@arbiterforge/ca-pi 0.15.2 → 0.15.3

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 (59) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/plugins/ca-pi/CHANGELOG.md +62 -0
  4. package/plugins/ca-pi/COMMANDS.md +3 -9
  5. package/plugins/ca-pi/SKILLS.md +16 -22
  6. package/plugins/ca-pi/agents/coverage-auditor.md +16 -2
  7. package/plugins/ca-pi/generated/command-catalog.json +13 -22
  8. package/plugins/ca-pi/helpers/artifacts/ca-artifact-darwin-amd64 +0 -0
  9. package/plugins/ca-pi/helpers/artifacts/ca-artifact-darwin-arm64 +0 -0
  10. package/plugins/ca-pi/helpers/artifacts/ca-artifact-linux-amd64 +0 -0
  11. package/plugins/ca-pi/helpers/artifacts/ca-artifact-linux-arm64 +0 -0
  12. package/plugins/ca-pi/helpers/artifacts/ca-artifact-windows-amd64.exe +0 -0
  13. package/plugins/ca-pi/helpers/artifacts/ca-artifact-windows-arm64.exe +0 -0
  14. package/plugins/ca-pi/helpers/artifacts/release.json +6 -6
  15. package/plugins/ca-pi/hooks/_artifactauthoritylib.py +383 -32
  16. package/plugins/ca-pi/hooks/_artifactlib.py +3 -1
  17. package/plugins/ca-pi/hooks/_host.py +1 -1
  18. package/plugins/ca-pi/hooks/artifact-authority-hook.py +4 -21
  19. package/plugins/ca-pi/hooks/artifact-authority.py +11 -0
  20. package/plugins/ca-pi/hooks/hostapi.py +1 -1
  21. package/plugins/ca-pi/includes/command-compatibility.md +31 -0
  22. package/plugins/ca-pi/includes/farm.md +187 -36
  23. package/plugins/ca-pi/includes/maturity-coverage.md +57 -17
  24. package/plugins/ca-pi/includes/routing-table.md +10 -11
  25. package/plugins/ca-pi/includes/safety-core.md +2 -2
  26. package/plugins/ca-pi/package.json +1 -1
  27. package/plugins/ca-pi/routines/INDEX.md +12 -11
  28. package/plugins/ca-pi/routines/context-check/SKILL.md +17 -1
  29. package/plugins/ca-pi/routines/context-creation/SKILL.md +8 -1
  30. package/plugins/ca-pi/routines/debug/SKILL.md +18 -2
  31. package/plugins/ca-pi/routines/decision-lifecycle/SKILL.md +72 -118
  32. package/plugins/ca-pi/routines/decision-lifecycle/references/authoring.md +152 -0
  33. package/plugins/ca-pi/routines/decision-variance/SKILL.md +107 -133
  34. package/plugins/ca-pi/routines/decision-variance/references/analysis.md +136 -0
  35. package/plugins/ca-pi/routines/decompose/SKILL.md +8 -1
  36. package/plugins/ca-pi/routines/finishing-a-development-branch/SKILL.md +85 -7
  37. package/plugins/ca-pi/routines/post-merge-cleanup/SKILL.md +19 -2
  38. package/plugins/ca-pi/routines/refactor/SKILL.md +27 -8
  39. package/plugins/ca-pi/routines/release/SKILL.md +2 -1
  40. package/plugins/ca-pi/routines/security-architecture/SKILL.md +14 -3
  41. package/plugins/ca-pi/routines/tdd/SKILL.md +9 -5
  42. package/plugins/ca-pi/routines/tribunal/SKILL.md +28 -14
  43. package/plugins/ca-pi/skills/ca-adr/SKILL.md +103 -18
  44. package/plugins/ca-pi/skills/ca-adr-status/SKILL.md +6 -24
  45. package/plugins/ca-pi/skills/ca-cleanup/SKILL.md +241 -52
  46. package/plugins/ca-pi/skills/ca-context-check/SKILL.md +87 -24
  47. package/plugins/ca-pi/skills/ca-create-context/SKILL.md +159 -19
  48. package/plugins/ca-pi/skills/ca-debug/SKILL.md +100 -27
  49. package/plugins/ca-pi/skills/ca-decompose/SKILL.md +156 -17
  50. package/plugins/ca-pi/skills/ca-pr/SKILL.md +161 -26
  51. package/plugins/ca-pi/skills/ca-reconcile/SKILL.md +108 -30
  52. package/plugins/ca-pi/skills/ca-refactor/SKILL.md +96 -30
  53. package/plugins/ca-pi/skills/ca-release/SKILL.md +614 -39
  54. package/plugins/ca-pi/skills/ca-status/SKILL.md +1 -1
  55. package/plugins/ca-pi/skills/ca-threat-model/SKILL.md +56 -27
  56. package/plugins/ca-pi/skills/ca-tribunal/SKILL.md +105 -26
  57. package/plugins/ca-pi/routines/skill-author/SKILL.md +0 -129
  58. package/plugins/ca-pi/routines/skill-author/references/skill-template.md +0 -58
  59. package/plugins/ca-pi/skills/ca-new-skill/SKILL.md +0 -129
@@ -1,11 +1,27 @@
1
1
  ---
2
2
  name: refactor
