@arbiterforge/ca-pi 0.10.12 → 0.14.6

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 (58) hide show
  1. package/README.md +6 -5
  2. package/package.json +2 -1
  3. package/plugins/ca-pi/CHANGELOG.md +165 -0
  4. package/plugins/ca-pi/SKILLS.md +1 -1
  5. package/plugins/ca-pi/SPRINT.md +40 -10
  6. package/plugins/ca-pi/agents/backend-author.md +1 -1
  7. package/plugins/ca-pi/agents/frontend-author.md +1 -1
  8. package/plugins/ca-pi/generated/command-catalog.json +1 -1
  9. package/plugins/ca-pi/helpers/artifacts/ca-artifact-darwin-amd64 +0 -0
  10. package/plugins/ca-pi/helpers/artifacts/ca-artifact-darwin-arm64 +0 -0
  11. package/plugins/ca-pi/helpers/artifacts/ca-artifact-linux-amd64 +0 -0
  12. package/plugins/ca-pi/helpers/artifacts/ca-artifact-linux-arm64 +0 -0
  13. package/plugins/ca-pi/helpers/artifacts/ca-artifact-windows-amd64.exe +0 -0
  14. package/plugins/ca-pi/helpers/artifacts/ca-artifact-windows-arm64.exe +0 -0
  15. package/plugins/ca-pi/helpers/artifacts/release.json +38 -0
  16. package/plugins/ca-pi/hooks/_approvallib.py +355 -0
  17. package/plugins/ca-pi/hooks/_artifactlib.py +855 -0
  18. package/plugins/ca-pi/hooks/_cleanuplib.py +1553 -0
  19. package/plugins/ca-pi/hooks/_hooklib.py +37 -13
  20. package/plugins/ca-pi/hooks/_host.py +1 -1
  21. package/plugins/ca-pi/hooks/_intentlib.py +31 -0
  22. package/plugins/ca-pi/hooks/_planfilelib.py +34 -1
  23. package/plugins/ca-pi/hooks/_protectedstatelib.py +11 -1
  24. package/plugins/ca-pi/hooks/_readinjectlib.py +120 -0
  25. package/plugins/ca-pi/hooks/_releaselib.py +933 -85
  26. package/plugins/ca-pi/hooks/_standuplib.py +38 -10
  27. package/plugins/ca-pi/hooks/doctor.py +103 -0
  28. package/plugins/ca-pi/hooks/hostapi.py +1 -1
  29. package/plugins/ca-pi/hooks/pi-bridge.py +5 -1
  30. package/plugins/ca-pi/hooks/prompt-submit.py +33 -10
  31. package/plugins/ca-pi/hooks/releasehash.py +46 -32
  32. package/plugins/ca-pi/hooks/session-start.py +5 -4
  33. package/plugins/ca-pi/includes/artifacts.md +166 -0
  34. package/plugins/ca-pi/includes/author-tdd-workflow.md +2 -1
  35. package/plugins/ca-pi/includes/farm.md +27 -4
  36. package/plugins/ca-pi/includes/routing-table.md +2 -2
  37. package/plugins/ca-pi/includes/verification-boundary.md +27 -0
  38. package/plugins/ca-pi/package.json +18 -0
  39. package/plugins/ca-pi/routines/INDEX.md +4 -4
  40. package/plugins/ca-pi/routines/brainstorming/SKILL.md +23 -4
  41. package/plugins/ca-pi/routines/commit-gate/SKILL.md +30 -5
  42. package/plugins/ca-pi/routines/executing-plans/SKILL.md +52 -7
  43. package/plugins/ca-pi/routines/finishing-a-development-branch/SKILL.md +25 -3
  44. package/plugins/ca-pi/routines/refactor/SKILL.md +3 -2
  45. package/plugins/ca-pi/routines/release/SKILL.md +150 -44
  46. package/plugins/ca-pi/routines/subagent-driven-development/SKILL.md +53 -9
  47. package/plugins/ca-pi/routines/subagent-driven-development/references/farm-dispatch.md +20 -3
  48. package/plugins/ca-pi/routines/tdd/SKILL.md +27 -5
  49. package/plugins/ca-pi/routines/using-git-worktrees/SKILL.md +11 -2
  50. package/plugins/ca-pi/routines/writing-plans/SKILL.md +39 -10
  51. package/plugins/ca-pi/routines/writing-plans/references/farm-plan.md +34 -13
  52. package/plugins/ca-pi/skills/ca-chore/SKILL.md +7 -3
  53. package/plugins/ca-pi/skills/ca-commit/SKILL.md +3 -2
  54. package/plugins/ca-pi/skills/ca-doctor/SKILL.md +14 -0
  55. package/plugins/ca-pi/skills/ca-feature/SKILL.md +42 -8
  56. package/plugins/ca-pi/skills/ca-refactor/SKILL.md +4 -2
  57. package/plugins/ca-pi/skills/ca-release/SKILL.md +7 -6
  58. package/plugins/ca-pi/skills/ca-standup/SKILL.md +36 -8
@@ -6,6 +6,19 @@ disable-model-invocation: true
6
6
 
7
7
  # subagent-driven-development
8
8
 
9
+ ## Structured-artifact format boundary
10
+
11
+ New full-lane workflows default to HTML through the installed engine. Existing
12
+ HTML pairs use the same path. Load
13
+ `<plugin-root>/includes/artifacts.md` before HTML artifact I/O;
14
+ its typed identity, binding, receipt, contextual-read, and scope-state rules
15
+ replace rendered-document parsing and direct status-cell edits. Existing
16
+ authoritative Markdown pairs stay on their exact legacy path without conversion.
17
+ A missing, invalid, or unqualified HTML capability must fail closed rather than
18
+ fall back to new Markdown authority. HTML `--farm` dispatch remains disabled.
19
+ Keep every other workflow gate, including human checkpoints, unchanged.
20
+
21
+
9
22
  One task, one fresh subagent, two reviews, proof on a fresh run. Routed to by `/sprint` (full plan,
10
23
  autonomous) and by `executing-plans` (one batch at a time, with human checkpoints between batches).
