@cleocode/contracts 2026.5.111 → 2026.5.112

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.
Files changed (31) hide show
  1. package/dist/__tests__/evidence-atom-schema.test.d.ts +16 -0
  2. package/dist/__tests__/evidence-atom-schema.test.d.ts.map +1 -0
  3. package/dist/__tests__/evidence-atom-schema.test.js +394 -0
  4. package/dist/__tests__/evidence-atom-schema.test.js.map +1 -0
  5. package/dist/evidence-atom-schema.d.ts +407 -0
  6. package/dist/evidence-atom-schema.d.ts.map +1 -0
  7. package/dist/evidence-atom-schema.js +505 -0
  8. package/dist/evidence-atom-schema.js.map +1 -0
  9. package/dist/index.d.ts +4 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/invariants/__tests__/registry.test.d.ts +14 -0
  14. package/dist/invariants/__tests__/registry.test.d.ts.map +1 -0
  15. package/dist/invariants/__tests__/registry.test.js +113 -0
  16. package/dist/invariants/__tests__/registry.test.js.map +1 -0
  17. package/dist/invariants/adr-073-saga.d.ts +32 -0
  18. package/dist/invariants/adr-073-saga.d.ts.map +1 -0
  19. package/dist/invariants/adr-073-saga.js +155 -0
  20. package/dist/invariants/adr-073-saga.js.map +1 -0
  21. package/dist/invariants/index.d.ts +159 -0
  22. package/dist/invariants/index.d.ts.map +1 -0
  23. package/dist/invariants/index.js +109 -0
  24. package/dist/invariants/index.js.map +1 -0
  25. package/package.json +2 -2
  26. package/src/__tests__/evidence-atom-schema.test.ts +499 -0
  27. package/src/evidence-atom-schema.ts +628 -0
  28. package/src/index.ts +39 -0
  29. package/src/invariants/__tests__/registry.test.ts +136 -0
  30. package/src/invariants/adr-073-saga.ts +167 -0
  31. package/src/invariants/index.ts +213 -0
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ export { EngineResultError, engineError, engineSuccess, unwrap, } from './engine
25
25
  export { ARCHIVE_REASONS, TASK_KINDS, TASK_RELATION_TYPES, TASK_SCOPES, TASK_SEVERITIES, TASK_SIZES, } from './enums.js';
26
26
  // === Error Utilities ===
27
27
  export { ChangesetYamlInvalidError, ClassifierUnregisteredAgentError, createErrorResult, createSuccessResult, DecisionValidatorFailedError, E_SAGA_INVARIANT_VIOLATION_I3, E_SAGA_INVARIANT_VIOLATION_I5, E_SAGA_INVARIANT_VIOLATION_I7, formatError, getErrorMessage, isErrorResult, isErrorType, LeadBypassDetectedError, LifecycleScopeDeniedError, normalizeError, ThinAgentViolationError, } from './errors.js';
28
+ export { callsiteCoverageAtomSchema, commitAtomSchema, decisionAtomSchema, EvidenceAtomSchema, EvidenceParseError, filesAtomSchema, formatGateRequirement, GATE_EVIDENCE_REQUIREMENTS, locDropAtomSchema, noteAtomSchema, parseEvidenceString, prAtomSchema, testRunAtomSchema, toolAtomSchema, urlAtomSchema, validateEvidenceForGate, } from './evidence-atom-schema.js';
28
29
  // === Evidence Record Zod Schemas (runtime validation) ===
29
30
  export { commandOutputRecordSchema, evidenceRecordSchema, implDiffRecordSchema, lintReportRecordSchema, testOutputRecordSchema, validateSpecCheckRecordSchema, } from './evidence-record-schema.js';
30
31
  // === Exit Codes ===
@@ -40,6 +41,7 @@ E_WRITE_CONTENTION, ExitCode, getExitCodeName, isErrorCode, isNoChangeCode, isRe
40
41
  // === Facade API Interfaces ===
41
42
  export { AGENT_INSTANCE_STATUSES, AGENT_TYPES, BRAIN_OBSERVATION_TYPES, } from './facade.js';
42
43
  export { confidenceFromProvenance, confidenceLabelFromNumeric, provenanceFromNumeric, } from './graph.js';
44
+ export { ADR_073_INVARIANTS, getInvariant, getInvariantsByAdr, INVARIANTS_REGISTRY, } from './invariants/index.js';
43
45
  // === LAFS Envelope Types ===
44
46
  export { isGatewayEnvelope, isLafsError, isLafsSuccess, } from './lafs.js';
45
47
  export { PluginDeniedError, PluginLlmError, PluginModelGateError, PluginRateLimitedError, } from './llm/plugin-llm.js';