3
- description: The behavior-preserving restructure gate. Routed to by /refactor for a rename, extract, inline, move, dedup, or internal-implementation swap. Six gated phases prove behavioral parity through unmodified pre-existing tests; any diff that classifies as `feat` is not a refactor and is routed to tdd. A modified pre-existing test is rejected as evidence — it is a behavior change in disguise.
3
+ description: "Restructure code without changing observable behavior: rename, extract, inline, move, deduplicate, or replace an internal implementation with an equivalent one. Prove parity through unchanged pre-existing tests. Not for new behavior, bug fixes, explanation-only questions, or committing finished work."
4
+ argument-hint: "<surface and motivation>"
4
5
  ---
5
6
 
6
7
  # refactor
7
8
 
8
- Restructure, do not rewrite. Externally observable behavior before equals after — proven by mechanism, not inspection. Routed to by `/refactor`.
9
+ Select this owning procedure for a behavior-preserving restructure, whether requested
10
+ in plain language or through `/refactor`. Entry syntax is not an additional gate;
11
+ the approved-surface, parity, and verification requirements below still apply.
12
+ Externally observable behavior before equals after, proven rather than assumed.
13
+
14
+ ## Entry boundaries
15
+
16
+ - Identify both the surface and the motivation. Phase 1 owns the precise surface
17
+ table and its approval; knowing a command name does not establish either.
18
+ - New behavior, including a new error path, side effect, or public method beyond
19
+ a Phase 3 seam, belongs to `/feature`. Incorrect existing behavior belongs to `/fix`.
20
+ - An explanation-only question stays in the non-mutating question-answer path,
21
+ not this editing procedure and not a required help-command detour.
22
+ - Persisting an already-completed refactor belongs to the existing commit owner at
23
+ `<plugin-root>/routines/commit-gate/SKILL.md`, with its actual authorization and gates.
24
+ No commit, push, or PR is implied merely by entering this refactor procedure.
9
25
 
10
26
  ## Pre-flight
11
27
 
@@ -33,22 +49,25 @@ Gate: a precise, complete surface table, user-signed-off. A vague or category-le
33
49
 
34
50
  ## Phase 2 — Behavioral parity coverage proof · gate: BLOCK
35
51
 
36
- Prove pre-existing tests already exercise the named surface well enough to detect a behavior change, before any production code is touched. Locate every test that exercises a symbol in the surface table. Run the coverage command from `tech-stack.md` scoped to the surface files; record line, branch, and per-symbol coverage.
52
+ Prove pre-existing tests already exercise the named surface well enough to detect a behavior change, before any production code is touched. Locate every test that exercises a symbol in the surface table. Run the coverage command from `tech-stack.md` scoped to the surface files; record each metric required by the declared coverage profile and the per-symbol test evidence.
37
53
 
38
54
  Coverage scales with the maturity value (`stage:` in `CONTEXT.md`) — the same knob as `tdd` Phase 5,
39
55
  using the shared threshold table `<plugin-root>/includes/maturity-coverage.md`.
40
56
 
41
57
  Every public method in the surface table MUST have at least one direct test — transitive coverage through a higher-level integration test does not count. A public method with zero direct tests is uncovered for this gate.
42
58
 
