@moreih29/nexus-core 0.12.0 → 0.13.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 (210) hide show
  1. package/README.md +48 -63
  2. package/assets/agents/architect/body.ko.md +177 -0
  3. package/{agents → assets/agents}/architect/body.md +16 -0
  4. package/assets/agents/designer/body.ko.md +125 -0
  5. package/{agents → assets/agents}/designer/body.md +16 -0
  6. package/assets/agents/engineer/body.ko.md +106 -0
  7. package/{agents → assets/agents}/engineer/body.md +14 -0
  8. package/assets/agents/lead/body.ko.md +70 -0
  9. package/assets/agents/lead/body.md +70 -0
  10. package/assets/agents/postdoc/body.ko.md +122 -0
  11. package/{agents → assets/agents}/postdoc/body.md +16 -0
  12. package/assets/agents/researcher/body.ko.md +137 -0
  13. package/{agents → assets/agents}/researcher/body.md +15 -0
  14. package/assets/agents/reviewer/body.ko.md +138 -0
  15. package/{agents → assets/agents}/reviewer/body.md +15 -0
  16. package/assets/agents/strategist/body.ko.md +116 -0
  17. package/{agents → assets/agents}/strategist/body.md +16 -0
  18. package/assets/agents/tester/body.ko.md +195 -0
  19. package/{agents → assets/agents}/tester/body.md +15 -0
  20. package/assets/agents/writer/body.ko.md +122 -0
  21. package/{agents → assets/agents}/writer/body.md +14 -0
  22. package/assets/capability-matrix.yml +198 -0
  23. package/assets/hooks/agent-bootstrap/handler.test.ts +368 -0
  24. package/assets/hooks/agent-bootstrap/handler.ts +119 -0
  25. package/assets/hooks/agent-bootstrap/meta.yml +10 -0
  26. package/assets/hooks/agent-finalize/handler.test.ts +368 -0
  27. package/assets/hooks/agent-finalize/handler.ts +76 -0
  28. package/assets/hooks/agent-finalize/meta.yml +10 -0
  29. package/assets/hooks/capability-matrix.yml +313 -0
  30. package/assets/hooks/post-tool-telemetry/handler.test.ts +302 -0
  31. package/assets/hooks/post-tool-telemetry/handler.ts +49 -0
  32. package/assets/hooks/post-tool-telemetry/meta.yml +11 -0
  33. package/assets/hooks/prompt-router/handler.test.ts +801 -0
  34. package/assets/hooks/prompt-router/handler.ts +261 -0
  35. package/assets/hooks/prompt-router/meta.yml +11 -0
  36. package/assets/hooks/session-init/handler.test.ts +274 -0
  37. package/assets/hooks/session-init/handler.ts +30 -0
  38. package/assets/hooks/session-init/meta.yml +9 -0
  39. package/assets/lsp-servers.json +55 -0
  40. package/assets/schema/lsp-servers.schema.json +67 -0
  41. package/assets/skills/nx-init/body.ko.md +197 -0
  42. package/{skills → assets/skills}/nx-init/body.md +11 -0
  43. package/assets/skills/nx-plan/body.ko.md +361 -0
  44. package/{skills → assets/skills}/nx-plan/body.md +13 -0
  45. package/assets/skills/nx-run/body.ko.md +161 -0
  46. package/{skills → assets/skills}/nx-run/body.md +11 -0
  47. package/assets/skills/nx-sync/body.ko.md +92 -0
  48. package/{skills → assets/skills}/nx-sync/body.md +10 -0
  49. package/assets/tools/tool-name-map.yml +353 -0
  50. package/dist/hooks/opencode-mount.d.ts +35 -0
  51. package/dist/hooks/opencode-mount.d.ts.map +1 -0
  52. package/dist/hooks/opencode-mount.js +332 -0
  53. package/dist/hooks/opencode-mount.js.map +1 -0
  54. package/dist/hooks/runtime.d.ts +37 -0
  55. package/dist/hooks/runtime.d.ts.map +1 -0
  56. package/dist/hooks/runtime.js +274 -0
  57. package/dist/hooks/runtime.js.map +1 -0
  58. package/dist/hooks/types.d.ts +196 -0
  59. package/dist/hooks/types.d.ts.map +1 -0
  60. package/dist/hooks/types.js +85 -0
  61. package/dist/hooks/types.js.map +1 -0
  62. package/dist/lsp/cache.d.ts +9 -0
  63. package/dist/lsp/cache.d.ts.map +1 -0
  64. package/dist/lsp/cache.js +216 -0
  65. package/dist/lsp/cache.js.map +1 -0
  66. package/dist/lsp/client.d.ts +24 -0
  67. package/dist/lsp/client.d.ts.map +1 -0
  68. package/dist/lsp/client.js +166 -0
  69. package/dist/lsp/client.js.map +1 -0
  70. package/dist/lsp/detect.d.ts +77 -0
  71. package/dist/lsp/detect.d.ts.map +1 -0
  72. package/dist/lsp/detect.js +116 -0
  73. package/dist/lsp/detect.js.map +1 -0
  74. package/dist/mcp/server.d.ts +5 -0
  75. package/dist/mcp/server.d.ts.map +1 -0
  76. package/dist/mcp/server.js +34 -0
  77. package/dist/mcp/server.js.map +1 -0
  78. package/dist/mcp/tools/artifact.d.ts +4 -0
  79. package/dist/mcp/tools/artifact.d.ts.map +1 -0
  80. package/dist/mcp/tools/artifact.js +36 -0
  81. package/dist/mcp/tools/artifact.js.map +1 -0
  82. package/dist/mcp/tools/history.d.ts +3 -0
  83. package/dist/mcp/tools/history.d.ts.map +1 -0
  84. package/dist/mcp/tools/history.js +29 -0
  85. package/dist/mcp/tools/history.js.map +1 -0
  86. package/dist/mcp/tools/lsp.d.ts +13 -0
  87. package/dist/mcp/tools/lsp.d.ts.map +1 -0
  88. package/dist/mcp/tools/lsp.js +225 -0
  89. package/dist/mcp/tools/lsp.js.map +1 -0
  90. package/dist/mcp/tools/plan.d.ts +3 -0
  91. package/dist/mcp/tools/plan.d.ts.map +1 -0
  92. package/dist/mcp/tools/plan.js +317 -0
  93. package/dist/mcp/tools/plan.js.map +1 -0
  94. package/dist/mcp/tools/task.d.ts +3 -0
  95. package/dist/mcp/tools/task.d.ts.map +1 -0
  96. package/dist/mcp/tools/task.js +252 -0
  97. package/dist/mcp/tools/task.js.map +1 -0
  98. package/dist/shared/invocations.d.ts +74 -0
  99. package/dist/shared/invocations.d.ts.map +1 -0
  100. package/dist/shared/invocations.js +247 -0
  101. package/dist/shared/invocations.js.map +1 -0
  102. package/dist/shared/json-store.d.ts +37 -0
  103. package/dist/shared/json-store.d.ts.map +1 -0
  104. package/dist/shared/json-store.js +163 -0
  105. package/dist/shared/json-store.js.map +1 -0
  106. package/dist/shared/mcp-utils.d.ts +3 -0
  107. package/dist/shared/mcp-utils.d.ts.map +1 -0
  108. package/dist/shared/mcp-utils.js +6 -0
  109. package/dist/shared/mcp-utils.js.map +1 -0
  110. package/dist/shared/paths.d.ts +21 -0
  111. package/dist/shared/paths.d.ts.map +1 -0
  112. package/dist/shared/paths.js +81 -0
  113. package/dist/shared/paths.js.map +1 -0
  114. package/dist/shared/tool-log.d.ts +8 -0
  115. package/dist/shared/tool-log.d.ts.map +1 -0
  116. package/dist/shared/tool-log.js +22 -0
  117. package/dist/shared/tool-log.js.map +1 -0
  118. package/dist/types/state.d.ts +862 -0
  119. package/dist/types/state.d.ts.map +1 -0
  120. package/dist/types/state.js +66 -0
  121. package/dist/types/state.js.map +1 -0
  122. package/docs/consuming/codex-lead-merge.md +106 -0
  123. package/docs/plugin-guide.md +360 -0
  124. package/docs/plugin-template/claude/.github/workflows/build.yml +60 -0
  125. package/docs/plugin-template/claude/README.md +110 -0
  126. package/docs/plugin-template/claude/package.json +16 -0
  127. package/docs/plugin-template/codex/.github/workflows/build.yml +51 -0
  128. package/docs/plugin-template/codex/README.md +147 -0
  129. package/docs/plugin-template/codex/package.json +17 -0
  130. package/docs/plugin-template/opencode/.github/workflows/build.yml +61 -0
  131. package/docs/plugin-template/opencode/README.md +121 -0
  132. package/docs/plugin-template/opencode/package.json +25 -0
  133. package/package.json +21 -21
  134. package/scripts/build-agents.test.ts +1279 -0
  135. package/scripts/build-agents.ts +978 -0
  136. package/scripts/build-hooks.test.ts +1385 -0
  137. package/scripts/build-hooks.ts +584 -0
  138. package/scripts/cli.test.ts +367 -0
  139. package/scripts/cli.ts +547 -0
  140. package/agents/architect/meta.yml +0 -13
  141. package/agents/designer/meta.yml +0 -13
  142. package/agents/engineer/meta.yml +0 -11
  143. package/agents/postdoc/meta.yml +0 -13
  144. package/agents/researcher/meta.yml +0 -12
  145. package/agents/reviewer/meta.yml +0 -12
  146. package/agents/strategist/meta.yml +0 -13
  147. package/agents/tester/meta.yml +0 -12
  148. package/agents/writer/meta.yml +0 -11
  149. package/conformance/README.md +0 -311
  150. package/conformance/examples/plan.extension.schema.example.json +0 -25
  151. package/conformance/lifecycle/README.md +0 -48
  152. package/conformance/lifecycle/agent-complete.json +0 -44
  153. package/conformance/lifecycle/agent-resume.json +0 -43
  154. package/conformance/lifecycle/agent-spawn.json +0 -36
  155. package/conformance/lifecycle/memory-access-record.json +0 -27
  156. package/conformance/lifecycle/session-end.json +0 -48
  157. package/conformance/scenarios/full-plan-cycle.json +0 -147
  158. package/conformance/scenarios/task-deps-ordering.json +0 -95
  159. package/conformance/schema/fixture.schema.json +0 -354
  160. package/conformance/state-schemas/agent-tracker.schema.json +0 -63
  161. package/conformance/state-schemas/history.schema.json +0 -134
  162. package/conformance/state-schemas/memory-access.schema.json +0 -36
  163. package/conformance/state-schemas/plan.schema.json +0 -77
  164. package/conformance/state-schemas/tasks.schema.json +0 -98
  165. package/conformance/tools/artifact-write.json +0 -97
  166. package/conformance/tools/context.json +0 -172
  167. package/conformance/tools/history-search.json +0 -219
  168. package/conformance/tools/plan-decide.json +0 -139
  169. package/conformance/tools/plan-start.json +0 -81
  170. package/conformance/tools/plan-status.json +0 -127
  171. package/conformance/tools/plan-update.json +0 -341
  172. package/conformance/tools/task-add.json +0 -156
  173. package/conformance/tools/task-close.json +0 -161
  174. package/conformance/tools/task-list.json +0 -177
  175. package/conformance/tools/task-update.json +0 -167
  176. package/docs/behavioral-contracts.md +0 -145
  177. package/docs/consumer-implementation-guide.md +0 -840
  178. package/docs/memory-lifecycle-contract.md +0 -119
  179. package/docs/nexus-layout.md +0 -224
  180. package/docs/nexus-outputs-contract.md +0 -344
  181. package/docs/nexus-state-overview.md +0 -170
  182. package/docs/nexus-tools-contract.md +0 -438
  183. package/manifest.json +0 -448
  184. package/schema/README.md +0 -69
  185. package/schema/agent.schema.json +0 -23
  186. package/schema/common.schema.json +0 -17
  187. package/schema/manifest.schema.json +0 -78
  188. package/schema/memory-policy.schema.json +0 -98
  189. package/schema/skill.schema.json +0 -54
  190. package/schema/task-exceptions.schema.json +0 -40
  191. package/schema/vocabulary.schema.json +0 -167
  192. package/scripts/.gitkeep +0 -0
  193. package/scripts/conformance-coverage.ts +0 -466
  194. package/scripts/import-from-claude-nexus.ts +0 -403
  195. package/scripts/lib/frontmatter.ts +0 -71
  196. package/scripts/lib/lint.ts +0 -348
  197. package/scripts/lib/structure.ts +0 -159
  198. package/scripts/lib/validate.ts +0 -796
  199. package/scripts/validate.ts +0 -90
  200. package/skills/nx-init/meta.yml +0 -8
  201. package/skills/nx-plan/meta.yml +0 -10
  202. package/skills/nx-run/meta.yml +0 -8
  203. package/skills/nx-sync/meta.yml +0 -7
  204. package/vocabulary/capabilities.yml +0 -65
  205. package/vocabulary/categories.yml +0 -11
  206. package/vocabulary/invocations.yml +0 -147
  207. package/vocabulary/memory_policy.yml +0 -88
  208. package/vocabulary/resume-tiers.yml +0 -11
  209. package/vocabulary/tags.yml +0 -60
  210. package/vocabulary/task-exceptions.yml +0 -29
