@rryando/arcs 3.1.2 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +65 -40
  2. package/dist/cli/arcs-orchestrate.d.ts +1 -1
  3. package/dist/cli/arcs-orchestrate.d.ts.map +1 -1
  4. package/dist/cli/arcs-orchestrate.js +8 -4
  5. package/dist/cli/arcs-orchestrate.js.map +1 -1
  6. package/dist/cli/arg-parser.d.ts +3 -3
  7. package/dist/cli/arg-parser.d.ts.map +1 -1
  8. package/dist/cli/arg-parser.js +1 -1
  9. package/dist/cli/arg-parser.js.map +1 -1
  10. package/dist/cli/bundle-installer.d.ts +11 -0
  11. package/dist/cli/bundle-installer.d.ts.map +1 -1
  12. package/dist/cli/bundle-installer.js +14 -4
  13. package/dist/cli/bundle-installer.js.map +1 -1
  14. package/dist/cli/command-registry.d.ts +61 -6
  15. package/dist/cli/command-registry.d.ts.map +1 -1
  16. package/dist/cli/command-registry.js.map +1 -1
  17. package/dist/cli/commands/batch.js +17 -16
  18. package/dist/cli/commands/batch.js.map +1 -1
  19. package/dist/cli/commands/brief.js +71 -74
  20. package/dist/cli/commands/brief.js.map +1 -1
  21. package/dist/cli/commands/bundle.js +79 -31
  22. package/dist/cli/commands/bundle.js.map +1 -1
  23. package/dist/cli/commands/dependency.js +47 -43
  24. package/dist/cli/commands/dependency.js.map +1 -1
  25. package/dist/cli/commands/diagnostics.js +1 -1
  26. package/dist/cli/commands/diagnostics.js.map +1 -1
  27. package/dist/cli/commands/diagram.js +96 -58
  28. package/dist/cli/commands/diagram.js.map +1 -1
  29. package/dist/cli/commands/done.js +19 -18
  30. package/dist/cli/commands/done.js.map +1 -1
  31. package/dist/cli/commands/graph.js +12 -10
  32. package/dist/cli/commands/graph.js.map +1 -1
  33. package/dist/cli/commands/index.d.ts +1 -0
  34. package/dist/cli/commands/index.d.ts.map +1 -1
  35. package/dist/cli/commands/index.js +1 -0
  36. package/dist/cli/commands/index.js.map +1 -1
  37. package/dist/cli/commands/knowledge-search.js +11 -12
  38. package/dist/cli/commands/knowledge-search.js.map +1 -1
  39. package/dist/cli/commands/knowledge.js +63 -56
  40. package/dist/cli/commands/knowledge.js.map +1 -1
  41. package/dist/cli/commands/loop.js +40 -36
  42. package/dist/cli/commands/loop.js.map +1 -1
  43. package/dist/cli/commands/maintenance.js +30 -19
  44. package/dist/cli/commands/maintenance.js.map +1 -1
  45. package/dist/cli/commands/next.js +9 -8
  46. package/dist/cli/commands/next.js.map +1 -1
  47. package/dist/cli/commands/plan.js +61 -55
  48. package/dist/cli/commands/plan.js.map +1 -1
  49. package/dist/cli/commands/project-updates.js +37 -33
  50. package/dist/cli/commands/project-updates.js.map +1 -1
  51. package/dist/cli/commands/project.js +33 -23
  52. package/dist/cli/commands/project.js.map +1 -1
  53. package/dist/cli/commands/proposal.d.ts +2 -0
  54. package/dist/cli/commands/proposal.d.ts.map +1 -0
  55. package/dist/cli/commands/proposal.js +509 -0
  56. package/dist/cli/commands/proposal.js.map +1 -0
  57. package/dist/cli/commands/remember.js +6 -6
  58. package/dist/cli/commands/remember.js.map +1 -1
  59. package/dist/cli/commands/status.js +9 -8
  60. package/dist/cli/commands/status.js.map +1 -1
  61. package/dist/cli/commands/task.d.ts +1 -5
  62. package/dist/cli/commands/task.d.ts.map +1 -1
  63. package/dist/cli/commands/task.js +261 -248
  64. package/dist/cli/commands/task.js.map +1 -1
  65. package/dist/cli/commands/utility.d.ts.map +1 -1
  66. package/dist/cli/commands/utility.js +39 -35
  67. package/dist/cli/commands/utility.js.map +1 -1
  68. package/dist/cli/dag-commands.js.map +1 -1
  69. package/dist/cli/help-generator.d.ts +3 -3
  70. package/dist/cli/help-generator.d.ts.map +1 -1
  71. package/dist/cli/help-generator.js +1 -1
  72. package/dist/cli/help-generator.js.map +1 -1
  73. package/dist/cli/md-renderer.d.ts.map +1 -1
  74. package/dist/cli/md-renderer.js +45 -11
  75. package/dist/cli/md-renderer.js.map +1 -1
  76. package/dist/cli/setup.d.ts.map +1 -1
  77. package/dist/cli/setup.js +235 -113
  78. package/dist/cli/setup.js.map +1 -1
  79. package/dist/utils/diagram-generator.d.ts.map +1 -1
  80. package/dist/utils/diagram-generator.js +8 -1
  81. package/dist/utils/diagram-generator.js.map +1 -1
  82. package/dist/utils/diagram-store.d.ts +45 -0
  83. package/dist/utils/diagram-store.d.ts.map +1 -0
  84. package/dist/utils/diagram-store.js +99 -0
  85. package/dist/utils/diagram-store.js.map +1 -0
  86. package/dist/utils/errors.d.ts.map +1 -1
  87. package/dist/utils/errors.js.map +1 -1
  88. package/dist/utils/graphify-knowledge.d.ts +19 -3
  89. package/dist/utils/graphify-knowledge.d.ts.map +1 -1
  90. package/dist/utils/graphify-knowledge.js +45 -58
  91. package/dist/utils/graphify-knowledge.js.map +1 -1
  92. package/dist/utils/graphify.d.ts +58 -3
  93. package/dist/utils/graphify.d.ts.map +1 -1
  94. package/dist/utils/graphify.js +175 -42
  95. package/dist/utils/graphify.js.map +1 -1
  96. package/dist/utils/json-schemas.d.ts +153 -0
  97. package/dist/utils/json-schemas.d.ts.map +1 -1
  98. package/dist/utils/json-schemas.js +23 -0
  99. package/dist/utils/json-schemas.js.map +1 -1
  100. package/dist/utils/proposal-store.d.ts +64 -0
  101. package/dist/utils/proposal-store.d.ts.map +1 -0
  102. package/dist/utils/proposal-store.js +161 -0
  103. package/dist/utils/proposal-store.js.map +1 -0
  104. package/dist/utils/storage-utils.d.ts +1 -1
  105. package/dist/utils/storage-utils.d.ts.map +1 -1
  106. package/dist/utils/storage-utils.js +1 -1
  107. package/dist/utils/storage-utils.js.map +1 -1
  108. package/dist/utils/task-store.d.ts +20 -0
  109. package/dist/utils/task-store.d.ts.map +1 -1
  110. package/dist/utils/task-store.js +42 -5
  111. package/dist/utils/task-store.js.map +1 -1
  112. package/dist/utils/toposort.d.ts +1 -1
  113. package/dist/utils/toposort.d.ts.map +1 -1
  114. package/dist/utils/toposort.js +5 -4
  115. package/dist/utils/toposort.js.map +1 -1
  116. package/dist/utils/workflow-policy.d.ts +1 -1
  117. package/dist/utils/workflow-policy.d.ts.map +1 -1
  118. package/dist/utils/workflow-policy.js +1 -1
  119. package/dist/utils/workflow-policy.js.map +1 -1
  120. package/opencode/arcs/bundle-runtime.json +3 -0
  121. package/opencode/arcs/manifest.json +47 -66
  122. package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +8 -4
  123. package/opencode/arcs/prompts/arcs-orchestrate.txt +8 -4
  124. package/opencode/arcs/skills/enriching-graphify-proposals/SKILL.md +170 -0
  125. package/opencode/arcs/skills/init-project/SKILL.md +18 -11
  126. package/opencode/arcs/skills/to-diagram/SKILL.md +1 -1
  127. package/package.json +1 -1
  128. package/scripts/deploy-claudecode-bundle.mjs +414 -0
@@ -44,11 +44,19 @@
44
44
  }
45
45
  }
46
46
  },
47
+ {
48
+ "path": [
49
+ "lsp"
50
+ ],
51
+ "value": true,
52
+ "mode": "if-absent"
53
+ },
47
54
  {
48
55
  "path": [
49
56
  "model"
50
57
  ],
51
- "value": "github-copilot/claude-sonnet-4.6"
58
+ "value": "github-copilot/claude-sonnet-4.6",
59
+ "mode": "if-absent"
52
60
  },
53
61
  {
54
62
  "path": [
@@ -56,7 +64,8 @@
56
64
  "build",
57
65
  "model"
58
66
  ],
59
- "value": "github-copilot/claude-sonnet-4.6"
67
+ "value": "github-copilot/claude-sonnet-4.6",
68
+ "mode": "if-absent"
60
69
  },
61
70
  {
62
71
  "path": [
@@ -64,7 +73,8 @@
64
73
  "plan",
65
74
  "model"
66
75
  ],
67
- "value": "github-copilot/claude-opus-4.6"
76
+ "value": "github-copilot/claude-opus-4.6",
77
+ "mode": "if-absent"
68
78
  },
69
79
  {
70
80
  "path": [
@@ -72,7 +82,8 @@
72
82
  "general",
73
83
  "model"
74
84
  ],
75
- "value": "github-copilot/claude-opus-4.6"
85
+ "value": "github-copilot/claude-opus-4.6",
86
+ "mode": "if-absent"
76
87
  },
77
88
  {
78
89
  "path": [
@@ -80,7 +91,8 @@
80
91
  "explore",
81
92
  "model"
82
93
  ],
83
- "value": "github-copilot/claude-haiku-4.5"
94
+ "value": "github-copilot/claude-haiku-4.5",
95
+ "mode": "if-absent"
84
96
  },
85
97
  {
86
98
  "path": [
@@ -93,9 +105,11 @@
93
105
  "model": "github-copilot/claude-haiku-4.5",
94
106
  "prompt": "{file:./prompts/code-reviewer.txt}",
95
107
  "permission": {
96
- "edit": "deny",
108
+ "edit": "allow",
97
109
  "bash": "allow",
98
- "webfetch": "deny"
110
+ "webfetch": "allow",
111
+ "mcp": "allow",
112
+ "external_directory": { "*": "allow" }
99
113
  }
100
114
  }
101
115
  },
@@ -109,15 +123,11 @@
109
123
  "mode": "subagent",
110
124
  "model": "github-copilot/claude-opus-4.6",
111
125
  "permission": {
112
- "edit": "ask",
113
- "bash": "ask",
126
+ "edit": "allow",
127
+ "bash": "allow",
114
128
  "webfetch": "allow",
115
- "external_directory": {
116
- "/tmp": "allow",
117
- "/tmp/**": "allow",
118
- "~/.arcs": "allow",
119
- "~/.arcs/**": "allow"
120
- }
129
+ "mcp": "allow",
130
+ "external_directory": { "*": "allow" }
121
131
  },
122
132
  "prompt": "{file:./prompts/docs-researcher.txt}"
123
133
  }
@@ -132,13 +142,11 @@
132
142
  "mode": "subagent",
133
143
  "model": "github-copilot/claude-haiku-4.5",
134
144
  "permission": {
135
- "edit": "ask",
136
- "bash": "ask",
137
- "webfetch": "deny",
138
- "external_directory": {
139
- "~/.arcs": "allow",
140
- "~/.arcs/**": "allow"
141
- }
145
+ "edit": "allow",
146
+ "bash": "allow",
147
+ "webfetch": "allow",
148
+ "mcp": "allow",
149
+ "external_directory": { "*": "allow" }
142
150
  },
143
151
  "prompt": "{file:./prompts/tech-architect.txt}"
144
152
  }
@@ -155,14 +163,9 @@
155
163
  "permission": {
156
164
  "edit": "allow",
157
165
  "bash": "allow",
158
- "webfetch": "deny",
166
+ "webfetch": "allow",
159
167
  "mcp": "allow",
160
- "external_directory": {
161
- "/tmp": "allow",
162
- "/tmp/**": "allow",
163
- "~/.arcs": "allow",
164
- "~/.arcs/**": "allow"
165
- }
168
+ "external_directory": { "*": "allow" }
166
169
  },
167
170
  "prompt": "{file:./prompts/software-engineer.txt}"
168
171
  }
@@ -179,16 +182,9 @@
179
182
  "permission": {
180
183
  "edit": "allow",
181
184
  "bash": "allow",
182
- "webfetch": "deny",
185
+ "webfetch": "allow",
183
186
  "mcp": "allow",
184
- "external_directory": {
185
- "/tmp": "allow",
186
- "/tmp/**": "allow",
187
- "~/.arcs": "allow",
188
- "~/.arcs/**": "allow",
189
- "~/.config/opencode": "allow",
190
- "~/.config/opencode/**": "allow"
191
- }
187
+ "external_directory": { "*": "allow" }
192
188
  },
193
189
  "prompt": "{file:./prompts/arcs-docs.txt}"
194
190
  }
@@ -203,14 +199,11 @@
203
199
  "mode": "subagent",
204
200
  "model": "github-copilot/claude-haiku-4.5",
205
201
  "permission": {
206
- "edit": "deny",
202
+ "edit": "allow",
207
203
  "bash": "allow",
208
- "webfetch": "deny",
204
+ "webfetch": "allow",
209
205
  "mcp": "allow",
210
- "external_directory": {
211
- "~/.arcs": "allow",
212
- "~/.arcs/**": "allow"
213
- }
206
+ "external_directory": { "*": "allow" }
214
207
  },
215
208
  "prompt": "{file:./prompts/qa-analyst.txt}"
216
209
  }
@@ -225,16 +218,11 @@
225
218
  "mode": "subagent",
226
219
  "model": "github-copilot/claude-sonnet-4.6",
227
220
  "permission": {
228
- "edit": "deny",
221
+ "edit": "allow",
229
222
  "bash": "allow",
230
- "webfetch": "deny",
223
+ "webfetch": "allow",
231
224
  "mcp": "allow",
232
- "external_directory": {
233
- "/tmp": "allow",
234
- "/tmp/**": "allow",
235
- "~/.arcs": "allow",
236
- "~/.arcs/**": "allow"
237
- }
225
+ "external_directory": { "*": "allow" }
238
226
  },
239
227
  "prompt": "{file:./prompts/devil-advocate.txt}"
240
228
  }
@@ -249,16 +237,11 @@
249
237
  "mode": "subagent",
250
238
  "model": "github-copilot/claude-opus-4.6",
251
239
  "permission": {
252
- "edit": "ask",
240
+ "edit": "allow",
253
241
  "bash": "allow",
254
- "webfetch": "deny",
242
+ "webfetch": "allow",
255
243
  "mcp": "allow",
256
- "external_directory": {
257
- "/tmp": "allow",
258
- "/tmp/**": "allow",
259
- "~/.arcs": "allow",
260
- "~/.arcs/**": "allow"
261
- }
244
+ "external_directory": { "*": "allow" }
262
245
  },
263
246
  "prompt": "{file:./prompts/oncall-ops.txt}"
264
247
  }
@@ -273,14 +256,11 @@
273
256
  "mode": "subagent",
274
257
  "model": "github-copilot/claude-opus-4.6",
275
258
  "permission": {
276
- "edit": "deny",
259
+ "edit": "allow",
277
260
  "bash": "allow",
278
261
  "webfetch": "allow",
279
262
  "mcp": "allow",
280
- "external_directory": {
281
- "~/.arcs": "allow",
282
- "~/.arcs/**": "allow"
283
- }
263
+ "external_directory": { "*": "allow" }
284
264
  },
285
265
  "prompt": "{file:./prompts/system-architect.txt}"
286
266
  }
@@ -289,7 +269,8 @@
289
269
  "path": [
290
270
  "small_model"
291
271
  ],
292
- "value": "github-copilot/claude-haiku-4.5"
272
+ "value": "github-copilot/claude-haiku-4.5",
273
+ "mode": "if-absent"
293
274
  }
294
275
  ]
295
276
  }
@@ -134,7 +134,7 @@ Discovery: `arcs --commands --json` (cache once per session). Batch op names are
134
134
  | List tasks | `arcs task list <slug> --json` |
135
135
  | List plans | `arcs plan list <slug> --json` |
136
136
  | Search | `arcs search <slug> "<query>" --json` |
137
- | Diagram ready | `arcs diagram ready <slug> <planId> --json` |
137
+ | Diagram ready | `arcs diagram ready <slug> <planId> --json` — returns `{ready, blocked, inProgress, done}` arrays |
138
138
  | Validate | `arcs validate <slug> --json` |
139
139
  | Task transition | `arcs task transition <slug> <taskId> <status> --planId=<id> --diagramNodeId=<node> --json` |
140
140
  | Batch writes | `arcs batch --file=ops.json --json` |
@@ -292,6 +292,7 @@ Use `recommendedSurface` to pick the routing branch: `QUEUE` → EXECUTE, `PLAN`
292
292
  | External research / docs | `docs-researcher` | |
293
293
  | 2+ independent problems | parallel fan-out across typed agents | Load `dispatching-parallel-agents` |
294
294
  | Multi-step plan with independent leaves | `software-engineer` × N coordinated by orchestrator | Load `subagent-driven-development` |
295
+ | Pending graphify enrichment after init/sync | calling agent (or sub-agent) loads `enriching-graphify-proposals` | When envelope has `pending_enrichment: true` — drives `arcs proposal list/promote/drop` |
295
296
 
296
297
  **Anti-pattern:** dispatching `software-engineer` for analysis, audit, review, debugging, or research.
297
298
 
@@ -310,7 +311,7 @@ flowchart TD
310
311
  A -->|executing pre-written plan| EP[executing-plans]
311
312
  ```
312
313
 
313
- ### Skill Catalogue (14 surviving skills)
314
+ ### Skill Catalogue (15 surviving skills)
314
315
 
315
316
  | Skill | Load when |
316
317
  |-------|----------|
@@ -327,6 +328,7 @@ flowchart TD
327
328
  | `deep-pr-review` | GitHub PR link with "deep review" trigger |
328
329
  | `requesting-code-review` | Self-review gate at phase/feature completion |
329
330
  | `caveman-commit` | Writing git commit messages |
331
+ | `enriching-graphify-proposals` | `arcs project init` or `arcs graphify-sync` returned `pending_enrichment: true` |
330
332
 
331
333
  > **Note:** `confidence-gate` and `verification-before-completion` have been replaced by the `devil-advocate` subagent dispatched at phase checkpoints.
332
334
 
@@ -398,11 +400,12 @@ CLI:
398
400
  3. Present summary → user confirms → `arcs project init`
399
401
  4. `arcs project update-doc × 4`
400
402
  5. Fan out (if needed): `system-architect` (architecture entries) + `docs-researcher` (tech-stack, features) + `tech-architect` (couplings, gotchas) → collect proposals → dedup → `arcs knowledge create × N`
403
+ 6. **Proposal-gate enrichment:** if `arcs project init`'s envelope returned `data.graphify.pending_enrichment === true`, load the `enriching-graphify-proposals` skill on the calling agent (or dispatch a sub-agent with that skill). The skill reads `arcs proposal list <slug> --json`, decides per-proposal verdicts (keep / merge / drop), and persists results via `arcs proposal promote` and `arcs proposal drop`. Graphify never writes directly to the knowledge surface — promotion is the only path from proposal to knowledge entry.
401
404
 
402
405
  **Constraints:**
403
406
  - Do NOT read repo to infer name/description — gather from user or T0
404
407
  - See the `init-project` skill for full category table and worked example
405
- - Graphify (if on PATH): `arcs project init` auto-runs extraction + seeding. Load `graphify-aware` skill on sub-agents when `graphify-out/graph.json` exists.
408
+ - Graphify (if on PATH): `arcs project init` auto-runs extraction and writes structural proposals to `proposals/graphify.json`. When the envelope returns `pending_enrichment: true`, load `enriching-graphify-proposals` and consume via `arcs proposal list/promote/drop`. The previous direct-write knowledge ingestion has been replaced — graphify never writes directly to the knowledge surface anymore.
406
409
 
407
410
  ### BRAINSTORM Workflow
408
411
 
@@ -435,7 +438,7 @@ CLI:
435
438
  - `arcs next` is dependency-aware (topological sort) — it returns the first task whose `dependsOn` are all done. Use it as the primary task selection mechanism.
436
439
  - `arcs task transition` atomically updates task status + diagram node. MUST pass both `--planId` and `--diagramNodeId` (both required for diagram patch)
437
440
  - Sub-agents NEVER edit `.mmd` files — agents must NOT manually patch `.mmd` for status transitions. Scope changes reported back, orchestrator regenerates via `arcs diagram sort-metadata <slug> <planId> --json`
438
- - `arcs diagram ready` after each transition to discover newly-unblocked nodes
441
+ - `arcs diagram ready` after each transition to discover newly-unblocked nodes — read `data.ready` (and `data.blocked` to surface what's still gated)
439
442
  - If blocked → note blocker, advance to next unblocked task
440
443
 
441
444
  **Auto-sync triggers** (any one sufficient): 3+ transitions, `lastSyncedAt` > 7 days, plan reached `done`.
@@ -447,6 +450,7 @@ CLI:
447
450
  3. Delegate to arcs-docs sub-agent with T0 context + validate output + staleness info
448
451
  4. Sub-agent: audit + repair + write checkpoints (`lastSyncedAt`, `lastSyncGitCommit`, `lastSyncStats`) via ARCS CLI
449
452
  5. Receive sync report → present to user
453
+ 6. **Proposal-gate enrichment:** if SYNC includes `arcs graphify-sync` and that command returned `data.graphify.pending_enrichment === true`, dispatch the `enriching-graphify-proposals` skill (same protocol as INIT step 6) before declaring SYNC complete. New proposals from the latest extraction must be triaged in the same session that surfaced them.
450
454
 
451
455
  **arcs-docs sub-agent covers:**
452
456
  overview.md, tasks.md, dependencies.md, knowledge.md, plans/ status, knowledge/ accuracy, .diagram.mmd diagram drift (classDef mismatch, phantom nodes), AGENTS.md staleness, sourceFiles existence. Graph recalculation includes `task_blocks_task` edges derived from `dependsOn` fields.
@@ -42,7 +42,7 @@ Discovery: `arcs --commands --json` (cache once per session). Batch op names are
42
42
  | List tasks | `arcs task list <slug> --json` |
43
43
  | List plans | `arcs plan list <slug> --json` |
44
44
  | Search | `arcs search <slug> "<query>" --json` |
45
- | Diagram ready | `arcs diagram ready <slug> <planId> --json` |
45
+ | Diagram ready | `arcs diagram ready <slug> <planId> --json` — returns `{ready, blocked, inProgress, done}` arrays |
46
46
  | Validate | `arcs validate <slug> --json` |
47
47
  | Task transition | `arcs task transition <slug> <taskId> <status> --planId=<id> --diagramNodeId=<node> --json` |
48
48
  | Batch writes | `arcs batch --file=ops.json --json` |
@@ -200,6 +200,7 @@ Use `recommendedSurface` to pick the routing branch: `QUEUE` → EXECUTE, `PLAN`
200
200
  | External research / docs | `docs-researcher` | |
201
201
  | 2+ independent problems | parallel fan-out across typed agents | Load `dispatching-parallel-agents` |
202
202
  | Multi-step plan with independent leaves | `software-engineer` × N coordinated by orchestrator | Load `subagent-driven-development` |
203
+ | Pending graphify enrichment after init/sync | calling agent (or sub-agent) loads `enriching-graphify-proposals` | When envelope has `pending_enrichment: true` — drives `arcs proposal list/promote/drop` |
203
204
 
204
205
  **Anti-pattern:** dispatching `software-engineer` for analysis, audit, review, debugging, or research.
205
206
 
@@ -218,7 +219,7 @@ flowchart TD
218
219
  A -->|executing pre-written plan| EP[executing-plans]
219
220
  ```
220
221
 
221
- ### Skill Catalogue (14 surviving skills)
222
+ ### Skill Catalogue (15 surviving skills)
222
223
 
223
224
  | Skill | Load when |
224
225
  |-------|----------|
@@ -235,6 +236,7 @@ flowchart TD
235
236
  | `deep-pr-review` | GitHub PR link with "deep review" trigger |
236
237
  | `requesting-code-review` | Self-review gate at phase/feature completion |
237
238
  | `caveman-commit` | Writing git commit messages |
239
+ | `enriching-graphify-proposals` | `arcs project init` or `arcs graphify-sync` returned `pending_enrichment: true` |
238
240
 
239
241
  > **Note:** `confidence-gate` and `verification-before-completion` have been replaced by the `devil-advocate` subagent dispatched at phase checkpoints.
240
242
 
@@ -306,11 +308,12 @@ CLI:
306
308
  3. Present summary → user confirms → `arcs project init`
307
309
  4. `arcs project update-doc × 4`
308
310
  5. Fan out (if needed): `system-architect` (architecture entries) + `docs-researcher` (tech-stack, features) + `tech-architect` (couplings, gotchas) → collect proposals → dedup → `arcs knowledge create × N`
311
+ 6. **Proposal-gate enrichment:** if `arcs project init`'s envelope returned `data.graphify.pending_enrichment === true`, load the `enriching-graphify-proposals` skill on the calling agent (or dispatch a sub-agent with that skill). The skill reads `arcs proposal list <slug> --json`, decides per-proposal verdicts (keep / merge / drop), and persists results via `arcs proposal promote` and `arcs proposal drop`. Graphify never writes directly to the knowledge surface — promotion is the only path from proposal to knowledge entry.
309
312
 
310
313
  **Constraints:**
311
314
  - Do NOT read repo to infer name/description — gather from user or T0
312
315
  - See the `init-project` skill for full category table and worked example
313
- - Graphify (if on PATH): `arcs project init` auto-runs extraction + seeding. Load `graphify-aware` skill on sub-agents when `graphify-out/graph.json` exists.
316
+ - Graphify (if on PATH): `arcs project init` auto-runs extraction and writes structural proposals to `proposals/graphify.json`. When the envelope returns `pending_enrichment: true`, load `enriching-graphify-proposals` and consume via `arcs proposal list/promote/drop`. The previous direct-write knowledge ingestion has been replaced — graphify never writes directly to the knowledge surface anymore.
314
317
 
315
318
  ### BRAINSTORM Workflow
316
319
 
@@ -343,7 +346,7 @@ CLI:
343
346
  - `arcs next` is dependency-aware (topological sort) — it returns the first task whose `dependsOn` are all done. Use it as the primary task selection mechanism.
344
347
  - `arcs task transition` atomically updates task status + diagram node. MUST pass both `--planId` and `--diagramNodeId` (both required for diagram patch)
345
348
  - Sub-agents NEVER edit `.mmd` files — agents must NOT manually patch `.mmd` for status transitions. Scope changes reported back, orchestrator regenerates via `arcs diagram sort-metadata <slug> <planId> --json`
346
- - `arcs diagram ready` after each transition to discover newly-unblocked nodes
349
+ - `arcs diagram ready` after each transition to discover newly-unblocked nodes — read `data.ready` (and `data.blocked` to surface what's still gated)
347
350
  - If blocked → note blocker, advance to next unblocked task
348
351
 
349
352
  **Auto-sync triggers** (any one sufficient): 3+ transitions, `lastSyncedAt` > 7 days, plan reached `done`.
@@ -355,6 +358,7 @@ CLI:
355
358
  3. Delegate to arcs-docs sub-agent with T0 context + validate output + staleness info
356
359
  4. Sub-agent: audit + repair + write checkpoints (`lastSyncedAt`, `lastSyncGitCommit`, `lastSyncStats`) via ARCS CLI
357
360
  5. Receive sync report → present to user
361
+ 6. **Proposal-gate enrichment:** if SYNC includes `arcs graphify-sync` and that command returned `data.graphify.pending_enrichment === true`, dispatch the `enriching-graphify-proposals` skill (same protocol as INIT step 6) before declaring SYNC complete. New proposals from the latest extraction must be triaged in the same session that surfaced them.
358
362
 
359
363
  **arcs-docs sub-agent covers:**
360
364
  overview.md, tasks.md, dependencies.md, knowledge.md, plans/ status, knowledge/ accuracy, .diagram.mmd diagram drift (classDef mismatch, phantom nodes), AGENTS.md staleness, sourceFiles existence. Graph recalculation includes `task_blocks_task` edges derived from `dependsOn` fields.
@@ -0,0 +1,170 @@
1
+ ---
2
+ name: enriching-graphify-proposals
3
+ description: Use when `arcs project init` or `arcs graphify-sync` returns `pending_enrichment: true` — drives the per-proposal verdict loop (keep/drop/merge) and produces agent-authored knowledge entries from raw graphify proposals.
4
+ ---
5
+
6
+ # Skill: enriching-graphify-proposals
7
+
8
+ ## When
9
+
10
+ The CLI surfaced raw graphify proposals and is waiting for an agent to turn them into real knowledge entries. Mandatory triggers:
11
+
12
+ - `arcs project init` returned `graphify.pending_enrichment: true` in its JSON envelope.
13
+ - `arcs graphify-sync` returned `pending_enrichment: true`.
14
+ - User said "enrich the proposals", "process the graphify queue", "promote the pending proposals", or similar.
15
+
16
+ > **Read-write skill.** This skill mutates the DAG via `arcs proposal promote/drop`. Self-score ≥80% via `confidence-gate` before each promote.
17
+
18
+ ## Flow
19
+
20
+ ```mermaid
21
+ flowchart TD
22
+ classDef decision fill:#f59e0b,color:#fff
23
+ classDef terminal fill:#22c55e,color:#fff
24
+
25
+ A[arcs proposal list slug --json] --> B{Proposals empty?}
26
+ B -->|Yes| Done[Done — surface summary]:::terminal
27
+ B -->|No| C[Pick highest-degree proposal]
28
+ C --> D[Read structuralFacts + suggestedDedupCandidates]
29
+ D --> E{Verdict}:::decision
30
+ E -->|drop| F[arcs proposal drop slug id --reason='...']
31
+ E -->|keep| G[Author title + summary + body]
32
+ E -->|merge| H[Identify dedup target id]
33
+ H --> I[Author append-style body]
34
+ I --> J[arcs proposal promote slug id --merge-with=target ...]
35
+ G --> K[arcs proposal promote slug id ...]
36
+ F --> L{Budget left?}
37
+ J --> L
38
+ K --> L
39
+ L -->|Yes & proposals remain| C
40
+ L -->|No or empty| Done
41
+
42
+ class E decision
43
+ ```
44
+
45
+ ## Decision Heuristics
46
+
47
+ This is the meat of the skill. Apply per proposal — never skip.
48
+
49
+ ### Keep
50
+
51
+ Promote as a fresh knowledge entry when ALL of:
52
+
53
+ - The cluster / module covers a real architectural boundary AND existing knowledge does not already cover it (verify via `suggestedDedupCandidates` length 0 or low overlap).
54
+ - `structuralFacts.fileCount >= 3` and `fileTypeBreakdown` is code-dominant (`.ts`, `.tsx`, `.js`, `.py`, etc. — not 100% docs/templates/skills).
55
+ - `topHubs` includes named exports / functions / classes, not just file basenames.
56
+ - The boundary is distinct enough that a future agent editing inside it would benefit from a one-paragraph map.
57
+
58
+ ### Drop
59
+
60
+ Reject the proposal (use `arcs proposal drop`) when ANY of:
61
+
62
+ - `structuralFacts.fileTypeBreakdown` has zero code (all `.md`, `.mdx`, `.txt`, `.html` templates, skill files). T007 should already filter these — drop is defense-in-depth.
63
+ - Cluster covers test directories only (`test/`, `__tests__/`, `*.test.ts`, `*.spec.ts`, `tests/`).
64
+ - Cluster size `<= 2` distinct files — too small to be architecturally meaningful.
65
+ - All `topHubs` resolve to deprecated, dead, or vendored code (`vendor/`, `legacy/`, `_archive/`).
66
+ - `suggestedDedupCandidates` shows perfect overlap with an existing knowledge entry AND the proposal contributes no new structural insight (no new degree numbers, no new hubs, no new edges).
67
+ - Proposal is a near-duplicate of one already promoted in this session.
68
+
69
+ Always pass a `--reason` string. The reason is durable on the proposal-store ledger and helps future SYNC rounds skip the same noise.
70
+
71
+ ### Merge
72
+
73
+ Use `arcs proposal promote --merge-with=<existing-id>` when:
74
+
75
+ - `suggestedDedupCandidates` lists an existing knowledge entry whose `kind` matches the proposal's natural kind, AND
76
+ - The proposal adds genuinely new structural facts the existing entry does not already document (e.g. precise degree numbers, additional top hubs, cross-module edges, fileCount).
77
+
78
+ The agent appends a `## From graphify analysis` section to the existing entry — it does NOT replace prior body content. Treat the existing entry as the spine; the merge adds a graph-evidence rib.
79
+
80
+ ## Enrichment Output Contract
81
+
82
+ For every "keep" or "merge" verdict, the agent produces three fields. None may be the templated default from `ingestGraph`.
83
+
84
+ ### `--title` (6–12 words)
85
+
86
+ Tell a human what this code surface DOES, not just where it lives. Verb- or role-led, specific.
87
+
88
+ | Bad (templated) | Good (agent-authored) |
89
+ |-----------------------------|------------------------------------------------------------|
90
+ | "Cluster of 7 entities" | "Storage hub re-exporting helpers to all persistent stores" |
91
+ | "Module storage-utils" | "Task / plan / knowledge front-matter parser & guards" |
92
+ | "Architecture: src/cli" | "CLI router and command-registry dispatch surface" |
93
+
94
+ ### `--summary` (1–2 sentences, action-oriented)
95
+
96
+ State what the boundary is and what ripples when it changes. Prefer concrete consequences over abstract description.
97
+
98
+ > Example: "Storage hub re-exporting `nowISO` and `sanitizeFileRefs` to all three persistent stores; editing here ripples through every persistent surface and the file-lock contract."
99
+
100
+ ### `--body` (3–5 paragraphs)
101
+
102
+ Suggested structure — adapt as needed but cover all five beats:
103
+
104
+ 1. **What it is** — one sentence definition of the architectural boundary.
105
+ 2. **Top hubs and what they do** — brief expansion of `structuralFacts.topHubs`. Name each hub, name its responsibility in one clause.
106
+ 3. **Cross-cutting implications** — what depends on this surface; what this surface depends on. Pull from `structuralFacts.crossModuleEdges` if present.
107
+ 4. **When to read this entry** — concrete agent-facing trigger. ("Before editing `storage-utils.ts`. Before adding a new field to any task / plan / knowledge front-matter. Before changing the file-lock policy.")
108
+ 5. **Cross-references** — link to related knowledge entries by id (use `suggestedDedupCandidates` and `arcs related` output).
109
+
110
+ Always pass `--source-files` listing the files in `structuralFacts.fileList` (or the top-N if list is huge — cap at 12 paths). Graph-retrieval `shares_source_file` edges weight 0.9; without `--source-files` the entry is invisible to the graph.
111
+
112
+ ## Cost Discipline
113
+
114
+ - **Cap at 12 enrichments per session.** If proposals list exceeds 12, drop low-signal entries en masse before enriching the keep set.
115
+ - **Process highest-degree clusters first.** Sort proposals by `structuralFacts.degree` descending; the top 3–5 carry most of the value.
116
+ - **Bulk drop early.** A single triage pass over all proposals — calling `arcs proposal drop` on obvious noise — is cheaper than enriching one and discovering the next is also noise.
117
+ - **Stop early on budget.** If the agent has spent ~12 enrichments, drop the remainder with reason `"session budget exhausted; reconsider next sync"` rather than producing rushed entries.
118
+
119
+ ## Failure Modes
120
+
121
+ | Symptom | Recovery |
122
+ |-----------------------------------------------------------|------------------------------------------------------------------------------------------------|
123
+ | `promote --merge-with=<id>` fails: target doesn't exist | Drop the merge plan; re-run as a fresh `promote` (no `--merge-with`). |
124
+ | Body too long for shell argv (errno E2BIG / argv overflow)| Switch to `--body-file=path/to/body.md` or pipe via `--body-stdin`. |
125
+ | `proposal_not_found` on promote/drop | Another agent already handled it. Skip and continue — proposal-store lock is first-come-first-serve. |
126
+ | Promote succeeds but knowledge graph misses the edge | Verify `--source-files` was passed and points at real paths under the project root. |
127
+ | `structuralFacts` field absent | Treat as drop candidate — proposal has no evidence to enrich from. |
128
+ | Verdict drift: same proposal triaged twice in one session | Re-list with `arcs proposal list --json` — the store is the single source of truth. |
129
+
130
+ ## Constraints
131
+
132
+ - **Do not invent structural facts** not present in `structuralFacts`. If real-code grounding is needed, defer to `arcs context <slug> --audience=<role>` or `arcs related <slug> <id>` and read source. Hallucinated graph facts poison every downstream retrieval.
133
+ - **Always specify `--source-files`** on promote — graph-retrieval depends on it (per AGENTS.md "Knowledge gravity"). An entry without source files is a leaf with no inbound edges.
134
+ - **Never edit `.mmd` files** directly — diagram ownership rules in AGENTS.md still apply during enrichment.
135
+ - **No batch promote.** Each promote is one decision, one `arcs proposal promote` call. Bulk-promoting via `arcs batch` bypasses dedup checks and per-proposal review.
136
+ - **Preserve proposal IDs in commit messages / summaries** when reporting back so the human can audit the verdict ledger.
137
+
138
+ ## Worked Example
139
+
140
+ ```bash
141
+ # 1. List pending proposals (highest-degree first by default)
142
+ arcs proposal list arcs --json
143
+
144
+ # 2. Drop obvious noise in bulk
145
+ arcs proposal drop arcs prop_test_dirs_only \
146
+ --reason="cluster covers test/ only — defense in depth past T007 filter" --json
147
+
148
+ # 3. Promote a keep verdict with full enrichment
149
+ arcs proposal promote arcs prop_storage_hub \
150
+ --title="Storage hub re-exporting helpers to all persistent stores" \
151
+ --summary="Central re-export point for nowISO and sanitizeFileRefs used by task/plan/knowledge stores; edits ripple through every persistent surface." \
152
+ --body-file=/tmp/storage-hub.body.md \
153
+ --kind=architecture \
154
+ --source-files=src/utils/storage-utils.ts,src/utils/task-store.ts,src/utils/plan-store.ts,src/utils/knowledge-store.ts \
155
+ --json
156
+
157
+ # 4. Merge into an existing entry
158
+ arcs proposal promote arcs prop_cli_registry \
159
+ --merge-with=cli-registry-pattern-handlers-typed-via-parsedparams \
160
+ --body-file=/tmp/cli-registry-graph-evidence.md \
161
+ --source-files=src/cli/command-registry.ts,src/cli/index.ts \
162
+ --json
163
+
164
+ # 5. Confirm queue drained
165
+ arcs proposal list arcs --json # expect data.proposals == []
166
+ ```
167
+
168
+ ## Exit
169
+
170
+ When `arcs proposal list <slug> --json` returns an empty `proposals` array, the enrichment pass is done. Surface a one-line summary to the orchestrator: kept N, merged M, dropped K, deferred D.
@@ -48,27 +48,29 @@ Discovery: `arcs --commands --json`. Mutating commands run directly — no token
48
48
 
49
49
  ## Graphify Sub-Flow (DEFAULT: ON when binary present)
50
50
 
51
- The orchestrator runs graphify directly during INIT to seed knowledge entries with structural evidence before any sub-agent reads code. This is the default path when `graphify` is on PATH; skip cleanly otherwise.
51
+ The orchestrator runs graphify directly during INIT to produce structural **proposals** before any sub-agent reads code. Proposals are durable on the proposal-store ledger; agents enrich them into knowledge entries via the `enriching-graphify-proposals` skill. This is the default path when `graphify` is on PATH; skip cleanly otherwise.
52
52
 
53
- 1. **Detect:** call `detectGraphify()` from `src/utils/graphify.ts`. If unavailable, log "graphify not on PATH; proceeding without graph signal" and skip steps 3–5.
53
+ 1. **Detect:** call `detectGraphify()` from `src/utils/graphify.ts`. If unavailable, log "graphify not on PATH; proceeding without graph signal" and skip steps 3–6.
54
54
  2. **Trust the gitignore guarantee:** `runExtraction()` already auto-appends `graphify-out/` to `.gitignore` via `ensureGitignoreEntry`. Do NOT redundantly check or modify `.gitignore` from agents — running extraction is sufficient.
55
55
  3. **Extract** (AST-only, no LLM API key required):
56
56
  ```bash
57
57
  graphify update <workspacePath> --force --no-cluster
58
58
  ```
59
59
  Produces `<workspacePath>/graphify-out/graph.json`.
60
- 4. **Ingest:** call internal `ingestGraph(graphJsonPath, slug)` up to 20 `KnowledgeProposal` records (test files filtered):
60
+ 4. **Ingest as proposals:** `arcs project init` internally calls `ingestGraph(graphJsonPath, slug)`, which writes up to 20 structural proposals to `proposals/graphify.json` (test files filtered):
61
61
  - 8 god nodes (`kind=module`, top 5% degree)
62
62
  - 8 architecture clusters (`kind=architecture`, by community or directory grouping)
63
63
  - 5 cross-module couplings (`kind=gotcha`, high-degree links across top-level dirs)
64
- 5. **Enrich** with read-only graph queries (sub-agents may run these):
64
+
65
+ Graphify never writes directly to the knowledge surface. The init envelope returns `data.graphify.pending_enrichment: true` to signal that proposals are waiting.
66
+ 5. **Enrich** with the `enriching-graphify-proposals` skill — read `arcs proposal list <slug> --json`, decide per-proposal verdicts (keep / merge / drop), persist via `arcs proposal promote` and `arcs proposal drop`. The skill encodes the decision heuristics, output contract, and cost discipline; do not paraphrase.
67
+ 6. **Optional graph queries** for evidence during enrichment (sub-agents may run these):
65
68
  - `graphify query "entry points and main commands" --graph graphify-out/graph.json --budget 2000` → seeds for "key files" reference entries
66
69
  - `graphify query "core data flow" --graph graphify-out/graph.json --budget 2000` → seeds for "core modules" entries
67
70
  - `graphify explain "<godNodeLabel>" --graph graphify-out/graph.json` → plain-language summary for module entry bodies
68
71
  - `graphify affected "<critical-symbol>" --graph graphify-out/graph.json --depth 2` → reverse-impact map for high-risk modules
69
72
  - `graphify path "<A>" "<B>" --graph graphify-out/graph.json` → shortest dependency path for architecture entries
70
- 6. **Hand to typed agents:** the proposals + query results go to the sub-agents listed in **Agent Dispatch** below; they merge graph evidence with code reading and return finalized knowledge entries.
71
- 7. **Write** the entries directly: `arcs batch --file=ops.json` for one batched invocation, or repeated `arcs knowledge create` per entry.
73
+ 7. **Hand to typed agents** (in parallel) for code-grounded follow-up entries that go beyond what graphify proposals cover — see **Agent Dispatch** below.
72
74
 
73
75
  ## Content Guidelines
74
76
 
@@ -125,16 +127,21 @@ arcs project init "Foo" --description="Foo CLI tool" --path="$(pwd)" --json
125
127
  arcs project update-doc foo overview --content="..." --json
126
128
  # ... repeat for tasks, dependencies, knowledge
127
129
 
128
- # 4. Graphify (if available)
130
+ # 4. Graphify (if available) — runs inside `arcs project init`
129
131
  graphify update . --force --no-cluster
130
- # ingestGraph produces proposals; enrich with graphify query/explain
131
-
132
- # 5. Fan out typed agents (parallel)
132
+ # ingestGraph writes proposals to proposals/graphify.json
133
+ # init envelope: data.graphify.pending_enrichment === true → load
134
+ # `enriching-graphify-proposals` and run the verdict loop:
135
+ arcs proposal list foo --json
136
+ arcs proposal promote foo <id> --title="..." --summary="..." --body-file=... --kind=module --source-files=... --json
137
+ arcs proposal drop foo <id> --reason="..." --json
138
+
139
+ # 5. Fan out typed agents (parallel) for entries beyond proposal scope
133
140
  # system-architect → architecture/module entries
134
141
  # docs-researcher → reference/feature entries
135
142
  # tech-architect → gotcha/lesson entries
136
143
 
137
- # 6. Write knowledge entries directly
144
+ # 6. Write any non-proposal-derived knowledge entries directly
138
145
  arcs knowledge create foo "Tech stack: TypeScript + Node 20" --kind=architecture --summary="..." --body="..." --json
139
146
  # ... repeat per entry, or use arcs batch
140
147
  ```
@@ -163,7 +163,7 @@ Between plan-level header and `flowchart TD` declaration:
163
163
  | `sort-metadata <file>` | Order metadata blocks by node ID |
164
164
  | `regenerate <file> --metadata f.json` | Full regeneration from canonical data |
165
165
 
166
- Preferred: `arcs diagram ready <slug> <planId>` for ready detection. Script is fallback for file-level ops.
166
+ Preferred: `arcs diagram ready <slug> <planId>` for ready detection. The CLI returns `{ok, data: {ready, blocked, inProgress, done}}` — four disjoint arrays of node IDs that together cover every node in the diagram. The bundled `manage-diagram.mjs ready` script remains the file-level fallback (emits a bare list of ready IDs only).
167
167
 
168
168
  ## File Convention
169
169
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rryando/arcs",
3
- "version": "3.1.2",
3
+ "version": "3.2.1",
4
4
  "description": "ARCS — DAG-based task orchestration for AI agents. Persistent workflow continuity via graph-structured context.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",