@quolu/lattice 0.63.0 → 0.63.2

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 (60) hide show
  1. package/LICENSE +147 -147
  2. package/README.ja.md +378 -378
  3. package/README.md +303 -303
  4. package/bin/lattice-mcp.mjs +0 -0
  5. package/bin/lattice-scripted-adapter.mjs +0 -0
  6. package/bin/lattice-scripted-worker.mjs +0 -0
  7. package/bin/lattice-work-order-adapter.mjs +0 -0
  8. package/bin/lattice.mjs +3 -1
  9. package/docs/bridge-setup.md +248 -248
  10. package/docs/schemas/lattice.executor_packet.v1.schema.json +57 -57
  11. package/docs/schemas/lattice.executor_receipt.v1.schema.json +66 -66
  12. package/docs/schemas/lattice.phase_todo_revision.v3.schema.json +360 -360
  13. package/docs/schemas/lattice.plan_create_input.v1.schema.json +56 -56
  14. package/docs/schemas/lattice.plan_create_input.v2.schema.json +72 -72
  15. package/docs/schemas/lattice.plan_create_input.v3.schema.json +81 -81
  16. package/docs/schemas/lattice.plan_create_input.v4.schema.json +357 -85
  17. package/docs/schemas/lattice.plan_scope_review.v1.schema.json +55 -55
  18. package/docs/schemas/lattice.run_request.v1.schema.json +238 -238
  19. package/docs/schemas/lattice.runtime_adapter_capabilities.v2.schema.json +55 -55
  20. package/docs/schemas/lattice.runtime_adapter_registration_input.v1.schema.json +78 -78
  21. package/docs/schemas/lattice.runtime_adapter_registration_input.v2.schema.json +86 -86
  22. package/docs/schemas/lattice.todo_extraction.v2.schema.json +298 -298
  23. package/docs/schemas/lattice.todo_extraction.v3.schema.json +150 -150
  24. package/docs/schemas/lattice.todo_extraction.v4.schema.json +161 -161
  25. package/docs/schemas/lattice.todo_revision.v2.schema.json +260 -260
  26. package/docs/schemas/lattice.todo_revision_set.v3.schema.json +363 -363
  27. package/docs/schemas/lattice.todo_structure_binding.v1.schema.json +47 -47
  28. package/docs/schemas/lattice.todo_structure_realization.v1.schema.json +55 -55
  29. package/docs/schemas/lattice.todo_structure_set.v1.schema.json +264 -264
  30. package/package.json +109 -109
  31. package/sensor/LICENSE +21 -21
  32. package/sensor/NOTICE +19 -19
  33. package/sensor/dist/bin/lattice-sensor.js +9 -9
  34. package/sensor/dist/db/index.js +24 -24
  35. package/sensor/dist/db/migrations.js +41 -41
  36. package/sensor/dist/db/queries.js +164 -164
  37. package/sensor/dist/db/schema.sql +205 -205
  38. package/sensor/dist/directory.js +5 -5
  39. package/sensor/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  40. package/sensor/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  41. package/sensor/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  42. package/sensor/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  43. package/sensor/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  44. package/sensor/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  45. package/sensor/dist/extraction/wasm/tree-sitter-go.wasm +0 -0
  46. package/sensor/dist/extraction/wasm/tree-sitter-java.wasm +0 -0
  47. package/sensor/dist/extraction/wasm/tree-sitter-javascript.wasm +0 -0
  48. package/sensor/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  49. package/sensor/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  50. package/sensor/dist/extraction/wasm/tree-sitter-python.wasm +0 -0
  51. package/sensor/dist/extraction/wasm/tree-sitter-tsx.wasm +0 -0
  52. package/sensor/dist/extraction/wasm/tree-sitter-typescript.wasm +0 -0
  53. package/sensor/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  54. package/sensor/dist/mcp/liveness-watchdog.js +53 -53
  55. package/sensor/dist/mcp/server-instructions.js +95 -95
  56. package/sensor/package.json +56 -56
  57. package/src/project-cli.mjs +164 -24
  58. package/src/todo-authoring-input.mjs +35 -5
  59. package/src/todo-cli.mjs +2 -2
  60. package/src/todo-store.mjs +52 -21