@@ -1,147 +0,0 @@
1
- {
2
- "test_id": "full_plan_cycle",
3
- "description": "Verifies the complete plan → decide → task_add → close lifecycle across 5 sequential tool invocations",
4
- "covers": {
5
- "state_schemas": {
6
- "plan.schema.json": ["id", "topic", "issues[].id", "issues[].title", "issues[].status", "issues[].decision", "research_summary", "created_at"],
7
- "tasks.schema.json": ["goal", "decisions", "tasks[].id", "tasks[].title", "tasks[].status", "tasks[].plan_issue"],
8
- "history.schema.json": ["cycles[].completed_at", "cycles[].plan", "cycles[].plan.issues[].status", "cycles[].tasks[].id"]
9
- },
10
- "return_value": {
11
- "plan_start": ["created", "plan_id", "issueCount"],
12
- "plan_decide": ["decided", "allComplete", "remaining"],
13
- "task_add": ["task.id", "task.status", "task.plan_issue"],
14
- "task_close": ["closed", "archived.plan", "archived.decisions", "archived.tasks", "total_cycles"]
15
- },
16
- "description": "End-to-end lifecycle scenario: plan/task/history state transitions and each tool's return value across 5 sequential invocations."
17
- },
18
- "uncovered_params": ["research_summary", "issue_id", "decision", "title", "context", "deps"],
19
- "precondition": {
20
- "state_files": {
21
- ".nexus/state/plan.json": null,
22
- ".nexus/state/tasks.json": null
23
- }
24
- },
25
- "steps": [
26
- {
27
- "description": "Start a new plan with 2 issues",
28
- "action": {
29
- "tool": "plan_start",
30
- "params": {
31
- "topic": "Refactor state persistence layer",
32
- "issues": [
33
- "Should state files live in .nexus/state/ or project root?",
34
- "What is the migration path for existing users?"
35
- ],
36
- "research_summary": "Surveyed 3 consumer repos. All use .nexus/state/ already. Migration: provide a one-shot relocate script."
37
- }
38
- },
39
- "assert_return": {
40
- "$.created": true,
41
- "$.plan_id": { "type": "number", "min": 1 },
42
- "$.issueCount": 2
43
- },
44
- "assert_state": {
45
- ".nexus/state/plan.json": {
46
- "$.topic": "Refactor state persistence layer",
47
- "$.issues.length": 2,
48
- "$.issues[0].status": "pending",
49
- "$.issues[1].status": "pending"
50
- }
51
- }
52
- },
53
- {
54
- "description": "Decide issue 1 — confirm .nexus/state/ location",
55
- "action": {
56
- "tool": "plan_decide",
57
- "params": {
58
- "issue_id": 1,
59
- "decision": "Keep .nexus/state/ as the canonical location. Documented in state-schemas README."
60
- }
61
- },
62
- "assert_return": {
63
- "$.decided": true,
64
- "$.allComplete": false,
65
- "$.remaining.length": 1
66
- },
67
- "assert_state": {
68
- ".nexus/state/plan.json": {
69
- "$.issues[0].status": "decided",
70
- "$.issues[0].decision": "Keep .nexus/state/ as the canonical location. Documented in state-schemas README.",
71
- "$.issues[1].status": "pending"
72
- }
73
- }
74
- },
75
- {
76
- "description": "Decide issue 2 — confirm migration path; all issues now decided",
77
- "action": {
78
- "tool": "plan_decide",
79
- "params": {
80
- "issue_id": 2,
81
- "decision": "Ship a one-shot migration script as a standalone npm script. Document in RELEASING.md."
82
- }
83
- },
84
- "assert_return": {
85
- "$.decided": true,
86
- "$.allComplete": true
87
- },
88
- "assert_state": {
89
- ".nexus/state/plan.json": {
90
- "$.issues[0].status": "decided",
91
- "$.issues[1].status": "decided"
92
- }
93
- }
94
- },
95
- {
96
- "description": "Add a task derived from plan issue 1",
97
- "action": {
98
- "tool": "task_add",
99
- "params": {
100
- "title": "Update state-schemas README for .nexus/state/ location",
101
- "context": "Decision from plan: .nexus/state/ is the canonical location. Document this clearly.",
102
- "deps": [],
103
- "plan_issue": 1,
104
- "goal": "Land refactored state persistence layer with migration support"
105
- }
106
- },
107
- "assert_return": {
108
- "$.task.id": 1,
109
- "$.task.status": "pending",
110
- "$.task.plan_issue": 1
111
- },
112
- "assert_state": {
113
- ".nexus/state/tasks.json": {
114
- "$.goal": "Land refactored state persistence layer with migration support",
115
- "$.tasks.length": 1,
116
- "$.tasks[0].id": 1,
117
- "$.tasks[0].plan_issue": 1
118
- }
119
- }
120
- },
121
- {
122
- "description": "Close the cycle — archive plan and tasks into history, delete source files",
123
- "action": {
124
- "tool": "task_close",
125
- "params": {}
126
- },
127
- "assert_return": {
128
- "$.closed": true,
129
- "$.archived.plan": true,
130
- "$.archived.decisions": 2,
131
- "$.archived.tasks": 1,
132
- "$.total_cycles": { "type": "number", "min": 1 }
133
- },
134
- "assert_state": {
135
- ".nexus/state/plan.json": null,
136
- ".nexus/state/tasks.json": null,
137
- ".nexus/history.json": {
138
- "$.cycles.length": { "type": "number", "min": 1 },
139
- "$.cycles[-1].plan.topic": "Refactor state persistence layer",
140
- "$.cycles[-1].plan.issues.length": 2,
141
- "$.cycles[-1].tasks.length": 1,
142
- "$.cycles[-1].completed_at": { "type": "iso8601" }
143
- }
144
- }
145
- }
146
- ]
147
- }
@@ -1,95 +0,0 @@
1
- {
2
- "test_id": "task_deps_ordering",
3
- "description": "Verifies that dependency ordering is enforced by task_list: a task with an incomplete dep is not ready, and becomes ready after the dep is completed",
4
- "covers": {
5
- "state_schemas": {
6
- "tasks.schema.json": ["goal", "tasks[].id", "tasks[].title", "tasks[].status", "tasks[].deps"]
7
- },
8
- "return_value": {
9
- "task_add": ["task.id", "task.status", "task.deps"],
10
- "task_list": ["summary.total", "summary.ready", "summary.completed"],
11
- "task_update": ["task.id", "task.status"]
12
- },
13
- "description": "Dependency-aware ready set computation: validates that task_list correctly unblocks dependents after prerequisites complete."
14
- },
15
- "uncovered_params": ["title", "context", "goal"],
16
- "precondition": {
17
- "state_files": {
18
- ".nexus/state/tasks.json": null
19
- }
20
- },
21
- "steps": [
22
- {
23
- "description": "Add task A with no dependencies",
24
- "action": {
25
- "tool": "task_add",
26
- "params": {
27
- "title": "Task A — foundation work",
28
- "context": "Must complete before Task B can start",
29
- "deps": [],
30
- "goal": "Validate dependency ordering"
31
- }
32
- },
33
- "assert_return": {
34
- "$.task.id": 1,
35
- "$.task.status": "pending",
36
- "$.task.deps.length": 0
37
- }
38
- },
39
- {
40
- "description": "Add task B that depends on task A (id=1)",
41
- "action": {
42
- "tool": "task_add",
43
- "params": {
44
- "title": "Task B — requires A",
45
- "context": "Can only start after Task A is completed",
46
- "deps": [1]
47
- }
48
- },
49
- "assert_return": {
50
- "$.task.id": 2,
51
- "$.task.status": "pending",
52
- "$.task.deps.length": 1,
53
- "$.task.deps[0]": 1
54
- }
55
- },
56
- {
57
- "description": "List tasks — only task A should be ready because task B's dep is not complete",
58
- "action": {
59
- "tool": "task_list",
60
- "params": {}
61
- },
62
- "assert_return": {
63
- "$.summary.total": 2,
64
- "$.summary.ready.length": 1,
65
- "$.summary.ready[0]": 1
66
- }
67
- },
68
- {
69
- "description": "Mark task A as completed",
70
- "action": {
71
- "tool": "task_update",
72
- "params": {
73
- "id": 1,
74
- "status": "completed"
75
- }
76
- },
77
- "assert_return": {
78
- "$.task.id": 1,
79
- "$.task.status": "completed"
80
- }
81
- },
82
- {
83
- "description": "List tasks again — task B should now be ready because its dep (A) is completed",
84
- "action": {
85
- "tool": "task_list",
86
- "params": {}
87
- },
88
- "assert_return": {
89
- "$.summary.ready.length": 1,
90
- "$.summary.ready[0]": 2,
91
- "$.summary.completed": 1
92
- }
93
- }
94
- ]
95
- }
@@ -1,354 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "fixture.schema.json",
4
- "title": "Nexus Conformance Test Fixture",
5
- "description": "Declarative test case for Nexus MCP tool behavioral verification. Each fixture must declare exactly one of: action (single tool invocation), event (single lifecycle event), or steps (multi-step sequence).",
6
- "type": "object",
7
- "additionalProperties": false,
8
- "required": ["test_id", "description", "covers"],
9
- "oneOf": [
10
- {
11
- "required": ["action"],
12
- "properties": {
13
- "action": true,
14
- "event": false,
15
- "steps": false
16
- }
17
- },
18
- {
19
- "required": ["event"],
20
- "properties": {
21
- "action": false,
22
- "event": true,
23
- "steps": false
24
- }
25
- },
26
- {
27
- "required": ["steps"],
28
- "properties": {
29
- "action": false,
30
- "event": false,
31
- "steps": true
32
- }
33
- }
34
- ],
35
- "properties": {
36
- "test_id": {
37
- "type": "string",
38
- "pattern": "^[a-z][a-z0-9_-]*$",
39
- "description": "Unique identifier for this fixture, used for reporting"
40
- },
41
- "description": {
42
- "type": "string",
43
- "minLength": 10,
44
- "description": "Human-readable description of what behavior this fixture verifies"
45
- },
46
- "covers": {
47
- "type": "object",
48
- "description": "Declaration of which schema fields and return value paths this fixture verifies. At least one of state_schemas or return_value must be non-empty.",
49
- "additionalProperties": false,
50
- "anyOf": [
51
- {
52
- "properties": {
53
- "state_schemas": {
54
- "minProperties": 1
55
- }
56
- },
57
- "required": ["state_schemas"]
58
- },
59
- {
60
- "properties": {
61
- "return_value": {
62
- "minProperties": 1
63
- }
64
- },
65
- "required": ["return_value"]
66
- }
67
- ],
68
- "properties": {
69
- "state_schemas": {
70
- "type": "object",
71
- "description": "Map of state-schema filename (e.g. 'plan.schema.json') to array of field paths verified by this fixture's postcondition. Field paths use dot-notation with array index notation (e.g. 'issues[].status').",
72
- "additionalProperties": {
73
- "type": "array",
74
- "items": {
75
- "type": "string",
76
- "pattern": "^[^ ]+$",
77
- "description": "Field path within the named schema (e.g. 'id', 'issues[].status', 'issues[].how_agents')"
78
- }
79
- }
80
- },
81
- "return_value": {
82
- "type": "object",
83
- "description": "Map of abstract tool name (e.g. 'plan_start') to array of return-value field paths verified by this fixture's postcondition.",
84
- "additionalProperties": {
85
- "type": "array",
86
- "items": {
87
- "type": "string",
88
- "pattern": "^[^ ]+$",
89
- "description": "Field path within the tool's return value (e.g. 'created', 'plan_id', 'issueCount')"
90
- }
91
- }
92
- },
93
- "description": {
94
- "type": "string",
95
- "description": "Optional human-readable explanation of coverage rationale or known gaps"
96
- }
97
- }
98
- },
99
- "uncovered_params": {
100
- "type": "array",
101
- "description": "Params intentionally excluded from postcondition verification. Validators treat entries here as explicit exceptions rather than coverage gaps, preventing false anti-pattern warnings.",
102
- "items": {
103
- "type": "string",
104
- "pattern": "^[^ ]+$",
105
- "description": "Parameter name from the action or event params that is deliberately not verified"
106
- }
107
- },
108
- "precondition": {
109
- "type": "object",
110
- "description": "State that must be established before the action or steps are executed",
111
- "additionalProperties": false,
112
- "properties": {
113
- "state_files": {
114
- "type": "object",
115
- "description": "Map of file path to content object. File path keys may contain placeholder tokens that a conformance runner must expand before resolving paths. Allowed tokens: {STATE_ROOT} (the root directory for all harness state, e.g. '.nexus/state') and {HARNESS_ID} (the harness identifier, resolved from event.params.harness_id or equivalent context). No other arbitrary tokens are permitted. Example key: '{STATE_ROOT}/{HARNESS_ID}/agent-tracker.json'. null value = file must not exist; empty object {} = file must exist but content is not inspected (use for non-JSON artifacts like .md, .txt, binary files); non-empty object = precondition content written as-is (typically JSON).",
116
- "additionalProperties": {
117
- "oneOf": [
118
- { "type": "object" },
119
- { "type": "null" }
120
- ]
121
- }
122
- }
123
- }
124
- },
125
- "action": {
126
- "$ref": "#/$defs/action",
127
- "description": "Single tool invocation — use for single-action fixtures; mutually exclusive with event and steps"
128
- },
129
- "event": {
130
- "$ref": "#/$defs/event",
131
- "description": "Single lifecycle event — use for event-based fixtures that require no tool call; mutually exclusive with action and steps"
132
- },
133
- "steps": {
134
- "type": "array",
135
- "description": "Ordered sequence of tool invocations or lifecycle events with per-step assertions — use for multi-step scenarios; mutually exclusive with action and event",
136
- "minItems": 1,
137
- "items": { "$ref": "#/$defs/step" }
138
- },
139
- "postcondition": {
140
- "$ref": "#/$defs/postcondition",
141
- "description": "Assertions evaluated after the action (or all steps) complete"
142
- }
143
- },
144
- "$defs": {
145
- "action": {
146
- "type": "object",
147
- "description": "A single tool invocation",
148
- "additionalProperties": false,
149
- "required": ["tool", "params"],
150
- "properties": {
151
- "tool": {
152
- "type": "string",
153
- "description": "Abstract tool name (e.g. plan_start, task_add). Must not include harness-specific prefixes."
154
- },
155
- "params": {
156
- "type": "object",
157
- "description": "Input parameters passed verbatim to the tool"
158
- }
159
- }
160
- },
161
- "event": {
162
- "type": "object",
163
- "description": "A lifecycle event that triggers harness-level behavior without a direct tool call. Used for verifying agent-tracker.json state changes.",
164
- "additionalProperties": false,
165
- "required": ["type"],
166
- "properties": {
167
- "type": {
168
- "type": "string",
169
- "enum": ["agent_spawn", "agent_complete", "agent_resume", "session_end"],
170
- "description": "Lifecycle event type. agent_spawn/agent_complete/agent_resume: agent instance lifecycle. session_end: session teardown — agent-tracker.json deleted, history/memory/context/rules preserved."
171
- },
172
- "params": {
173
- "type": "object",
174
- "description": "Optional event-specific parameters (e.g. harness_id, agent_name, and agent_id for agent_spawn)",
175
- "additionalProperties": true
176
- },
177
- "description": {
178
- "type": "string",
179
- "description": "Optional human-readable explanation of the event and its expected effect"
180
- }
181
- }
182
- },
183
- "postcondition": {
184
- "type": "object",
185
- "description": "Assertions on the state and return value after the action completes",
186
- "additionalProperties": false,
187
- "properties": {
188
- "state_files": {
189
- "type": "object",
190
- "description": "Map of file path to assertion object. File path keys may contain placeholder tokens that a conformance runner must expand before resolving paths. Allowed tokens: {STATE_ROOT} and {HARNESS_ID} only — no other arbitrary tokens are permitted. See precondition.state_files for token semantics. null = file must not exist after the action; empty object {} = file must exist but content is not inspected (use for non-JSON artifacts like .md, .txt, binary files); non-empty object = JSONPath assertions on parsed JSON content.",
191
- "additionalProperties": {
192
- "oneOf": [
193
- {
194
- "type": "object",
195
- "description": "JSONPath assertions on the file content. Keys are JSONPath expressions, values are expected values or matcher objects.",
196
- "additionalProperties": {
197
- "oneOf": [
198
- { "type": "string" },
199
- { "type": "number" },
200
- { "type": "boolean" },
201
- { "type": "null" },
202
- {
203
- "type": "object",
204
- "description": "Matcher object for type checks and range assertions",
205
- "required": ["type"],
206
- "properties": {
207
- "type": {
208
- "type": "string",
209
- "enum": ["iso8601", "string", "number", "boolean"],
210
- "description": "Expected value type"
211
- },
212
- "min": {
213
- "type": "number",
214
- "description": "Minimum numeric value (for type: number)"
215
- },
216
- "max": {
217
- "type": "number",
218
- "description": "Maximum numeric value (for type: number)"
219
- },
220
- "minLength": {
221
- "type": "number",
222
- "description": "Minimum string length (for type: string)"
223
- },
224
- "pattern": {
225
- "type": "string",
226
- "description": "Regex pattern the value must match (for type: string)"
227
- }
228
- }
229
- }
230
- ]
231
- }
232
- },
233
- { "type": "null" }
234
- ]
235
- }
236
- },
237
- "return_value": {
238
- "type": "object",
239
- "description": "JSONPath assertions on the tool return value. Same assertion syntax as state_files entries.",
240
- "additionalProperties": {
241
- "oneOf": [
242
- { "type": "string" },
243
- { "type": "number" },
244
- { "type": "boolean" },
245
- { "type": "null" },
246
- {
247
- "type": "object",
248
- "required": ["type"],
249
- "properties": {
250
- "type": { "type": "string", "enum": ["iso8601", "string", "number", "boolean"] },
251
- "min": { "type": "number" },
252
- "max": { "type": "number" },
253
- "minLength": { "type": "number" },
254
- "pattern": { "type": "string" }
255
- }
256
- }
257
- ]
258
- }
259
- },
260
- "error": {
261
- "type": "boolean",
262
- "description": "If true, the action must produce an error response"
263
- },
264
- "error_contains": {
265
- "type": "string",
266
- "description": "The error message must contain this substring (implies error: true)"
267
- }
268
- }
269
- },
270
- "step": {
271
- "type": "object",
272
- "description": "One step in a multi-step scenario. Each step must contain exactly one of: action (tool invocation) or event (lifecycle event).",
273
- "additionalProperties": false,
274
- "oneOf": [
275
- {
276
- "required": ["action"],
277
- "properties": {
278
- "action": true,
279
- "event": false
280
- }
281
- },
282
- {
283
- "required": ["event"],
284
- "properties": {
285
- "action": false,
286
- "event": true
287
- }
288
- }
289
- ],
290
- "properties": {
291
- "description": {
292
- "type": "string",
293
- "description": "Optional human-readable label for this step"
294
- },
295
- "action": { "$ref": "#/$defs/action" },
296
- "event": { "$ref": "#/$defs/event" },
297
- "assert_return": {
298
- "type": "object",
299
- "description": "JSONPath assertions on the return value of this step's action",
300
- "additionalProperties": {
301
- "oneOf": [
302
- { "type": "string" },
303
- { "type": "number" },
304
- { "type": "boolean" },
305
- { "type": "null" },
306
- {
307
- "type": "object",
308
- "required": ["type"],
309
- "properties": {
310
- "type": { "type": "string", "enum": ["iso8601", "string", "number", "boolean"] },
311
- "min": { "type": "number" },
312
- "max": { "type": "number" },
313
- "minLength": { "type": "number" },
314
- "pattern": { "type": "string" }
315
- }
316
- }
317
- ]
318
- }
319
- },
320
- "assert_state": {
321
- "type": "object",
322
- "description": "Map of file path to assertions on state files after this step completes. null means file must not exist.",
323
- "additionalProperties": {
324
- "oneOf": [
325
- {
326
- "type": "object",
327
- "additionalProperties": {
328
- "oneOf": [
329
- { "type": "string" },
330
- { "type": "number" },
331
- { "type": "boolean" },
332
- { "type": "null" },
333
- {
334
- "type": "object",
335
- "required": ["type"],
336
- "properties": {
337
- "type": { "type": "string", "enum": ["iso8601", "string", "number", "boolean"] },
338
- "min": { "type": "number" },
339
- "max": { "type": "number" },
340
- "minLength": { "type": "number" },
341
- "pattern": { "type": "string" }
342
- }
343
- }
344
- ]
345
- }
346
- },
347
- { "type": "null" }
348
- ]
349
- }
350
- }
351
- }
352
- }
353
- }
354
- }
@@ -1,63 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "conformance/state-schemas/agent-tracker.schema.json",
4
- "title": "Nexus Agent Tracker",
5
- "description": "Schema for .nexus/state/agent-tracker.json — registry of spawned agent instances tracked across a session. No schema_version field: this file is session-scoped and deleted on session end — migration anchor not required.",
6
- "type": "array",
7
- "items": {
8
- "type": "object",
9
- "additionalProperties": false,
10
- "required": ["harness_id", "started_at"],
11
- "properties": {
12
- "harness_id": {
13
- "type": "string",
14
- "pattern": "^[a-z][a-z0-9-]*$",
15
- "description": "Identifier of the harness that spawned this agent."
16
- },
17
- "agent_name": {
18
- "type": "string",
19
- "pattern": "^[a-z][a-z0-9-]*$",
20
- "description": "Neutral agent id as defined in nexus-core agents/{id}/meta.yml (e.g. 'architect', 'engineer')."
21
- },
22
- "agent_id": {
23
- "type": "string",
24
- "minLength": 1,
25
- "description": "Harness-specific opaque agent instance identifier. Format is defined by the writing harness (UUID, composite string, etc.). Consumers MUST treat the value as opaque — do not parse or infer agent identity across harness namespaces."
26
- },
27
- "started_at": {
28
- "type": "string",
29
- "format": "date-time",
30
- "description": "ISO 8601 timestamp when this agent instance was first started"
31
- },
32
- "last_resumed_at": {
33
- "type": "string",
34
- "format": "date-time",
35
- "description": "ISO 8601 timestamp of the most recent resume, if the agent has been resumed"
36
- },
37
- "resume_count": {
38
- "type": "number",
39
- "minimum": 0,
40
- "description": "Number of times this agent instance has been resumed"
41
- },
42
- "status": {
43
- "type": "string",
44
- "enum": ["running", "completed"],
45
- "description": "Current lifecycle status of the agent instance"
46
- },
47
- "stopped_at": {
48
- "type": "string",
49
- "format": "date-time",
50
- "description": "ISO 8601 timestamp when the agent completed or was stopped"
51
- },
52
- "last_message": {
53
- "type": "string",
54
- "description": "Last recorded output or status message from the agent"
55
- },
56
- "files_touched": {
57
- "type": "array",
58
- "items": { "type": "string" },
59
- "description": "Paths of files created or modified by this agent instance"
60
- }
61
- }
62
- }
63
- }