11
24
  The loop processes tasks in dependency order and never trusts a self-report.
@@ -15,8 +28,15 @@ The loop processes tasks in dependency order and never trusts a self-report.
15
28
  Read these, or STOP and surface the gap — never guess scope, command, or obligation:
16
29
 
17
30
  - `<project-root>/.codearbiter/CONTEXT.md` — the `stage:` frontmatter (the maturity value) and project context.
18
- - `<project-root>/.codearbiter/plans/<slug>.md` — the approved plan. Each task carries an exact path set and a verification command. This is the task source.
19
- - `<project-root>/.codearbiter/specs/<slug>.md` — the approved spec. Each task's obligation traces to it. The spec-compliance review measures against it.
31
+ - The discovered authoritative spec/plan pair. Existing Markdown pairs retain
32
+ their current ledger. For HTML, load `<plugin-root>/includes/artifacts.md`,
33
+ retain the exact artifact identities and engine-written receipts, and read
34
+ the approved spec binding, obligations, paths, verification definitions,
35
+ dependencies, and state only through `identity`, `index`, `outline`,
36
+ symbol-scoped `read`, and `eligible`. The engine `eligible` response is authoritative;
37
+ the workflow must not infer authority from rendered text, checkboxes, status
38
+ words, digests, or caller-supplied labels, and must not read or write a shadow
39
+ Markdown ledger.
20
40
  - `<project-root>/.codearbiter/tech-stack.md` — build, test, and verification invocations; file layout; the scope-to-author mapping.
21
41
  - `<project-root>/.codearbiter/security-controls.md` — only when a task touches a security boundary (auth, crypto, secrets, a trust boundary).
22
42
 
@@ -30,6 +50,18 @@ Pull the next unblocked task from the plan in dependency order. When a `scope` w
30
50
  selection to tasks in that list. A task is one verifiable unit of work with a path set, a spec
31
51
  obligation, and a verification command.
32
52
 
53
+ For HTML, select only a task returned as eligible for the exact selected plan
54
+ identity. Follow contextual `read` pages to completion, retain their context
55
+ ticket, and use `task-start` before author dispatch. Do not translate a displayed
56
+ status or a copied task label into a transition.
57
+
58
+ After process recreation, rediscover the same authoritative pair and query
59
+ `identity` and `eligible` again. Reconcile an interrupted `IN_PROGRESS` task only
60
+ through an authority-backed `task-reconcile`, then redispatch with `task-start`
61
+ and a fresh complete context ticket. A task in `REVIEW` is not accepted on
62
+ resume; obtain fresh evidence when required and finish the current combined
63
+ scope review before `accept-scope`.
64
+
33
65
  - Confirm every dependency task is `ACCEPTED` before selecting.
34
66
  - Confirm no unresolved `[CONFIRM-NN]` blocks the task. One that does halts the loop — see Hard rules.
35
67
 
@@ -74,6 +106,11 @@ traces to — not against whether tests merely pass.
74
106
  - Out-of-scope work the subagent noticed is recorded with an inline `[NEEDS-TRIAGE]` marker — never
75
107
  acted on inside this task.
76
108
 
109
+ For HTML, capture the actual spec-review event against the exact task and
110
+ artifact identities. After the governed verification runner has produced its
111
+ separate receipt, use `task-review` with those two engine-written receipts. A
112
+ digest or the reviewer/subagent's label is not evidence by itself.
113
+
77
114
  Gate: the obligation is fully satisfied and scope is clean. A shortfall returns the task to Phase 2
78
115
  with a corrective brief.
79
116
 
@@ -116,13 +153,13 @@ Gate: the verification command exits clean and its output demonstrates the oblig
116
153
 
117
154
  ## Phase 6 — Accept and advance · gate: BLOCK
118
155
 
119
- Mark the task `ACCEPTED` only when its spec-compliance review and fresh verification passed AND the
120
- scope's Phase 4 quality review passed.
121
- Record acceptance **in the plan file itself** — set the task's `status` cell in
122
- `.codearbiter/plans/<slug>.md` to `ACCEPTED` the moment it is accepted, plus any `[NEEDS-TRIAGE]`
123
- markers and the `.codearbiter/` audit trail. The plan's status column is the pipeline's resume
124
- ledger: an interrupted run is re-entered at the first non-`ACCEPTED` task, and an acceptance that
125
- lives only in conversation context is lost to the interruption.
156
+ Mark a task accepted only when its spec-compliance review and fresh verification
157
+ passed AND the scope's Phase 4 quality review passed. For Markdown, record the
158
+ existing status-cell transition in the plan. For HTML, capture the actual
159
+ combined quality-review event and call `accept-scope` once for the whole scope;
160
+ the resulting engine state and acceptance receipts are the resume ledger. Never
161
+ edit an HTML status cell or create a Markdown counterpart. In either format, an
162
+ acceptance that lives only in conversation context is lost to interruption.
126
163
 
127
164
  - Tasks remain in the current scope → return to Phase 1.
128
165
  - **Scoped invocation** (`scope` was passed by `executing-plans`): all scoped tasks `ACCEPTED` → signal
@@ -130,6 +167,13 @@ lives only in conversation context is lost to the interruption.
130
167
  - **Full-plan invocation** (no `scope`, i.e. `/sprint`): plan complete → hand the branch to
131
168
  `commit-gate`, then to the caller's finishing step. The loop does not commit on its own authority.
132
169
 
