@arbiterforge/ca-pi 0.18.4 → 0.20.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 (80) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/plugins/ca-pi/CHANGELOG.md +63 -0
  4. package/plugins/ca-pi/COMMANDS.md +2 -2
  5. package/plugins/ca-pi/SKILLS.md +5 -5
  6. package/plugins/ca-pi/SPRINT.md +44 -230
  7. package/plugins/ca-pi/agents/backend-author.md +5 -5
  8. package/plugins/ca-pi/agents/checkpoint-aggregator.md +7 -0
  9. package/plugins/ca-pi/agents/frontend-author.md +5 -5
  10. package/plugins/ca-pi/agents/grader.md +5 -4
  11. package/plugins/ca-pi/agents/infra-author.md +6 -7
  12. package/plugins/ca-pi/agents/scout.md +25 -24
  13. package/plugins/ca-pi/arbiter.md +6 -4
  14. package/plugins/ca-pi/generated/command-catalog.json +5 -5
  15. package/plugins/ca-pi/helpers/artifacts/ca-artifact-darwin-amd64 +0 -0
  16. package/plugins/ca-pi/helpers/artifacts/ca-artifact-darwin-arm64 +0 -0
  17. package/plugins/ca-pi/helpers/artifacts/ca-artifact-linux-amd64 +0 -0
  18. package/plugins/ca-pi/helpers/artifacts/ca-artifact-linux-arm64 +0 -0
  19. package/plugins/ca-pi/helpers/artifacts/ca-artifact-windows-amd64.exe +0 -0
  20. package/plugins/ca-pi/helpers/artifacts/ca-artifact-windows-arm64.exe +0 -0
  21. package/plugins/ca-pi/helpers/artifacts/release.json +37 -37
  22. package/plugins/ca-pi/hooks/_approvallib.py +41 -0
  23. package/plugins/ca-pi/hooks/_artifactlib.py +61 -115
  24. package/plugins/ca-pi/hooks/_artifactpromptlib.py +12 -12
  25. package/plugins/ca-pi/hooks/_bashguardlib.py +66 -4
  26. package/plugins/ca-pi/hooks/_contextselectlib.py +38 -35
  27. package/plugins/ca-pi/hooks/_contextwriterlib.py +114 -0
  28. package/plugins/ca-pi/hooks/_host.py +1 -1
  29. package/plugins/ca-pi/hooks/_prerequisitelib.py +35 -0
  30. package/plugins/ca-pi/hooks/_provenancelib.py +107 -1
  31. package/plugins/ca-pi/hooks/_readinjectlib.py +21 -7
  32. package/plugins/ca-pi/hooks/_reconciliationlib.py +167 -2
  33. package/plugins/ca-pi/hooks/_releaselib.py +6 -6
  34. package/plugins/ca-pi/hooks/_sprintapprovallib.py +52 -2
  35. package/plugins/ca-pi/hooks/artifact-reconcile.py +13 -4
  36. package/plugins/ca-pi/hooks/hostapi.py +1 -1
  37. package/plugins/ca-pi/hooks/init-codearbiter.py +34 -5
  38. package/plugins/ca-pi/includes/artifacts-attestation.md +434 -0
  39. package/plugins/ca-pi/includes/artifacts.md +138 -492
  40. package/plugins/ca-pi/includes/author-tdd-workflow.md +32 -21
  41. package/plugins/ca-pi/includes/fresh-verification.md +14 -12
  42. package/plugins/ca-pi/includes/harvest.md +3 -3
  43. package/plugins/ca-pi/includes/reference-map.md +1 -1
  44. package/plugins/ca-pi/includes/routing-table.md +3 -3
  45. package/plugins/ca-pi/includes/smarts/core.md +93 -17
  46. package/plugins/ca-pi/includes/smarts/lenses.md +115 -0
  47. package/plugins/ca-pi/includes/sprint-authority.md +6 -1
  48. package/plugins/ca-pi/includes/verification-boundary.md +11 -2
  49. package/plugins/ca-pi/package.json +1 -1
  50. package/plugins/ca-pi/routines/INDEX.md +8 -8
  51. package/plugins/ca-pi/routines/brainstorming/SKILL.md +71 -202
  52. package/plugins/ca-pi/routines/commit-gate/SKILL.md +60 -25
  53. package/plugins/ca-pi/routines/context-check/SKILL.md +89 -53
  54. package/plugins/ca-pi/routines/context-creation/SKILL.md +114 -220
  55. package/plugins/ca-pi/routines/debug/SKILL.md +1 -0
  56. package/plugins/ca-pi/routines/decision-variance/references/analysis.md +5 -2
  57. package/plugins/ca-pi/routines/decompose/SKILL.md +139 -167
  58. package/plugins/ca-pi/routines/executing-plans/SKILL.md +38 -136
  59. package/plugins/ca-pi/routines/finishing-a-development-branch/SKILL.md +45 -55
  60. package/plugins/ca-pi/routines/refactor/SKILL.md +33 -12
  61. package/plugins/ca-pi/routines/release/SKILL.md +1 -1
  62. package/plugins/ca-pi/routines/subagent-driven-development/SKILL.md +88 -230
  63. package/plugins/ca-pi/routines/tdd/SKILL.md +115 -228
  64. package/plugins/ca-pi/routines/writing-plans/SKILL.md +112 -174
  65. package/plugins/ca-pi/skills/ca-audit/SKILL.md +2 -2
  66. package/plugins/ca-pi/skills/ca-checkpoint/SKILL.md +1 -1
  67. package/plugins/ca-pi/skills/ca-commit/SKILL.md +60 -25
  68. package/plugins/ca-pi/skills/ca-context-check/SKILL.md +89 -53
  69. package/plugins/ca-pi/skills/ca-create-context/SKILL.md +114 -220
  70. package/plugins/ca-pi/skills/ca-debug/SKILL.md +1 -0
  71. package/plugins/ca-pi/skills/ca-decompose/SKILL.md +139 -167
  72. package/plugins/ca-pi/skills/ca-feature/SKILL.md +28 -38
  73. package/plugins/ca-pi/skills/ca-fix/SKILL.md +21 -9
  74. package/plugins/ca-pi/skills/ca-init/SKILL.md +18 -40
  75. package/plugins/ca-pi/skills/ca-pr/SKILL.md +45 -55
  76. package/plugins/ca-pi/skills/ca-refactor/SKILL.md +33 -12
  77. package/plugins/ca-pi/skills/ca-release/SKILL.md +1 -1
  78. package/plugins/ca-pi/skills/ca-review/SKILL.md +5 -8
  79. package/plugins/ca-pi/skills/ca-sprint/SKILL.md +11 -25
  80. package/plugins/ca-pi/skills/ca-status/SKILL.md +15 -6
