frontend-project-context 1.0.1 → 1.3.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 (31) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +164 -8
  3. package/UPGRADING.md +44 -0
  4. package/docs/00-PRODUCT-CONSTITUTION.md +42 -10
  5. package/docs/04-PROGRAM-DESIGN.md +89 -2
  6. package/docs/05-ACCEPTANCE-CONTRACT.md +52 -3
  7. package/docs/08-INSTALLATION-AND-DISTRIBUTION.md +27 -15
  8. package/docs/14-FORMAL-RELEASE-READINESS.md +15 -0
  9. package/docs/16-GUIDED-ONBOARDING-AND-AI-RECONCILIATION-DESIGN.md +469 -0
  10. package/docs/17-AI-EXCHANGE-BOUNDARY-DESIGN.md +270 -0
  11. package/docs/18-BRANCH-AWARE-STAGED-CONTEXT-DESIGN.md +348 -0
  12. package/docs/README.md +17 -5
  13. package/examples/README.md +15 -2
  14. package/examples/package.json +6 -2
  15. package/package.json +4 -3
  16. package/schemas/action-plan.schema.json +250 -0
  17. package/schemas/assist-bundle.schema.json +75 -0
  18. package/schemas/capabilities.schema.json +146 -0
  19. package/schemas/integration-review-bundle.schema.json +43 -0
  20. package/schemas/review-bundle.schema.json +109 -0
  21. package/schemas/stage-context-bundle.schema.json +56 -0
  22. package/schemas/stage-receipt.schema.json +55 -0
  23. package/schemas/task-context-plan.schema.json +85 -0
  24. package/src/project-context/assist.mjs +422 -0
  25. package/src/project-context/capabilities.mjs +74 -0
  26. package/src/project-context/cli.mjs +168 -13
  27. package/src/project-context/exchange-schema.mjs +528 -0
  28. package/src/project-context/exchange.mjs +565 -0
  29. package/src/project-context/project-store.mjs +22 -0
  30. package/src/project-context/task-context-schema.mjs +290 -0
  31. package/src/project-context/task-context.mjs +361 -0
@@ -5,7 +5,20 @@
5
5
  维护者首次初始化:
6
6
 
7
7
  ```bash
8
- npm run context:init -- --id my-project --name "My Project" --write
8
+ npm run context:setup -- --id my-project --name "My Project" --write --json
9
+ ```
10
+
11
+ 日常维护时生成只读变化工作单元:
12
+
13
+ ```bash
14
+ npm run context:sync -- --changed-path src/example.ts --json
15
+ ```
16
+
17
+ 外部 AI 宿主先查询机器协议,再对无权限 Action Plan 生成只读 Review Bundle:
18
+
19
+ ```bash
20
+ npm run context:capabilities -- --json
21
+ npm run context:preflight -- --plan .project-context/action-plan.json --json
9
22
  ```
10
23
 
11
24
  团队和 CI 的只读 Gate:
@@ -14,4 +27,4 @@ npm run context:init -- --id my-project --name "My Project" --write
14
27
  npm run context:check