170
+ When either path claims the entire HTML plan is currently accepted, invoke the
171
+ installed bridge's `_preflight_current_acceptance` with the exact
172
+ `_resolve_workflow_pair` result, repository-bound client, and engine-returned
173
+ spec/plan IDs. Do not pass or derive authority from a caller label, digest,
174
+ status, or receipt. A refusal means the plan is not complete; return to the
175
+ appropriate execution/reconciliation phase instead of handing off.
176
+
133
177
  Gate: every task in the current scope `ACCEPTED`, the suite green, ready for the caller's next step.
134
178
 
135
179
  ## Hard rules
@@ -9,6 +9,11 @@ designed for — roadmap, not built). It does **not** replace review: every task
9
9
  still routed through Phases 3, 4, and 5 before acceptance. Swapping the worker only changes who *writes*
10
10
  the code, never whether it is *reviewed*. See `<plugin-root>/includes/farm.md` for setup.
11
11
 
12
+ **Current rollout gate:** HTML-backed farm use is disabled. Do not launch it in ordinary feature or
13
+ sprint work until the fresh frontier/low-tier qualification matrix, native payload packaging and real
14
+ authority integration are complete. The checks below define the real qualification boundary; the June
15
+ 2026 run has zero promotion credit. Legacy farm plans with no sibling HTML retain their existing path.
16
+
12
17
  ## Step 1 — Model selection
13
18
 
14
19
  If `FARM_MODEL` env var is set, use it directly and skip selection. Otherwise, prefer a **measured**
@@ -24,7 +29,9 @@ choice over web hearsay:
24
29
  and call `codearbiter_farm_preview` with the project-relative plan plus
25
30
  `canary: true`. It runs the plan's
26
31
  smallest task against each candidate and writes `.farm/canary-report.json` ranked by measured
27
- pass-rate / attempts / latency. Pick the top passing model.
32
+ pass-rate / attempts / latency. For an HTML projection, the shared backend first invokes the pinned
33
+ artifact engine's `farm-verify` canary phase. A missing/stale source binding blocks before worktree,
34
+ report or network activity. Pick the top passing model.
28
35
  4. Surface the choice with its measured basis: "Selected `<model-id>` — canary passed in `<n>` attempts,
29
36
  `<ms>`ms (vs. `<alternatives>`). Proceed, or set `FARM_MODEL` to override." For any opaque codename,
30
37
  add one line of websearched identity context (e.g. "community reports GLM4-based") for the audit log.
@@ -32,8 +39,12 @@ choice over web hearsay:
32
39
  websearch-selected model with a clear warning that the choice is unmeasured; (c) only if all fail,
33
40
  BLOCK and ask the user to set `FARM_MODEL`. Halting the whole feature on a noisy websearch is wrong —
34
41
  exhaust the ladder first.
35
- 6. Write the chosen `meta.model` + `meta.apiBaseUrl` into `plan.json`, and update `.farm/model-cache.json`
36
- (model + timestamp + canary pass-rate) before dispatching.
42
+ 6. Write only the chosen `meta.model` + `meta.apiBaseUrl` into `plan.json`. For an HTML projection,
43
+ immediately call the artifact protocol's `farm-seal` operation with the exact effective model,
44
+ API base URL, bounded selection source and caller-stated origin. These are auditable assertions,
45
+ not independently authenticated provenance. It rejects any other base-projection
46
+ change and seals the exact full execution bytes plus provider identity. Then update
47
+ `.farm/model-cache.json` (model + timestamp + canary pass-rate) before dispatching.
37
48
 
38
49
  ## Step 2 — Farm dispatch
39
50
 
