hadara 0.3.2 → 0.3.3

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 (52) hide show
  1. package/README.md +49 -34
  2. package/dist/cli/context.js +110 -0
  3. package/dist/cli/help.js +6 -7
  4. package/dist/cli/init.js +56 -58
  5. package/dist/cli/main.js +12 -0
  6. package/dist/cli/session.js +37 -0
  7. package/dist/cli/task.js +52 -0
  8. package/dist/context/code-graph-extractor.js +123 -0
  9. package/dist/context/code-index.js +1154 -0
  10. package/dist/context/context-cache-store.js +925 -0
  11. package/dist/context/context-graph-builder.js +341 -0
  12. package/dist/context/context-graph.js +42 -0
  13. package/dist/context/context-pack.js +457 -0
  14. package/dist/context/context-slice-boundary.js +37 -0
  15. package/dist/context/context-slice.js +487 -0
  16. package/dist/context/document-extractors.js +343 -0
  17. package/dist/context/evidence-extractors.js +179 -0
  18. package/dist/context/extractor-contract.js +166 -0
  19. package/dist/context/registry-extractors.js +177 -0
  20. package/dist/context/release-extractors.js +175 -0
  21. package/dist/context/session-start.js +297 -0
  22. package/dist/context/source-manifest.js +566 -0
  23. package/dist/context/state-projection.js +209 -0
  24. package/dist/context/task-extractors.js +168 -0
  25. package/dist/core/schema.js +26 -0
  26. package/dist/harness/validate.js +7 -8
  27. package/dist/schemas/code-index.schema.json +173 -0
  28. package/dist/schemas/context-cache-record.schema.json +56 -0
  29. package/dist/schemas/context-cache-status.schema.json +167 -0
  30. package/dist/schemas/context-cache-warm.schema.json +222 -0
  31. package/dist/schemas/context-graph.schema.json +286 -0
  32. package/dist/schemas/context-pack.schema.json +246 -0
  33. package/dist/schemas/context-slice.schema.json +94 -0
  34. package/dist/schemas/context-source-manifest.schema.json +147 -0
  35. package/dist/schemas/schema-index.json +91 -0
  36. package/dist/schemas/session-start.schema.json +158 -0
  37. package/dist/schemas/task-close-repair-plan.schema.json +67 -0
  38. package/dist/schemas/task-context.schema.json +125 -0
  39. package/dist/schemas/task-finalize.schema.json +98 -0
  40. package/dist/schemas/task-lifecycle.schema.json +84 -0
  41. package/dist/services/capability-registry.js +266 -9
  42. package/dist/services/lifecycle-guide.js +23 -29
  43. package/dist/services/protocol-consistency.js +6 -8
  44. package/dist/services/workbench-next-actions.js +2 -0
  45. package/dist/task/acceptance.js +171 -0
  46. package/dist/task/task-close-repair-plan.js +190 -0
  47. package/dist/task/task-close.js +34 -35
  48. package/dist/task/task-finalize.js +377 -0
  49. package/dist/task/task-lifecycle.js +210 -0
  50. package/dist/task/task-next.js +10 -1
  51. package/dist/task/task-ready.js +4 -0
  52. package/package.json +1 -1
@@ -0,0 +1,147 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "hadara.context.sourceManifest.v1",
4
+ "x-hadara-schema-id": "hadara.context.sourceManifest.v1",
5
+ "title": "HADARA Context Source Manifest",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": [
9
+ "schemaVersion",
10
+ "generatedAt",
11
+ "projectFingerprint",
12
+ "cacheVersion",
13
+ "manifestHash",
14
+ "ignoreConfigHash",
15
+ "extractorVersions",
16
+ "sources",
17
+ "summary",
18
+ "budget",
19
+ "issues"
20
+ ],
21
+ "properties": {
22
+ "schemaVersion": { "const": "hadara.context.sourceManifest.v1" },
23
+ "generatedAt": { "type": "string" },
24
+ "projectFingerprint": { "type": "string" },
25
+ "cacheVersion": { "type": "string" },
26
+ "manifestHash": { "type": "string" },
27
+ "ignoreConfigHash": { "type": "string" },
28
+ "extractorVersions": {
29
+ "type": "object",
30
+ "additionalProperties": { "type": "string" }
31
+ },
32
+ "sources": {
33
+ "type": "array",
34
+ "items": { "$ref": "#/$defs/source" }
35
+ },
36
+ "summary": { "$ref": "#/$defs/summary" },
37
+ "budget": { "$ref": "#/$defs/budget" },
38
+ "issues": {
39
+ "type": "array",
40
+ "items": { "$ref": "#/$defs/issue" }
41
+ }
42
+ },
43
+ "$defs": {
44
+ "sourceKind": {
45
+ "enum": [
46
+ "task-board",
47
+ "task-capsule",
48
+ "evidence",
49
+ "docs-registry",
50
+ "command-registry",
51
+ "managed-section-source",
52
+ "source-file",
53
+ "test-file",
54
+ "fixture-file",
55
+ "config-file",
56
+ "release-doc",
57
+ "handoff-doc",
58
+ "project-state-doc",
59
+ "spec-doc",
60
+ "other-doc"
61
+ ]
62
+ },
63
+ "source": {
64
+ "type": "object",
65
+ "additionalProperties": true,
66
+ "required": [
67
+ "path",
68
+ "kind",
69
+ "sizeBytes",
70
+ "metadataHash",
71
+ "extractorKeys"
72
+ ],
73
+ "properties": {
74
+ "path": { "type": "string", "minLength": 1 },
75
+ "kind": { "$ref": "#/$defs/sourceKind" },
76
+ "sizeBytes": { "type": "number" },
77
+ "mtimeMs": { "type": "number" },
78
+ "mtimeNs": { "type": "string" },
79
+ "contentHash": { "type": "string" },
80
+ "metadataHash": { "type": "string", "minLength": 1 },
81
+ "extractorKeys": {
82
+ "type": "array",
83
+ "items": { "type": "string", "minLength": 1 }
84
+ },
85
+ "parseState": { "enum": ["ok", "skipped", "failed"] },
86
+ "issueCodes": {
87
+ "type": "array",
88
+ "items": { "type": "string" }
89
+ }
90
+ }
91
+ },
92
+ "summary": {
93
+ "type": "object",
94
+ "additionalProperties": true,
95
+ "required": [
96
+ "sourceCount",
97
+ "totalBytes",
98
+ "hashedSourceCount",
99
+ "skippedSourceCount"
100
+ ],
101
+ "properties": {
102
+ "sourceCount": { "type": "number" },
103
+ "totalBytes": { "type": "number" },
104
+ "hashedSourceCount": { "type": "number" },
105
+ "skippedSourceCount": { "type": "number" },
106
+ "generatedByCommand": { "type": "string" }
107
+ }
108
+ },
109
+ "budget": {
110
+ "type": "object",
111
+ "additionalProperties": true,
112
+ "required": [
113
+ "maxSourceFiles",
114
+ "maxSourceBytes",
115
+ "maxSingleSourceBytes",
116
+ "discoveredSourceCount",
117
+ "discoveredBytes",
118
+ "skippedSourceCount"
119
+ ],
120
+ "properties": {
121
+ "maxSourceFiles": { "type": "number" },
122
+ "maxSourceBytes": { "type": "number" },
123
+ "maxSingleSourceBytes": { "type": "number" },
124
+ "discoveredSourceCount": { "type": "number" },
125
+ "discoveredBytes": { "type": "number" },
126
+ "skippedSourceCount": { "type": "number" }
127
+ }
128
+ },
129
+ "issue": {
130
+ "type": "object",
131
+ "additionalProperties": true,
132
+ "required": ["severity", "code", "message"],
133
+ "properties": {
134
+ "severity": { "enum": ["info", "warning", "error"] },
135
+ "code": {
136
+ "enum": [
137
+ "SOURCE_MANIFEST_READ_FAILED",
138
+ "SOURCE_MANIFEST_PARTIAL"
139
+ ]
140
+ },
141
+ "message": { "type": "string", "minLength": 1 },
142
+ "path": { "type": "string" },
143
+ "fixHint": { "type": "string" }
144
+ }
145
+ }
146
+ }
147
+ }
@@ -64,6 +64,69 @@
64
64
  "owner": "hermes/context-export",
