@oscaner-skills/cdd-engine 3.1.0 → 4.0.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.
@@ -15,7 +15,6 @@
15
15
  // bare functions.
16
16
  import process from "node:process";
17
17
  import { printParseErrorCode } from "jsonc-parser";
18
- import { ConfigLoader } from "../infra/config.js";
19
18
  import { TemplateAssembler } from "../render/templates.js";
20
19
  import { HandoffSchema } from "../session/handoff-schema.js";
21
20
  import { RoundNaming } from "../session/round-naming.js";
@@ -40,7 +39,6 @@ const STDOUT_TAIL_MAX = 40;
40
39
  export class CliLifecycle {
41
40
  #env;
42
41
  #sync;
43
- #config;
44
42
  #template;
45
43
  #io;
46
44
  #scene;
@@ -65,7 +63,6 @@ export class CliLifecycle {
65
63
  this.#scene = opts.scene;
66
64
  this.#naming = new RoundNaming(opts.scene.workspace);
67
65
  this.#sync = opts.sync ?? new Terminator();
68
- this.#config = opts.config ?? new ConfigLoader();
69
66
  this.#template = opts.template ?? new TemplateAssembler();
70
67
  this.#words = opts.words ?? new Words();
71
68
  this.#io = opts.io ?? {
@@ -251,6 +248,13 @@ export class CliLifecycle {
251
248
  : frame.type === "plan" || frame.type === "branch"
252
249
  ? this.#rel(scene.specLink ?? "")
253
250
  : "",
251
+ // The parent charter of the spec the face reads (INPUT_OVERALL) — the same
252
+ // value condition as INPUT_SPEC, one face (spec = its own `program:`; plan/
253
+ // branch = the same-slug identity doc's `program:`); empty off those faces and
254
+ // when the spec names no program (the assembler drops the empty slot).
255
+ INPUT_OVERALL: frame.type === "spec" || frame.type === "plan" || frame.type === "branch"
256
+ ? this.#rel(scene.overallLink ?? "")
257
+ : "",
254
258
  // The branch/wave tree-review scope anchor (BASE_BRANCH) — engine-injected
255
259
  // from the base artifact at dispatch; empty off those faces (spec/plan reviews
256
260
  // carry none, and the empty slot is dropped by the assembler).
@@ -315,7 +319,7 @@ export class CliLifecycle {
315
319
  return this.#scene.workspace.readJsonLenient(this.#scene.ledger.handoffName(op, frame.type, frame.params));
316
320
  }
317
321
  /** The non-rejecting draft probe of the termination branch — a terminated REVIEW
318
- * round's draft is promotable iff it exists, parses, passes the findings schema,
322
+ * round's draft is promotable iff it exists, parses, passes the judge plane's schema,
319
323
  * and carries at least one finding. Returns the validated draft (the promotion
320
324
  * then rides the reconstruct's existing validation/persistence/conclusion path) or
321
325
  * null (the round keeps the TIMEOUT failure face). It calls no `#reject` and
@@ -325,14 +329,12 @@ export class CliLifecycle {
325
329
  const op = this.#opOf(frame);
326
330
  if (op !== "review")
327
331
  return null;
328
- const face = this.#familyOf(op, frame.type).schema ?? "delivery";
329
- if (face !== "findings")
330
- return null;
332
+ const plane = HandoffSchema.planeOf(op);
331
333
  const read = this.#readDraft(frame);
332
334
  if (read.kind !== "ok")
333
335
  return null;
334
336
  const draft = read.value;
335
- if (this.#handoffSchema.violations(face, draft).length > 0)
337
+ if (this.#handoffSchema.violations(plane, draft).length > 0)
336
338
  return null;
337
339
  const findings = Array.isArray(draft.findings) ? draft.findings : [];
338
340
  return findings.length >= 1 ? draft : null;
@@ -368,8 +370,8 @@ export class CliLifecycle {
368
370
  * remains the carrier's single author). A missing or schema-violating draft →
369
371
  * BLOCK over the CDD_BLOCKED channel + a crash record + the draft untouched
370
372
  * (on failure, no overwrite — the child's work is never clobbered; resume re-runs the same
371
- * command, which re-offers the round). The test-evidence file (task-family delivery
372
- * rounds only) is read back with the same stakes: a missing/violating file
373
+ * command, which re-offers the round). The test-evidence file (work-plane wave /
374
+ * branch rounds only) is read back with the same stakes: a missing/violating file
373
375
  * rewrites the carrier to BLOCKED (persisted — the child's work is kept, marked
374
376
  * bad), the second fix for a prose-only claim.
375
377
  *
@@ -379,7 +381,7 @@ export class CliLifecycle {
379
381
  #reconstruct(frame, prefetched) {
380
382
  const scene = this.#scene;
381
383
  const op = this.#opOf(frame);
382
- const face = this.#familyOf(op, frame.type).schema ?? "delivery";
384
+ const plane = HandoffSchema.planeOf(op);
383
385
  const schema = this.#handoffSchema;
384
386
  const path = scene.ledger.handoffPath(op, frame.type, frame.params);
385
387
  let draft;
@@ -396,7 +398,11 @@ export class CliLifecycle {
396
398
  // brace, …) still reports malformed.
397
399
  const draftRead = this.#readDraft(frame);
398
400
  if (draftRead.kind === "missing") {
399
- return this.#reject(frame, path, `the handoff draft was not written at ${path}`);
401
+ return this.#reject(frame, path, `the handoff draft was not written at ${path}`, {
402
+ exitCode: 0,
403
+ cause: "handoff-absent",
404
+ termination: null,
405
+ });
400
406
  }
401
407
  if (draftRead.kind === "malformed") {
402
408
  // The lenient face carries the parser's precise error codes (D39) — surface
@@ -410,31 +416,31 @@ export class CliLifecycle {
410
416
  }
411
417
  draft = draftRead.value;
412
418
  }
413
- const problems = schema.violations(face, draft);
419
+ const problems = schema.violations(plane, draft);
414
420
  if (problems.length > 0) {
415
- return this.#reject(frame, path, `the handoff draft at ${path} violates the ${face} schema: ${problems.join("; ")}`);
421
+ return this.#reject(frame, path, `the handoff draft at ${path} violates the ${plane} schema: ${problems.join("; ")}`);
416
422
  }
417
- // T2 — the face-aware read: the findings face ALONE reads `draft.findings` (its
418
- // own declared required field — rolled up to the conclusion); the delivery face
419
- // derives its status from the draft's declared status, never the findings plane
420
- // (the delivery writable subset declares no findings field — zero findings read).
423
+ // T2 — the plane-aware read: the judge plane ALONE reads `draft.findings` (its
424
+ // own declared required field — rolled up to the conclusion); the work plane
425
+ // derives its status from the draft's declared status, never the findings slot
426
+ // (the work writable subset declares no findings field — zero findings read).
421
427
  // The conclusion rides the ONE source (`HandoffSchema.conclusionOf`) the ledger
422
- // legs read too — the reconstruct never rules a delivery status by a second path.
423
- const findings = face === "findings" ? (Array.isArray(draft.findings) ? draft.findings : []) : [];
424
- // A validated draft's conclusion is total: the findings face rolls up its own
425
- // required findings, and the delivery face's `status` passed the `required` gate above
426
- // — so the `?? "BLOCKED"` never fires here (a delivery draft without a status never
428
+ // legs read too — the reconstruct never rules a work status by a second path.
429
+ const findings = plane === "judge" ? (Array.isArray(draft.findings) ? draft.findings : []) : [];
430
+ // A validated draft's conclusion is total: the judge plane rolls up its own
431
+ // required findings, and the work plane's `status` passed the `required` gate above
432
+ // — so the `?? "BLOCKED"` never fires here (a work draft without a status never
427
433
  // reaches this line; the absent→undefined case exists only for on-disk legacy
428
434
  // carriers the ledger reads back, never a schema-validated draft).
429
- let status = schema.conclusionOf(face, draft) ?? "BLOCKED";
435
+ let status = schema.conclusionOf(plane, draft) ?? "BLOCKED";
430
436
  let reason = null;
431
- // The evidence gate (v1.9) — the delivery faces (implement/fix task+branch) write
432
- // the canonical `{family-prefix}-{key}-test-evidence.json` under the workspace
433
- // (§3.7 naming: tasks- for the task families, branch- for the branch fix); the
434
- // docs faces (review/docs-fix) carry no evidence file. The read-back is REAL — a
435
- // missing/malformed/schema-violating file rewrites the draft to BLOCKED (each
436
- // cause reported truly — the tri-state read, D27).
437
- if (face === "delivery") {
437
+ // The evidence gate (v1.9) — the work plane's wave / branch rounds (implement/fix
438
+ // task+branch) write the canonical `{family-prefix}-{key}-test-evidence.json` under
439
+ // the workspace (§3.7 naming: tasks- for the task families, branch- for the branch
440
+ // fix); the doc rounds (review/docs-fix) carry no evidence file. The read-back is
441
+ // REAL — a missing/malformed/schema-violating file rewrites the draft to BLOCKED
442
+ // (each cause reported truly — the tri-state read, D27).
443
+ if (plane === "work" && (frame.type === "wave" || frame.type === "branch")) {
438
444
  const evidenceName = this.#naming.evidenceName(frame);
439
445
  const evidencePath = scene.workspace.resolve(evidenceName);
440
446
  const evidenceRead = scene.workspace.readJson(evidenceName);
@@ -457,17 +463,18 @@ export class CliLifecycle {
457
463
  }
458
464
  return {
459
465
  status,
460
- findings: face === "findings" ? schema.findingsOf(findings) : undefined,
461
- carrier: this.#materialize(frame, face, draft, status, reason),
466
+ findings: plane === "judge" ? schema.findingsOf(findings) : undefined,
467
+ carrier: this.#materialize(frame, plane, draft, status, reason),
462
468
  };
463
469
  }
464
470
  /** The read-back rejection face — CDD_BLOCKED reason + the crash record (the
465
471
  * same-command resume's decision source: the attempted handoff + the resume
466
472
  * command) + NO carrier (the bookkeep leaves the draft untouched). The crash
467
- * record carries the caller's REAL death facts: an absent draft/schema violation
468
- * is the read-back face (exit 0 · `contract-violation` — the defaults), a dead
473
+ * record carries the caller's REAL death facts: an absent draft is the
474
+ * `handoff-absent` read-back face (exit 0), a present-but-unqualified draft
475
+ * (malformed JSON / schema) is `contract-violation` (the default), a dead
469
476
  * child passes its own exit code + `child-exit`, and a terminated round passes
470
- * its whole `termination` fact (cause + last sample) — one record shape, three
477
+ * its whole `termination` fact (cause + last sample) — one record shape, four
471
478
  * truthful callers (the record is the postmortem artifact; a misreported death
472
479
  * sends a maintainer hunting the wrong fault).
473
480
  *
@@ -500,6 +507,9 @@ export class CliLifecycle {
500
507
  * the record shape is identical, only the promotion fact differs. */
501
508
  #writeCrash(frame, path, reason, death, promoted) {
502
509
  const op = this.#opOf(frame);
510
+ // The cause rides the termination fact when one is present (one of the three
511
+ // causes or the `unknown` fallback); without it, the caller's own cause.
512
+ const cause = death.termination?.cause ?? death.cause;
503
513
  this.#scene.ledger.writeCrash(`${op}.${frame.type}`, frame.round, {
504
514
  exitCode: death.exitCode,
505
515
  stderrTail: [reason],
@@ -508,23 +518,26 @@ export class CliLifecycle {
508
518
  // shape (never the absolute `handoffPath` syscall form — §2.7).
509
519
  attemptedHandoff: this.#rel(path),
510
520
  next: this.#resumeOf(frame),
511
- // The cause rides the termination fact when one is present (one of the three
512
- // causes or the `unknown` fallback); without it, the caller's own cause.
513
- cause: death.termination?.cause ?? death.cause,
521
+ cause,
514
522
  // The last sample rides WITH the termination (in memory, zero re-read of the
515
523
  // heartbeat file) — null on every non-terminated face.
516
524
  lastSample: death.termination?.lastSample ?? null,
517
525
  promoted,
518
526
  idleMs: death.termination?.idleMs ?? null,
519
527
  });
528
+ // P14 — the sole contractViolationCount write seam: observe the FINAL crash
529
+ // cause (termination override wins). Never keyed off status === "BLOCKED".
530
+ if (cause === "handoff-absent" || cause === "contract-violation") {
531
+ this.#scene.ledger.incrementContractViolationCount();
532
+ }
520
533
  }
521
534
  /** Build the final carrier — the validated writable fields from the draft (the
522
535
  * engine-seated identity rides the canonical file name, never inline: phase/tasks
523
536
  * are not declared and never written — v1.30), persisted by the bookkeep
524
537
  * full-replace at the SAME path (agent draft → finalized). The evidence override
525
- * rewrites the status to BLOCKED + a failure_category + the reason note (the
526
- * child's work preserved, marked bad). */
527
- #materialize(frame, face, draft, status, reason) {
538
+ * rewrites the status to BLOCKED + the reason note (the child's work preserved,
539
+ * marked bad). */
540
+ #materialize(frame, plane, draft, status, reason) {
528
541
  const ledger = this.#scene.ledger;
529
542
  const notes = [];
530
543
  // The §8.7 classification ruling — the SAME judgment the read-back validator makes
@@ -532,42 +545,40 @@ export class CliLifecycle {
532
545
  // AT MOST ONE WARN on the carrier's notes (auditable, non-interrupting — replacing
533
546
  // the retired "BLOCK + crash-resume + reopen" chain). The engine stays the carrier's
534
547
  // single author; a child's stray key is surfaced, not obeyed.
535
- const dropped = this.#handoffSchema.droppedKeys(face, draft);
548
+ const dropped = this.#handoffSchema.droppedKeys(plane, draft);
536
549
  if (dropped.length > 0) {
537
550
  notes.push(`dropped non-declared draft field(s): ${dropped.join(", ")} — engine-reserved, never written`);
538
551
  }
539
- // The per-face carrier — buildHandoff's typed overloads: the findings face REQUIRES
552
+ // The per-plane carrier — buildHandoff's typed overloads: the judge plane REQUIRES
540
553
  // its findings payload (the schema-required field — cli.test pins the review
541
- // carrier's findings + status), the delivery face builds a findings-FREE typed carrier
542
- // (the delivery writable subset declares no findings field — the materialized delivery
543
- // carrier carries zero findings keys). `Record<string, unknown>` local: the round
544
- // conclusion (status — a RoundStatus, wider than the carrier's declared union) and
545
- // the engine's extended fields ride the caller's set below.
546
- const carrier = face === "findings"
547
- ? ledger.buildHandoff("findings", {
554
+ // carrier's findings + status), the work plane builds a findings-FREE typed carrier
555
+ // (the work writable subset declares no findings field — a docs-fix draft's residual
556
+ // findings are dropped, never materialized). `Record<string, unknown>` local: the
557
+ // round conclusion (status — a RoundStatus, wider than the carrier's declared union)
558
+ // and the engine's extended fields ride the caller's set below.
559
+ const carrier = plane === "judge"
560
+ ? ledger.buildHandoff("judge", {
548
561
  artifacts: this.#canonicalArtifacts(frame, draft.artifacts, notes),
549
562
  findings: this.#findingsList(draft.findings),
550
563
  })
551
- : ledger.buildHandoff("delivery", {
564
+ : ledger.buildHandoff("work", {
552
565
  artifacts: this.#canonicalArtifacts(frame, draft.artifacts, notes),
553
566
  });
554
- // The delivery face ALONE persists the round conclusion — it is the child's own
555
- // declared status (the schema enum pinned it to APPROVED | BLOCKED). The findings
556
- // face holds NO status field: its conclusion is DERIVED at judgment time
557
- // (`HandoffSchema.conclusionOf("findings", carrier)` → rollup(findings)), so the
558
- // persisted findings carrier stays the pure declaration plane
567
+ // The work plane ALONE persists the round conclusion — it is the child's own
568
+ // declared status (the schema enum pinned it to APPROVED | BLOCKED). The judge
569
+ // plane holds NO status field: its conclusion is DERIVED at judgment time
570
+ // (`HandoffSchema.conclusionOf("judge", carrier)` → rollup(findings)), so the
571
+ // persisted judge carrier stays the pure declaration plane
559
572
  // (findings/artifacts/notes) and a fix child's INPUT_REVIEWS carrier is
560
- // status-free (the judgment face is perpendicular to the input face · D27).
573
+ // status-free (the judgment plane is perpendicular to the input plane · D27).
561
574
  const draftNotes = Array.isArray(draft.notes) ? [...draft.notes] : [];
562
- if (face === "delivery") {
575
+ if (plane === "work") {
563
576
  carrier.status = status;
564
- if (typeof draft.failure_category === "string")
565
- carrier.failure_category = draft.failure_category;
566
- // The evidence-contract override (delivery faces only — the evidence gate reads a
567
- // delivery round's evidence file) rewrites the persisted conclusion to BLOCKED.
577
+ // The evidence-contract override (work-plane wave / branch rounds only — the
578
+ // evidence gate reads that round's evidence file) rewrites the persisted
579
+ // conclusion to BLOCKED.
568
580
  if (reason !== null) {
569
581
  carrier.status = "BLOCKED";
570
- carrier.failure_category = "evidence-contract";
571
582
  draftNotes.push(reason);
572
583
  }
573
584
  }
@@ -625,23 +636,13 @@ export class CliLifecycle {
625
636
  }
626
637
  /** The `## Handoff schema` section value — the mode's writable-subset fence
627
638
  * (projection ①; byte-fixed per mode so the prompt's fixed prefix stays
628
- * cache-friendly). The family's `schema` field selects the face (§3.6: delivery →
629
- * carrier + evidence fence for the implement/fix modes; findings → the review /
630
- * docs-fix fence only). */
639
+ * cache-friendly). The op-derived plane selects the subset: work → carrier +
640
+ * evidence fence on the wave / branch rounds; judge → the review fence only. */
631
641
  #schemaText(frame) {
632
- const op = this.#opOf(frame);
633
- const face = this.#familyOf(op, frame.type).schema ?? "delivery";
634
- const evidence = face === "delivery";
642
+ const plane = HandoffSchema.planeOf(this.#opOf(frame));
643
+ const evidence = plane === "work" && (frame.type === "wave" || frame.type === "branch");
635
644
  const prefix = evidence ? this.#naming.prefix(frame) : "tasks";
636
- return this.#handoffSchema.schemaText(face, evidence, prefix);
637
- }
638
- /** The op.type family record — the engine-config handoff namespace single truth
639
- * (loud on an unknown family: never a second naming table). */
640
- #familyOf(op, type) {
641
- const family = this.#config.engineConfig().handoffNamespace.families[`${op}.${type}`];
642
- if (family === undefined)
643
- throw new Error(`unknown handoff family: ${op}.${type}`);
644
- return family;
645
+ return this.#handoffSchema.schemaText(plane, evidence, prefix);
645
646
  }
646
647
  /** The artifacts field as a string-map (only string values land — non-string rows
647
648
  * are dropped, never coerced). */
@@ -84,7 +84,7 @@ export class Preview {
84
84
  return this.#rel(this.#scene.planPath ?? "");
85
85
  }
86
86
  /** The artifacts the round would write — the frame's prescribed output set (the
87
- * handoff carrier, the round report and the delivery faces' test evidence), named by
87
+ * handoff carrier, the round report and the evidence rounds' test evidence), named by
88
88
  * the ONE naming source. A slot the frame's family does not consume (a review
89
89
  * round prescribes no evidence file) is dropped, never rendered blank. */
90
90
  #writesOf(frame) {
@@ -37,6 +37,12 @@ export class TerminationPolicy {
37
37
  fix: 3 * 60 * 60 * 1000,
38
38
  "branch-review": 3 * 60 * 60 * 1000,
39
39
  };
40
+ /** The child's per-command Bash ceiling (ms) — a DISCIPLINE constant, never a
41
+ * phase budget: the child prompt tells the child to put a `timeout` on every
42
+ * Bash invocation, no longer than this. It is deliberately not a `RoundPhase`
43
+ * key (no dispatch phase maps to it) and not an engine-side kill: the engine
44
+ * cannot see commands inside the child. */
45
+ static CHILD_BASH_TIMEOUT_MS = 15 * 60 * 1000;
40
46
  /** The stall window (ms) — how long a round may make no progress before the
41
47
  * judge rules it stalled (not per phase: "no progress" means the same thing on
42
48
  * every phase). */
@@ -30,6 +30,7 @@
30
30
  //
31
31
  // Module-level exports are types / the declared word data / the class — zero
32
32
  // behavior-carrying bare functions (the plan's zero-bare-function discipline).
33
+ import { DOC_TYPE_VALUES } from "../contract/declare.js";
33
34
  /** The capsule word rows — every word the capsule face emits, one table. */
34
35
  export const CAPSULE_WORDS = {
35
36
  /** The capsule emit key rows — one declaration per status class (the summary
@@ -60,7 +61,11 @@ export const CAPSULE_WORDS = {
60
61
  review: "review",
61
62
  fix: "fix",
62
63
  implement: "implement",
63
- docType: "the doc declares no `doc-type:` key — add `doc-type: <overall-spec|phase-spec|single-spec|plan>` to the doc's front-matter (spec §12 · D34) and re-run",
64
+ docType: "the doc declares no `doc-type:` key — add `doc-type: <overall|phase-spec|single-spec|plan>` to the doc's front-matter (spec §12 · D34) and re-run",
65
+ docTypeValue: "the doc declares `doc-type: {value}`, which is outside the declared domain — use one of {domain} and re-run",
66
+ slugMissing: "the doc declares no `slug:` key — add `slug: <workspace-key>` to the doc's front-matter (the identity key the board and every work command share) and re-run",
67
+ slugInvalid: 'the doc\'s `slug:` value "{slug}" is illegal — use 1–128 characters, an alphanumeric first character, then alphanumerics, `.`, `_`, or `-` (the slug is the workspace directory name), then re-run',
68
+ slugDuplicated: 'the slug "{slug}" is declared by more than one document — keep exactly one identity document and at most one plan per slug, then re-run',
64
69
  frontmatterParse: "the doc's front-matter is not valid YAML: {reason} on line {line}, column {column} (`{source}`) — quote values that start with `[` or `{` (a YAML flow-sequence start) and re-run",
65
70
  },
66
71
  /** The wave-gate BLOCK wording rows (v1.21) — the highest-arity pre-flight refusal
@@ -68,11 +73,12 @@ export const CAPSULE_WORDS = {
68
73
  waveGate: {
69
74
  split: "the requested wave ({requested}) splits/mismatches the derived wave ({open}) — dispatch the full derived wave",
70
75
  wrongPhase: "the open wave is at {phase} — run cdd {phase} first",
76
+ mixedBatch: "the derived batch ({batch}) mixes closed and open tasks ({closed} closed, {open} open) — a wave closes as a unit; re-declare the **DependsOn** edges so no task joins an already-executed batch",
71
77
  },
72
78
  /** The pre-flight BLOCK wording rows (P4.1 T1) — the seam's refusal vocabulary,
73
79
  * single-sourced (the seam fills the {count} slot, never a re-type). */
74
80
  preflight: {
75
- dirtyTree: "the working tree is dirty — commit or discard your changes, then re-run the same command",
81
+ dirtyTree: "the working tree is dirty — commit or discard your changes (recovery is the orchestrator's job; the engine only refuses — it never stashes, makes a temporary commit, or resumes a dirty tree), then re-run the same command",
76
82
  graph: "the plan graph has {count} edge violation(s) — fix the **DependsOn** edges first",
77
83
  docContract: "the target document fails the doc-contract — fix its structural findings first",
78
84
  },
@@ -196,6 +202,27 @@ export class Words {
196
202
  routeWord(kind) {
197
203
  return CAPSULE_WORDS.routeWords[kind];
198
204
  }
205
+ /** The out-of-domain `doc-type:` wording — the declared value named, the
206
+ * allowed domain interpolated from the ONE `DOC_TYPE_VALUES` declaration
207
+ * (never a second hand-written list). */
208
+ docTypeValueWord(value) {
209
+ return this.routeWord("docTypeValue")
210
+ .replace("{value}", value)
211
+ .replace("{domain}", DOC_TYPE_VALUES.join(", "));
212
+ }
213
+ /** The identity-gate refusal wording for one refused slug verdict — the ONE
214
+ * spelling the pre-flight gate and the dispatch carrier print (the row and its
215
+ * `{slug}` fill are owned here, never re-typed at a carrier). */
216
+ slugRefusal(verdict) {
217
+ switch (verdict.kind) {
218
+ case "missing":
219
+ return this.routeWord("slugMissing");
220
+ case "illegal":
221
+ return this.routeWord("slugInvalid").replace("{slug}", verdict.slug);
222
+ case "duplicated":
223
+ return this.routeWord("slugDuplicated").replace("{slug}", verdict.slug);
224
+ }
225
+ }
199
226
  /** The wave-gate BLOCK wording rows — the vocabulary the WaveGate verdicts render
200
227
  * (single source: the gate fills the placeholders from these rows, never re-types). */
201
228
  waveGateWords() {
@@ -14,6 +14,7 @@
14
14
  /** The doc-tree root segments — the ONE value of the doc-root fact (the runtime's
15
15
  * `docRoots` and every derived literal read THIS constant). */
16
16
  export const ENGINE_DOC_ROOTS = {
17
+ overalls: "docs/kairos/overalls",
17
18
  specs: "docs/kairos/specs",
18
19
  plans: "docs/kairos/plans",
19
20
  };
@@ -14,8 +14,8 @@
14
14
  // The JSON plane's dead fields are not carried (the delete-dead-empties iron rule):
15
15
  // · failureCategories — the new tree keeps no failure-category counter data; the
16
16
  // ledger's progress key set is the declared code constant (PROGRESS_COUNTER_ZERO).
17
- // · handoffNamespace.slugRule — the slug derivation is code (Workspace.slugFromDoc),
18
- // never a prose data field.
17
+ // · handoffNamespace.slugRule — the workspace key is the document's declared
18
+ // `slug:` (judged by the identity index), never a prose data field.
19
19
  // · contextContract channels.git / derived / transport / timeouts and the env-host
20
20
  // channel — no live consumer; the host-marker closure is single-sourced by the
21
21
  // harness detect rows (face/host.ts), never re-declared here.
@@ -28,47 +28,38 @@ import { ENGINE_DOC_ROOTS } from "./doc-roots.js";
28
28
  * keyed by `op.type` (implement.wave / review.wave / … — the ledger's single
29
29
  * naming truth, verbatim from the engine-config handoff namespace). The v1.9
30
30
  * reparametrization: `returnFormat` is gone (RETURN_PROSE is the one return
31
- * contract) and the `schema` faces are the handoff-schema selector (delivery / findings —
32
- * session/handoff-schema.ts). */
31
+ * contract) and each family is a pure name row — the carrier plane derives from the
32
+ * op, never from this table (`planeOf`, session plane). */
33
33
  export const HANDOFF_FAMILIES = {
34
34
  "implement.wave": {
35
35
  name: "tasks-{tasks}-implement.json",
36
- schema: "delivery",
37
36
  },
38
37
  "review.wave": {
39
38
  name: "tasks-{tasks}-review-{round}.json",
40
- schema: "findings",
41
39
  },
42
40
  "fix.wave": {
43
41
  name: "tasks-{tasks}-fix-{round}.json",
44
- schema: "delivery",
45
42
  },
46
43
  "review.spec": {
47
44
  name: "spec-review-{round}.json",
48
- schema: "findings",
49
45
  },
50
46
  "fix.spec": {
51
47
  name: "spec-fix-{round}.json",
52
- schema: "findings",
53
48
  },
54
49
  "review.plan": {
55
50
  name: "plan-review-{round}.json",
56
- schema: "findings",
57
51
  },
58
52
  "fix.plan": {
59
53
  name: "plan-fix-{round}.json",
60
- schema: "findings",
61
54
  },
62
55
  "review.branch": {
63
56
  // find #9 (spec §6.5): the range token leaves the file name — the workspace
64
57
  // slug is the plan-slug (the fix face carries --plan) · round accumulates
65
58
  // across re-reviews (lineKey pins "branch").
66
59
  name: "branch-review-{round}.json",
67
- schema: "findings",
68
60
  },
69
61
  "fix.branch": {
70
62
  name: "branch-fix-{round}.json",
71
- schema: "delivery",
72
63
  },
73
64
  };
74
65
  /** The engine runtime — the typed engine-config surface, one constant (the argv