@@ -58,6 +69,12 @@ enforces gates and a zero-token anti-gaming guard, and writes to `<project-root>
58
69
  each task settles (drives completion-order consumption — see Step 2.6)
59
70
  - `diffs/<task-id>.patch` — the actual change per task, for audit
60
71
 
72
+ The built shared dispatcher resolves `ca-artifact` only from its manifest-verified sibling payload.
73
+ It never consults PATH or repository configuration. Immediately before ordinary HTML dispatch it
74
+ invokes `farm-verify` with the effective model and API base URL; missing or mismatched full-byte seals
75
+ fail before creating `.farm/`, worktrees, branches, or network requests. Pi preview uses this same built
76
+ backend and therefore the same guard. Do not bypass it with a source-tree or host-local dispatcher.
77
+
61
78
  Each of those is published twice: once under the run's own artifact directory
62
79
  `<project-root>/.farm/runs/<run-id>/` (the durable, attributable receipt — concurrent runs never
63
80
  overwrite each other's artifacts) and once at the top-level `.farm/` path above as a **latest**
@@ -6,6 +6,18 @@ disable-model-invocation: true
6
6
 
7
7
  # tdd
8
8
 
9
+ ## Authoritative format boundary
10
+
11
+ For an HTML spec/plan pair, load `<plugin-root>/includes/artifacts.md` and use
12
+ the installed structured-artifact engine for artifact I/O. Verify the plan's
13
+ binding to the approved spec, use typed `index`, `outline`, and symbol-scoped `read`,
14
+ and follow contextual pages for the selected task. The workflow must not parse rendered HTML
15
+ for criteria, status, evidence, or authority. Missing or
16
+ invalid HTML capability is a STOP, not a fallback to Markdown. Existing
17
+ authoritative Markdown pairs continue through the legacy path. HTML `--farm`
18
+ dispatch remains blocked.
19
+
20
+
9
21
  Test-first, or it does not ship. Routed to by `/feature` (after spec approval), `/fix`, and `/refactor`.
10
22
 
11
23
  ## Pre-flight
@@ -14,8 +26,13 @@ Read these, or STOP and surface the gap — never guess a command or a threshold
14
26
 
15
27
  - `<project-root>/.codearbiter/CONTEXT.md` — the `stage:` frontmatter (the maturity value) and project context.
16
28
  - `<project-root>/.codearbiter/tech-stack.md` — test, coverage, and lint invocations; file layout; mock patterns.
29
+ - `<plugin-root>/includes/verification-boundary.md` — the required split between focused local proof and exhaustive exact-head hosted CI.
17
30
  - `<project-root>/.codearbiter/coding-standards.md` — style, structure, naming. Required for Phase 3.
18
- - `<project-root>/.codearbiter/specs/<slug>.md` — the approved spec, when `/feature` produced one. It is the primary obligation source.
31
+ - The authoritative approved spec selected by `/feature`. For HTML, read its
32
+ typed criterion records through the installed engine and confirm the paired
33
+ plan's exact binding; for legacy Markdown, read
34
+ `<project-root>/.codearbiter/specs/<slug>.md`. It is the primary obligation
35
+ source.
19
36
  - `<project-root>/.codearbiter/security-controls.md` — only when the change touches a security boundary (auth, crypto, secrets, a trust boundary). Optional; absent on most changes.
20
37
  - `<project-root>/.codearbiter/code-map.md` — if present, a coarse concern→path→role map to orient before writing tests and code. Absent is fine — it is read-on-demand, populated by context-creation or commit-gate heal.
21
38
 
@@ -27,7 +44,10 @@ test is `MISSING`. "We should test X" is not an obligation.
27
44
 
28
45
  Derive every obligation before any code is written, and record each as `ID · source · OPEN`:
29
46
 
30
- - **Spec** — one obligation per acceptance criterion in the approved spec.
47
+ - **Spec** — one obligation per acceptance criterion in the approved spec. For
48
+ HTML, cite the exact artifact ID and criterion ID returned by the engine;
49
+ caller-supplied labels cannot manufacture obligations or widen the approved
50
+ criterion set.
31
51
  - **Contract** — API and input-validation invariants, error responses, boundary conditions.
32
52
  - **Security** — only when `security-controls.md` applies: the assertion that the security-relevant boundary holds.
33
53
 
@@ -66,10 +86,12 @@ obligation `MAPPED` to a failing test. No implementation code is written until t
66
86
  ## Phase 3 — Green · gate: BLOCK
67
87
 
68
88
  Write the **minimum** implementation that satisfies the Phase 2 tests — no speculative logic, no
69
- gold-plating — to the conventions in `coding-standards.md`. Run the full suite. A broken pre-existing
70
- test is a regression: fix it.
89
+ gold-plating — to the conventions in `coding-standards.md`. Run the impact-bounded local tests from
90
+ `verification-boundary.md`: the new regression plus affected pre-existing contracts. A broken
91
+ pre-existing test is a regression: fix it. Exhaustive and cross-platform suites run on exact-head
92
+ hosted CI before merge.
71
93
 
72
- Gate: full suite green, reached by satisfying the Phase 2 tests — not by weakening them. A test's
94
+ Gate: the applicable local suite is green, reached by satisfying the Phase 2 tests — not by weakening them. A test's
73
95
  assertions MUST be unchanged between red and green; only fixtures and setup may move. A relaxed
74
96
  assertion is a gate violation.
75
97
 
@@ -21,8 +21,17 @@ that terminal step into one PR per unit.
21
21
  Read these, or STOP and surface the gap — never guess:
22
22
 
23
23
  - `<project-root>/.codearbiter/CONTEXT.md` — confirm the repo is a git repo and the base/working branch.
24
-
25
- Confirm the caller passed an explicit isolation opt-in AND the parallel unit list (from `plans/<slug>.md`). Absent either, do not stand up worktrees.
24
+ - The discovered authoritative spec/plan pair for the caller's pipeline. Use its
25
+ exact selected plan for the parallel unit list. Re-run the private bridge resolver
26
+ `_resolve_workflow_pair` with the trusted project root and pipeline slug rather
27
+ than reconstructing either path. For an HTML pair, load
28
+ `<plugin-root>/includes/artifacts.md` and obtain
29
+ HTML task and path records only through the installed engine `identity`, `index`, and symbol-scoped `read`
30
+ operations. For a Markdown pair, use its existing Markdown task table. Worktree
31
+ planning must not create, convert, or consult a counterpart.
32
+
33
+ Confirm the caller passed an explicit isolation opt-in AND the parallel unit list
34
+ from the exact selected plan. Absent either, do not stand up worktrees.
26
35
 
27
36
  ## Phase 1 — Provision · gate: BLOCK
28
37
 
@@ -1,18 +1,32 @@
1
1
  ---
2
2
  name: writing-plans
3
- description: The spec-to-plan bridge. Routed to by /feature once the brainstormed spec is approved, and by /sprint before execution. Decomposes the spec into 2–5 minute tasks, each carrying its exact file path(s) and a concrete verification step that maps to a tdd obligation. Writes the plan to .codearbiter/plans/<slug>.md, ordered with dependencies flagged and an MVP slice identifiable. Nothing executes until every task has a path and a verification and the task set covers every acceptance criterion.
3
+ description: The spec-to-plan bridge. Routed to by /feature once the brainstormed spec is approved, and by /sprint before execution. Decomposes the spec into 2–5 minute tasks, each carrying its exact file path(s) and a concrete verification step that maps to a tdd obligation. Writes the plan in the approved spec's authoritative format, ordered with dependencies flagged and an MVP slice identifiable. Nothing executes until every task has a path and a verification and the task set covers every acceptance criterion.
4
4
  disable-model-invocation: true
5
5
  ---
6
6
 
7
7
  # writing-plans
8
8
 
9
+ ## Authoritative format boundary
10
+
11
+ For a new full-lane HTML spec, load `<plugin-root>/includes/artifacts.md` and
12
+ use the installed structured-artifact engine for every spec and plan read or
13
+ write. The resulting pair is `.codearbiter/specs/<slug>.html` and
14
+ `.codearbiter/plans/<slug>.html`. Missing or invalid HTML capability is a STOP
15
+ before writing and must not fall back to Markdown. An existing authoritative
16
+ Markdown spec continues through the legacy Markdown path without conversion.
17
+ HTML `--farm` dispatch remains blocked.
18
+
19
+
9
20
  Turn an approved spec into an executable plan. Routed to by `/feature` (after spec approval) and `/sprint`.
10
21
 
11
22
  ## Pre-flight
12
23
 
13
24
  Read these, or STOP and surface the gap — never plan against an unapproved or missing spec:
14
25
 
15
- - `<project-root>/.codearbiter/specs/<slug>.md` — the approved brainstorming spec. The single source of acceptance criteria. Absent or unapproved → STOP and route back to `/feature`.
26
+ - The authoritative approved spec selected by `/feature`: for HTML, resolve it
27
+ through the installed engine and verify its ready approval and exact identity;
28
+ for legacy Markdown, read `<project-root>/.codearbiter/specs/<slug>.md`.
29
+ Absent or unapproved → STOP and route back to `/feature`.
16
30
  - `<project-root>/.codearbiter/CONTEXT.md` — the `stage:` frontmatter (the maturity value) and project context.
17
31
  - `<project-root>/.codearbiter/tech-stack.md` — file layout, build/test/lint invocations. A verification step cites a real command from here, never a guess.
18
32
  - `<project-root>/.codearbiter/coding-standards.md` — structure and naming, so a task names the right path.
@@ -21,8 +35,10 @@ Read these, or STOP and surface the gap — never plan against an unapproved or
21
35
 
22
36
  ## Phase 1 — Criterion extraction · gate: BLOCK
23
37
 
24
- Lift every acceptance criterion from the spec verbatim and assign each a stable ID (`AC-01`,
25
- `AC-02`, …). This list is the coverage ledger for the whole plan — Phase 4 checks the task set
38
+ Lift every acceptance criterion from the spec and retain its stable ID (`AC-01`,
39
+ `AC-02`, …). For HTML, obtain criterion records through typed engine reads and
40
+ retain their typed IDs; rendered document text is not an authority source. This
41
+ list is the coverage ledger for the whole plan — Phase 4 checks the task set
26
42
  against it.
27
43
 
28
44
  A criterion the spec leaves ambiguous is a `[CONFIRM-NN]` against
@@ -31,7 +47,8 @@ A criterion the spec leaves ambiguous is a `[CONFIRM-NN]` against
31
47
  **Backstop the ledger against the spec's own stated intent, mechanically, before trusting it — this
32
48
  runs even when `brainstorming` already ran the same check, because a hole that survived Phase 3
33
49
  survives Phase 4's bijection too, silently** (#566): run `"$PY" "<plugin-root>/hooks/_intentlib.py"
34
- uncovered-intent <project-root>/.codearbiter/specs/<slug>.md [--issue-body <scratch-file>]` —
50
+ uncovered-intent <spec-path> [--issue-body <scratch-file>]`, where `<spec-path>`
51
+ is the authoritative `.html` or legacy `.md` spec selected above —
35
52
  `<scratch-file>` holds the linked issue's body when one exists (`gh issue view <N> --json body -q
36
53
  .body > <scratch-file>`, written outside the working tree), omitted when none does. A non-empty
37
54
  result names an in-scope bullet or an acceptance checkbox the criteria never cited — BLOCK and route
@@ -89,10 +106,20 @@ that completeness gap is caught earlier, by Phase 1's `uncovered_intent` backsto
89
106
  - Every `AC-NN` is covered by at least one task's `covers`. An uncovered criterion blocks — author the missing task.
90
107
  - Every task advances at least one `AC-NN`. A task that covers nothing is scope creep — cut it or surface it.
91
108
 
92
- Then write the plan to `<project-root>/.codearbiter/plans/<slug>.md` — `<slug>` matching the
93
- spec — with the `AC-NN` ledger, the ordered task table (id · path(s) · verification · maps-to ·
94
- covers · depends-on · **status**, initialized `PENDING`), the marked MVP slice, and any out-of-scope
95
- item tagged inline `[NEEDS-TRIAGE]`.
109
+ For an HTML source, pass the selected route, installed client, and the spec
110
+ identity just read from the engine through `_preflight_plan_authoring`. Only its
111
+ returned same-slug `.codearbiter/plans/<slug>.html` target may be created. Create
112
+ that plan through the installed structured-artifact engine as `draft_preview`,
113
+ using the approved spec's exact artifact ID and normative digest. Populate it only with typed operations,
114
+ validate it at the ready gate, then use `plan-bind` to bind it to that approved
115
+ spec before plan approval. This path must not create `.codearbiter/plans/<slug>.md`;
116
+ that would be a shadow authority.
117
+
118
+ For an existing authoritative Markdown source, write
119
+ `<project-root>/.codearbiter/plans/<slug>.md` — `<slug>` matching the spec —
120
+ with the `AC-NN` ledger, the ordered task table (id · path(s) · verification ·
121
+ maps-to · covers · depends-on · **status**, initialized `PENDING`), the marked
122
+ MVP slice, and any out-of-scope item tagged inline `[NEEDS-TRIAGE]`.
96
123
 
97
124
  The status column is the pipeline's resume ledger: `subagent-driven-development` flips a task to
98
125
  `ACCEPTED` the moment it accepts it, so an interrupted run (crash, compaction, closed session) is
@@ -106,7 +133,7 @@ completeness of the ledger itself was Phase 1's gate, not this one. This clears
106
133
 
107
134
  ### Phase 4-farm extension (only when `--farm` was requested)
108
135
 
109
- When `--farm` was requested, after the bijective coverage gate passes and the `.md` plan is written,
136
+ When `--farm` was requested for a legacy Markdown workflow, after the bijective coverage gate passes and the `.md` plan is written,
110
137
  produce the farm artifact (`plan.json`) — **one MVP slice at a time** — per
111
138
  `<plugin-root>/routines/writing-plans/references/farm-plan.md`. Load that leaf and follow it;
112
139
  it owns the per-task failing-test + schema-valid `plan.json` procedure.
@@ -117,6 +144,8 @@ artifacts exist before handing off to `subagent-driven-development` (`<plugin-ro
117
144
  ## Hard rules
118
145
 
119
146
  - MUST NOT plan against an absent or unapproved spec — STOP and route back to `/feature`.
147
+ - MUST NOT write or parse rendered HTML directly, create a Markdown shadow for
148
+ an HTML spec, or bind a plan from a caller-supplied identity.
120
149
  - MUST NOT emit a task without an exact path AND a concrete verification step.
121
150
  - MUST NOT let a task's verification stand in for a `tdd` gate — it maps to a tdd obligation, it does not replace one.
122
151
  - MUST NOT write the plan while any acceptance criterion is uncovered or any task covers nothing.
@@ -3,7 +3,16 @@
3
3
  Loaded by `writing-plans` Phase 4 only when `--farm` was requested. The base plan (Phases 1–4) is
4
4
  unchanged; this leaf adds the machine artifact the farm dispatcher needs.
5
5
 
6
- After the bijective coverage gate passes and the `.md` plan is written, produce the farm artifact —
6
+ Apply the shared `<plugin-root>/includes/verification-boundary.md`: the slice's narrow RED test and
7
+ affected contracts run locally, while exhaustive repository/cross-platform proof remains an
8
+ exact-head hosted-CI requirement.
9
+
10
+ **Rollout gate:** HTML-backed farm use remains disabled until the repository's fresh model-era
11
+ qualification matrix, native payload packaging, and real authority adapters are complete. The
12
+ projection contract below is implemented so qualification can exercise the real boundary; it is not
13
+ permission to use HTML farm dispatch in ordinary work.
14
+
15
+ After the bijective coverage gate passes and the canonical plan is written, produce the farm artifact —
7
16
  **one MVP slice at a time, not the whole plan up front.** Front-loading every failing test for the
8
17
  entire plan would be the waterfall this skill otherwise rejects (Phase 3), and it maximizes the cost
9
18
  of a mid-flight spec change. So the farm artifact is scoped to the **current slice** (the MVP slice on
@@ -16,26 +25,32 @@ dependency order:
16
25
  non-zero). A test that passes before implementation means the obligation is wrong — STOP and revisit
17
26
  Phase 2.
18
27
 
19
- Then write `<project-root>/.codearbiter/plans/<slug>.plan.json` (the current slice's tasks only)
20
- conforming to `<plugin-root>/tools/plan.schema.json`:
28
+ For a legacy Markdown plan, retain the existing schema-driven path below unchanged. For an HTML plan,
29
+ do **not** hand-write the projection. Construct the minimal candidate in memory and submit it through
30
+ the on-demand artifact protocol's `farm-project` operation. That operation atomically writes
31
+ `<project-root>/.codearbiter/plans/<slug>.plan.json` and an immutable content-addressed base binding
32
+ only after the approved source pair, current input snapshot, selected scope/slice, deterministic ID
33
+ mapping, projection bytes, and fresh RED result for every task all agree.
34
+
35
+ The HTML projection is the current slice's tasks only and is a strict subset of the unchanged farm
36
+ runtime schema:
21
37
 
22
38
  - `meta.name` ← slug
23
- - `meta.repo` ← project name from CONTEXT.md
24
39
  - `meta.model` and `meta.apiBaseUrl` — **leave unset**. These are written by
25
40
  `subagent-driven-development`'s model research step at dispatch time. Writing them here would bake in
26
41
  a potentially stale selection.
27
42
  - Per task: `id` ← T-NN (normalized to kebab-case), `description` ← task description,
28
43
  `filesInScope` ← path(s) from the task table, `test.path` ← the failing test written above,
29
- `gate.commands` ← verification command from task table plus full-suite and lint/typecheck from
30
- `tech-stack.md`, `deps` ← dependency ids (empty array if none), `context` ← a minimal slice of
31
- relevant types/interfaces (omit if the test file plus task description is self-contained),
32
- `maxRetries` ← omit to use the farm default.
44
+ `gate.commands` ← the canonical task verification argv joined without shell reinterpretation;
45
+ `deps` ← dependency ids inside the selected slice (empty array if none). Do not add `repo`,
46
+ `context`, setup, retry, or task-model fields to an HTML projection. A canonical argv token that
47
+ cannot be represented without shell quoting makes the slice unsupported and BLOCKS projection.
33
48
  - **`gate.commands[0]` MUST be the task's narrow behavioral test** (the command that runs just
34
- `test.path`), with the full suite and lint/typecheck following. The farm's mutation guard re-runs
35
- `gate.commands[0]` per mutant; if the first command were the full suite, mutation testing would be
49
+ `test.path`), with affected contract tests and lint/typecheck following. The farm's mutation guard re-runs
50
+ `gate.commands[0]` per mutant; if the first command were an exhaustive suite, mutation testing would be
36
51
  prohibitively slow.
37
52
 
38
- Validate the JSON against the schema before writing (load the schema from
53
+ For the legacy path, validate the JSON against the schema before writing (load the schema from
39
54
  `<plugin-root>/tools/plan.schema.json` and check). A schema-invalid plan BLOCKS.
40
55
 
41
56
  `plan.schema.json` is the **authoring** contract. The dispatcher enforces its own **runtime** contract
@@ -46,5 +61,11 @@ satisfies the schema is accepted at runtime — with one deliberate exception, t
46
61
  pattern, which is stricter here than the runtime path-safety rule. Both objects are closed: an
47
62
  undeclared property is an error, not an ignored extra.
48
63
 
49
- Gate: all failing tests written and confirmed failing; `plan.json` written and schema-valid. Both
50
- artifacts exist before handing off to `subagent-driven-development`.
64
+ For the HTML path, the existing user/SMARTS workflow must capture a `farm_authorization` receipt whose
65
+ payload binds the current spec/plan/input hashes, scope, base projection hash, and each task's source
66
+ ID, farm ID, test path, verification-definition hash, command, failing exit, stdout hash and stderr
67
+ hash. A digest is correspondence, not approval authentication. Call `farm-project` with that receipt;
68
+ do not create a binding file directly.
69
+
70
+ Gate: all failing tests written and freshly observed failing; the legacy JSON is schema-valid or the
71
+ HTML projection and immutable binding were committed together. Both artifacts exist before handoff.
@@ -26,12 +26,15 @@ the gates that fit it — and nothing it doesn't need. Everything still exits th
26
26
  **deps** — bump an existing dependency's version (manifest + lockfile together, never one without
27
27
  the other).