43
- **Lines and branches must both clear the threshold** (issue #507); a surface satisfying one and not
44
- the other is not proven. Where the surface has no coverage tooling, take the no-tooling exemption in
59
+ Resolve the **declared coverage profile** from `tech-stack.md` against the shared
60
+ `maturity-coverage.md` rule. Every required metric must clear the threshold, and
61
+ the shared report-validity and critical-path evidence requirements must hold.
62
+ Keep the same profile, scope and required metrics before and after the refactor.
63
+ Where the surface has no coverage tooling, take the no-tooling exemption in
45
64
  `<plugin-root>/includes/maturity-coverage.md` — it requires QUOTING the `tech-stack.md` Coverage
46
65
  section that omits a command for this surface — and the per-symbol direct-test proof stands alone.
47
66
  Without that citation the phase STOPs rather than passing on an unverifiable claim.
48
67
 
49
- If surface coverage is below the maturity threshold on either metric, OR any public method has zero direct tests, halt and route to the `tdd` skill (`<plugin-root>/routines/tdd/SKILL.md`) Phase 1 to backfill obligations and red tests for the uncovered surface. Resume Phase 2 only after the backfill is green.
68
+ If surface coverage is below the maturity threshold on any required metric, OR any public method has zero direct tests, halt and route to the `tdd` skill (`<plugin-root>/routines/tdd/SKILL.md`) Phase 1 to backfill obligations and red tests for the uncovered surface. Resume Phase 2 only after the backfill is green.
50
69
 
51
- Gate: surface coverage at or above the maturity threshold on BOTH lines and branches AND every public method backed by a direct test. Otherwise backfill via `tdd` Phase 1 before retrying.
70
+ Gate: surface coverage at or above the maturity threshold on every required metric in the declared coverage profile, the shared critical-path evidence present, AND every public method backed by a direct test. Otherwise backfill via `tdd` Phase 1 before retrying.
52
71
 
53
72
  ## Phase 3 — Red parity tests (conditional) · gate: BLOCK
54
73
 
@@ -74,7 +93,7 @@ Gate: scoped parity tests green with zero pre-existing tests modified. BLOCK if
74
93
 
75
94
  ## Phase 6 — Lint and coverage · gate: BLOCK
76
95
 
77
- Run lint, the type-check if the project is statically typed, and coverage, all from `tech-stack.md`. Resolve every lint and type error. Confirm surface coverage remains at or above the maturity threshold on both lines and branches — a refactor MUST NOT reduce coverage of the surface it touched on either metric.
96
+ Run lint, the type-check if the project is statically typed, and coverage, all from `tech-stack.md`. Resolve every lint and type error. Confirm surface coverage remains at or above the maturity threshold on every required metric in the same declared coverage profile. A refactor MUST NOT reduce coverage of the surface it touched on any required metric or drop its critical-path evidence.
78
97
 
79
98
  Where the surface has no coverage tooling, the same clause as Phase 2 applies — the no-tooling exemption in `<plugin-root>/includes/maturity-coverage.md`, citation included — and parity is verified through Phase 5's unmodified pre-existing tests alone. Phase 2 and Phase 6 MUST NOT give different answers about the same surface, which is why both defer to the one shared clause rather than restating its conditions.
80
99
 
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  name: release
3
- description: The single permitted path to a version tag, for any target declared in the project's .codearbiter/release-targets.md. Routed to when the user invokes /release on a non-default branch with a green suite. Takes the declared target as its one argument, derives the next identity under its declared version policy from Conventional-Commits history, rolls the commits into that target's CHANGELOG, writes an annotated tag in that target's namespace, and on authorization publishes it as a GitHub Release with the changelog section and exact declared assets. A release commit, if needed, routes through commit-gate; the tag and Release are never published without explicit authorization.
3
+ description: Prepare a declared release target, or preview it with --dry-run. Derive its version and require authorization before publication.
4
+ argument-hint: "[target] | --dry-run"
4
5
  ---
5
6
 
6
7
  # release
@@ -1,16 +1,27 @@
1
1
  ---
2
2
  name: security-architecture
3
- description: Optional, opt-in STRIDE threat pass for a sensitive feature — invoked deliberately via /threat-model, never forced on ordinary changes. Walks the change's attack surface and security boundaries (governed by <project-root>/.codearbiter/security-controls.md), surfaces threats and unmitigated gaps, and MAY dispatch security-reviewer or auth-crypto-reviewer. Not a routine gate; it can hard-STOP only on a genuinely critical unmitigated threat it surfaces.
3
+ description: "Threat-model a sensitive design with STRIDE on request. Read-only analysis of threats, controls, and implementation constraints."
4
+ argument-hint: "<scope description>"
4
5
  ---
5
6
 
6
7
  # security-architecture
7
8
 
8
- Optional, lightweight threat-modeling pass over a design before it is built. Routed to only when the user deliberately invokes `/threat-model <scope>` for a sensitive feature — never forced on an ordinary change. Reviews architectural intent before code exists; for code already written, dispatch `security-reviewer` instead.
9
+ Optional, lightweight threat-modeling pass over a design before it is built. Selected when the user deliberately requests threat modeling of a sensitive design, with or without `/ca-threat-model`. Never forced on an ordinary change. Reviews architectural intent before code exists; for code already written, dispatch `security-reviewer` instead.
10
+
11
+ ## Entry boundaries
12
+
13
+ Read-only: modify no project file, decision record, control or implementation.
14
+ Optional reviewers inherit this read-only analysis scope. An explanation-only
15
+ security question does not start the pass; mentioning authentication in an ordinary
16
+ change does not opt in. The user need not repeat a slash command to request it.
17
+ Missing required security-controls input is a prerequisite failure, separate from
18
+ the severity of a finding. A lesser gap is a constraint, not blanket denied clearance.
9
19
 
10
20
  ## Pre-flight
11
21
 
12
22
  - Read `<project-root>/.codearbiter/security-controls.md` — approved primitives, declared security boundaries and their permitted crossings, what is and is not allowed. If it cannot be read, STOP and surface the gap; do not guess the boundary model.
13
- - Establish the scope from the user's `/threat-model` argument: the feature, component, or design under review.
23
+ - Establish the scope from the user's request: the feature, component, or design under review.
24
+ - Read relevant security ADRs under `<project-root>/.codearbiter/decisions/`; do not invent decisions or interpret their absence as approval.
14
25
 
15
26
  ## Phase 1 — Attack surface · gate: BLOCK
16
27
 
@@ -117,9 +117,12 @@ Coverage scales with the maturity value (`stage:` in `CONTEXT.md`) — a rigor k
117
117
  gate. The threshold table is the shared `<plugin-root>/includes/maturity-coverage.md` (the
118
118
  single source of truth, also used by `refactor` Phase 2).
119
119
 
120
- Run the coverage command from `tech-stack.md`. **Lines and branches must both clear the threshold**
121
- — a report satisfying one and not the other does not pass (issue #507). Below it on either → add
122
- tests until both are met.
120
+ Resolve the surface's **declared coverage profile** from `tech-stack.md` against
121
+ `<plugin-root>/includes/maturity-coverage.md`, then run its coverage command.
122
+ Every required metric must clear the maturity threshold. Apply the shared
123
+ profile-selection, report-validity and critical-path evidence requirements;
124
+ do not substitute metrics or treat an unmeasured metric as passed. Below the
125
+ floor on any required metric → add meaningful tests until it is met.
123
126
 
124
127
  **Name the host you measured on**, and for a tree `tech-stack.md` marks as platform-forked, the
125
128
  figure is the UNION across its supported hosts — a single-host report scores the other platform's
@@ -139,8 +142,9 @@ still reads as satisfied, which is worse than an absent one.
139
142
  regression could rot unnoticed — not just "below threshold." The number is the rule; the untested paths
140
143
  are why it matters.
141
144
 
142
- Gate: threshold met on BOTH lines and branches for the current maturity value, or the no-tooling
143
- exemption taken WITH its citation. A test added only to move the percentage fails this gate in
145
+ Gate: threshold met on every required metric in the declared coverage profile
146
+ for the current maturity value, with the shared critical-path evidence, or the no-tooling
147
+ exemption taken WITH its citation and Phase 4 proof. A test added only to move the percentage fails this gate in
144
148
  spirit — it converts an honest red into a green that asserts nothing.
145
149
 
146
150
  ## Phase 6 — Lint · gate: BLOCK
@@ -1,11 +1,25 @@
1
1
  ---
2
2
  name: tribunal
3
- description: The deep, rarely-convened whole-codebase audit lane. Routed to when the user invokes /ca-tribunal. Seven gated phases — cost/model, map, roster dispatch, triage, report, approval+filing, telemetry. Costs on the order of millions of tokens; proceeds only after the user acknowledges the estimate; never a required gate; nothing filed or sent without explicit authorization.
3
+ description: "Run an opt-in deep codebase audit with persisted findings. Confirm cost before dispatch; filing and telemetry need separate approval."
4
+ argument-hint: "[scope-path] [--tag <label>]"
4
5
  ---
5
6
 
6
7
  # tribunal
7
8
 
8
- The deepest, most expensive review codeArbiter offers — convened rarely, on demand, never as a gate. Routed to when the user invokes `/ca-tribunal`. Eleven specialist lenses judge the codebase; every finding persists to its own file (plus append-only triage/run logs) under a run dir that survives compaction and disconnects, so the run resumes from disk.
9
+ The deepest, most expensive review codeArbiter offers — convened rarely, on demand, never as a gate. Selected by a deliberate request for a deep codebase audit, including `/ca-tribunal`. Eleven specialist lenses judge the codebase; every finding persists to its own file (plus append-only triage/run logs) under a run dir that survives compaction and disconnects, so the run resumes from disk.
10
+
11
+ ## Entry boundaries
12
+
13
+ A direct audit request is sufficient routing intent; do not ask the user to repeat a
14
+ command. An explanation-only question does not start an audit. Ordinary diff review,
15
+ periodic checkpoints and a single-feature threat model retain their separate owners.
16
+ Cost acknowledgment, issue filing and telemetry authorization remain separate below.
17
+
18
+ `[scope-path]` limits the audit to that subtree (default: repository root). Evaluate
19
+ applicability across the full roster; skip a lens only when its concern is absent and
20
+ record the launched/skipped set. A smaller scope does not require irrelevant lenses.
21
+ `--tag <label>` supplies the optional freeform run label governed by the telemetry card;
22
+ it is not authorization to transmit anything.
9
23
 
10
24
  ## Pre-flight
11
25
 
@@ -22,11 +36,11 @@ Read these, or STOP and surface the gap — never guess a command or a path:
22
36
 
23
37
  This lane is expensive. Orient and get explicit go-ahead before dispatching anything.
24
38
 
25
- - **Resume check.** Scan `.codearbiter/reports/` for the most recent run dir matching the current scope-slug, any date — never just today's. If none, skip to sizing. If found, check completion: incomplete (no `report-written` event in its `run.jsonl`) means either resumable or stale, judged by that run dir's latest `run.jsonl` timestamp. A run whose `run.jsonl` carries `run-aborted` is terminal — never offered for resume; a fresh run starts. Younger than 7 days → recover position with the cheap cursor scan in `references/schemas.md` (grep the last `wave-triaged`, do not read finding bodies) and offer to resume at the first un-triaged wave instead of restarting; skip the estimate. Older than 7 days → STOP and ask the user to resume anyway or start fresh — the codebase may have drifted under the findings, and stale-tree findings must not silently merge with fresh ones. Complete → start a fresh run.
39
+ - **Resume check.** Scan `.codearbiter/reports/` for the most recent run dir matching the current scope-slug, any date — never just today's. If none, skip to sizing. If found, check completion: incomplete (no `report-written` event in its `run.jsonl`) means either resumable or stale, judged by that run dir's latest `run.jsonl` timestamp. A run whose `run.jsonl` carries `run-aborted` is terminal — never offered for resume; a fresh run starts. Younger than 7 days → recover position with the cheap cursor scan in `<plugin-root>/routines/tribunal/references/schemas.md` (grep the last `wave-triaged`, do not read finding bodies) and offer to resume at the first un-triaged wave instead of restarting; skip the estimate. Older than 7 days → STOP and ask the user to resume anyway or start fresh — the codebase may have drifted under the findings, and stale-tree findings must not silently merge with fresh ones. Complete → start a fresh run.
26
40
  - **Abandon.** If the user tells the orchestrator to abandon the run, log a `run-aborted` event to `run.jsonl` before stopping.
27
41
  - **Cost acknowledgment.** Size the job, compute the token band, recommend the model (highest-reasoning available, high effort), and offer the cost-control levers. Present the band plainly; nothing dispatches until the user acknowledges it and confirms the model.
28
42
  - Establish `RUN_ID` = `<UTC-date>-<scope-slug>` on a fresh run; create `.codearbiter/reports/<run-id>/`; open `run.jsonl`. On resume, reuse the existing `RUN_ID` as-is — the date is the run's creation date and never changes on resume.
29
- - Procedure: `references/cost-and-models.md` — load now.
43
+ - Procedure: `<plugin-root>/routines/tribunal/references/cost-and-models.md` — load now.
30
44
 
31
45
  Gate: the user has acknowledged the estimated cost and confirmed the model. An unacknowledged run does not pass.
32
46
 
@@ -34,18 +48,18 @@ Gate: the user has acknowledged the estimated cost and confirmed the model. An u
34
48
 
35
49
  Map before reviewing; the map decides what gets scrutiny.
36
50
 
37
- - Produce the inventory (inline, or on a large repo dispatch the optional cheap mappers per `references/cost-and-models.md`): file tree, language breakdown, entry points/routes, core-logic and shared-utility locations, dependency and integration surface. Write `inventory.md`.
38
- - Apply the judgment overlay in `references/ai-markers.md`: risk-rank directories (untrusted input, money, auth, PII, churn = highest), mark trust boundaries, record AI-authorship markers and an iteration-depth estimate. High-marker / high-iteration areas carry a scrutiny boost and a small severity prior.
39
- - Choose the active lenses — the roster IS the set of cards under `references/lenses/`; the active set is that roster minus any lens whose concern is absent from scope (no migrations → drop the migration lens). Record launched/skipped as `run.jsonl` events.
40
- - Choose the wave partition — the default in `references/cost-and-models.md`, or a repartition for cause — and record it in the `run-started` event (`references/schemas.md`); resume reads this recorded partition, never re-derives it.
51
+ - Produce the inventory (inline, or on a large repo dispatch the optional cheap mappers per `<plugin-root>/routines/tribunal/references/cost-and-models.md`): file tree, language breakdown, entry points/routes, core-logic and shared-utility locations, dependency and integration surface. Write `inventory.md`.
52
+ - Apply the judgment overlay in `<plugin-root>/routines/tribunal/references/ai-markers.md`: risk-rank directories (untrusted input, money, auth, PII, churn = highest), mark trust boundaries, record AI-authorship markers and an iteration-depth estimate. High-marker / high-iteration areas carry a scrutiny boost and a small severity prior.
53
+ - Choose the active lenses — the roster IS the set of cards under `<plugin-root>/routines/tribunal/references/lenses/`; the active set is that roster minus any lens whose concern is absent from scope (no migrations → drop the migration lens). Record launched/skipped as `run.jsonl` events.
54
+ - Choose the wave partition — the default in `<plugin-root>/routines/tribunal/references/cost-and-models.md`, or a repartition for cause — and record it in the `run-started` event (`<plugin-root>/routines/tribunal/references/schemas.md`); resume reads this recorded partition, never re-derives it.
41
55
 
42
56
  Gate: `inventory.md` written with the risk/boundary/marker overlay, and the active-lens set recorded.
43
57
 
44
58
  ## Phase 2 — Roster dispatch (dual output: finding files + summary) · gate: BLOCK
45
59
 
46
- Dispatch one `tribunal-lens-reviewer` per active lens, in the wave partition recorded at Phase 1 (default in `references/cost-and-models.md`) at the concurrency from `references/cost-and-models.md` (≤5 in flight). Each dispatch carries the assignment block from the agent's Assignment Format — its FIRST line is the title `Tribunal lens: <lens-slug> — <scope summary>` — naming the lens slug, the scope slice, the run dir, and the findings dir, on the model/effort from `references/cost-and-models.md`. The agent itself reads its own mandate (`references/lenses/<lens>.md`, including that card's Required-reading docs) and the finding contract (`references/finding-record.md`), and loads neither the other lenses' mandates nor the orchestrator schemas. The orchestrator reads `references/finding-record.md` to read findings at triage, and consults a lens mandate only to adjudicate that lens's finding.
60
+ Dispatch one `tribunal-lens-reviewer` per active lens, in the wave partition recorded at Phase 1 (default in `<plugin-root>/routines/tribunal/references/cost-and-models.md`) at the concurrency from `<plugin-root>/routines/tribunal/references/cost-and-models.md` (≤5 in flight). Each dispatch carries the assignment block from the agent's Assignment Format — its FIRST line is the title `Tribunal lens: <lens-slug> — <scope summary>` — naming the lens slug, the scope slice, the run dir, and the findings dir, on the model/effort from `<plugin-root>/routines/tribunal/references/cost-and-models.md`. The agent itself reads its own mandate from `<plugin-root>/routines/tribunal/references/lenses/` (the recorded active lens slug plus `.md`, including that card's Required-reading docs) and the finding contract (`<plugin-root>/routines/tribunal/references/finding-record.md`), and loads neither the other lenses' mandates nor the orchestrator schemas. The orchestrator reads `<plugin-root>/routines/tribunal/references/finding-record.md` to read findings at triage, and consults a lens mandate only to adjudicate that lens's finding.
47
61
 
