Repository navigation
test(runtime): pin that an unknown metadata.taskless key is tolerated - #244
Conversation
The generator asked whether a capture survives discovery with an unrecognised key under `metadata.taskless`, before depending on it. The answer is yes, and the honest form of that answer is that it works by ACCIDENT: `assessCaptureRule` checks the fields it needs and never rejects the ones it does not know, and ast-grep treats `metadata` as opaque. Neither is a decision anyone wrote down, so neither was a promise. Verified end to end before claiming it — a capture carrying `metadata.taskless.note` passes `verify` AND still fires under `check`, which is the assertion that matters. A dropped capture verifies clean and finds nothing, and finding nothing is what a passing run looks like. This test holds the tolerance in place. The generator writes a demonstration disclaimer into the rule rather than only into the HTTP response, because a note in an envelope is gone the moment the rule reaches disk — which is exactly when a reader with no memory of asking for a demo needs to know what it is. Confirmed it bites by making the assessor reject unknown keys, the way a schema-based rewrite plausibly would: it fails, and passes again when restored.
|
@claude /review |
|
Claude finished @theCodeDrift's task in 2m 17s —— View job Review complete
Review mode: incremental — read 0 prior review thread(s) before reviewing. Scope: one file, Verification performed against the actual source (this PR touches no source, only a test, so I read the code the test claims to pin):
No correctness, security, or test-adequacy issues found. The test is well-targeted: it purposefully asserts on matches produced, not just rule discovered, which is exactly the distinction the PR description calls out as the one that matters (a dropped capture also "passes" a discovery-only check). One minor, non-blocking observation (not filed inline — too small to be worth a thread): I found nothing NEW to raise beyond that non-blocking note, and there was nothing prior to reconcile against. |
Acknowledged, and declining the non-blocking Thanks for verifying the claim against — AI Coding Agent |
Answers a question the generator team asked before depending on the behaviour, which is the right order.
The question
Their demo carries a disclaimer inside the rule as
metadata.taskless.note, rather than only in the HTTP response — because a note in an envelope is gone the moment the rule reaches disk, which is exactly when a reader with no memory of asking for a demo needs to know what it is.Does our discovery tolerate that, or drop the capture?
The answer, and why it needed pinning
It is tolerated — and it works by accident.
assessCaptureRulechecks the fields it needs and never rejects the ones it does not know; ast-grep treatsmetadataas opaque. Neither is a decision anybody wrote down, so neither was a promise anyone could rely on.Verified end to end before claiming it: a capture carrying the key passes
verifyand still fires undercheck. That second half is the one that matters. A dropped capture verifies clean and finds nothing, and finding nothing is indistinguishable from a passing run — the failure mode this whole contract exchange kept turning up.What this adds
One test asserting the capture is discovered and that it still matches, not merely that discovery accepted it.
Confirmed it bites by making the assessor reject unknown keys, the way a schema-based rewrite plausibly would: it fails, and passes again when restored. That is the realistic way this breaks — nobody would delete the tolerance deliberately, they would tighten validation and not notice what it cost.
Why it belongs here rather than in a comment
The rule both sides converged on during the payload alignment work is that a claim about the other repository has to be checkable from this one. "We tolerate unknown metadata keys" is exactly such a claim. Answering it in prose would have been the same shape as the seven stale layout comments: true when written, unenforced afterwards.