feat(agency-tools): directive usage report, and reach the experimental store - #160
Merged
Conversation
added 3 commits
August 16, 2026 18:58
Counts incidence, per-surface and per-verb totals, outcomes and per-day activity over a closed window, from the rows the app already writes where it parses and applies a directive. Reading those rows rather than re-matching prose keeps one parser in the system: a second pattern would drift from the real one and report a surface the app does not implement. The window has two named constants and both are empty, so an unset window is a refusal rather than a silently chosen span. --start and --end override them for a one-off run. --blinded substitutes every verb through a fixed table and drops identifying strings, for output that must not be searchable back to this project. Surface names and dates pass through unchanged; they are generic and they are the point of the table. Two things the source data settles rather than the reader guessing: directives.rs has exactly two terminal outcomes, applied and refused, so the normalized bucket is a structural zero rather than a synthesised third state, and an outcome outside that set is counted as failed under an unrecognized code so a new arm surfaces instead of vanishing into a total. Directives that parsed but reached no terminal record are reported as a count, not hidden by an assertion that would abort the run. The table this reads is untouched: no new columns, no new table, no migration on a single-writer store.
The store directory was resolved from a hardcoded standard bundle identifier, so a machine running the experimental window had its data reachable only by passing AZ_DATA_DIR by hand. The failure is quiet and wrong rather than loud: the standard store exists and reads fine, so the tool reports another profile's numbers as if they were this profile's. AZ_PROFILE=experimental picks the other identifier and resolves it through the same three-step order the GUI uses, pointer file included.
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.
Adds
ps-usage-reportto the read-only CLI: incidence, per-surface and per-verb counts, outcomes and per-day activity over a closed window, read from the rows the app already writes at its parse and apply boundaries. No second parser, no new table, no schema change.The window constants are empty by default so an unset window refuses rather than silently choosing a span.
--start/--endoverride for a one-off run.--blindedmaps every verb through a fixed table and drops identifying strings.Also fixes store resolution: the directory came from a hardcoded standard bundle identifier, so an experimental profile's data was reachable only by passing
AZ_DATA_DIRby hand, and the default quietly reported the wrong profile's numbers.AZ_PROFILE=experimentalresolves the other identifier through the same three-step order the GUI uses.11 new tests cover once-per-turn counting, the inclusive window end, determinism and the blinded-output assertions. Workspace clippy
-D warningsclean, all suites pass, one-rev guard passes.0.8.8.
🤖 Generated with Claude Code