28
28
  - Gates: dispatch `dependency-reviewer` (same vetting as `/ca-add-dep` — license, provenance,
29
- supply chain, changelog of the bump); full test suite green after the bump; `commit-gate`.
29
+ supply chain, changelog of the bump); affected local tests green under
30
+ `<plugin-root>/includes/verification-boundary.md`; exhaustive exact-head hosted CI before merge;
31
+ `commit-gate`.
30
32
  - A bump that requires code changes to adopt is not a chore — route the code change through
31
33
  `/ca-feature` or `/ca-fix`.
32
34
 
33
35
  **revert** — back out a named commit.
34
- - Gates: `git revert <SHA>` (never hand-edited backout); full suite green after the revert; the
36
+ - Gates: `git revert <SHA>` (never hand-edited backout); affected local tests green under the shared
37
+ `verification-boundary`, exhaustive exact-head hosted CI before merge; the
35
38
  commit message references the reverted SHA and the reason; `commit-gate`.
36
39
  - No new regression test demanded — the revert restores already-tested behavior. If the revert is
37
40
  fixing a defect the suite missed, open `/ca-fix` afterward to pin it.
@@ -48,7 +51,8 @@ the other).
48
51
 
49
52
  MUST reject a change containing behavioral code (beyond the revert itself) — that is `/ca-feature`
50
53
  or `/ca-fix` territory. MUST keep manifest and lockfile changes in the same commit for `deps`.
51
- MUST run the full suite for `deps` and `revert`. MUST run the anti-slop copy pass on any user-facing
54
+ MUST run impact-bounded local verification for `deps` and `revert` and require exhaustive exact-head
55
+ hosted CI before merge. MUST run the anti-slop copy pass on any user-facing
52
56
  doc a `docs` change authors or edits. Never skips `commit-gate`.
53
57
 
54
58
  ## When NOT to use
@@ -23,5 +23,6 @@ is canonical for its phases, gates, and output format.
23
23
 
24
24
  ## Hard gate
25
25
 
26
- MUST NOT commit without `commit-gate` clearing. MUST NOT commit if the project test suite is not
27
- green.
26
+ MUST NOT commit without `commit-gate` clearing. The applicable impact-bounded local tests from
27
+ `<plugin-root>/includes/verification-boundary.md` must be green; exhaustive repository and
28
+ cross-platform suites are exact-head hosted-CI merge gates, not local commit prerequisites.
@@ -12,6 +12,17 @@ remediation.
12
12
 
13
13
  ## Flow
14
14
 
15
+
16
+ The mechanical report also invokes the installation-pinned artifact client's `capabilities`
17
+ operation. When the repository contains an HTML authority, it performs a bounded catalog read to
18
+ surface invalid or ambiguous artifacts. It MUST NOT load the artifact schema, search `PATH`, use a
19
+ repository binary, mutate an artifact, or silently fall back to Markdown.
20
+
21
+ - `CAPABILITY_MISSING` or another installation identity failure is unhealthy: report “repair or
22
+ reinstall the pinned artifact payload; HTML work is blocked.” Unrelated legacy Markdown remains
23
+ usable.
24
+ - An invalid HTML artifact is unhealthy: preserve the bounded engine code and direct the user to
25
+ inspect `repair-preview` before any explicit reviewed repair.
15
26
  1. The `/ca-doctor` alias has already run the extension's structured Pi doctor report before sending
16
27
  this generated skill. Present the `<codearbiter-doctor-report>` block below verbatim.
17
28
  2. The report inspects, without granting trust: active Git package origin/version, exact Pi CLI and
@@ -24,6 +35,9 @@ remediation.
24
35
  4. Its `active-dispatch` row remains degraded because supported Pi 0.84.1 public extension
25
36
  APIs cannot submit that deterministic call through the active dispatcher. PI-AC-28 remains blocked
26
37
  until supported-version real-host promotion/CI evidence closes the gap.
38
+ 5. Resolve Python once, run `<plugin-root>/hooks/doctor.py`, and present its mechanical report
39
+ verbatim. This is the on-demand artifact-capability and repository-artifact check; it is separate
40
+ from the wrapper self-test and must not be respelled into an active-dispatch claim.
27
41
 
28
42
  ## Remediation ladder
29
43
 
@@ -8,14 +8,45 @@ argument-hint: "<what you want to build>"
8
8
 
9
9
  The single permitted entry to implementation work. No feature code is written before a spec is approved and `tdd` Phase 1 clears. A one-line idea is not a spec — `brainstorming` makes it one.
10
10
 
