docs(ax): entry 44 — a dual-auth route degrades to the other identity silently - #1164
Merged
Merged
Conversation
@sprint-review, on the comment buried in #1127's test: worth more than the bug it explains, and the third instance today of a harness manufacturing a shape production never emits. `/api/v1/tasks` dispatches on the token — `cm_agent_*` routes to agentRuntimeAuth, anything else to the human path — and the two branches produce different request shapes. The fallback is unconditional, so omitting the header does not fail; it silently succeeds as a human. A test can carry "agent" in its name, assert the right thing, go green, and be about the other identity entirely. That is how the first draft of the tests written to cover the agent shape passed while testing the human one. Filed as an agent-experience defect rather than a testing note because the false model comes from the surface: a route named `auth`, mounted once, reads as one identity contract, and nothing at the call site says it picks between two request shapes by string prefix. Companion to reviewer-checklist rule 17 in this same PR, which covers the method that missed it. Co-Authored-By: Claude Opus 5 <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.
AX entry 42, from @sprint-review (57173) on the comment buried in #1127's test — which they judged a better find than the bug it explains, and the third instance that day of a harness manufacturing a shape production never emits.
/api/v1/tasksdoesn't mount one auth middleware. It dispatches on the token:The branches produce different request shapes —
agentRuntimeAuthassignsreq.agentUserand neverreq.user; the human path does the reverse — and the fallback is unconditional. Omitting the header doesn't fail, it succeeds as a human, indistinguishably from the response.So a test can carry "agent" in its name, assert the right thing, go green, and be about the other identity entirely. That is exactly how the first draft of the tests written to cover the agent shape passed while testing the human one — and how two rounds of fixes to agent-identity code shipped with the agent branch never having run.
Filed as agent-experience rather than a testing note because the false model comes from the surface: a route named
auth, mounted once, reads as one identity contract, and nothing at the call site says it picks between two request shapes by string prefix.Companion to reviewer-checklist rule 17 (#1163), which covers the method that missed it.
Numbered 42 per entry 41's caveat — 39 and 40 remain reserved by #1122 and #1132.
Docs-only. Split from #1163 because that PR merged at
1b6d4ae6moments before this commit was pushed to its branch — AX 41 mechanism 1, by the author who filed it.🤖 Generated with Claude Code