codecartographer-pi 0.8.0 → 0.9.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.
@@ -232,6 +232,8 @@ Before starting `reimplementation-spec` (or any synthesis phase), confirm with t
232
232
 
233
233
  This conversation produces inputs the synthesis phase actually needs (locked target stack, locked project name, locked scope cuts) and selects the right template. If the answer is "opinionated," use `templates/reimplementation-spec-opinionated.md` instead of the default. Skipping the hook produces a generic spec when the user wanted a specific one — the most informative friction the framework has produced to date. A two-question pre-flight is cheap.
234
234
 
235
+ **Behavior under `/codecarto-next --auto`:** the auto runner suppresses this hook to keep the loop moving. The spec defaults to **language-agnostic** and is tagged `selection: auto-default` in its front-matter; any choice the hook would otherwise have prompted for (target stack, project name, scope cuts) is captured as an `open_questions` entry on the phase rather than blocking the run. Users who want an opinionated spec should run `reimplementation-spec` interactively (via `/codecarto-phase reimplementation-spec` or by stopping `--auto` before the synthesis phase).
236
+
235
237
  ## Guardrails
236
238
 
237
239
  These rules cannot be enforced by the template — they rely on the LLM following instructions. A future code-backed implementation should enforce them programmatically.
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ <p align="center">
2
+ <img src="assets/logo.svg" alt="CodeCartographer logo" width="96" height="96">
3
+ </p>
4
+
1
5
  # CodeCartographer
2
6
 
3
7
  [![CI](https://github.com/HuginnIndustries/CodeCartographer/actions/workflows/ci.yml/badge.svg)](https://github.com/HuginnIndustries/CodeCartographer/actions/workflows/ci.yml)
@@ -23,26 +27,32 @@
23
27
  |---|---|
24
28
  | **Layered analysis pipeline** — architecture → defect scan → behavioral contracts → protocols → porting → reimplementation spec | `.codecarto/` template |
25
29
  | **Validation gates between phases** — no advancing past a `FAIL` output | `core/` state machine |
26
- | **Three delivery surfaces** — Pi extension, MCP server, or pure template | All three share `core/` |
30
+ | **Three surfaces, one framework** — Pi extension (recommended), MCP server (for other coding agents), or drop-in template (one-off / evaluation) | All three share `core/` |
27
31
  | **Live progress widget** while phase sub-agents work | Pi extension |
28
32
  | **HTML dashboard** — single-file aggregate of progress, links, usage, narrative | `.codecarto/dashboard.html` |
29
33
  | **Per-phase token tracking** | `/codecarto-usage` |
30
34
  | **Opt-in LLM steering** of the next phase's seed prompt | `/codecarto-next --llm-steer` |
31
35
 
36
+ > **Forward-flow synthesis is underway.** v0.9.0 adds the experimental library foundation and MCP publish/list/reindex tools for accumulating `reimplementation-spec.md` artifacts in a git-trackable library. The Pi publish UX and synthesis pipeline that turns selected library entries plus a vision into `project-plan.md` are still in progress. See [`docs/synthesis-roadmap.md`](docs/synthesis-roadmap.md) for the implementation tracker.
37
+
32
38
  ---
33
39
 
34
40
  ## Install
35
41
 
36
- Pick the surface that matches your tooling. All three share the same `core/` and produce byte-identical phase prompts.
42
+ Three surfaces, in recommended order. All three share the same `core/` and produce byte-identical phase prompts — but the user experience differs by surface, and new features (live widget, dashboard, auto-runner, the upcoming library + synthesis workflows) land on Pi first, MCP second, drop-in last.
43
+
44
+ 1. **Pi extension** — recommended for interactive use. First-class UX.
45
+ 2. **MCP server** — for Claude Code, Codex, opencode, Cursor, Claude Desktop, and any other MCP-capable agent.
46
+ 3. **Drop-in template** — pure `.codecarto/` markdown + YAML for one-off evaluation or any LLM that can read and write files. Library and synthesis workflows are **not** available in pure drop-in mode; the analysis side works fully.
37
47
 
38
- ### Pi extension (recommended for interactive use)
48
+ ### Pi extension (recommended)
39
49
 
40
50
  [Pi](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) is a TUI coding agent. The CodeCartographer extension adds slash commands, a live agents widget, and the dashboard.
41
51
 
42
52
  ```bash
43
53
  pi install npm:codecartographer-pi # from the npm registry
44
54
  pi install /absolute/path/to/CodeCartographer # from a local checkout
45
- pi install git:github.com/your-user/CodeCartographer # from a git URL
55
+ pi install git:github.com/HuginnIndustries/CodeCartographer # from a git URL
46
56
  ```
47
57
 
48
58
  > **Don't** run `npm install codecartographer-pi` for the Pi use case. Plain `npm install` puts the package on disk but doesn't register it with Pi. Use `pi install npm:...` so Pi writes the package into its own `~/.pi/agent/settings.json`.
@@ -53,7 +63,9 @@ For extension development, point Pi directly at the entrypoint:
53
63
  pi -e /absolute/path/to/CodeCartographer/extensions/codecarto/index.ts
54
64
  ```
55
65
 
56
- ### MCP server (for Claude Code, Claude Desktop, any MCP host)
66
+ ### MCP server (for other coding agents)
67
+
68
+ Use this when your coding agent isn't Pi — Claude Code, Codex, opencode, Cursor, Claude Desktop, or anything else that speaks MCP. The host drives the conversation and runs the LLM; CodeCartographer provides phase prompts, validation, and experimental library publish/list/reindex operations.
57
69
 
58
70
  ```bash
59
71
  npm install --global codecartographer-pi
@@ -71,7 +83,9 @@ Add to your host config (`~/.config/claude-code/config.json`, `claude_desktop_co
71
83
  }
72
84
  ```
73
85
 
74
- ### Pure template (no runtime, any LLM that reads/writes files)
86
+ ### Drop-in template (one-off / evaluation)
87
+
88
+ Use this to try CodeCartographer in any repo without installing anything, or in environments where neither Pi nor an MCP-capable agent is available. Works with any LLM that can read and write files.
75
89
 
76
90
  ```bash
77
91
  cp -r /path/to/CodeCartographer/.codecarto /path/to/your-repo/
@@ -79,6 +93,8 @@ cp -r /path/to/CodeCartographer/.codecarto /path/to/your-repo/
79
93
 
80
94
  Then in the LLM session: `Read .codecarto/GUIDE.md and begin the analysis.`
81
95
 
96
+ > **Limitation.** Drop-in mode runs the analysis pipeline fully, but library + synthesis workflows require executable code. Publishing and reading library entries are currently available through the MCP server; Pi publish UX and project-plan synthesis are still in progress. See [`docs/synthesis-roadmap.md`](docs/synthesis-roadmap.md) for the planned scope.
97
+
82
98
  ---
83
99
 
84
100
  ## How it works
@@ -207,13 +223,13 @@ Beyond the slash commands, the Pi extension layers on:
207
223
 
208
224
  ### Version history (Pi orchestration)
209
225
 
210
- The current parallel-sub-agent design landed in 0.2.0 and has been incrementally enriched: file-backed sessions (0.3.0), summary injection (0.4.0), opt-in LLM steering (0.5.0), usage tracking (0.6.0), HTML dashboard (0.7.0), and end-to-end auto mode (0.8.0). 0.1.x workspaces don't need migration — existing `.codecarto/` directories work unchanged. See `CHANGELOG.md` for details.
226
+ The current parallel-sub-agent design landed in 0.2.0 and has been incrementally enriched: file-backed sessions (0.3.0), summary injection (0.4.0), opt-in LLM steering (0.5.0), usage tracking (0.6.0), HTML dashboard (0.7.0), end-to-end auto mode (0.8.0), and experimental library foundations plus MCP library tools (0.9.0). 0.1.x workspaces don't need migration — existing `.codecarto/` directories work unchanged. See `CHANGELOG.md` for details.
211
227
 
212
228
  ---
213
229
 
214
230
  ## MCP server
215
231
 
216
- The same framework is packaged as a [Model Context Protocol](https://modelcontextprotocol.io) server. The MCP path returns prompt text for the host to dispatch and never runs sub-agents itself, so the Pi-only orchestration features (sub-agents, live widget, dashboard, usage tracking) don't apply — but phase prompts and validation are byte-identical with the Pi path because both import the same `core/`.
232
+ The same framework is packaged as a [Model Context Protocol](https://modelcontextprotocol.io) server. The MCP path returns prompt text for the host to dispatch and never runs sub-agents itself, so the Pi-only orchestration features (sub-agents, live widget, dashboard, usage tracking) don't apply — but phase prompts and validation are byte-identical with the Pi path because both import the same `core/`. v0.9.0 also exposes experimental library tools so MCP-capable hosts can publish, list, and reindex reusable `reimplementation-spec.md` artifacts.
217
233
 
218
234
  Implements MCP spec revision [`2025-11-25`](https://modelcontextprotocol.io/specification/2025-11-25) via `@modelcontextprotocol/sdk` ≥ 1.29.0. The negotiated `protocolVersion` reflects whatever the connecting client requests; the server accepts every revision the SDK supports (currently `2025-11-25`, `2025-06-18`, `2025-03-26`, `2024-11-05`, `2024-10-07`).
219
235
 
@@ -226,21 +242,25 @@ Implements MCP spec revision [`2025-11-25`](https://modelcontextprotocol.io/spec
226
242
  | `codecarto_validate` | `/codecarto-validate` |
227
243
  | `codecarto_complete` | `/codecarto-complete` |
228
244
  | `codecarto_skill` | `/codecarto-skill` |
245
+ | `codecarto_publish` | MCP-only library publish |
246
+ | `codecarto_library_list` | MCP-only library listing |
247
+ | `codecarto_library_reindex` | MCP-only library reindex |
229
248
 
230
- Each tool accepts an absolute `cwd` for the target repository. `codecarto_init` requires `force: true` to overwrite an existing `.codecarto/` (instead of Pi's interactive confirmation).
249
+ Each workflow tool accepts an absolute `cwd` for the target repository. `codecarto_init` requires `force: true` to overwrite an existing `.codecarto/` (instead of Pi's interactive confirmation). The library tools accept an explicit absolute `library_path` or resolve `library.path` from `.codecarto/workflow/config.yaml` / `~/.codecarto/config.yaml`. The library schema is experimental and may break before v2.
231
250
 
232
251
  ---
233
252
 
234
253
  ## Compatible environments
235
254
 
236
- | Environment | Notes |
255
+ | Environment | Recommended surface |
237
256
  |---|---|
238
- | **Pi** | Native install the extension, get slash commands + widget + dashboard. |
239
- | **Claude Code** | MCP server, or point it at `.codecarto/GUIDE.md` directly. |
257
+ | **Pi** | Native Pi extension slash commands + widget + dashboard. |
258
+ | **Claude Code / Codex / opencode** | MCP server. All three speak MCP cleanly. |
259
+ | **Cursor / Windsurf / IDE copilots** | MCP server where supported; otherwise drop-in template (`.codecarto/GUIDE.md`). |
240
260
  | **Claude Desktop** | MCP server. |
241
- | **OpenCode / Aider / Cursor / Windsurf / IDE copilots** | Open the repo, point the LLM at `.codecarto/GUIDE.md`. |
242
- | **Claude.ai / ChatGPT (web chat)** | Paste file contents manually. Tedious for multi-phase runs. |
243
- | **API-based agents** | Load files programmatically, pass to the model, write outputs back. |
261
+ | **Aider** | Drop-in template point at `.codecarto/GUIDE.md`. |
262
+ | **Claude.ai / ChatGPT (web chat)** | Drop-in, paste file contents manually. Tedious for multi-phase runs. |
263
+ | **API-based agents** | Load files programmatically, pass to the model, write outputs back. Drop-in semantics. |
244
264
 
245
265
  ---
246
266
 
@@ -381,7 +401,7 @@ core/ # Pipeline state machine, validators, prompt assemb
381
401
  # dashboard renderer, usage log, orchestrator config.
382
402
  extensions/codecarto/ # Pi extension surface (slash commands, widget,
383
403
  # tool gating, dashboard writer + narrator).
384
- mcp-server/ # MCP server surface (seven tools mirroring Pi commands).
404
+ mcp-server/ # MCP server surface (workflow tools + experimental library tools).
385
405
  tests/ # Invariant tests catching cross-wrapper drift.
386
406
  docs/ # Roadmap, design notes.
387
407
  ```
@@ -0,0 +1,42 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-labelledby="title desc">
2
+ <title id="title">CodeCartographer logo</title>
3
+ <desc id="desc">A folded map with a highlighted route over subtle matrix-style code marks.</desc>
4
+ <defs>
5
+ <linearGradient id="bg" x1="8" y1="6" x2="56" y2="58" gradientUnits="userSpaceOnUse">
6
+ <stop offset="0" stop-color="#303431"/>
7
+ <stop offset="1" stop-color="#111312"/>
8
+ </linearGradient>
9
+ <linearGradient id="route" x1="18" y1="45" x2="48" y2="18" gradientUnits="userSpaceOnUse">
10
+ <stop offset="0" stop-color="#b8432f"/>
11
+ <stop offset="1" stop-color="#f1a84f"/>
12
+ </linearGradient>
13
+ </defs>
14
+
15
+ <rect x="4" y="4" width="56" height="56" rx="14" fill="url(#bg)"/>
16
+ <rect x="5" y="5" width="54" height="54" rx="13" fill="none" stroke="#f5efd8" stroke-opacity="0.22" stroke-width="2"/>
17
+
18
+ <!-- Matrix/code rain: intentionally sparse so it survives favicon/header size. -->
19
+ <g stroke="#63e6a4" stroke-width="2.2" stroke-linecap="round" opacity="0.42">
20
+ <path d="M15 14v5M15 25v4M49 13v7M49 28v4"/>
21
+ <path d="M25 11v4M39 49v4" opacity="0.65"/>
22
+ </g>
23
+
24
+ <!-- Simplified folded map silhouette. -->
25
+ <path d="M15 22 27 16l12 6 10-5v25l-10 6-12-6-12 6Z" fill="#f5efd8"/>
26
+ <path d="M27 16v26M39 22v26" fill="none" stroke="#141413" stroke-opacity="0.25" stroke-width="2"/>
27
+ <path d="M15 22 27 16l12 6 10-5v25l-10 6-12-6-12 6Z" fill="none" stroke="#141413" stroke-opacity="0.38" stroke-width="2" stroke-linejoin="round"/>
28
+
29
+ <!-- Cartography contour lines. -->
30
+ <g fill="none" stroke="#2c5862" stroke-width="2.2" stroke-linecap="round" opacity="0.9">
31
+ <path d="M19 29c3-2 5-2 8 0"/>
32
+ <path d="M31 29c2.5 1.3 4.5 1.1 6.5-.2"/>
33
+ <path d="M43 29c2-1.5 3.4-1.5 5 .1"/>
34
+ </g>
35
+
36
+ <!-- Dominant route/compass mark. -->
37
+ <path d="M18 43c7-10 12-11 17-12 6-1 8-7 13-13" fill="none" stroke="#141413" stroke-opacity="0.28" stroke-width="7" stroke-linecap="round"/>
38
+ <path d="M18 43c7-10 12-11 17-12 6-1 8-7 13-13" fill="none" stroke="url(#route)" stroke-width="4.5" stroke-linecap="round"/>
39
+ <circle cx="18" cy="43" r="4" fill="#141413" stroke="#f5efd8" stroke-width="2"/>
40
+ <circle cx="35" cy="31" r="3.3" fill="#141413" stroke="#f5efd8" stroke-width="2"/>
41
+ <path d="M48 11.5 52 19l-4 7.5-4-7.5Z" fill="#b8432f" stroke="#f5efd8" stroke-width="2" stroke-linejoin="round"/>
42
+ </svg>
@@ -2,10 +2,16 @@ import type { NormalizedStatus, PipelineFile } from "./types.ts";
2
2
  import type { UsageFile } from "./usage.ts";
3
3
  export declare const DASHBOARD_RELATIVE_PATH = "dashboard.html";
4
4
  export declare const NARRATION_CACHE_RELATIVE_PATH = ".dashboard-narration.local.md";
5
+ export interface DashboardArtifactLink {
6
+ path: string;
7
+ exists: boolean;
8
+ kind: "primary" | "secondary";
9
+ }
5
10
  export interface DashboardCloseoutEntry {
6
11
  date: string;
7
12
  phaseOrModule: string;
8
13
  fileName: string;
14
+ summary?: string;
9
15
  }
10
16
  export interface OutputAvailability {
11
17
  primary?: {