@hellraisercenobit/ai-engineering-gate 0.8.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.
Files changed (100) hide show
  1. package/README.md +82 -0
  2. package/agents/design-pattern-reviewer.md +40 -0
  3. package/agents/modern-typescript-reviewer.md +24 -0
  4. package/agents/testing-pattern-reviewer.md +23 -0
  5. package/bin/ai-engineering-gate.mjs +6 -0
  6. package/contracts/axi/axi-standard.md +273 -0
  7. package/contracts/axi/pin.json +36 -0
  8. package/contracts/members.json +58 -0
  9. package/contracts/schemas/arbitration.schema.json +45 -0
  10. package/contracts/schemas/decision-envelope.schema.json +215 -0
  11. package/contracts/schemas/declaration.schema.json +190 -0
  12. package/contracts/schemas/dispute.schema.json +67 -0
  13. package/contracts/schemas/evidence-append.schema.json +72 -0
  14. package/contracts/schemas/gate-output.schema.json +296 -0
  15. package/contracts/schemas/marker.schema.json +75 -0
  16. package/contracts/schemas/review-envelope.schema.json +378 -0
  17. package/contracts/schemas/verdict-record.schema.json +191 -0
  18. package/contracts/suite-contract.md +270 -0
  19. package/dist/ai-engineering-gate.mjs +2762 -0
  20. package/package.json +47 -0
  21. package/skills/engineering/review-design-patterns/LICENSE +6 -0
  22. package/skills/engineering/review-design-patterns/SKILL.md +196 -0
  23. package/skills/engineering/review-design-patterns/agents/openai.yaml +3 -0
  24. package/skills/engineering/review-design-patterns/references/smell-signatures.md +117 -0
  25. package/skills/engineering/review-design-patterns/review-design-patterns.yaml +25 -0
  26. package/skills/engineering/review-modern-typescript/LICENSE +21 -0
  27. package/skills/engineering/review-modern-typescript/SKILL.md +88 -0
  28. package/skills/engineering/review-modern-typescript/agents/openai.yaml +3 -0
  29. package/skills/engineering/review-modern-typescript/references/smell-signatures.md +36 -0
  30. package/skills/engineering/review-modern-typescript/review-modern-typescript.yaml +22 -0
  31. package/skills/engineering/review-testing-patterns/SKILL.md +108 -0
  32. package/skills/engineering/review-testing-patterns/agents/openai.yaml +4 -0
  33. package/skills/engineering/review-testing-patterns/references/compiler-profile.mjs +103 -0
  34. package/skills/engineering/review-testing-patterns/references/smell-signatures.md +30 -0
  35. package/skills/engineering/review-testing-patterns/review-testing-patterns.yaml +23 -0
  36. package/skills/engineering/transpose-design-patterns/LICENSE +6 -0
  37. package/skills/engineering/transpose-design-patterns/SKILL.md +231 -0
  38. package/skills/engineering/transpose-design-patterns/agents/openai.yaml +3 -0
  39. package/skills/engineering/transpose-design-patterns/references/arbitration.schema.json +45 -0
  40. package/skills/engineering/transpose-design-patterns/references/decision-envelope.schema.json +215 -0
  41. package/skills/engineering/transpose-design-patterns/references/declaration.schema.json +190 -0
  42. package/skills/engineering/transpose-design-patterns/references/design-decision-record.schema.json +731 -0
  43. package/skills/engineering/transpose-design-patterns/references/dispute.schema.json +67 -0
  44. package/skills/engineering/transpose-design-patterns/references/evidence-append.schema.json +72 -0
  45. package/skills/engineering/transpose-design-patterns/references/marker.schema.json +75 -0
  46. package/skills/engineering/transpose-design-patterns/references/pattern-catalog.md +305 -0
  47. package/skills/engineering/transpose-design-patterns/references/record.example.json +120 -0
  48. package/skills/engineering/transpose-design-patterns/references/review-envelope.schema.json +378 -0
  49. package/skills/engineering/transpose-design-patterns/references/suite-contract.md +270 -0
  50. package/skills/engineering/transpose-design-patterns/references/transpose-angular.md +224 -0
  51. package/skills/engineering/transpose-design-patterns/references/transpose-php.md +561 -0
  52. package/skills/engineering/transpose-design-patterns/references/transpose-quarkus.md +283 -0
  53. package/skills/engineering/transpose-design-patterns/references/transpose-react.md +256 -0
  54. package/skills/engineering/transpose-design-patterns/references/transpose-vanilla.md +204 -0
  55. package/skills/engineering/transpose-design-patterns/references/transpose-vue.md +234 -0
  56. package/skills/engineering/transpose-design-patterns/transpose-design-patterns.yaml +24 -0
  57. package/skills/engineering/transpose-modern-typescript/LICENSE +21 -0
  58. package/skills/engineering/transpose-modern-typescript/SKILL.md +90 -0
  59. package/skills/engineering/transpose-modern-typescript/agents/openai.yaml +3 -0
  60. package/skills/engineering/transpose-modern-typescript/references/arbitration.schema.json +45 -0
  61. package/skills/engineering/transpose-modern-typescript/references/catalog.md +38 -0
  62. package/skills/engineering/transpose-modern-typescript/references/collections.md +50 -0
  63. package/skills/engineering/transpose-modern-typescript/references/compatibility.md +61 -0
  64. package/skills/engineering/transpose-modern-typescript/references/decision-envelope.schema.json +215 -0
  65. package/skills/engineering/transpose-modern-typescript/references/decision-record.schema.json +830 -0
  66. package/skills/engineering/transpose-modern-typescript/references/declaration.schema.json +190 -0
  67. package/skills/engineering/transpose-modern-typescript/references/dispute.schema.json +67 -0
  68. package/skills/engineering/transpose-modern-typescript/references/evidence-append.schema.json +72 -0
  69. package/skills/engineering/transpose-modern-typescript/references/idioms.md +74 -0
  70. package/skills/engineering/transpose-modern-typescript/references/marker.schema.json +75 -0
  71. package/skills/engineering/transpose-modern-typescript/references/platform.md +147 -0
  72. package/skills/engineering/transpose-modern-typescript/references/record.example.json +172 -0
  73. package/skills/engineering/transpose-modern-typescript/references/record.md +37 -0
  74. package/skills/engineering/transpose-modern-typescript/references/review-envelope.schema.json +378 -0
  75. package/skills/engineering/transpose-modern-typescript/references/suite-contract.md +270 -0
  76. package/skills/engineering/transpose-modern-typescript/references/types.md +97 -0
  77. package/skills/engineering/transpose-modern-typescript/transpose-modern-typescript.yaml +22 -0
  78. package/skills/engineering/transpose-testing-patterns/SKILL.md +96 -0
  79. package/skills/engineering/transpose-testing-patterns/agents/openai.yaml +4 -0
  80. package/skills/engineering/transpose-testing-patterns/references/arbitration.schema.json +45 -0
  81. package/skills/engineering/transpose-testing-patterns/references/catalog.md +218 -0
  82. package/skills/engineering/transpose-testing-patterns/references/decision-envelope.schema.json +215 -0
  83. package/skills/engineering/transpose-testing-patterns/references/decision-record.schema.json +857 -0
  84. package/skills/engineering/transpose-testing-patterns/references/declaration.schema.json +190 -0
  85. package/skills/engineering/transpose-testing-patterns/references/detect-adapter.mjs +98 -0
  86. package/skills/engineering/transpose-testing-patterns/references/dispute.schema.json +67 -0
  87. package/skills/engineering/transpose-testing-patterns/references/doubles-data.md +45 -0
  88. package/skills/engineering/transpose-testing-patterns/references/evidence-append.schema.json +72 -0
  89. package/skills/engineering/transpose-testing-patterns/references/journal-event.schema.json +115 -0
  90. package/skills/engineering/transpose-testing-patterns/references/marker.schema.json +75 -0
  91. package/skills/engineering/transpose-testing-patterns/references/record.example.json +230 -0
  92. package/skills/engineering/transpose-testing-patterns/references/record.md +25 -0
  93. package/skills/engineering/transpose-testing-patterns/references/review-envelope.schema.json +378 -0
  94. package/skills/engineering/transpose-testing-patterns/references/suite-contract.md +270 -0
  95. package/skills/engineering/transpose-testing-patterns/references/tdd.md +62 -0
  96. package/skills/engineering/transpose-testing-patterns/references/transpose-codeception.md +84 -0
  97. package/skills/engineering/transpose-testing-patterns/references/transpose-karma-jasmine-angular.md +73 -0
  98. package/skills/engineering/transpose-testing-patterns/references/transpose-vitest.md +111 -0
  99. package/skills/engineering/transpose-testing-patterns/references/typescript.md +42 -0
  100. package/skills/engineering/transpose-testing-patterns/transpose-testing-patterns.yaml +23 -0
