@tiphys/kernel 0.0.0 → 0.2.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.
- package/AGENTS.md +663 -0
- package/LICENSE +202 -0
- package/assurance-modes.yaml +299 -0
- package/checklists/clean-room.yaml +325 -0
- package/checklists/env-failure-diagnosis.yaml +68 -0
- package/checklists/flake-playbook.yaml +68 -0
- package/checklists/hazard-review.yaml +144 -0
- package/checklists/plan-review.yaml +103 -0
- package/dist/bin/tiphys.d.ts +2 -0
- package/dist/bin/tiphys.js +92 -0
- package/dist/src/adapters/load.d.ts +202 -0
- package/dist/src/adapters/load.js +440 -0
- package/dist/src/brief.d.ts +32 -0
- package/dist/src/brief.js +66 -0
- package/dist/src/checklists.d.ts +169 -0
- package/dist/src/checklists.js +310 -0
- package/dist/src/checks.d.ts +1539 -0
- package/dist/src/checks.js +5025 -0
- package/dist/src/cli.d.ts +9 -0
- package/dist/src/cli.js +68 -0
- package/dist/src/commands/brief.d.ts +92 -0
- package/dist/src/commands/brief.js +343 -0
- package/dist/src/commands/checklist.d.ts +42 -0
- package/dist/src/commands/checklist.js +168 -0
- package/dist/src/commands/cutover.d.ts +35 -0
- package/dist/src/commands/cutover.js +448 -0
- package/dist/src/commands/doctor.d.ts +264 -0
- package/dist/src/commands/doctor.js +1546 -0
- package/dist/src/commands/gates.d.ts +9 -0
- package/dist/src/commands/gates.js +360 -0
- package/dist/src/commands/init.d.ts +30 -0
- package/dist/src/commands/init.js +177 -0
- package/dist/src/commands/lock.d.ts +34 -0
- package/dist/src/commands/lock.js +340 -0
- package/dist/src/commands/mode.d.ts +40 -0
- package/dist/src/commands/mode.js +134 -0
- package/dist/src/commands/next.d.ts +130 -0
- package/dist/src/commands/next.js +597 -0
- package/dist/src/commands/plan.d.ts +20 -0
- package/dist/src/commands/plan.js +105 -0
- package/dist/src/commands/pool.d.ts +1 -0
- package/dist/src/commands/pool.js +139 -0
- package/dist/src/commands/resume.d.ts +1 -0
- package/dist/src/commands/resume.js +88 -0
- package/dist/src/commands/spawn.d.ts +1 -0
- package/dist/src/commands/spawn.js +195 -0
- package/dist/src/commands/status.d.ts +21 -0
- package/dist/src/commands/status.js +122 -0
- package/dist/src/commands/sync.d.ts +47 -0
- package/dist/src/commands/sync.js +341 -0
- package/dist/src/commands/teardown.d.ts +1 -0
- package/dist/src/commands/teardown.js +87 -0
- package/dist/src/commands/tuition.d.ts +21 -0
- package/dist/src/commands/tuition.js +218 -0
- package/dist/src/commands/validate.d.ts +78 -0
- package/dist/src/commands/validate.js +430 -0
- package/dist/src/commands/watch.d.ts +1 -0
- package/dist/src/commands/watch.js +172 -0
- package/dist/src/cutover.d.ts +584 -0
- package/dist/src/cutover.js +1444 -0
- package/dist/src/exclusion.d.ts +389 -0
- package/dist/src/exclusion.js +843 -0
- package/dist/src/exec/env.d.ts +278 -0
- package/dist/src/exec/env.js +334 -0
- package/dist/src/fleet.d.ts +223 -0
- package/dist/src/fleet.js +298 -0
- package/dist/src/gates/adapters/http-json.d.ts +5 -0
- package/dist/src/gates/adapters/http-json.js +283 -0
- package/dist/src/gates/adapters/migrations-command.d.ts +1 -0
- package/dist/src/gates/adapters/migrations-command.js +373 -0
- package/dist/src/gates/citations.d.ts +408 -0
- package/dist/src/gates/citations.js +1169 -0
- package/dist/src/gates/coverage.d.ts +375 -0
- package/dist/src/gates/coverage.js +836 -0
- package/dist/src/gates/credentials.d.ts +233 -0
- package/dist/src/gates/credentials.js +752 -0
- package/dist/src/gates/deploy.d.ts +1 -0
- package/dist/src/gates/deploy.js +33 -0
- package/dist/src/gates/gate-classes.d.ts +56 -0
- package/dist/src/gates/gate-classes.js +633 -0
- package/dist/src/gates/manifest.d.ts +99 -0
- package/dist/src/gates/manifest.js +208 -0
- package/dist/src/gates/merge-preconditions.d.ts +319 -0
- package/dist/src/gates/merge-preconditions.js +932 -0
- package/dist/src/gates/migrations.d.ts +1 -0
- package/dist/src/gates/migrations.js +36 -0
- package/dist/src/gates/pin.d.ts +114 -0
- package/dist/src/gates/pin.js +154 -0
- package/dist/src/gates/red-witness.d.ts +22 -0
- package/dist/src/gates/red-witness.js +482 -0
- package/dist/src/gates/release.d.ts +283 -0
- package/dist/src/gates/release.js +820 -0
- package/dist/src/gates/result.d.ts +116 -0
- package/dist/src/gates/result.js +91 -0
- package/dist/src/gates/run.d.ts +614 -0
- package/dist/src/gates/run.js +1614 -0
- package/dist/src/gates/schemas/citation-config.schema.json +59 -0
- package/dist/src/gates/schemas/coverage-config.schema.json +77 -0
- package/dist/src/gates/schemas/gate-manifest.schema.json +125 -0
- package/dist/src/gates/schemas/gate-result.schema.json +160 -0
- package/dist/src/gates/schemas/phase-declaration.schema.json +87 -0
- package/dist/src/gates/schemas/release-record.schema.json +119 -0
- package/dist/src/gates/schemas/verifier-config.schema.json +101 -0
- package/dist/src/gates/schemas/witness-spec.schema.json +110 -0
- package/dist/src/gates/scope.d.ts +131 -0
- package/dist/src/gates/scope.js +1018 -0
- package/dist/src/gates/suite.d.ts +217 -0
- package/dist/src/gates/suite.js +968 -0
- package/dist/src/gates/validate.d.ts +121 -0
- package/dist/src/gates/validate.js +414 -0
- package/dist/src/hooks.d.ts +84 -0
- package/dist/src/hooks.js +125 -0
- package/dist/src/index.d.ts +31 -0
- package/dist/src/index.js +30 -0
- package/dist/src/liveness.d.ts +321 -0
- package/dist/src/liveness.js +396 -0
- package/dist/src/lock.d.ts +256 -0
- package/dist/src/lock.js +792 -0
- package/dist/src/model-resolution.d.ts +159 -0
- package/dist/src/model-resolution.js +307 -0
- package/dist/src/modes.d.ts +149 -0
- package/dist/src/modes.js +258 -0
- package/dist/src/path-identity.d.ts +34 -0
- package/dist/src/path-identity.js +48 -0
- package/dist/src/plan.d.ts +73 -0
- package/dist/src/plan.js +153 -0
- package/dist/src/pool.d.ts +326 -0
- package/dist/src/pool.js +988 -0
- package/dist/src/roles.d.ts +461 -0
- package/dist/src/roles.js +776 -0
- package/dist/src/spawn.d.ts +482 -0
- package/dist/src/spawn.js +1003 -0
- package/dist/src/status.d.ts +116 -0
- package/dist/src/status.js +148 -0
- package/dist/src/task.d.ts +504 -0
- package/dist/src/task.js +307 -0
- package/dist/src/teardown.d.ts +39 -0
- package/dist/src/teardown.js +422 -0
- package/dist/src/tuition.d.ts +159 -0
- package/dist/src/tuition.js +311 -0
- package/dist/src/validate.d.ts +263 -0
- package/dist/src/validate.js +742 -0
- package/dist/src/version.d.ts +3 -0
- package/dist/src/version.js +38 -0
- package/dist/src/watcher.d.ts +275 -0
- package/dist/src/watcher.js +849 -0
- package/dist/src/witness/run.d.ts +299 -0
- package/dist/src/witness/run.js +1373 -0
- package/dist/src/witness/spec.d.ts +270 -0
- package/dist/src/witness/spec.js +475 -0
- package/dist/tsconfig.src.tsbuildinfo +1 -0
- package/gate-registry.yaml +526 -0
- package/gates.manifest.json +257 -0
- package/package.json +72 -3
- package/role-model-config.yaml +88 -0
- package/roles/README.md +128 -0
- package/roles/_shared-dispatch-contract.md +87 -0
- package/roles/adversarial-plan-reviewer.md +80 -0
- package/roles/clean-room-reviewer.md +140 -0
- package/roles/implementer.md +463 -0
- package/roles/investigator.md +138 -0
- package/roles/plan-writer.md +95 -0
- package/schemas/README.md +82 -0
- package/schemas/assurance-modes.schema.json +264 -0
- package/schemas/charter.schema.json +185 -0
- package/schemas/checklist.schema.json +114 -0
- package/schemas/cutover-state.schema.json +64 -0
- package/schemas/decision-record.schema.json +88 -0
- package/schemas/executor-record.schema.json +36 -0
- package/schemas/final-report.schema.json +90 -0
- package/schemas/finding.schema.json +106 -0
- package/schemas/gate-registry.schema.json +260 -0
- package/schemas/mechanism-index.schema.json +94 -0
- package/schemas/model-resolution.schema.json +362 -0
- package/schemas/plan.schema.json +300 -0
- package/schemas/report.schema.json +579 -0
- package/schemas/role-brief.schema.json +105 -0
- package/schemas/role-model-config.schema.json +90 -0
- package/schemas/status-line.schema.json +40 -0
- package/schemas/tuition.schema.json +191 -0
- package/schemas/verdict.schema.json +295 -0
- package/schemas/work-history.schema.json +183 -0
- package/schemas/write-bypass.schema.json +69 -0
- package/templates/charter.example.yaml +54 -0
- package/templates/decision-record.example.yaml +27 -0
- package/templates/final-report.example.yaml +80 -0
- package/templates/plan.example.yaml +87 -0
- package/templates/report.example.yaml +236 -0
- package/templates/warnings.md +74 -0
- package/templates/work-history.example.yaml +185 -0
- package/tuition/README.md +76 -0
- package/tuition/T-001.yaml +48 -0
- package/tuition/T-002.yaml +51 -0
- package/tuition/T-003.yaml +100 -0
- package/tuition/T-004.yaml +52 -0
- package/tuition/T-005.yaml +72 -0
- package/tuition/T-006.yaml +81 -0
- package/tuition/T-007.yaml +56 -0
- package/tuition/T-008.yaml +111 -0
- package/tuition/T-009.yaml +50 -0
- package/tuition/T-015.yaml +36 -0
- package/tuition/T-016.yaml +36 -0
- package/tuition/T-017.yaml +46 -0
- package/tuition/T-018.yaml +84 -0
- package/tuition/T-021.yaml +40 -0
- package/tuition/T-022.yaml +36 -0
- package/tuition/mechanism-index.yaml +256 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://tiphys.dev/schemas/citation-config.schema.json",
|
|
4
|
+
"title": "Tiphys citation linter configuration",
|
|
5
|
+
"description": "Roots (local and external), the configured document set, and the citationRequired subset for the `citations` gate. Kernel plan M2, M2-P5 step 2. Expressed entirely in the closed keyword set of M2-D-04 (src/gates/validate.ts): no oneOf/if-then-else, so root-kind-specific shape is not expressed here and is checked in code instead, the same split src/gates/manifest.ts already uses for precondition kinds.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["version", "roots", "externalRoots", "documents", "citationRequired"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"version": {
|
|
11
|
+
"type": "integer",
|
|
12
|
+
"minimum": 1
|
|
13
|
+
},
|
|
14
|
+
"roots": {
|
|
15
|
+
"description": "Local roots: paths this checkout is expected to contain. A citation matching a local root's glob is resolved against the filesystem (existence, line count, optional content hash).",
|
|
16
|
+
"type": "array",
|
|
17
|
+
"minItems": 1,
|
|
18
|
+
"items": { "$ref": "#/$defs/root" }
|
|
19
|
+
},
|
|
20
|
+
"externalRoots": {
|
|
21
|
+
"description": "Roots naming a repository this checkout does NOT contain (kernel plan M2 section 3, M2-P5 grounding: the firstmate scouted clone). External roots are matched FIRST, before local roots, so a bare relative path that would otherwise collide with this repository's own tree (bin/fm-lock.sh vs this repo's bin/) resolves deterministically rather than being guessed. A citation matching an external root is recorded unverifiable-external with provenance and is never counted as a resolved unit.",
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": { "$ref": "#/$defs/root" }
|
|
24
|
+
},
|
|
25
|
+
"documents": {
|
|
26
|
+
"description": "Path globs identifying the configured document set this gate ever looks at, diff-scoped at run time (M2-D-10) and walked in full only by the one-shot inventory (kernel plan M2-P5 step 5, not a standing gate mode).",
|
|
27
|
+
"type": "array",
|
|
28
|
+
"minItems": 1,
|
|
29
|
+
"items": { "type": "string" }
|
|
30
|
+
},
|
|
31
|
+
"citationRequired": {
|
|
32
|
+
"description": "The subset of `documents` in which zero recognized citations is red (M2R-014's narrowed vacuous guard: plans, reviews, verifications). Every glob here must also appear in `documents`; checked in code, not expressible in the closed keyword set.",
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": { "type": "string" }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"$defs": {
|
|
38
|
+
"root": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["name", "match"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"name": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
46
|
+
},
|
|
47
|
+
"description": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
"match": {
|
|
51
|
+
"description": "Explicit path globs (segments separated by /, * matches within one segment, ** matches zero or more segments). A glob listed under more than one root (local or external, the identical glob string) is a config error, reported as error, never guessed (kernel plan M2-P5 criterion 5).",
|
|
52
|
+
"type": "array",
|
|
53
|
+
"minItems": 1,
|
|
54
|
+
"items": { "type": "string" }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://tiphys.dev/schemas/coverage-config.schema.json",
|
|
4
|
+
"title": "Tiphys coverage gate configuration",
|
|
5
|
+
"description": "Declares the inventory source, the coverage-table source, and the named bucket-kind regexes the coverage gate (kernel plan M2, M2-P6) classifies bucket values against. Expressed entirely in the closed keyword set of M2-D-04.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["inventory", "coverageTable", "bucketKinds"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"inventory": {
|
|
11
|
+
"description": "The document enumerating every id that must be covered (this repository's real run: delivery/requirements/migration-table.md).",
|
|
12
|
+
"type": "object",
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"required": ["path", "idPattern"],
|
|
15
|
+
"properties": {
|
|
16
|
+
"path": {
|
|
17
|
+
"type": "string"
|
|
18
|
+
},
|
|
19
|
+
"idPattern": {
|
|
20
|
+
"description": "A regex SOURCE, compiled anchored as ^(?:<idPattern>)$ and tested against the first cell of every markdown table row in the document. A row whose first cell matches is a candidate id row; every other row (headers, separators, prose) is ignored.",
|
|
21
|
+
"type": "string"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"coverageTable": {
|
|
26
|
+
"description": "The document asserting, for each id, which bucket it lands in (this repository's real run: delivery/plan/kernel-plan-v1.md Appendix A).",
|
|
27
|
+
"type": "object",
|
|
28
|
+
"additionalProperties": false,
|
|
29
|
+
"required": ["path", "idPattern", "bucketColumn", "noteColumn"],
|
|
30
|
+
"properties": {
|
|
31
|
+
"path": {
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
"idPattern": {
|
|
35
|
+
"type": "string"
|
|
36
|
+
},
|
|
37
|
+
"bucketColumn": {
|
|
38
|
+
"description": "0-based index into the row's cell array (cell 0 is the id) holding the bucket value.",
|
|
39
|
+
"type": "integer",
|
|
40
|
+
"minimum": 1
|
|
41
|
+
},
|
|
42
|
+
"noteColumn": {
|
|
43
|
+
"description": "0-based index into the row's cell array holding the note, checked only for bucket kinds that declare requiresNote true.",
|
|
44
|
+
"type": "integer",
|
|
45
|
+
"minimum": 1
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"bucketKinds": {
|
|
50
|
+
"description": "A named set of regexes, each tested anchored full-string against a bucket value. A value matching more than one declared kind is the ambiguous-kind finding (CR-992), never a silent first-match. A pattern's first capturing group, when present and participating in the match, is read as a milestone digit (bare group value, e.g. 2 for M2); a kind whose pattern carries no such group, or whose match did not use it, buckets by the kind's own name in the per-milestone view (this is how 'parked' appears in that view rather than as a milestone).",
|
|
51
|
+
"type": "array",
|
|
52
|
+
"minItems": 1,
|
|
53
|
+
"items": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": ["kind", "pattern", "requiresNote"],
|
|
57
|
+
"properties": {
|
|
58
|
+
"kind": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"pattern": "^[a-z][a-z-]*$"
|
|
61
|
+
},
|
|
62
|
+
"pattern": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"requiresNote": {
|
|
66
|
+
"type": "boolean"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"expectedUnits": {
|
|
72
|
+
"description": "CR-986: the exact expected count of DISTINCT inventory ids. A row deleted from BOTH documents leaves every other check silent (the two documents still agree with each other), so this is the only check that can catch it. Optional; when absent, no floor is enforced. This repository's real run sets it to 115.",
|
|
73
|
+
"type": "integer",
|
|
74
|
+
"minimum": 0
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://tiphys.dev/schemas/gate-manifest.schema.json",
|
|
4
|
+
"title": "Tiphys gate manifest",
|
|
5
|
+
"description": "One manifest per repository: which gates exist, how each is invoked, and which commands can destroy work. Kernel plan M2, M2-P1 step 6. Expressed entirely in the closed keyword set of M2-D-04.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["version", "gates", "destructiveCommands"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"note": {
|
|
11
|
+
"description": "Free prose for the manifest's own readers. JSON carries no comments and a manifest has things worth saying about itself (CR-813).",
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"version": {
|
|
15
|
+
"type": "integer",
|
|
16
|
+
"minimum": 1
|
|
17
|
+
},
|
|
18
|
+
"gates": {
|
|
19
|
+
"description": "Append-only registry keyed by id. No minItems: a manifest with zero gates must reach the runner and be reported as no applicable gate (M2R-012), not rejected at load.",
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {
|
|
22
|
+
"$ref": "#/$defs/gate"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"destructiveCommands": {
|
|
26
|
+
"description": "CLI commands and module paths whose operations can destroy work (kernel plan M2 section 2 item 11). Consumed by M2-P2 rule (e) to DERIVE a witness class rather than trust the implementer's declaration.",
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": {
|
|
29
|
+
"type": "string"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"$defs": {
|
|
34
|
+
"gate": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"required": ["id", "command", "unitLabel", "applicability"],
|
|
38
|
+
"properties": {
|
|
39
|
+
"id": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
42
|
+
},
|
|
43
|
+
"command": {
|
|
44
|
+
"description": "argv array. The runner appends --result and --evidence, plus one flag per declared parameter.",
|
|
45
|
+
"type": "array",
|
|
46
|
+
"minItems": 1,
|
|
47
|
+
"items": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"unitLabel": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
},
|
|
54
|
+
"applicability": {
|
|
55
|
+
"description": "required: an unmet precondition fails the run. conditional: an unmet precondition does not.",
|
|
56
|
+
"type": "string",
|
|
57
|
+
"enum": ["required", "conditional"]
|
|
58
|
+
},
|
|
59
|
+
"parameters": {
|
|
60
|
+
"description": "Run parameters this gate's command REQUIRES. Declared rather than inferred: deciding what another program needs by pattern-matching its command line is the mechanism MECHANISMS.md forbids. An absent declared parameter makes the gate error, never not-applicable (M2-C-3, M2R-003).",
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"enum": ["base", "head", "phase"]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"precondition": {
|
|
68
|
+
"$ref": "#/$defs/precondition"
|
|
69
|
+
},
|
|
70
|
+
"modes": {
|
|
71
|
+
"description": "Reserved for M3's assurance modes (section 2 item 1). Validated if present, ignored by the M2 runner, so the promotion is additive.",
|
|
72
|
+
"type": "array",
|
|
73
|
+
"items": {
|
|
74
|
+
"type": "string"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"precondition": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"required": ["id", "kind"],
|
|
83
|
+
"properties": {
|
|
84
|
+
"id": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
"kind": {
|
|
88
|
+
"description": "The closed set. Kind-specific required fields are checked by src/gates/manifest.ts, which emits the same INVALID <pointer> <message> diagnostics, because this validator's keyword set has no conditional composition and M2-D-04 forbids growing it.",
|
|
89
|
+
"type": "string",
|
|
90
|
+
"enum": [
|
|
91
|
+
"file-exists",
|
|
92
|
+
"file-absent",
|
|
93
|
+
"branch-matches",
|
|
94
|
+
"diff-touches",
|
|
95
|
+
"command-exit-zero"
|
|
96
|
+
]
|
|
97
|
+
},
|
|
98
|
+
"path": {
|
|
99
|
+
"description": "file-exists and file-absent.",
|
|
100
|
+
"type": "string"
|
|
101
|
+
},
|
|
102
|
+
"pattern": {
|
|
103
|
+
"description": "branch-matches. A JavaScript regular expression source that is ANCHORED: it is compiled as ^(?:<pattern>)$ and must match the WHOLE branch name, so a prefix rule is written claude/{phase}-.* and not claude/{phase}-. The token {phase} is replaced by the --phase value, REGEX-ESCAPED, so a phase id containing a metacharacter is a literal. Both were faults: unanchored, claude/m2-p4- matched the decoy branch evil/claude/m2-p4-scope-auditor-DECOY, and unescaped, a phase id m2.p4 matched m2xp4 (CR-805). An author who forgets the .* gets not-applicable, which is the safe direction.",
|
|
104
|
+
"type": "string"
|
|
105
|
+
},
|
|
106
|
+
"paths": {
|
|
107
|
+
"description": "diff-touches. Path prefixes; the precondition is met when the diff changes a path under any of them.",
|
|
108
|
+
"type": "array",
|
|
109
|
+
"minItems": 1,
|
|
110
|
+
"items": {
|
|
111
|
+
"type": "string"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"command": {
|
|
115
|
+
"description": "command-exit-zero. argv array, run in the runner's working directory.",
|
|
116
|
+
"type": "array",
|
|
117
|
+
"minItems": 1,
|
|
118
|
+
"items": {
|
|
119
|
+
"type": "string"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://tiphys.dev/schemas/gate-result.schema.json",
|
|
4
|
+
"title": "Tiphys gate result record",
|
|
5
|
+
"description": "One record per gate the runner evaluated. Kernel plan M2, M2-P1 step 2. Expressed entirely in the closed keyword set of M2-D-04.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"gate",
|
|
10
|
+
"status",
|
|
11
|
+
"units",
|
|
12
|
+
"unitLabel",
|
|
13
|
+
"startedAt",
|
|
14
|
+
"endedAt",
|
|
15
|
+
"detail",
|
|
16
|
+
"evidence"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"gate": {
|
|
20
|
+
"description": "The gate id, matching the manifest entry that produced this record.",
|
|
21
|
+
"type": "string",
|
|
22
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
23
|
+
},
|
|
24
|
+
"status": {
|
|
25
|
+
"description": "The four-word status vocabulary. not-applicable ASSERTS that a precondition was evaluated and found unmet (SC-011).",
|
|
26
|
+
"type": "string",
|
|
27
|
+
"enum": ["green", "red", "not-applicable", "error"]
|
|
28
|
+
},
|
|
29
|
+
"units": {
|
|
30
|
+
"description": "How much the gate examined, in unitLabel units. M2-C-2: green with 0 is rewritten to error.",
|
|
31
|
+
"type": "integer",
|
|
32
|
+
"minimum": 0
|
|
33
|
+
},
|
|
34
|
+
"unitLabel": {
|
|
35
|
+
"description": "What one unit is, declared per gate in kernel plan M2 section 1.4.",
|
|
36
|
+
"type": "string"
|
|
37
|
+
},
|
|
38
|
+
"startedAt": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]+)?Z$"
|
|
41
|
+
},
|
|
42
|
+
"endedAt": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]+)?Z$"
|
|
45
|
+
},
|
|
46
|
+
"vacuous": {
|
|
47
|
+
"description": "Set only when the M2-C-2 rewrite fired: this error was a green with zero units. A strict subset of error in the summary counts.",
|
|
48
|
+
"type": "boolean"
|
|
49
|
+
},
|
|
50
|
+
"precondition": {
|
|
51
|
+
"$ref": "#/$defs/precondition"
|
|
52
|
+
},
|
|
53
|
+
"pin": {
|
|
54
|
+
"$ref": "#/$defs/pinPair"
|
|
55
|
+
},
|
|
56
|
+
"detail": {
|
|
57
|
+
"description": "One human-facing reason line. Never the machine authority for anything.",
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"evidence": {
|
|
61
|
+
"description": "Paths relative to the evidence directory.",
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"$defs": {
|
|
69
|
+
"precondition": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"additionalProperties": false,
|
|
72
|
+
"required": ["id", "met", "reason"],
|
|
73
|
+
"properties": {
|
|
74
|
+
"id": {
|
|
75
|
+
"type": "string"
|
|
76
|
+
},
|
|
77
|
+
"met": {
|
|
78
|
+
"description": "false means EVALUATED AND UNMET. An evaluation that could not conclude produces no precondition record at all, because the gate is error.",
|
|
79
|
+
"type": "boolean"
|
|
80
|
+
},
|
|
81
|
+
"reason": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
},
|
|
84
|
+
"evidence": {
|
|
85
|
+
"type": "array",
|
|
86
|
+
"items": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"pinPair": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"additionalProperties": false,
|
|
95
|
+
"required": ["start", "end"],
|
|
96
|
+
"properties": {
|
|
97
|
+
"start": {
|
|
98
|
+
"$ref": "#/$defs/pin"
|
|
99
|
+
},
|
|
100
|
+
"end": {
|
|
101
|
+
"$ref": "#/$defs/pin"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"pin": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"additionalProperties": false,
|
|
108
|
+
"required": ["roots", "takenAt", "fileCount", "files"],
|
|
109
|
+
"properties": {
|
|
110
|
+
"fileCount": {
|
|
111
|
+
"description": "files.length, carried explicitly so a vacuous pin is visible in the record (CR-804). Zero makes a green record error under M2-C-5.",
|
|
112
|
+
"type": "integer",
|
|
113
|
+
"minimum": 0
|
|
114
|
+
},
|
|
115
|
+
"roots": {
|
|
116
|
+
"type": "array",
|
|
117
|
+
"items": {
|
|
118
|
+
"type": "string"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"takenAt": {
|
|
122
|
+
"type": "string"
|
|
123
|
+
},
|
|
124
|
+
"files": {
|
|
125
|
+
"type": "array",
|
|
126
|
+
"items": {
|
|
127
|
+
"$ref": "#/$defs/pinFile"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"pinFile": {
|
|
133
|
+
"type": "object",
|
|
134
|
+
"additionalProperties": false,
|
|
135
|
+
"required": ["path", "sha256", "size", "mtimeMs", "ctimeMs"],
|
|
136
|
+
"properties": {
|
|
137
|
+
"path": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
},
|
|
140
|
+
"sha256": {
|
|
141
|
+
"type": "string",
|
|
142
|
+
"pattern": "^[0-9a-f]{64}$"
|
|
143
|
+
},
|
|
144
|
+
"size": {
|
|
145
|
+
"type": "integer",
|
|
146
|
+
"minimum": 0
|
|
147
|
+
},
|
|
148
|
+
"mtimeMs": {
|
|
149
|
+
"type": "number",
|
|
150
|
+
"minimum": 0
|
|
151
|
+
},
|
|
152
|
+
"ctimeMs": {
|
|
153
|
+
"description": "Inode change time. Pinned in addition to M2-C-5's four fields because mtime is settable from userspace and cp -p, rsync -a and tar -x all restore it exactly (CR-809).",
|
|
154
|
+
"type": "number",
|
|
155
|
+
"minimum": 0
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://tiphys.dev/schemas/phase-declaration.schema.json",
|
|
4
|
+
"title": "Tiphys phase declaration",
|
|
5
|
+
"description": "One document per plan phase, a projection of kernel plan M2 section 3's files-to-touch list, committed to main before the phase branch is created (delivery/plan/phase-declarations/README.md). Read by the scope auditor (M2-P4) from the MERGE BASE of the audited branch, never from the head, so editing the declaration on the audited branch cannot widen the audited scope (kernel plan M2, M2-P4 step 4, the anti-widening property). Shape fixed by M2-P4 step 2. Expressed entirely in the closed keyword set of M2-D-04 (src/gates/validate.ts).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["id", "branch", "filesToTouch", "declaredExtras", "citations"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"id": {
|
|
11
|
+
"description": "The phase id as the plan spells it, for example M2-P4.",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"pattern": "^M[0-9]+-P[0-9]+$"
|
|
14
|
+
},
|
|
15
|
+
"branch": {
|
|
16
|
+
"description": "The phase's one governing branch (kernel plan M2 section 3: one phase, one branch, one PR).",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"pattern": "^claude/m[0-9]+-p[0-9]+-.+$"
|
|
19
|
+
},
|
|
20
|
+
"filesToTouch": {
|
|
21
|
+
"description": "Literal paths, or literal directories written with a trailing slash. Never a description (M2R-016): the scope auditor matches these strings exactly or as a directory prefix and does not interpret prose.",
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"declaredExtras": {
|
|
28
|
+
"description": "Paths this phase is authorized to touch beyond filesToTouch, over and above the two standing pre-authorized extras (test/behaviors.json and this phase's own delivery/work-history/<id>.md), which the auditor adds itself and which never need to be listed here.",
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"citations": {
|
|
35
|
+
"description": "Requirement, finding, decision or constraint ids the plan cites for this phase (for example R-020, DR-0014, M2-C-6, T-003).",
|
|
36
|
+
"type": "array",
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "string"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"gateClasses": {
|
|
42
|
+
"description": "DR-0029 part 2a (M4-P14). The kernel requires a PHASE to declare at least one gate in each required CLASS and never says what the command is. THE SHAPE IS DECLARED HERE AND THE SEMANTICS ARE NOT, deliberately: an absent reason on a not-applicable class, or a missing establishing phase on a not-yet-establishable one, must reach a reader as a RED gate naming the phase and the class, and a schema rejection would instead surface as the gate's `error` status, which M2-C-3 reserves for a check that could not reach a verdict. So this property admits every shape src/gates/gate-classes.ts is able to report on, and that module refuses the ones DR-0029 forbids. The property is OPTIONAL because every declaration written before this phase lacks it and a required field would make all of them fail to load, turning a red verdict into an error for a defect this schema is not the right instrument for.",
|
|
43
|
+
"type": "object",
|
|
44
|
+
"additionalProperties": false,
|
|
45
|
+
"properties": {
|
|
46
|
+
"correctness": {
|
|
47
|
+
"$ref": "#/$defs/classDeclaration"
|
|
48
|
+
},
|
|
49
|
+
"scope": {
|
|
50
|
+
"$ref": "#/$defs/classDeclaration"
|
|
51
|
+
},
|
|
52
|
+
"review": {
|
|
53
|
+
"$ref": "#/$defs/classDeclaration"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"$defs": {
|
|
59
|
+
"classDeclaration": {
|
|
60
|
+
"description": "One class's disposition. EITHER `gates` names one or more gate ids that assert this class, OR `status` declares an escape: `not-applicable` carrying a `reason`, or `not-yet-establishable` carrying `establishedBy`, the phase id that will establish it. DR-0029: a phase may start from nothing and may never SILENTLY have nothing, so the escape is data, it is visible, and it is carried forward.",
|
|
61
|
+
"type": "object",
|
|
62
|
+
"additionalProperties": false,
|
|
63
|
+
"properties": {
|
|
64
|
+
"gates": {
|
|
65
|
+
"description": "Gate ids from this repository's own gate registry that assert this class for this phase.",
|
|
66
|
+
"type": "array",
|
|
67
|
+
"items": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"status": {
|
|
72
|
+
"description": "The declared escape, when this phase asserts no gate in this class.",
|
|
73
|
+
"type": "string",
|
|
74
|
+
"enum": ["not-applicable", "not-yet-establishable"]
|
|
75
|
+
},
|
|
76
|
+
"reason": {
|
|
77
|
+
"description": "Required by src/gates/gate-classes.ts when status is not-applicable. Not required HERE: an empty or absent reason is a RED verdict naming the class, not a document that fails to load.",
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
"establishedBy": {
|
|
81
|
+
"description": "Required by src/gates/gate-classes.ts when status is not-yet-establishable: the phase id that will establish this class. The IOU's due date.",
|
|
82
|
+
"type": "string"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://tiphys.dev/schemas/release-record.schema.json",
|
|
4
|
+
"title": "Tiphys release-verification adapter response",
|
|
5
|
+
"description": "What an adapter writes to the kernel-supplied record path after one bounded observation (kernel plan M2, M2-P7 step 3; investigation section 2.5). The adapter returns an OUTCOME, never a status path: JSON-pointer extraction exists only inside the http-json adapter's own configuration and the kernel never learns what a statusPath is. Conditional requirements (satisfied requires resolved and observation, which are fail-closed rules 4 and 5; reason is required for failed, absent, not-applicable and error) need conditional composition, which is outside the closed keyword set of M2-D-04, so they are enforced in code by src/gates/release.ts with the response schema's own INVALID <pointer> <message> diagnostic shape. The outcome enum is deliberately NOT expressed here: an out-of-enum outcome is fail-closed rule 7's own named error, never coerced and never a generic schema failure, and the subject echo (rule 3) must be checked before the outcome is read at all. Expressed entirely in the closed keyword set.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["contractVersion", "adapter", "subject", "outcome", "observedAt"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"contractVersion": {
|
|
11
|
+
"description": "The versions the kernel accepts are enumerated in src/gates/release.ts; an unrecognized value is error naming them (fail-closed rule 6).",
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"adapter": {
|
|
15
|
+
"description": "The adapter's own name, for the record.",
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"subject": {
|
|
19
|
+
"$ref": "#/$defs/subject"
|
|
20
|
+
},
|
|
21
|
+
"outcome": {
|
|
22
|
+
"description": "One of satisfied, failed, pending, absent, not-applicable, error. Enforced in code as fail-closed rule 7 (see the document description).",
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"resolved": {
|
|
26
|
+
"description": "The platform identity the adapter actually inspected, verbatim. Required for satisfied (fail-closed rule 4): a verifier that cannot say what it looked at did not look. kind and id are the contract; everything else is platform vocabulary the adapter may record and the kernel never interprets, except createdAt, which the kernel compares against the subject's mergedAt for the older-than-the-merge observation.",
|
|
27
|
+
"type": "object",
|
|
28
|
+
"required": ["kind", "id"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"kind": {
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"id": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"observedAt": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}([.][0-9]+)?Z$"
|
|
41
|
+
},
|
|
42
|
+
"observation": {
|
|
43
|
+
"description": "The captured evidence behind the outcome. Required for satisfied (fail-closed rule 5): a claim with no captured evidence behind it is treated as unknown. raw is a verbatim extract of the observed response and is deliberately unconstrained; detail is one line. For pending, detail carries the observed value verbatim, because the deadline conversion names the last observed value.",
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"required": ["detail"],
|
|
47
|
+
"properties": {
|
|
48
|
+
"raw": {
|
|
49
|
+
"description": "Verbatim extract. Any JSON value."
|
|
50
|
+
},
|
|
51
|
+
"detail": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"reason": {
|
|
57
|
+
"description": "Required for failed, absent, not-applicable and error (checked in code as part of fail-closed rule 2's conditional half).",
|
|
58
|
+
"type": "string"
|
|
59
|
+
},
|
|
60
|
+
"units": {
|
|
61
|
+
"description": "How many units of the verification's declared unit the adapter examined (e.g. migrations compared). Absent, a satisfied verification counts 1 (kernel plan M2, M2-P7 step 3's mapping). Declared as design decision D-p7-3 in the phase work history.",
|
|
62
|
+
"type": "integer",
|
|
63
|
+
"minimum": 0
|
|
64
|
+
},
|
|
65
|
+
"precondition": {
|
|
66
|
+
"description": "Present only with outcome not-applicable from an adapter-evaluated precondition (the declared-false state of M2-P7 step 7): the precondition id and the evidence of its evaluation.",
|
|
67
|
+
"type": "object",
|
|
68
|
+
"additionalProperties": false,
|
|
69
|
+
"required": ["id"],
|
|
70
|
+
"properties": {
|
|
71
|
+
"id": {
|
|
72
|
+
"type": "string"
|
|
73
|
+
},
|
|
74
|
+
"evidence": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"items": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"transport": {
|
|
83
|
+
"description": "Transport-level detail for the attempt record: for HTTP, the status code; a command's exit code is observed by the kernel itself.",
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"properties": {
|
|
87
|
+
"httpStatus": {
|
|
88
|
+
"type": "integer",
|
|
89
|
+
"minimum": 0
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"$defs": {
|
|
95
|
+
"subject": {
|
|
96
|
+
"description": "The kernel-owned subject, echoed VERBATIM from the request. The kernel compares it field by field before reading the outcome (fail-closed rule 3): an adapter that verified something else cannot report success for this subject by accident.",
|
|
97
|
+
"type": "object",
|
|
98
|
+
"additionalProperties": false,
|
|
99
|
+
"required": ["repository", "integrationRef", "mergedSha", "mergedAt", "phaseId"],
|
|
100
|
+
"properties": {
|
|
101
|
+
"repository": {
|
|
102
|
+
"type": "string"
|
|
103
|
+
},
|
|
104
|
+
"integrationRef": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
},
|
|
107
|
+
"mergedSha": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
},
|
|
110
|
+
"mergedAt": {
|
|
111
|
+
"type": "string"
|
|
112
|
+
},
|
|
113
|
+
"phaseId": {
|
|
114
|
+
"type": "string"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|