Skip to content

fix(agency-tools): correct the event unit, and formatting - #161

Merged
pathscale merged 2 commits into
masterfrom
fix/fmt-ps-usage
Aug 16, 2026
Merged

fix(agency-tools): correct the event unit, and formatting#161
pathscale merged 2 commits into
masterfrom
fix/fmt-ps-usage

Conversation

@pathscale

Copy link
Copy Markdown
Owner

Two counting bugs in ps-usage-report, both visible as exact multiples in the trial output.

A directive writes three rows: parsed, queued, completed. The outcome tally counted every row that was not parsed, so queued and completed each scored: outcomes came back at exactly 2x the event total (1046 vs 523). The per-day tally counted every directive row whatever its stage: exactly 3x (1569).

One event is now one parsed row, named in EVENT_STAGE and counted in a single block so the surface, verb and per-day tables cannot drift apart. Outcomes come only from the terminal stage. All four totals now agree at 523.

every_table_totals_the_same_number_of_events asserts surfaces = verbs = per-day, and outcomes + unresolved = events. The fixture now carries the queued row that caused this, so the old behaviour fails the test.

Also formats ps_usage.rs, which was written with in-place regex rewrites and turned CI red on cargo fmt --all --check.

0.8.9. 29 tests pass, clippy -D warnings clean, fmt clean, one-rev guard passes.

🤖 Generated with Claude Code

meh added 2 commits August 16, 2026 19:16
The file was written with in-place regex rewrites, which produced code rustfmt
rejects. CI runs cargo fmt --all --check, so that turned the build red and
stopped the release.
A directive writes three rows: parsed, queued, then completed. The outcome
tally counted every row that was not parsed, so queued and completed each
scored and the outcome total came back at exactly twice the event total. The
per-day tally counted every directive row whatever its stage, so it came back
at exactly three times.

One event is now one parsed row, named in EVENT_STAGE and counted in a single
block, so the surface, verb and per-day tables cannot drift apart again.
Outcomes come only from the terminal stage.

The new test asserts all four totals agree, and the fixture carries the queued
row that made the arithmetic wrong, so the old behaviour fails it.
@pathscale
pathscale merged commit 6fb10ed into master Aug 16, 2026
2 checks passed
@pathscale
pathscale deleted the fix/fmt-ps-usage branch August 16, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant