codecartographer-pi 0.16.0 → 0.17.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 (40) hide show
  1. package/.codecarto/GUIDE.md +15 -2
  2. package/.codecarto/README.md +3 -0
  3. package/.codecarto/broadside/SKILL.md +143 -0
  4. package/.codecarto/broadside/config.yaml +104 -0
  5. package/.codecarto/findings/broadside-scout/README.md +20 -0
  6. package/.codecarto/findings/broadside-scout/SKILL.md +101 -0
  7. package/.codecarto/skills/spec-delta-application/SKILL.md +3 -1
  8. package/.codecarto/templates/backlog-project.md +51 -0
  9. package/.codecarto/templates/broadside-scout-brief.md +97 -0
  10. package/.codecarto/{THREAD_LOG.md → templates/thread-log.md} +2 -5
  11. package/.codecarto/workflow/pipeline-scout-first.yaml +271 -0
  12. package/.codecarto/workflow/scaffold-version.yaml +1 -1
  13. package/README.md +47 -2
  14. package/agent-skill/codecartographer/SKILL.md +3 -1
  15. package/agent-skill/codecartographer/references/broadside.md +115 -0
  16. package/agent-skill/codecartographer/references/library.md +1 -1
  17. package/agent-skill/codecartographer/references/pipeline-selection.md +14 -0
  18. package/dist/core/broadside.d.ts +421 -0
  19. package/dist/core/broadside.js +2349 -0
  20. package/dist/core/completion.js +20 -4
  21. package/dist/core/index.d.ts +1 -0
  22. package/dist/core/index.js +1 -0
  23. package/dist/core/library.d.ts +22 -0
  24. package/dist/core/library.js +101 -1
  25. package/dist/core/orchestrator-config.js +5 -2
  26. package/dist/core/pipeline.js +1 -0
  27. package/dist/core/status.js +9 -1
  28. package/dist/core/utils.js +7 -1
  29. package/dist/core/workspace.d.ts +17 -0
  30. package/dist/core/workspace.js +68 -2
  31. package/dist/extensions/codecarto/agent-runner.js +6 -0
  32. package/dist/extensions/codecarto/broadside-flags.d.ts +21 -0
  33. package/dist/extensions/codecarto/broadside-flags.js +116 -0
  34. package/dist/extensions/codecarto/index.js +232 -4
  35. package/dist/mcp-server/server.d.ts +22 -0
  36. package/dist/mcp-server/server.js +218 -11
  37. package/package.json +10 -1
  38. package/.codecarto/BACKLOG.md +0 -184
  39. package/.codecarto/CHANGELOG-2026-05-02-feedback-pass.md +0 -118
  40. package/.codecarto/closeouts/2026-05-02-framework-feedback-pass.md +0 -111
@@ -57,6 +57,7 @@ Read these files in order before doing any analysis:
57
57
  4. `scratch/checkpoints/<phase>.md`, if present, to resume durable in-phase progress after compaction or interruption.
58
58
  5. The current phase's `SKILL.md` for detailed instructions on what to analyze and produce.
59
59
  6. The output template from `templates/` for the current phase (if starting a new output).
60
+ 7. `broadside/synthesis.md`, if a Broad-Side batch reconnaissance run has completed — it carries unverified scouting leads (see `broadside/SKILL.md`) that tell you where the interactive phases should spend attention.
60
61
 
61
62
  All paths in this guide are relative to `.codecarto/` unless stated otherwise.
62
63
 
@@ -71,7 +72,7 @@ Some files in this workspace are **read-only instructions** and must not be modi
71
72
  | Category | Files | Access |
72
73
  |---|---|---|
73
74
  | Orchestration (read-only) | `GUIDE.md`, `CONTRIBUTING.md`, `LICENSE` | Read only. Never modify. |
74
- | Skills (read-only) | `findings/*/SKILL.md`, `findings/defect-scan/passes/*.md`, `skills/*/SKILL.md` | Read only. Never modify. |
75
+ | Skills (read-only) | `findings/*/SKILL.md`, `findings/defect-scan/passes/*.md`, `skills/*/SKILL.md`, `broadside/SKILL.md` | Read only. Never modify. |
75
76
  | Templates (read-only) | `templates/*.md` | Read only. Never modify. |
76
77
  | Pipeline definitions (read-only) | `workflow/pipeline*.yaml`, `workflow/VALIDATE.md` | Read only. Never modify. |
77
78
  | Source code (read-only) | `../` (everything outside `.codecarto/`) | Read only. Analyze but never modify. |
@@ -83,11 +84,17 @@ Some files in this workspace are **read-only instructions** and must not be modi
83
84
  | Closeouts (framework-owned) | `closeouts/<date>-<phase-or-module>.md`, `THREAD_LOG.md` | Completion writes or updates one canonical closeout and one idempotent index entry. |
84
85
  | Conventions (orchestrator-maintained) | `CONVENTIONS.md` | Cross-cutting patterns promoted to project-wide invariants. Phase executors propose; the orchestrator promotes at the phase boundary — in inline runs, the same chat changing hats. |
85
86
  | Decisions (orchestrator-maintained, append-only) | `DECISIONS.md` | Numbered log of decisions that diverge from spec, prompt, or obvious-default. Completion appends each handoff's `decisions` under `## Completion log`; the orchestrator may re-file entries into categories. |
86
- | Backlog (read-write) | `BACKLOG.md` | Deferred items with rationale. |
87
+ | Backlog (orchestrator-maintained) | `BACKLOG.md` | Work this project decided to **defer**, with the reasoning, the preconditions for revisiting, and the smallest viable form. Seeded from `templates/backlog-project.md` at init. |
87
88
  | Scratch (read-write) | `scratch/*` | Working notes; `scratch/checkpoints/<phase>.md` is the durable in-phase continuation checkpoint until the phase validates; `scratch/spikes/<spike-id>/<scenario>.md` holds spike reports (`templates/spike-report.md`); `scratch/amendments/<slug>.yaml` holds post-pipeline amendments (`templates/amendment.yaml`). |
88
89
 
89
90
  If you are uncertain whether a file should be modified, treat it as read-only.
90
91
 
92
+ ### Two things named "backlog", and neither is the other
93
+
94
+ - **`BACKLOG.md` in this workspace** is *this project's* deferrals: work the project chose not to do yet. `DECISIONS.md` records what the project decided to **do**; `BACKLOG.md` records what it decided to **defer**. Deferrals get no `D` number. When a deferred item is later picked up, remove its entry here and record the decision in `DECISIONS.md`.
95
+ - **`status.yaml`'s `post_pipeline` list** is framework-owned lifecycle state, not this file. Items there are retired by `codecarto_amend`, never by hand.
96
+ - **CodeCartographer's own backlog** — deferred improvements to the *framework* — lives in the CodeCartographer repository, not in your workspace. If a phase prompt misled you or a validation criterion did not fit, that is feedback to the framework; it does not belong in this file.
97
+
91
98
  ## Pipeline Selection
92
99
 
93
100
  Seven pipeline variants are available. Check the `pipeline` field in `workflow/status.yaml` to see which is active.
@@ -98,6 +105,7 @@ Seven pipeline variants are available. Check the `pipeline` field in `workflow/s
98
105
  | Variant | File | Phases | When to use |
99
106
  |---|---|---|---|
100
107
  | Full with deep audit (default) | `workflow/pipeline-full-with-deep-audit.yaml` | architecture → defect-scan-mechanical → contracts → protocols → defect-scan-semantic → porting → reimplementation-spec | Complete analysis with defect scan split into an early mechanical pass and a deep semantic pass; reimplementation designs around defects with full context |
108
+ | Scout first | `workflow/pipeline-scout-first.yaml` | broadside-scout → architecture → defect-scan-mechanical → contracts → protocols → defect-scan-semantic → porting → reimplementation-spec | The deep-audit run behind a Broad-Side routing brief: the scout phase distills an existing batch reconnaissance run into leads addressed to later phases, each of which must confirm, dismiss, or carry them forward. Leads are never evidence |
101
109
  | Full with audit | `workflow/pipeline-full-with-audit.yaml` | architecture → defect-scan → contracts → protocols → porting → reimplementation-spec | Single early defect scan; cheaper than the deep variant when you do not need contracts/protocols-grounded defect findings |
102
110
  | Full | `workflow/pipeline.yaml` | architecture → contracts → protocols → porting → reimplementation-spec | Porting bundle without defect scan |
103
111
  | Defect scan | `workflow/pipeline-defect-scan.yaml` | architecture → defect-scan | Maintenance audit to surface latent problems |
@@ -303,6 +311,7 @@ your-repo/
303
311
  SKILL.md
304
312
  workflow/
305
313
  pipeline-full-with-deep-audit.yaml # 7-phase pipeline with split defect scan (default).
314
+ pipeline-scout-first.yaml # 8-phase: deep audit behind a broadside-scout routing brief.
306
315
  pipeline-full-with-audit.yaml # 6-phase pipeline with single early defect scan.
307
316
  pipeline.yaml # 5-phase (no defect scan).
308
317
  pipeline-defect-scan.yaml # 2-phase (architecture + defect scan).
@@ -313,6 +322,10 @@ your-repo/
313
322
  VALIDATE.md # Validation protocol. Run after every phase.
314
323
  closeouts/ # Per-session closeout files (replaces monolithic THREAD_LOG body).
315
324
  <YYYY-MM-DD>-<phase-or-module>.md
325
+ broadside/ # Batch reconnaissance state and results (see broadside/SKILL.md).
326
+ SKILL.md # How to read Broad-Side scouting leads (unverified, not evidence).
327
+ config.yaml # Broad-Side model/key/lens configuration.
328
+ <run-id>/ # Per-run JSON + markdown findings, run-meta.json, synthesis report.
316
329
  CONVENTIONS.md # (Optional, project-grown) Cross-cutting invariants. Orchestrator-maintained.
317
330
  DECISIONS.md # (Optional, project-grown) Numbered decisions log. Orchestrator-maintained.
318
331
  BACKLOG.md # (Optional) Deferred items with rationale.
@@ -31,6 +31,7 @@ The default is the 7-phase **full-with-deep-audit** pipeline, which splits the d
31
31
 
32
32
  ```yaml
33
33
  pipeline: workflow/pipeline-full-with-deep-audit.yaml # 7-phase with split defect scan (default; depth-first)
34
+ pipeline: workflow/pipeline-scout-first.yaml # 8-phase: the deep-audit run behind a broadside-scout brief (Pi/MCP only)
34
35
  pipeline: workflow/pipeline-full-with-audit.yaml # 6-phase with single early defect scan — adjust phases to use one defect-scan
35
36
  pipeline: workflow/pipeline.yaml # 5-phase without defect scan — remove defect-scan phases
36
37
  pipeline: workflow/pipeline-defect-scan.yaml # 2-phase defect audit — remove contracts through reimplementation-spec
@@ -39,4 +40,6 @@ pipeline: workflow/pipeline-architecture-only.yaml # 1-phase quick overview
39
40
  pipeline: workflow/pipeline-synthesis.yaml # 4-phase forward synthesis — vision + confirmed library specs → project plan (Pi/MCP only)
40
41
  ```
41
42
 
43
+ The scout-first pipeline is the deep-audit run with one phase in front of it: `broadside-scout` distills a completed Broad-Side batch reconnaissance run into `findings/broadside-scout/scout-brief.md`, and the six phases after it read that brief and must account for the leads routed to them. Firing the reconnaissance run itself needs Pi or MCP; the scout phase only reads what a run already wrote, so with no run on disk it produces an explicitly empty brief and the pipeline proceeds.
44
+
42
45
  The synthesis pipeline is different from the analysis variants: it requires Pi or MCP, a configured non-empty CodeCartographer library, and a completed `inputs/vision.md`. It pauses after proposing candidate specs and will not merge or finalize until the user changes at least one proposal checkbox from `[ ]` to `[x]`.
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: broadside
3
+ description: Interpret a Broad-Side batch reconnaissance run. Use after codecarto_broadside collect has produced .codecarto/broadside/<run>/ results, to triage scouting signals before or during an interactive CodeCartographer pipeline run.
4
+ ---
5
+
6
+ # Broad-Side
7
+
8
+ Broad-Side is CodeCartographer's batch reconnaissance pass. It fires six
9
+ analysis lenses — architecture, API surface, security, mechanical defect scan,
10
+ convention extraction, and porting — at the repository as single-turn prompts
11
+ over the OpenRouter Batch API (~50% of sync pricing, asynchronous, unattended),
12
+ then synthesizes one cross-lens report. Results live under
13
+ `.codecarto/broadside/<run>/` alongside this file.
14
+
15
+ ## What Broad-Side findings are — and are not
16
+
17
+ Broad-Side findings are **unverified scouting signals**, not validated claims.
18
+ Every lens is one shot: no cross-file traversal, no runtime verification, no
19
+ builds, no tests, no follow-up questions. The batch model is cheap, not strong.
20
+ Treat every finding as a lead with a file:line pointer that the interactive
21
+ pipeline — or you — must confirm before it is a fact.
22
+
23
+ This is the division of labor: Broad-Side is cheap enough to run on any repo to
24
+ decide where the expensive interactive run should spend its attention. It does
25
+ not replace any phase; it tells phases where to look.
26
+
27
+ ## Reading a Broad-Side run
28
+
29
+ 1. Read `synthesis.md` first. It carries the executive summary, severity counts,
30
+ the top cross-lens findings, and per-module risk levels.
31
+ 2. Read `triage.md` for the work order: each lead scored by impact ×
32
+ difficulty with a P0–P3 priority and an effort estimate. It is a starting
33
+ point for re-verification, not a commitment — every item still needs
34
+ confirmation against the source before work begins.
35
+ 3. Read the per-lens files behind anything that matters to your current phase:
36
+ - `architecture-*.json` → the architecture phase's seed of prior knowledge
37
+ - `api-*.json` → endpoints and data types (contracts/protocols phases)
38
+ - `security-*.json` → auth, trust boundaries (defect-scan-semantic pass 5)
39
+ - `defect-*.json` → mechanical defect leads (defect-scan-mechanical)
40
+ - `conventions-*.json` → naming/idiom candidates for CONVENTIONS.md
41
+ - `porting-*.json` → platform coupling (porting phase)
42
+ 4. `run-meta.json` records scope: which lenses ran, at what cost, with what
43
+ coverage caps.
44
+
45
+ ## How to use the leads
46
+
47
+ - **A finding that matches your phase's scope is a starting point, not an answer.**
48
+ Re-derive it from the source yourself; cite the source, not the Broad-Side
49
+ report. Broad-Side output is not evidence.
50
+ - **Route, don't believe.** A Broad-Side "high" that your phase can neither
51
+ confirm nor dismiss becomes an open question with `needs-runtime-test` or
52
+ `needs-maintainer-decision` — never a finding.
53
+ - **Promotable conventions are candidates only.** CONVENTIONS.md promotions
54
+ still require the orchestrator's review against the code, per the usual
55
+ promotion rules.
56
+ - **Coverage caps are real.** Directory-sliced lenses cap each slice's input;
57
+ `run-meta.json` and the synthesis `coverage` field say what was scanned.
58
+ Everything outside that is unscouted, not clean.
59
+
60
+ ## Running Broad-Side
61
+
62
+ Broad-Side is an executable-surface feature. On the Pi extension:
63
+
64
+ ```
65
+ /codecarto-broadside submit [lenses…] # prices the run, asks, then fires
66
+ /codecarto-broadside collect # poll, save, synthesize
67
+ /codecarto-broadside status # show recorded runs
68
+ /codecarto-broadside models # compare batch models
69
+ ```
70
+
71
+ On the MCP server:
72
+
73
+ ```
74
+ codecarto_broadside {cwd, action: "submit", lenses: [...]} # fire the batches
75
+ codecarto_broadside {cwd, action: "collect"} # poll, save, synthesize
76
+ codecarto_broadside {cwd, action: "status"} # show recorded runs
77
+ codecarto_broadside {cwd, action: "models"} # compare batch models
78
+ ```
79
+
80
+ The `models` action lists every `:batch` variant on OpenRouter — pricing per
81
+ million tokens, context window, output ceiling, structured-output support, and
82
+ (optionally) Artificial Analysis coding indices — cheapest first, with the
83
+ configured model marked. Use it before switching models in `config.yaml`.
84
+ Submits pre-flight the chosen model: pricing comes from the live catalog
85
+ (cached 24h), requests clamp to the provider's completion ceiling, and a
86
+ model that does not advertise structured-output support is refused outright,
87
+ because every lens depends on `json_schema` response_format.
88
+
89
+ Collect runs two cross-lens post-passes by default: **synthesis** (the
90
+ executive report) and **triage** (the prioritized work order). Pass
91
+ `include_synthesis: false` or `include_triage: false` on collect to skip one.
92
+
93
+ Lenses do not all have to run on the same model. `lens_models` in `config.yaml`
94
+ routes individual lenses to their own batch model — the usual reason being that
95
+ a stronger model changes security and defect findings more than it changes an
96
+ architecture map. Each override is priced, capability-checked, and clamped like
97
+ the default, the submit estimate breaks cost out per lens, and `run-meta.json`
98
+ records which lens ran on what. No stronger default is shipped: which model is
99
+ worth the money depends on the repository and the budget, so compare with the
100
+ `models` action and decide.
101
+
102
+ Every run knob — `incremental`, `retry_truncated`, `include_synthesis`,
103
+ `include_triage`, `wait_seconds` — also has a repository default under the same
104
+ name in this directory's `config.yaml`, alongside `model`, `api_key`,
105
+ `default_lenses`, `max_cost`, and the `pricing` overrides. An explicit
106
+ parameter on the call always wins over the file.
107
+
108
+ This file is also served directly: `codecarto_skill {cwd, name: "broadside"}`
109
+ returns it. Unlike the post-pipeline skills under `.codecarto/skills/`, it is
110
+ not gated on a completed pipeline — a scout run is meant to be read before the
111
+ pipeline starts and while it runs.
112
+
113
+ It works on any git repository — no initialized workspace required — and needs
114
+ an OpenRouter API key via the `api_key` parameter, the `OPENROUTER_API_KEY`
115
+ environment variable, or `api_key` in this directory's `config.yaml`.
116
+
117
+ Submits are priced before they fire: Broad-Side estimates the run from the
118
+ collected file sizes against the model's live per-token pricing and refuses
119
+ when the estimate exceeds `max_cost` (`config.yaml` or the tool parameter)
120
+ unless `force` is passed. See `config.yaml` for the model, limit, and manual
121
+ pricing-override keys.
122
+
123
+ The `max_cost` guardrail is an **estimate-based pre-flight limit**, distinct
124
+ from OpenRouter's runtime cost tracking: it predicts from file sizes before
125
+ spend, it does not stop a batch mid-flight. Actual spend appears in
126
+ `run-meta.json` after collect.
127
+
128
+ ## Resilience notes
129
+
130
+ - **Truncation is spoken.** A lens output whose JSON does not parse — even
131
+ after code-fence stripping — is saved verbatim but marked `truncated`:
132
+ the collect summary counts it, `run-meta.json` records it, and the
133
+ synthesis prompt is told its module is unrepresented, not clean.
134
+ - **Resubmission is always safe.** Batch requests are pure (no tools, no
135
+ filesystem, no side effects), so a failed or truncated slice can be
136
+ resubmitted freely. This is the same retry-safety rule OpenRouter's
137
+ headless-agent scaffold enforces for tool-using agents ("retry only
138
+ before tool calls"); Broad-Side satisfies it by construction. If
139
+ Broad-Side ever gains server tools, this invariant becomes load-bearing.
140
+ - **Field shapes** for the model catalog and benchmarks endpoints follow
141
+ the official OpenRouter skills (`OpenRouterTeam/skills`:
142
+ `openrouter-models`, `openrouter-benchmarks`) — consult them when
143
+ extending catalog parsing.
@@ -0,0 +1,104 @@
1
+ # Broad-Side batch reconnaissance configuration. Optional.
2
+ # Missing keys fall back to the defaults listed below.
3
+
4
+ # OpenRouter model to use for batch requests. The default is Google Gemini
5
+ # 3.7 Flash (batch) — the cheapest batch model with tool-calling support and
6
+ # a 1M-token context window. Change this to another OpenRouter batch model
7
+ # if you need a different cost/capability trade-off. To compare what's
8
+ # available, run codecarto_broadside with action "models" — it lists every
9
+ # :batch variant with pricing, context, output caps, structured-output
10
+ # support, and optional coding benchmarks. Beware the expensive end of that
11
+ # list — some batch models exceed $80 per million output tokens — and note
12
+ # that every lens requires structured-output (json_schema) support, which
13
+ # submit refuses to proceed without.
14
+ #
15
+ # model: google/gemini-3.7-flash:batch
16
+
17
+ # OpenRouter API key. Prefer the OPENROUTER_API_KEY environment variable —
18
+ # keys in this file are committed if you track .codecarto/ after init.
19
+ # The codecarto_broadside tool also accepts api_key as a parameter.
20
+ #
21
+ # api_key: ""
22
+
23
+ # Default lens set for codecarto_broadside submit when no lenses are
24
+ # specified. All six lenses are on by default. Remove a lens id to skip it
25
+ # globally, or pass an explicit lenses array on the submit call to override.
26
+ #
27
+ # default_lenses:
28
+ # - architecture
29
+ # - api
30
+ # - security
31
+ # - defect
32
+ # - conventions
33
+ # - porting
34
+
35
+ # Per-lens model overrides. A lens listed here runs on its own model; every
36
+ # other lens uses the `model` above. This is how you spend more where it pays:
37
+ # the cheap default is right for architecture and conventions, while security
38
+ # and defect findings are the ones a stronger model most changes. Each override
39
+ # is pre-flighted like the default — priced from the live catalog, refused
40
+ # without structured-output support, and clamped to its own completion ceiling
41
+ # — and the submit estimate breaks the cost out per lens so a mixed-model run
42
+ # cannot be approved without seeing which lens costs what.
43
+ #
44
+ # There is deliberately no stronger default shipped here: which model is worth
45
+ # the money for the semantic lenses depends on your repository and your budget,
46
+ # and picking one for you would spend your money on our guess. Compare
47
+ # candidates with the `models` action first.
48
+ #
49
+ # lens_models:
50
+ # security: anthropic/claude-opus-4.5:batch
51
+ # defect: anthropic/claude-opus-4.5:batch
52
+
53
+ # Approximate run expense limit in USD (0 = no limit). Before submitting,
54
+ # Broad-Side estimates the run cost from the collected file sizes and the
55
+ # model's per-token pricing — fetched live from OpenRouter's model catalog
56
+ # and cached for 24h. If the estimate exceeds max_cost, submit refuses and
57
+ # prints the per-lens breakdown; pass force: true to override, or set a
58
+ # value here so every run is guarded by default.
59
+ #
60
+ # This is a pre-flight estimate guardrail, not a runtime stop: OpenRouter
61
+ # bills actual usage, which may differ from the estimate either direction.
62
+ # Actual cost lands in each run's run-meta.json after collect.
63
+ #
64
+ # max_cost: 1.00
65
+
66
+ # Manual pricing overrides in USD per MILLION tokens. Normally Broad-Side
67
+ # looks the model's pricing up automatically; set both fields only when the
68
+ # lookup fails (offline, private model) or you want to assert a ceiling.
69
+ #
70
+ # pricing:
71
+ # input_per_m: 0.1875
72
+ # output_per_m: 0.9375
73
+ # ---------------------------------------------------------------------------
74
+ # Run defaults. Each key below mirrors a codecarto_broadside parameter of the
75
+ # same name and sets this repository's default for it; an explicit parameter on
76
+ # the call always wins. Set them here when a repo's scouting policy is stable,
77
+ # so it does not have to be restated on every submit and collect.
78
+
79
+ # Scan only the modules whose files changed since the previous run's git HEAD.
80
+ # Falls back to a full scan on a dirty tree or when no prior run exists.
81
+ #
82
+ # incremental: false
83
+
84
+ # Re-submit lens results that came back truncated at the output token limit,
85
+ # once, with a doubled output cap. Truncation is always reported either way.
86
+ #
87
+ # retry_truncated: true
88
+
89
+ # Run the cross-lens synthesis pass (synthesis.md, the executive report) once
90
+ # every lens batch completes.
91
+ #
92
+ # include_synthesis: true
93
+
94
+ # Run the triage pass (triage.md, the P0-P3 work order) once every lens batch
95
+ # completes.
96
+ #
97
+ # include_triage: true
98
+
99
+ # Default poll budget in seconds. 0 returns as soon as the batches are
100
+ # submitted or the recorded state is read; a positive value polls that long
101
+ # before returning with whatever is done. Batch jobs routinely take tens of
102
+ # minutes, so a submit-then-collect-later rhythm is normal.
103
+ #
104
+ # wait_seconds: 0
@@ -0,0 +1,20 @@
1
+ # Broad-Side Scout
2
+
3
+ Distills a completed Broad-Side batch reconnaissance run into a routing brief.
4
+ Runs first, before architecture, in the `pipeline-scout-first` workflow.
5
+
6
+ **Primary output:** `scout-brief.md`
7
+
8
+ **Depends on:** nothing in the pipeline. It reads what a prior
9
+ `/codecarto-broadside` (Pi) or `codecarto_broadside` (MCP) run wrote under
10
+ `broadside/<run>/`. It never submits a batch and never spends; with no run on
11
+ disk it produces an explicitly empty brief and the pipeline proceeds.
12
+
13
+ **Consumed by:** architecture, defect-scan-mechanical, contracts, protocols,
14
+ defect-scan-semantic, and porting, each of which must account for the leads
15
+ routed to it at validation. `reimplementation-spec` deliberately does not read
16
+ it — the porting bundle is that phase's compression boundary.
17
+
18
+ Everything in the brief is an unverified scouting lead. No phase may cite it,
19
+ or any file under `broadside/`, as a source. See `SKILL.md`, and
20
+ `broadside/SKILL.md` for how to read the underlying run.
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: broadside-scout
3
+ description: Distill a completed Broad-Side batch reconnaissance run into a routing brief the later phases read. Runs first, before architecture, in the scout-first pipeline. Produces leads with a target phase for each — never findings, never evidence.
4
+ ---
5
+
6
+ # Broad-Side Scout
7
+
8
+ This phase turns a Broad-Side batch reconnaissance run into a **routing brief**:
9
+ a short document that tells each later phase where to spend its attention
10
+ first. It runs before architecture, and everything downstream reads it.
11
+
12
+ The source code to analyze is in the parent directory (`../` relative to
13
+ `.codecarto/`).
14
+
15
+ ## This phase spends no money
16
+
17
+ Broad-Side itself is fired by `/codecarto-broadside submit` (Pi) or
18
+ `codecarto_broadside` (MCP), and it is priced and confirmed there. This phase
19
+ only reads what those already wrote under `broadside/<run>/`. It never submits
20
+ a batch, and it must never instruct anyone to.
21
+
22
+ If no run exists, that is a legitimate outcome — see "When there is no run."
23
+
24
+ ## What you are reading, and what it is worth
25
+
26
+ Broad-Side findings are **unverified scouting signals** produced by a cheap
27
+ batch model in a single shot: no cross-file traversal, no runtime
28
+ verification, no builds, no tests, no follow-up questions.
29
+
30
+ The entire value of this phase is routing attention. The entire risk is that a
31
+ lead gets copied forward as a fact. So the brief you write is a list of
32
+ *places to look*, each addressed to a phase, and every entry carries the
33
+ source pointer that phase must confirm for itself.
34
+
35
+ Nothing you write here is evidence. No later phase may cite this brief, or any
36
+ file under `broadside/`, as a source for a finding. A later phase cites the
37
+ code it confirmed.
38
+
39
+ ## Reading the run
40
+
41
+ 1. Find the most recent run directory under `broadside/`. If several exist,
42
+ use the newest and say which one you used.
43
+ 2. `broadside/<run>/synthesis.md` — the executive summary, severity counts,
44
+ top cross-lens findings, per-module risk. Start here.
45
+ 3. `broadside/<run>/triage.md` — the same findings scored by impact ×
46
+ difficulty into a P0–P3 order with effort estimates.
47
+ 4. `broadside/<run>/run-meta.json` — which lenses ran, at what cost, with what
48
+ coverage caps. This is where you learn what was *not* scanned.
49
+ 5. The per-lens files only when a lead matters enough to need its detail.
50
+
51
+ ## Routing
52
+
53
+ Each lead goes to exactly one phase. Use the lens it came from as the default
54
+ routing, and override when the content says otherwise:
55
+
56
+ | Lens | Default target phase |
57
+ |---|---|
58
+ | architecture | `architecture` |
59
+ | api | `contracts`, or `protocols` for wire formats |
60
+ | security | `defect-scan-semantic` |
61
+ | defect | `defect-scan-mechanical` |
62
+ | porting | `porting` |
63
+ | conventions | none — these are candidates for the orchestrator's `CONVENTIONS.md`, not a phase |
64
+
65
+ A lead you cannot route to a phase in the active pipeline is not a lead for
66
+ this run. Drop it and say you dropped it.
67
+
68
+ ## Cutting the list down
69
+
70
+ A brief that forwards everything routes nothing. Keep the leads that would
71
+ change where a phase starts looking, and drop the rest. Two filters:
72
+
73
+ - **Would this phase find it anyway in its first pass?** If yes, it is not
74
+ worth a lead — the phase's own rubric already covers it.
75
+ - **Is it specific enough to check?** A lead without a file or a module is not
76
+ actionable. Note the theme in coverage notes instead of forwarding noise.
77
+
78
+ Prefer 3–8 leads per target phase. If a lens produced far more than that, say
79
+ so in the coverage notes and forward the strongest.
80
+
81
+ ## Coverage is spoken, not implied
82
+
83
+ `run-meta.json` records truncated slices, skipped lenses, and coverage caps.
84
+ Everything outside the sweep is **unscouted, not clean**, and the brief must
85
+ say which parts of the repository were never looked at. A later phase that
86
+ reads "no leads for module X" must be able to tell "the scout found nothing
87
+ there" from "the scout never looked."
88
+
89
+ ## When there is no run
90
+
91
+ If `broadside/` holds no completed run, do not submit one and do not stall the
92
+ pipeline. Write the brief with an empty lead table, state plainly under
93
+ Coverage and limits that no run exists and therefore no module was scouted
94
+ (coverage disposition `NONE`), and validate the coverage criteria against that. Every later phase then proceeds on its own
95
+ rubric, exactly as it would in a pipeline without this phase.
96
+
97
+ ## Output
98
+
99
+ Write the brief to the primary output using
100
+ `templates/broadside-scout-brief.md`. Keep it short: it is read at the top of
101
+ six later phases, and every line costs each of them context.
@@ -26,11 +26,13 @@ Triage every delta into one of four buckets:
26
26
  |---|---|---|
27
27
  | **APPLY** | Delta is a real correction or required addition; the spec is wrong without it. | Edit the spec body. Add a `[revised per <source> §<delta-id>]` marker at the changed section. Record in DELTAS-APPLIED.md. |
28
28
  | **CLARIFY** | Delta proposes wording change; the spec's *meaning* is correct but the language is ambiguous. | Edit the spec wording (not the rule). Record in DELTAS-APPLIED.md as a clarification. |
29
- | **DEFER** | Delta is a real improvement but not load-bearing for the next implementation step. | Add to BACKLOG.md with rationale and a back-reference. Do NOT edit the spec. |
29
+ | **DEFER** | Delta is a real improvement but not load-bearing for the next implementation step. | Add to `BACKLOG.md` with rationale and a back-reference (`templates/backlog-project.md` gives the entry shape). Do NOT edit the spec. |
30
30
  | **REJECT** | Delta is wrong on close reading (premise was incorrect, scope was misread, the rule it proposes already exists, etc.). | Document in DELTAS-APPLIED.md with a one-line rationale. Do NOT edit the spec. |
31
31
 
32
32
  The previous wisdom: any delta you can't decisively bucket should default to DEFER. The cost of a missed correction is one re-application pass; the cost of a bad correction is shipped.
33
33
 
34
+ **DEFER goes to `BACKLOG.md`, not `DECISIONS.md`, and gets no `D` number.** `DECISIONS.md` is for what the project decided to *do*; `BACKLOG.md` is for what it decided to *defer*. A refinement you make while applying a delta — the applied text going beyond the literal proposal — is a decision: record it in the audit file's Decisions Beyond Triage section, and lift it into `DECISIONS.md` only if it is cross-cutting. An existing `D` entry for a proposed delta has its disposition updated in place (`APPLIED 2026-05-03 round-3`); it is never superseded by a new entry when applied.
35
+
34
36
  ## Citation convention
35
37
 
36
38
  Every applied or clarified delta leaves a citation marker in the spec body so a future reader can trace the change back to its source.
@@ -0,0 +1,51 @@
1
+ # Backlog
2
+
3
+ Project-level deferrals: work this project decided **not** to do yet, with the reasoning
4
+ that made deferring the right call. One entry per deferral.
5
+
6
+ This is the project's backlog, not CodeCartographer's. Items about the framework itself —
7
+ a phase prompt that misled you, a validation criterion that does not fit — belong in
8
+ feedback to the framework, not here.
9
+
10
+ **BACKLOG vs DECISIONS.** `DECISIONS.md` records what the project decided to **do**;
11
+ this file records what it decided to **defer**. Deferrals get no `D` number. If a deferred
12
+ item is later picked up, remove its entry here and record the decision in `DECISIONS.md`.
13
+
14
+ ## Format
15
+
16
+ ```
17
+ ## <ID>. <Short title>
18
+
19
+ **Raised by:** <closeout file, phase, or DECISIONS.md entry that produced this deferral>
20
+
21
+ **Why deferred:** <the reasoning — what made this not worth doing now, not just "later">
22
+
23
+ **Preconditions:** <what has to land before this can be revisited: a module, an artifact,
24
+ a decision, an answer to an open question. "None" is a valid answer, but say so.>
25
+
26
+ **Smallest viable form:** <the least you could build that would settle the item, so whoever
27
+ picks it up does not have to redesign it from scratch>
28
+ ```
29
+
30
+ ## Entries
31
+
32
+ <!--
33
+ Append entries below this marker. Number them however the project prefers (B1, B2, … is
34
+ the convention the framework's own backlog uses).
35
+
36
+ Example:
37
+
38
+ ## B1. Retry policy for the upload path
39
+
40
+ **Raised by:** closeouts/2026-03-14-contracts.md
41
+
42
+ **Why deferred:** The contracts phase found no documented retry behavior, but nothing
43
+ downstream depends on knowing it — the porting phase can treat uploads as at-most-once
44
+ and flag the gap.
45
+
46
+ **Preconditions:** A protocols-phase answer on whether the server deduplicates by
47
+ request id. Without that, any retry policy written here is a guess.
48
+
49
+ **Smallest viable form:** One paragraph in the contracts report stating the observed
50
+ behavior and the assumption downstream phases should hold.
51
+ -->
@@ -0,0 +1,97 @@
1
+ # Broad-Side Scout Brief — [project_name]
2
+
3
+ <!--
4
+ Output template for the `broadside-scout` phase.
5
+ Distills a Broad-Side batch reconnaissance run into leads routed to later
6
+ phases. See findings/broadside-scout/SKILL.md for instructions.
7
+
8
+ Every entry here is an UNVERIFIED lead from a cheap batch model, not a
9
+ finding. No later phase may cite this file as a source.
10
+ -->
11
+
12
+ ## Scout Context
13
+
14
+ - **Run:** `broadside/[run-id]/` (or: no completed run — see Scout Coverage)
15
+ - **Model:** [batch model id]
16
+ - **Lenses that ran:** [list]
17
+ - **Recorded cost:** [from run-meta.json]
18
+ - **Pipeline:** [pipeline variant name]
19
+ - **Date:** [date]
20
+
21
+ > These are unverified scouting leads. Each one is a place to look, not a
22
+ > fact. The receiving phase confirms it against the source and cites the
23
+ > source — never this brief.
24
+
25
+ ---
26
+
27
+ ## Leads by Phase
28
+
29
+ <!--
30
+ One row per lead. Target must be a phase in the active pipeline.
31
+ Source pointer is the file:line (or module) the receiving phase starts from.
32
+ Confidence is the scout's, not yours: high / medium / low.
33
+ Drop anything the target phase would find in its own first pass.
34
+ -->
35
+
36
+ | # | Target phase | Lead | Source pointer | Lens | Scout confidence |
37
+ |---|--------------|------|----------------|------|------------------|
38
+ | 1 | | | | | |
39
+
40
+ ---
41
+
42
+ ## Convention Candidates
43
+
44
+ <!--
45
+ From the conventions lens. These route to the orchestrator's CONVENTIONS.md
46
+ promotion review, not to a phase. Candidates only — promotion still requires
47
+ the orchestrator's review against the code.
48
+ -->
49
+
50
+ | # | Candidate convention | Where the scout saw it |
51
+ |---|----------------------|------------------------|
52
+ | 1 | | |
53
+
54
+ ---
55
+
56
+ ## Leads Dropped
57
+
58
+ <!--
59
+ What you chose not to forward, and why. This is the record that keeps the
60
+ brief short without hiding the discard.
61
+ -->
62
+
63
+ | # | Lead | Why dropped |
64
+ |---|------|-------------|
65
+ | 1 | | |
66
+
67
+ ---
68
+
69
+ ## Coverage and limits
70
+
71
+ <!--
72
+ What the scout scanned, what it did not, and what came back unusable. A
73
+ later phase must be able to tell "the scout found nothing there" from "the
74
+ scout never looked there." Sourced from broadside/<run>/run-meta.json.
75
+ -->
76
+
77
+ - Inspected scope: [modules scanned, or "whole repository in one slice"]
78
+ - Skipped scope: [modules the lens globs, slicing cap, or incremental diff excluded; lenses skipped, with reason]
79
+ - Evidence basis: batch-model scouting signals only — no source inspection, no tests, no runtime verification
80
+ - Known blind spots: [truncated slices and the modules they covered; everything under Skipped scope is unscouted, not clean]
81
+ - Coverage disposition: COMPLETE | PARTIAL | NONE (no completed Broad-Side run)
82
+
83
+ ## Validation
84
+
85
+ <!-- Fill in this table per workflow/VALIDATE.md. The rows below match the broadside-scout scope. -->
86
+
87
+ | # | Criterion | Result | Evidence |
88
+ |---|-----------|--------|----------|
89
+ | 1 | Every forwarded lead names a target phase in this pipeline and a source pointer the target phase can start from. | PASS / PARTIAL / FAIL | |
90
+ | 2 | Every lead is marked as an unverified scouting signal; none is stated as a fact or cited as evidence. | PASS / PARTIAL / FAIL | |
91
+ | 3 | Leads dropped rather than forwarded are recorded with a reason. | PASS / PARTIAL / FAIL | |
92
+ | 4 | Convention candidates are routed to the orchestrator's CONVENTIONS.md review, not to a phase. | PASS / PARTIAL / FAIL | |
93
+ | 5 | When no completed Broad-Side run exists, the brief says so explicitly and forwards no leads. | PASS / PARTIAL / FAIL | |
94
+ | 6 | Coverage and limits name inspected scope, skipped scope, evidence basis, and blind spots. | PASS / PARTIAL / FAIL | |
95
+
96
+ **Validated by:** [session identifier or date]
97
+ **Overall:** PASS / PASS WITH GAPS / FAIL
@@ -19,8 +19,7 @@ heredoc-vs-edit sync risks that bite append-to-large-file workflows once the fil
19
19
 
20
20
  Before appending, scan the bottom 5 entries. If you see a line with the same date AND same
21
21
  phase-or-module AND same summary, do not append — the prior session already wrote it. The
22
- framework has no programmatic dedup gate; this is human-discipline. (See
23
- `Apply 20 spec deltas to Thaumaturge.txt` for the incident that established this rule.)
22
+ framework has no programmatic dedup gate; this is human-discipline.
24
23
 
25
24
  A one-liner to surface duplicates from the shell:
26
25
 
@@ -33,7 +32,5 @@ grep -E '^- [0-9]{4}-[0-9]{2}-[0-9]{2}' .codecarto/THREAD_LOG.md | sort | uniq -
33
32
  <!--
34
33
  Append one line per session below this marker.
35
34
  Example:
36
- - 2026-05-02framework-feedback-passapplied 6 spec-blockers + 5 clarifications from FEEDBACK_INDEX.md — [closeout](closeouts/2026-05-02-framework-feedback-pass.md)
35
+ - 2026-03-14architecturemapped 14 packages across 3 layers; wire formats deferred to protocols — [closeout](closeouts/2026-03-14-architecture.md)
37
36
  -->
38
-
39
- - 2026-05-02 — framework-feedback-pass — applied 6 spec-blockers + 5 clarifications from FEEDBACK_INDEX.md; 14 deferred to BACKLOG.md — [closeout](closeouts/2026-05-02-framework-feedback-pass.md)