48
- - Each dispatched lens reviewer writes each finding to its own file `findings/<lens>/<finding-id>.json` the moment it is found — one file per finding, never a batched write at the end (write contract: `references/finding-record.md`).
62
+ - Each dispatched lens reviewer writes each finding to its own file `findings/<lens>/<finding-id>.json` the moment it is found — one file per finding, never a batched write at the end (write contract: `<plugin-root>/routines/tribunal/references/finding-record.md`).
49
63
  - **Evidence-or-drop.** Every finding cites a concrete `path:line` and the minimal snippet. An absence claim — "no handler", "no teardown", "missing validation" — requires reading the whole unit, never a truncated window.
50
64
  - Specialists never dispatch further subagents. Update each wave's status in `run.jsonl` as it flushes.
51
65
  - When a lens's summary returns, record a `lens-completed` event in `run.jsonl` with `surface_seen`/`findings`/`model` taken from the agent's summary, plus `tokens` when the orchestrator can observe that lens's spend.
@@ -59,13 +73,13 @@ Triage per wave from disk as soon as it flushes; do not wait for the whole run.
59
73
  - **Calibrate independently.** Set `final_severity`/`final_confidence` from the evidence yourself — the lens's values are provisional input; every critical/high carries a `counter_argument`.
60
74
  - **Decide per finding, logged.** Each finding gets one decision from the vocabulary, appended as one line to `triage.jsonl`. Below the confidence gate after calibration → `investigate` (medium/low) or `decision-required` (critical/high) — never dropped silently.
61
75
  - **Plan the wave.** Write `plans/phase-<n>.md` for its kept (`keep`/`combine`) work.
62
- - Procedure: `references/triage.md` — load now.
76
+ - Procedure: `<plugin-root>/routines/tribunal/references/triage.md` — load now.
63
77
 
64
78
  Gate: every wave's findings triaged into `triage.jsonl` and a `plans/phase-<n>.md` written for its kept work.
65
79
 
66
80
  ## Phase 4 — Report · gate: BLOCK
67
81
 
68
- Regenerate `report.md` and `manifest.yaml` from the two logs per `references/report.md` — projections, never hand-authored. Task-list-structured (not prose): findings grouped by **calibrated** severity then type, each with id, `path:line`, one-line description, remediation shape, triage decision, and a link to its phase plan; `decision-required` in its own section; a launched/skipped-lens summary; an investigate appendix. Apply `<plugin-root>/includes/anti-slop-design/` (`core` + `medium-documents`) to the prose.
82
+ Regenerate `report.md` and `manifest.yaml` from the two logs per `<plugin-root>/routines/tribunal/references/report.md` — projections, never hand-authored. Task-list-structured (not prose): findings grouped by **calibrated** severity then type, each with id, `path:line`, one-line description, remediation shape, triage decision, and a link to its phase plan; `decision-required` in its own section; a launched/skipped-lens summary; an investigate appendix. Apply `<plugin-root>/includes/anti-slop-design/` (`core` + `medium-documents`) to the prose.
69
83
 