@@ -1,20 +1,19 @@
1
1
  ---
2
2
  name: ca-context-check
3
- description: "Audit stale provenance-tracked docs on request. Report first; re-scout or re-baseline only for selected docs."
3
+ description: "Inspect context drift and refresh selected source-backed documents under existing authorization."
4
4
  argument-hint: "(none)"
5
5
  ---
6
6
 
7
7
  # context-check
8
8
 
9
- An optional, on-demand drift audit for bypass cases: a merge or an external
10
- edit drifted a tracked source file you are not about to commit, so commit-gate's
11
- Phase 5.5 auto-heal did not fire. This skill reports stale docs and lets you
12
- act on each one individually.
9
+ Inspect context drift or refresh selected source-backed documents. This includes
10
+ drift from a merge or external edit that commit-gate's Phase 5.5 auto-heal did
11
+ not cover, and an explicitly requested full refresh of initialized context.
13
12
 
14
13
  This skill is NOT in the daily loop. Commit-gate auto-heal (Phase 5.5,
15
- `heal_worklist`) owns the routine maintenance path. Invoke this only when drift
16
- was introduced outside a commit (e.g. a direct push, a merge you did not
17
- author, a manual file edit).
14
+ `heal_worklist` for v1 and `v2_heal_worklist` for managed pairs) owns routine
15
+ maintenance. Reuse existing selection and
16
+ authorization for requested refresh; an audit-only request remains read-only.
18
17
 
19
18
  <!-- catalog-compatibility-notice:start -->
20
19
  > Compatibility route. Prefer `/ca-status drift` for new explicit usage. The retained entry
@@ -27,9 +26,11 @@ author, a manual file edit).
27
26
  Use this owner for a requested provenance drift audit, `/ca-status drift`, or
28
27
  the explicit `/ca-context-check` compatibility entry. Explanation-only questions
29
28
  and ordinary status snapshots remain read-only answers, not repair requests.
30
- Report first. Write only after the user selects re-scout or re-baseline for that
31
- document; never change an unselected derived document. This owner neither stages
32
- nor commits. Routine commit-gate auto-heal is unchanged.
29
+ Report first for an audit-only request. A direct request to refresh selected
30
+ documents or the full project context supplies that selection; reuse the
31
+ existing authorization instead of asking again per document. Never change an
32
+ unselected derived document. This owner neither stages nor commits. Routine
33
+ commit-gate auto-heal is unchanged.
33
34
 
34
35
  An **initialized refresh** belongs to this existing owner after an explicit
35
36
  selection. It is separate from initial population: do not call the initialized
@@ -73,7 +74,7 @@ is unknown coverage, even when a neighboring v1 or v2 record is usable. Report
73
74
  the usable records and the unknowns separately; never turn an empty legacy
74
75
  drift report into a fresh verdict for v2. `v2_current` acknowledges matching
