fix(agency-tools): correct the event unit, and formatting - #161
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 notparsed, soqueuedandcompletedeach 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
parsedrow, named inEVENT_STAGEand 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_eventsasserts surfaces = verbs = per-day, and outcomes + unresolved = events. The fixture now carries thequeuedrow 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 oncargo fmt --all --check.0.8.9. 29 tests pass, clippy
-D warningsclean, fmt clean, one-rev guard passes.🤖 Generated with Claude Code