70
84
  State plainly that critical/high are blocking-severity findings — work that should block shipping the affected code — but that this lane is not itself a gate and blocks nothing.
71
85
 
@@ -78,7 +92,7 @@ Findings become GitHub issues only on explicit selection and authorization. Sile
78
92
  - **Dedup first.** Skip findings already carrying an `issue_ref` in `triage.jsonl`, then dedup against the tracker — this lane reruns over time and will re-find the same issues.
79
93
  - **Default is hand-off.** Write and print `issue-commands.sh`; execute only on explicit approval, writing each `issue_ref` back into `triage.jsonl`.
80
94
  - Findings file as GitHub issues, never `open-tasks.md` — a periodic-review finding must survive PR abandonment.
81
- - Procedure: `references/issue-filing.md` — load now.
95
+ - Procedure: `<plugin-root>/routines/tribunal/references/issue-filing.md` — load now.
82
96
 
83
97
  Gate: either `issue-commands.sh` written and printed, or — on approval — issues filed with the id→result table and `issue_ref` recorded. Nothing filed without explicit selection; no duplicates against the tracker.
84
98
 
@@ -88,7 +102,7 @@ Optional, opt-in KPI feedback to refine the skill and the estimator — off by d
88
102
 
89
103
  - **Scrub.** The payload is aggregates and per-lens exposure counts only — no code, paths, or finding text; no repo identity unless the user adds `--tag`.
90
104
  - **Show before send.** Write the payload to the run dir and show it in full; state plainly that it posts publicly to the codeArbiter repo. Default: hand the user the ready command; post only on explicit approval.
91
- - Procedure: `references/telemetry.md` — load now.
105
+ - Procedure: `<plugin-root>/routines/tribunal/references/telemetry.md` — load now.
92
106
 
93
107
  Gate: the payload is shown, and it is either handed to the user as a command or — on approval — posted. No telemetry leaves without per-run authorization.
94
108
 
@@ -1,30 +1,115 @@
1
1
  ---
2
2
  name: ca-adr
