Skip to content

docs: gate tests ship with a recorded mutation result (#834) - #835

Merged
admarble merged 1 commit into
mainfrom
docs/834-gate-test-mutation-convention
Jul 29, 2026
Merged

admarble merged 1 commit into
mainfrom
docs/834-gate-test-mutation-convention

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Adopts one convention in CLAUDE.md, from #830's second look:

Gate tests ship with a recorded mutation result. A test whose job is to gate a claim — a fixture exists, a skill section is present, a flag is wired — must be mutation-verified before it counts as coverage: delete the thing it asserts, confirm exactly that test fails, restore, and record the result in the commit message or PR body. Scope file-reading assertions to the delimited region they mean to check; matching the whole file lets a doc header or comment satisfy the assertion.

Why now. In #830, trust-model-skill.test.ts asserted that the prompt-injection fixture hid an agent-directed instruction, using a pattern matched against the whole file. The fixture's own explanatory header necessarily quotes run/env/POST while describing the payload, so it satisfied the assertion — deleting the real payload line left the suite at 16/16 green. The one thing that CI gate existed to hold, it did not hold.

Why a convention and not tooling. #834 covers the deterministic half (a lint over the skill's own enforcement chain). An auto-mutating harness for file-reading gate tests is buildable — there are now four such tests — but is deliberately deferred there until a third case demands it. Mutation-verifying by hand took about two minutes for four assertions in #830, so the convention is cheap enough to be worth stating before the tooling exists.

Docs-only. Related: #834, #830, #819.

Adopts the convention from #830's second look, where a CI gate assertion
matched the whole fixture file instead of its delimited payload span — the
fixture's own explanatory header satisfied it, so deleting the real payload
left the suite green.

Stated as a convention rather than tooling: #834 covers the deterministic
lint for skill enforcement chains, and a mutation harness for file-reading
gate tests should wait until there is a third such test to justify it.

Entire-Checkpoint: e0c289d6e717
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