65
65
  "notes": "Documents read-only MCP memory-mode context export; CLI export-context remains file-writing."
66
66
  },
67
+ {
68
+ "id": "hadara.context.cacheRecord.v1",
69
+ "path": "src/schemas/context-cache-record.schema.json",
70
+ "status": "fixture",
71
+ "owner": "context/cache",
72
+ "notes": "Documents C6 context cache record envelopes for projection payloads keyed by source manifests, source subsets, and extractor versions."
73
+ },
74
+ {
75
+ "id": "hadara.context.cacheStatus.v1",
76
+ "path": "src/schemas/context-cache-status.schema.json",
77
+ "status": "fixture",
78
+ "owner": "context/cache",
79
+ "notes": "Documents read-only C6 context cache status reports for source-manifest cache hit, miss, stale, and corrupt states."
80
+ },
81
+ {
82
+ "id": "hadara.context.cacheWarm.v1",
83
+ "path": "src/schemas/context-cache-warm.schema.json",
84
+ "status": "fixture",
85
+ "owner": "context/cache",
86
+ "notes": "Documents dry-run-first C6 context cache warm reports for source-manifest cache population."
87
+ },
88
+ {
89
+ "id": "hadara.codeIndex.v1",
90
+ "path": "src/schemas/code-index.schema.json",
91
+ "status": "fixture",
92
+ "owner": "context/code-index",
93
+ "notes": "Documents deterministic read-only C2 code index reports over source, test, fixture, script, config, symbol, and code relation candidates."
94
+ },
95
+ {
96
+ "id": "hadara.context.sourceManifest.v1",
97
+ "path": "src/schemas/context-source-manifest.schema.json",
98
+ "status": "fixture",
99
+ "owner": "context/source-manifest",
100
+ "notes": "Documents C6.1 metadata-first source discovery manifests for context graph, code index, cache invalidation, and future warm paths."
101
+ },
102
+ {
103
+ "id": "hadara.contextPack.v1",
104
+ "path": "src/schemas/context-pack.schema.json",
105
+ "status": "fixture",
106
+ "owner": "context/context-pack",
107
+ "notes": "Documents deterministic read-only C3 context pack reports over graph-ranked task, document, command, evidence, code, known-problem, validation, write-boundary, and slice-candidate items."
108
+ },
109
+ {
110
+ "id": "hadara.contextSlice.v1",
111
+ "path": "src/schemas/context-slice.schema.json",
112
+ "status": "fixture",
113
+ "owner": "context/context-slice",
114
+ "notes": "Documents deterministic read-only C4 raw context slice reports for explicit ranges, tail windows, keyword windows, managed sections, symbol neighborhoods, and context-pack candidates."
115
+ },
116
+ {
117
+ "id": "hadara.contextGraph.v1",
118
+ "path": "src/schemas/context-graph.schema.json",
119
+ "status": "fixture",
120
+ "owner": "context/graph",
121
+ "notes": "Documents deterministic read-only C1 project context graph reports over task, document, evidence, command, release, decision, and known-problem nodes."
122
+ },
123
+ {
124
+ "id": "hadara.sessionStart.v1",
125
+ "path": "src/schemas/session-start.schema.json",
126
+ "status": "fixture",
127
+ "owner": "context/session-start",
128
+ "notes": "Documents bounded read-only C5 session-start packets composed from context pack, state projection, lifecycle guidance, and cache/degraded metadata."
129
+ },
67
130
  {
68
131
  "id": "hadara.command_help.v1",
69
132
  "path": "src/schemas/command-help.schema.json",
@@ -218,6 +281,13 @@
218
281
  "owner": "task/close",
219
282
  "notes": "Documents task close plan and execute reports with close-evidence loop-boundary metadata."
220
283
  },