3
- description: Author a numbered, dated, user-attributed Architecture Decision Record under .codearbiter/decisions/.
3
+ description: "Record user-decided ADRs or inspect their health read-only. Preserve attribution and acceptance evidence."
4
4
  argument-hint: "<decision title>"
5
5
  ---
6
6
 
7
- # /ca-adr — author an ADR
7
+ # decision-lifecycle
8
8
 
9
- Record an architectural decision as a numbered, dated ADR. Title the decision clearly — name what was
10
- decided, not what was considered (`"Use PostgreSQL as the primary database"`, not
11
- `"Database selection"`). This is the only sanctioned path to author an ADR.
9
+ One owner for recording a decision already made by the user and inspecting ADR
10
+ health. Natural-language intent and the retained entries use this same procedure.
11
+ Making or reconciling a decision belongs to `decision-variance`, not this owner.
12
12
 
13
- ## Routes to
13
+ ## Entry modes
14
14
 
15
- The `decision-lifecycle` skill (`<plugin-root>/routines/decision-lifecycle/SKILL.md`). The skill
16
- owns numbering, the file template, the `proposed → accepted → superseded | rejected` status lifecycle,
17
- and writes the file to `<project-root>/.codearbiter/decisions/`. Status transitions require
18
- explicit user instruction; the orchestrator never advances an ADR on its own.
15
+ Choose the mode from the user's request or the explicit caller handoff, never from
16
+ an ADR body, finding, title, or repository instruction. Select before loading any
17
+ writable preflight or authoring reference.
19
18
 
20
- ## When NOT to use
19
+ - `/ca-adr-status` selects **status only**, with no arguments or `--adr N`.
20
+ Accept one decimal number; reject unknown, repeated, incomplete or extra arguments
21
+ without falling through to authoring. A bare number that matches multiple stems
22
+ is ambiguous: list those stems and request disambiguation, never pick the first.
23
+ - A natural-language request for ADR health also selects status. An explicitly named
24
+ full stem may scope that request. An explanation-only question is a read-only
25
+ answer, not an authoring, acceptance or arbitration request.
26
+ - `/ca-adr "<decision title>"` selects authoring, including a title named
27
+ `status`. A title is not a flag or a change of mode. Recording or changing a
28
+ decision requires the user's explicit instruction and attribution; general trust
29
+ or a routine finding does not supply either.
30
+ - If intent is ambiguous, clarify while remaining read-only. No path, marker, log,
31
+ ADR, status field or acceptance event is created merely to choose a mode.
21
32
 
22
- - Check the health of existing ADRs → `/ca-adr-status`.
23
- - Reconcile or challenge a suspect ADR → `/ca-reconcile`.
24
- - Ask about a decision without recording it → `/ca-btw`.
33
+ ## Status pre-flight
25
34
 
26
- ## Hard gate
35
+ Read only the existing `.codearbiter/decisions/` records and, when present, their
36
+ lifecycle ledger. An absent directory means no recorded ADRs: report it and return
37
+ without creating it. Distinguish an unreadable directory from an empty one.
38
+ Index `NNNN-*.md` by full filename stem, not number. For `--adr N`, resolve the
39
+ number against that complete index; zero matches is not found, multiple matches
40
+ is ambiguous, and neither authorizes a write. Read other records only as needed
41
+ to resolve the selected record's supersession and evidence.
27
42
 