@@ -0,0 +1,218 @@
1
+ # Testing catalog 1.0.0
2
+
3
+ Normative source for this dimension. Read the inventory first, then the relevant rules.
4
+ The adapter chooses runner APIs; it cannot weaken these guarantees. Sources inform the
5
+ rules, not a second protocol. Examples from the user's TDD craftsmanship report are
6
+ contextual observations, not universal style requirements.
7
+
8
+ ## Inventory and routing
9
+
10
+ Record applicability, sites and reason for each axis: `behavior` (TP-01-06), `process`
11
+ (TP-07), `doubles` (TP-08), `data` (TP-09), `isolation` (TP-10), `testability` (TP-11),
12
+ `types` (TP-12), `async-lifetime` (TP-13), `environment` (TP-14), `oracle` (TP-15),
13
+ `execution` (TP-16). Absence of a test for an applicable risk is not non-applicability.
14
+
15
+ Choose family, level, double and arrangement independently. A contract test can execute
16
+ real infrastructure; a spy need not use a mock framework. `none` means no specialized
17
+ pattern or extra tool helps. Direct tests can still be added under `none`. `retain` describes an action and can
18
+ retain a named pattern. Both require comparison with alternatives and explicit limits.
19
+
20
+ ## TP-01 - Direct behavior
21
+
22
+ - **Intent/use:** pure calculation, transformation or parsing needs an input/output oracle.
23
+ - **Compare/trade-off:** direct examples are easy to diagnose; tables reduce repeated setup;
24
+ properties widen an input space at generator/debugging cost. Start with a discriminating example.
25
+ - **Avoid/invariant:** do not calculate the expected answer with the SUT's algorithm. Observe
26
+ boundary values and invalid input when contracted, without inventing a builder or port.
27
+ - **Defense:** a named domain helper can improve understanding; a literal is not mandatory
28
+ when an independent specification supplies the oracle.
29
+ - **Sources:** [Test Desiderata](https://kentbeck.github.io/TestDesiderata/), [properties](https://fast-check.dev/docs/introduction/).
30
+
31
+ ## TP-02 - State and sequences
32
+
33
+ - **Intent/use:** aggregates, events and state machines depend on history and legal transitions.
34
+ - **Compare/trade-off:** public operations and observations resist representation changes;
35
+ model-based sequences explore more histories at greater model complexity.
36
+ - **Avoid/invariant:** no private-state seeding or test-only getter to bypass invariants.
37
+ Verify legal and rejected transitions, including that rejection preserves promised state.
38
+ - **Defense:** a public read model is a legitimate observable contract; fields are not
39
+ automatically private merely because the tests read them.
40
+ - **Sources:** [model-based testing](https://fast-check.dev/docs/advanced/model-based-testing/).
41
+
42
+ ## TP-03 - Contractual interactions
43
+
44
+ - **Intent/use:** orchestration has an externally meaningful effect or protocol.
45
+ - **Compare/trade-off:** observe resulting state when sufficient; record boundary messages
46
+ for content/absence/order/cardinality contracts. Isolate only the costly or controlled boundary.
47
+ - **Avoid/invariant:** a called-method assertion alone does not prove business policy.
48
+ Detect omitted, wrong or duplicate outputs required by the contract.
49
+ - **Defense:** order/count assertions are valid for idempotence, retry and protocols;
50
+ they are coupling only when they prescribe an interchangeable internal traversal.
51
+ - **Sources:** [Mocks Aren't Stubs](https://martinfowler.com/articles/mocksArentStubs.html).
52
+
53
+ ## TP-04 - Substitutable boundaries
54
+
55
+ - **Intent/use:** claim a fake represents an actual adapter for a relevant port contract.
56
+ - **Compare/trade-off:** run applicable shared scenarios against fake and real isolated
57
+ adapter; real checks cost setup but expose fake drift. A stub may suffice without a fidelity claim.
58
+ - **Avoid/invariant:** two fakes do not prove a production adapter. Verify key, missing-value,
59
+ replacement and failure semantics as applicable; name transaction/concurrency/provider limits.
60
+ - **Defense:** no contract suite is required for an imaginary implementation; scope the
61
+ equivalence claim to the exercised behavior, not complete infrastructure fidelity.
62
+ - **Sources:** [Contract Test](https://martinfowler.com/bliki/ContractTest.html).
63
+
64
+ ## TP-05 - Properties and models
65
+
66
+ - **Intent/use:** meaningful invariants span many inputs or operation histories.
67
+ - **Compare/trade-off:** examples remain best for an obvious boundary; generated cases
68
+ explore combinations but need useful generators, shrinking and reproducible failures.
69
+ - **Avoid/invariant:** do not copy the implementation into the model or assert a tautology.
70
+ Keep seed, replay path and reduced counterexample; the model must be simpler and independent.
71
+ - **Defense:** metamorphic/round-trip properties can be useful, but shared defects can pass
72
+ both directions; supplement with an independent known case where that risk matters.
73
+ - **Sources:** [fast-check](https://fast-check.dev/docs/introduction/), [models](https://fast-check.dev/docs/advanced/model-based-testing/).
74
+
75
+ ## TP-06 - Characterization
76
+
77
+ - **Intent/use:** preserve legacy behavior before changing its design.
78
+ - **Compare/trade-off:** direct examples clarify semantics; a reviewed, bounded snapshot can
79
+ protect a stable format. Characterization records observations, not endorsement of bugs.
80
+ - **Avoid/invariant:** run against the real reference before refactoring. A bug correction
81
+ needs its own changed expectation and cycle, not an equivalence claim.
82
+ - **Defense:** unavailable history limits process evidence, not the value of a present
83
+ audit. Large unread snapshots or output captured only after the rewrite are weak evidence.
84
+ - **Sources:** [Test Desiderata](https://kentbeck.github.io/TestDesiderata/).
85
+
86
+ ## TP-07 - Observed TDD
87
+
88
+ - **Intent/use:** a change explicitly claims tests guided implementation.
89
+ - **Compare/trade-off:** [TDD](tdd.md) gives behavioral/static RED, frozen oracle, GREEN and
90
+ pressure-led refactor. Existing coverage and audit modes avoid fabricated history.
91
+ - **Avoid/invariant:** setup/import failures are not behavioral RED; weakening a test restarts
92
+ the cycle. Preserve raw tool output and reinspectable states, not just timestamps/hashes.
93
+ - **Defense:** minimal skeletons can reach an assertion; natural generalization is allowed.
94
+ No empty reflection commit, per-RED commit or fixed step size is required.
95
+ - **Sources:** [TDD](https://martinfowler.com/bliki/TestDrivenDevelopment.html).
96
+
97
+ ## TP-08 - Double role
98
+
99
+ - **Intent/use:** a collaborator needs controlled input, observable effects or realistic state.
100
+ - **Compare/trade-off:** compare real/no double, stub, spy, fake and mock by role and fidelity;
101
+ [doubles/data](doubles-data.md) gives the decision tree. `vi.fn` is not inherently a strict mock.
102
+ - **Avoid/invariant:** do not replace the business rule under test with its expected answer.
103
+ Keep structural types honest; a fake's policy needs its own product owner and evidence.
104
+ - **Defense:** typed framework functions and handwritten objects can both be simplest.
105
+ Classes, files, mutable spy flags and naming prefixes are not requirements.
106
+ - **Sources:** [Test Double](https://martinfowler.com/bliki/TestDouble.html), [Vitest mocks](https://vitest.dev/guide/mocking).
107
+
108
+ ## TP-09 - Arrangement
109
+
110
+ - **Intent/use:** scenario setup obscures meaning or repeated resource lifetime needs ownership.
111
+ - **Compare/trade-off:** inline values, fresh factory, fixture, object mother and builder have
112
+ different costs. Use a builder for meaningful construction/history, not a parameter-count rule.
113
+ - **Avoid/invariant:** decisive inputs stay visible; valid setup uses legitimate APIs; mutable
114
+ data is fresh and resource scope/cleanup explicit. Do not hide clock controls a scenario needs.
115
+ - **Defense:** small duplication can be clearer; complex helper tests can be legitimate but
116
+ are not evidence of the product behavior. Hooks are not forbidden.
117
+ - **Sources:** [Test Context](https://vitest.dev/guide/test-context), [Object Mother](https://martinfowler.com/bliki/ObjectMother.html).
118
+
119
+ ## TP-10 - Isolation and sociability
120
+
121
+ - **Intent/use:** decide what real collaboration the chosen observation needs.
122
+ - **Compare/trade-off:** cheap deterministic domain collaborators usually work well together;
123
+ isolation helps expensive boundaries, combinatorics or diagnosis but loses integration signal.
124
+ - **Avoid/invariant:** do not mock every object by default or demand all-real dependencies.
125
+ Name which policy the test really exercises and what integration risk remains.
126
+ - **Defense:** a narrow isolated test can be the correct fast diagnostic when an integration
127
+ check protects the boundary. Neither school wins by naming convention.
128
+ - **Sources:** [Unit Test](https://martinfowler.com/bliki/UnitTest.html).
129
+
130
+ ## TP-11 - Testability seam
131
+
132
+ - **Intent/use:** nondeterminism or entangled responsibilities prevent a useful observation.
133
+ - **Compare/trade-off:** use the highest existing seam with a precise signal; functional
134
+ core/imperative shell, ports and hexagonal testing can separate policy from effects.
135
+ - **Avoid/invariant:** testing identifies observation/control needs; design owns structural
136
+ response. Do not expose private internals or build a port solely to assert a traversal.
137
+ - **Defense:** extracting a real unstable boundary is legitimate even when first discovered
138
+ through a test; no full hexagonal architecture or new catalog pattern is mandatory.
139
+ - **Sources:** [Hexagonal Architecture](https://alistair.cockburn.us/hexagonal-architecture/).
140
+
141
+ ## TP-12 - TypeScript guarantees
142
+
143
+ - **Intent/use:** callers depend on static contracts or untrusted values cross runtime boundaries.
144
+ - **Compare/trade-off:** [TypeScript](typescript.md) separates runtime, compilation and
145
+ consumer type assertions. Test significant inference/forbidden uses, not every declaration.
146
+ - **Avoid/invariant:** runner green does not mean typecheck green. Negative types must fail
147
+ for the intended diagnostic. Brands/readonly are not runtime validation/immutability.
148
+ - **Defense:** a justified assertion at a validated boundary can be correct; casts that hide
149
+ an invalid double or missing validator cannot prove the contract.
150
+ - **Sources:** [Testing Types](https://vitest.dev/guide/testing-types), [TS handbook](https://www.typescriptlang.org/docs/handbook/2/narrowing.html).
151
+
152
+ ## TP-13 - Async, time and lifetime
153
+
154
+ - **Intent/use:** results depend on time, random inputs, scheduling, concurrency or consumption.
155
+ - **Compare/trade-off:** time as input, controlled clock, scheduler timers and controlled
156
+ barriers address different forces. Prefer deterministic observation over arbitrary sleeps.
157
+ - **Avoid/invariant:** await promises/assertions; force real overlap for exclusion claims.
158
+ Check cancellation and resource cleanup, including failure and partial iteration where promised.
159
+ - **Defense:** fake timers are useful for scheduling but do not prove mutual exclusion;
160
+ random sources can remain real when they do not affect the asserted guarantee.
161
+ - **Sources:** [async](https://vitest.dev/guide/learn/async), [timers](https://vitest.dev/guide/mocking/timers).
162
+
163
+ ## TP-14 - Environment fidelity
164
+
165
+ - **Intent/use:** browser or infrastructure behavior is itself the guarantee.
166
+ - **Compare/trade-off:** Node, simulated DOM, real Browser Mode, HTTP interception, local
167
+ server and isolated real infrastructure trade speed for fidelity. Choose the smallest adequate one.
168
+ - **Avoid/invariant:** simulated DOM does not prove native browser behavior; MSW does not
169
+ prove a remote provider. Execute relevant real adapter/browser cases and disclose engine limits.
170
+ - **Defense:** simulation is enough for many component contracts; a real browser for a pure
171
+ function adds no useful guarantee. Playwright provider remains the Vitest runner adapter.
172
+ - **Sources:** [Browser Mode](https://vitest.dev/guide/browser/), [requests](https://vitest.dev/guide/mocking/requests).
173
+
174
+ ## TP-15 - Oracle and refactor resistance
175
+
176
+ - **Intent/use:** judge what a test really proves and whether its failure is useful.
177
+ - **Compare/trade-off:** explicit values, contract-specific errors, state and boundary
178
+ interactions can all be strong oracles. Prefer the one exposing a plausible defect clearly.
179
+ - **Avoid/invariant:** names/assertions written by the builder are not requirements. Reject
180
+ wrong values/errors, missing rejection and accidental exceptions; do not fix internal structure.
181
+ - **Defense:** contractual ordering or a bounded reviewed snapshot can be necessary.
182
+ Require demonstrated coupling or missed guarantee, not line-count/style preferences.
183
+ - **Sources:** [Test Desiderata](https://kentbeck.github.io/TestDesiderata/), [expect](https://vitest.dev/api/expect).
184
+
185
+ Every site whose action applies a test change names its oracle with a value from each set below and
186
+ the oracle statement itself. Only a `retain` action is exempt; a `none` choice that adds direct tests
187
+ is not. A decision is incomplete until its oracle exists.
188
+
189
+ | Oracle kind | Where the expected value comes from |
190
+ | --- | --- |
191
+ | `specification` | a written requirement, public contract or standard outside this change |
192
+ | `invariant` | a property that must hold for every input, not one example |
193
+ | `domain-example` | a case a domain expert or an existing document supplies |
194
+ | `independent-calculation` | a second computation that does not share the implementation's path |
195
+ | `boundary` | the defined behavior at a limit, an empty set or an error edge |
196
+
197
+ | Independence | Meaning |
198
+ | --- | --- |
199
+ | `independent` | the expected value is derived without executing or transcribing the implementation |
200
+ | `dependent` | the expected value comes from the implementation, with the reason it must |
201
+
202
+ A `dependent` oracle needs its reason, and a reviewer weighs whether that reason survives: a test whose
203
+ expectation is copied from the code it tests reproduces the same defect. Beside the oracle, the site
204
+ names the **plausible defect** it discriminates - a realistic wrong behavior, not an uncovered line -
205
+ and how the test tells the two apart. "What bug does this catch" is the question; "what path does this
206
+ run" is not an answer.
207
+
208
+ ## TP-16 - Executed evidence
209
+
210
+ - **Intent/use:** a suite or workflow claims successful validation.
211
+ - **Compare/trade-off:** map required scenarios to discovered and executed tests, inspect
212
+ skips/todos/expected failures/retries, run the actual checker and applicable project gates.
213
+ - **Avoid/invariant:** global green, coverage percentage or schema validity alone is not
214
+ completion. Include relevant unimported sources in coverage and honor project thresholds.
215
+ Cleanup must hold on failure paths; tool outputs/state references stay reviewable externally.
216
+ - **Defense:** a justified skip/retry can be an explicit limitation, but cannot count as proof
217
+ of a required guarantee. No universal coverage target or mutation framework is imposed.
218
+ - **Sources:** [coverage](https://vitest.dev/guide/coverage), [retry](https://vitest.dev/config/retry), [test API](https://vitest.dev/api/test).
@@ -0,0 +1,215 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/hellraisercenobit/skills/blob/main/contracts/schemas/decision-envelope.schema.json",
4
+ "title": "Decision record envelope 1.0.0",
5
+ "description": "The outer shape every dimension's decision record shares. Enforcement validates a record against this envelope and against the dimension's own schema; the dimension-specific body stays opaque here. Applicability is not a record field: it lives in the declaration.",
6
+ "type": "object",
7
+ "required": [
8
+ "dimension",
9
+ "schemaVersion",
10
+ "catalogVersion",
11
+ "contractVersions",
12
+ "need",
13
+ "scope",
14
+ "base",
15
+ "revision",
16
+ "cites",
17
+ "plans"
18
+ ],
19
+ "properties": {
20
+ "dimension": {
21
+ "type": "string",
22
+ "minLength": 1
23
+ },
24
+ "schemaVersion": {
25
+ "type": "string",
26
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
27
+ },
28
+ "catalogVersion": {
29
+ "type": "string",
30
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
31
+ },
32
+ "contractVersions": {
33
+ "description": "The contract versions this record's member supports.",
34
+ "type": "array",
35
+ "minItems": 1,
36
+ "uniqueItems": true,
37
+ "items": {
38
+ "type": "string",
39
+ "pattern": "^\\d+\\.\\d+\\.\\d+$"
40
+ }
41
+ },
42
+ "need": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "scope": {
47
+ "type": "array",
48
+ "minItems": 1,
49
+ "items": {
50
+ "type": "string",
51
+ "minLength": 1
52
+ }
53
+ },
54
+ "base": {
55
+ "type": "string",
56
+ "minLength": 1
57
+ },
58
+ "revision": {
59
+ "$ref": "#/$defs/revision"
60
+ },
61
+ "cites": {
62
+ "description": "Artifacts and evidence sources that exist when the record is validated. A dangling path refuses the record; every cited path is hashed with the revision.",
63
+ "type": "array",
64
+ "items": {
65
+ "$ref": "#/$defs/citation"
66
+ }
67
+ },
68
+ "plans": {
69
+ "description": "Artifacts the record commits to produce. Not checked when the record is written, so a record can precede the first affected write; required to exist before a review begins, is filed or is dispatched.",
70
+ "type": "array",
71
+ "items": {
72
+ "$ref": "#/$defs/plan"
73
+ }
74
+ }
75
+ },
76
+ "$defs": {
77
+ "citation": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": [
81
+ "path",
82
+ "checkedAt",
83
+ "claim",
84
+ "covers"
85
+ ],
86
+ "properties": {
87
+ "path": {
88
+ "description": "A repository-relative path, or a path under the task's evidence. Both are checked for existence.",
89
+ "type": "string",
90
+ "minLength": 1
91
+ },
92
+ "checkedAt": {
93
+ "type": "string",
94
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
95
+ },
96
+ "claim": {
97
+ "type": "string",
98
+ "minLength": 1
99
+ },
100
+ "covers": {
101
+ "type": "array",
102
+ "minItems": 1,
103
+ "items": {
104
+ "type": "string",
105
+ "minLength": 1
106
+ }
107
+ },
108
+ "searched": {
109
+ "description": "Paths consulted and not found. Present when the citation supports a claim of unknown about a checkable fact.",
110
+ "type": "array",
111
+ "minItems": 1,
112
+ "items": {
113
+ "type": "string",
114
+ "minLength": 1
115
+ }
116
+ }
117
+ }
118
+ },
119
+ "plan": {
120
+ "type": "object",
121
+ "additionalProperties": false,
122
+ "required": [
123
+ "path",
124
+ "role"
125
+ ],
126
+ "properties": {
127
+ "path": {
128
+ "type": "string",
129
+ "minLength": 1
130
+ },
131
+ "role": {
132
+ "description": "A role the dimension defines. Testing patterns uses `test` and `production` so a replay knows which files stand alone.",
133
+ "type": "string",
134
+ "minLength": 1
135
+ }
136
+ }
137
+ },
138
+ "revision": {
139
+ "type": "object",
140
+ "additionalProperties": false,
141
+ "required": [
142
+ "number",
143
+ "previous",
144
+ "reason"
145
+ ],
146
+ "properties": {
147
+ "number": {
148
+ "type": "integer",
149
+ "minimum": 1
150
+ },
151
+ "previous": {
152
+ "type": [
153
+ "string",
154
+ "null"
155
+ ],
156
+ "minLength": 1
157
+ },
158
+ "reason": {
159
+ "type": "string",
160
+ "minLength": 1
161
+ },
162
+ "changed": {
163
+ "description": "The cited paths this revision changed. Enforcement verifies their hashes differ from the previous revision's snapshot; absent, at least one cited path must differ.",
164
+ "type": "array",
165
+ "minItems": 1,
166
+ "uniqueItems": true,
167
+ "items": {
168
+ "type": "string",
169
+ "minLength": 1
170
+ }
171
+ },
172
+ "addresses": {
173
+ "description": "Finding identifiers this revision closes. A judgment finding is closed by a revision that cites it together with a moved state.",
174
+ "type": "array",
175
+ "minItems": 1,
176
+ "uniqueItems": true,
177
+ "items": {
178
+ "type": "string",
179
+ "minLength": 1
180
+ }
181
+ }
182
+ },
183
+ "allOf": [
184
+ {
185
+ "if": {
186
+ "properties": {
187
+ "number": {
188
+ "type": "integer",
189
+ "minimum": 2
190
+ }
191
+ },
192
+ "required": [
193
+ "number"
194
+ ]
195
+ },
196
+ "then": {
197
+ "properties": {
198
+ "previous": {
199
+ "type": "string",
200
+ "minLength": 1
201
+ }
202
+ }
203
+ },
204
+ "else": {
205
+ "properties": {
206
+ "previous": {
207
+ "type": "null"
208
+ }
209
+ }
210
+ }
211
+ }
212
+ ]
213
+ }
214
+ }
215
+ }