@@ -1,85 +1,357 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/kitepon/Lattice/blob/main/docs/schemas/lattice.plan_create_input.v4.schema.json",
4
- "title": "lattice.plan_create_input.v4",
5
- "description": "Canonical initial authoring input for a phase-audited plan. Every task requires a design memo. After the complete plan is written, run `lattice plan scope-review` and confirm that every task preserves an owner-supplied work specification without adding a product purpose. あなたがこのToDoに対して、何も考えていないならば、設計メモに `NO_PLAN` と書いてください",
6
- "$comment": "Runtime validation additionally enforces canonical JSON+LF bytes, sorted identifiers and edges, unique ids, combined task/phase acyclicity, byte bounds, non-empty design_memo, and input_digest.",
7
- "type": "object",
8
- "additionalProperties": false,
9
- "required": ["schema", "project_id", "plan_key", "plan_version", "actor", "recorded_at", "tasks", "phases", "hard_dependencies", "joins", "phase_accept_dependencies", "input_digest"],
10
- "properties": {
11
- "schema": { "const": "lattice.plan_create_input.v4" },
12
- "project_id": { "$ref": "#/$defs/identifier" },
13
- "plan_key": { "$ref": "#/$defs/identifier" },
14
- "plan_version": { "$ref": "#/$defs/identifier" },
15
- "actor": { "$ref": "#/$defs/actor" },
16
- "recorded_at": { "$ref": "#/$defs/strictTimestamp" },
17
- "tasks": { "type": "array", "minItems": 1, "maxItems": 512, "items": { "$ref": "#/$defs/task" } },
18
- "phases": { "type": "array", "minItems": 1, "maxItems": 512, "items": { "$ref": "#/$defs/phase" } },
19
- "hard_dependencies": { "type": "array", "maxItems": 2048, "items": { "$ref": "#/$defs/edge" } },
20
- "joins": { "type": "array", "maxItems": 128, "items": { "$ref": "#/$defs/join" } },
21
- "phase_accept_dependencies": { "type": "array", "maxItems": 2048, "items": { "$ref": "#/$defs/phaseAcceptDependency" } },
22
- "input_digest": { "$ref": "#/$defs/digest" }
23
- },
24
- "$defs": {
25
- "identifier": { "type": "string", "pattern": "^[0-9A-Za-z](?:[0-9A-Za-z._-]{0,127})$" },
26
- "digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
27
- "repoRef": { "type": "string", "minLength": 1, "maxLength": 1024 },
28
- "strictTimestamp": { "type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$" },
29
- "nullableRepoRef": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/repoRef" }] },
30
- "nullableIdentifier": { "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/identifier" }] },
31
- "actor": {
32
- "type": "object", "additionalProperties": false, "required": ["host", "session", "agent"],
33
- "properties": { "host": { "$ref": "#/$defs/identifier" }, "session": { "$ref": "#/$defs/identifier" }, "agent": { "$ref": "#/$defs/identifier" } }
34
- },
35
- "task": {
36
- "type": "object", "additionalProperties": false,
37
- "required": ["task_id", "title", "lane", "design_memo", "narrative_ref", "narrative_anchor", "compile_binding", "parent_task_id", "phase_id"],
38
- "properties": {
39
- "task_id": { "$ref": "#/$defs/identifier" },
40
- "title": { "oneOf": [{ "type": "null" }, { "type": "string", "minLength": 1, "maxLength": 16384 }] },
41
- "lane": { "$ref": "#/$defs/identifier" },
42
- "design_memo": {
43
- "type": "string", "minLength": 1, "maxLength": 16384,
44
- "description": "Markdown design memo. あなたがこのToDoに対して、何も考えていないならば、設計メモに `NO_PLAN` と書いてください"
45
- },
46
- "narrative_ref": { "$ref": "#/$defs/nullableRepoRef" },
47
- "narrative_anchor": { "type": "null" },
48
- "compile_binding": { "type": "null" },
49
- "parent_task_id": { "$ref": "#/$defs/nullableIdentifier" },
50
- "phase_id": { "$ref": "#/$defs/identifier" }
51
- }
52
- },
53
- "phase": {
54
- "type": "object", "additionalProperties": false,
55
- "required": ["phase_id", "title", "gate_policy", "predecessor_phase_ids", "required_evidence_slots"],
56
- "properties": {
57
- "phase_id": { "$ref": "#/$defs/identifier" },
58
- "title": { "oneOf": [{ "type": "null" }, { "type": "string", "minLength": 1, "maxLength": 16384 }] },
59
- "gate_policy": { "$ref": "#/$defs/identifier" },
60
- "predecessor_phase_ids": { "type": "array", "items": { "$ref": "#/$defs/identifier" }, "uniqueItems": true },
61
- "required_evidence_slots": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/identifier" }, "uniqueItems": true }
62
- }
63
- },
64
- "nodeRef": {
65
- "type": "object", "additionalProperties": false, "required": ["project_id", "plan_key", "task_id"],
66
- "properties": { "project_id": { "$ref": "#/$defs/identifier" }, "plan_key": { "$ref": "#/$defs/identifier" }, "task_id": { "$ref": "#/$defs/identifier" }, "expected_topology_digest": { "$ref": "#/$defs/digest" } }
67
- },
68
- "phaseRef": {
69
- "type": "object", "additionalProperties": false, "required": ["project_id", "plan_key", "phase_id"],
70
- "properties": { "project_id": { "$ref": "#/$defs/identifier" }, "plan_key": { "$ref": "#/$defs/identifier" }, "phase_id": { "$ref": "#/$defs/identifier" }, "expected_topology_digest": { "$ref": "#/$defs/digest" } }
71
- },
72
- "edge": {
73
- "type": "object", "additionalProperties": false, "required": ["from", "to"],
74
- "properties": { "from": { "$ref": "#/$defs/nodeRef" }, "to": { "$ref": "#/$defs/nodeRef" } }
75
- },
76
- "phaseAcceptDependency": {
77
- "type": "object", "additionalProperties": false, "required": ["from", "to"],
78
- "properties": { "from": { "$ref": "#/$defs/phaseRef" }, "to": { "$ref": "#/$defs/nodeRef" } }
79
- },
80
- "join": {
81
- "type": "object", "additionalProperties": false, "required": ["id", "after", "before"],
82
- "properties": { "id": { "$ref": "#/$defs/identifier" }, "after": { "type": "array", "minItems": 1, "maxItems": 512, "items": { "$ref": "#/$defs/nodeRef" } }, "before": { "$ref": "#/$defs/nodeRef" } }
83
- }
84
- }
85
- }
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/kitepon/Lattice/blob/main/docs/schemas/lattice.plan_create_input.v4.schema.json",
4
+ "title": "lattice.plan_create_input.v4",
5
+ "description": "Canonical initial authoring input for a phase-audited plan. Every task requires a design memo. After the complete plan is written, run `lattice plan scope-review` and confirm that every task preserves an owner-supplied work specification without adding a product purpose. あなたがこのToDoに対して、何も考えていないならば、設計メモに `NO_PLAN` と書いてください",
6
+ "$comment": "Runtime validation additionally enforces canonical JSON+LF bytes, sorted identifiers and edges, unique ids, combined task/phase acyclicity, byte bounds, non-empty design_memo, and input_digest.",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "required": [
10
+ "schema",
11
+ "project_id",
12
+ "plan_key",
13
+ "plan_version",
14
+ "actor",
15
+ "recorded_at",
16
+ "tasks",
17
+ "phases",
18
+ "hard_dependencies",
19
+ "joins",
20
+ "phase_accept_dependencies",
21
+ "input_digest"
22
+ ],
23
+ "properties": {
24
+ "schema": {
25
+ "const": "lattice.plan_create_input.v4"
26
+ },
27
+ "project_id": {
28
+ "$ref": "#/$defs/identifier"
29
+ },
30
+ "plan_key": {
31
+ "$ref": "#/$defs/identifier"
32
+ },
33
+ "plan_version": {
34
+ "$ref": "#/$defs/identifier"
35
+ },
36
+ "actor": {
37
+ "$ref": "#/$defs/actor"
38
+ },
39
+ "recorded_at": {
40
+ "$ref": "#/$defs/strictTimestamp"
41
+ },
42
+ "tasks": {
43
+ "type": "array",
44
+ "minItems": 1,
45
+ "maxItems": 512,
46
+ "items": {
47
+ "$ref": "#/$defs/task"
48
+ },
49
+ "description": "task_idの昇順・重複なしで並べる。整列はJSON Schemaでは表現できないがCLIは拒否する。"
50
+ },
51
+ "phases": {
52
+ "type": "array",
53
+ "minItems": 1,
54
+ "maxItems": 512,
55
+ "items": {
56
+ "$ref": "#/$defs/phase"
57
+ },
58
+ "description": "phase_idの昇順・重複なしで並べる。全taskのphase_idはここに存在しなければならない。"
59
+ },
60
+ "hard_dependencies": {
61
+ "type": "array",
62
+ "maxItems": 2048,
63
+ "items": {
64
+ "$ref": "#/$defs/edge"
65
+ }
66
+ },
67
+ "joins": {
68
+ "type": "array",
69
+ "maxItems": 128,
70
+ "items": {
71
+ "$ref": "#/$defs/join"
72
+ }
73
+ },
74
+ "phase_accept_dependencies": {
75
+ "type": "array",
76
+ "maxItems": 2048,
77
+ "items": {
78
+ "$ref": "#/$defs/phaseAcceptDependency"
79
+ }
80
+ },
81
+ "input_digest": {
82
+ "$ref": "#/$defs/authoringDigest"
83
+ }
84
+ },
85
+ "$defs": {
86
+ "identifier": {
87
+ "type": "string",
88
+ "pattern": "^[0-9A-Za-z](?:[0-9A-Za-z._-]{0,127})$"
89
+ },
90
+ "digest": {
91
+ "type": "string",
92
+ "pattern": "^[0-9a-f]{64}$"
93
+ },
94
+ "repoRef": {
95
+ "type": "string",
96
+ "minLength": 1,
97
+ "maxLength": 1024
98
+ },
99
+ "strictTimestamp": {
100
+ "type": "string",
101
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
102
+ },
103
+ "nullableRepoRef": {
104
+ "oneOf": [
105
+ {
106
+ "type": "null"
107
+ },
108
+ {
109
+ "$ref": "#/$defs/repoRef"
110
+ }
111
+ ]
112
+ },
113
+ "nullableIdentifier": {
114
+ "oneOf": [
115
+ {
116
+ "type": "null"
117
+ },
118
+ {
119
+ "$ref": "#/$defs/identifier"
120
+ }
121
+ ]
122
+ },
123
+ "actor": {
124
+ "type": "object",
125
+ "additionalProperties": false,
126
+ "required": [
127
+ "host",
128
+ "session",
129
+ "agent"
130
+ ],
131
+ "properties": {
132
+ "host": {
133
+ "$ref": "#/$defs/identifier"
134
+ },
135
+ "session": {
136
+ "$ref": "#/$defs/identifier"
137
+ },
138
+ "agent": {
139
+ "$ref": "#/$defs/identifier"
140
+ }
141
+ }
142
+ },
143
+ "task": {
144
+ "type": "object",
145
+ "additionalProperties": false,
146
+ "required": [
147
+ "task_id",
148
+ "title",
149
+ "lane",
150
+ "design_memo",
151
+ "narrative_ref",
152
+ "narrative_anchor",
153
+ "compile_binding",
154
+ "parent_task_id",
155
+ "phase_id"
156
+ ],
157
+ "properties": {
158
+ "task_id": {
159
+ "$ref": "#/$defs/identifier"
160
+ },
161
+ "title": {
162
+ "oneOf": [
163
+ {
164
+ "type": "null"
165
+ },
166
+ {
167
+ "type": "string",
168
+ "minLength": 1,
169
+ "maxLength": 16384
170
+ }
171
+ ]
172
+ },
173
+ "lane": {
174
+ "$ref": "#/$defs/identifier"
175
+ },
176
+ "design_memo": {
177
+ "type": "string",
178
+ "minLength": 1,
179
+ "maxLength": 16384,
180
+ "description": "Markdown design memo. あなたがこのToDoに対して、何も考えていないならば、設計メモに `NO_PLAN` と書いてください"
181
+ },
182
+ "narrative_ref": {
183
+ "$ref": "#/$defs/nullableRepoRef"
184
+ },
185
+ "narrative_anchor": {
186
+ "type": "null"
187
+ },
188
+ "compile_binding": {
189
+ "type": "null"
190
+ },
191
+ "parent_task_id": {
192
+ "$ref": "#/$defs/nullableIdentifier"
193
+ },
194
+ "phase_id": {
195
+ "$ref": "#/$defs/identifier"
196
+ }
197
+ }
198
+ },
199
+ "phase": {
200
+ "type": "object",
201
+ "additionalProperties": false,
202
+ "required": [
203
+ "phase_id",
204
+ "title",
205
+ "gate_policy",
206
+ "predecessor_phase_ids",
207
+ "required_evidence_slots"
208
+ ],
209
+ "properties": {
210
+ "phase_id": {
211
+ "$ref": "#/$defs/identifier"
212
+ },
213
+ "title": {
214
+ "oneOf": [
215
+ {
216
+ "type": "null"
217
+ },
218
+ {
219
+ "type": "string",
220
+ "minLength": 1,
221
+ "maxLength": 16384
222
+ }
223
+ ]
224
+ },
225
+ "gate_policy": {
226
+ "$ref": "#/$defs/identifier",
227
+ "description": "Phase gateの呼び名。製品はこの値で分岐しないので統制語彙は無く、identifierなら何でもよい。表示に使う。慣用は 'heavy'(重監査)と 'terminal-audit'(暗黙の終端Phaseが使う)。"
228
+ },
229
+ "predecessor_phase_ids": {
230
+ "type": "array",
231
+ "items": {
232
+ "$ref": "#/$defs/identifier"
233
+ },
234
+ "uniqueItems": true,
235
+ "description": "先行Phase。identifierの昇順・重複なしで並べる。"
236
+ },
237
+ "required_evidence_slots": {
238
+ "type": "array",
239
+ "minItems": 1,
240
+ "items": {
241
+ "$ref": "#/$defs/identifier"
242
+ },
243
+ "uniqueItems": true,
244
+ "description": "Phase gateが要求する証跡slot。1つ以上必須で、identifierの昇順・重複なしで並べる。"
245
+ }
246
+ }
247
+ },
248
+ "nodeRef": {
249
+ "type": "object",
250
+ "additionalProperties": false,
251
+ "required": [
252
+ "project_id",
253
+ "plan_key",
254
+ "task_id"
255
+ ],
256
+ "properties": {
257
+ "project_id": {
258
+ "$ref": "#/$defs/identifier"
259
+ },
260
+ "plan_key": {
261
+ "$ref": "#/$defs/identifier"
262
+ },
263
+ "task_id": {
264
+ "$ref": "#/$defs/identifier"
265
+ },
266
+ "expected_topology_digest": {
267
+ "$ref": "#/$defs/digest"
268
+ }
269
+ }
270
+ },
271
+ "phaseRef": {
272
+ "type": "object",
273
+ "additionalProperties": false,
274
+ "required": [
275
+ "project_id",
276
+ "plan_key",
277
+ "phase_id"
278
+ ],
279
+ "properties": {
280
+ "project_id": {
281
+ "$ref": "#/$defs/identifier"
282
+ },
283
+ "plan_key": {
284
+ "$ref": "#/$defs/identifier"
285
+ },
286
+ "phase_id": {
287
+ "$ref": "#/$defs/identifier"
288
+ },
289
+ "expected_topology_digest": {
290
+ "$ref": "#/$defs/digest"
291
+ }
292
+ }
293
+ },
294
+ "edge": {
295
+ "type": "object",
296
+ "additionalProperties": false,
297
+ "required": [
298
+ "from",
299
+ "to"
300
+ ],
301
+ "properties": {
302
+ "from": {
303
+ "$ref": "#/$defs/nodeRef"
304
+ },
305
+ "to": {
306
+ "$ref": "#/$defs/nodeRef"
307
+ }
308
+ }
309
+ },
310
+ "phaseAcceptDependency": {
311
+ "type": "object",
312
+ "additionalProperties": false,
313
+ "required": [
314
+ "from",
315
+ "to"
316
+ ],
317
+ "properties": {
318
+ "from": {
319
+ "$ref": "#/$defs/phaseRef"
320
+ },
321
+ "to": {
322
+ "$ref": "#/$defs/nodeRef"
323
+ }
324
+ }
325
+ },
326
+ "join": {
327
+ "type": "object",
328
+ "additionalProperties": false,
329
+ "required": [
330
+ "id",
331
+ "after",
332
+ "before"
333
+ ],
334
+ "properties": {
335
+ "id": {
336
+ "$ref": "#/$defs/identifier"
337
+ },
338
+ "after": {
339
+ "type": "array",
340
+ "minItems": 1,
341
+ "maxItems": 512,
342
+ "items": {
343
+ "$ref": "#/$defs/nodeRef"
344
+ }
345
+ },
346
+ "before": {
347
+ "$ref": "#/$defs/nodeRef"
348
+ }
349
+ }
350
+ },
351
+ "authoringDigest": {
352
+ "type": "string",
353
+ "pattern": "^(|[0-9a-f]{64})$",
354
+ "description": "canonical入力から算出される自己digest。CLIが読み込み時に必ず再計算して埋めるので、authorは空文字 \"\" を置けばよい。手で計算する必要はない。"
355
+ }
356
+ }
357
+ }
@@ -1,55 +1,55 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/kitepon/Lattice/blob/main/docs/schemas/lattice.plan_scope_review.v1.schema.json",
4
- "title": "lattice.plan_scope_review.v1",
5
- "description": "AI-authored review performed after the complete plan is written and before it is registered. Every planned task is judged against the owner-supplied work specifications; task splitting and parallelization are allowed, but a new product purpose is not.",
6
- "$comment": "Lattice validates complete task coverage, known work-spec references, verdict consistency, and digest binding. The operating AI owns the semantic judgment.",
7
- "type": "object",
8
- "additionalProperties": false,
9
- "required": [
10
- "schema", "authoring_digest", "work_specs", "task_assessments", "verdict", "review_digest"
11
- ],
12
- "properties": {
13
- "schema": { "const": "lattice.plan_scope_review.v1" },
14
- "authoring_digest": { "$ref": "#/$defs/digest" },
15
- "work_specs": {
16
- "type": "array", "minItems": 1, "maxItems": 512,
17
- "description": "The owner-supplied work specifications. Do not add inferred improvements as work specifications.",
18
- "items": { "$ref": "#/$defs/workSpec" }
19
- },
20
- "task_assessments": {
21
- "type": "array", "minItems": 1, "maxItems": 512,
22
- "description": "Exactly one assessment for every task that will be registered. Use out_of_scope when the task creates a purpose not required by any work specification.",
23
- "items": { "$ref": "#/$defs/taskAssessment" }
24
- },
25
- "verdict": { "enum": ["scope_preserved", "scope_mismatch"] },
26
- "review_digest": { "$ref": "#/$defs/digest" }
27
- },
28
- "$defs": {
29
- "identifier": { "type": "string", "pattern": "^[0-9A-Za-z](?:[0-9A-Za-z._-]{0,127})$" },
30
- "digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
31
- "text": { "type": "string", "minLength": 1, "maxLength": 16384, "pattern": "\\S" },
32
- "workSpec": {
33
- "type": "object", "additionalProperties": false,
34
- "required": ["work_spec_id", "requirement", "acceptance"],
35
- "properties": {
36
- "work_spec_id": { "$ref": "#/$defs/identifier" },
37
- "requirement": { "$ref": "#/$defs/text" },
38
- "acceptance": { "$ref": "#/$defs/text" }
39
- }
40
- },
41
- "taskAssessment": {
42
- "type": "object", "additionalProperties": false,
43
- "required": ["task_id", "work_spec_ids", "judgment", "reason"],
44
- "properties": {
45
- "task_id": { "$ref": "#/$defs/identifier" },
46
- "work_spec_ids": {
47
- "type": "array", "maxItems": 512, "uniqueItems": true,
48
- "items": { "$ref": "#/$defs/identifier" }
49
- },
50
- "judgment": { "enum": ["required", "out_of_scope"] },
51
- "reason": { "$ref": "#/$defs/text" }
52
- }
53
- }
54
- }
55
- }
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/kitepon/Lattice/blob/main/docs/schemas/lattice.plan_scope_review.v1.schema.json",
4
+ "title": "lattice.plan_scope_review.v1",
5
+ "description": "AI-authored review performed after the complete plan is written and before it is registered. Every planned task is judged against the owner-supplied work specifications; task splitting and parallelization are allowed, but a new product purpose is not.",
6
+ "$comment": "Lattice validates complete task coverage, known work-spec references, verdict consistency, and digest binding. The operating AI owns the semantic judgment.",
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "required": [
10
+ "schema", "authoring_digest", "work_specs", "task_assessments", "verdict", "review_digest"
11
+ ],
12
+ "properties": {
13
+ "schema": { "const": "lattice.plan_scope_review.v1" },
14
+ "authoring_digest": { "$ref": "#/$defs/digest" },
15
+ "work_specs": {
16
+ "type": "array", "minItems": 1, "maxItems": 512,
17
+ "description": "The owner-supplied work specifications. Do not add inferred improvements as work specifications.",
18
+ "items": { "$ref": "#/$defs/workSpec" }
19
+ },
20
+ "task_assessments": {
21
+ "type": "array", "minItems": 1, "maxItems": 512,
22
+ "description": "Exactly one assessment for every task that will be registered. Use out_of_scope when the task creates a purpose not required by any work specification.",
23
+ "items": { "$ref": "#/$defs/taskAssessment" }
24
+ },
25
+ "verdict": { "enum": ["scope_preserved", "scope_mismatch"] },
26
+ "review_digest": { "$ref": "#/$defs/digest" }
27
+ },
28
+ "$defs": {
29
+ "identifier": { "type": "string", "pattern": "^[0-9A-Za-z](?:[0-9A-Za-z._-]{0,127})$" },
30
+ "digest": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
31
+ "text": { "type": "string", "minLength": 1, "maxLength": 16384, "pattern": "\\S" },
32
+ "workSpec": {
33
+ "type": "object", "additionalProperties": false,
34
+ "required": ["work_spec_id", "requirement", "acceptance"],
35
+ "properties": {
36
+ "work_spec_id": { "$ref": "#/$defs/identifier" },
37
+ "requirement": { "$ref": "#/$defs/text" },
38
+ "acceptance": { "$ref": "#/$defs/text" }
39
+ }
40
+ },
41
+ "taskAssessment": {
42
+ "type": "object", "additionalProperties": false,
43
+ "required": ["task_id", "work_spec_ids", "judgment", "reason"],
44
+ "properties": {
45
+ "task_id": { "$ref": "#/$defs/identifier" },
46
+ "work_spec_ids": {
47
+ "type": "array", "maxItems": 512, "uniqueItems": true,
48
+ "items": { "$ref": "#/$defs/identifier" }
49
+ },
50
+ "judgment": { "enum": ["required", "out_of_scope"] },
51
+ "reason": { "$ref": "#/$defs/text" }
52
+ }
53
+ }
54
+ }
55
+ }