75
76
  identities only. `semantic: unverified` and `verified_fresh: false` remain in
76
- force until the owning semantic review and writer receipt establish otherwise;
77
+ force: only actual evidence can support a narrower semantic claim;
77
78
  changing hashes or choosing re-baseline does not perform that review.
78
79
 
79
80
  Only if the relevant legacy drift report is empty and v2 coverage/identities
@@ -103,8 +104,7 @@ stale path. Do not offer an automatic write for an unbounded scope.
103
104
  ### Unsupported human content and owner reconciliation
104
105
 
105
106
  An unsupported human Markdown layout, ambiguous duplicate anchor, unparseable
106
- custom section, oversized document or absent managed ownership record is a
107
- write refusal for that document, not a reason to erase it or abandon safe
107
+ custom section or oversized document is a write refusal for that document, not a reason to erase it or abandon safe
108
108
  task-time reading. An unrelated unknown section in an otherwise supported
109
109
  document remains unowned and byte-identical during a supported field update.
110
110
  Preserve exact bytes and report the specific unsupported or unowned span.
@@ -116,36 +116,38 @@ project. Surface a real conflict without silently displacing either source.
116
116
 
117
117
  If the requested change would adopt or replace normative instructions, route
118
118
  the proposal to its actual owner and obtain that owner's actual approval before
119
- any supported bounded update. An unsupported template needs explicit
120
- reconciliation or a qualified per-kind transition through the existing context
121
- writer. Its refusal never authorizes raw Write/Edit fallback or a regex rewrite.
119
+ any supported bounded update. Missing or legacy v1 provenance may use explicit native `adopt` with current
120
+ evidence and selected supported spans, preserving the old provenance preimage.
121
+ An unsupported template still needs reconciliation through its actual owner or
122
+ a supported writer transition. Its refusal never authorizes raw Write/Edit fallback or a regex rewrite.
122
123
  Task, question, audit, release and ADR files remain with their existing writers;
123
124
  do not normalize, recreate or edit their history during context refresh.
124
125
 
125
126
  ### Step 3 — Selected initialized refresh
126
127
 
127
- For each stale or bounded affected document, present supported re-scout,
128
- re-baseline and defer choices; wait for the user's selection. A user may instead
129
- explicitly select full refresh. Do not interpret
130
- `status drift`, the drift report itself or an ordinary status request as that
131
- selection. Record the selected documents and declared affected source paths
132
- before any scout or write. An incremental refresh re-scouts only the selected
133
- drifted paths and affected logical assignments. A full refresh declares all six
134
- logical assignments and all five content documents. Retain prior coverage as
135
- prior evidence; a scoped `join_scout_reports` result has `full_coverage: false`
136
- and must never be described as a newly completed full scan.
137
-
138
- **re-scout** — dispatch an incremental re-scout of the drifted paths for this
139
- doc, scoped to those paths only. Use the context-creation containment profile,
140
- run budget, `admit_scout_attempt` and `join_scout_reports` contract for exactly
141
- the declared affected assignments. A missing/failed report, changed snapshot,
142
- contradiction or unresolved task-dependent decision blocks the selected write.
143
- If the claims still hold, a valid selected owned-field metadata refresh may
144
- keep document bytes identical only when proposed v2 provenance actually
145
- changes. Missing selection and unchanged proposed provenance refuse; retain
146
- the stale pair and do not claim freshness in those cases. Any update still
147
- requires current source evidence, exact preview approval and receipt-only
148
- apply. Surface the proposed content and provenance pair for exact review.
128
+ Use the user's selected documents and affected scope. If only an audit was
129
+ requested, offer reinspection, re-baseline and defer choices before writing.
130
+ A request for full refresh already selects all five content documents and all
131
+ six logical categories; do not repeat that question. Record the selection and
132
+ source paths, then inspect only what those claims need. Keep the initialized
133
+ marker and prior history. Full inspection accounts for all six categories;
134
+ incremental inspection does not claim a new full scan.
135
+
136
+ **re-scout / reinspect** — use direct bounded inspection or optional scoped
137
+ agents for the selected claims. The context-creation evidence and gap rules
138
+ apply. When structured reports help, `join_scout_reports` tracks their declared
139
+ coverage; a scoped result has `full_coverage: false`. The helper is not a
140
+ permission or containment check. A missing report can be replaced by direct
141
+ inspection, but failed or uninspected work never becomes evidence of absence.
142
+ Recheck changed source snapshots and resolve contradictions before their
143
+ claims are written. Unrelated gaps do not hold independent selected work.
144
+
145
+ If claims still hold, a selected owned-field metadata refresh may keep document
146
+ bytes identical when current evidence changes the v2 provenance. Missing
147
+ selection and unchanged proposed provenance refuse rather than claim a refresh.
148
+ Surface the proposed content and provenance pair, inspect its source bindings,
149
+ and apply within the selected authorization. Review consequential or disputed
150
+ claims independently when useful; a matching digest does not verify semantics.
149
151
 
