Skip to content

Commit c21e862

Browse files
test: address corpus review nits (typed coverage list, cap rationale, derived-citation note)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 09a0557 commit c21e862

2 files changed

Lines changed: 22 additions & 11 deletions

File tree

‎test/replay-compat/README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ surface, and `provenance` pins the bytes:
5555
checked-in bytes and must reproduce that id, so a rewritten script cannot be made green by editing
5656
the manifest to match — the id is only obtainable from the released content.
5757
- `derived` entries (`scripts/docs/`) have no historical blob to point at, so their bytes are pinned
58-
by SHA-256.
58+
by SHA-256. Only the bytes are machine-checked: the `from` citation naming the released grammar or
59+
doc that emitted the surface is **reviewer-verified**, so a derived entry has to be reviewed against
60+
its cited source at that tag (`git show <tag>:<path>`) before it lands. Never hand-transcribe a
61+
hint or a form — copy it from the release.
5962

6063
The kind is not a free choice: `provenance-rules.ts` fixes it by corpus area (`scripts/integration/`
6164
and `scripts/examples/` must stay `mined`, `scripts/docs/` is `derived`), so an edited script cannot

‎test/replay-compat/corpus.test.ts‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,21 @@ import { findProvenanceKindViolations, requiredProvenanceKind } from './provenan
1616
const CORPUS_DIR = fileURLToPath(new URL('.', import.meta.url));
1717

1818
/**
19-
* Every historical surface the corpus exists to hold still. A coverage tag with
20-
* no entry means the corpus stopped covering a compat surface #1417 named.
19+
* Every historical surface the corpus exists to hold still. Keyed by the coverage
20+
* union so the typechecker — not a hand-kept list — forces a new surface to be
21+
* required here; a tag with no entry means the corpus stopped covering a compat
22+
* surface #1417 named.
2123
*/
22-
const REQUIRED_COVERAGE: ReplayCompatCoverage[] = [
23-
'context-header',
24-
'env-vars',
25-
'quoting',
26-
'retired-gesture',
27-
'target-annotation',
28-
'wait-landmark',
29-
];
24+
const REQUIRED_COVERAGE_KEYS: Record<ReplayCompatCoverage, true> = {
25+
'context-header': true,
26+
'env-vars': true,
27+
quoting: true,
28+
'retired-gesture': true,
29+
'target-annotation': true,
30+
'wait-landmark': true,
31+
};
32+
33+
const REQUIRED_COVERAGE = Object.keys(REQUIRED_COVERAGE_KEYS) as ReplayCompatCoverage[];
3034

3135
function readCorpusScript(entry: ReplayCompatEntry): Buffer {
3236
return readFileSync(join(CORPUS_DIR, entry.file));
@@ -133,6 +137,10 @@ describe('replay-compat corpus', () => {
133137
// say which form or refusal it is the sole witness of, and the count stays a
134138
// reviewable set of deliberate entries rather than a mirror of the replay
135139
// fixtures. Raising the ceiling is allowed; doing it silently is not.
140+
//
141+
// 30 is headroom over the 22 witnesses the shipped grammar needs today: enough
142+
// for the next few retirements without another pruning pass, small enough that
143+
// a re-mirrored fixture tree (52 entries at first cut) cannot land quietly.
136144
test('every entry states why it exists, and the corpus stays small', () => {
137145
for (const entry of REPLAY_COMPAT_CORPUS) {
138146
expect(entry.note.trim(), entry.id).not.toBe('');

0 commit comments

Comments
 (0)