@mmnto/cli 1.83.0 → 1.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,44 @@
1
+ import type { AuthoredControlsDeps, GroundTruthLabel, ResolvedPrDiff, SplitArtifact, Stage4VerifierDeps } from '@mmnto/totem';
2
+ import type { CertifyingCorpus } from './spine-windtunnel.js';
3
+ export interface BuildAuthoredCertifyingCorpusDeps {
4
+ /** `.totem` dir holding `spine/authored-rules.yaml` + the authoring-ledger. */
5
+ totemDir: string;
6
+ /**
7
+ * The splitRef THIS cert run is bound to (ADR-110 §6). Every authored record's
8
+ * authoring split (file header → authoring-ledger entry) MUST equal this, or the
9
+ * rules were authored under a DIFFERENT split — the run is voided BEFORE compile
10
+ * (codex finding 4: `deriveAuthoredControls`'s train-side fixture check ALONE is
11
+ * insufficient for leakage; the file/ledger split-binding is the load-bearing guard).
12
+ */
13
+ expectedSplitRef: string;
14
+ /** The frozen split (the §5 leakage gate + `deriveAuthoredControls` train-side check). */
15
+ split: SplitArtifact;
16
+ /** Resolved-PR diffs — the producer-independent scoring substrate (passed through). */
17
+ prDiffs: ResolvedPrDiff[];
18
+ /** Frozen ground-truth labels keyed by firingLabelId (passed through). */
19
+ groundTruth: Map<string, GroundTruthLabel>;
20
+ /** Stage-4 verifier deps (listFiles/readFile) for the compile stage. */
21
+ stage4: Stage4VerifierDeps;
22
+ /** Injected timestamp (Tenet 15 determinism — no `new Date()` in the pipeline). */
23
+ now: string;
24
+ /** Optional §4 differential-evaluator injection for `deriveAuthoredControls` (defaults to the real one). */
25
+ authoredControlsDeps?: AuthoredControlsDeps;
26
+ }
27
+ /**
28
+ * Assemble an AUTHORED `CertifyingCorpus` from `.totem/spine/authored-rules.yaml`.
29
+ *
30
+ * Pipeline: `runRuleAuthor` (preserving ALL §3/§8 producer invariants — strict
31
+ * authored-file shape, recursive producer-owned-key rejection, independent
32
+ * structural-eligibility, stable id mint/reuse, fail-loud dup-identity, ledger
33
+ * append/read-back, `judgedBy`≠author) → `rejected.length === 0` precondition →
34
+ * file/ledger split-binding verification (BEFORE compile) → `toCompileFeed` →
35
+ * `runCompileStage` (authored compile-rejection = HARD failure) → homogeneous
36
+ * authored-provenance assembly from the `c.provenance` SIDECAR (never
37
+ * `rule.legitimacy`) → `deriveAuthoredControls`.
38
+ *
39
+ * Pure of its own IO except the producer's authoring-ledger read/append (behind
40
+ * `runRuleAuthor`) — `stage4`/diffs/ground-truth are injected, so it is fully
41
+ * testable with a real temp `.totem` dir + fakes (no LLM, no network, no real git).
42
+ */
43
+ export declare function buildAuthoredCertifyingCorpus(deps: BuildAuthoredCertifyingCorpusDeps): Promise<CertifyingCorpus>;
44
+ //# sourceMappingURL=spine-authored-cert-corpus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spine-authored-cert-corpus.d.ts","sourceRoot":"","sources":["../../src/commands/spine-authored-cert-corpus.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,oBAAoB,EAEpB,gBAAgB,EAEhB,cAAc,EACd,aAAa,EACb,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,WAAW,iCAAiC;IAChD,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAC;IAKjB;;;;;;OAMG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,0FAA0F;IAC1F,KAAK,EAAE,aAAa,CAAC;IACrB,uFAAuF;IACvF,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,0EAA0E;IAC1E,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC3C,wEAAwE;IACxE,MAAM,EAAE,kBAAkB,CAAC;IAC3B,mFAAmF;IACnF,GAAG,EAAE,MAAM,CAAC;IACZ,4GAA4G;IAC5G,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,iCAAiC,GACtC,OAAO,CAAC,gBAAgB,CAAC,CAiN3B"}
@@ -0,0 +1,173 @@
1
+ // ─── ADR-112 §6/§9 Slice D1 — the AUTHORED certifying-corpus assembler ───────
2
+ //
3
+ // The SIBLING of the mined `buildCertifyingCorpus` (spine-cert-corpus.ts), NOT a
4
+ // branch inside it: the mined assembler's extract→classify deps (source / extractor
5
+ // / classifier) are irrelevant to an authored run, so a shared function would do two
6
+ // disjoint jobs (Tenet-9 anti-shape). This assembler runs the AUTHORED producer
7
+ // (`runRuleAuthor` → `toCompileFeed` → `runCompileStage`) over the SAME one G-series
8
+ // compiler, then assembles a `CertifyingCorpus` whose `authoredControls` channel is
9
+ // derived from the §6 emission builder. The mined path stays BYTE-UNCHANGED.
10
+ //
11
+ // D1 is INERT: nothing in scoring/persist/report consumes `authoredControls` yet
12
+ // (D3/D4 do). The leakage / rejected / compile / mixed-provenance / duplicate throws
13
+ // are assembly CONTRACT guards (fail-loud, Tenet-4) — NOT behind a feature flag.
14
+ /**
15
+ * Assemble an AUTHORED `CertifyingCorpus` from `.totem/spine/authored-rules.yaml`.
16
+ *
17
+ * Pipeline: `runRuleAuthor` (preserving ALL §3/§8 producer invariants — strict
18
+ * authored-file shape, recursive producer-owned-key rejection, independent
19
+ * structural-eligibility, stable id mint/reuse, fail-loud dup-identity, ledger
20
+ * append/read-back, `judgedBy`≠author) → `rejected.length === 0` precondition →
21
+ * file/ledger split-binding verification (BEFORE compile) → `toCompileFeed` →
22
+ * `runCompileStage` (authored compile-rejection = HARD failure) → homogeneous
23
+ * authored-provenance assembly from the `c.provenance` SIDECAR (never
24
+ * `rule.legitimacy`) → `deriveAuthoredControls`.
25
+ *
26
+ * Pure of its own IO except the producer's authoring-ledger read/append (behind
27
+ * `runRuleAuthor`) — `stage4`/diffs/ground-truth are injected, so it is fully
28
+ * testable with a real temp `.totem` dir + fakes (no LLM, no network, no real git).
29
+ */
30
+ export async function buildAuthoredCertifyingCorpus(deps) {
31
+ const { toCompileFeed, runCompileStage, deriveAuthoredControls, isAuthoredProvenance, provenanceKind, readAuthoringLedger, sanitizeForTerminal, TotemError, } = await import('@mmnto/totem');
32
+ const { runRuleAuthor } = await import('../authored-rule-intake.js');
33
+ // Escape every authored/ledger-derived value before it lands in CLI-facing TotemError
34
+ // text: authored fields (author / targetDefect / reason / splitRef) are free-text from
35
+ // the authored YAML and could carry ANSI/control bytes (terminal injection — CR outside-
36
+ // diff). Applied uniformly via `safe` so all error strings are consistently escaped (a
37
+ // no-op on the minted-hex ids, but it keeps the "all CLI error text sanitized" invariant).
38
+ const safe = sanitizeForTerminal;
39
+ // 0. Derive the §8 single-source `judgedBy` from the authoring-ledger (NOT the lock —
40
+ // strategy couple-on-D ruling 2026-06-30 (iii): a run-level judgedBy on the lock is a
41
+ // second source for a fact §8 already owns per-rule = the Tenet-20 mirror, #787). The
42
+ // ledger MUST pre-exist — authoring (`totem rule author`) records each rule's §3 judgedBy
43
+ // before a cert run reads it; a cert run is NOT the first author. For cert 1 the §3 check
44
+ // is one static whitelist, so judgedBy is uniform across the set; a mixed-check ledger is
45
+ // ambiguous ("which is THE run's check?") → fail loud (single-check cert; multi-check is
46
+ // an ADR-112 Deferred Decision). This is the source the step-1 re-run + the step-3 per-
47
+ // record assert-equal both bind to (never a freshly-substituted value — strategy's drift guard).
48
+ const priorLedger = readAuthoringLedger(deps.totemDir);
49
+ if (priorLedger.length === 0) {
50
+ throw new TotemError('GATE_INVALID', 'Authored cert corpus: the authoring-ledger is empty — there are no authored rules to certify.', 'Run `totem rule author` to author + record rules (with their §3 judgedBy) before the cert run.');
51
+ }
52
+ const priorEffective = new Map();
53
+ for (const entry of priorLedger)
54
+ priorEffective.set(entry.ruleId, entry);
55
+ const judgedBys = new Set([...priorEffective.values()].map((e) => e.structuralEligibility.judgedBy));
56
+ if (judgedBys.size !== 1) {
57
+ throw new TotemError('GATE_INVALID', `Authored cert corpus: the authoring-ledger records ${judgedBys.size} distinct judgedBy values ` +
58
+ `(${safe([...judgedBys].join(', '))}) — a single cert run binds ONE §3 eligibility check.`, 'Certify a single-check authored set (multi-check corpora are out of scope for cert 1, ADR-112 Deferred Decisions).');
59
+ }
60
+ const judgedBy = [...judgedBys][0];
61
+ // 1. Produce the authored records under the LEDGER-SOURCED judgedBy (idempotent re-derive —
62
+ // the ledger already records this verdict, so an equal contentHash ⇒ no new row). The
63
+ // producer establishes eligibility/identity/ledger; NEVER construct AuthoredRuleRecord[]
64
+ // ad hoc or read YAML→record here.
65
+ const authorResult = runRuleAuthor(deps.totemDir, { judgedBy });
66
+ // 2. rejected.length === 0 precondition: a partially-invalid authored file is broken
67
+ // cert input — never certify the eligible subset (fail loud, not a partial corpus).
68
+ if (authorResult.rejected.length > 0) {
69
+ const summary = authorResult.rejected
70
+ .map((r) => `(${safe(r.author)} · ${safe(r.targetDefect)}: ${safe(r.reason)})`)
71
+ .join('; ');
72
+ throw new TotemError('GATE_INVALID', `Authored cert corpus: ${authorResult.rejected.length} authored rule(s) were rejected by the ` +
73
+ `structural-eligibility check — ${summary}`, 'Fix or remove the rejected rules; a certifying run must not certify the eligible subset of a ' +
74
+ 'partially-invalid authored file (ADR-112 §3).');
75
+ }
76
+ const records = authorResult.records;
77
+ if (records.length === 0) {
78
+ throw new TotemError('GATE_INVALID', 'Authored cert corpus: runRuleAuthor produced zero eligible authored records.', 'Declare ≥1 structurally-decidable authored rule in .totem/spine/authored-rules.yaml (ADR-112 §3).');
79
+ }
80
+ // 3. Verify the file/ledger SPLIT-BINDING before compile: every materialized record
81
+ // MUST have been authored under THIS cert run's split. This is the §5 leakage guard
82
+ // `deriveAuthoredControls`'s train-side fixture check alone cannot cover (codex
83
+ // finding-4) — `splitRef` is the run-binding the FILE does not self-enforce.
84
+ // The §5 embargo attestations themselves (`authoredAfterSplit`,
85
+ // `heldOutNonInspectionAttestation`) are NOT re-checked here: `AuthoredRulesFileSchema`
86
+ // types them as `z.literal(true)`, so `runRuleAuthor` rejects any file lacking them
87
+ // BEFORE this point — a runtime re-check would be an unreachable branch (CR; bot-
88
+ // finding reachability). The ledger entry only exists because the file already passed.
89
+ const ledger = readAuthoringLedger(deps.totemDir);
90
+ const effectiveByRuleId = new Map();
91
+ for (const entry of ledger)
92
+ effectiveByRuleId.set(entry.ruleId, entry);
93
+ for (const record of records) {
94
+ const entry = effectiveByRuleId.get(record.ruleId);
95
+ if (entry === undefined) {
96
+ throw new TotemError('GATE_INVALID', `Authored cert corpus: no authoring-ledger entry for rule '${safe(record.ruleId)}' — the §8 ` +
97
+ 'attestation chain is missing its split-binding.', 'Re-author the rule so the ledger records its splitRef + attestations (ADR-112 §8).');
98
+ }
99
+ if (entry.splitRef !== deps.expectedSplitRef) {
100
+ throw new TotemError('GATE_INVALID', `Authored cert corpus: rule '${safe(record.ruleId)}' was authored under split '${safe(entry.splitRef)}', but ` +
101
+ `this cert run is bound to split '${safe(deps.expectedSplitRef)}' — the rules were authored under a ` +
102
+ 'different split (ADR-112 §5 leakage guard).', 'Re-author against the current frozen split, or run the cert against the split the rules were authored under.');
103
+ }
104
+ // judgedBy assert-equal (strategy ruling 2026-06-30 (iii)): `judgedBy` was DERIVED from the
105
+ // ledger's §8 record (step 0), and the step-1 re-run carried it — so this asserts the
106
+ // post-re-run effective row STILL carries that single §8 value, never a silently-substituted
107
+ // one. It backstops the §8 single-source invariant: a divergent verdict reaching the cert
108
+ // corpus (e.g. a re-run that appended a row under a different check) fails loud, Tenet 4.
109
+ if (entry.structuralEligibility.judgedBy !== judgedBy) {
110
+ throw new TotemError('GATE_INVALID', `Authored cert corpus: rule '${safe(record.ruleId)}' carries judgedBy ` +
111
+ `'${safe(entry.structuralEligibility.judgedBy)}', but this cert run binds the ledger-sourced ` +
112
+ `judgedBy '${safe(judgedBy)}' — the §8 eligibility verdict diverged (ADR-112 §3/§8).`, 'Re-author the set under one §3 eligibility check; a cert run binds a single judgedBy.');
113
+ }
114
+ }
115
+ // 4. Compile via the ONE G-series compiler (authored producer). toCompileFeed builds
116
+ // the exact CompileStageInput shape; runCompileStage runs Stage-3/4.
117
+ const feed = toCompileFeed(records);
118
+ const compileResult = await runCompileStage({ candidates: feed.candidates, classifierLedger: feed.classifierLedger }, { stage4: deps.stage4, now: deps.now });
119
+ // Authored compile-rejection = HARD failure: an authored record reaching compile and
120
+ // being rejected (e.g. per-engine ReDoS validation) is BROKEN cert input, not mined
121
+ // noise — fail before emitting an incomplete controls set.
122
+ const rejectedRefs = compileResult.classifierLedger.entries
123
+ .filter((e) => e.stage4Outcome === 'compile-rejected')
124
+ .map((e) => e.candidateRef);
125
+ if (rejectedRefs.length > 0) {
126
+ throw new TotemError('GATE_INVALID', `Authored cert corpus: ${rejectedRefs.length} authored candidate(s) were rejected at compile ` +
127
+ `(${safe(rejectedRefs.join(', '))}) — an authored record must compile cleanly (ADR-112 §2).`, "Fix the authored rule's dslSource so it compiles under its declared engine.");
128
+ }
129
+ // Exclude Stage-4 out-of-scope (archived) rules from the scored set — archived ≠
130
+ // wind-tunnel FP (fold-F throws if one reaches firing); their provenance drops with
131
+ // them. Mirrors the mined assembler's binding-2 (a distinct axis from compile-rejection).
132
+ const scored = compileResult.compiled.filter((c) => c.rule.status !== 'archived');
133
+ if (scored.length === 0) {
134
+ throw new TotemError('GATE_INVALID', 'Authored cert corpus: every authored rule was Stage-4 out-of-scope (archived) — no scorable ' +
135
+ 'authored rule remains.', 'Tighten the authored matchers so they do not fire on the verification baseline (ADR-112 §4 / Stage-4).');
136
+ }
137
+ // 5. Assemble rules + provenanceByRule from the c.provenance SIDECAR (NOT
138
+ // rule.legitimacy — stamped only post-scoring). Enforce HOMOGENEOUS authored
139
+ // provenance (single-provenance §7) + a unique join identity per rule.
140
+ const rules = [];
141
+ const provenanceByRule = new Map();
142
+ for (const c of scored) {
143
+ // `isAuthoredProvenance` is the single runtime+type-narrowing check (greptile: the
144
+ // earlier `provenanceKind(...) !== 'authored'` leg was redundant — both derive from
145
+ // `p.kind === 'authored'`). Compute the kind only for the fail-loud message.
146
+ if (!isAuthoredProvenance(c.provenance)) {
147
+ throw new TotemError('GATE_INVALID', `Authored cert corpus: rule '${safe(c.rule.lessonHash)}' carries '${provenanceKind(c.provenance)}' ` +
148
+ 'provenance — an authored corpus must be wholly authored (ADR-112 §7 single-provenance).', 'Do not mix mined and authored rules in one cert run; author them as separate runs.');
149
+ }
150
+ if (provenanceByRule.has(c.rule.lessonHash)) {
151
+ throw new TotemError('GATE_INVALID', `Authored cert corpus: duplicate rule identity '${safe(c.rule.lessonHash)}' across scored authored ` +
152
+ 'rules — the §6 control join key would resolve ambiguously.', 'Each authored rule needs a unique minted ruleId (ADR-112 §8); de-duplicate the authored set.');
153
+ }
154
+ rules.push(c.rule);
155
+ provenanceByRule.set(c.rule.lessonHash, c.provenance);
156
+ }
157
+ // 6. Derive the §6 authored controls from the SIDECAR provenance (the D1 fold-#1
158
+ // reshape). Defined-with-empty-arrays if no fixtures — never undefined-for-authored.
159
+ const authoredControls = await deriveAuthoredControls({
160
+ rules,
161
+ split: deps.split,
162
+ provenanceByRule,
163
+ ...(deps.authoredControlsDeps ? { deps: deps.authoredControlsDeps } : {}),
164
+ });
165
+ return {
166
+ rules,
167
+ prDiffs: deps.prDiffs,
168
+ groundTruth: deps.groundTruth,
169
+ provenanceByRule,
170
+ authoredControls,
171
+ };
172
+ }
173
+ //# sourceMappingURL=spine-authored-cert-corpus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spine-authored-cert-corpus.js","sourceRoot":"","sources":["../../src/commands/spine-authored-cert-corpus.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,EAAE;AACF,iFAAiF;AACjF,oFAAoF;AACpF,qFAAqF;AACrF,gFAAgF;AAChF,qFAAqF;AACrF,oFAAoF;AACpF,6EAA6E;AAC7E,EAAE;AACF,iFAAiF;AACjF,qFAAqF;AACrF,iFAAiF;AA2CjF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,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IAAI,CAAC,WAAW;QAC7B,gBAAgB;QAChB,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=spine-authored-cert-corpus.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spine-authored-cert-corpus.test.d.ts","sourceRoot":"","sources":["../../src/commands/spine-authored-cert-corpus.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,289 @@
1
+ import { createHash } from 'node:crypto';
2
+ import * as fs from 'node:fs';
3
+ import * as os from 'node:os';
4
+ import * as path from 'node:path';
5
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
6
+ import { stringify } from 'yaml';
7
+ import { runRuleAuthor } from '../authored-rule-intake.js';
8
+ import { buildAuthoredCertifyingCorpus, } from './spine-authored-cert-corpus.js';
9
+ import { resolveCertifyingCorpusProvider } from './spine-cert-run-corpus.js';
10
+ // ─── Fixtures (mirror the slice-2/3/4 + authored-controls tests) ──────────────
11
+ const sha = (n) => String(n).padStart(40, '0');
12
+ const NOW = '2026-06-19T12:00:00.000Z';
13
+ const SPLIT_REF = 'split-cert-1';
14
+ const JUDGED_BY = 'static-whitelist@cert-1';
15
+ const LESSON_REF = 'deadbeefdeadbeef';
16
+ /** A regex DSL that compiles cleanly + fires on `forbiddenCall()`. */
17
+ const REGEX_DSL = [
18
+ '**Pattern:** `forbiddenCall\\(`',
19
+ '**Engine:** regex',
20
+ '**Severity:** warning',
21
+ '',
22
+ '### Bad Example',
23
+ '```ts',
24
+ 'forbiddenCall()',
25
+ '```',
26
+ ].join('\n');
27
+ /** A regex DSL that PARSES but fails per-engine validation (unterminated group) → compile-rejected. */
28
+ const BAD_REGEX_DSL = [
29
+ '**Pattern:** `(unclosed`',
30
+ '**Engine:** regex',
31
+ '**Severity:** warning',
32
+ ].join('\n');
33
+ const SPLIT = {
34
+ asOfCommit: sha(100),
35
+ trainPrs: [1],
36
+ heldOutPrs: [],
37
+ excludedPrs: [],
38
+ positiveControlPrs: [],
39
+ negativeControlPrs: [],
40
+ splitRule: { predicate: 'code-touching non-bot', cutIndex: 1 },
41
+ };
42
+ function posFixture(pr = 1, filePath = 'src/a.ts', matchedSpan = 'L1-L2') {
43
+ return {
44
+ pr,
45
+ preimageSource: {
46
+ kind: 'lesson',
47
+ lessonRef: LESSON_REF,
48
+ badExample: 'bad()',
49
+ goodExample: 'good()',
50
+ },
51
+ filePath,
52
+ matchedSpan,
53
+ contentHash: `ch-${pr}-${filePath}`,
54
+ };
55
+ }
56
+ function authoredRuleInput(overrides = {}) {
57
+ return {
58
+ author: 'agent-x',
59
+ authoredAt: '2026-06-01',
60
+ targetDefect: 'a real lc defect',
61
+ declaredEngine: 'regex',
62
+ structuralClass: 'forbidden-literal-token',
63
+ dslSource: REGEX_DSL,
64
+ positiveFixtures: [posFixture()],
65
+ ...overrides,
66
+ };
67
+ }
68
+ /** Write a valid `.totem/spine/authored-rules.yaml` into the temp totemDir. */
69
+ function writeAuthoredYaml(totemDir, opts = {}) {
70
+ const fileDoc = {
71
+ splitRef: opts.splitRef ?? SPLIT_REF,
72
+ authoredAfterSplit: true,
73
+ heldOutNonInspectionAttestation: true,
74
+ rules: opts.rules ?? [authoredRuleInput()],
75
+ };
76
+ const dir = path.join(totemDir, 'spine');
77
+ fs.mkdirSync(dir, { recursive: true });
78
+ fs.writeFileSync(path.join(dir, 'authored-rules.yaml'), stringify(fileDoc), 'utf-8');
79
+ // Author-first (strategy (iii)): seed the authoring-ledger via runRuleAuthor, mirroring the
80
+ // production order (`totem rule author` runs BEFORE a cert run). buildAuthoredCertifyingCorpus
81
+ // now sources judgedBy from the pre-existing ledger (no lock/deps judgedBy), so the ledger
82
+ // must exist before the build. JUDGED_BY is the §3 check id the ledger records per-rule.
83
+ runRuleAuthor(totemDir, { judgedBy: JUDGED_BY });
84
+ }
85
+ /**
86
+ * Write the AUTHORED scoring substrate (split + pr-diffs + ground-truth) into a gate-1
87
+ * dir and return the integrity shas the lock must carry — the LF-normalized sha256 the
88
+ * loader (`readAndVerifyScoringSubstrate`) re-derives on its single read. The split is
89
+ * NOT hash-gated (no integrity sha in the loader); pr-diffs + ground-truth are.
90
+ */
91
+ function writeSubstrate(gate1Dir, opts = {}) {
92
+ fs.mkdirSync(gate1Dir, { recursive: true });
93
+ const splitJson = JSON.stringify(opts.split ?? SPLIT);
94
+ const prDiffsJson = JSON.stringify(opts.prDiffs ?? []);
95
+ const gtJson = JSON.stringify(opts.groundTruth ?? {});
96
+ fs.writeFileSync(path.join(gate1Dir, 'split.json'), splitJson, 'utf-8');
97
+ fs.writeFileSync(path.join(gate1Dir, 'pr-diffs.json'), prDiffsJson, 'utf-8');
98
+ fs.writeFileSync(path.join(gate1Dir, 'ground-truth-labels.json'), gtJson, 'utf-8');
99
+ const sha = (s) => createHash('sha256').update(s.replace(/\r\n/g, '\n'), 'utf-8').digest('hex');
100
+ return { prDiffsSha: sha(prDiffsJson), groundTruthSha: sha(gtJson) };
101
+ }
102
+ /** Fake Stage-4 deps — `forbiddenCall()` present in a non-test file ⇒ active (scored). */
103
+ function stage4(files = { 'src/a.ts': 'forbiddenCall()' }) {
104
+ return {
105
+ listFiles: () => Promise.resolve(Object.keys(files)),
106
+ readFile: (f) => f in files ? Promise.resolve(files[f]) : Promise.reject(new Error(`absent ${f}`)),
107
+ };
108
+ }
109
+ /** Stage-4 deps that THROW if touched — proves a guard fired BEFORE compile. */
110
+ function explodingStage4() {
111
+ return {
112
+ listFiles: () => {
113
+ throw new Error('compile must not run');
114
+ },
115
+ readFile: () => {
116
+ throw new Error('compile must not run');
117
+ },
118
+ };
119
+ }
120
+ /** §4 differential stub: drive every fixture to one outcome (no git, no engine). */
121
+ function diffDeps(outcome) {
122
+ const result = {
123
+ outcome,
124
+ sourceKind: 'lesson',
125
+ firesOnPreimage: null,
126
+ silentOnPostimage: null,
127
+ preimageMatchCount: null,
128
+ postimageMatchCount: null,
129
+ };
130
+ return { evaluate: () => Promise.resolve(result) };
131
+ }
132
+ function baseDeps(totemDir, overrides = {}) {
133
+ return {
134
+ totemDir,
135
+ expectedSplitRef: SPLIT_REF,
136
+ split: SPLIT,
137
+ prDiffs: [],
138
+ groundTruth: new Map(),
139
+ stage4: stage4(),
140
+ now: NOW,
141
+ authoredControlsDeps: diffDeps('differential-holds'),
142
+ ...overrides,
143
+ };
144
+ }
145
+ // ─── Temp totemDir lifecycle ──────────────────────────
146
+ let totemDir;
147
+ beforeEach(() => {
148
+ totemDir = fs.mkdtempSync(path.join(os.tmpdir(), 'totem-authored-cert-'));
149
+ });
150
+ afterEach(() => {
151
+ fs.rmSync(totemDir, { recursive: true, force: true });
152
+ });
153
+ // ─── 1. Production path (REAL compile, no mocked CompiledCandidate[]) ──────────
154
+ describe('buildAuthoredCertifyingCorpus — production path', () => {
155
+ it('authored YAML → runRuleAuthor → toCompileFeed → runCompileStage → authored corpus + populated controls', async () => {
156
+ writeAuthoredYaml(totemDir);
157
+ const corpus = await buildAuthoredCertifyingCorpus(baseDeps(totemDir));
158
+ expect(corpus.rules).toHaveLength(1);
159
+ const rule = corpus.rules[0];
160
+ // Provenance is the SIDECAR authored record (NOT rule.legitimacy — absent pre-verdict).
161
+ const prov = corpus.provenanceByRule.get(rule.lessonHash);
162
+ expect(prov && 'kind' in prov && prov.kind).toBe('authored');
163
+ expect(rule.legitimacy).toBeUndefined();
164
+ // authoredControls populated with the TRUE positive shape (no contentHash/preimageSource).
165
+ expect(corpus.authoredControls).toBeDefined();
166
+ expect(corpus.authoredControls.positive).toEqual([
167
+ { pr: 1, targetRuleId: rule.lessonHash, filePath: 'src/a.ts', matchedSpan: 'L1-L2' },
168
+ ]);
169
+ expect(corpus.authoredControls.negative).toEqual([]);
170
+ expect(corpus.authoredControls.nonEmissions).toEqual([]);
171
+ // The scoring substrate is passed through untouched.
172
+ expect(corpus.prDiffs).toEqual([]);
173
+ expect(corpus.groundTruth.size).toBe(0);
174
+ });
175
+ });
176
+ // ─── 2. Fail-loud assembly contract guards ────────────────────────────────────
177
+ describe('buildAuthoredCertifyingCorpus — fail-loud guards', () => {
178
+ it('any rejected authored record fails the build (never certify the eligible subset)', async () => {
179
+ writeAuthoredYaml(totemDir, {
180
+ rules: [
181
+ authoredRuleInput(), // eligible
182
+ authoredRuleInput({
183
+ targetDefect: 'undecidable defect',
184
+ structuralClass: 'not-in-whitelist',
185
+ }),
186
+ ],
187
+ });
188
+ await expect(buildAuthoredCertifyingCorpus(baseDeps(totemDir))).rejects.toThrow(/rejected by the structural-eligibility check/);
189
+ });
190
+ it('an authored compile-rejection fails the build (not a partial corpus)', async () => {
191
+ writeAuthoredYaml(totemDir, { rules: [authoredRuleInput({ dslSource: BAD_REGEX_DSL })] });
192
+ await expect(buildAuthoredCertifyingCorpus(baseDeps(totemDir))).rejects.toThrow(/rejected at compile/);
193
+ });
194
+ it('a file/ledger split mismatch fails BEFORE compile (stage4 never runs)', async () => {
195
+ writeAuthoredYaml(totemDir); // authored under SPLIT_REF
196
+ await expect(buildAuthoredCertifyingCorpus(baseDeps(totemDir, { expectedSplitRef: 'split-DIFFERENT', stage4: explodingStage4() }))).rejects.toThrow(/different split/);
197
+ });
198
+ // (The §5 embargo attestations `authoredAfterSplit` / `heldOutNonInspectionAttestation`
199
+ // are `z.literal(true)` in AuthoredRulesFileSchema, so runRuleAuthor rejects any file
200
+ // lacking them before the assembler runs — there is no reachable assembler branch to
201
+ // test. The reachable §5 guard is the splitRef binding, covered above.)
202
+ });
203
+ // ─── 3. Channel 3-state matrix (authored side; mined→undefined lives in cert-corpus.test) ─
204
+ describe('buildAuthoredCertifyingCorpus — authoredControls channel', () => {
205
+ it('authored with an EMITTING fixture → channel populated', async () => {
206
+ writeAuthoredYaml(totemDir);
207
+ const corpus = await buildAuthoredCertifyingCorpus(baseDeps(totemDir));
208
+ expect(corpus.authoredControls.positive).toHaveLength(1);
209
+ });
210
+ it('authored with NO emitting fixture → channel DEFINED with empty positive/negative arrays', async () => {
211
+ writeAuthoredYaml(totemDir);
212
+ const corpus = await buildAuthoredCertifyingCorpus(baseDeps(totemDir, { authoredControlsDeps: diffDeps('fix-shaped') }));
213
+ // Never undefined for an authored corpus — defined object, empty emission arrays.
214
+ expect(corpus.authoredControls).toBeDefined();
215
+ expect(corpus.authoredControls.positive).toEqual([]);
216
+ expect(corpus.authoredControls.negative).toEqual([]);
217
+ // The non-emitting fixture is KEPT (never silently dropped) as a classed non-emission.
218
+ expect(corpus.authoredControls.nonEmissions).toHaveLength(1);
219
+ expect(corpus.authoredControls.nonEmissions[0]).toMatchObject({
220
+ pr: 1,
221
+ outcome: 'fix-shaped',
222
+ class: 'illegitimate',
223
+ });
224
+ });
225
+ });
226
+ // ─── 4. Single-home dispatch (provider resolution off lock.producerKind) — D2 ──
227
+ describe('resolveCertifyingCorpusProvider — producerKind dispatch (D2 async single-home)', () => {
228
+ let gate1Dir;
229
+ beforeEach(() => {
230
+ gate1Dir = fs.mkdtempSync(path.join(os.tmpdir(), 'totem-d2-gate1-'));
231
+ });
232
+ afterEach(() => {
233
+ fs.rmSync(gate1Dir, { recursive: true, force: true });
234
+ });
235
+ /** Kind-agnostic raw run-context the caller passes unconditionally (no producerKind branch). */
236
+ const inputs = (extra = {}) => ({
237
+ gate1Dir,
238
+ stage4: stage4(),
239
+ now: NOW,
240
+ totemDir,
241
+ ...extra,
242
+ });
243
+ /** A minimal lock cast — the resolver only reads producerKind / authored / integrity shas. */
244
+ const lock = (overrides) => ({ controls: { integrity: {} }, ...overrides });
245
+ it('a mined lock (explicit or absent) resolves to a provider with no authored block', async () => {
246
+ await expect(resolveCertifyingCorpusProvider(lock({ producerKind: 'mined' }), inputs())).resolves.toBeTypeOf('function');
247
+ await expect(resolveCertifyingCorpusProvider(lock({}), inputs())).resolves.toBeTypeOf('function');
248
+ });
249
+ it('an authored lock WITHOUT an `authored` block fails loud (require-when-authored)', async () => {
250
+ await expect(resolveCertifyingCorpusProvider(lock({ producerKind: 'authored' }), inputs())).rejects.toThrow(/run-input block/);
251
+ });
252
+ it('an authored lock missing prDiffsSha / groundTruthSha fails loud (same hard preconditions as mined)', async () => {
253
+ const authored = { expectedSplitRef: SPLIT_REF };
254
+ await expect(resolveCertifyingCorpusProvider(lock({
255
+ producerKind: 'authored',
256
+ authored,
257
+ controls: { integrity: { groundTruthSha: 'x' } },
258
+ }), inputs())).rejects.toThrow(/prDiffsSha/);
259
+ await expect(resolveCertifyingCorpusProvider(lock({ producerKind: 'authored', authored, controls: { integrity: { prDiffsSha: 'x' } } }), inputs())).rejects.toThrow(/groundTruthSha/);
260
+ });
261
+ it('an authored lock + substrate + authored YAML → authored provider yields an authored corpus (e2e input path)', async () => {
262
+ writeAuthoredYaml(totemDir);
263
+ const { prDiffsSha, groundTruthSha } = writeSubstrate(gate1Dir);
264
+ const authoredLock = lock({
265
+ producerKind: 'authored',
266
+ authored: { expectedSplitRef: SPLIT_REF },
267
+ controls: { integrity: { prDiffsSha, groundTruthSha } },
268
+ });
269
+ const provider = await resolveCertifyingCorpusProvider(authoredLock, inputs({ authoredControlsDeps: diffDeps('differential-holds') }));
270
+ const corpus = await provider(authoredLock);
271
+ expect(corpus.authoredControls).toBeDefined();
272
+ expect(corpus.authoredControls.positive).toHaveLength(1);
273
+ // The scoring substrate (prDiffs/groundTruth) came from the loaded fixtures, proving
274
+ // the lock-driven AUTHORED loader wired through (D2) — empty here, but loaded not faked.
275
+ expect(corpus.prDiffs).toEqual([]);
276
+ expect(corpus.groundTruth.size).toBe(0);
277
+ });
278
+ it('an authored lock whose substrate fails integrity (tampered pr-diffs) fails loud', async () => {
279
+ writeAuthoredYaml(totemDir);
280
+ const { groundTruthSha } = writeSubstrate(gate1Dir);
281
+ const authoredLock = lock({
282
+ producerKind: 'authored',
283
+ authored: { expectedSplitRef: SPLIT_REF },
284
+ controls: { integrity: { prDiffsSha: 'f'.repeat(64), groundTruthSha } },
285
+ });
286
+ await expect(resolveCertifyingCorpusProvider(authoredLock, inputs())).rejects.toThrow(/pr-diffs\.json integrity FAILED/);
287
+ });
288
+ });
289
+ //# sourceMappingURL=spine-authored-cert-corpus.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spine-authored-cert-corpus.test.js","sourceRoot":"","sources":["../../src/commands/spine-authored-cert-corpus.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAWjC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,6BAA6B,GAE9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAE7E,iFAAiF;AAEjF,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC/D,MAAM,GAAG,GAAG,0BAA0B,CAAC;AACvC,MAAM,SAAS,GAAG,cAAc,CAAC;AACjC,MAAM,SAAS,GAAG,yBAAyB,CAAC;AAC5C,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAEtC,sEAAsE;AACtE,MAAM,SAAS,GAAG;IAChB,iCAAiC;IACjC,mBAAmB;IACnB,uBAAuB;IACvB,EAAE;IACF,iBAAiB;IACjB,OAAO;IACP,iBAAiB;IACjB,KAAK;CACN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb,uGAAuG;AACvG,MAAM,aAAa,GAAG;IACpB,0BAA0B;IAC1B,mBAAmB;IACnB,uBAAuB;CACxB,CAAC,IAAI,CAAC,IAAI,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CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iFAAiF,EAAE,KAAK,IAAI,EAAE;QAC/F,iBAAiB,CAAC,QAAQ,CAAC,CAAC;QAC5B,MAAM,EAAE,cAAc,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,YAAY,GAAG,IAAI,CAAC;YACxB,YAAY,EAAE,UAAU;YACxB,QAAQ,EAAE,EAAE,gBAAgB,EAAE,SAAS,EAAE;YACzC,QAAQ,EAAE,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,cAAc,EAAE,EAAE;SACxE,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,+BAA+B,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CACnF,iCAAiC,CAClC,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -98,6 +98,9 @@ describe('buildCertifyingCorpus', () => {
98
98
  // fold-I: held-out fetch count is 0 (FM-h) + seed-blindness surfaced.
99
99
  expect(ledgers.apiUsage.heldOutFetchCount).toBe(0);
100
100
  expect(ledgers.emission.extractionInputsAttestation.seedClassesProvided).toBe(false);
101
+ // ADR-112 §6 Slice D1: a MINED corpus carries NO authored controls channel — the
102
+ // miner path is byte-unchanged (the channel is present-iff authored-provenance).
103
+ expect(corpus.authoredControls).toBeUndefined();
101
104
  });
102
105
  it('binding-2: a Stage-4 out-of-scope (archived) rule is EXCLUDED from the scored set', async () => {
103
106
  // The rule fires only on a TEST file → Stage-4 out-of-scope → status archived →
@@ -1 +1 @@
1
- {"version":3,"file":"spine-cert-corpus.test.js","sourceRo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