@magic-spells/constellation 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/README.md +13 -6
  2. package/constellation/agent/AGENT-GUIDANCE.md +22 -0
  3. package/constellation/component/COMPONENT-EDITABLE.md +9 -0
  4. package/constellation/component/COMPONENT-STATUS-PILL.md +9 -0
  5. package/constellation/component/COMPONENT-SYNC-PILL.md +9 -0
  6. package/constellation/diagram/DIAGRAM-ARCHITECTURE.md +28 -0
  7. package/constellation/doc/DOC-CARD-TYPES.md +36 -0
  8. package/constellation/doc/DOC-CHANGE-TRACKING.md +26 -0
  9. package/constellation/doc/DOC-CONNECTED-REPOS.md +25 -0
  10. package/constellation/doc/DOC-DIAGRAMS.md +22 -0
  11. package/constellation/doc/DOC-FILE-FORMAT.md +54 -0
  12. package/constellation/doc/DOC-LINT-CODES.md +35 -0
  13. package/constellation/doc/DOC-MCP-SERVER.md +59 -0
  14. package/constellation/doc/DOC-MCP-UPGRADES.md +56 -0
  15. package/constellation/external/EXTERNAL-AJV.md +7 -0
  16. package/constellation/external/EXTERNAL-GIT.md +7 -0
  17. package/constellation/external/EXTERNAL-GRAY-MATTER.md +7 -0
  18. package/constellation/external/EXTERNAL-MCP-SDK.md +7 -0
  19. package/constellation/external/EXTERNAL-ZOD.md +7 -0
  20. package/constellation/file/FILE-CLI.md +9 -0
  21. package/constellation/file/FILE-CODE.md +9 -0
  22. package/constellation/file/FILE-EXTRACT.md +9 -0
  23. package/constellation/file/FILE-GIT.md +9 -0
  24. package/constellation/file/FILE-HANDLES.md +9 -0
  25. package/constellation/file/FILE-INDEXER.md +11 -0
  26. package/constellation/file/FILE-LINT.md +9 -0
  27. package/constellation/file/FILE-MCP-SEARCH.md +12 -0
  28. package/constellation/file/FILE-MCP-SERVER.md +9 -0
  29. package/constellation/file/FILE-PARSE.md +9 -0
  30. package/constellation/file/FILE-RENAME.md +18 -0
  31. package/constellation/file/FILE-REPOS.md +9 -0
  32. package/constellation/file/FILE-RESOLVE.md +9 -0
  33. package/constellation/file/FILE-SCAFFOLD.md +12 -0
  34. package/constellation/file/FILE-SERVE.md +9 -0
  35. package/constellation/file/FILE-SYNC.md +9 -0
  36. package/constellation/file/FILE-TYPES.md +9 -0
  37. package/constellation/file/FILE-VALIDATE.md +11 -0
  38. package/constellation/file/FILE-WRITER.md +11 -0
  39. package/constellation/flow/FLOW-DRIFT-DETECT.md +11 -0
  40. package/constellation/flow/FLOW-LINT-PIPELINE.md +14 -0
  41. package/constellation/flow/FLOW-SYNC-PLAN.md +13 -0
  42. package/constellation/page/PAGE-VIEWER-CARD.md +9 -0
  43. package/constellation/page/PAGE-VIEWER-HOME.md +9 -0
  44. package/constellation/plan.md +59 -0
  45. package/constellation/test/TEST-SUITE.md +9 -0
  46. package/dist/cli/index.js +37 -0
  47. package/dist/cli/index.js.map +1 -1
  48. package/dist/core/code.d.ts +4 -2
  49. package/dist/core/code.js +22 -7
  50. package/dist/core/code.js.map +1 -1
  51. package/dist/core/git.d.ts +2 -0
  52. package/dist/core/git.js +6 -0
  53. package/dist/core/git.js.map +1 -1
  54. package/dist/core/rename.d.ts +24 -0
  55. package/dist/core/rename.js +72 -0
  56. package/dist/core/rename.js.map +1 -0
  57. package/dist/core/repos.d.ts +2 -0
  58. package/dist/core/repos.js +5 -1
  59. package/dist/core/repos.js.map +1 -1
  60. package/dist/core/sync.d.ts +2 -0
  61. package/dist/core/sync.js +3 -1
  62. package/dist/core/sync.js.map +1 -1
  63. package/dist/core/validate.js +14 -1
  64. package/dist/core/validate.js.map +1 -1
  65. package/dist/core/writer.d.ts +29 -0
  66. package/dist/core/writer.js +98 -3
  67. package/dist/core/writer.js.map +1 -1
  68. package/dist/mcp/search.d.ts +2 -2
  69. package/dist/mcp/search.js +27 -5
  70. package/dist/mcp/search.js.map +1 -1
  71. package/dist/mcp/server.js +300 -99
  72. package/dist/mcp/server.js.map +1 -1
  73. package/dist/serve/server.js +6 -7
  74. package/dist/serve/server.js.map +1 -1
  75. package/package.json +2 -2
  76. package/skill/SKILL.md +11 -5
  77. package/skill/methodology.md +6 -2
  78. package/viewer/dist/assets/{arc-YuzGWkw8.js → arc-ByV7p1fN.js} +1 -1
  79. package/viewer/dist/assets/architecture-7EHR7CIX-FCXXAu3O.js +1 -0
  80. package/viewer/dist/assets/{architectureDiagram-3BPJPVTR-BgksqMlF.js → architectureDiagram-3BPJPVTR-CMawC2nt.js} +1 -1
  81. package/viewer/dist/assets/{blockDiagram-GPEHLZMM-Bc6JILFK.js → blockDiagram-GPEHLZMM-Bp0MKYXV.js} +1 -1
  82. package/viewer/dist/assets/{c4Diagram-AAUBKEIU-CRVt42df.js → c4Diagram-AAUBKEIU-BLCX9gmN.js} +1 -1
  83. package/viewer/dist/assets/channel-GJMBi5UK.js +1 -0
  84. package/viewer/dist/assets/{chunk-2J33WTMH-CpuwKeX6.js → chunk-2J33WTMH-C6iOidst.js} +1 -1
  85. package/viewer/dist/assets/{chunk-3OPIFGDE-BG_ijJhE.js → chunk-3OPIFGDE-B9xItVw4.js} +1 -1
  86. package/viewer/dist/assets/{chunk-4BX2VUAB-Bgz1tnDP.js → chunk-4BX2VUAB-Bl0HWb9B.js} +1 -1
  87. package/viewer/dist/assets/{chunk-55IACEB6-NdWURd2K.js → chunk-55IACEB6-BYilo1WJ.js} +1 -1
  88. package/viewer/dist/assets/{chunk-5ZQYHXKU-wzW5x_7z.js → chunk-5ZQYHXKU-DOCnP8P8.js} +1 -1
  89. package/viewer/dist/assets/{chunk-727SXJPM-BxKeJXYf.js → chunk-727SXJPM-D9YKAzha.js} +1 -1
  90. package/viewer/dist/assets/{chunk-AQP2D5EJ-gPm6xhPX.js → chunk-AQP2D5EJ-B1KE4h_b.js} +1 -1
  91. package/viewer/dist/assets/{chunk-BSJP7CBP-C30ZXEUD.js → chunk-BSJP7CBP-DA3pfXCw.js} +1 -1
  92. package/viewer/dist/assets/{chunk-CSCIHK7Q-C9h7yfl1.js → chunk-CSCIHK7Q-Bv0Fa0Zn.js} +6 -6
  93. package/viewer/dist/assets/{chunk-FMBD7UC4-BcSnkYc3.js → chunk-FMBD7UC4-k-EzzpU2.js} +1 -1
  94. package/viewer/dist/assets/{chunk-KSCS5N6A-rxSD5-MD.js → chunk-KSCS5N6A-CUTkv0jR.js} +1 -1
  95. package/viewer/dist/assets/{chunk-L5ZTLDWV-DGwFsVWy.js → chunk-L5ZTLDWV-C_SwE6oB.js} +1 -1
  96. package/viewer/dist/assets/{chunk-LZXEDZCA-BY3sTuvt.js → chunk-LZXEDZCA-DtwqVIDt.js} +2 -2
  97. package/viewer/dist/assets/{chunk-ND2GUHAM-PqmKwdzq.js → chunk-ND2GUHAM-JJiAqLG2.js} +1 -1
  98. package/viewer/dist/assets/{chunk-NZK2D7GU-BAZbzxhl.js → chunk-NZK2D7GU-BQ8Dn7FA.js} +1 -1
  99. package/viewer/dist/assets/{chunk-O5CBEL6O-SvZfZ-0j.js → chunk-O5CBEL6O-BRpqOJ1I.js} +1 -1
  100. package/viewer/dist/assets/chunk-QZHKN3VN-DA8qsAVF.js +1 -0
  101. package/viewer/dist/assets/chunk-WU5MYG2G-Dp8LMm21.js +1 -0
  102. package/viewer/dist/assets/{chunk-XPW4576I-1OXPbRQX.js → chunk-XPW4576I-C1NcqPJd.js} +1 -1
  103. package/viewer/dist/assets/classDiagram-4FO5ZUOK-wnkp0LBB.js +1 -0
  104. package/viewer/dist/assets/classDiagram-v2-Q7XG4LA2-wnkp0LBB.js +1 -0
  105. package/viewer/dist/assets/{cose-bilkent-S5V4N54A-DtCvLpah.js → cose-bilkent-S5V4N54A-BsJFb39B.js} +1 -1
  106. package/viewer/dist/assets/{dagre-BM42HDAG-B55Ilz10.js → dagre-BM42HDAG-CRPovG4Q.js} +1 -1
  107. package/viewer/dist/assets/{diagram-2AECGRRQ-ClqSMarp.js → diagram-2AECGRRQ-D6GCKn1u.js} +1 -1
  108. package/viewer/dist/assets/{diagram-5GNKFQAL-Dx74UdxY.js → diagram-5GNKFQAL-CoHqKdf3.js} +1 -1
  109. package/viewer/dist/assets/{diagram-KO2AKTUF-Vj0buH8e.js → diagram-KO2AKTUF-BEkMb40X.js} +1 -1
  110. package/viewer/dist/assets/{diagram-LMA3HP47-DpEm8RZd.js → diagram-LMA3HP47-B6mfW9S2.js} +1 -1
  111. package/viewer/dist/assets/{diagram-OG6HWLK6-Crl3BdwC.js → diagram-OG6HWLK6-OBBkuJvR.js} +1 -1
  112. package/viewer/dist/assets/{dist-C2uHOEFB.js → dist-C4BxOpXa.js} +1 -1
  113. package/viewer/dist/assets/{erDiagram-TEJ5UH35-B-Mf-EHP.js → erDiagram-TEJ5UH35-C2i3TB2-.js} +1 -1
  114. package/viewer/dist/assets/eventmodeling-FCH6USID-CCZDiBK0.js +1 -0
  115. package/viewer/dist/assets/{flowDiagram-I6XJVG4X-B9stChWN.js → flowDiagram-I6XJVG4X-SreJFib5.js} +1 -1
  116. package/viewer/dist/assets/{ganttDiagram-6RSMTGT7-DzWlclwM.js → ganttDiagram-6RSMTGT7-DO7GLSdw.js} +1 -1
  117. package/viewer/dist/assets/{gitGraph-WXDBUCRP-CdVI3GTp.js → gitGraph-WXDBUCRP-Cgwn_Q5_.js} +1 -1
  118. package/viewer/dist/assets/{gitGraphDiagram-PVQCEYII-Dn9yRc1N.js → gitGraphDiagram-PVQCEYII-DLwaMyDa.js} +1 -1
  119. package/viewer/dist/assets/{index-BsGRgBOD.js → index-COz6c_JS.js} +2 -2
  120. package/viewer/dist/assets/{info-J43DQDTF-CXV3Mm9T.js → info-J43DQDTF-Ci-BiM87.js} +1 -1
  121. package/viewer/dist/assets/{infoDiagram-5YYISTIA-zIUka_J2.js → infoDiagram-5YYISTIA-Bip5dlKM.js} +1 -1
  122. package/viewer/dist/assets/{ishikawaDiagram-YF4QCWOH-DsZwNuE3.js → ishikawaDiagram-YF4QCWOH-VXV_9uEH.js} +1 -1
  123. package/viewer/dist/assets/{journeyDiagram-JHISSGLW-BhSTSB2s.js → journeyDiagram-JHISSGLW-DQz-8gAS.js} +1 -1
  124. package/viewer/dist/assets/{kanban-definition-UN3LZRKU-sCAldj86.js → kanban-definition-UN3LZRKU-BTWpEcf0.js} +1 -1
  125. package/viewer/dist/assets/{line-D7b3fopb.js → line-BnRWAabF.js} +1 -1
  126. package/viewer/dist/assets/{linear-BWlvVc_d.js → linear-BR6v_8SI.js} +1 -1
  127. package/viewer/dist/assets/{mermaid-parser.core-BdEYBvaj.js → mermaid-parser.core-CSsnrQhR.js} +2 -2
  128. package/viewer/dist/assets/{mermaid.core-C9bGWeJU.js → mermaid.core-I1kLnpG2.js} +3 -3
  129. package/viewer/dist/assets/{mindmap-definition-RKZ34NQL-DbTvvku-.js → mindmap-definition-RKZ34NQL-Cq66Ilr1.js} +1 -1
  130. package/viewer/dist/assets/{packet-YPE3B663-DRfLruyq.js → packet-YPE3B663-BjSCEGVd.js} +1 -1
  131. package/viewer/dist/assets/{pie-LRSECV5Y-47xXMkK-.js → pie-LRSECV5Y-Di72yxoZ.js} +1 -1
  132. package/viewer/dist/assets/{pieDiagram-4H26LBE5-Ckno9E1M.js → pieDiagram-4H26LBE5-TmsfKHOO.js} +1 -1
  133. package/viewer/dist/assets/{quadrantDiagram-W4KKPZXB-XB5kJ_2c.js → quadrantDiagram-W4KKPZXB-Dp9iSvCk.js} +1 -1
  134. package/viewer/dist/assets/{radar-GUYGQ44K-CLwIH5Zr.js → radar-GUYGQ44K-CZeWC3Jm.js} +1 -1
  135. package/viewer/dist/assets/{requirementDiagram-4Y6WPE33-D3fApL0X.js → requirementDiagram-4Y6WPE33-lbTbiw59.js} +1 -1
  136. package/viewer/dist/assets/{sankeyDiagram-5OEKKPKP-6UdaRhuZ.js → sankeyDiagram-5OEKKPKP-DqmoGDJk.js} +1 -1
  137. package/viewer/dist/assets/{sequenceDiagram-3UESZ5HK-ClIrrs0w.js → sequenceDiagram-3UESZ5HK-B6_EiWF6.js} +1 -1
  138. package/viewer/dist/assets/{src-BPb55SrS.js → src-Dz3SjXJY.js} +1 -1
  139. package/viewer/dist/assets/{stateDiagram-AJRCARHV-CCsrcv5R.js → stateDiagram-AJRCARHV-Z6QRASCx.js} +1 -1
  140. package/viewer/dist/assets/stateDiagram-v2-BHNVJYJU-BePyUY0u.js +1 -0
  141. package/viewer/dist/assets/{timeline-definition-PNZ67QCA-BkiWQlVI.js → timeline-definition-PNZ67QCA-XuUZAYAP.js} +1 -1
  142. package/viewer/dist/assets/{treeView-BLDUP644-m1mGpAE8.js → treeView-BLDUP644-DuGsPB97.js} +1 -1
  143. package/viewer/dist/assets/{treemap-LRROVOQU-Bapvwi0Q.js → treemap-LRROVOQU-CSJx8IZ0.js} +1 -1
  144. package/viewer/dist/assets/{vennDiagram-CIIHVFJN-BlH71Nmx.js → vennDiagram-CIIHVFJN-BnebDryc.js} +1 -1
  145. package/viewer/dist/assets/{wardley-L42UT6IY-CPRSoKgV.js → wardley-L42UT6IY-DqqoXPSq.js} +1 -1
  146. package/viewer/dist/assets/{wardleyDiagram-YWT4CUSO-C-ptFJ9t.js → wardleyDiagram-YWT4CUSO-Bchy871K.js} +1 -1
  147. package/viewer/dist/assets/{xychartDiagram-2RQKCTM6-C4rfeH4W.js → xychartDiagram-2RQKCTM6-Bl_zzGZm.js} +1 -1
  148. package/viewer/dist/index.html +1 -1
  149. package/docs/001-file-format.md +0 -265
  150. package/docs/002-mcp.md +0 -186
  151. package/docs/003-mcp-upgrade-plan.md +0 -138
  152. package/viewer/dist/assets/architecture-7EHR7CIX-BAboPvK1.js +0 -1
  153. package/viewer/dist/assets/channel-D8YnBgqu.js +0 -1
  154. package/viewer/dist/assets/chunk-QZHKN3VN-ClYnv9g5.js +0 -1
  155. package/viewer/dist/assets/chunk-WU5MYG2G-CvL2Yleq.js +0 -1
  156. package/viewer/dist/assets/classDiagram-4FO5ZUOK-B8YUd1jx.js +0 -1
  157. package/viewer/dist/assets/classDiagram-v2-Q7XG4LA2-B8YUd1jx.js +0 -1
  158. package/viewer/dist/assets/eventmodeling-FCH6USID-CZ5gxAxG.js +0 -1
  159. package/viewer/dist/assets/stateDiagram-v2-BHNVJYJU-C1phrPNi.js +0 -1
package/README.md CHANGED
@@ -38,6 +38,7 @@ Requires Node ≥ 22.
38
38
  ```sh
39
39
  constellation init # scaffold constellation/ with a starter plan.md
40
40
  constellation lint # validate handles, references, folders, schemas
41
+ constellation rename A-X A-Y # rename a card + rewrite every reference to it
41
42
  constellation mcp # run the MCP server (stdio) for AI agents
42
43
  constellation serve # open the local viewer (editable; --readonly to disable)
43
44
  constellation repos # list sibling repos declared in connected_repos
@@ -53,12 +54,11 @@ unknown fields, dangling prose links) don't block.
53
54
 
54
55
  | Path | What |
55
56
  |---|---|
56
- | `docs/001-file-format.md` | The normative format spec |
57
- | `docs/002-mcp.md` | MCP design: tool surface, hydration, write semantics, git layer |
57
+ | `constellation/` | Constellation's own plan — the format spec, MCP design, and architecture as connected cards (formerly `docs/`); also a flagship real-world plan |
58
58
  | `schemas/` | JSON Schemas: `card.json` (reserved keys) + one per type |
59
59
  | `skill/` | AI authoring skill: `SKILL.md` + per-type references with golden examples |
60
60
  | `src/core/` | Parser, reference extraction, indexer, schema validation, lint |
61
- | `src/cli/` | The `constellation` binary (`init`, `lint`, `mcp`, `serve`, `repos`) |
61
+ | `src/cli/` | The `constellation` binary (`init`, `lint`, `rename`, `mcp`, `serve`, `repos`) |
62
62
  | `src/mcp/` | MCP server: hydrated retrieval, validated writes, git tools |
63
63
  | `examples/constellation/` | Golden sample plan — one card of every type, lints clean, doubles as the test fixture |
64
64
 
@@ -77,11 +77,18 @@ npm run build # tsc → dist/
77
77
 
78
78
  - **Hydrated retrieval**: `get_card`, `search`, and `traverse` can return
79
79
  connected cards with their complete frontmatter and body in one call.
80
- - **Validated writes**: `create_card`, `update_card`, `delete_card`,
81
- `add_connection`, `remove_connection` every write lints and returns issues.
80
+ `list_cards` and `traverse` filter by status — `["planned", "building", "none"]`
81
+ is the backlog view (everything not yet built).
82
+ - **Validated writes**: `create_card` / `create_cards`, `update_card`,
83
+ `append_note` / `edit_section` (byte-cheap memory writes), `set_verified`,
84
+ `rename_card` (rewrites every reference plan-wide), `delete_card`,
85
+ `add_connection(s)`, `remove_connection` — every write lints and returns issues.
82
86
  Body-only updates never reformat frontmatter.
87
+ - **Queryable memory**: `search` matches appended note text; `list_notes` lists
88
+ notes across cards by kind (every gotcha / decision in one call).
83
89
  - **Git-powered change tracking**: `diff_plan` (per-card changes since the sync
84
- marker), `plan_log`, `set_sync_point`, `check_integrity`.
90
+ marker), `plan_log`, `set_sync_point`, `stale_report` / `check_sync`
91
+ (bound-code drift since a card was verified), `check_integrity`.
85
92
  - **Connected repos (multi-repo)**: a plan can declare sibling repos
86
93
  (`add_connected_repo` / `list_connected_repos` / `remove_connected_repo`); every
87
94
  tool takes an optional `repo` selector to read or write a sibling's plan. Omit it
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: Agent guidance (three copies)
3
+ kind: policy
4
+ status: built
5
+ code_refs:
6
+ - skill/SKILL.md
7
+ - skill/methodology.md
8
+ ---
9
+
10
+ # Agent guidance
11
+
12
+ How AI agents are taught to use Constellation. The guidance lives in **three unshared copies
13
+ that must stay consistent**: the MCP `INSTRUCTIONS` string ([[FILE-MCP-SERVER]]) and the skill
14
+ (`skill/SKILL.md` + `skill/methodology.md`). None imports another, so any change to how an
15
+ agent should use the plan must land in all three.
16
+
17
+ Core stance: treat the plan as **durable, cross-session memory** (read the neighborhood before
18
+ changing code; update cards as part of "done"); be **plan-first** when changing behavior
19
+ (express the end state as cards, get sign-off on the plan diff, then bring code up to match —
20
+ [[FLOW-SYNC-PLAN]]); act as an **orchestrator** for large work (partition into file-disjoint
21
+ neighborhoods, one card per agent, then verify). `skill/methodology.md` also backs the MCP
22
+ `bootstrap_plan` / `audit_plan` prompts. See [[DOC-MCP-UPGRADES]] for the why.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: Editable
3
+ kind: ui
4
+ status: built
5
+ code_refs:
6
+ - viewer/src/components/Editable.svelte
7
+ ---
8
+
9
+ Inline-edit wrapper: click to edit a field or the body, saves through the serve PATCH endpoint with an `if_mtime` stale-write guard ([[FILE-SERVE]]).
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: StatusPill
3
+ kind: ui
4
+ status: built
5
+ code_refs:
6
+ - viewer/src/components/StatusPill.svelte
7
+ ---
8
+
9
+ Card status picker (`planned` → `building` → `built` → `verified`); PATCHes through the write API ([[FILE-SERVE]]).
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: SyncPill
3
+ kind: ui
4
+ status: built
5
+ code_refs:
6
+ - viewer/src/components/SyncPill.svelte
7
+ ---
8
+
9
+ Glanceable freshness pill — renders `computeSyncStatus` ([[FILE-SYNC]]) state (in-sync / drifted / dirty / never-synced), including the marker-unreachable case.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: Architecture pipeline
3
+ kind: flowchart
4
+ status: built
5
+ ---
6
+
7
+ # Architecture
8
+
9
+ One direction: **files → index → (lint | serve | mcp)**. Every consumer reloads the index from
10
+ disk per operation, so it's always correct under parallel edits.
11
+
12
+ ```mermaid
13
+ flowchart TD
14
+ files["constellation/ files"] --> FILE-INDEXER
15
+ FILE-PARSE --> FILE-INDEXER
16
+ FILE-EXTRACT --> FILE-INDEXER
17
+ FILE-HANDLES --> FILE-INDEXER
18
+ FILE-VALIDATE --> FILE-LINT
19
+ FILE-INDEXER --> FILE-LINT
20
+ FILE-INDEXER --> FILE-MCP-SERVER
21
+ FILE-INDEXER --> FILE-SERVE
22
+ FILE-LINT --> FILE-CLI
23
+ FILE-MCP-SERVER --> FILE-CODE
24
+ FILE-MCP-SERVER --> FILE-GIT
25
+ FILE-MCP-SERVER --> FILE-WRITER
26
+ FILE-SERVE --> FILE-WRITER
27
+ FILE-SERVE --> PAGE-VIEWER-HOME
28
+ ```
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: The 17 card types
3
+ kind: reference
4
+ status: built
5
+ ---
6
+
7
+ # The 17 card types
8
+
9
+ The prefix before the first dash determines a card's type and must be one of these 17. Folder
10
+ placement matches the type (a misfiled card warns W001, not errors — the prefix is
11
+ authoritative). Defined in [[FILE-TYPES]] (`TYPE_NAMES`) and [[FILE-HANDLES]] (`TYPE_FOLDERS`).
12
+
13
+ | Type | Prefix | Folder | What it is |
14
+ |---|---|---|---|
15
+ | API | `API-` | `api/` | HTTP/RPC endpoints |
16
+ | DB | `DB-` | `db/` | Database tables / collections |
17
+ | DATATYPE | `DATATYPE-` | `datatype/` | Data type schemas (interfaces, Zod, etc.) |
18
+ | ROLE | `ROLE-` | `role/` | User roles / permission groups |
19
+ | DOC | `DOC-` | `doc/` | Documentation cards |
20
+ | FILE | `FILE-` | `file/` | Source file references (require `path`) |
21
+ | TEST | `TEST-` | `test/` | Test specs |
22
+ | EXTERNAL | `EXTERNAL-` | `external/` | External services / integrations |
23
+ | EVENT | `EVENT-` | `event/` | Domain events / signals |
24
+ | COMPONENT | `COMPONENT-` | `component/` | Reusable UI components |
25
+ | PAGE | `PAGE-` | `page/` | Frontend routes / screens |
26
+ | JOB | `JOB-` | `job/` | Background / scheduled / queued work |
27
+ | FLOW | `FLOW-` | `flow/` | Multi-step sequenced processes |
28
+ | STATE | `STATE-` | `state/` | State machines |
29
+ | DIAGRAM | `DIAGRAM-` | `diagram/` | Architecture diagrams |
30
+ | AGENT | `AGENT-` | `agent/` | AI agent instructions / policies |
31
+ | PLAN | `PLAN-` | `plan/` | Plan documents (`plan.md` = PLAN-PROJECT) |
32
+
33
+ **Adding or renaming a type touches four places that must agree:** `TYPE_NAMES`
34
+ ([[FILE-TYPES]]) + `TYPE_FOLDERS` ([[FILE-HANDLES]]); `schemas/<folder>.json`;
35
+ `skill/types/<folder>.md`; and a sample card in `examples/` + this table. Each type's
36
+ frontmatter schema + golden example is served live by the MCP `describe_type` tool.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: Change tracking & sync
3
+ kind: spec
4
+ status: built
5
+ ---
6
+
7
+ # Change tracking & sync
8
+
9
+ **What changed is git's job**, never stamped into cards: `git diff <ref> -- constellation/`
10
+ *is* the plan diff. [[FILE-GIT]] exposes it as `diff_plan` / `plan_log`; plan changes ride
11
+ branches and PRs, and reviewing a plan PR is the human approval gate before an AI syncs code.
12
+
13
+ **Sync marker** — a reconciling agent records the last plan commit it synced code against in
14
+ `constellation/.sync.json` (plan-global, via `set_sync_point`). [[FILE-SYNC]]'s
15
+ `computeSyncStatus` reports `drifted` when the plan moved past the marker or code commits land
16
+ after it, and `marker_error` → `drifted` when the marker sha is unreachable (rebase / shallow
17
+ clone / hand-edited marker).
18
+
19
+ **Lifecycle** — `status` (`planned`→`building`→`built`→`verified`) is a card property,
20
+ orthogonal to history. Verify only against real code.
21
+
22
+ **Verification provenance vs. change tracking** — the one recorded per-card baseline is
23
+ `verified_sha` / `verified_at`: `set_verified` stamps the sha a card was checked at. That's the
24
+ basis of a *claim*, not a change flag — and the drift *verdict* ("has the bound code moved
25
+ since?") is recomputed live by `stale_report` / `check_sync` ([[FILE-CODE]]), never stored.
26
+ This reconciles the "no per-card stamping" rule rather than breaking it. See [[DOC-MCP-UPGRADES]].
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: Connected repos (multi-repo)
3
+ kind: spec
4
+ status: built
5
+ ---
6
+
7
+ # Connected repos (multi-repo)
8
+
9
+ A project spanning several repos declares its siblings on PLAN-PROJECT — the one cross-repo
10
+ concept in the format, deliberately minimal. Each repo's `constellation/` is a standalone plan,
11
+ references only its own cards, and lints clean alone; **connections never cross repos.**
12
+
13
+ ```yaml
14
+ # plan.md frontmatter
15
+ connected_repos:
16
+ - name: pyramid-server # the `repo` selector (lowercase id)
17
+ path: ../pyramid-server # relative to this repo's root (or absolute)
18
+ description: Back-end API for Pyramid.
19
+ ```
20
+
21
+ Paths are local topology and are **never linted** — reachability is computed at call time.
22
+ [[FILE-REPOS]] resolves the `repo` selector; every MCP read/write tool accepts it to target a
23
+ sibling. **Plan resolution still never crosses a repo boundary** on its own ([[FILE-RESOLVE]])
24
+ — a sibling is reached only when explicitly named. Management tools: `list_connected_repos`,
25
+ `add_connected_repo` (`reciprocate` writes the reverse link too), `remove_connected_repo`.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: Diagrams and flows
3
+ kind: reference
4
+ status: built
5
+ ---
6
+
7
+ # Diagrams and flows
8
+
9
+ Three tiers, cheapest first:
10
+
11
+ 1. **Derived subgraphs** — the viewer/MCP render any card's neighborhood from the real
12
+ connection graph on demand. Never stored, never stale. The default for "what does this area
13
+ look like."
14
+ 2. **Authored Mermaid** — a DIAGRAM card whose body is a mermaid block; use handles as node IDs
15
+ so the diagram joins the graph ([[FILE-EXTRACT]] reads them). Sequence diagrams and
16
+ `stateDiagram-v2` work the same way in FLOW and STATE cards.
17
+ 3. **Pinned layouts** — structured `nodes`/`edges`/`phases` with explicit positions in DIAGRAM
18
+ frontmatter (`schemas/diagram.json`). Only when layout carries meaning; positions make noisy
19
+ diffs.
20
+
21
+ **FLOW cards are linear** — steps are a numbered markdown list, nested items for error/edge
22
+ cases. Real branching belongs in a mermaid flowchart or a STATE card.
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: File format
3
+ kind: spec
4
+ status: built
5
+ ---
6
+
7
+ # File format
8
+
9
+ Constellation stores a project's architecture plan as markdown files under a `constellation/`
10
+ folder. Each file is one **card** — one typed piece of the plan, linked to others by
11
+ **connections**. ("Node" is reserved for diagram elements inside DIAGRAM cards.) This is the
12
+ normative format; the JSON Schemas in `schemas/` define per-type frontmatter and
13
+ [[FILE-INDEXER]] is the reference implementation.
14
+
15
+ ## Files are handles
16
+
17
+ The filename IS the handle: `api/API-TICKETS.md` defines the card `API-TICKETS`. There is no
18
+ `handle:` or `type:` field — the path already says it. Handle grammar:
19
+ `^[A-Z][A-Z0-9]*-[A-Z0-9][A-Z0-9-]*$` (3–135 chars; uppercase, digits, dashes). The prefix
20
+ before the first dash is the type and must be one of the 17 canonical prefixes (see
21
+ [[DOC-CARD-TYPES]]). `plan.md` at the root is the one special file — the card `PLAN-PROJECT`.
22
+
23
+ ## Frontmatter
24
+
25
+ YAML frontmatter is optional; a card with none is valid. Four keys are **reserved**
26
+ (`schemas/card.json`): `name`, `kind` (lowercase-slug subtype), `status`
27
+ (`planned`→`building`→`built`→`verified`), `connections` (list of handles). Beyond those,
28
+ card.json also defines **cross-type metadata** valid on any card, tool-managed rather than
29
+ hand-authored: `code_refs` (code binding, `path` or `path:symbol`), `verified_sha` /
30
+ `verified_at` (the drift baseline — see [[DOC-CHANGE-TRACKING]]), and `notes` (append-only
31
+ typed memory `{kind,text,sha?}`). Everything else is a type-specific field. Schemas are
32
+ permissive: almost nothing is required; unknown fields warn (W003) rather than fail.
33
+
34
+ ## The graph (four connection sources)
35
+
36
+ [[FILE-INDEXER]] derives the connection set, in all cards, from: (1) the `connections:` list;
37
+ (2) any handle-shaped string elsewhere in frontmatter (so `response_schema: DATATYPE-TICKET`
38
+ connects automatically); (3) `[[HANDLE]]` wiki-links in the body; (4) handle-shaped IDs inside
39
+ mermaid blocks. Connections are **undirected** and deduped by pair — declare on whichever card
40
+ you're editing; the reverse view is the indexer's job, never written to disk. Extraction lives
41
+ in [[FILE-EXTRACT]].
42
+
43
+ ## Body conventions
44
+
45
+ Markdown narrative. DATATYPE: the type as a fenced code block. FLOW: a numbered list of steps
46
+ (linear — branch via mermaid or a STATE card). STATE: a mermaid `stateDiagram-v2`. DIAGRAM: a
47
+ mermaid flowchart with handles as node IDs. See [[DOC-DIAGRAMS]]. Lint codes: [[DOC-LINT-CODES]].
48
+
49
+ ## Deliberately not in the format
50
+
51
+ No IDs but handles. No cross-repo card references (siblings link at the project level — see
52
+ [[DOC-CONNECTED-REPOS]]). No connection kinds / directions / metadata — put nuance in prose. No
53
+ revision/diff machinery — git does that. No required fields beyond the filename, except FILE
54
+ cards require `path`.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: Lint codes
3
+ kind: reference
4
+ status: built
5
+ ---
6
+
7
+ # Lint codes
8
+
9
+ Errors break the graph (CLI exit 1; CI should block). Warnings are quality signals (exit 0).
10
+ Structural codes come from [[FILE-INDEXER]]; schema codes (W002/W003) from [[FILE-VALIDATE]];
11
+ [[FILE-LINT]] composes and sorts them.
12
+
13
+ **Errors**
14
+
15
+ | Code | Rule |
16
+ |---|---|
17
+ | E001 | Filename is not a valid handle |
18
+ | E002 | Handle prefix is not one of the 17 canonical prefixes |
19
+ | E003 | Duplicate handle (two files resolve to the same handle) |
20
+ | E004 | `connections` entry is not a handle-shaped string |
21
+ | E005 | `connections` or frontmatter-field target resolves to no card |
22
+ | E006 | Frontmatter is not valid YAML |
23
+
24
+ **Warnings**
25
+
26
+ | Code | Rule |
27
+ |---|---|
28
+ | W001 | Card is not in the folder matching its type |
29
+ | W002 | Frontmatter violates the type's JSON Schema |
30
+ | W003 | Unknown frontmatter field (not a reserved/cross-type key from card.json, not in the type schema) |
31
+ | W004 | Body `[[link]]` or mermaid reference resolves to no card |
32
+
33
+ The E005/W004 split is deliberate: **structured references are contracts** (a frontmatter
34
+ target must resolve → error); **prose references are aspirational** (a body `[[link]]` may
35
+ point at a card not yet written → warning).
@@ -0,0 +1,59 @@
1
+ ---
2
+ name: MCP server design
3
+ kind: reference
4
+ status: built
5
+ ---
6
+
7
+ # MCP server
8
+
9
+ `constellation mcp` (stdio) gives AI agents graph queries, hydrated retrieval, validated
10
+ writes, and git-powered change tracking over a plan folder. It is a thin layer over
11
+ [[FILE-MCP-SERVER]] + `src/core/`: every tool call reloads the index from disk (tens of ms at
12
+ realistic sizes), so it is always correct while files are edited in parallel — no watcher, no
13
+ cache invalidation. Bootstrap is folder discovery, bounded by the repo root ([[FILE-RESOLVE]]);
14
+ a repo with no plan returns `NO_PLAN_FOUND`. The agent-facing INSTRUCTIONS string is embedded
15
+ in the server — one of three guidance copies, see [[AGENT-GUIDANCE]].
16
+
17
+ ## Hydrated retrieval
18
+
19
+ Any read tool can return connected cards with full data in one call — `connected: none |
20
+ summary | full`. The acceptance test: one `get_card` returns an API card plus the complete
21
+ content of every card connected to it (its datatypes, table, tests, docs).
22
+
23
+ ## Tool surface
24
+
25
+ - **Read** — `get_card` (+ `code: none|paths|direct`, notes filters), `list_cards`,
26
+ `list_notes` (cross-card notes query by kind/handles), `search` (bodies **and** notes),
27
+ `traverse`, `assemble`, `describe_type` (the type reference, plan-independent).
28
+ `list_cards`/`traverse` filter by status (value or list; `"none"` = unset), so
29
+ `["planned","building","none"]` is the backlog view. On `traverse` status is a
30
+ *post-filter* — the walk passes through non-matching cards so a built hub never hides
31
+ planned work — while `types` prunes the walk itself.
32
+ - **Write** — `create_card`, `create_cards` (batched, lints once), `update_card` (+ `if_mtime`
33
+ stale-write guard), `append_note`, `edit_section`, `set_verified`, `rename_card` (rename a
34
+ handle and rewrite every reference plan-wide, whole-token; the file moves with the prefix —
35
+ shared engine with the CLI `constellation rename`, [[FILE-RENAME]]),
36
+ `delete_card`, `add_connection`, `add_connections`, `remove_connection`. Every write reloads
37
+ + lints and returns the issues for the file it touched; **a card is created even when issues
38
+ come back** (issues are lint state, not failure). Writes are serialized per file behind an
39
+ in-process lock and land atomically (temp + rename); the cheap writes apply their change to
40
+ the file's *current* content, so concurrent small updates compose instead of clobbering.
41
+ - **Git** — `diff_plan`, `plan_log`, `set_sync_point`, `stale_report`, `check_sync`,
42
+ `check_integrity` (see [[DOC-CHANGE-TRACKING]]).
43
+ - **Viewer** — `start_viewer` / `stop_viewer` ([[PAGE-VIEWER-HOME]]).
44
+ - **Connected repos** — `list` / `add` / `remove_connected_repo`; every tool takes a `repo`
45
+ selector (see [[DOC-CONNECTED-REPOS]]).
46
+
47
+ ## Code binding, drift & assembly
48
+
49
+ A card binds to code via a connected FILE `path:` or its own `code_refs`, resolved by
50
+ [[FILE-CODE]]. `get_card(code:"paths"|"direct")` attaches it (capped, repo-contained);
51
+ `stale_report` / `check_sync` flag reverse drift; `assemble` builds file-disjoint work packages.
52
+ Byte-preserving cheap writes ([[FILE-WRITER]]) make a correction cost less than a full rewrite.
53
+
54
+ ## What v1 tools deliberately died
55
+
56
+ `expand_handles` (handles ARE the identifiers); `init_project` / `link_project` /
57
+ `check_health` (bootstrap is finding a folder — `init_plan` just creates it);
58
+ `read_plan` / `update_plan` (use `get_card("PLAN-PROJECT")` / `update_card`). Bulk variants were
59
+ kept: `create_cards` / `add_connections` batch and lint once so intra-batch references resolve.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: MCP upgrades & memory model
3
+ kind: decision
4
+ status: built
5
+ ---
6
+
7
+ # MCP upgrades & memory model (decisions)
8
+
9
+ The rationale behind Constellation's role as **durable, cross-session, cross-agent memory**
10
+ for AI agents — the "003" upgrade plan, shipped in v0.2.2 (phases 0–6). This card replaces the
11
+ former `docs/003`; it is the ADR for the memory/durability design.
12
+
13
+ ## Why this matters
14
+
15
+ Every session an agent pays a "discovery tax" — rebuilding a mental model of the code before it
16
+ can act. Without a place to bank that understanding it evaporates at session end and the next
17
+ agent re-pays it. Constellation's value is that understanding **compounds**. Two failure modes
18
+ erode it: **drift** (a card's claim silently diverges from code — a card you can't trust is
19
+ worse than none) and **friction** (updating a card is expensive, so agents skip it, which
20
+ *causes* drift).
21
+
22
+ ## Principles
23
+
24
+ - **`built` is a claim that outlives its author** — claims must be re-verifiable, not taken on
25
+ faith. Durability, not distrust (the same reason you keep tests).
26
+ - **Card what code can't say** — intent, decisions, current state, gotchas, cross-cutting rules.
27
+ Don't duplicate DDL / signatures / code; link to it (copies drift).
28
+ - **Make the honest path the cheap path** — most drift is skipped updates; lower the cost of a
29
+ small correction (`append_note`, `edit_section`) and cards stay true.
30
+ - **Purpose belongs in the intro** — the MCP instructions load every session, so framing changes
31
+ agent defaults more than any tool. See [[AGENT-GUIDANCE]].
32
+
33
+ ## Two headline capabilities
34
+
35
+ **Hand me the delta** — what changed since I last looked: plan-side (`diff_plan`) and code-side
36
+ reverse drift (`stale_report`, the core new capability). **Hand me the code behind a card** —
37
+ attach the bound file ([[FILE-CODE]]), so an agent starts from intent + current reality in one
38
+ call. `assemble` fuses both into a fan-out-ready work package.
39
+
40
+ ## Decisions on record
41
+
42
+ - **Binding granularity** — FILE-`path:` is the default (zero authoring tax); optional
43
+ `code_refs` add precision (`path` or `path:symbol`) only where drift precision earns its keep.
44
+ Drift is detected at file granularity; the symbol is an informational hint.
45
+ - **No-per-card-stamping, reconciled** — `verified_sha` is verification *provenance*, not a
46
+ change flag; the drift verdict stays live and unstored ([[DOC-CHANGE-TRACKING]], [[FILE-SYNC]]).
47
+ - **Code attach is same-repo** — cards never bind across repos; reach a sibling's code via the
48
+ `repo` selector ([[DOC-CONNECTED-REPOS]]).
49
+ - **Decided AGAINST a dedicated `DECISION` card type** — decisions live as data on the cards
50
+ they concern: an `append_note(kind: decision)`, a DOC card (`kind: decision`, like this one),
51
+ or a DIAGRAM. Co-location beats a separate filing system you have to remember to open.
52
+ - **Memory must be retrievable to be memory** — `search` indexes note text alongside bodies,
53
+ and `list_notes` gives the cross-card view (every gotcha / every decision in one call). A
54
+ note that full-text search can't find would silently defeat the point of appending it.
55
+ - **Deferred** — a structured partial-status model (`{built, pending}`); typed `notes` cover most
56
+ of that need for now.
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: ajv
3
+ kind: library
4
+ status: built
5
+ ---
6
+
7
+ JSON Schema validation (2020 dialect) behind [[FILE-VALIDATE]] (W002/W003). Ships CJS, loaded via createRequire.
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: git
3
+ kind: cli
4
+ status: built
5
+ ---
6
+
7
+ The change-tracking backbone; [[FILE-GIT]] shells out to it for diff / log / rev-list (revisions guarded by safeRev + --end-of-options).
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: gray-matter
3
+ kind: library
4
+ status: built
5
+ ---
6
+
7
+ Frontmatter parsing in [[FILE-PARSE]].
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: '@modelcontextprotocol/sdk'
3
+ kind: library
4
+ status: built
5
+ ---
6
+
7
+ The MCP protocol — stdio transport, tool/prompt registration — used by [[FILE-MCP-SERVER]].
@@ -0,0 +1,7 @@
1
+ ---
2
+ name: zod
3
+ kind: library
4
+ status: built
5
+ ---
6
+
7
+ MCP tool input schemas in [[FILE-MCP-SERVER]].
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: cli/index.ts
3
+ status: built
4
+ path: src/cli/index.ts
5
+ language: typescript
6
+ summary: The constellation binary (commander)
7
+ ---
8
+
9
+ Commands: `init`, `lint`, `rename`, `mcp`, `serve`, `repos`, `version`/`v`, `upgrade`. `lint` exits 1 on errors, 0 otherwise (warnings never fail), 2 when no plan is found. `rename OLD NEW` is the human-facing wrapper over [[FILE-RENAME]] — it prints the rewritten references and a lint-error count.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: code.ts
3
+ status: built
4
+ path: src/core/code.ts
5
+ language: typescript
6
+ summary: Code binding + attach (same-repo, contained, capped)
7
+ ---
8
+
9
+ Resolves a card's bound files — connected FILE `path:` + own `code_refs` — and attaches their contents under per-file (64 KB) and total (256 KB) caps, skipping binaries / lockfiles / generated and rejecting paths (incl. symlinks) that escape the repo root. A file over the per-file cap attaches its head with `truncated: true` rather than being skipped. Shared by `get_card` code mode, stale_report, and assemble.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: extract.ts
3
+ status: built
4
+ path: src/core/extract.ts
5
+ language: typescript
6
+ summary: Pull references out of a card body and frontmatter
7
+ ---
8
+
9
+ Extracts the four connection sources: `[[HANDLE]]` wiki-links, handle-shaped frontmatter values, and mermaid node IDs. Only handle-shaped tokens count.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: git.ts
3
+ status: built
4
+ path: src/core/git.ts
5
+ language: typescript
6
+ summary: Git plumbing for change tracking + drift
7
+ ---
8
+
9
+ `diffPlan` (per-card delta), `planLog`, sync-marker read/write, `headSha`, `changedFilesSince`, `countCodeCommitsSince`, `recentPlanActivity`. Every caller-supplied revision is guarded by `safeRev` + `--end-of-options` so a dash-leading value can't be parsed as a git option.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: handles.ts
3
+ status: built
4
+ path: src/core/handles.ts
5
+ language: typescript
6
+ summary: Handle grammar, the 17 canonical prefixes, and the type↔folder map
7
+ ---
8
+
9
+ Defines the handle regex (`^[A-Z][A-Z0-9]*-[A-Z0-9][A-Z0-9-]*$`), `isHandleShaped` / `isKnownHandle` / `typeForHandle`, and `TYPE_FOLDERS` — the authority for which prefix is which type and where its cards live.
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: indexer.ts
3
+ status: built
4
+ path: src/core/indexer.ts
5
+ language: typescript
6
+ summary: 'loadPlan(root): the heart of the system'
7
+ connections:
8
+ - FILE-TYPES
9
+ ---
10
+
11
+ Reads every card, dedupes handles, resolves references, builds the undirected connection set, and collects structural issues (E001–E006, W001, W004). The single source of the derived graph — recomputed on every load, never stored.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: lint.ts
3
+ status: built
4
+ path: src/core/lint.ts
5
+ language: typescript
6
+ summary: 'lintPlan: loadPlan + schema validation, sorted'
7
+ ---
8
+
9
+ Composes the indexer's structural issues with schema validation, sorted by file then code. Errors break the graph (CLI exit 1); warnings never fail.
@@ -0,0 +1,12 @@
1
+ ---
2
+ name: mcp/search.ts
3
+ status: built
4
+ path: src/mcp/search.ts
5
+ language: typescript
6
+ summary: Scored full-text search
7
+ connections:
8
+ - FILE-MCP-SERVER
9
+ - DOC-MCP-SERVER
10
+ ---
11
+
12
+ Ranks matches: handle ≫ name > kind/type > body-and-note occurrences; appended notes are indexed as `note(kind): text` lines so recorded memory stays findable, and the excerpt is the first matching body or note line.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: mcp/server.ts
3
+ status: built
4
+ path: src/mcp/server.ts
5
+ language: typescript
6
+ summary: 'The MCP server: tools + INSTRUCTIONS'
7
+ ---
8
+
9
+ `constellation mcp` (stdio). Registers every tool, embeds the agent-facing `INSTRUCTIONS` string (one of the three guidance copies), and resolves the target plan — the home plan or, when `repo` is passed, a connected sibling.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: parse.ts
3
+ status: built
4
+ path: src/core/parse.ts
5
+ language: typescript
6
+ summary: Split a card file into YAML frontmatter + markdown body
7
+ ---
8
+
9
+ Frontmatter/body splitter built on gray-matter. Surfaces malformed YAML so the indexer can raise E006.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: rename.ts
3
+ status: built
4
+ path: src/core/rename.ts
5
+ language: typescript
6
+ summary: Plan-wide handle rename shared by MCP rename_card and CLI rename
7
+ connections:
8
+ - FILE-WRITER
9
+ - FILE-INDEXER
10
+ - FILE-MCP-SERVER
11
+ - FILE-CLI
12
+ ---
13
+
14
+ Moves the card file to the new handle's path (folder follows the prefix) with its bytes
15
+ preserved, then rewrites every card that mentions the old handle — connections lists,
16
+ handle-shaped frontmatter values, `[[links]]`, mermaid node IDs, prose — as whole tokens
17
+ only (`API-USER` never touches `API-USERS`). Throws typed `RenameCardError`s
18
+ (NOT_FOUND / INVALID_HANDLE / CARD_EXISTS); callers map them to tool errors or exit codes.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: repos.ts
3
+ status: built
4
+ path: src/core/repos.ts
5
+ language: typescript
6
+ summary: Connected-repo declarations + repo selector resolution
7
+ ---
8
+
9
+ Reads/writes `connected_repos` on PLAN-PROJECT and resolves the `repo` selector (name or path) to a sibling plan root. Repo-level links only — cards never connect across repos.
@@ -0,0 +1,9 @@
1
+ ---
2
+ name: resolve.ts
3
+ status: built
4
+ path: src/core/resolve.ts
5
+ language: typescript
6
+ summary: Find the plan folder, bounded by the repo root
7
+ ---
8
+
9
+ Walks up from cwd to find `constellation/`, stopping at the first ancestor with `.git` and returning null rather than adopting a sibling repo's plan. Plan resolution never crosses a repo boundary.