150
152
  **re-baseline** — the legacy v1 provenance choice may acknowledge a verified
151
153
  cosmetic change through its existing owner, where applicable. For an enrolled
@@ -155,22 +157,56 @@ If no field is selected or the proposed pair is a true no-op, retain the stale
155
157
  pair and defer that selection. Never directly write the v2 provenance or use
156
158
  the legacy `rebaseline` helper as a fallback for it.
157
159
 
158
- **full refresh** — only after explicit selection, use the same qualified
159
- containment and bounded join with `mode: full` and six complete logical reports.
160
- Synthesize all five content documents from the new evidence and reconcile gaps
161
- under the context-creation Phase 3–4 rules. Do not enter its Phase 6 lock.
160
+ **full refresh** — use bounded inspection across all six categories and
161
+ synthesize all five content documents from current evidence. Preserve unknowns
162
+ and reconcile material user decisions under context-creation Phase 3–4. Do not
163
+ enter its Phase 6 lock for an already initialized repository.
162
164
 
163
- For each selected document, submit its finite typed `update` preview through
165
+ For a selected whole-document refresh, prepare a UTF-8 draft inside the workspace
166
+ that retains user-owned content outside the requested change. The installed CLI
167
+ collects bounded source hashes and chooses create/adopt/update from the current
168
+ pair. Substitute the actual inspected repository-relative source paths; repeat
169
+ `--source` for each supporting file. For example:
170
+
171
+ ```text
172
+ python "<plugin-root>/hooks/init-codearbiter.py" --root "<project-root>" --context-draft "context-code-map-draft.md" --document code-map --source "src/main.py"
173
+ ```
174
+
175
+ This retains an internal preview but does not change the content document or
176
+ provenance. Inspect the returned diff, then apply the exact returned reference
177
+ and digest:
178
+
179
+ ```text
180
+ python "<plugin-root>/hooks/init-codearbiter.py" --root "<project-root>" --context-apply "<preview_ref>" --preview-sha256 "<preview_sha256>"
181
+ ```
182
+
183
+ The source list must support the draft; it is not an automatic semantic review.
184
+ The convenience path records `semantic_review: unreviewed`. Use typed field
185
+ previews below when only specific managed fields are selected.
186
+
187
+ For each selected document, send the typed preview through
164
188
  `python "<plugin-root>/hooks/init-codearbiter.py" --root <exact-root> --context-request <request-file>`.
165
- The installed qualified context writer checks the existing document/provenance
166
- pair, current source evidence, field ownership and protected target set. Review
167
- the exact proposed pair and obtain its own native `approve-context` reply; apply
168
- only its receipt through the same `--context-request` bridge. Read back the
169
- committed pair and confirm the standalone `<!--INITIALIZED-->` marker remains
170
- for `CONTEXT.md`. The writer's five content targets exclude task, question and
171
- audit history. Never edit those owners as a side effect, hand-write a provenance
172
- record, bypass a refusal, stage or commit here. If the installed writer or
173
- qualified scout profile is unavailable, report that boundary and retain state.
189
+ The request uses `operation: preview` and a `preview` object. Native
190
+ `context-preview` supports `create` for a genuinely absent document, explicit
191
+ `adopt` for supported missing/v1 provenance, and `update` for a managed v2 pair.
192
+ Supply the exact expected document/provenance hashes, selected fields, typed
193
+ content and source evidence. Keep request files inside the workspace.
194
+
195
+ Inspect the returned diff and preserved content. Apply with `operation: apply`,
196
+ `preview_ref` and `preview_sha256` through the same bridge;
197
+ native `context-apply` rechecks the preview and current identities under its
198
+ lock and writes the selected document/provenance pair together. No approval
199
+ receipt, actor ticket or qualified scout profile is a prerequisite for ordinary
200
+ already-authorized refresh. This is compare-and-swap protection, not a second
201
+ permission system. A stale preview requires reinspection, never an overwrite.
202
+ After a lost response, inspect the transaction and retry its identical request
203
+ and operation ID or use native recovery; do not start a duplicate write.
204
+
205
+ Read back the committed pair and confirm `<!--INITIALIZED-->` remains for
206
+ `CONTEXT.md`. Keep unowned spans byte-identical and retain legacy provenance
207
+ history. Task, question, audit, release and ADR history stay with their actual
208
+ writers. Never hand-write a provenance record or bypass a refused unsupported
209
+ shape. A missing safe writer stops that write, not authorized task-time reads.
174
210
 
175
211
  **defer** — do nothing for this doc now. The drift line will reappear at the
176
212
  next SessionStart. Use when the change is in-progress and the doc update should