fix(intercept): name the sessionId namespace in ledger deny hints#307
Merged
Conversation
The ledger-gate deny "To satisfy" hint showed the session id value but did not name which namespace it is. An entry written under the agent-tasks task UUID never satisfies a harness runtime gate, which keys off the runtime session id. That ambiguity caused a production failure (2026-05-17, harness PRs #174/#175: first attempt used the task UUID and was rejected, second used the session id and passed). The hint now reads "..., under this runtime session's id `<id>` (not the agent-tasks task UUID)". Naming an identity is not a producer verb, so it keeps the deny path neutral on producer choice (agent-tasks/88ca4bb3). Adds a focused, mutation-checked test asserting both the required tag and the namespace clause are present; updates the two tests that pinned the old string; adds a CHANGELOG [Unreleased] entry for the message-format change. Refs: discovery-2026-06-24/ledger-deny-namespace-hint (cdc60d56) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Ledger-gate deny "to satisfy" hints now name the sessionId namespace the unblocking ledger entry must be written under.
Why
Two ledger namespaces exist: the runtime session id (harness runtime MCP gates) and the agent-tasks task UUID (the CI merge-approval GitHub Check). The deny hint showed the session id value but never named which namespace it was, so an agent holding both a session id and a task UUID could write under the wrong one. An entry under the task UUID never satisfies a harness runtime gate, which reads, writes, and hints under the same
resolveSessionIdvalue. This caused a real production failure (2026-05-17, PRs #174/#175): the first write under the task UUID was rejected, the second under the session id passed.How
src/runtime/intercept.ts: thehintSuffixnow names the namespace identity. Naming an identity is not a producer verb, so the deny path stays neutral on producer choice (agent-tasks/88ca4bb3); therecordHintcontract insrc/policies/requires.tsis unchanged.ux:agent-facing path and the sibling understanding-gate denies are out of scope (different surface, and no task-UUID ambiguity there).Tests / verification
Review
Independent reviewer subagent: APPROVE (accept_with_notes), no high or critical findings. The one in-scope low finding (missing CHANGELOG entry) is addressed; the wording nit is applied.
Refs: discovery-2026-06-24/ledger-deny-namespace-hint (cdc60d56)