brainstorming
Refine feature and sprint intent into a useful specification. Capture scope, observable criteria and material choices without…
Inspect context drift and refresh selected source-backed documents under existing authorization.
Claude Code
$ npx -y skills add arbiterForge/codeArbiter --skill ca-context-check --agent claude-code
Codex
$ npx skills add arbiterForge/codeArbiter --skill ca-context-check -a codex -y
Cursor
$ npx skills add arbiterForge/codeArbiter --skill ca-context-check -a cursor -y
Gemini CLI
$ npx skills add arbiterForge/codeArbiter --skill ca-context-check -a gemini-cli -y
GitHub Copilot
$ npx skills add arbiterForge/codeArbiter --skill ca-context-check -a github-copilot -y
OpenCode
$ npx skills add arbiterForge/codeArbiter --skill ca-context-check -a opencode -y
Windsurf
$ npx skills add arbiterForge/codeArbiter --skill ca-context-check -a windsurf -y
name: ca-context-check description: "Inspect context drift and refresh selected source-backed documents under existing authorization." argument-hint: "(none)"
Inspect context drift or refresh selected source-backed documents. This includes drift from a merge or external edit that commit-gate's Phase 5.5 auto-heal did not cover, and an explicitly requested full refresh of initialized context.
This skill is NOT in the daily loop. Commit-gate auto-heal (Phase 5.5, `heal_worklist` for v1 and `v2_heal_worklist` for managed pairs) owns routine maintenance. Reuse existing selection and authorization for requested refresh; an audit-only request remains read-only.
<!-- catalog-compatibility-notice:start --> > Compatibility route. Prefer `$ca-status drift` for new explicit usage. The retained entry > and natural-language intent use this owner under > [includes/command-compatibility.md](../../includes/command-compatibility.md). <!-- catalog-compatibility-notice:end -->
Use this owner for a requested provenance drift audit, `$ca-status drift`, or the explicit `$ca-context-check` compatibility entry. Explanation-only questions and ordinary status snapshots remain read-only answers, not repair requests. Report first for an audit-only request. A direct request to refresh selected documents or the full project context supplies that selection; reuse the existing authorization instead of asking again per document. Never change an unselected derived document. This owner neither stages nor commits. Routine commit-gate auto-heal is unchanged.
An **initialized refresh** belongs to this existing owner after an explicit selection. It is separate from initial population: do not call the initialized `$ca-create-context`/`$ca-init --brownfield` path, rerun the scaffolder, clear `<!--INITIALIZED-->`, or repeat context finalization. An ordinary status snapshot and the initial `$ca-status drift` report are read-only. A declined refresh leaves every file unchanged.
Run `knowledge.py format` first ([includes/knowledge.md](../../includes/knowledge.md)). When it reports `html`, use this section instead of the Markdown provenance flow below.
1. **Find what may be stale.** `knowledge.py stale` lists, per document, the records whose scoped paths or cited sources changed since that document's baseline commit. It is advisory: unlisted records are unaffected, and nothing is reset. A document with no baseline is reported as such, not as stale. 2. **Report** the listed records and their changed paths before offering actions. An audit-only request stops here. 3. **Refresh the selected records.** Reinspect only the changed paths those records rely on (the context-creation inspection and evidence rules apply), then `update` records whose claims changed, `add` newly observed ones and `retire` ones that no longer hold, each with its basis. An unchanged claim needs no write. A full refresh selected by the user covers all six categories. 4. **Rebaseline** each document whose listed records were checked: `knowledge.py rebaseline <doc>`. Leave a deferred document's baseline alone so its records are listed again next time.
For an explicitly selected initialized brownfield acquisition, inspect the relevant source categories using the same evidence rules, then update only affected observed knowledge. The existing `decompose` owner records the project's intended target, delta, future phases and candidate work in its separate document. Preserve prior answers, ADR references, work IDs and the initialized marker; record denied or uninspected scope as unknown. A candidate is not promoted by a context refresh. This extension does not make an ordinary drift report a request to perform full acquisition.
Every write is a journaled, retry-safe engine operation; there is no preview to approve and no provenance file to hand-write. `<!--INITIALIZED-->` and all history stay. Imported notes stay until a record replaces them.
Read these before computing drift:
1. `.codearbiter/.provenance/` — the per-doc provenance records. Load all records via `load_provenance_dir` from [hooks/_provenancelib.py](../../hooks/_provenancelib.py). 2. `.codearbiter/code-map.md` — coarse concern map; read to orient on which modules the stale docs govern.
Use `_provenancelib` helpers in this order:
1. `load_provenance_dir(root + "/.codearbiter/.provenance/")` — returns the provenance map `{doc: record}`. 2. Collect all `drift_trigger: true` paths across all records. 3. `batch_hash(paths, runner)` — hash every existing path in one git call. 4. `compute_drift(provenance_map, current_hashes)` — returns a drift report `{doc: [{path, kind}]}` for docs that have stale sources.
Alternatively reuse the same logic as `startup_drift_line` by calling it for a human-readable summary, then inspecting `compute_drift` directly for detail.
The `entries`/Git-hash comparison above covers legacy v1 records only. For every enrolled v2 document, call `assess_context_provenance` with the bounded current source/target snapshot and an action-boundary snapshot probe. Inspect its per-document states as well as aggregate coverage. A missing, corrupt or unsupported record, incomplete acquisition, partial hash or unchecked identity is unknown coverage, even when a neighboring v1 or v2 record is usable. Report the usable records and the unknowns separately; never turn an empty legacy drift report into a fresh verdict for v2. `v2_current` acknowledges matching identities only. `semantic: unverified` and `verified_fresh: false` remain in force: only actual evidence can support a narrower semantic claim; changing hashes or choosing re-baseline does not perform that review.
Only if the relevant legacy drift report is empty and v2 coverage/identities have been checked without unknowns may this audit report no stale identities
Open-source governance and hard gates for AI coding agents across Claude Code, Codex CLI, and Pi.
Refine feature and sprint intent into a useful specification. Capture scope, observable criteria and material choices without…
Create a verified local Git commit when committing changes is requested. Not for explaining commit history, drafting a message…
Inspect context drift and refresh selected source-backed documents under existing authorization.
Build source-backed project context through bounded inspection, optional agents, and record-level knowledge writes.
The banned-primitive gate. Routed to when changed code hashes, signs, encrypts, derives keys, generates security-relevant…
Investigate an unexplained defect or unexpected behavior without changing application code. Use for root-cause diagnosis and an…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.