284
+ {
285
+ "id": "hadara.task.closeRepairPlan.v1",
286
+ "path": "src/schemas/task-close-repair-plan.schema.json",
287
+ "status": "fixture",
288
+ "owner": "task/close-repair-plan",
289
+ "notes": "Documents read-only close proof repair classifications and next actions."
290
+ },
221
291
  {
222
292
  "id": "hadara.task.complete_flow.v1",
223
293
  "path": "src/schemas/task-complete-flow.schema.json",
@@ -225,6 +295,27 @@
225
295
  "owner": "task/complete-flow",
226
296
  "notes": "Documents read-only task completion flow reports that compose finish, ready, close, and audit guidance."
227
297
  },
298
+ {
299
+ "id": "hadara.task.finalize.v1",
300
+ "path": "src/schemas/task-finalize.schema.json",
301
+ "status": "fixture",
302
+ "owner": "task/finalize",
303
+ "notes": "Documents read-only finalize dry-run plans with plan hashes, lifecycle steps, write boundaries, and execute refusal metadata."
304
+ },
305
+ {
306
+ "id": "hadara.task.lifecycle.v1",
307
+ "path": "src/schemas/task-lifecycle.schema.json",
308
+ "status": "fixture",
309
+ "owner": "task/lifecycle",
310
+ "notes": "Documents read-only normalized lifecycle phase reports that compose finish, ready, close, and audit state."
311
+ },
312
+ {
313
+ "id": "hadara.taskContext.v1",
314
+ "path": "src/schemas/task-context.schema.json",
315
+ "status": "fixture",
316
+ "owner": "context/task-context",
317
+ "notes": "Documents task-centered C1 context reports used to avoid reading the full graph for a selected task."
318
+ },
228
319
  {
229
320
  "id": "hadara.task.create.v1",
230
321
  "path": "src/schemas/task-create.schema.json",
@@ -0,0 +1,158 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "hadara.sessionStart.v1",
4
+ "x-hadara-schema-id": "hadara.sessionStart.v1",
5
+ "title": "HADARA Session Start Report",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": [
9
+ "schemaVersion",
10
+ "command",
11
+ "ok",
12
+ "generatedAt",
13
+ "projectRoot",
14
+ "currentState",
15
+ "contextPack",
16
+ "lifecycle",
17
+ "guidance",
18
+ "knownProblems",
19
+ "sourceSummary",
20
+ "cache",
21
+ "summary",
22
+ "issues"
23
+ ],
24
+ "properties": {
25
+ "schemaVersion": { "const": "hadara.sessionStart.v1" },
26
+ "command": { "const": "session.start" },
27
+ "ok": { "type": "boolean" },
28
+ "generatedAt": { "type": "string" },
29
+ "projectRoot": { "type": "string" },
30
+ "currentState": {
31
+ "type": "object",
32
+ "additionalProperties": true,
33
+ "properties": {
34
+ "activeTask": { "type": "string" },
35
+ "latestCompletedTask": { "type": "string" },
36
+ "recommendedNextTask": { "type": "string" },
37
+ "releaseState": { "type": "string" }
38
+ }
39
+ },
40
+ "contextPack": {
41
+ "type": "object",
42
+ "additionalProperties": true,
43
+ "required": ["schemaVersion", "command", "ok", "readFirst", "readIfNeeded", "issues"],
44
+ "properties": {
45
+ "schemaVersion": { "const": "hadara.contextPack.v1" },
46
+ "command": { "const": "context.pack" },
47
+ "ok": { "type": "boolean" },
48
+ "readFirst": { "type": "array" },
49
+ "readIfNeeded": { "type": "array" },
50
+ "issues": { "type": "array" }
51
+ }
52
+ },
53
+ "lifecycle": {
54
+ "type": "object",
55
+ "additionalProperties": true,
56
+ "required": ["primaryNextCommands", "diagnosticCommands"],
57
+ "properties": {
58
+ "primaryNextCommands": {
59
+ "type": "array",
60
+ "items": { "type": "string", "minLength": 1 }
61
+ },
62
+ "diagnosticCommands": {
63
+ "type": "array",
64
+ "items": { "type": "string", "minLength": 1 }
65
+ }
66
+ }
67
+ },
68
+ "guidance": {
69
+ "type": "object",
70
+ "additionalProperties": true,
71
+ "required": [
72
+ "mode",
73
+ "primaryNextAction",
74
+ "reason",
75
+ "taskRequired",
76
+ "liveContextPackAvailable",
77
+ "commands"
78
+ ],
79
+ "properties": {
80
+ "mode": { "enum": ["live-context-pack", "warm-cache", "bounded-no-live"] },
81
+ "primaryNextAction": { "enum": ["select-task", "inspect-task"] },
82
+ "reason": { "type": "string", "minLength": 1 },
83
+ "taskRequired": { "type": "boolean" },
84
+ "liveContextPackAvailable": { "type": "boolean" },
85
+ "commands": {
86
+ "type": "array",
87
+ "items": {
88
+ "type": "object",
89
+ "additionalProperties": true,
90
+ "required": ["id", "command", "args", "reason"],
91
+ "properties": {
92
+ "id": { "type": "string", "minLength": 1 },
93
+ "command": { "type": "string", "minLength": 1 },
94
+ "args": {
95
+ "type": "array",
96
+ "items": { "type": "string" }
97
+ },
98
+ "reason": { "type": "string", "minLength": 1 }
99
+ }
100
+ }
101
+ }
102
+ }
103
+ },
104
+ "knownProblems": { "type": "array" },
105
+ "sourceSummary": {
106
+ "type": "object",
107
+ "additionalProperties": true,
108
+ "required": ["graphAvailable", "stateProjectionAvailable", "degraded"],
109
+ "properties": {
110
+ "graphAvailable": { "type": "boolean" },
111
+ "stateProjectionAvailable": { "type": "boolean" },
112
+ "degraded": { "type": "boolean" }
113
+ }
114
+ },
115
+ "cache": {
116
+ "type": "object",
117
+ "additionalProperties": true,
118
+ "required": ["used", "hit"],
119
+ "properties": {
120
+ "used": { "type": "boolean" },
121
+ "hit": { "type": "boolean" }
122
+ }
123
+ },
124
+ "summary": {
125
+ "type": "object",
126
+ "additionalProperties": true,
127
+ "required": [
128
+ "degraded",
129
+ "readFirstCount",
130
+ "readIfNeededCount",
131
+ "sliceCandidateCount",
132
+ "knownProblemCount",
133
+ "issueCount"
134
+ ],
135
+ "properties": {
136
+ "degraded": { "type": "boolean" },
137
+ "readFirstCount": { "type": "number" },
138
+ "readIfNeededCount": { "type": "number" },
139
+ "sliceCandidateCount": { "type": "number" },
140
+ "knownProblemCount": { "type": "number" },
141
+ "issueCount": { "type": "number" }
142
+ }
143
+ },
144
+ "issues": {
145
+ "type": "array",
146
+ "items": {
147
+ "type": "object",
148
+ "additionalProperties": true,
149
+ "required": ["severity", "code", "message"],
150
+ "properties": {
151
+ "severity": { "enum": ["info", "warning", "error"] },
152
+ "code": { "type": "string" },
153
+ "message": { "type": "string", "minLength": 1 }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "hadara.task.closeRepairPlan.v1",
4
+ "x-hadara-schema-id": "hadara.task.closeRepairPlan.v1",
5
+ "type": "object",
6
+ "additionalProperties": true,
7
+ "required": ["schemaVersion", "command", "ok", "readOnly", "taskId", "generatedAt", "actor", "classification", "repairNeeded", "summary", "evidence", "causes", "nextActions", "issues"],
8
+ "properties": {
9
+ "schemaVersion": { "const": "hadara.task.closeRepairPlan.v1" },
10
+ "command": { "const": "task.close-repair-plan" },
11
+ "ok": { "type": "boolean" },
12
+ "readOnly": { "const": true },
13
+ "taskId": { "type": "string" },
14
+ "generatedAt": { "type": "string" },
15
+ "actor": {
16
+ "type": "object",
17
+ "additionalProperties": true,
18
+ "required": ["agentId", "runId", "role", "parentRunId"],
19
+ "properties": {
20
+ "agentId": { "type": "string" },
21
+ "runId": { "type": "string" },
22
+ "role": { "enum": ["operator", "coordinator", "worker", "reviewer", "unknown"] },
23
+ "parentRunId": { "type": ["string", "null"] }
24
+ }
25
+ },
26
+ "classification": { "enum": ["not-closed", "closed-stale", "closed-invalid", "duplicate-close-proof", "closed-valid", "unknown"] },
27
+ "repairNeeded": { "type": "boolean" },
28
+ "summary": { "type": "string" },
29
+ "evidence": {
30
+ "type": "object",
31
+ "additionalProperties": true,
32
+ "required": ["closeEvidenceFound", "closeEvidenceValid", "closeEvidenceRecords", "currentValidationReportHash", "currentSourceHash"],
33
+ "properties": {
34
+ "closeEvidenceFound": { "type": "boolean" },
35
+ "closeEvidenceValid": { "type": "boolean" },
36
+ "closeEvidenceRecords": { "type": "number" },
37
+ "latestCloseEvidenceId": { "type": "string" },
38
+ "duplicateCloseEvidenceCount": { "type": "number" },
39
+ "supersededCloseEvidenceIds": { "type": "array", "items": { "type": "string" } },
40
+ "recordedValidationReportHash": { "type": "string" },
41
+ "currentValidationReportHash": { "type": "string" },
42
+ "reportHashMatches": { "type": "boolean" },
43
+ "recordedSourceHash": { "type": "string" },
44
+ "currentSourceHash": { "type": "string" },
45
+ "sourceHashMatches": { "type": "boolean" }
46
+ }
47
+ },
48
+ "causes": {
49
+ "type": "array",
50
+ "items": {
51
+ "type": "object",
52
+ "additionalProperties": true,
53
+ "required": ["code", "severity", "summary", "sourceReport"],
54
+ "properties": {
55
+ "code": { "type": "string" },
56
+ "severity": { "enum": ["error", "warning", "info"] },
57
+ "summary": { "type": "string" },
58
+ "sourceReport": { "enum": ["hadara.task.audit_close.v1", "hadara.task.close.v1"] },
59
+ "path": { "type": "string" }
60
+ }
61
+ }
62
+ },
63
+ "primaryNextAction": { "type": "object", "additionalProperties": true },
64
+ "nextActions": { "type": "array", "items": { "type": "object", "additionalProperties": true } },
65
+ "issues": { "type": "array", "items": { "type": "object", "additionalProperties": true } }
66
+ }
67
+ }
@@ -0,0 +1,125 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "hadara.taskContext.v1",
4
+ "x-hadara-schema-id": "hadara.taskContext.v1",
5
+ "title": "HADARA Task Context Report",
6
+ "type": "object",
7
+ "additionalProperties": true,
8
+ "required": [
9
+ "schemaVersion",
10
+ "taskId",
11
+ "readFirst",
12
+ "readIfNeeded",
13
+ "doNotReadByDefault",
14
+ "relatedEvidence",
15
+ "relatedCommands",
16
+ "knownProblems",
17
+ "validationSuggestions",
18
+ "stateIssues",
19
+ "issues"
20
+ ],
21
+ "properties": {
22
+ "schemaVersion": { "const": "hadara.taskContext.v1" },
23
+ "taskId": { "type": "string", "minLength": 1 },
24
+ "task": { "$ref": "#/$defs/node" },
25
+ "readFirst": { "type": "array", "items": { "$ref": "#/$defs/candidate" } },
26
+ "readIfNeeded": { "type": "array", "items": { "$ref": "#/$defs/candidate" } },
27
+ "doNotReadByDefault": { "type": "array", "items": { "$ref": "#/$defs/candidate" } },
28
+ "relatedEvidence": { "type": "array", "items": { "$ref": "#/$defs/candidate" } },
29
+ "relatedCommands": { "type": "array", "items": { "$ref": "#/$defs/candidate" } },
30
+ "knownProblems": { "type": "array", "items": { "$ref": "#/$defs/candidate" } },
31
+ "validationSuggestions": { "type": "array", "items": { "type": "string" } },
32
+ "stateIssues": { "type": "array", "items": { "$ref": "#/$defs/stateIssue" } },
33
+ "issues": { "type": "array", "items": { "$ref": "#/$defs/graphIssue" } }
34
+ },
35
+ "$defs": {
36
+ "confidence": { "enum": ["explicit", "derived", "heuristic"] },
37
+ "nodeType": {
38
+ "enum": ["Task", "Document", "ManagedSection", "Evidence", "Command", "ReleaseCheck", "Decision", "KnownProblem"]
39
+ },
40
+ "source": {
41
+ "type": "object",
42
+ "additionalProperties": true,
43
+ "required": ["path", "extractor"],
44
+ "properties": {
45
+ "path": { "type": "string", "minLength": 1 },
46
+ "line": { "type": "number" },
47
+ "hash": { "type": "string" },
48
+ "extractor": { "type": "string", "minLength": 1 }
49
+ }
50
+ },
51
+ "node": {
52
+ "type": "object",
53
+ "additionalProperties": true,
54
+ "required": ["id", "type", "label", "source"],
55
+ "properties": {
56
+ "id": { "type": "string", "minLength": 1 },
57
+ "type": { "$ref": "#/$defs/nodeType" },
58
+ "label": { "type": "string", "minLength": 1 },
59
+ "path": { "type": "string" },
60
+ "status": { "type": "string" },
61
+ "kind": { "type": "string" },
62
+ "owner": { "type": "string" },
63
+ "metadata": { "type": "object" },
64
+ "source": { "$ref": "#/$defs/source" }
65
+ }
66
+ },
67
+ "candidate": {
68
+ "type": "object",
69
+ "additionalProperties": true,
70
+ "required": ["id", "type", "reason", "confidence"],
71
+ "properties": {
72
+ "id": { "type": "string", "minLength": 1 },
73
+ "type": { "$ref": "#/$defs/nodeType" },
74
+ "path": { "type": "string" },
75
+ "reason": { "type": "string", "minLength": 1 },
76
+ "confidence": { "$ref": "#/$defs/confidence" },
77
+ "sourceHash": { "type": "string" }
78
+ }
79
+ },
80
+ "stateIssue": {
81
+ "type": "object",
82
+ "additionalProperties": true,
83
+ "required": ["severity", "code", "message", "paths"],
84
+ "properties": {
85
+ "severity": { "enum": ["info", "warning", "error"] },
86
+ "code": {
87
+ "enum": [
88
+ "STATE_LATEST_TASK_MISMATCH",
89
+ "STATE_ACTIVE_TASK_MISMATCH",
90
+ "STATE_TASK_BOARD_MISSING_ROW",
91
+ "STATE_TASK_CAPSULE_MISSING",
92
+ "STATE_CLOSE_PROOF_STALE",
93
+ "STATE_RELEASE_EVIDENCE_STALE",
94
+ "STATE_DOC_REQUIRED_READING_DRIFT",
95
+ "STATE_UNKNOWN"
96
+ ]
97
+ },
98
+ "message": { "type": "string", "minLength": 1 },
99
+ "paths": { "type": "array", "items": { "type": "string" } },
100
+ "fixHint": { "type": "string" }
101
+ }
102
+ },
103
+ "graphIssue": {
104
+ "type": "object",
105
+ "additionalProperties": true,
106
+ "required": ["severity", "code", "message"],
107
+ "properties": {
108
+ "severity": { "enum": ["info", "warning", "error"] },
109
+ "code": {
110
+ "enum": [
111
+ "CONTEXT_GRAPH_SOURCE_MISSING",
112
+ "CONTEXT_GRAPH_PARSE_FAILED",
113
+ "CONTEXT_GRAPH_DOC_REGISTRY_MISSING",
114
+ "CONTEXT_GRAPH_COMMAND_REGISTRY_MISSING",
115
+ "CONTEXT_GRAPH_EVIDENCE_READ_FAILED",
116
+ "CONTEXT_GRAPH_DEGRADED"
117
+ ]
118
+ },
119
+ "message": { "type": "string", "minLength": 1 },
120
+ "path": { "type": "string" },
121
+ "fixHint": { "type": "string" }
122
+ }
123
+ }
124
+ }
125
+ }