@davesheffer/hunch 1.22.2 → 1.23.1
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/README.md +5 -2
- package/contracts/change-proof/hunch.change-proof.v1.example.json +96 -0
- package/contracts/change-proof/hunch.change-proof.v1.schema.json +215 -0
- package/dist/changeProof.d.ts +1 -0
- package/dist/changeProof.js +2 -0
- package/dist/cli/index.js +37 -0
- package/dist/core/changeProof.js +512 -0
- package/dist/core/changeProofContract.d.ts +164 -0
- package/dist/core/changeProofContract.js +253 -0
- package/dist/core/projectDnaOutcomeExperience.d.ts +105 -0
- package/dist/core/projectDnaOutcomeExperience.js +271 -0
- package/dist/mcp/server.js +28 -0
- package/dist/projectDna.d.ts +1 -0
- package/dist/projectDna.js +1 -0
- package/package.json +8 -1
- package/server.json +2 -2
package/README.md
CHANGED
|
@@ -80,6 +80,7 @@ validation layer behind the tools that write the code.
|
|
|
80
80
|
| **Project DNA** | Revision-specific, evidence-backed observations about how a repository communicates and works: vocabulary, contribution habits, review expectations, engineering conventions, and culture. |
|
|
81
81
|
| **Engineering Landscape** | Human-reviewed links from product and capability to system, repository, service, interface, data, delivery resources, runbooks, ownership, dashboards, and SLOs. |
|
|
82
82
|
| **Validated Delivery** | The smallest relevant evidence for the current builder, reviewer, or architect, with provenance, currentness, omissions, authority, and a content-addressed receipt. |
|
|
83
|
+
| **Native Change Proof** | A sealed exact-change artifact binding revisions, DNA, base/result graphs, memory, blast radius, conformance, guard verdict, and explicit gaps without granting workflow authority. |
|
|
83
84
|
| **Change Gate + Constitution** | Deterministic checks for trusted constraints and architectural intent. Policies are compiled, proved, inspected, and explicitly activated by a human—never promoted by an agent in the background. |
|
|
84
85
|
|
|
85
86
|
Readable JSON in `.hunch/` is the source of truth. SQLite is a fast, rebuildable projection. Git
|
|
@@ -126,6 +127,7 @@ manual paths:
|
|
|
126
127
|
| `hunch conform` | Prove the code still satisfies recorded architectural intent |
|
|
127
128
|
| `hunch impact origin/main` | See the dependency and memory surface of a branch |
|
|
128
129
|
| `hunch compare branch-a branch-b` | Rank candidate changes by the fewest invariant and decision conflicts |
|
|
130
|
+
| `hunch prove origin/main --public-only` | Produce a publication-safe `hunch.change-proof/1` artifact for an exact committed change |
|
|
129
131
|
| `hunch landscape review` | Inspect a hash-bound repository landscape without writing authority |
|
|
130
132
|
| `hunch now` | See recent memory and the live decision-backed roadmap |
|
|
131
133
|
| `hunch escalations` | See the rare questions that genuinely require a human answer |
|
|
@@ -179,7 +181,7 @@ does not host that repository. Give teammates and CI normal Git access, keep cre
|
|
|
179
181
|
the Git credential helper, and have one maintainer connect it:
|
|
180
182
|
|
|
181
183
|
```bash
|
|
182
|
-
npm i -g @davesheffer/hunch@1.
|
|
184
|
+
npm i -g @davesheffer/hunch@1.23.1
|
|
183
185
|
hunch shared --repo git@github.com:acme/project-hunch-memory.git
|
|
184
186
|
git add .gitignore .hunch/team.json
|
|
185
187
|
git commit -m "chore: connect shared Hunch memory"
|
|
@@ -189,7 +191,7 @@ git push
|
|
|
189
191
|
Teammates then install the same version and run:
|
|
190
192
|
|
|
191
193
|
```bash
|
|
192
|
-
npm i -g @davesheffer/hunch@1.
|
|
194
|
+
npm i -g @davesheffer/hunch@1.23.1
|
|
193
195
|
git pull
|
|
194
196
|
hunch init
|
|
195
197
|
hunch doctor
|
|
@@ -224,6 +226,7 @@ Use `hunch firmness off` to pause hook enforcement without deleting history. Use
|
|
|
224
226
|
- [Full documentation](https://hunch-pi.vercel.app/docs)
|
|
225
227
|
- [Copy-paste cookbook](https://hunch-pi.vercel.app/cookbook)
|
|
226
228
|
- [Project DNA](docs/project-dna.md)
|
|
229
|
+
- [Native change proof](docs/change-proof.md)
|
|
227
230
|
- [Engineering Landscape Graph](docs/engineering-landscape.md)
|
|
228
231
|
- [Hunch roadmap](ROADMAP.md)
|
|
229
232
|
- [VS Code extension](vscode-extension/README.md)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "hunch.change-proof/1",
|
|
3
|
+
"algorithm": "hunch-change-proof-sha256/1",
|
|
4
|
+
"engine": {
|
|
5
|
+
"package": "@davesheffer/hunch",
|
|
6
|
+
"version": "1.22.3"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"repository_id": "pdnar_aaaaaaaaaaaaaaaaaaaaaaaa",
|
|
10
|
+
"base_revision": "1111111111111111111111111111111111111111",
|
|
11
|
+
"result_revision": "2222222222222222222222222222222222222222"
|
|
12
|
+
},
|
|
13
|
+
"change": {
|
|
14
|
+
"schema": "hunch.change-identity/1",
|
|
15
|
+
"algorithm": "git-raw-tree-delta-sha256/1",
|
|
16
|
+
"change_id": "hchg_889f51592bcb2e773394f42c",
|
|
17
|
+
"base_revision": "1111111111111111111111111111111111111111",
|
|
18
|
+
"head_revision": "2222222222222222222222222222222222222222",
|
|
19
|
+
"base_tree": "4444444444444444444444444444444444444444",
|
|
20
|
+
"head_tree": "5555555555555555555555555555555555555555",
|
|
21
|
+
"delta_hash": "sha256:3333333333333333333333333333333333333333333333333333333333333333",
|
|
22
|
+
"patch_id": "6666666666666666666666666666666666666666",
|
|
23
|
+
"file_count": 1,
|
|
24
|
+
"paths_hash": "sha256:7777777777777777777777777777777777777777777777777777777777777777",
|
|
25
|
+
"content_hash": "sha256:4149654f541cca52d2f69c208772f9d3063ec4daf230d88cf5f27855a94293a6"
|
|
26
|
+
},
|
|
27
|
+
"project_dna": {
|
|
28
|
+
"schema": "hunch.project-dna/1",
|
|
29
|
+
"profile_id": "pdna_bbbbbbbbbbbbbbbbbbbbbbbb",
|
|
30
|
+
"repository_id": "pdnar_aaaaaaaaaaaaaaaaaaaaaaaa",
|
|
31
|
+
"repository_revision": "2222222222222222222222222222222222222222",
|
|
32
|
+
"content_hash": "sha256:8888888888888888888888888888888888888888888888888888888888888888",
|
|
33
|
+
"trait_ids": []
|
|
34
|
+
},
|
|
35
|
+
"graph": {
|
|
36
|
+
"base": {
|
|
37
|
+
"source": "commit",
|
|
38
|
+
"revision": "1111111111111111111111111111111111111111",
|
|
39
|
+
"source_hash": "sha1:9999999999999999999999999999999999999999",
|
|
40
|
+
"topology_hash": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
41
|
+
"files": 1,
|
|
42
|
+
"symbols": 1,
|
|
43
|
+
"edges": 0,
|
|
44
|
+
"components": 1,
|
|
45
|
+
"issue_count": 0
|
|
46
|
+
},
|
|
47
|
+
"result": {
|
|
48
|
+
"source": "commit",
|
|
49
|
+
"revision": "2222222222222222222222222222222222222222",
|
|
50
|
+
"source_hash": "sha1:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
51
|
+
"topology_hash": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
52
|
+
"files": 1,
|
|
53
|
+
"symbols": 1,
|
|
54
|
+
"edges": 0,
|
|
55
|
+
"components": 1,
|
|
56
|
+
"issue_count": 0
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"changed_files": [
|
|
60
|
+
"src/example.ts"
|
|
61
|
+
],
|
|
62
|
+
"changed_file_count": 1,
|
|
63
|
+
"blast_radius": [],
|
|
64
|
+
"blast_radius_count": 0,
|
|
65
|
+
"decisions": [],
|
|
66
|
+
"decision_count": 0,
|
|
67
|
+
"constraints": [],
|
|
68
|
+
"constraint_count": 0,
|
|
69
|
+
"conformance": [],
|
|
70
|
+
"conformance_count": 0,
|
|
71
|
+
"guard": {
|
|
72
|
+
"verdict": "pass",
|
|
73
|
+
"strict_blocker_ids": [],
|
|
74
|
+
"regression_decision_ids": [],
|
|
75
|
+
"veto_decision_ids": [],
|
|
76
|
+
"report_hash": "sha256:dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
|
|
77
|
+
},
|
|
78
|
+
"memory": {
|
|
79
|
+
"scope": "public",
|
|
80
|
+
"records_hash": "sha256:d181842823fd171f29a2de31820136d5b5ea58341c07626fa0b1c574e74f0b16"
|
|
81
|
+
},
|
|
82
|
+
"omissions": [],
|
|
83
|
+
"unknowns": [],
|
|
84
|
+
"verdict": "pass",
|
|
85
|
+
"authority": {
|
|
86
|
+
"execution": false,
|
|
87
|
+
"ci": false,
|
|
88
|
+
"deployment": false,
|
|
89
|
+
"merge": false,
|
|
90
|
+
"ranking": false,
|
|
91
|
+
"promotion": false,
|
|
92
|
+
"policy": false
|
|
93
|
+
},
|
|
94
|
+
"proof_id": "hproof_813af1d712c7e16334c573e3",
|
|
95
|
+
"content_hash": "sha256:481d03e0dd598a1b1811541e978b92d40e607c104c3c9b5403d2b4fea604068d"
|
|
96
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "https://raw.githubusercontent.com/davesheffer/hunch/main/contracts/change-proof/hunch.change-proof.v1.schema.json",
|
|
3
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"schema": { "type": "string", "const": "hunch.change-proof/1" },
|
|
7
|
+
"algorithm": { "type": "string", "const": "hunch-change-proof-sha256/1" },
|
|
8
|
+
"proof_id": { "type": "string", "pattern": "^hproof_[a-f0-9]{24}$" },
|
|
9
|
+
"engine": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"package": { "type": "string", "const": "@davesheffer/hunch" },
|
|
13
|
+
"version": { "type": "string", "minLength": 1, "maxLength": 64 }
|
|
14
|
+
},
|
|
15
|
+
"required": ["package", "version"],
|
|
16
|
+
"additionalProperties": false
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"properties": {
|
|
21
|
+
"repository_id": { "type": "string", "pattern": "^pdnar_[a-f0-9]{24}$" },
|
|
22
|
+
"base_revision": { "$ref": "#/$defs/gitObject" },
|
|
23
|
+
"result_revision": { "$ref": "#/$defs/gitObject" }
|
|
24
|
+
},
|
|
25
|
+
"required": ["repository_id", "base_revision", "result_revision"],
|
|
26
|
+
"additionalProperties": false
|
|
27
|
+
},
|
|
28
|
+
"change": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"schema": { "type": "string", "const": "hunch.change-identity/1" },
|
|
32
|
+
"algorithm": { "type": "string", "const": "git-raw-tree-delta-sha256/1" },
|
|
33
|
+
"change_id": { "type": "string", "pattern": "^hchg_[a-f0-9]{24}$" },
|
|
34
|
+
"base_revision": { "$ref": "#/$defs/gitObject" },
|
|
35
|
+
"head_revision": { "$ref": "#/$defs/gitObject" },
|
|
36
|
+
"base_tree": { "$ref": "#/$defs/gitObject" },
|
|
37
|
+
"head_tree": { "$ref": "#/$defs/gitObject" },
|
|
38
|
+
"delta_hash": { "$ref": "#/$defs/sha256" },
|
|
39
|
+
"patch_id": { "anyOf": [{ "$ref": "#/$defs/gitObject" }, { "type": "null" }] },
|
|
40
|
+
"file_count": { "type": "integer", "minimum": 1, "maximum": 16384 },
|
|
41
|
+
"paths_hash": { "$ref": "#/$defs/sha256" },
|
|
42
|
+
"content_hash": { "$ref": "#/$defs/sha256" }
|
|
43
|
+
},
|
|
44
|
+
"required": ["schema", "algorithm", "change_id", "base_revision", "head_revision", "base_tree", "head_tree", "delta_hash", "patch_id", "file_count", "paths_hash", "content_hash"],
|
|
45
|
+
"additionalProperties": false
|
|
46
|
+
},
|
|
47
|
+
"project_dna": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"schema": { "type": "string", "const": "hunch.project-dna/1" },
|
|
51
|
+
"profile_id": { "type": "string", "pattern": "^pdna_[a-f0-9]{24}$" },
|
|
52
|
+
"repository_id": { "type": "string", "pattern": "^pdnar_[a-f0-9]{24}$" },
|
|
53
|
+
"repository_revision": { "$ref": "#/$defs/gitObject" },
|
|
54
|
+
"content_hash": { "$ref": "#/$defs/sha256" },
|
|
55
|
+
"trait_ids": {
|
|
56
|
+
"type": "array",
|
|
57
|
+
"maxItems": 64,
|
|
58
|
+
"uniqueItems": true,
|
|
59
|
+
"items": { "type": "string", "pattern": "^pdnat_[a-f0-9]{20}$" }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"required": ["schema", "profile_id", "repository_id", "repository_revision", "content_hash", "trait_ids"],
|
|
63
|
+
"additionalProperties": false
|
|
64
|
+
},
|
|
65
|
+
"graph": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"properties": {
|
|
68
|
+
"base": { "$ref": "#/$defs/graphSeal" },
|
|
69
|
+
"result": { "$ref": "#/$defs/graphSeal" }
|
|
70
|
+
},
|
|
71
|
+
"required": ["base", "result"],
|
|
72
|
+
"additionalProperties": false
|
|
73
|
+
},
|
|
74
|
+
"changed_files": { "type": "array", "maxItems": 2048, "uniqueItems": true, "items": { "$ref": "#/$defs/repoPath" } },
|
|
75
|
+
"changed_file_count": { "type": "integer", "minimum": 1, "maximum": 16384 },
|
|
76
|
+
"blast_radius": { "type": "array", "maxItems": 4096, "uniqueItems": true, "items": { "$ref": "#/$defs/blastEntry" } },
|
|
77
|
+
"blast_radius_count": { "type": "integer", "minimum": 0, "maximum": 10000000 },
|
|
78
|
+
"decisions": { "type": "array", "maxItems": 1024, "uniqueItems": true, "items": { "$ref": "#/$defs/decisionRef" } },
|
|
79
|
+
"decision_count": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
80
|
+
"constraints": { "type": "array", "maxItems": 1024, "uniqueItems": true, "items": { "$ref": "#/$defs/constraintRef" } },
|
|
81
|
+
"constraint_count": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
82
|
+
"conformance": { "type": "array", "maxItems": 1024, "uniqueItems": true, "items": { "$ref": "#/$defs/conformanceReceipt" } },
|
|
83
|
+
"conformance_count": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
84
|
+
"guard": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"properties": {
|
|
87
|
+
"verdict": { "type": "string", "enum": ["pass", "fail"] },
|
|
88
|
+
"strict_blocker_ids": { "type": "array", "maxItems": 2048, "uniqueItems": true, "items": { "type": "string", "minLength": 1, "maxLength": 256 } },
|
|
89
|
+
"regression_decision_ids": { "type": "array", "maxItems": 1024, "uniqueItems": true, "items": { "$ref": "#/$defs/decisionId" } },
|
|
90
|
+
"veto_decision_ids": { "type": "array", "maxItems": 1024, "uniqueItems": true, "items": { "$ref": "#/$defs/decisionId" } },
|
|
91
|
+
"report_hash": { "$ref": "#/$defs/sha256" }
|
|
92
|
+
},
|
|
93
|
+
"required": ["verdict", "strict_blocker_ids", "regression_decision_ids", "veto_decision_ids", "report_hash"],
|
|
94
|
+
"additionalProperties": false
|
|
95
|
+
},
|
|
96
|
+
"memory": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"properties": {
|
|
99
|
+
"scope": { "type": "string", "enum": ["public", "union"] },
|
|
100
|
+
"records_hash": { "$ref": "#/$defs/sha256" }
|
|
101
|
+
},
|
|
102
|
+
"required": ["scope", "records_hash"],
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
},
|
|
105
|
+
"omissions": { "type": "array", "maxItems": 64, "uniqueItems": true, "items": { "$ref": "#/$defs/hashGap" } },
|
|
106
|
+
"unknowns": { "type": "array", "maxItems": 64, "uniqueItems": true, "items": { "$ref": "#/$defs/hashGap" } },
|
|
107
|
+
"verdict": { "type": "string", "enum": ["fail", "pass", "unknown"] },
|
|
108
|
+
"authority": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"properties": {
|
|
111
|
+
"execution": { "type": "boolean", "const": false },
|
|
112
|
+
"ci": { "type": "boolean", "const": false },
|
|
113
|
+
"deployment": { "type": "boolean", "const": false },
|
|
114
|
+
"merge": { "type": "boolean", "const": false },
|
|
115
|
+
"ranking": { "type": "boolean", "const": false },
|
|
116
|
+
"promotion": { "type": "boolean", "const": false },
|
|
117
|
+
"policy": { "type": "boolean", "const": false }
|
|
118
|
+
},
|
|
119
|
+
"required": ["execution", "ci", "deployment", "merge", "ranking", "promotion", "policy"],
|
|
120
|
+
"additionalProperties": false
|
|
121
|
+
},
|
|
122
|
+
"content_hash": { "$ref": "#/$defs/sha256" }
|
|
123
|
+
},
|
|
124
|
+
"required": ["schema", "algorithm", "proof_id", "engine", "repository", "change", "project_dna", "graph", "changed_files", "changed_file_count", "blast_radius", "blast_radius_count", "decisions", "decision_count", "constraints", "constraint_count", "conformance", "conformance_count", "guard", "memory", "omissions", "unknowns", "verdict", "authority", "content_hash"],
|
|
125
|
+
"additionalProperties": false,
|
|
126
|
+
"$defs": {
|
|
127
|
+
"gitObject": { "type": "string", "pattern": "^[a-f0-9]{40,64}$" },
|
|
128
|
+
"sha1": { "type": "string", "pattern": "^sha1:[a-f0-9]{40}$" },
|
|
129
|
+
"sha256": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
130
|
+
"repoPath": {
|
|
131
|
+
"type": "string",
|
|
132
|
+
"minLength": 1,
|
|
133
|
+
"maxLength": 4096,
|
|
134
|
+
"pattern": "^(?!/)(?![A-Za-z]:)(?!.*\\\\)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)[^\\u0000]+$"
|
|
135
|
+
},
|
|
136
|
+
"decisionId": { "type": "string", "pattern": "^dec_[A-Za-z0-9_.-]{3,}$" },
|
|
137
|
+
"constraintId": { "type": "string", "pattern": "^con_[A-Za-z0-9_.-]{3,}$" },
|
|
138
|
+
"graphSeal": {
|
|
139
|
+
"type": "object",
|
|
140
|
+
"properties": {
|
|
141
|
+
"source": { "type": "string", "const": "commit" },
|
|
142
|
+
"revision": { "$ref": "#/$defs/gitObject" },
|
|
143
|
+
"source_hash": { "$ref": "#/$defs/sha1" },
|
|
144
|
+
"topology_hash": { "$ref": "#/$defs/sha256" },
|
|
145
|
+
"files": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
146
|
+
"symbols": { "type": "integer", "minimum": 0, "maximum": 10000000 },
|
|
147
|
+
"edges": { "type": "integer", "minimum": 0, "maximum": 50000000 },
|
|
148
|
+
"components": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
149
|
+
"issue_count": { "type": "integer", "minimum": 0, "maximum": 1000000 }
|
|
150
|
+
},
|
|
151
|
+
"required": ["source", "revision", "source_hash", "topology_hash", "files", "symbols", "edges", "components", "issue_count"],
|
|
152
|
+
"additionalProperties": false
|
|
153
|
+
},
|
|
154
|
+
"blastEntry": {
|
|
155
|
+
"type": "object",
|
|
156
|
+
"properties": {
|
|
157
|
+
"source_path": { "$ref": "#/$defs/repoPath" },
|
|
158
|
+
"dependent_path": { "$ref": "#/$defs/repoPath" },
|
|
159
|
+
"depth": { "type": "integer", "minimum": 1, "maximum": 4 },
|
|
160
|
+
"graphs": { "type": "array", "minItems": 1, "maxItems": 2, "uniqueItems": true, "items": { "type": "string", "enum": ["base", "result"] } }
|
|
161
|
+
},
|
|
162
|
+
"required": ["source_path", "dependent_path", "depth", "graphs"],
|
|
163
|
+
"additionalProperties": false
|
|
164
|
+
},
|
|
165
|
+
"decisionRef": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"properties": {
|
|
168
|
+
"id": { "$ref": "#/$defs/decisionId" },
|
|
169
|
+
"record_hash": { "$ref": "#/$defs/sha256" },
|
|
170
|
+
"relevance": { "type": "array", "minItems": 1, "maxItems": 4, "uniqueItems": true, "items": { "type": "string", "enum": ["blast_radius", "changed_path", "conformance", "guard"] } },
|
|
171
|
+
"paths": { "type": "array", "maxItems": 128, "uniqueItems": true, "items": { "$ref": "#/$defs/repoPath" } },
|
|
172
|
+
"path_count": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
173
|
+
"paths_hash": { "$ref": "#/$defs/sha256" }
|
|
174
|
+
},
|
|
175
|
+
"required": ["id", "record_hash", "relevance", "paths", "path_count", "paths_hash"],
|
|
176
|
+
"additionalProperties": false
|
|
177
|
+
},
|
|
178
|
+
"constraintRef": {
|
|
179
|
+
"type": "object",
|
|
180
|
+
"properties": {
|
|
181
|
+
"id": { "$ref": "#/$defs/constraintId" },
|
|
182
|
+
"record_hash": { "$ref": "#/$defs/sha256" },
|
|
183
|
+
"severity": { "type": "string", "enum": ["advisory", "warning", "blocking"] },
|
|
184
|
+
"relevance": { "type": "array", "minItems": 1, "maxItems": 2, "uniqueItems": true, "items": { "type": "string", "enum": ["blast_radius", "changed_path"] } },
|
|
185
|
+
"paths": { "type": "array", "maxItems": 128, "uniqueItems": true, "items": { "$ref": "#/$defs/repoPath" } },
|
|
186
|
+
"path_count": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
187
|
+
"paths_hash": { "$ref": "#/$defs/sha256" }
|
|
188
|
+
},
|
|
189
|
+
"required": ["id", "record_hash", "severity", "relevance", "paths", "path_count", "paths_hash"],
|
|
190
|
+
"additionalProperties": false
|
|
191
|
+
},
|
|
192
|
+
"conformanceReceipt": {
|
|
193
|
+
"type": "object",
|
|
194
|
+
"properties": {
|
|
195
|
+
"decision_id": { "$ref": "#/$defs/decisionId" },
|
|
196
|
+
"predicate_index": { "type": "integer", "minimum": 0, "maximum": 1000000 },
|
|
197
|
+
"predicate_hash": { "$ref": "#/$defs/sha256" },
|
|
198
|
+
"satisfied": { "type": "boolean" },
|
|
199
|
+
"detail_hash": { "$ref": "#/$defs/sha256" }
|
|
200
|
+
},
|
|
201
|
+
"required": ["decision_id", "predicate_index", "predicate_hash", "satisfied", "detail_hash"],
|
|
202
|
+
"additionalProperties": false
|
|
203
|
+
},
|
|
204
|
+
"hashGap": {
|
|
205
|
+
"type": "object",
|
|
206
|
+
"properties": {
|
|
207
|
+
"code": { "type": "string", "pattern": "^[a-z][a-z0-9_.-]{2,127}$" },
|
|
208
|
+
"count": { "type": "integer", "minimum": 1, "maximum": 1000000 },
|
|
209
|
+
"evidence_hash": { "$ref": "#/$defs/sha256" }
|
|
210
|
+
},
|
|
211
|
+
"required": ["code", "count", "evidence_hash"],
|
|
212
|
+
"additionalProperties": false
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CHANGE_PROOF_ALGORITHM, CHANGE_PROOF_RELEVANCE, CHANGE_PROOF_SCHEMA_VERSION, CHANGE_PROOF_VERDICTS, ChangeProofSchema, assertChangeProof, canonicalChangeProofJson, changeProofHash, type ChangeProof, } from "./core/changeProofContract.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -57,6 +57,7 @@ import { compileVerifiedEvidenceMap, formatVerifiedEvidenceMap } from "../core/e
|
|
|
57
57
|
import { collectCorrectionStageSources } from "../extractors/correctionSources.js";
|
|
58
58
|
import { buildDeliveryEnvelope, DELIVERY_PROFILES } from "../core/delivery.js";
|
|
59
59
|
import { deriveChangeIdentity } from "../core/changeIdentity.js";
|
|
60
|
+
import { deriveChangeProof } from "../core/changeProof.js";
|
|
60
61
|
import { discoverProjectDna, evaluateProjectDnaMatch } from "../core/projectDna.js";
|
|
61
62
|
import { diffProjectDna } from "../core/projectDnaDelta.js";
|
|
62
63
|
import { projectDnaDeliverySupplement } from "../core/projectDnaDelivery.js";
|
|
@@ -3985,6 +3986,42 @@ program
|
|
|
3985
3986
|
fail(error.message);
|
|
3986
3987
|
}
|
|
3987
3988
|
});
|
|
3989
|
+
// ---- prove (standalone semantic proof for an exact committed change) ------
|
|
3990
|
+
program
|
|
3991
|
+
.command("prove")
|
|
3992
|
+
.description("Derive Hunch's sealed semantic proof for one exact committed tree transition.")
|
|
3993
|
+
.argument("<base>", "base commit or ref")
|
|
3994
|
+
.argument("[result]", "result commit or ref", "HEAD")
|
|
3995
|
+
.option("--public-only", "exclude the configured private-memory overlay from the proof")
|
|
3996
|
+
.option("--json", "emit the complete hunch.change-proof/1 artifact as JSON")
|
|
3997
|
+
.action((base, result, opts) => {
|
|
3998
|
+
const { store, root } = storeFor();
|
|
3999
|
+
try {
|
|
4000
|
+
const proof = deriveChangeProof(root, store, base, result, { publicOnly: opts.publicOnly });
|
|
4001
|
+
if (opts.json) {
|
|
4002
|
+
console.log(JSON.stringify(proof, null, 2));
|
|
4003
|
+
}
|
|
4004
|
+
else {
|
|
4005
|
+
const gaps = proof.omissions.length + proof.unknowns.length;
|
|
4006
|
+
console.log([
|
|
4007
|
+
`${proof.proof_id} — ${proof.verdict.toUpperCase()} (${proof.schema})`,
|
|
4008
|
+
` exact revisions: ${proof.repository.base_revision}..${proof.repository.result_revision}`,
|
|
4009
|
+
` exact change: ${proof.change.change_id} (${proof.changed_file_count} file${proof.changed_file_count === 1 ? "" : "s"})`,
|
|
4010
|
+
` semantic graph: ${proof.graph.result.symbols} symbols, ${proof.graph.result.edges} edges; ${proof.blast_radius_count} dependent path${proof.blast_radius_count === 1 ? "" : "s"}`,
|
|
4011
|
+
` memory: ${proof.decision_count} decision${proof.decision_count === 1 ? "" : "s"}, ${proof.constraint_count} constraint${proof.constraint_count === 1 ? "" : "s"}, ${proof.conformance_count} conformance receipt${proof.conformance_count === 1 ? "" : "s"} (${proof.memory.scope})`,
|
|
4012
|
+
` guard: ${proof.guard.verdict.toUpperCase()}; explicit gaps: ${gaps}`,
|
|
4013
|
+
` sealed artifact: ${proof.content_hash}`,
|
|
4014
|
+
" authority: evidence only — no execution, CI, deployment, merge, ranking, promotion, or policy authority",
|
|
4015
|
+
].join("\n"));
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
4018
|
+
catch (error) {
|
|
4019
|
+
fail(error.message);
|
|
4020
|
+
}
|
|
4021
|
+
finally {
|
|
4022
|
+
store.close();
|
|
4023
|
+
}
|
|
4024
|
+
});
|
|
3988
4025
|
// ---- context (surgical retrieval) -----------------------------------------
|
|
3989
4026
|
program
|
|
3990
4027
|
.command("context")
|