package/dist/index.js.map CHANGED
@@ -1 +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AAYvE,OAAO,EACL,2BAA2B,EAC3B,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,oBAAoB,CAAC;AAuB5B,uEAAuE;AACvE,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAkF5B,yCAAyC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Unit tests for the central invariants registry (T10335).
3
+ *
4
+ * The registry is the SSoT for system-wide invariants surfaced via the
5
+ * SG-SUBSTRATE-RECONCILIATION saga. Downstream R-tasks (R2 ORC codes,
6
+ * R4 CI gate, R5 release refactor, R6 doctor audit, R8 docs renderer)
7
+ * all key off the metadata shape asserted below.
8
+ *
9
+ * @epic T10327 — E-INVARIANT-REGISTRY-SSOT
10
+ * @saga T10326 — SG-SUBSTRATE-RECONCILIATION
11
+ * @task T10335 — R1: registry + ADR-073 I1-I8
12
+ */
13
+ export {};
14
+ //# sourceMappingURL=registry.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.test.d.ts","sourceRoot":"","sources":["../../../src/invariants/__tests__/registry.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Unit tests for the central invariants registry (T10335).
3
+ *
4
+ * The registry is the SSoT for system-wide invariants surfaced via the
5
+ * SG-SUBSTRATE-RECONCILIATION saga. Downstream R-tasks (R2 ORC codes,
6
+ * R4 CI gate, R5 release refactor, R6 doctor audit, R8 docs renderer)
7
+ * all key off the metadata shape asserted below.
8
+ *
9
+ * @epic T10327 — E-INVARIANT-REGISTRY-SSOT
10
+ * @saga T10326 — SG-SUBSTRATE-RECONCILIATION
11
+ * @task T10335 — R1: registry + ADR-073 I1-I8
12
+ */
13
+ import { describe, expect, it } from 'vitest';
14
+ import { E_SAGA_INVARIANT_VIOLATION_I3, E_SAGA_INVARIANT_VIOLATION_I5, E_SAGA_INVARIANT_VIOLATION_I7, } from '../../errors.js';
15
+ import { ADR_073_INVARIANTS, getInvariant, getInvariantsByAdr, INVARIANTS_REGISTRY, } from '../index.js';
16
+ /**
17
+ * Map from ADR-073 invariant code → expected LAFS error code in
18
+ * `packages/contracts/src/errors.ts`. R2/R4 will extend this mapping with
19
+ * ADR-070 ORC codes once they land — for now the registry only knows
20
+ * about the three saga-runtime guards.
21
+ *
22
+ * NOTE: I4 / I6 / I8 deliberately have no error code today — they are
23
+ * UNENFORCED warnings. The R4 CI gate (T10338) is the right home for the
24
+ * strict "every error has an error code" assertion; this test only
25
+ * validates the subset we already have wired.
26
+ */
27
+ const ADR_073_ERROR_CODE_MAP = {
28
+ I3: E_SAGA_INVARIANT_VIOLATION_I3,
29
+ I5: E_SAGA_INVARIANT_VIOLATION_I5,
30
+ I7: E_SAGA_INVARIANT_VIOLATION_I7,
31
+ };
32
+ describe('INVARIANTS_REGISTRY — central registry shape', () => {
33
+ it('exposes at least 8 entries (ADR-073 I1-I8 baseline)', () => {
34
+ const entries = Object.values(INVARIANTS_REGISTRY);
35
+ expect(entries.length).toBeGreaterThanOrEqual(8);
36
+ });
37
+ it('registers all eight ADR-073 invariants under predictable keys', () => {
38
+ for (let i = 1; i <= 8; i++) {
39
+ const key = `ADR-073.I${i}`;
40
+ expect(INVARIANTS_REGISTRY[key]).toBeDefined();
41
+ expect(INVARIANTS_REGISTRY[key]?.adr).toBe('ADR-073');
42
+ expect(INVARIANTS_REGISTRY[key]?.code).toBe(`I${i}`);
43
+ }
44
+ });
45
+ it('every entry carries a non-empty name and description', () => {
46
+ for (const entry of Object.values(INVARIANTS_REGISTRY)) {
47
+ expect(entry.name.length).toBeGreaterThan(0);
48
+ expect(entry.description.length).toBeGreaterThan(0);
49
+ }
50
+ });
51
+ it('every severity:"error" invariant has a non-null runtimeGate', () => {
52
+ const errorTier = Object.values(INVARIANTS_REGISTRY).filter((e) => e.severity === 'error');
53
+ expect(errorTier.length).toBeGreaterThan(0);
54
+ for (const entry of errorTier) {
55
+ expect(entry.runtimeGate).not.toBeNull();
56
+ // Triple is fully populated when present.
57
+ if (entry.runtimeGate !== null) {
58
+ expect(entry.runtimeGate.module.length).toBeGreaterThan(0);
59
+ expect(entry.runtimeGate.functionName.length).toBeGreaterThan(0);
60
+ }
61
+ }
62
+ });
63
+ });
64
+ describe('getInvariant — lookup helper', () => {
65
+ it('returns the ADR-073.I3 entry with the expected runtime guard', () => {
66
+ const i3 = getInvariant('ADR-073.I3');
67
+ expect(i3).toBeDefined();
68
+ expect(i3?.adr).toBe('ADR-073');
69
+ expect(i3?.code).toBe('I3');
70
+ expect(i3?.severity).toBe('error');
71
+ expect(i3?.runtimeGate?.functionName).toBe('assertSagaInvariantI3');
72
+ expect(i3?.runtimeGate?.module).toBe('packages/core/src/sagas/enforcement.ts');
73
+ });
74
+ it('returns undefined for an unregistered key', () => {
75
+ expect(getInvariant('ADR-999.X1')).toBeUndefined();
76
+ });
77
+ });
78
+ describe('getInvariantsByAdr — per-ADR enumeration', () => {
79
+ it('returns all eight ADR-073 invariants in declaration order', () => {
80
+ const adr073 = getInvariantsByAdr('ADR-073');
81
+ expect(adr073).toHaveLength(8);
82
+ expect(adr073.map((e) => e.code)).toEqual(['I1', 'I2', 'I3', 'I4', 'I5', 'I6', 'I7', 'I8']);
83
+ });
84
+ it('returns an empty array for an unknown ADR', () => {
85
+ expect(getInvariantsByAdr('ADR-DOES-NOT-EXIST')).toEqual([]);
86
+ });
87
+ });
88
+ describe('ADR_073_INVARIANTS — exported convenience binding', () => {
89
+ it('matches the entries surfaced via getInvariantsByAdr', () => {
90
+ expect(ADR_073_INVARIANTS).toHaveLength(8);
91
+ const enumerated = getInvariantsByAdr('ADR-073');
92
+ expect(enumerated).toHaveLength(ADR_073_INVARIANTS.length);
93
+ for (let i = 0; i < ADR_073_INVARIANTS.length; i++) {
94
+ expect(enumerated[i]?.code).toBe(ADR_073_INVARIANTS[i]?.code);
95
+ }
96
+ });
97
+ });
98
+ describe('error-code cross-reference (subset — R4 T10338 owns full strict gate)', () => {
99
+ it('every ADR-073 invariant with a runtimeGate has a known LAFS error code', () => {
100
+ // TODO(T10338 / R4): replace this targeted subset with a strict registry-wide
101
+ // assertion that walks every severity:"error" entry and confirms a matching
102
+ // LAFS error code (E_<ADR>_INVARIANT_VIOLATION_<CODE>) exists in errors.ts.
103
+ const adr073 = getInvariantsByAdr('ADR-073');
104
+ for (const entry of adr073) {
105
+ if (entry.runtimeGate !== null) {
106
+ const expected = ADR_073_ERROR_CODE_MAP[entry.code];
107
+ expect(expected).toBeDefined();
108
+ expect(typeof expected).toBe('string');
109
+ }
110
+ }
111
+ });
112
+ });
113
+ //# sourceMappingURL=registry.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.test.js","sourceRoot":"","sources":["../../../src/invariants/__tests__/registry.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,GAEpB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;GAUG;AACH,MAAM,sBAAsB,GAA2B;IACrD,EAAE,EAAE,6BAA6B;IACjC,EAAE,EAAE,6BAA6B;IACjC,EAAE,EAAE,6BAA6B;CAClC,CAAC;AAEF,QAAQ,CAAC,8CAA8C,EAAE,GAAG,EAAE;IAC5D,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;QAC7D,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;QACnD,MAAM,CAAC,OAAO,CAAC,MAAM,C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AC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,uEAAuE,EAAE,GAAG,EAAE;IACrF,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;QAChF,8EAA8E;QAC9E,4EAA4E;QAC5E,4EAA4E;QAC5E,MAAM,MAAM,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC7C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,IAAI,KAAK,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;gBAC/B,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACpD,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE,CAAC;gBAC/B,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * ADR-073 §1.2 invariants I1-I8 registered against the central invariants
3
+ * registry (`./index.ts`).
4
+ *
5
+ * The eight invariants govern the 4-tier task hierarchy (Saga → Epic → Task
6
+ * → Subtask) and the cross-tier rules that keep it healthy. I3, I5, I7 carry
7
+ * runtime guards (the `assertSagaInvariant{I3,I5,I7}` functions in
8
+ * `@cleocode/core` saga module) and surface as `E_SAGA_INVARIANT_VIOLATION_*`
9
+ * LAFS error codes. I1 + I2 are display/storage concerns enforced by DB
10
+ * CHECK constraints (added in W1.B T10329 migration) and ID generation
11
+ * conventions rather than runtime functions. I4, I6, I8 are
12
+ * orchestration/process invariants that lack a unified runtime guard today
13
+ * — they are marked `warning` and explicitly tagged as UNENFORCED
14
+ * (load-bearing) so downstream R6 doctor audits surface them visibly.
15
+ *
16
+ * @epic T10327 — E-INVARIANT-REGISTRY-SSOT
17
+ * @saga T10326 — SG-SUBSTRATE-RECONCILIATION
18
+ * @task T10335 — R1 (registry + ADR-073 I1-I8)
19
+ * @see ADR-073-above-epic-naming.md §1.2
20
+ */
21
+ import type { RegisteredInvariant } from './index.js';
22
+ /**
23
+ * ADR-073 invariants I1-I8 in declaration order.
24
+ *
25
+ * Severity mapping (see `RegisteredInvariant` JSDoc for tier semantics):
26
+ * - I1, I2 → `info` (display/storage; enforced by DB CHECK + ID convention).
27
+ * - I3, I5, I7 → `error` (LAFS error code + runtime guard mandatory).
28
+ * - I4, I6, I8 → `warning` (orchestration/process; UNENFORCED at runtime
29
+ * today, doctor audit only).
30
+ */
31
+ export declare const ADR_073_INVARIANTS: readonly RegisteredInvariant[];
32
+ //# sourceMappingURL=adr-073-saga.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adr-073-saga.d.ts","sourceRoot":"","sources":["../../src/invariants/adr-073-saga.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAiBtD;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,mBAAmB,EAuH3D,CAAC"}
@@ -0,0 +1,155 @@
1
+ /**
2
+ * ADR-073 §1.2 invariants I1-I8 registered against the central invariants
3
+ * registry (`./index.ts`).
4
+ *
5
+ * The eight invariants govern the 4-tier task hierarchy (Saga → Epic → Task
6
+ * → Subtask) and the cross-tier rules that keep it healthy. I3, I5, I7 carry
7
+ * runtime guards (the `assertSagaInvariant{I3,I5,I7}` functions in
8
+ * `@cleocode/core` saga module) and surface as `E_SAGA_INVARIANT_VIOLATION_*`
9
+ * LAFS error codes. I1 + I2 are display/storage concerns enforced by DB
10
+ * CHECK constraints (added in W1.B T10329 migration) and ID generation
11
+ * conventions rather than runtime functions. I4, I6, I8 are
12
+ * orchestration/process invariants that lack a unified runtime guard today
13
+ * — they are marked `warning` and explicitly tagged as UNENFORCED
14
+ * (load-bearing) so downstream R6 doctor audits surface them visibly.
15
+ *
16
+ * @epic T10327 — E-INVARIANT-REGISTRY-SSOT
17
+ * @saga T10326 — SG-SUBSTRATE-RECONCILIATION
18
+ * @task T10335 — R1 (registry + ADR-073 I1-I8)
19
+ * @see ADR-073-above-epic-naming.md §1.2
20
+ */
21
+ /**
22
+ * Module path that hosts the saga runtime-guard exports
23
+ * (`assertSagaInvariantI3`, `assertSagaInvariantI5`, `assertSagaInvariantI7`).
24
+ *
25
+ * Held as a constant so all four entries share the same source-of-truth
26
+ * pointer — touching the module path once propagates to every guard ref.
27
+ */
28
+ const SAGA_ENFORCEMENT_MODULE = 'packages/core/src/sagas/enforcement.ts';
29
+ /**
30
+ * Path to the canonical enforcement-tests file. Used as the `tests` ref
31
+ * for every I3 / I5 / I7 entry below.
32
+ */
33
+ const SAGA_ENFORCEMENT_TESTS = 'packages/core/src/sagas/__tests__/enforcement.test.ts';
34
+ /**
35
+ * ADR-073 invariants I1-I8 in declaration order.
36
+ *
37
+ * Severity mapping (see `RegisteredInvariant` JSDoc for tier semantics):
38
+ * - I1, I2 → `info` (display/storage; enforced by DB CHECK + ID convention).
39
+ * - I3, I5, I7 → `error` (LAFS error code + runtime guard mandatory).
40
+ * - I4, I6, I8 → `warning` (orchestration/process; UNENFORCED at runtime
41
+ * today, doctor audit only).
42
+ */
43
+ export const ADR_073_INVARIANTS = Object.freeze([
44
+ {
45
+ adr: 'ADR-073',
46
+ code: 'I1',
47
+ name: 'Storage uniformity',
48
+ description: 'All task IDs are stored as T#### and the type column is the canonical tier discriminator. There is no separate ID space for Sagas, Epics, Tasks, or Subtasks; label="saga" elevates a type="epic" row to Saga semantics.',
49
+ severity: 'info',
50
+ // I1 is enforced by the DB CHECK constraints introduced in W1.B (T10329)
51
+ // and by TASK_ID_PATTERN in packages/core/src/tasks/id-generator.ts —
52
+ // not by a single runtime function.
53
+ runtimeGate: null,
54
+ lintRule: null,
55
+ doctorAudit: null,
56
+ tests: ['packages/core/src/tasks/__tests__/id-generator.test.ts'],
57
+ },
58
+ {
59
+ adr: 'ADR-073',
60
+ code: 'I2',
61
+ name: 'Conceptual prefixes are display + import only',
62
+ description: "SG-, E-, T- (and Subtask's implicit absence) are documentation, CLI display, and import-mapping conventions only. They MUST NOT be used as DB primary keys — display-only with no runtime enforcement.",
63
+ severity: 'info',
64
+ // I2 is a display convention; the SG- prefix preservation snapshot
65
+ // (T10333) protects the display contract but there is no runtime guard.
66
+ runtimeGate: null,
67
+ lintRule: null,
68
+ doctorAudit: null,
69
+ tests: [],
70
+ },
71
+ {
72
+ adr: 'ADR-073',
73
+ code: 'I3',
74
+ name: 'Tier promotion mandatory when scope outgrows the tier',
75
+ description: 'A Subtask whose change exceeds 2 files or crosses a module boundary MUST be split or promoted to a sibling Task. A Task that requires more than one PR or wave MUST be split. An Epic that spans more than one release MUST be regrouped under a Saga.',
76
+ severity: 'error',
77
+ runtimeGate: {
78
+ module: SAGA_ENFORCEMENT_MODULE,
79
+ functionName: 'assertSagaInvariantI3',
80
+ },
81
+ lintRule: null,
82
+ doctorAudit: null,
83
+ tests: [SAGA_ENFORCEMENT_TESTS],
84
+ },
85
+ {
86
+ adr: 'ADR-073',
87
+ code: 'I4',
88
+ name: 'Ownership non-overlapping',
89
+ description: 'A single tier maps to a single orchestration role (per ADR-070). Workers MUST NOT spawn other Workers. Phase Leads MUST NOT own multiple Epics simultaneously. The Orchestrator MUST NOT spawn Workers directly when fan-out exceeds the ADR-070 migration threshold.',
90
+ severity: 'warning',
91
+ // I4 is partially covered by ADR-070 spawn guards but the unification
92
+ // with the registry happens in R2 (T10336 — ORC codes). For now this
93
+ // entry stays warning + runtimeGate:null to mark the gap explicitly.
94
+ runtimeGate: null,
95
+ lintRule: null,
96
+ doctorAudit: null,
97
+ tests: [],
98
+ },
99
+ {
100
+ adr: 'ADR-073',
101
+ code: 'I5',
102
+ name: 'Sagas link via groups, not parent',
103
+ description: 'task_relations.type="groups" is the ONLY relation type that links a Saga to its member Epics. The Saga row\'s parent_id MUST be NULL. Enforced at runtime by assertSagaInvariantI5 AND by the DB CHECK constraint from W1.B (T10329) on label="saga" rows.',
104
+ severity: 'error',
105
+ runtimeGate: {
106
+ module: SAGA_ENFORCEMENT_MODULE,
107
+ functionName: 'assertSagaInvariantI5',
108
+ },
109
+ lintRule: null,
110
+ doctorAudit: null,
111
+ tests: [SAGA_ENFORCEMENT_TESTS],
112
+ },
113
+ {
114
+ adr: 'ADR-073',
115
+ code: 'I6',
116
+ name: 'Acceptance criteria required at every tier',
117
+ description: 'Per ADR-066 §"Ownership Matrix" invariant #5, all tasks regardless of type or kind MUST have --acceptance set at creation time. No tier exemption exists. Delegated to the ADR-066 --acceptance requirement on cleo add/add-batch.',
118
+ severity: 'warning',
119
+ // I6 is enforced by ADR-066's CLI requirement, not by a saga runtime
120
+ // function. UNENFORCED in the saga module — left as a warning so R6
121
+ // doctor audit reminds operators of the upstream guard's location.
122
+ runtimeGate: null,
123
+ lintRule: null,
124
+ doctorAudit: null,
125
+ tests: [],
126
+ },
127
+ {
128
+ adr: 'ADR-073',
129
+ code: 'I7',
130
+ name: 'Maximum parent depth is 3',
131
+ description: 'The parent ladder Subtask → Task → Epic is fixed at depth 3 (hierarchy.maxDepth=3). Sagas do NOT consume depth — they attach via groups relations, not parent edges. Enforced at runtime by assertSagaInvariantI7.',
132
+ severity: 'error',
133
+ runtimeGate: {
134
+ module: SAGA_ENFORCEMENT_MODULE,
135
+ functionName: 'assertSagaInvariantI7',
136
+ },
137
+ lintRule: null,
138
+ doctorAudit: null,
139
+ tests: [SAGA_ENFORCEMENT_TESTS],
140
+ },
141
+ {
142
+ adr: 'ADR-073',
143
+ code: 'I8',
144
+ name: 'Subtask-to-PR aggregation rule',
145
+ description: "A Task ships as exactly one PR. The PR's commit history is the union of the Task's Subtask commits. A Subtask never produces its own PR; if a unit of work warrants its own PR, it is a Task, not a Subtask. UNENFORCED at runtime today — load-bearing convention enforced via code review and the lifecycle decision table.",
146
+ severity: 'warning',
147
+ // I8 is explicitly "UNENFORCED, load-bearing" — there is no automated
148
+ // gate. R6 doctor audit surfaces this entry so it stays visible.
149
+ runtimeGate: null,
150
+ lintRule: null,
151
+ doctorAudit: null,
152
+ tests: [],
153
+ },
154
+ ]);
155
+ //# sourceMappingURL=adr-073-saga.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adr-073-saga.js","sourceRoot":"","sources":["../../src/invariants/adr-073-saga.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;;;GAMG;AACH,MAAM,uBAAuB,GAAG,wCAAwC,CAAC;AAEzE;;;GAGG;AACH,MAAM,sBAAsB,GAAG,uDAAuD,CAAC;AAEvF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAmC,MAAM,CAAC,MAAM,CAAC;IAC9E;QACE,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,0NAA0N;QAC5N,QAAQ,EAAE,MAAM;QAChB,yEAAyE;QACzE,sEAAsE;QACtE,oCAAoC;QACpC,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,CAAC,wDAAwD,CAAC;KAClE;IACD;QACE,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,+CAA+C;QACrD,WAAW,EACT,wMAAwM;QAC1M,QAAQ,EAAE,MAAM;QAChB,mEAAmE;QACnE,wEAAwE;QACxE,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,EAAE;KACV;IACD;QACE,GAAG,EAAE,SAAS;QACd,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,uDAAuD;QAC7D,WAAW,EACT,wPAAwP;QAC1P,QAAQ,EAAE,OAAO;QACjB,WAAW,EAAE;YACX,MAAM,EAAE,uBAAuB;YAC/B,YAAY,EAAE,uBAAuB;SACtC;QACD,Q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AG,EAAE,SAAS;QACd,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,gCAAgC;QACtC,WAAW,EACT,+TAA+T;QACjU,QAAQ,EAAE,SAAS;QACnB,sEAAsE;QACtE,iEAAiE;QACjE,WAAW,EAAE,IAAI;QACjB,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,EAAE;KACV;CACF,CAAC,CAAC"}
@@ -0,0 +1,159 @@
1
+ /**
2
+ * Central invariants registry — SSoT for system-wide invariants surfaced via
3
+ * the SaGa T10326 SG-SUBSTRATE-RECONCILIATION programme (Epic T10327
4
+ * E-INVARIANT-REGISTRY-SSOT, Task T10335 R1).
5
+ *
6
+ * Every registered invariant carries the metadata needed to:
7
+ * 1. Reference its source ADR (e.g. `ADR-073` §1.2 for I1-I8).
8
+ * 2. Locate the runtime guard that enforces it (when one exists).
9
+ * 3. Bind the CI lint rule that protects it (when one exists).
10
+ * 4. Cross-reference test files that exercise it.
11
+ * 5. Render documentation via the downstream R8 auto-render pipeline.
12
+ *
13
+ * Downstream consumers:
14
+ * - R2 (T10336): register ADR-070 ORC codes into this same registry.
15
+ * - R4 (T10338): CI gate validates that every `severity:'error'` entry has
16
+ * a non-null `runtimeGate` AND a matching error-code in `errors.ts`.
17
+ * - R5 (T10339): refactor `packages/core/src/release/invariants/registry.ts`
18
+ * to consume the central registry instead of carrying its own list.
19
+ * - R6 (T10340): `cleo doctor --audit-invariants` walks the registry to
20
+ * produce a per-invariant audit report.
21
+ * - R8 (T10342): auto-render docs page from the registry.
22
+ *
23
+ * @epic T10327 — E-INVARIANT-REGISTRY-SSOT
24
+ * @saga T10326 — SG-SUBSTRATE-RECONCILIATION
25
+ * @task T10335 — R1: registry + ADR-073 I1-I8
26
+ * @see ADR-073-above-epic-naming.md §1.2
27
+ */
28
+ export { ADR_073_INVARIANTS } from './adr-073-saga.js';
29
+ /**
30
+ * Severity tier for a registered invariant.
31
+ *
32
+ * - `'error'` — runtime gate MUST exist; violation surfaces as LAFS error
33
+ * code (cross-checked by R4 CI gate).
34
+ * - `'warning'` — orchestration/process concern; surfaces via doctor audit
35
+ * but does not throw at runtime.
36
+ * - `'info'` — display or storage concern; enforced (if at all) by DB
37
+ * constraints or convention rather than a runtime function.
38
+ */
39
+ export type InvariantSeverity = 'info' | 'warning' | 'error';
40
+ /**
41
+ * Pointer to a runtime guard function that enforces an invariant.
42
+ *
43
+ * The `module` field is the package-relative import specifier
44
+ * (e.g. `packages/core/src/sagas/enforcement.ts`). The `functionName` is the
45
+ * exported identifier (e.g. `assertSagaInvariantI3`).
46
+ *
47
+ * R4 CI gate uses this triple to assert the guard actually exists and is
48
+ * exported with the expected name. R6 doctor audit uses it to render
49
+ * per-invariant enforcement provenance.
50
+ */
51
+ export interface InvariantRuntimeGate {
52
+ readonly module: string;
53
+ readonly functionName: string;
54
+ }
55
+ /**
56
+ * Pointer to a CI lint script that protects an invariant.
57
+ *
58
+ * The path is repo-rooted (e.g. `scripts/lint-saga-label-anti-pattern.mjs`).
59
+ */
60
+ export interface InvariantLintRule {
61
+ readonly lintScript: string;
62
+ }
63
+ /**
64
+ * Pointer to a `cleo doctor` audit that surfaces invariant violations.
65
+ *
66
+ * The lintScript field mirrors the CI gate pointer — many invariants share
67
+ * the same script between CI and doctor (e.g. saga-label anti-pattern).
68
+ */
69
+ export interface InvariantDoctorAudit {
70
+ readonly lintScript: string;
71
+ }
72
+ /**
73
+ * A registered invariant — one entry per `(adr, code)` pair.
74
+ *
75
+ * The `adr` + `code` combination forms the registry key
76
+ * (`${adr}.${code}`, e.g. `'ADR-073.I3'`). Lookups via `getInvariant`
77
+ * and per-ADR enumeration via `getInvariantsByAdr` use this convention.
78
+ *
79
+ * @see ADR-073-above-epic-naming.md §1.2 — original I1-I8 source.
80
+ */
81
+ export interface RegisteredInvariant {
82
+ /** Source ADR identifier, e.g. `'ADR-073'`. */
83
+ readonly adr: string;
84
+ /** Invariant code within the ADR, e.g. `'I3'` or `'ORC-001'`. */
85
+ readonly code: string;
86
+ /** Short human-readable name, e.g. `'Tier promotion mandatory'`. */
87
+ readonly name: string;
88
+ /** Full description (one or two sentences, no markdown). */
89
+ readonly description: string;
90
+ /** Severity tier — drives R4 CI gate strictness. */
91
+ readonly severity: InvariantSeverity;
92
+ /**
93
+ * Runtime guard function, or `null` when the invariant has no
94
+ * runtime-checkable form (display/storage/process concerns).
95
+ *
96
+ * Every `severity:'error'` invariant MUST set a non-null
97
+ * `runtimeGate` — enforced by the registry test suite (T10335 AC5)
98
+ * and by the R4 CI gate (T10338).
99
+ */
100
+ readonly runtimeGate: InvariantRuntimeGate | null;
101
+ /**
102
+ * Optional CI lint rule reference. Distinct from `runtimeGate` —
103
+ * `runtimeGate` runs in dispatch code, `lintRule` runs in CI.
104
+ */
105
+ readonly lintRule?: InvariantLintRule | null;
106
+ /**
107
+ * Optional `cleo doctor` audit reference. R6 consumes this field to
108
+ * decide which invariants surface in `cleo doctor --audit-invariants`.
109
+ */
110
+ readonly doctorAudit?: InvariantDoctorAudit | null;
111
+ /**
112
+ * Paths of test files that exercise the invariant. Used by R8 to render
113
+ * documentation pages with live test cross-references.
114
+ */
115
+ readonly tests: readonly string[];
116
+ /**
117
+ * Optional flag — set to `true` when the invariant is superseded but
118
+ * preserved for historical/import-mapping reasons. Defaults to `false`.
119
+ */
120
+ readonly deprecated?: boolean;
121
+ }
122
+ /**
123
+ * Central invariants registry — keyed by `${adr}.${code}`.
124
+ *
125
+ * Treat as read-only at runtime. Mutating this record is a contract
126
+ * violation; downstream consumers (R5 release-registry refactor, R6
127
+ * doctor audit, R8 docs renderer) assume immutability.
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * import { INVARIANTS_REGISTRY } from '@cleocode/contracts';
132
+ * const i3 = INVARIANTS_REGISTRY['ADR-073.I3'];
133
+ * if (i3?.runtimeGate) {
134
+ * console.log(`Guard: ${i3.runtimeGate.functionName}`);
135
+ * }
136
+ * ```
137
+ */
138
+ export declare const INVARIANTS_REGISTRY: Readonly<Record<string, RegisteredInvariant>>;
139
+ /**
140
+ * Look up a single invariant by its `${adr}.${code}` key.
141
+ *
142
+ * @example
143
+ * ```ts
144
+ * const i3 = getInvariant('ADR-073.I3');
145
+ * // → RegisteredInvariant for ADR-073 invariant I3
146
+ * ```
147
+ */
148
+ export declare function getInvariant(adrCode: string): RegisteredInvariant | undefined;
149
+ /**
150
+ * Return every invariant registered against a given ADR, in declaration order.
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * const adr073 = getInvariantsByAdr('ADR-073');
155
+ * // → array of I1..I8 entries
156
+ * ```
157
+ */
158
+ export declare function getInvariantsByAdr(adr: string): RegisteredInvariant[];
159
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/invariants/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAMH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD;;;;;;;;;GASG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAClD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACnD;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAiCD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAmB,CAAC;AAElG;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAE7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,EAAE,CASrE"}
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Central invariants registry — SSoT for system-wide invariants surfaced via
3
+ * the SaGa T10326 SG-SUBSTRATE-RECONCILIATION programme (Epic T10327
4
+ * E-INVARIANT-REGISTRY-SSOT, Task T10335 R1).
5
+ *
6
+ * Every registered invariant carries the metadata needed to:
7
+ * 1. Reference its source ADR (e.g. `ADR-073` §1.2 for I1-I8).
8
+ * 2. Locate the runtime guard that enforces it (when one exists).
9
+ * 3. Bind the CI lint rule that protects it (when one exists).
10
+ * 4. Cross-reference test files that exercise it.
11
+ * 5. Render documentation via the downstream R8 auto-render pipeline.
12
+ *
13
+ * Downstream consumers:
14
+ * - R2 (T10336): register ADR-070 ORC codes into this same registry.
15
+ * - R4 (T10338): CI gate validates that every `severity:'error'` entry has
16
+ * a non-null `runtimeGate` AND a matching error-code in `errors.ts`.
17
+ * - R5 (T10339): refactor `packages/core/src/release/invariants/registry.ts`
18
+ * to consume the central registry instead of carrying its own list.
19
+ * - R6 (T10340): `cleo doctor --audit-invariants` walks the registry to
20
+ * produce a per-invariant audit report.
21
+ * - R8 (T10342): auto-render docs page from the registry.
22
+ *
23
+ * @epic T10327 — E-INVARIANT-REGISTRY-SSOT
24
+ * @saga T10326 — SG-SUBSTRATE-RECONCILIATION
25
+ * @task T10335 — R1: registry + ADR-073 I1-I8
26
+ * @see ADR-073-above-epic-naming.md §1.2
27
+ */
28
+ import { ADR_073_INVARIANTS } from './adr-073-saga.js';
29
+ // Re-exported so consumers can import either the per-ADR list or the merged
30
+ // registry from one place.
31
+ export { ADR_073_INVARIANTS } from './adr-073-saga.js';
32
+ /**
33
+ * Compute the canonical registry key for an invariant.
34
+ *
35
+ * @internal
36
+ */
37
+ function buildKey(invariant) {
38
+ return `${invariant.adr}.${invariant.code}`;
39
+ }
40
+ /**
41
+ * Build the merged registry record from all per-ADR invariant modules.
42
+ *
43
+ * Future ADR modules (ADR-070 ORC codes via R2 T10336, etc.) append to
44
+ * the spread list below. Each module exports a `readonly RegisteredInvariant[]`
45
+ * — this index assembles them into a keyed record at module load time.
46
+ *
47
+ * @internal
48
+ */
49
+ function buildRegistry() {
50
+ const entries = [...ADR_073_INVARIANTS];
51
+ const record = {};
52
+ for (const entry of entries) {
53
+ const key = buildKey(entry);
54
+ if (record[key] !== undefined) {
55
+ throw new Error(`Duplicate invariant key registered: ${key}`);
56
+ }
57
+ record[key] = entry;
58
+ }
59
+ return Object.freeze(record);
60
+ }
61
+ /**
62
+ * Central invariants registry — keyed by `${adr}.${code}`.
63
+ *
64
+ * Treat as read-only at runtime. Mutating this record is a contract
65
+ * violation; downstream consumers (R5 release-registry refactor, R6
66
+ * doctor audit, R8 docs renderer) assume immutability.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * import { INVARIANTS_REGISTRY } from '@cleocode/contracts';
71
+ * const i3 = INVARIANTS_REGISTRY['ADR-073.I3'];
72
+ * if (i3?.runtimeGate) {
73
+ * console.log(`Guard: ${i3.runtimeGate.functionName}`);
74
+ * }
75
+ * ```
76
+ */
77
+ export const INVARIANTS_REGISTRY = buildRegistry();
78
+ /**
79
+ * Look up a single invariant by its `${adr}.${code}` key.
80
+ *
81
+ * @example
82
+ * ```ts
83
+ * const i3 = getInvariant('ADR-073.I3');
84
+ * // → RegisteredInvariant for ADR-073 invariant I3
85
+ * ```
86
+ */
87
+ export function getInvariant(adrCode) {
88
+ return INVARIANTS_REGISTRY[adrCode];
89
+ }
90
+ /**
91
+ * Return every invariant registered against a given ADR, in declaration order.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * const adr073 = getInvariantsByAdr('ADR-073');
96
+ * // → array of I1..I8 entries
97
+ * ```
98
+ */
99
+ export function getInvariantsByAdr(adr) {
100
+ const result = [];
101
+ for (const key of Object.keys(INVARIANTS_REGISTRY)) {
102
+ const entry = INVARIANTS_REGISTRY[key];
103
+ if (entry !== undefined && entry.adr === adr) {
104
+ result.push(entry);
105
+ }
106
+ }
107
+ return result;
108
+ }
109
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/invariants/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,4EAA4E;AAC5E,2BAA2B;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAoGvD;;;;GAIG;AACH,SAAS,QAAQ,CAAC,SAA8B;IAC9C,OAAO,GAAG,SAAS,CAAC,GAAG,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;AAC9C,C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