15
28
  ```
16
29
 
17
- 应提交 `.project-context/contract.json`、`.project-context/sources.lock.json`、`.project-context/projections.lock.json` 和团队明确采用的受管投影。不要提交 proposal、dashboard HTML、tarball、node_modules 或临时 Context Bundle。
30
+ 人工审查 setup/sync 或 Review Bundle 返回的精确 action、ID 和路径后,继续使用 approve/accept/revise/deprecate/publish 的显式写入命令。Review Bundle invocation 不含 `--write`/`--by`,不能当成授权。应提交 `.project-context/contract.json`、`.project-context/sources.lock.json`、`.project-context/projections.lock.json` 和团队明确采用的受管投影。不要提交 proposal、Action Plan、Review Bundle、Assist Bundle、dashboard HTML、tarball、node_modules 或临时 Context Bundle。
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "private": true,
3
3
  "scripts": {
4
+ "context:setup": "project-context setup --project .",
4
5
  "context:init": "project-context init --project .",
5
6
  "context:check": "project-context check --project .",
6
- "context:dashboard": "project-context dashboard --project ."
7
+ "context:dashboard": "project-context dashboard --project .",
8
+ "context:sync": "project-context sync --project .",
9
+ "context:capabilities": "project-context capabilities --project .",
10
+ "context:preflight": "project-context preflight --project ."
7
11
  },
8
12
  "devDependencies": {
9
- "frontend-project-context": "1.0.1"
13
+ "frontend-project-context": "1.2.0"
10
14
  }
11
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frontend-project-context",
3
- "version": "1.0.1",
3
+ "version": "1.3.0",
4
4
  "description": "Govern, compile, and verify project-local context for AI coding tools.",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -13,6 +13,7 @@
13
13
  "files": [
14
14
  "bin/",
15
15
  "src/",
16
+ "schemas/",
16
17
  "docs/",
17
18
  "examples/",
18
19
  "CHANGELOG.md",
@@ -24,8 +25,8 @@
24
25
  "project-context": "bin/project-context.mjs"
25
26
  },
26
27
  "scripts": {
27
- "check": "node --check bin/project-context.mjs && node --test test/project-context test/release",
28
- "test": "node --test test/project-context test/release",
28
+ "check": "node --check bin/project-context.mjs && npm test",
29
+ "test": "node --test test/project-context/acceptance.test.mjs test/project-context/assist.test.mjs test/project-context/cli.test.mjs test/project-context/dashboard.test.mjs test/project-context/exchange.test.mjs test/project-context/maintenance.test.mjs test/project-context/source-lifecycle.test.mjs test/project-context/task-context.test.mjs test/release/acceptance.test.mjs",
29
30
  "prepack": "npm run check"
30
31
  },
31
32
  "engines": {
@@ -0,0 +1,250 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:action-plan:1",
4
+ "title": "Frontend Project Context Action Plan",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "projectId", "baselines", "actions"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 1 },
10
+ "projectId": { "$ref": "#/$defs/id" },
11
+ "baselines": { "$ref": "#/$defs/baselines" },
12
+ "actions": {
13
+ "type": "array",
14
+ "minItems": 1,
15
+ "items": {
16
+ "oneOf": [
17
+ { "$ref": "#/$defs/registerSource" },
18
+ { "$ref": "#/$defs/proposeItem" },
19
+ { "$ref": "#/$defs/acceptSourceChange" },
20
+ { "$ref": "#/$defs/reviseItem" },
21
+ { "$ref": "#/$defs/deprecateItem" },
22
+ { "$ref": "#/$defs/deprecateSource" },
23
+ { "$ref": "#/$defs/requestItemApproval" },
24
+ { "$ref": "#/$defs/publishProjection" }
25
+ ]
26
+ }
27
+ }
28
+ },
29
+ "$defs": {
30
+ "id": { "type": "string", "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)*$" },
31
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
32
+ "path": { "type": "string", "minLength": 1, "not": { "pattern": "(^/|(^|[\\/])\\.\\.([\\/]|$))" } },
33
+ "baselines": {
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["contract", "sourcesLock", "projectionsLock"],
37
+ "properties": {
38
+ "contract": { "$ref": "#/$defs/digest" },
39
+ "sourcesLock": { "$ref": "#/$defs/digest" },
40
+ "projectionsLock": { "$ref": "#/$defs/digest" }
41
+ }
42
+ },
43
+ "scope": {
44
+ "oneOf": [
45
+ {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "required": ["kind"],
49
+ "properties": { "kind": { "const": "project" } }
50
+ },
51
+ {
52
+ "type": "object",
53
+ "additionalProperties": false,
54
+ "required": ["kind", "path"],
55
+ "properties": {
56
+ "kind": { "enum": ["path-prefix", "file"] },
57
+ "path": { "$ref": "#/$defs/path" }
58
+ }
59
+ }
60
+ ]
61
+ },
62
+ "verification": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "required": ["kind"],
66
+ "properties": {
67
+ "kind": { "enum": ["none", "file-exists", "json-value", "path-digest"] },
68
+ "source": { "$ref": "#/$defs/id" },
69
+ "expected": {}
70
+ }
71
+ },
72
+ "itemInput": {
73
+ "type": "object",
74
+ "required": ["id", "kind", "subject", "value", "statement", "sources", "scope"],
75
+ "properties": {
76
+ "id": { "$ref": "#/$defs/id" },
77
+ "kind": { "enum": ["fact", "policy", "reference", "validation-description"] },
78
+ "subject": { "$ref": "#/$defs/id" },
79
+ "value": {},
80
+ "statement": { "type": "string", "minLength": 1 },
81
+ "sources": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/id" } },
82
+ "scope": { "$ref": "#/$defs/scope" },
83
+ "overrides": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } },
84
+ "verification": { "$ref": "#/$defs/verification" }
85
+ }
86
+ },
87
+ "registerSource": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": ["id", "kind", "input"],
91
+ "properties": {
92
+ "id": { "$ref": "#/$defs/id" },
93
+ "kind": { "const": "register-source" },
94
+ "input": {
95
+ "type": "object",
96
+ "additionalProperties": false,
97
+ "required": ["id", "kind"],
98
+ "properties": {
99
+ "id": { "$ref": "#/$defs/id" },
100
+ "kind": { "enum": ["file", "path", "json-pointer", "human-decision", "external-reference"] },
101
+ "path": { "$ref": "#/$defs/path" },
102
+ "pointer": { "type": "string" },
103
+ "reference": { "type": "string", "minLength": 1 }
104
+ }
105
+ }
106
+ }
107
+ },
108
+ "proposeItem": {
109
+ "type": "object",
110
+ "additionalProperties": false,
111
+ "required": ["id", "kind", "input"],
112
+ "properties": {
113
+ "id": { "$ref": "#/$defs/id" },
114
+ "kind": { "const": "propose-item" },
115
+ "input": {
116
+ "unevaluatedProperties": false,
117
+ "allOf": [
118
+ { "$ref": "#/$defs/itemInput" },
119
+ {
120
+ "type": "object",
121
+ "required": ["output"],
122
+ "properties": { "output": { "$ref": "#/$defs/path" } }
123
+ }
124
+ ]
125
+ }
126
+ }
127
+ },
128
+ "acceptSourceChange": {
129
+ "type": "object",
130
+ "additionalProperties": false,
131
+ "required": ["id", "kind", "input"],
132
+ "properties": {
133
+ "id": { "$ref": "#/$defs/id" },
134
+ "kind": { "const": "accept-source-change" },
135
+ "input": {
136
+ "type": "object",
137
+ "additionalProperties": false,
138
+ "required": ["id", "sourceObjectDigest", "lockedDigest", "currentDigest", "affectedItems"],
139
+ "properties": {
140
+ "id": { "$ref": "#/$defs/id" },
141
+ "sourceObjectDigest": { "$ref": "#/$defs/digest" },
142
+ "lockedDigest": { "$ref": "#/$defs/digest" },
143
+ "currentDigest": { "$ref": "#/$defs/digest" },
144
+ "affectedItems": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } }
145
+ }
146
+ }
147
+ }
148
+ },
149
+ "reviseItem": {
150
+ "type": "object",
151
+ "additionalProperties": false,
152
+ "required": ["id", "kind", "input"],
153
+ "properties": {
154
+ "id": { "$ref": "#/$defs/id" },
155
+ "kind": { "const": "revise-item" },
156
+ "input": {
157
+ "unevaluatedProperties": false,
158
+ "allOf": [
159
+ { "$ref": "#/$defs/itemInput" },
160
+ {
161
+ "type": "object",
162
+ "required": ["expectedItemDigest"],
163
+ "properties": { "expectedItemDigest": { "$ref": "#/$defs/digest" } }
164
+ }
165
+ ]
166
+ }
167
+ }
168
+ },
169
+ "deprecateItem": {
170
+ "type": "object",
171
+ "additionalProperties": false,
172
+ "required": ["id", "kind", "input"],
173
+ "properties": {
174
+ "id": { "$ref": "#/$defs/id" },
175
+ "kind": { "const": "deprecate-item" },
176
+ "input": {
177
+ "type": "object",
178
+ "additionalProperties": false,
179
+ "required": ["id", "expectedItemDigest", "rationale"],
180
+ "properties": {
181
+ "id": { "$ref": "#/$defs/id" },
182
+ "expectedItemDigest": { "$ref": "#/$defs/digest" },
183
+ "rationale": { "type": "string", "minLength": 1 }
184
+ }
185
+ }
186
+ }
187
+ },
188
+ "deprecateSource": {
189
+ "type": "object",
190
+ "additionalProperties": false,
191
+ "required": ["id", "kind", "input"],
192
+ "properties": {
193
+ "id": { "$ref": "#/$defs/id" },
194
+ "kind": { "const": "deprecate-source" },
195
+ "input": {
196
+ "type": "object",
197
+ "additionalProperties": false,
198
+ "required": ["id", "expectedSourceDigest", "affectedItems", "rationale"],
199
+ "properties": {
200
+ "id": { "$ref": "#/$defs/id" },
201
+ "expectedSourceDigest": { "$ref": "#/$defs/digest" },
202
+ "affectedItems": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } },
203
+ "rationale": { "type": "string", "minLength": 1 }
204
+ }
205
+ }
206
+ }
207
+ },
208
+ "requestItemApproval": {
209
+ "type": "object",
210
+ "additionalProperties": false,
211
+ "required": ["id", "kind", "input"],
212
+ "properties": {
213
+ "id": { "$ref": "#/$defs/id" },
214
+ "kind": { "const": "request-item-approval" },
215
+ "input": {
216
+ "type": "object",
217
+ "additionalProperties": false,
218
+ "required": ["mode", "ids"],
219
+ "properties": {
220
+ "mode": { "enum": ["pending", "proposal"] },
221
+ "ids": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/id" } },
222
+ "proposal": { "$ref": "#/$defs/path" },
223
+ "proposalDigest": { "$ref": "#/$defs/digest" },
224
+ "rationale": { "type": "string" }
225
+ }
226
+ }
227
+ }
228
+ },
229
+ "publishProjection": {
230
+ "type": "object",
231
+ "additionalProperties": false,
232
+ "required": ["id", "kind", "input"],
233
+ "properties": {
234
+ "id": { "$ref": "#/$defs/id" },
235
+ "kind": { "const": "publish-projection" },
236
+ "input": {
237
+ "type": "object",
238
+ "additionalProperties": false,
239
+ "required": ["target", "output", "paths", "expectedContentDigest"],
240
+ "properties": {
241
+ "target": { "enum": ["agents", "ruler"] },
242
+ "output": { "$ref": "#/$defs/path" },
243
+ "paths": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/path" } },
244
+ "expectedContentDigest": { "anyOf": [{ "$ref": "#/$defs/digest" }, { "type": "null" }] }
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:assist-bundle:1",
4
+ "title": "Frontend Project Context Assist Bundle",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "mode",
10
+ "project",
11
+ "snapshots",
12
+ "summary",
13
+ "sourceChanges",
14
+ "affectedItems",
15
+ "pendingItems",
16
+ "pathSignals",
17
+ "projectionPaths",
18
+ "findings",
19
+ "readTargets",
20
+ "workUnits",
21
+ "proposal",
22
+ "artifacts"
23
+ ],
24
+ "properties": {
25
+ "schemaVersion": { "const": 1 },
26
+ "mode": { "enum": ["setup", "sync"] },
27
+ "project": {
28
+ "type": "object",
29
+ "additionalProperties": false,
30
+ "required": ["id", "name", "initialized"],
31
+ "properties": {
32
+ "id": { "type": "string" },
33
+ "name": { "type": "string" },
34
+ "initialized": { "type": "boolean" }
35
+ }
36
+ },
37
+ "snapshots": {
38
+ "type": "object",
39
+ "additionalProperties": false,
40
+ "required": ["contract", "sourcesLock", "projectionsLock"],
41
+ "properties": {
42
+ "contract": { "$ref": "#/$defs/digest" },
43
+ "sourcesLock": { "$ref": "#/$defs/digest" },
44
+ "projectionsLock": { "$ref": "#/$defs/digest" }
45
+ }
46
+ },
47
+ "summary": {
48
+ "type": "object",
49
+ "additionalProperties": false,
50
+ "required": ["candidateSources", "candidateItems", "changedSources", "affectedItems", "pendingItems", "affectedProjections"],
51
+ "properties": {
52
+ "candidateSources": { "type": "integer", "minimum": 0 },
53
+ "candidateItems": { "type": "integer", "minimum": 0 },
54
+ "changedSources": { "type": "integer", "minimum": 0 },
55
+ "affectedItems": { "type": "integer", "minimum": 0 },
56
+ "pendingItems": { "type": "integer", "minimum": 0 },
57
+ "affectedProjections": { "type": "integer", "minimum": 0 }
58
+ }
59
+ },
60
+ "sourceChanges": { "type": "array", "items": { "type": "object" } },
61
+ "affectedItems": { "type": "array", "items": { "type": "object" } },
62
+ "pendingItems": { "type": "array", "items": { "type": "object" } },
63
+ "pathSignals": { "type": "array", "items": { "type": "object" } },
64
+ "projectionPaths": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/path" } },
65
+ "findings": { "type": "array", "items": { "type": "object" } },
66
+ "readTargets": { "type": "array", "items": { "type": "object" } },
67
+ "workUnits": { "type": "array", "items": { "type": "object" } },
68
+ "proposal": { "anyOf": [{ "type": "null" }, { "type": "object" }] },
69
+ "artifacts": { "type": "array", "items": { "type": "object" } }
70
+ },
71
+ "$defs": {
72
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
73
+ "path": { "type": "string", "minLength": 1 }
74
+ }
75
+ }
@@ -0,0 +1,146 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:capabilities:1",
4
+ "title": "Frontend Project Context Capabilities",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "package",
10
+ "exchangeProtocolVersion",
11
+ "schemas",
12
+ "commands",
13
+ "actionKinds",
14
+ "contextBudget",
15
+ "initialization",
16
+ "initialized",
17
+ "project",
18
+ "boundaries"
19
+ ],
20
+ "properties": {
21
+ "schemaVersion": { "const": 1 },
22
+ "package": {
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["name", "version"],
26
+ "properties": {
27
+ "name": { "const": "frontend-project-context" },
28
+ "version": { "type": "string" }
29
+ }
30
+ },
31
+ "exchangeProtocolVersion": { "const": 1 },
32
+ "schemas": {
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": [
36
+ "actionPlan",
37
+ "assistBundle",
38
+ "capabilities",
39
+ "contract",
40
+ "dashboardViewModel",
41
+ "integrationReviewBundle",
42
+ "projectionLock",
43
+ "projectionRenderer",
44
+ "proposal",
45
+ "reviewBundle",
46
+ "sourceLock",
47
+ "stageContextBundle",
48
+ "stageReceipt",
49
+ "taskContextPlan"
50
+ ],
51
+ "properties": {
52
+ "actionPlan": { "const": 1 },
53
+ "assistBundle": { "const": 1 },
54
+ "capabilities": { "const": 1 },
55
+ "contract": { "type": "integer" },
56
+ "dashboardViewModel": { "type": "integer" },
57
+ "integrationReviewBundle": { "const": 1 },
58
+ "projectionLock": { "type": "integer" },
59
+ "projectionRenderer": { "type": "integer" },
60
+ "proposal": { "type": "integer" },
61
+ "reviewBundle": { "const": 1 },
62
+ "sourceLock": { "type": "integer" },
63
+ "stageContextBundle": { "const": 1 },
64
+ "stageReceipt": { "const": 1 },
65
+ "taskContextPlan": { "const": 1 }
66
+ }
67
+ },
68
+ "commands": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string" } },
69
+ "actionKinds": {
70
+ "type": "array",
71
+ "minItems": 8,
72
+ "maxItems": 8,
73
+ "uniqueItems": true,
74
+ "items": {
75
+ "enum": [
76
+ "accept-source-change",
77
+ "deprecate-item",
78
+ "deprecate-source",
79
+ "propose-item",
80
+ "publish-projection",
81
+ "register-source",
82
+ "request-item-approval",
83
+ "revise-item"
84
+ ]
85
+ }
86
+ },
87
+ "contextBudget": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": ["unit", "modelTokens", "callerMustProvideLimit"],
91
+ "properties": {
92
+ "unit": { "const": "canonical-utf8-bytes" },
93
+ "modelTokens": { "const": false },
94
+ "callerMustProvideLimit": { "const": true }
95
+ }
96
+ },
97
+ "initialization": { "enum": ["uninitialized", "partial", "initialized"] },
98
+ "initialized": { "type": "boolean" },
99
+ "project": {
100
+ "anyOf": [
101
+ { "type": "null" },
102
+ {
103
+ "type": "object",
104
+ "additionalProperties": false,
105
+ "required": ["id", "name"],
106
+ "properties": {
107
+ "id": { "type": "string" },
108
+ "name": { "type": "string" }
109
+ }
110
+ }
111
+ ]
112
+ },
113
+ "boundaries": {
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": [
117
+ "provider",
118
+ "agentRuntime",
119
+ "git",
120
+ "network",
121
+ "dependencyInstallation",
122
+ "automaticApproval",
123
+ "businessCodeWrites",
124
+ "taskExecution",
125
+ "stagePathBodyReads",
126
+ "applyPlan",
127
+ "scheduler",
128
+ "daemon"
129
+ ],
130
+ "properties": {
131
+ "provider": { "const": false },
132
+ "agentRuntime": { "const": false },
133
+ "git": { "const": false },
134
+ "network": { "const": false },
135
+ "dependencyInstallation": { "const": false },
136
+ "automaticApproval": { "const": false },
137
+ "businessCodeWrites": { "const": false },
138
+ "taskExecution": { "const": false },
139
+ "stagePathBodyReads": { "const": false },
140
+ "applyPlan": { "const": false },
141
+ "scheduler": { "const": false },
142
+ "daemon": { "const": false }
143
+ }
144
+ }
145
+ }
146
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "urn:frontend-project-context:schema:integration-review-bundle:1",
4
+ "title": "Frontend Project Context Integration Review Bundle",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "kind", "project", "task", "workspace", "planDigest", "planSnapshots", "currentSnapshots", "mainChangedPaths", "branchChangedPaths", "receipts", "contractOverlapItemIds", "decisionCandidates", "readTargets", "findings", "excluded", "status", "bundleDigest"],
8
+ "properties": {
9
+ "schemaVersion": { "const": 1 },
10
+ "kind": { "const": "integration-review-bundle" },
11
+ "project": { "$ref": "#/$defs/identity" },
12
+ "task": { "$ref": "#/$defs/task" },
13
+ "workspace": { "$ref": "#/$defs/workspace" },
14
+ "planDigest": { "$ref": "#/$defs/digest" },
15
+ "planSnapshots": { "$ref": "#/$defs/snapshots" },
16
+ "currentSnapshots": { "$ref": "#/$defs/snapshots" },
17
+ "mainChangedPaths": { "$ref": "#/$defs/paths" },
18
+ "branchChangedPaths": { "$ref": "#/$defs/paths" },
19
+ "receipts": { "type": "array", "items": { "$ref": "#/$defs/receiptSummary" } },
20
+ "contractOverlapItemIds": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/id" } },
21
+ "decisionCandidates": { "type": "array", "items": { "$ref": "#/$defs/decisionCandidate" } },
22
+ "readTargets": { "type": "array", "items": { "$ref": "#/$defs/readTarget" } },
23
+ "findings": { "type": "array", "items": { "type": "object" } },
24
+ "excluded": { "type": "array", "uniqueItems": true, "items": { "type": "string" } },
25
+ "status": { "enum": ["reviewable", "blocked"] },
26
+ "bundleDigest": { "$ref": "#/$defs/digest" }
27
+ },
28
+ "$defs": {
29
+ "digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
30
+ "id": { "type": "string", "pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)*$" },
31
+ "text": { "type": "string", "minLength": 1 },
32
+ "paths": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
33
+ "snapshots": { "type": "object", "additionalProperties": false, "required": ["contract", "sourcesLock", "projectionsLock"], "properties": { "contract": { "$ref": "#/$defs/digest" }, "sourcesLock": { "$ref": "#/$defs/digest" }, "projectionsLock": { "$ref": "#/$defs/digest" } } },
34
+ "identity": { "type": "object", "additionalProperties": false, "required": ["id", "name"], "properties": { "id": { "$ref": "#/$defs/id" }, "name": { "$ref": "#/$defs/text" } } },
35
+ "task": { "type": "object", "additionalProperties": false, "required": ["id", "title", "goal"], "properties": { "id": { "$ref": "#/$defs/id" }, "title": { "$ref": "#/$defs/text" }, "goal": { "$ref": "#/$defs/text" } } },
36
+ "workspace": { "type": "object", "additionalProperties": false, "required": ["branchLabel", "baseRevision"], "properties": { "branchLabel": { "$ref": "#/$defs/text" }, "baseRevision": { "$ref": "#/$defs/text" } } },
37
+ "acceptanceResult": { "type": "object", "additionalProperties": false, "required": ["id", "status", "evidence"], "properties": { "id": { "$ref": "#/$defs/id" }, "status": { "enum": ["observed", "not-observed"] }, "evidence": { "$ref": "#/$defs/paths" } } },
38
+ "verificationResult": { "type": "object", "additionalProperties": false, "required": ["id", "status", "summary", "evidence"], "properties": { "id": { "$ref": "#/$defs/id" }, "status": { "enum": ["passed", "failed", "observed", "skipped"] }, "summary": { "$ref": "#/$defs/text" }, "evidence": { "$ref": "#/$defs/paths" } } },
39
+ "receiptSummary": { "type": "object", "additionalProperties": false, "required": ["stageId", "status", "inputBundleDigest", "changedPaths", "acceptanceResults", "verificationResults", "decisions", "openIssues"], "properties": { "stageId": { "$ref": "#/$defs/id" }, "status": { "enum": ["completed", "blocked"] }, "inputBundleDigest": { "$ref": "#/$defs/digest" }, "changedPaths": { "$ref": "#/$defs/paths" }, "acceptanceResults": { "type": "array", "items": { "$ref": "#/$defs/acceptanceResult" } }, "verificationResults": { "type": "array", "items": { "$ref": "#/$defs/verificationResult" } }, "decisions": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/text" } }, "openIssues": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/text" } } } },
40
+ "decisionCandidate": { "type": "object", "additionalProperties": false, "required": ["stageId", "decision"], "properties": { "stageId": { "$ref": "#/$defs/id" }, "decision": { "$ref": "#/$defs/text" } } },
41
+ "readTarget": { "type": "object", "additionalProperties": false, "required": ["path", "reason"], "properties": { "path": { "type": "string", "minLength": 1 }, "reason": { "enum": ["integration-conflict", "contract-source"] }, "sourceId": { "$ref": "#/$defs/id" } } }
42
+ }
43
+ }