Move CORA's background runtimes onto the door they actually arrive at - #765
Merged
Conversation
Thirty-five call sites across fifteen files still passed NIL_SENTINEL_ID as their arrival Surface. That resolves to the FRONT policy, which is bound to the HTTP door, so every one of them strict-denied at the surface check. On the live 2-BM deployment those were the overwhelming majority of shadow-mode near-misses, and they are the reason POLICY_POSTURE=enforce could not be turned on: enforcing today would darken the status page and stop the durable-copy sweep from registering finished scans. They now pass SYSTEM_IN_PROCESS_SURFACE_ID. conduit_id stays nil at the same sites deliberately, since that one resolves through trust_conduit_id and is a different axis. The status page also stops signing as SYSTEM_PRINCIPAL_ID, the fallback identity an unauthenticated HTTP request receives, and acts as the StatusPublisher agent #764 seeded for it. Twelve reads an interval that used to be attributed to nobody in particular now name the runtime that issued them. A new architecture test keeps it swept. It is an AST walk over `surface_id=` keyword bindings, not a grep: a grep would match the docstring in `in_process_grants` that quotes the very command used to find these sites, and the natural response to that misfire would be an exclusion that quietly weakens the check. Its allowlist is empty, and a second test asserts the file enumerator actually found files, so the parametrized case cannot pass vacuously over an empty list. ## What the sweep broke, and why that was the point `test_run_initiator_with_start_grant_starts_run` failed: its fixture policy takes seed_policy's default nil surface, so once the initiator moved doors the grant no longer matched and no Run was created. The test was right and the fixture was stale; both policies in that file now bind the in-process surface, exactly as the deployment's generated back-door rulebook does. Its companion `..._without_start_grant_is_denied_no_run` did NOT fail, and that was worse. Post-sweep it was refused at the surface check before the command check was ever reached, so it would have passed just as well with StartRun granted. A test that has silently stopped testing its own name is the failure this repo keeps re-learning. Binding its surface restores the refusal to the command grant, verified by granting StartRun and watching it fail. Co-Authored-By: Claude Sonnet 5 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
Part 4, the last code change in the plan behind #762 and #764. This is the one that removes the enforcement blocker.
The problem
35 call sites across 15 files still passed
NIL_SENTINEL_IDas their arrival Surface. That resolves to the FRONT policy, bound to the HTTP door, so every one strict-denied at the surface check.They now pass
SYSTEM_IN_PROCESS_SURFACE_ID.conduit_iddeliberately stays nil at the same sites — that axis resolves throughtrust_conduit_idand is a different question.The status page also stops signing as
SYSTEM_PRINCIPAL_ID(the fallback identity an unauthenticated HTTP request receives) and acts as theStatusPublisheragent #764 seeded for it.The test that keeps it swept
An AST walk over
surface_id=keyword bindings, not a grep. A grep would match the docstring inin_process_grantsthat quotes the very command used to find these sites, and the natural response to that misfire is an exclusion that quietly weakens the check. The allowlist is empty. A second test asserts the file enumerator actually found files, so the parametrized case cannot pass vacuously over an empty list.What the sweep broke, and why that was the point
test_run_initiator_with_start_grant_starts_runfailed. Its fixture policy takesseed_policy's default nil surface, so once the initiator changed doors the grant stopped matching and no Run was created. The test was right and the fixture was stale. Both policies in that file now bind the in-process surface, exactly as the deployment's generated rulebook does.Its companion did NOT fail, and that was worse.
..._without_start_grant_is_denied_no_runkept passing — but post-sweep it was refused at the surface check before the command check was ever reached, so it would have passed just as well withStartRungranted. It had silently stopped testing its own name. Binding its surface restores the refusal to the command grant, verified by grantingStartRunand watching it fail.Verification
55,349 unit + architecture + contract, 1,369 integration.
ruff,pyright,tachclean.Independently re-verified rather than inherited:
NIL_SENTINEL_IDinsrc/is thein_process_grantsdocstring, correctly untouched. In-process sites went 10 → 45.TrustAuthorizeintegration files callauthorize()directly with no surface argument, so port default and policy both sit at nil and stay self-consistent.Deploying this
Order matters, and it is not the obvious one:
Reversed, the callers move to a door with no rules and simply fail differently: "not on the list" instead of "wrong door".
POLICY_POSTUREstaysshadowthroughout; enforcement remains a separate decision after step 4 reads clean.Process
Implemented by a Sonnet subagent from a scoped brief; it stopped mid-verification without reporting, so the contract and integration tiers, both mutation checks, the grant-table cross-check, and the two test fixes above are mine.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com