Skip to content

docs(review): a mutation proves a term matters to the suite, not that the suite is real - #1163

Merged
lilyshen0722 merged 1 commit into
mainfrom
docs/mutation-cannot-validate-the-harness-shape
Aug 23, 2026
Merged

docs(review): a mutation proves a term matters to the suite, not that the suite is real#1163
lilyshen0722 merged 1 commit into
mainfrom
docs/mutation-cannot-validate-the-harness-shape

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Reviewer-checklist rule 17, from @sprint-review's account (57167) of how they missed the dead identity term — which they judged worth more than the miss, and it is: the method that produced the wrong answer is the one everybody trusts.

The failure

They dropped req.user?.username, saw exactly one test go red, and reported the term as load-bearing. It is — in the harness. tasksApi.updateRenewsLease.test.js:32 builds the auth object inline from a test header:

req.user = { id: req.userId, _id: req.userId,
             username: req.get('x-test-username') || undefined,
             isBot: Boolean(req.get('x-test-username')) };
next();
});
jest.mock('../../../middleware/agentRuntimeAuth', () => (req, res, next) => next());

That last line is the loud tell. The real middleware assigns req.agentUser — at :102 and :191, and nowhere else — so the shape under discussion isn't merely unexercised, it's deliberately excluded. Every mutation result was valid; every conclusion was about a world that does not exist.

The closing check is one line and orthogonal to the mutation: grep what the real middleware assigns, and confirm the harness produces that shape.

The corollary, which is why this isn't just a process note

The obvious fix is a regression. resolveHolder loads the holder's User row only when claimedBy matches /^[0-9a-f]{24}$/. Make resolveAgentInstanceId fire on the agent path and claimedBy becomes a bare instanceId string → holder is null → agentName is '' → the AgentInstallation lookup loses its narrowing and label degrades to the raw key. A prettier column, a weaker liveness check.

So: a term found dead this way is often dead in the safe direction — confirm what reviving it would do before calling it a bug.

Docs-only.

Post-merge note. This body briefly described a second entry (AX 42, the dual-auth silent fallback). That commit was pushed to this branch moments after the squash-merge and never belonged to this PR — it is now #1164. Restored to describe what actually merged here.

🤖 Generated with Claude Code

… the suite is real

@sprint-review's own account of how they missed the dead identity term, which
they judged worth more than the miss — and it is, because the method that
produced the wrong answer is the one everybody trusts.

They dropped `req.user?.username`, saw exactly one test go red, and reported
the term as load-bearing. It is: in the harness. That fixture builds
`req.user = { id, _id, username, isBot }` from a test header and mocks
`agentRuntimeAuth` into a bare `next()` one line below — so the shape
production's agent path actually produces (`req.agentUser`, assigned at
`:102`/`:191` and nowhere else) is not merely unexercised, it is deliberately
excluded. Every mutation result was valid and every conclusion was about a
world that does not exist.

The closing check is one line and orthogonal to the mutation: grep what the
real middleware assigns, and confirm the harness produces that shape.

Also records the corollary, because the obvious fix here is a regression.
`resolveHolder` loads the holder's User row only when `claimedBy` is 24-hex,
so making the resolver fire on the agent path would null the holder, empty
the `agentName` narrowing on the install lookup, and degrade lease-rescue
liveness — to buy a more readable column. The term is dead in the safe
direction.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@lilyshen0722
lilyshen0722 merged commit 1b6d4ae into main Aug 23, 2026
10 checks passed
@lilyshen0722
lilyshen0722 deleted the docs/mutation-cannot-validate-the-harness-shape branch August 23, 2026 05:08
@lilyshen0722 lilyshen0722 changed the title docs(review): a mutation proves a term matters to the suite, not that the suite is real docs: the harness shape rule — reviewer rule 17 + AX 42 Aug 23, 2026
@lilyshen0722 lilyshen0722 changed the title docs: the harness shape rule — reviewer rule 17 + AX 42 docs(review): a mutation proves a term matters to the suite, not that the suite is real Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant