@rryando/arcs 4.0.0 → 4.2.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.
- package/README.md +18 -20
- package/dist/cli/arcs-flash.d.ts +1 -1
- package/dist/cli/arcs-flash.d.ts.map +1 -1
- package/dist/cli/arcs-flash.js +9 -50
- package/dist/cli/arcs-flash.js.map +1 -1
- package/dist/cli/arcs-orchestrate-caveman.d.ts +2 -2
- package/dist/cli/arcs-orchestrate-caveman.d.ts.map +1 -1
- package/dist/cli/arcs-orchestrate-caveman.js +2 -8
- package/dist/cli/arcs-orchestrate-caveman.js.map +1 -1
- package/dist/cli/arcs-orchestrate.d.ts +1 -1
- package/dist/cli/arcs-orchestrate.d.ts.map +1 -1
- package/dist/cli/arcs-orchestrate.js +4 -54
- package/dist/cli/arcs-orchestrate.js.map +1 -1
- package/dist/cli/orchestrator-shared-blocks.d.ts +10 -30
- package/dist/cli/orchestrator-shared-blocks.d.ts.map +1 -1
- package/dist/cli/orchestrator-shared-blocks.js +46 -128
- package/dist/cli/orchestrator-shared-blocks.js.map +1 -1
- package/dist/utils/claude-code-hook-install.d.ts.map +1 -1
- package/dist/utils/claude-code-hook-install.js +3 -2
- package/dist/utils/claude-code-hook-install.js.map +1 -1
- package/dist/utils/diagram-generator.d.ts.map +1 -1
- package/dist/utils/diagram-generator.js +11 -6
- package/dist/utils/diagram-generator.js.map +1 -1
- package/dist/utils/hook-token-store.d.ts +5 -3
- package/dist/utils/hook-token-store.d.ts.map +1 -1
- package/dist/utils/hook-token-store.js +5 -3
- package/dist/utils/hook-token-store.js.map +1 -1
- package/dist/utils/session-store.d.ts +9 -57
- package/dist/utils/session-store.d.ts.map +1 -1
- package/dist/utils/session-store.js +19 -92
- package/dist/utils/session-store.js.map +1 -1
- package/dist/utils/storage-utils.d.ts +1 -1
- package/dist/utils/storage-utils.d.ts.map +1 -1
- package/dist/utils/storage-utils.js +1 -1
- package/dist/utils/storage-utils.js.map +1 -1
- package/dist/web-client/assets/{GraphCanvas-CTyf_XXQ.js → GraphCanvas-BPDgvsyT.js} +1 -1
- package/dist/web-client/assets/{MarkdownEditor-af2vwQOX.js → MarkdownEditor-D7TLp78z.js} +1 -1
- package/dist/web-client/assets/{abnfDiagram-VRR7QNED-CdxcKX9t.js → abnfDiagram-VRR7QNED-CyuP2N9t.js} +1 -1
- package/dist/web-client/assets/architecture-TIHT7OUA-Bdo2Yvm9.js +1 -0
- package/dist/web-client/assets/{architectureDiagram-ZJ3FMSHR-DOISDv6o.js → architectureDiagram-ZJ3FMSHR-DZ0ul9QX.js} +1 -1
- package/dist/web-client/assets/{blockDiagram-677ZJIJ3-DKwtbttM.js → blockDiagram-677ZJIJ3-LLGzlc9l.js} +1 -1
- package/dist/web-client/assets/{c4Diagram-LMCZKHZV-CilqK-Mm.js → c4Diagram-LMCZKHZV-CViu3CTc.js} +1 -1
- package/dist/web-client/assets/channel-DBNmizpo.js +1 -0
- package/dist/web-client/assets/{chunk-32BRIVSS-C79m1mkG.js → chunk-32BRIVSS-Bw_IuJCM.js} +1 -1
- package/dist/web-client/assets/{chunk-52WLFC77-C6WelGWJ.js → chunk-52WLFC77-C29h440W.js} +1 -1
- package/dist/web-client/assets/{chunk-C7G6YPKG-DLg7ryWI.js → chunk-C7G6YPKG-hhOrvw5w.js} +1 -1
- package/dist/web-client/assets/{chunk-EX3LRPZG-DjWgo4gL.js → chunk-EX3LRPZG-COMzol-M.js} +1 -1
- package/dist/web-client/assets/{chunk-FWX5IMBZ-BgS9p_zy.js → chunk-FWX5IMBZ-6vdX9EUn.js} +2 -2
- package/dist/web-client/assets/{chunk-HOUHSVGY-DuVR7dZO.js → chunk-HOUHSVGY-DWDW6sxp.js} +1 -1
- package/dist/web-client/assets/{chunk-ICXQ74PX-Y8DlnIJM.js → chunk-ICXQ74PX-BdMYglo2.js} +1 -1
- package/dist/web-client/assets/{chunk-MOJQB5TN-BEM3QgeD.js → chunk-MOJQB5TN-C0LAX_dC.js} +1 -1
- package/dist/web-client/assets/{chunk-OGEWGWER-DlM8LxGr.js → chunk-OGEWGWER-CBx8MB7f.js} +1 -1
- package/dist/web-client/assets/{chunk-PUDLZKDR-c6cqNVTx.js → chunk-PUDLZKDR-DKssR1nf.js} +1 -1
- package/dist/web-client/assets/{chunk-Q4XR5HBZ-C5lNmcka.js → chunk-Q4XR5HBZ-B3kcxFE-.js} +1 -1
- package/dist/web-client/assets/{chunk-V7JOEXUC-nSswxvSG.js → chunk-V7JOEXUC-CAlymndy.js} +1 -1
- package/dist/web-client/assets/{chunk-VAUOI2AC-CqJkCkT0.js → chunk-VAUOI2AC-BowfsmTW.js} +1 -1
- package/dist/web-client/assets/{chunk-VR4S4FIN-D3pFchin.js → chunk-VR4S4FIN-BBOydgvt.js} +1 -1
- package/dist/web-client/assets/{chunk-WYO6CB5R-BI9c-NzI.js → chunk-WYO6CB5R-DcymFbES.js} +1 -1
- package/dist/web-client/assets/{chunk-ZGVPDNZ5-CKTF2kLR.js → chunk-ZGVPDNZ5--uKFP-Lr.js} +1 -1
- package/dist/web-client/assets/classDiagram-OUVF2IWQ-CB3HiA1_.js +1 -0
- package/dist/web-client/assets/classDiagram-v2-EOCWNBFH-CB3HiA1_.js +1 -0
- package/dist/web-client/assets/{cynefin-VYW2F7L2-BrJrnfh1.js → cynefin-VYW2F7L2-CjboUOMA.js} +1 -1
- package/dist/web-client/assets/{cynefinDiagram-TSTJHNR4-9jYzPWJZ.js → cynefinDiagram-TSTJHNR4-BcxygBP7.js} +1 -1
- package/dist/web-client/assets/{dagre-VKFMJZFB-B705Djpu.js → dagre-VKFMJZFB-D-tiERQE.js} +1 -1
- package/dist/web-client/assets/{diagram-FQU43EPY-BfQAlUlJ.js → diagram-FQU43EPY-ChPXczaS.js} +1 -1
- package/dist/web-client/assets/{diagram-G47NLZAW-s1YDe06A.js → diagram-G47NLZAW-CVL3Y91h.js} +1 -1
- package/dist/web-client/assets/{diagram-NH7WQ7WH-Dy3z11Hc.js → diagram-NH7WQ7WH-DsaNA9Lh.js} +1 -1
- package/dist/web-client/assets/{diagram-OA4YK3LP-Bius2xUN.js → diagram-OA4YK3LP-CXhrhdhU.js} +1 -1
- package/dist/web-client/assets/{diagram-WEI45ONY-D7x4VcHM.js → diagram-WEI45ONY-BTVPnk4E.js} +1 -1
- package/dist/web-client/assets/{ebnfDiagram-CCIWWBDH-CBg1xrmD.js → ebnfDiagram-CCIWWBDH-BAyrRBtM.js} +1 -1
- package/dist/web-client/assets/{erDiagram-Q63AITRT-CJRvTFvd.js → erDiagram-Q63AITRT-Qm24Wepm.js} +1 -1
- package/dist/web-client/assets/eventmodeling-45OFAUF4-DoTBIvl5.js +1 -0
- package/dist/web-client/assets/flowDiagram-23GEKE2U-BEH23L1A.js +1 -0
- package/dist/web-client/assets/{ganttDiagram-NO4QXBWP-C_LsypZ4.js → ganttDiagram-NO4QXBWP-D8h7l3XJ.js} +1 -1
- package/dist/web-client/assets/{gitGraph-TEB2WS4Q-Dx2XxdGk.js → gitGraph-TEB2WS4Q-DIBml1SB.js} +1 -1
- package/dist/web-client/assets/{gitGraphDiagram-IHSO6WYX-DiKWkGWQ.js → gitGraphDiagram-IHSO6WYX-CtkYoXjn.js} +1 -1
- package/dist/web-client/assets/{index-CYwhkPtc.js → index-DOSH4Q9H.js} +38 -38
- package/dist/web-client/assets/{info-DKCQHKI2-DORwHenK.js → info-DKCQHKI2-DLEUtV5Q.js} +1 -1
- package/dist/web-client/assets/{infoDiagram-FWYZ7A6U-CQecXS1E.js → infoDiagram-FWYZ7A6U-BJQ7aQux.js} +1 -1
- package/dist/web-client/assets/{ishikawaDiagram-FXEZZL3T-CWhj60Zp.js → ishikawaDiagram-FXEZZL3T-BPM11FvG.js} +1 -1
- package/dist/web-client/assets/{journeyDiagram-5HDEW3XC-Cj3z2U8u.js → journeyDiagram-5HDEW3XC-C0aX2z3c.js} +1 -1
- package/dist/web-client/assets/{kanban-definition-HUTT4EX6-DFmBRenP.js → kanban-definition-HUTT4EX6-C56F29Ib.js} +1 -1
- package/dist/web-client/assets/{line-C_Hxz9xb.js → line-BLFHLF2N.js} +1 -1
- package/dist/web-client/assets/{mermaid-parser.core-E3xRdzPn.js → mermaid-parser.core-BLC8FhgU.js} +3 -3
- package/dist/web-client/assets/{mermaid.core-C2_CcotH.js → mermaid.core-BBqkKuXt.js} +3 -3
- package/dist/web-client/assets/{mindmap-definition-LN4V7U3C-Bs7VxPid.js → mindmap-definition-LN4V7U3C-aVZbsoPc.js} +1 -1
- package/dist/web-client/assets/{packet-7NZHBO7P-D2nqso7i.js → packet-7NZHBO7P-D4aqSQfB.js} +1 -1
- package/dist/web-client/assets/{pegDiagram-2B236MQR-Cepo1sIu.js → pegDiagram-2B236MQR-DjfyNI0U.js} +1 -1
- package/dist/web-client/assets/{pie-RZYD4A2V-Sx0IGbXt.js → pie-RZYD4A2V-ChCwYsYj.js} +1 -1
- package/dist/web-client/assets/{pieDiagram-ENE6RG2P-D-PMDNhk.js → pieDiagram-ENE6RG2P-BeHLKkXC.js} +1 -1
- package/dist/web-client/assets/{quadrantDiagram-ABIIQ3AL-BNGC7Fms.js → quadrantDiagram-ABIIQ3AL-stga3gvq.js} +1 -1
- package/dist/web-client/assets/{radar-I7S5WNFK-CFf_-2OC.js → radar-I7S5WNFK-DOGheiwT.js} +1 -1
- package/dist/web-client/assets/{railroad-3IZDKUUU-BvZeVRGh.js → railroad-3IZDKUUU-_JnU7M6L.js} +1 -1
- package/dist/web-client/assets/railroad-abnf-AHOZXSZD-nhNub7LE.js +1 -0
- package/dist/web-client/assets/railroad-ebnf-EBAXGLYW-BlQYe7Yf.js +1 -0
- package/dist/web-client/assets/railroad-peg-LSFZ7HO6-B3E8pRVN.js +1 -0
- package/dist/web-client/assets/{railroadDiagram-RFXS5EU6-D0iK_k84.js → railroadDiagram-RFXS5EU6-C0CkMsOd.js} +1 -1
- package/dist/web-client/assets/{requirementDiagram-TGXJPOKE-BPdsw9tz.js → requirementDiagram-TGXJPOKE-DuImwoRD.js} +1 -1
- package/dist/web-client/assets/{sankeyDiagram-HTMAVEWB-maA6ukOJ.js → sankeyDiagram-HTMAVEWB-kprq0XF9.js} +1 -1
- package/dist/web-client/assets/{sequenceDiagram-DBY2YBRQ-DKmAjmgr.js → sequenceDiagram-DBY2YBRQ-DiXKJMF6.js} +1 -1
- package/dist/web-client/assets/{stateDiagram-2N3HPSRC-esxmzk3w.js → stateDiagram-2N3HPSRC-D5qbVStE.js} +1 -1
- package/dist/web-client/assets/stateDiagram-v2-6OUMAXLB-DWwTAG1r.js +1 -0
- package/dist/web-client/assets/{swimlanes-5IMT3BWC-DFd-wGBv.js → swimlanes-5IMT3BWC-DCbw389c.js} +1 -1
- package/dist/web-client/assets/swimlanesDiagram-G3AALYLV-DabrCsjZ.js +8 -0
- package/dist/web-client/assets/{timeline-definition-FHXFAJF6-C7SG8MQH.js → timeline-definition-FHXFAJF6-CQeaYN_9.js} +1 -1
- package/dist/web-client/assets/{treeView-QDETBFTQ-M0rhxbs2.js → treeView-QDETBFTQ-Cf7Sq3qo.js} +1 -1
- package/dist/web-client/assets/{treemap-6X3UGDF4-BQfkQxSh.js → treemap-6X3UGDF4-BovzvoTU.js} +1 -1
- package/dist/web-client/assets/{vennDiagram-L72KCM5P-CyIlb8ju.js → vennDiagram-L72KCM5P-CZsJy139.js} +1 -1
- package/dist/web-client/assets/{wardley-OPB4EBWU-EE-7q8M1.js → wardley-OPB4EBWU-DJ7MS6XZ.js} +1 -1
- package/dist/web-client/assets/{wardleyDiagram-EHGQE667-bY8XdYYS.js → wardleyDiagram-EHGQE667-rqhcmsbM.js} +1 -1
- package/dist/web-client/assets/{xychartDiagram-FW5EYKEG-AhuXJ3de.js → xychartDiagram-FW5EYKEG-HuK4Seps.js} +1 -1
- package/dist/web-client/index.html +1 -1
- package/dist/web-server/app.d.ts +2 -2
- package/dist/web-server/app.d.ts.map +1 -1
- package/dist/web-server/app.js +0 -3
- package/dist/web-server/app.js.map +1 -1
- package/dist/web-server/routes/hook-events.d.ts +6 -7
- package/dist/web-server/routes/hook-events.d.ts.map +1 -1
- package/dist/web-server/routes/hook-events.js +18 -22
- package/dist/web-server/routes/hook-events.js.map +1 -1
- package/dist/web-server/routes/sessions.d.ts +6 -8
- package/dist/web-server/routes/sessions.d.ts.map +1 -1
- package/dist/web-server/routes/sessions.js +27 -137
- package/dist/web-server/routes/sessions.js.map +1 -1
- package/opencode/arcs/bundle-runtime.json +0 -3
- package/opencode/arcs/manifest.json +8 -25
- package/opencode/arcs/prompts/arcs-docs.txt +19 -157
- package/opencode/arcs/prompts/arcs-flash.txt +49 -152
- package/opencode/arcs/prompts/arcs-orchestrate-caveman.txt +47 -165
- package/opencode/arcs/prompts/arcs-orchestrate.txt +46 -158
- package/opencode/arcs/prompts/code-reviewer.txt +20 -60
- package/opencode/arcs/prompts/graph-explorer.txt +19 -49
- package/opencode/arcs/prompts/software-engineer.txt +21 -67
- package/opencode/arcs/prompts/tech-architect.txt +20 -130
- package/opencode/arcs/skills/brainstorming/SKILL.md +20 -100
- package/opencode/arcs/skills/brainstorming/visual-companion.md +6 -264
- package/opencode/arcs/skills/caveman-commit/SKILL.md +6 -43
- package/opencode/arcs/skills/deep-pr-review/SKILL.md +18 -200
- package/opencode/arcs/skills/deep-pr-review/codegraph-diff.md +7 -93
- package/opencode/arcs/skills/deep-pr-review/review-template.md +13 -60
- package/opencode/arcs/skills/enriching-codegraph-proposals/SKILL.md +16 -156
- package/opencode/arcs/skills/implementation/SKILL.md +20 -46
- package/opencode/arcs/skills/init-project/SKILL.md +12 -150
- package/opencode/arcs/skills/install-claude-code-hook/SKILL.md +13 -133
- package/opencode/arcs/skills/systematic-debugging/SKILL.md +13 -152
- package/opencode/arcs/skills/systematic-debugging/condition-based-waiting.md +7 -110
- package/opencode/arcs/skills/systematic-debugging/defense-in-depth.md +7 -119
- package/opencode/arcs/skills/systematic-debugging/phases-reference.md +9 -166
- package/opencode/arcs/skills/systematic-debugging/root-cause-tracing.md +8 -165
- package/opencode/arcs/skills/test-driven-development/SKILL.md +10 -61
- package/opencode/arcs/skills/test-driven-development/tdd-rationalizations-and-examples.md +7 -154
- package/opencode/arcs/skills/test-driven-development/testing-anti-patterns.md +8 -295
- package/opencode/arcs/skills/to-diagram/SKILL.md +18 -206
- package/opencode/arcs/skills/writing-knowledge/SKILL.md +11 -63
- package/opencode/arcs/skills/writing-plans/SKILL.md +25 -118
- package/opencode/arcs/skills/writing-plans/plan-document-reviewer-prompt.md +10 -61
- package/package.json +1 -1
- package/scripts/claude-code-session-hook.mjs +16 -41
- package/skills/explore-dag.md +9 -52
- package/skills/init-project.md +9 -98
- package/skills/orchestrate.md +15 -109
- package/skills/update-docs.md +9 -60
- package/dist/web-client/assets/architecture-TIHT7OUA-Bt2-DmfV.js +0 -1
- package/dist/web-client/assets/channel-C2mb9np_.js +0 -1
- package/dist/web-client/assets/classDiagram-OUVF2IWQ-CPd_w3Zr.js +0 -1
- package/dist/web-client/assets/classDiagram-v2-EOCWNBFH-CPd_w3Zr.js +0 -1
- package/dist/web-client/assets/eventmodeling-45OFAUF4-CTKRC2Yj.js +0 -1
- package/dist/web-client/assets/flowDiagram-23GEKE2U-CaZjFyU1.js +0 -1
- package/dist/web-client/assets/railroad-abnf-AHOZXSZD-DnGh6x2O.js +0 -1
- package/dist/web-client/assets/railroad-ebnf-EBAXGLYW-CGfgCoaE.js +0 -1
- package/dist/web-client/assets/railroad-peg-LSFZ7HO6-BzQxYdqp.js +0 -1
- package/dist/web-client/assets/stateDiagram-v2-6OUMAXLB-hcBqlOLc.js +0 -1
- package/dist/web-client/assets/swimlanesDiagram-G3AALYLV-DbSrPBYr.js +0 -8
- package/dist/web-server/opencode-client.d.ts +0 -123
- package/dist/web-server/opencode-client.d.ts.map +0 -1
- package/dist/web-server/opencode-client.js +0 -514
- package/dist/web-server/opencode-client.js.map +0 -1
- package/opencode/arcs/prompts/devil-advocate.txt +0 -79
- package/opencode/arcs/skills/executing-plans/SKILL.md +0 -49
|
@@ -1,96 +1,10 @@
|
|
|
1
|
-
# Codegraph Diff
|
|
1
|
+
# Optional Codegraph Diff Analysis
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use the cached PR diff from the parent review; never fetch a second diff.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
1. Extract changed symbols and files from the cached diff.
|
|
6
|
+
2. Query codegraph impact, callers, callees, or exploration only for material boundaries.
|
|
7
|
+
3. Check whether callers, public contracts, or high-coupling modules are omitted from tests or migration notes.
|
|
8
|
+
4. Return concise evidence-linked risks to the parent review.
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
which codegraph || echo "skip" # graceful absence
|
|
11
|
-
codegraph status --json 2>/dev/null # index must exist + be initialized
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
If codegraph is missing or the index is stale relative to the PR's base commit, refresh:
|
|
15
|
-
```bash
|
|
16
|
-
codegraph sync . # incremental; or `codegraph index . --force` for a full rebuild
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
The index lives in `.codegraph/` (SQLite, gitignored) — there is no `graph.json` file.
|
|
20
|
-
|
|
21
|
-
## Step 1: Extract changed symbols from the diff
|
|
22
|
-
|
|
23
|
-
Parse the cached `DIFF` snapshot (optionally materialized as `/tmp/pr.diff`) to extract changed symbols:
|
|
24
|
-
- For each `+++ b/<file>` hunk, capture the file path
|
|
25
|
-
- For each added / modified function or exported identifier, capture `<symbol>` (codegraph addresses symbols by name, not `<file>::<symbol>`)
|
|
26
|
-
- Skip pure deletions (handled separately under "removed coupling" check)
|
|
27
|
-
|
|
28
|
-
Heuristic for symbol extraction (language-aware):
|
|
29
|
-
- TypeScript / JavaScript: `function X`, `class X`, `export const X`, `export function X`, `const X = `
|
|
30
|
-
- Python: `def X`, `class X`
|
|
31
|
-
- Go: `func X`, `type X`
|
|
32
|
-
- Rust: `fn X`, `struct X`, `impl X`
|
|
33
|
-
- Other: fall back to file-level granularity
|
|
34
|
-
|
|
35
|
-
## Step 2: Run `impact` per changed symbol
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
codegraph impact "<symbol>" --json # what code is affected by changing this symbol
|
|
39
|
-
codegraph callers "<symbol>" --json # direct callers (one hop)
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
`codegraph impact` is the closest equivalent to the old `affected --depth N`: it walks the reverse-dependency closure for a symbol. Use `callers` for a precise one-hop view when `impact` is too broad.
|
|
43
|
-
|
|
44
|
-
Collect for each symbol:
|
|
45
|
-
- **Fan-out callers** — who depends on this symbol (changes ripple here), from `callers` / `impact`
|
|
46
|
-
- **Fan-out reach** — size of the impact set (proxy for blast radius)
|
|
47
|
-
- **Cross-module edges** — callers in different top-level dirs (derive from each caller's `file_path`)
|
|
48
|
-
|
|
49
|
-
## Step 3: Detect surprising fan-out
|
|
50
|
-
|
|
51
|
-
Flag as 🟠 **risk** in the report when:
|
|
52
|
-
|
|
53
|
-
| Pattern | Meaning |
|
|
54
|
-
|---------|---------|
|
|
55
|
-
| Changed symbol has >10 callers across >3 modules | Wide blast radius — non-obvious from diff alone |
|
|
56
|
-
| Changed signature on a symbol with >5 callers | Breaking-change risk |
|
|
57
|
-
| New symbol has same name as existing symbol in another module | Naming collision risk → DRY check |
|
|
58
|
-
|
|
59
|
-
## Step 4: Duplication check
|
|
60
|
-
|
|
61
|
-
For each new function added in the diff, run:
|
|
62
|
-
```bash
|
|
63
|
-
codegraph query "<new-symbol-name or signature keywords>" --json
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
`codegraph query` is a symbol search over the index. If results include symbols with similar names/signatures (≥70% name overlap or matching parameter shape), flag as 🟡 **suggestion** with citation `codegraph: similar to <existing-symbol>` and propose extraction or reuse.
|
|
67
|
-
|
|
68
|
-
## Step 5: Aggregate findings
|
|
69
|
-
|
|
70
|
-
Each codegraph-derived finding must include:
|
|
71
|
-
- The `codegraph` command that produced it (for reproducibility)
|
|
72
|
-
- The cited symbol(s) — use backticks
|
|
73
|
-
- The cited module path(s)
|
|
74
|
-
- A finding ID for re-review tracking: `<file>:<line>:<dimension>:<short-hash>`
|
|
75
|
-
|
|
76
|
-
## Performance bounds
|
|
77
|
-
|
|
78
|
-
- Cap symbols analyzed per PR at 50. If diff contains more, sample by:
|
|
79
|
-
- All exported / public symbols first (always)
|
|
80
|
-
- Then internal symbols by descending hunk size
|
|
81
|
-
- Skip step 4 (duplication) entirely if diff size exceeds 1500 LOC — too noisy
|
|
82
|
-
|
|
83
|
-
## Graceful degradation
|
|
84
|
-
|
|
85
|
-
If any codegraph call fails or returns empty:
|
|
86
|
-
- Note in report: `Codegraph step <N> unavailable: <reason>` under "Cleared Dimensions"
|
|
87
|
-
- Continue with the remaining dimensions
|
|
88
|
-
- Never let a codegraph failure abort the review
|
|
89
|
-
|
|
90
|
-
## Output integration
|
|
91
|
-
|
|
92
|
-
Codegraph findings flow back into the standard finding pipeline. Each one is:
|
|
93
|
-
- Cited as `codegraph: <one-line observation>`
|
|
94
|
-
- Severity-classified (most are 🟡 suggestion or 🟠 risk; rarely 🔴)
|
|
95
|
-
- Attached to a specific file+line if possible; otherwise lives in the top-level review body
|
|
96
|
-
- Tagged for re-review with `<!-- arcs:deep-review:<finding-id> -->`
|
|
10
|
+
Skip this analysis when the index is absent or the diff is local and obvious.
|
|
@@ -1,69 +1,22 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Used as the `body` field of `gh api repos/{owner}/{repo}/pulls/{pull_number}/reviews` when posting. Inline comments live in the `comments[]` array; this is the top-level summary.
|
|
4
|
-
|
|
5
|
-
## Template
|
|
1
|
+
# Deep PR Review Template
|
|
6
2
|
|
|
7
3
|
```markdown
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
**Scope:** <N files, +X/-Y LOC, modules: <list>>
|
|
11
|
-
**Rubric:** <activated dimensions> — others cleared (not applicable)
|
|
12
|
-
**Posting mode:** <1-Critical-only | 2-Critical+actionable | 3-All | 4-Summary>
|
|
13
|
-
|
|
14
|
-
### Summary
|
|
15
|
-
<1-3 sentences: overall shape of the PR, biggest concern, what's well done>
|
|
4
|
+
# Review: <repo>#<number> — <title>
|
|
16
5
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- 🟠 <count> risk(s)
|
|
20
|
-
- 🟡 <count> suggestion(s)
|
|
21
|
-
- 🔵 <count> nit(s)
|
|
22
|
-
- ❓ <count> question(s)
|
|
6
|
+
## Scope
|
|
7
|
+
<files, change size, important boundaries>
|
|
23
8
|
|
|
24
|
-
|
|
9
|
+
## Findings
|
|
10
|
+
- [severity] <file>:L<line> — <problem, consequence, fix>
|
|
25
11
|
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
- [tech-architect] <reason — e.g. crosses 3 modules, touches god node X>
|
|
29
|
-
- [software-engineer, AGENT_MODE: incident, systematic-debugging] <reason — e.g. new query in render path>
|
|
12
|
+
## Cleared Risks
|
|
13
|
+
- <dimension>: <evidence>
|
|
30
14
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- knowledge/<id> — <what was checked>
|
|
34
|
-
- codegraph — <observations, if run>
|
|
15
|
+
## Confidence and Gaps
|
|
16
|
+
<what was and was not verified>
|
|
35
17
|
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
## Posting
|
|
19
|
+
<mode and exact payload, or not posting>
|
|
38
20
|
```
|
|
39
21
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- **Posting mode** field is informational for the author — they see what severity threshold was applied
|
|
43
|
-
- Findings counts are **as posted**, not as found. Mode 1 with 4 nits found shows `🔵 0 nit(s)` — those were dropped
|
|
44
|
-
- Architectural / Performance Handoffs section is omitted entirely if no handoffs (don't show empty headings)
|
|
45
|
-
- The trailing HTML comment is mandatory — used by re-review detection to find prior AI reviews
|
|
46
|
-
|
|
47
|
-
## Inline comment template (per finding)
|
|
48
|
-
|
|
49
|
-
```markdown
|
|
50
|
-
<severity-emoji> <severity>: <one-line problem>. <one-line fix>.
|
|
51
|
-
|
|
52
|
-
<optional 1-2 sentences of why, only if not obvious from problem>
|
|
53
|
-
|
|
54
|
-
Citation: <AGENTS.md §x | knowledge/<id> | codegraph | principle: <name>>
|
|
55
|
-
|
|
56
|
-
```suggestion
|
|
57
|
-
<replacement code — only for small line replacements>
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
<!-- arcs:deep-review:<finding-id> -->
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## Approve-with-comments override
|
|
64
|
-
|
|
65
|
-
If the user explicitly says "approve" / "lgtm" / "post approve":
|
|
66
|
-
- Set `event: "APPROVE"` on the review API call
|
|
67
|
-
- Top-level body must still list any 🟡 / 🔵 findings as advisory notes
|
|
68
|
-
- Append to body: `**Approved with <N> non-blocking suggestion(s).**`
|
|
69
|
-
- Never auto-elevate to APPROVE without explicit user phrase
|
|
22
|
+
Escalate architecture questions to `tech-architect`. Escalate performance incidents to `software-engineer` incident work with `systematic-debugging`. Posting still requires explicit confirmation.
|
|
@@ -1,169 +1,29 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: enriching-codegraph-proposals
|
|
3
|
-
description:
|
|
3
|
+
description: Triage pending codegraph proposals into useful project knowledge
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Enrich Codegraph Proposals
|
|
7
7
|
|
|
8
8
|
## When
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Use when init or codegraph sync reports `pending_enrichment: true`, or when the user asks to process the proposal queue.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
- `arcs codegraph-sync` returned `pending_enrichment: true`.
|
|
14
|
-
- User said "enrich the proposals", "process the codegraph queue", "promote the pending proposals", or similar.
|
|
12
|
+
## Method
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
1. Run `arcs proposal list <slug>`.
|
|
15
|
+
2. Inspect the proposal's structural facts, source files, and likely duplicates.
|
|
16
|
+
3. Choose **keep**, **merge**, or **drop**:
|
|
17
|
+
- keep a distinct useful boundary grounded in real code;
|
|
18
|
+
- merge when an existing entry is the right home and the proposal adds evidence;
|
|
19
|
+
- drop tests-only, docs-only, tiny, stale, duplicate, or unsupported noise.
|
|
20
|
+
4. For keep or merge, author a human title, concise impact summary, substantive body, and source files.
|
|
21
|
+
5. Apply the requested promote/drop operation and continue until the useful queue is handled.
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
Source files and structural evidence must support every promoted claim. Never invent responsibilities from names alone. Preserve proposal IDs and give a reason for drops. Cap source files to the most useful anchors when the raw list is large.
|
|
19
24
|
|
|
20
|
-
|
|
21
|
-
flowchart TD
|
|
22
|
-
classDef decision fill:#f59e0b,color:#fff
|
|
23
|
-
classDef terminal fill:#22c55e,color:#fff
|
|
25
|
+
Use `--body-file` for long bodies. Stop and report races or missing merge targets rather than silently changing the decision.
|
|
24
26
|
|
|
25
|
-
|
|
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[Propose drop command + 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[Propose merge command]
|
|
35
|
-
G --> K[Propose promote command]
|
|
36
|
-
F --> L{Budget left?}
|
|
37
|
-
J --> L
|
|
38
|
-
K --> L
|
|
39
|
-
L -->|Yes & proposals remain| C
|
|
40
|
-
L -->|No or empty| Done
|
|
27
|
+
## Return
|
|
41
28
|
|
|
42
|
-
|
|
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
|
-
Propose `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
|
-
Propose `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 codegraph 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-triage early.** Proposing drops for obvious noise in one pass 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
|
-
| Proposed merge target no longer exists at apply time | Orchestrator rejects it; return for re-audit rather than changing the command during apply. |
|
|
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 disappears before return | Re-list read-only, omit it, and report the race. |
|
|
126
|
-
| Proposed entry would miss graph edges | Verify `--source-files` is present 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 proposed promote is one decision and one command. Bulk promotion bypasses dedup checks and per-proposal review.
|
|
136
|
-
- **Preserve proposal IDs in 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. PROPOSED_MUTATIONS: drop obvious noise
|
|
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. PROPOSED_MUTATIONS: 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. PROPOSED_MUTATIONS: 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
|
-
# Return these commands without executing them; the orchestrator applies approved mutations.
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
## Exit
|
|
168
|
-
|
|
169
|
-
Return `PROPOSED_MUTATIONS:` with one stable proposal ID, verdict, rationale, and exact command per item. Do not execute `arcs knowledge upsert` or proposal mutations. Surface a one-line summary to the orchestrator: proposed keeps N, merges M, drops K, deferred D.
|
|
29
|
+
Report counts and IDs for kept, merged, dropped, and deferred proposals, plus created or updated knowledge IDs.
|
|
@@ -1,61 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implementation
|
|
3
|
-
description:
|
|
3
|
+
description: Inspect, edit, verify, or execute a ready plan node
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Implementation
|
|
7
7
|
|
|
8
|
-
## Work
|
|
8
|
+
## Work Modes
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
`bounded`, `inspect`, and `plan-node` are hints, not lifecycle gates:
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
- **bounded:** the requested files and behavior are already clear; start directly.
|
|
13
|
+
- **inspect:** inspect the smallest repository surface needed to resolve implementation details.
|
|
14
|
+
- **plan-node:** check declared dependencies, execute the current ready node within its scope, run relevant verification, and align task and diagram state through the ARCS CLI. Never edit DAG files or diagrams directly, execute a blocked node, or absorb an adjacent outcome.
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
In any mode, ask only when evidence cannot resolve a change to the goal, material scope, dependency strategy, or risk.
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
- Read only the dispatched files and context needed to make the change.
|
|
18
|
-
- If a material decision or hidden scope appears, stop and return `STATUS: blocked`; do not guess or switch modes.
|
|
18
|
+
## Method
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
1. Inspect relevant code and tests.
|
|
21
|
+
2. Reuse existing patterns and dependencies.
|
|
22
|
+
3. Edit the minimum code needed for a complete result.
|
|
23
|
+
4. Add proportionate tests for changed behavior.
|
|
24
|
+
5. Verify with targeted checks; use broader checks for broad or high-risk work.
|
|
25
|
+
6. If verification fails, fix failures caused by the change and rerun the relevant check.
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
For `plan-node`, read the current node metadata, confirm every predecessor is done, and use ARCS CLI task and diagram commands to keep completion state aligned. If dependencies are unmet or the node conflicts with its scope, stop with the concrete blocker instead of selecting other work.
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
2. Infer the answer when tools or established conventions make it clear.
|
|
26
|
-
3. Ask at most one targeted user question, and only for a material decision that is not tool-resolvable.
|
|
27
|
-
4. If uncertainty is design-shaping or scope expands, stop and return `STATUS: blocked` rather than improvising.
|
|
29
|
+
Prefer necessity → standard library → platform capability → installed dependency → minimum custom code. Do not simplify away security, accessibility, validation, error handling, or data-loss protection.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
Do not commit, push, deploy, or modify unrelated files without an explicit request.
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
## Return
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
2. **Standard library** — use it when it correctly covers the need.
|
|
35
|
-
3. **Native platform** — prefer a built-in platform capability.
|
|
36
|
-
4. **Installed dependency** — reuse one before adding code or a dependency.
|
|
37
|
-
5. **Minimum code** — write only the smallest correct implementation.
|
|
38
|
-
|
|
39
|
-
Do not introduce abstractions, configuration, scaffolding, or dependencies for hypothetical consumers. Minimal does not mean flimsy: never simplify away security controls, accessibility basics, trust-boundary validation, or error handling that prevents data loss.
|
|
40
|
-
|
|
41
|
-
Mark every deliberate simplification with its known ceiling and concrete revisit trigger:
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
// SHORTCUT: <ceiling>, upgrade when <trigger>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Implementation And Verification
|
|
48
|
-
|
|
49
|
-
- Follow existing repository conventions and the dispatch SCOPE.
|
|
50
|
-
- Use test-driven-development when the dispatch requires it or when adding non-trivial behavior; structural changes may rely on existing focused contracts.
|
|
51
|
-
- Run exactly the dispatch VERIFY command, scoped to touched files. NEVER the full suite, project-wide lint, or full build.
|
|
52
|
-
- Fix failures in touched files and re-run VERIFY. Report failures originating outside SCOPE under `BLOCKED_BY`; do not edit those files.
|
|
53
|
-
- Never commit unless explicitly asked.
|
|
54
|
-
|
|
55
|
-
## Knowledge Exit
|
|
56
|
-
|
|
57
|
-
Knowledge is proposal-only. For a durable, non-obvious pattern or gotcha, return a substantive ready-to-run proposal for orchestrator persistence at fan-in; do not execute `arcs knowledge upsert` yourself. Skip mechanical or easily re-derived observations.
|
|
58
|
-
|
|
59
|
-
`arcs knowledge template --kind=<kind> --json`; `arcs knowledge upsert <slug> "<title>" --kind=<pattern|gotcha|lesson|architecture|decision> --summary="<summary>" --body="<substantive filled template>" --keywords="<keywords>" --source-files="<path[:anchor]>" --json`
|
|
60
|
-
|
|
61
|
-
Upsert is idempotent by title.
|
|
35
|
+
Report changed files, verification actually run, remaining risk, and blockers.
|
|
@@ -1,160 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: init-project
|
|
3
|
-
description:
|
|
3
|
+
description: Initialize a repository as an ARCS project with useful minimal metadata
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Initialize Project
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## Method
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
An explicit request to init or track a project authorizes the local ARCS initialization. Ask only for missing user-owned identity such as name, description, workspace path, or dependency choice.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
1. Check slug conflicts with `arcs project list`.
|
|
13
|
+
2. Verify named dependency projects exist.
|
|
14
|
+
3. Run `arcs project init` with the requested metadata.
|
|
15
|
+
4. Add only requested or clearly useful overview/dependency documentation.
|
|
16
|
+
5. Validate the new project and report its slug and paths.
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
Codegraph is optional. When available, initialization may index the workspace and emit structural proposals. When absent, continue without it. If `pending_enrichment` is true, process useful proposals with `enriching-codegraph-proposals`; do not require a broad agent fan-out.
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
flowchart TD
|
|
18
|
-
classDef sub fill:#8b5cf6,color:#fff
|
|
20
|
+
Raw proposals are not knowledge. Inspect them before keep, merge, drop, or promote decisions. Never infer destructive cleanup, deployment, publication, or Git permission from initialization.
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
B --> C[Present summary to user]
|
|
22
|
-
C -->|user confirms| D[arcs project init]
|
|
23
|
-
D --> E[arcs project update-doc × 4]
|
|
24
|
-
E --> F{codegraph on PATH?}
|
|
25
|
-
F -->|yes| G[codegraph index --force --quiet]
|
|
26
|
-
F -->|no| H[Skip graph step, log gap]
|
|
27
|
-
G --> G2[ingestGraph → ≤20 proposals]
|
|
28
|
-
G2 --> G3[Enrich queue: list → keep/merge/drop → promote/drop]
|
|
29
|
-
G3 --> I[Fan out: tech-architect analysis + research modes]:::sub
|
|
30
|
-
H --> I
|
|
31
|
-
I --> K[Done]
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## CLI Primer
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
arcs project init "Foo" --description="..." --path="$(pwd)" --json
|
|
38
|
-
```
|
|
39
|
-
Discovery: `arcs --commands --json`. Mutating commands run directly — no token.
|
|
40
|
-
|
|
41
|
-
## Constraints
|
|
42
|
-
|
|
43
|
-
- Do NOT read repo to infer name/description — gather from user
|
|
44
|
-
- Verify `dependsOn` targets exist via `arcs project list --json`
|
|
45
|
-
- `arcs project init` creates empty `plans/`, `knowledge/`, `tasks/` indexes — don't pre-populate
|
|
46
|
-
- Repo analysis is **fan-out across typed agents**, never a generic "analysis sub-agent" (see Agent Dispatch below)
|
|
47
|
-
- Never block INIT on codegraph — it's optional. Skip cleanly if missing.
|
|
48
|
-
|
|
49
|
-
## Codegraph Sub-Flow (DEFAULT: ON when binary present)
|
|
50
|
-
|
|
51
|
-
The orchestrator runs codegraph 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-codegraph-proposals` skill. This is the default path when `codegraph` is on PATH; skip cleanly otherwise.
|
|
52
|
-
|
|
53
|
-
1. **Detect:** call `detectCodegraph()` from `src/utils/codegraph.ts`. If unavailable, log "codegraph not on PATH; proceeding without graph signal" and skip steps 3–6.
|
|
54
|
-
2. **Trust the gitignore guarantee:** `runIndex()` already auto-appends `.codegraph/` to `.gitignore` via `ensureGitignoreEntry`. Do NOT redundantly check or modify `.gitignore` from agents — running the index is sufficient.
|
|
55
|
-
3. **Index** (project-based; CLI drives the bundled runtime — no LLM API key required):
|
|
56
|
-
```bash
|
|
57
|
-
codegraph index <workspacePath> --force --quiet
|
|
58
|
-
```
|
|
59
|
-
Builds a per-project codegraph index under `<workspacePath>/.codegraph/`.
|
|
60
|
-
4. **Ingest as proposals:** `arcs project init` internally calls `ingestGraph(slug)`, which parses codegraph CLI `--json` output and writes up to 20 structural proposals to `proposals/graphify.json` (filename retained for compatibility; rename pending; test files filtered):
|
|
61
|
-
- 8 god nodes (`kind=module`, ranked by callers+callees / impact as a proxy for degree)
|
|
62
|
-
- 8 architecture clusters (`kind=architecture`, synthesized pseudo-communities by directory prefix — codegraph has no community/cluster export)
|
|
63
|
-
- 5 cross-module couplings (`kind=gotcha`, high-degree links across top-level dirs; relations hard-coded as `["calls"]`)
|
|
64
|
-
|
|
65
|
-
Codegraph never writes directly to the knowledge surface. The init envelope returns `data.codegraph.pending_enrichment: true` to signal that proposals are waiting.
|
|
66
|
-
5. **Enrich** with the `enriching-codegraph-proposals` skill — read `arcs proposal list <slug> --json`, decide per-proposal verdicts (keep / merge / drop), and return exact proposed promote/drop commands for orchestrator application. Pending codegraph proposals never bypass this lifecycle into knowledge.
|
|
67
|
-
6. **Optional graph queries** for evidence during enrichment (sub-agents may run these via the codegraph MCP server, which auto-syncs through its own file watcher):
|
|
68
|
-
- `codegraph_search "entry points and main commands"` → seeds for "key files" reference entries
|
|
69
|
-
- `codegraph_explore` on core modules → seeds for "core modules" entries
|
|
70
|
-
- `codegraph_node "<godNodeLabel>"` → structural summary for module entry bodies
|
|
71
|
-
- `codegraph_impact "<critical-symbol>"` → reverse-impact map for high-risk modules
|
|
72
|
-
- `codegraph_callers` / `codegraph_callees "<symbol>"` → dependency paths for architecture entries
|
|
73
|
-
7. **Hand to typed agents** (in parallel) for independently authored, code-grounded follow-up entries beyond the proposal queue — see **Agent Dispatch** below.
|
|
74
|
-
|
|
75
|
-
## Content Guidelines
|
|
76
|
-
|
|
77
|
-
| Doc | Format |
|
|
78
|
-
|-----|--------|
|
|
79
|
-
| `overview.md` | 2-3 sentence summary + goals |
|
|
80
|
-
| `tasks.md` | `[ ]` backlog / `[/]` in-progress / `[x]` done |
|
|
81
|
-
| `dependencies.md` | Upstream + downstream sections |
|
|
82
|
-
| `knowledge.md` | High-level context + pointers to structured entries |
|
|
83
|
-
|
|
84
|
-
Update via `arcs project update-doc <slug> <doc> --content="..."`.
|
|
85
|
-
|
|
86
|
-
## Agent Dispatch (named typed agents — DO NOT default to a generic analysis agent)
|
|
87
|
-
|
|
88
|
-
| Sub-agent | Owns | Knowledge kinds it produces |
|
|
89
|
-
|-----------|------|----------------------------|
|
|
90
|
-
| `tech-architect` (analysis mode) | Module boundaries, clusters, dependency direction, cross-module couplings, structural gotchas, lessons | `architecture`, `module`, `gotcha`, `lesson` |
|
|
91
|
-
| `tech-architect` (`AGENT_MODE: research`) | Tech stack, third-party libraries, key files, features | `reference`, `feature` |
|
|
92
|
-
| `code-reviewer` (audit mode, optional) | Coding-style + convention scan from existing code | `pattern` |
|
|
93
|
-
|
|
94
|
-
Dispatch in parallel — all agents in one message, per the orchestrator's Parallelism rules. Each agent receives:
|
|
95
|
-
- The relevant `KnowledgeProposal` records from `ingestGraph` (so they don't rediscover what codegraph already found)
|
|
96
|
-
- Targeted codegraph queries for evidence (e.g., `codegraph_node` / `codegraph_impact` output for the modules they own)
|
|
97
|
-
- Explicit scope (which files / which kinds to produce)
|
|
98
|
-
|
|
99
|
-
Raw `KnowledgeProposal` records stay in the proposal lifecycle above. Each typed agent may instead return an independently authored finding: `{title, kind, summary, keywords, sourceFiles, body}`. Workers do not execute `arcs knowledge upsert`; after deduplication they return substantive ready-to-run commands for orchestrator fan-in persistence.
|
|
100
|
-
|
|
101
|
-
## Knowledge Categories for Analysis Sub-Agents
|
|
102
|
-
|
|
103
|
-
| Category | Kind | What to discover | Primary agent |
|
|
104
|
-
|----------|------|------------------|---------------|
|
|
105
|
-
| tech stack | `architecture` | Languages, frameworks, runtimes, build tools, versions | `tech-architect` (`AGENT_MODE: research`) |
|
|
106
|
-
| key files | `reference` | Entry points, config files, main modules, purposes | `tech-architect` (`AGENT_MODE: research`; use `codegraph_search "entry points"`) |
|
|
107
|
-
| code patterns | `pattern` | Recurring design patterns, abstractions, error handling | `code-reviewer` (audit mode) or `tech-architect` |
|
|
108
|
-
| coding style | `pattern` | Formatting, linting, import ordering, file organization | `code-reviewer` (audit mode) |
|
|
109
|
-
| core modules | `module` | Core modules / shared functions — what, where, interconnections | `tech-architect` (god nodes from codegraph) |
|
|
110
|
-
| external services | `module` | APIs, databases, message queues the project interacts with | `tech-architect` (`AGENT_MODE: research`) |
|
|
111
|
-
| third-party libraries | `reference` | Key dependencies and why they are used | `tech-architect` (`AGENT_MODE: research`) |
|
|
112
|
-
| features | `feature` | Major user-facing or system-facing features | `tech-architect` (`AGENT_MODE: research`) |
|
|
113
|
-
| cross-module couplings | `gotcha` | Hot edges between modules surfaced by codegraph | `tech-architect` (auto from `ingestGraph`) |
|
|
114
|
-
| architecture clusters | `architecture` | Pseudo-community / directory groupings from codegraph | `tech-architect` (auto from `ingestGraph`) |
|
|
115
|
-
|
|
116
|
-
## Worked Example
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
# 1. Conflict check
|
|
120
|
-
arcs project list --json
|
|
121
|
-
|
|
122
|
-
# 2. Present summary to user; on confirmation, init
|
|
123
|
-
arcs project init "Foo" --description="Foo CLI tool" --path="$(pwd)" --json
|
|
124
|
-
|
|
125
|
-
# 3. Update docs
|
|
126
|
-
arcs project update-doc foo overview --content="..." --json
|
|
127
|
-
# ... repeat for tasks, dependencies, knowledge
|
|
128
|
-
|
|
129
|
-
# 4. Codegraph (if available) — runs inside `arcs project init`
|
|
130
|
-
codegraph index . --force --quiet
|
|
131
|
-
# ingestGraph parses codegraph CLI --json → proposals/graphify.json (filename retained; rename pending)
|
|
132
|
-
# init envelope: data.codegraph.pending_enrichment === true → load
|
|
133
|
-
# `enriching-codegraph-proposals` and run the verdict loop:
|
|
134
|
-
arcs proposal list foo --json
|
|
135
|
-
# keep: promote only after authoring the required title, summary, body, and source files
|
|
136
|
-
arcs proposal promote foo <id> --title="..." --summary="..." --body-file=... --kind=module --source-files=... --json
|
|
137
|
-
# merge: promote with --merge-with=<existing-knowledge-id> and append graph evidence
|
|
138
|
-
arcs proposal promote foo <id> --merge-with=<existing-knowledge-id> --body-file=... --source-files=... --json
|
|
139
|
-
arcs proposal drop foo <id> --reason="..." --json
|
|
140
|
-
|
|
141
|
-
# 5. Fan out typed agents (parallel) for entries beyond proposal scope
|
|
142
|
-
# tech-architect (analysis mode) → architecture/module/gotcha/lesson entries
|
|
143
|
-
# tech-architect (AGENT_MODE: research) → reference/feature entries
|
|
144
|
-
|
|
145
|
-
# 6. Propose only independently authored, non-proposal-derived findings.
|
|
146
|
-
# Obtain the kind-specific body anatomy before authoring the ready-to-run command:
|
|
147
|
-
arcs knowledge template --kind=architecture --json
|
|
148
|
-
arcs knowledge upsert foo "Tech stack: TypeScript + Node 20" --kind=architecture --summary="..." --body-file=... --source-files=package.json --json
|
|
149
|
-
# Return the upsert; do not execute it. The orchestrator persists it at fan-in.
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
## Exit Conditions
|
|
153
|
-
|
|
154
|
-
| Condition | Action |
|
|
155
|
-
|-----------|--------|
|
|
156
|
-
| Project already in DAG (slug collision) | Stop. Surface conflict; ask user to rename or use existing |
|
|
157
|
-
| User declines summary | Stop. No mutations performed |
|
|
158
|
-
| `codegraph` missing | Continue without graph signal; sub-agents run with code reading only |
|
|
159
|
-
| `dependsOn` target missing | Stop. Ask user to init dependencies first or remove the link |
|
|
160
|
-
| Init succeeds but knowledge fan-out fails | Project exists in DAG; rerun knowledge phase later via SYNC |
|
|
22
|
+
If a write fails, stop and report partial state instead of layering more mutations on an uncertain project.
|