Draw the graph, route on history, and test policy against history - #56
Merged
Merged
Conversation
The three places the doctrine was still ahead of the code. 1. The graph was ASCII. It is supposed to be the visual model of execution authority, and it is what a developer sees in the first sixty seconds. pctr graph --svg draws principal -> agents -> tools -> actions: agents carry framework, live trust and a clock mark when evidence is stale, actions are coloured by severity and marked when they are a protected consequence, and naming an action draws its selected route in green with everything else dimmed. Standalone SVG — no fonts, no scripts, no network — so it drops into a README. Every graph carries an aria-label describing the route in words. I rendered it to PNG and looked at it: the first two passes had tofu boxes where the brand fonts have no arrow or clock glyph, so those are drawn as paths now, and the legend no longer overlaps itself. 2. Routing ignored what happened. resolveRoute now takes accumulated history and prefers routes that work. The constraint that matters: history only reorders routes that already passed every admissibility check. A flawless record buys no authority — there is a test that gives an unauthorized agent twenty clean receipts and asserts it still cannot route. 3. No way to test a policy against reality. pctr whatif re-decides every recorded receipt under a proposed policy, executing nothing, and exits non-zero when a change would loosen anything, so it gates policy edits in CI. Writing its test surfaced something worth stating: raising an approval threshold cannot unlock a CRITICAL consequence, because severity comes from what the action can cause, not from the rule that reads it. That is now its own test. 167 tests (11 new). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
The three places the doctrine was still ahead of the code.
1. The graph was ASCII
It is supposed to be the visual model of execution authority — and it is what a developer sees in the first sixty seconds.
pctr graph --svg pctr graph --svg route.svg payments.transfer # with the selected route drawnColumns run principal → agents → tools → actions. Agents carry framework, live trust and a clock mark when evidence is stale; actions are coloured by severity and marked
!when protected; naming an action draws its route in green and dims the rest. Standalone SVG — no fonts, no scripts, no network.Every graph carries an
aria-labeldescribing the route in words. I rendered it to PNG and actually looked at it: the first two passes had tofu boxes where the brand fonts have no arrow or clock glyph, so those are drawn as paths now, and the legend no longer overlaps itself.2. Routing ignored what happened
resolveRoutenow accepts accumulated history and prefers routes that work.The constraint that matters: history only reorders routes that already passed every admissibility check. A flawless record buys no authority. There's a test that hands an unauthorized agent twenty clean receipts and asserts it still cannot route — optimization happens after admissibility, never instead of it.
3. No way to test a policy against reality
pctr whatif --policy '{"approvalThresholds":{"amount":25000}}'Nothing executes — each recorded receipt is re-decided under the proposed policy. Exits non-zero when a change would loosen anything, so it gates policy edits in CI.
Writing its test surfaced something worth stating outright, and it's now its own test: raising an approval threshold cannot unlock a CRITICAL consequence, because severity comes from what the action can cause, not from the rule that reads it.
Verification
167 tests (11 new), Python 19, AGT parity green at 52 checks.
🤖 Generated with Claude Code