11
+ ## Structured-artifact boundary
12
+
13
+ For new full-lane work or an existing `.html` spec/plan match, load
14
+ `<plugin-root>/includes/artifacts.md` before resume classification or artifact
15
+ I/O. After lane classification, call
16
+ `_select_authoring_route` with the trusted project root, slug, `workflow: feature`,
17
+ and the selected lane. Use only its returned mode, format, and paths. For a
18
+ selected HTML route it
19
+ checks the installed capability before writing; a missing or invalid helper is
20
+ a STOP and the workflow must not fall back to Markdown.
21
+ Its validated identity, authority, binding and task-state operations replace this
22
+ command's `.md`, approval-label and status-cell assumptions for that pipeline.
23
+ New full-lane specs use the installed structured-artifact engine and default to
24
+ canonical `.html`. An existing `.md` pair remains on the legacy path. Discovery requires a
25
+ complete same-extension spec/plan pair: select that exact pair as authoritative. A
26
+ mixed-extension or duplicate match is a STOP. A lone spec resumes in its exact format,
27
+ and the next plan must use the same extension. The workflow must not create, rename, or convert its counterpart to repair ambiguity. HTML `--farm` dispatch stays
28
+ blocked. Small-lane behavior is unchanged: its confirmed mini-spec remains inline
29
+ and does not create a spec artifact.
30
+
11
31
  **Orientation:** if `.codearbiter/code-map.md` is present, read it first — a coarse concern→path→role map that orients task authoring. Absent is fine; it is read-on-demand, populated by context-creation or commit-gate heal.
12
32
 
13
33
  ## Resume — an interrupted pipeline is re-entered, never restarted
14
34
 
15
- Before triage, scan `<project-root>/.codearbiter/specs/` and `plans/` for an existing slug
16
- matching `$ARGUMENTS` (invoked bare, list every resumable pipeline and ask which). A crash,
17
- compaction, or closed session mid-pipeline loses nothing — the spec, the plan, and each task's
18
- `status` cell are on disk. On a match, confirm the resume with the user in one line
35
+ Before triage, scan `<project-root>/.codearbiter/specs/` and `plans/` for artifacts
36
+ whose slug matches `$ARGUMENTS` (invoked bare, list every resumable pipeline and
37
+ ask which). Call the private bridge resolver `_resolve_workflow_pair` with the
38
+ trusted project root and selected slug; its returned paths and format own this
39
+ resume. Select a complete same-extension pair as authoritative. A lone spec
40
+ resumes in its exact format, and the next plan must use the same extension. A
41
+ mixed-extension or duplicate match is a STOP. A crash, compaction,
42
+ or closed session mid-pipeline loses nothing — the spec, the plan, and each task's
43
+ state are on disk. For an HTML pair, obtain state only through the installed
44
+ engine `identity`, `index`, and symbol-scoped `read` operations; do not scrape
45
+ rendered labels or embedded JSON. For a Markdown pair, use the
46
+ existing Markdown status ledger. Resume either exact format
47
+ without creating or consulting a shadow artifact; the workflow must not create,
48
+ rename, or convert its counterpart. On a match,
49
+ confirm the resume with the user in one line
19
50
  ("resume `<slug>` at <point>?") and re-enter at the furthest checkpoint reached:
20
51
 
21
52
  1. **Plan exists with non-`ACCEPTED` tasks** → `executing-plans` (its Phase 1 batches only the
@@ -62,12 +93,14 @@ Route through the pipeline in order; each step gates the next:
62
93
 
63
94
  1. **`brainstorming`** (`<plugin-root>/routines/brainstorming/SKILL.md`) — refine `$ARGUMENTS` into a concrete spec by Socratic questioning: challenge
64
95
  vague language, surface hidden complexity, force trade-offs. Writes the spec to
65
- `<project-root>/.codearbiter/specs/<slug>.md`. **Hard gate: no plan and no code until the
96
+ route-selected spec path. New full-lane work writes
97
+ `<project-root>/.codearbiter/specs/<slug>.html` through the installed engine.
98
+ **Hard gate: no plan and no code until the
66
99
  user approves the spec.** Genuinely-unresolved unknowns become `[CONFIRM-NN]` in
67
100
  `open-questions.md`, never guesses.
68
101
  2. **`writing-plans`** (`<plugin-root>/routines/writing-plans/SKILL.md`) — decompose the approved spec into small tasks, each with an exact path and a
69
102
  verification that maps to a `tdd` obligation (it does not replace one). Writes
70
- `<project-root>/.codearbiter/plans/<slug>.md` with bijective criterion↔task coverage.
103
+ matching route-selected plan path with bijective criterion↔task coverage.
71
104
  3. **`executing-plans`** (`<plugin-root>/routines/executing-plans/SKILL.md`) — coordinates the plan in small batches with human checkpoints. Each batch is
72
105
  delegated to `subagent-driven-development` (`<plugin-root>/routines/subagent-driven-development/SKILL.md` — fresh author agent per task, spec-compliance review,
73
106
  quality review, fresh verification). The user acknowledges between batches; nothing advances until
@@ -84,8 +117,9 @@ not `/feature`.
84
117
 
85
118
  Scope determines which author agent `subagent-driven-development` dispatches per task:
86
119
  `backend-author`, `frontend-author`, or `infra-author` — per the mapping in `tech-stack.md`. A
87
- multi-area feature runs the appropriate agent per task; the full suite must be green before
88
- transitioning between scope areas.
120
+ multi-area feature runs the appropriate agent per task. Each transition requires the affected local
121
+ tests from `<plugin-root>/includes/verification-boundary.md` to be green; exhaustive cross-area and
122
+ cross-platform proof runs in exact-head hosted CI before merge.
89
123
 
90
124
  ## When NOT to use
91
125
 
@@ -19,8 +19,10 @@ Routes to the `refactor` skill — six phases:
19
19
  Phase 1 to write failing tests pinning the seam's contract first.
20
20
  4. **Implementation** — apply the restructure mechanically within the surface table; no new behavior,
21
21
  branches, error paths, or side effects.
22
- 5. **Parity verification** — the full pre-existing suite passes with zero edits to any pre-existing
23
- test file.
22
+ 5. **Parity verification** — every impact-bounded local parity test identified for the surface passes
23
+ with zero edits to any pre-existing test file; the shared
24
+ `<plugin-root>/includes/verification-boundary.md` reserves the exhaustive suite for exact-head
25
+ hosted CI before merge.
24
26
  6. **Lint / coverage gate** — lint, type-check, and coverage clear; surface coverage MUST NOT regress.
25
27
 
26
28
  ## Routes to