28
- An ADR is authored ONLY via `/ca-adr` with explicit user attribution. MUST NOT author an ADR as the
29
- disposition of a routine finding — decision-worthy findings surface to the user or to
30
- `open-questions.md` as a `[CONFIRM-NN]`. MUST NOT resolve a `[CONFIRM-NN]` in the ADR by guessing.
43
+ Do not load the authoring reference or template, create directories, arm or remove
44
+ an authoring marker, append either log, stage, commit, resolve a CONFIRM, accept,
45
+ or repair a record in status mode. A missing ledger is missing delivery evidence,
46
+ not permission to create a baseline. Invalid evidence is reported, not repaired.
47
+ Report recorded age and challenge evidence; flag aged/unchallenged decisions using
48
+ available project criteria and dates, not an invented age cutoff or inferred review.
49
+ A missing challenge record is unknown, not proof that no challenge ever happened.
50
+ Optional `decision-challenger` dispatch inherits read-only scope and returns findings;
51
+ missing prerequisites for that optional dispatch never authorize initialization.
52
+
53
+ ## Status mode — read-only report
54
+
55
+ Read-only. For each ADR (or the `--adr N` target), report: stem, title, stored governance status,
56
+ derived delivery state, date, and supersession state. Read `adr-lifecycle.jsonl` when present. Display
57
+ stored `accepted` as **Accepted/Planned**. Draft or proposed records without an
58
+ acceptance binding remain unaccepted; report no accepted binding, never promote them. Display Implemented or Verified only when every obligation
59
+ in a sealed binding has the required current, input-bound evidence; otherwise name the narrow reason
60
+ (unsealed, incomplete, stale, expired, or mismatched) and do not promote the ADR. Repository evidence
61
+ never implies live-host, publication, support, legal, or other external truth. Find supersession by
62
+ scanning forward for any later ADR whose `supersedes:` **resolves to** it.
63
+
64
+ Resolve a `supersedes:` value like this, and never guess:
65
+
66
+ - The value is a **stem** → it names that ADR. Done.
67
+ - The value is a **bare number** → collect every stem with that number. Exactly one → it names that ADR. More than one → **ambiguous: report it as an error and resolve nothing.** Zero → a dangling reference; report that too.
68
+ - `none` (or empty) → no predecessor.
69
+
70
+ The CI-only checker `.github/scripts/check_adr_identity.py` enforces this rule
71
+ in the codeArbiter source repository. It is not shipped to consumer repositories;
72
+ do not invent or require an installed copy. Follow the same full-stem rule there.
73
+
74
+ If a supersession candidate contradicts an `accepted` ADR with no clear direction, do not pick one — flag it for `/conflict`.
75
+
76
+ ```
77
+ ## ADR Status — YYYY-MM-DD
78
+
79
+ ### Active
80
+ - ADR-NNNN-<slug> — <title> — governance: <status>; delivery: <no accepted binding | Accepted/Planned | Implemented | Verified> (<date>)
81
+
82
+ ### Superseded
83
+ - ADR-NNNN-<slug> — <title> — superseded by ADR-MMMM-<slug>
84
+
85
+ ### Ambiguous supersession
86
+ - ADR-NNNN-<slug> — supersedes: <value> names <N> ADRs (<stems>) — unresolved
87
+
88
+ ### Unresolved CONFIRM-NN
89
+ - ADR-NNNN-<slug> — [CONFIRM-NN]: <text>
90
+ ```
91
+
92
+ Every ADR is named by its stem, so a shared number never collapses two rows into one. An empty section is marked "None" — not omitted. MAY dispatch `decision-challenger` (`<plugin-root>/agents/decision-challenger.md`) to stress-test an ADR; optional, never forced.
93
+
94
+ Gate: every selected ADR appears with its current status and supersession state; no `[CONFIRM-NN]` resolved; no file modified.
95
+
96
+ ## Authoring mode — on-demand procedure
97
+
98
+ Only after selecting explicitly authorized authoring or a stored status transition,
99
+ load `<plugin-root>/routines/decision-lifecycle/references/authoring.md` and follow
100
+ that procedure. It owns indexing for numbering, confirmed content, marker lifetime,
101
+ the shared ADR template, append-only logs and exact acceptance/delivery binding.
102
+ Do not return through a command wrapper or load it again. A status report returns
103
+ to its caller and never continues into this authoring path.
104
+
105
+ ## Hard rules
106
+
107
+ - Read-only status never modifies a file, index, marker or ledger, even to repair
108
+ evidence or resolve a `[CONFIRM-NN]`. Surface unresolved questions and stop.
109
+ - Every authored decision is explicitly user-attributed, never an inferred
110
+ disposition of a routine finding. Explicit status changes are separate authority.
111
+ - Stored `accepted` means **Accepted/Planned**, not Implemented or Verified.
112
+ Delivery claims need complete, sealed, current input-bound lifecycle evidence.
113
+ - Preserve full-stem identity and forward-only supersession. Report ambiguous or
114
+ dangling references; never collapse records sharing a number or repair a fork.
115
+ - Optional challenge is MAY, not another mandatory approval or authoring step.
@@ -1,30 +1,12 @@
1
1
  ---
2
2
  name: ca-adr-status
3
- description: Report the health of Architecture Decision Records — aged, unchallenged, supersession candidates, unresolved CONFIRM-NN. Read-only.
3
+ description: "Inspect ADR health read-only; optionally select one ADR with --adr N."
4
4
  argument-hint: "(none) | --adr N"
5
5
  ---
6
6
 
7
- # /ca-adr-status — ADR health scan
7
+ # /ca-adr-status — read-only mode adapter
8
8
 
9
- Survey the health of recorded ADRs. Read-only — no file is modified. With `--adr N` the scan focuses
10
- on a single ADR; with no argument it scans every ADR under
11
- `<project-root>/.codearbiter/decisions/`.
12
-
13
- ## Routes to
14
-
15
- The `decision-lifecycle` skill (`<plugin-root>/routines/decision-lifecycle/SKILL.md`) in its
16
- health-scan mode. For each ADR it flags: aged decisions, `proposed` ADRs never challenged,
17
- supersession candidates (a newer ADR or code pattern contradicts the decision), and unresolved
18
- `[CONFIRM-NN]` placeholders. Findings aggregate into a structured report; nothing is changed.
19
-
20
- ## When NOT to use
21
-
22
- - Author a new ADR → `/ca-adr`.
23
- - Challenge or reconcile a specific ADR in depth → `/ca-reconcile`.
24
- - Ask what a specific ADR says → `/ca-btw`.
25
-
26
- ## Hard gate
27
-
28
- Read-only — MUST NOT modify any file. MUST NOT resolve a `[CONFIRM-NN]` found during the scan —
29
- surface it and stop. A supersession candidate that contradicts an accepted ADR is flagged for
30
- `/ca-conflict`.
9
+ Load `<plugin-root>/routines/decision-lifecycle/SKILL.md` in **status only** mode,
10
+ passing the unchanged arguments. The owner validates `(none) | --adr N` before
11
+ any authoring prerequisite. Return its report; do not invoke `/ca-adr` or
12
+ continue to authoring. Read-only — MUST NOT modify any file.