P06 - Recover context drift without losing unrelated work
Choose the commands you use
Operating system
codeArbiter host
Know before you begin
An agent can make the wrong change when project context describes old behavior. Find one claim contradicted by source, correct it through the context writer, and preserve an unrelated note exactly.
P06 is a public guided and runnable Academy lesson in this preview. Its shared action cards are the public course route.
Complete P05 in the same Academy fork and clone. Before Prepare, return to main and confirm that your worktree is clean: git status --short should print nothing. Keep a native terminal open at the clone root for Academy Prepare, Check, and Reset. Keep one codeArbiter harness open at that same clone for inspection, the context audit, and the two governed commits.
This is a recovery lesson, not a cleanup lesson. The prepared scenario contains a stale .codearbiter/CONTEXT.md, a matching stale provenance record, and an unrelated docs/preserved-note.md. You will prove that the note survived byte-for-byte. Never delete, recreate, normalize, or “tidy” it.
Native-terminal commands are entered directly and never start with !. codeArbiter commands and agent messages are entered in your selected harness and never start with !. Every action card names the actor and the surface so you do not have to infer where a command belongs.
What you will prove
The prepared context says Workshop Queue report output is JSON-only. The prepared source proves the opposite: stable text is the default and structured JSON is optional. This exercise corrects only the CLI claim. Preserve the lifecycle link and all other claims; reviewing a different source belongs in a separate scoped refresh. The legacy provenance points to older source. Let the installed native writer adopt it into v2 after inspecting the current source; never repair provenance by replacing a hash yourself.
You will make exactly two ordered single-parent commits after Prepare. The first records only the native writer's corrected context and v2 provenance pair. The second introduces only a canonical recovery handoff. Academy Check independently compares those commits with the prepared baseline and verifies that the unrelated note has identical raw Git-object bytes before and after the repair.
Prepare safely
Prepare one preserved recovery attempt
At the root of your Academy clone on a clean main branch, run Prepare in a native terminal. Academy creates the numbered attempt and freezes the stale context, provenance record, and unrelated note before you inspect anything.
A prepared commit gives Check a fixed before-state and keeps a failed recovery attempt inspectable.
You · Native terminal · Windows
$academy = "$env:LOCALAPPDATA\ArbiterAcademy\preview-0.33\Scripts\arbiter-academy.exe"
& $academy --repository (Get-Location).Path prepare P06-context-drift-recovery
You · Native terminal · macOS
academy="${XDG_DATA_HOME:-$HOME/.local/share}/arbiter-academy/preview-0.33/bin/arbiter-academy"
"$academy" --repository "$PWD" prepare P06-context-drift-recovery
You · Native terminal · Linux
academy="${XDG_DATA_HOME:-$HOME/.local/share}/arbiter-academy/preview-0.33/bin/arbiter-academy"
"$academy" --repository "$PWD" prepare P06-context-drift-recovery
Academy prints academy/P06-context-drift-recovery/ATTEMPT_NUMBER and leaves you on that numbered branch.
If Prepare names a dirty worktree or branch condition, preserve the message and resolve only that condition. Do not reset, rebase, or delete an earlier attempt.
The prepared commit is the trusted baseline for every later byte and history comparison.
ATTEMPT_NUMBER means the number Academy prints, such as 1; do not type that word literally. Stay on the numbered branch until Check passes or Reset creates a preserved retry.
Have the agent expose the contradictory evidence
In your selected codeArbiter harness, ask the agent to read the prepared context, provenance, preserved note, current CLI source without editing. The agent must show why the context is stale before you select a recovery route.
The correction is justified by a tracked source contradiction, not by guessing that documentation is old.
Your agent · Claude Code harness · All operating systems
Read, do not edit, .codearbiter/CONTEXT.md, .codearbiter/.provenance/CONTEXT.json, docs/preserved-note.md, workshop_queue/cli.py. Show the stale report claim, the source behavior that contradicts it, the recorded source object ID, the prepared source object ID, and the unrelated note boundary. Do not select a route, edit, stage, or commit.
Your agent · Codex harness · All operating systems
Read, do not edit, .codearbiter/CONTEXT.md, .codearbiter/.provenance/CONTEXT.json, docs/preserved-note.md, workshop_queue/cli.py. Show the stale report claim, the source behavior that contradicts it, the recorded source object ID, the prepared source object ID, and the unrelated note boundary. Do not select a route, edit, stage, or commit.
Your agent · Pi harness · All operating systems
Read, do not edit, .codearbiter/CONTEXT.md, .codearbiter/.provenance/CONTEXT.json, docs/preserved-note.md, workshop_queue/cli.py. Show the stale report claim, the source behavior that contradicts it, the recorded source object ID, the prepared source object ID, and the unrelated note boundary. Do not select a route, edit, stage, or commit.
You can see that stable text is the default, structured JSON is optional, and the lifecycle reference and docs/preserved-note.md are outside this repair.
If any named evidence file is missing or differs from the prepared scenario, stop and preserve the attempt. Use Reset for a fresh prepared baseline; do not substitute evidence.
This inspection supports your decision, but Check later verifies committed objects rather than an agent transcript.
Practice
Run the host context audit
Run this codeArbiter command in the selected harness. It is a codeArbiter command, not a shell command, so it never begins with !. Read the finding before choosing the route.
The host audit makes the available context-recovery routes visible before the scope is changed.
Your agent · Claude Code harness · All operating systems
/ca:status drift
Your agent · Codex harness · All operating systems
$ca-status drift
Your agent · Pi harness · All operating systems
/ca-status drift
Your agent · Pi harness · All operating systems
/skill:ca-status drift
The agent identifies the contradicted context claim and offers a scoped recovery decision instead of silently rewriting broad repository context.
If the host reports an unrelated blocker, preserve its finding and resolve that blocker first. Do not claim the audit ran by writing a replacement receipt.
The final handoff records your declared route; Check does not prove that the host command ran.
Select the bounded re-scout decision
You · Active codeArbiter harness · All operating systems
Choose scoped re-scout because the prepared source contradicts the recorded claim. Do not choose an alternate route or a broader documentation rewrite.
Re-scout refreshes one source-backed claim while preserving unrelated evidence and the prepared exercise boundary.
The next instruction is limited to the stale report statement, its lifecycle link, and the provenance entry that names the source.
If you cannot explain the contradiction from the prepared files, return to the evidence inspection instead of making a route choice.
The handoff later declares re-scout, but that declaration is not proof of a host invocation or of your reasoning process.
re-scout is the sole permitted recovery route because the prepared source directly contradicts the recorded claim. It refreshes this bounded evidence; it does not authorize an alternate route, a broad context rewrite, or a new baseline.
Refresh the selected context through the native writer
Ask the agent to prepare and inspect a source-backed refresh, then apply the native preview under this request. Review both resulting files before the separate commit step.
Separating the correction from the handoff makes the two-commit topology reconstructable.
Your agent · Claude Code harness · All operating systems
Refresh only the P06 CONTEXT document using the installed context writer. Inspect workshop_queue/cli.py. Prepare a draft in .academy/P06-context-draft.md that preserves all other text, replaces the stale report sentence with: Workshop Queue report output defaults to stable text and supports structured JSON with --format json. Preserve the lifecycle link and all other claims; this preview binds only the CLI source. Use native context-draft with document CONTEXT and source workshop_queue/cli.py, inspect its preview, and apply the returned reference and digest. This adopts the legacy provenance into v2; do not hand-edit provenance or claim semantic freshness. Preserve the legacy preimage and docs/preserved-note.md. Stop before staging or committing. If the writer refuses, retain the refusal and inspect the unsupported input; do not fall back to raw writes.
Your agent · Codex harness · All operating systems
Refresh only the P06 CONTEXT document using the installed context writer. Inspect workshop_queue/cli.py. Prepare a draft in .academy/P06-context-draft.md that preserves all other text, replaces the stale report sentence with: Workshop Queue report output defaults to stable text and supports structured JSON with --format json. Preserve the lifecycle link and all other claims; this preview binds only the CLI source. Use native context-draft with document CONTEXT and source workshop_queue/cli.py, inspect its preview, and apply the returned reference and digest. This adopts the legacy provenance into v2; do not hand-edit provenance or claim semantic freshness. Preserve the legacy preimage and docs/preserved-note.md. Stop before staging or committing. If the writer refuses, retain the refusal and inspect the unsupported input; do not fall back to raw writes.
Your agent · Pi harness · All operating systems
Refresh only the P06 CONTEXT document using the installed context writer. Inspect workshop_queue/cli.py. Prepare a draft in .academy/P06-context-draft.md that preserves all other text, replaces the stale report sentence with: Workshop Queue report output defaults to stable text and supports structured JSON with --format json. Preserve the lifecycle link and all other claims; this preview binds only the CLI source. Use native context-draft with document CONTEXT and source workshop_queue/cli.py, inspect its preview, and apply the returned reference and digest. This adopts the legacy provenance into v2; do not hand-edit provenance or claim semantic freshness. Preserve the legacy preimage and docs/preserved-note.md. Stop before staging or committing. If the writer refuses, retain the refusal and inspect the unsupported input; do not fall back to raw writes.
The native transaction updates CONTEXT.md and its v2 provenance together. The unrelated note is unchanged; no Git commit has been made.
If any other path is staged or the note changed, stop. Preserve the attempt and use Reset rather than unstaging around an unclear correction.
The first learner commit is allowed to contain only the corrected context and provenance objects.
Review the first commit boundary yourself
Inspect the two-file correction and preserved note. Once satisfied, explicitly stage those two paths for the commit gate.
A small staged review prevents a correct concept from becoming an oversized recovery commit.
You · Claude Code harness · All operating systems
Show git diff -- .codearbiter/CONTEXT.md .codearbiter/.provenance/CONTEXT.json and confirm docs/preserved-note.md is unchanged. Check that v2 provenance binds the corrected document and inspected source, while semantic_review remains unreviewed. Stage exactly .codearbiter/CONTEXT.md and .codearbiter/.provenance/CONTEXT.json, show the staged path list, and stop before committing.
You · Codex harness · All operating systems
Show git diff -- .codearbiter/CONTEXT.md .codearbiter/.provenance/CONTEXT.json and confirm docs/preserved-note.md is unchanged. Check that v2 provenance binds the corrected document and inspected source, while semantic_review remains unreviewed. Stage exactly .codearbiter/CONTEXT.md and .codearbiter/.provenance/CONTEXT.json, show the staged path list, and stop before committing.
You · Pi harness · All operating systems
Show git diff -- .codearbiter/CONTEXT.md .codearbiter/.provenance/CONTEXT.json and confirm docs/preserved-note.md is unchanged. Check that v2 provenance binds the corrected document and inspected source, while semantic_review remains unreviewed. Stage exactly .codearbiter/CONTEXT.md and .codearbiter/.provenance/CONTEXT.json, show the staged path list, and stop before committing.
You can account for both staged paths and see no change to docs/preserved-note.md.
If the review shows an unrelated change, keep the attempt as evidence and use Reset for a new numbered baseline. Do not amend or rebase committed work.
Check reconstructs the committed path boundary; it does not authenticate that you personally viewed this review.
Commit the correction through codeArbiter
After your staged-boundary review, run the codeArbiter commit gate in the selected harness. This command never begins with !.
The correction must become the first of exactly two linear commits after Prepare.
Your agent · Claude Code harness · All operating systems
/ca:commit
Your agent · Codex harness · All operating systems
$ca-commit
Your agent · Pi harness · All operating systems
/ca-commit
Your agent · Pi harness · All operating systems
/skill:ca-commit
The first descendant of Prepare contains exactly the two correction paths and leaves the worktree clean.
If the commit gate blocks, preserve its finding and resolve the named issue without expanding the two-file correction scope.
Check reads commit ancestry and changed paths, not a commit message chosen by a learner.
Generate the digest-bound recovery handoff
In a native terminal at the Academy clone root, run the local Academy helper. It derives a candidate only from committed Git objects and leaves it untracked and unstaged for your review.
The lesson teaches evidence-led recovery, not hand-authoring canonical JSON or blob hashes.
You · Native terminal · Windows
$academy = "$env:LOCALAPPDATA\ArbiterAcademy\preview-0.33\Scripts\arbiter-academy.exe"
& $academy --repository (Get-Location).Path write-handoff P06-context-drift-recovery
You · Native terminal · macOS
academy="${XDG_DATA_HOME:-$HOME/.local/share}/arbiter-academy/preview-0.33/bin/arbiter-academy"
"$academy" --repository "$PWD" write-handoff P06-context-drift-recovery
You · Native terminal · Linux
academy="${XDG_DATA_HOME:-$HOME/.local/share}/arbiter-academy/preview-0.33/bin/arbiter-academy"
"$academy" --repository "$PWD" write-handoff P06-context-drift-recovery
Only .codearbiter/reports/academy/P06-recovery.json is untracked. It names re-scout and has identical preserved-note digests; it is not staged or committed.
If the helper refuses, preserve its message and use Reset for a fresh attempt. Do not create, overwrite, stage, or hand-edit a substitute handoff.
The helper derives a candidate from committed objects. Check later recomputes it and does not prove that a host command ran.
The helper writes one untracked candidate. It does not stage, commit, reset, run Check, contact a network service, or replace a report that already exists.
Stage only the generated handoff
In the native terminal at the Academy clone root, stage only the generated handoff. Do not stage the preserved note, correction files, or any substitute report.
The learner-visible staging boundary keeps the generated evidence separate from the earlier correction and makes the second commit reviewable.
You · Native terminal · Windows
git add -- .codearbiter/reports/academy/P06-recovery.json
You · Native terminal · macOS
git add -- .codearbiter/reports/academy/P06-recovery.json
You · Native terminal · Linux
git add -- .codearbiter/reports/academy/P06-recovery.json
The staged path list contains only .codearbiter/reports/academy/P06-recovery.json, ready for the second-commit review.
If the staged path list contains any other entry, stop and use Reset for a fresh attempt. Do not unstage around an unclear boundary or stage a replacement report.
Only this staged handoff path may become the second commit; the next action reviews that exact boundary.
Review the handoff as the second commit
Use the selected copyable request to inspect the staged handoff before committing. Confirm it is the only staged file and binds the re-scout route, prepared/correction commits, and preserved-note digests.
The handoff is evidence about the repair, so its own commit must stay separate from the correction it describes.
You · Claude Code harness · All operating systems
Run git diff --cached --name-only and git diff --cached. Show both outputs and assess only whether .codearbiter/reports/academy/P06-recovery.json is the sole staged path, names re-scout, identifies the prepared and correction commits, and preserves identical note digests. Do not change files, stage, commit, or clear the boundary; stop for my decision.
You · Codex harness · All operating systems
Run git diff --cached --name-only and git diff --cached. Show both outputs and assess only whether .codearbiter/reports/academy/P06-recovery.json is the sole staged path, names re-scout, identifies the prepared and correction commits, and preserves identical note digests. Do not change files, stage, commit, or clear the boundary; stop for my decision.
You · Pi harness · All operating systems
Run git diff --cached --name-only and git diff --cached. Show both outputs and assess only whether .codearbiter/reports/academy/P06-recovery.json is the sole staged path, names re-scout, identifies the prepared and correction commits, and preserves identical note digests. Do not change files, stage, commit, or clear the boundary; stop for my decision.
The staged boundary contains one canonical report and no recreated or edited preserved note.
If the handoff mixes another path or claims a different route, stop and use Reset. Do not amend the first correction commit.
Check verifies the report shape, digests, and commit order; it cannot prove who generated the JSON.
Commit the handoff through codeArbiter
After your handoff review, run the codeArbiter commit gate in the selected harness. This is the second and final learner commit for P06.
A dedicated evidence commit preserves the ordered distinction between correction and recovery record.
Your agent · Claude Code harness · All operating systems
/ca:commit
Your agent · Codex harness · All operating systems
$ca-commit
Your agent · Pi harness · All operating systems
/ca-commit
Your agent · Pi harness · All operating systems
/skill:ca-commit
There are exactly two ordered single-parent commits after Prepare, and git status --short prints nothing.
If the commit gate blocks, preserve its finding and correct only the named report condition in a new numbered attempt; do not amend history.
The verifier requires the second commit to introduce only the handoff.
Recognize success
The first learner commit after Prepare changes exactly .codearbiter/CONTEXT.md and .codearbiter/.provenance/CONTEXT.json. The second changes exactly .codearbiter/reports/academy/P06-recovery.json. The corrected context states: Workshop Queue report output defaults to stable text and supports structured JSON with --format json.
The native writer retains the old provenance preimage in its local transaction history. Its file transaction is not a Git commit. The matching digests do not claim semantic review or host qualification.
The handoff declares re-scout, identifies the prepared and correction commits, records the before/after SHA-256 values for context, provenance, and the preserved note, and has identical before/after note digests. Immediately before Check, git status --short prints nothing.
Check
Run the external Academy Check
From the Academy clone root, run Check in a native terminal after the second commit leaves the worktree clean.
The installed verifier evaluates the attempt from outside the learner flow and recomputes the evidence from Git objects.
You · Native terminal · Windows
$academy = "$env:LOCALAPPDATA\ArbiterAcademy\preview-0.33\Scripts\arbiter-academy.exe"
& $academy --repository (Get-Location).Path check P06-context-drift-recovery
You · Native terminal · macOS
academy="${XDG_DATA_HOME:-$HOME/.local/share}/arbiter-academy/preview-0.33/bin/arbiter-academy"
"$academy" --repository "$PWD" check P06-context-drift-recovery
You · Native terminal · Linux
academy="${XDG_DATA_HOME:-$HOME/.local/share}/arbiter-academy/preview-0.33/bin/arbiter-academy"
"$academy" --repository "$PWD" check P06-context-drift-recovery
Check prints checkpoint P06-context-drift-recovery: passed; progress: .academy/progress.json.
If Check fails, preserve the committed attempt and read the failed predicate. Use Reset for a fresh numbered attempt instead of rewriting committed evidence.
A pass verifies the frozen baseline, exact two-commit topology, object bytes, provenance repair, handoff, and clean worktree.
A pass contains checkpoint P06-context-drift-recovery: passed; progress: .academy/progress.json. Check proves the committed state, path boundaries, topology, raw-object digests, and preserved-note identity. It does not prove that the host command ran, that a particular agent made an edit, or why you selected the route. Those are honest workflow observations, not final-state claims.
Recover or continue
If Check names a failed predicate, preserve the committed attempt and compare the failure with the matching action card. Do not amend, rebase, force-reset, or conceal an earlier attempt.
Hint 1
The stale claim is a source contradiction, not a date mismatch. Compare the report parser choices and default with the context statement before you choose a route.
Hint 2
Before values come from prepared Git objects. A filesystem hash read after an edit cannot prove the earlier context, provenance, or note.
Hint 3
Keep the correction and handoff separate: the first commit has two paths, the second has one.
After Check passes, leave the completed branch intact and return to main with this native-terminal action.
Return to main after a passing Check
After Check passes, return to main in a native terminal. Leave the completed numbered attempt branch intact for later inspection.
A completed attempt remains evidence. Returning to main prepares the clone for the next published lesson without erasing the recovery history.
You · Native terminal · Windows
git switch main
You · Native terminal · macOS
git switch main
You · Native terminal · Linux
git switch main
You are back on main and the completed academy/P06-context-drift-recovery/ATTEMPT_NUMBER branch still exists.
If Check did not pass, stay on the preserved attempt and use Reset instead. Do not delete, force-reset, or rebase the completed or failed branch.
The retained attempt branch remains the inspectable recovery record; returning to main is not part of Check.
If Check did not pass, use Reset to create a preserved numbered retry.
Create a preserved numbered retry
Use Reset only when the attempt needs a new baseline. Run it in a native terminal at the Academy clone root; it archives the earlier branch before preparing the next number.
A retained failed attempt is evidence you can inspect, not debris to erase.
You · Native terminal · Windows
$academy = "$env:LOCALAPPDATA\ArbiterAcademy\preview-0.33\Scripts\arbiter-academy.exe"
& $academy --repository (Get-Location).Path reset P06-context-drift-recovery
You · Native terminal · macOS
academy="${XDG_DATA_HOME:-$HOME/.local/share}/arbiter-academy/preview-0.33/bin/arbiter-academy"
"$academy" --repository "$PWD" reset P06-context-drift-recovery
You · Native terminal · Linux
academy="${XDG_DATA_HOME:-$HOME/.local/share}/arbiter-academy/preview-0.33/bin/arbiter-academy"
"$academy" --repository "$PWD" reset P06-context-drift-recovery
Academy archives the earlier attempt and prints the next academy/P06-context-drift-recovery/ATTEMPT_NUMBER branch.
If Reset stops, preserve its message and current branch. Resolve only the named repository condition; never force-reset, rebase, or delete the prior attempt.
The archived branch remains reachable while the new attempt starts from the canonical prepared scenario.
P07 is public, guided, and runnable in this preview. Continue with its published Academy lesson after you return to main; do not substitute unpublished source exercises for the accepted course.
Understand the mechanism
A re-scout repairs one contradiction without pretending all context was freshly reviewed. Your two commits separate the source-backed correction from the record that describes it, and unrelated work stays byte-identical. Understand an Existing Project and Provenance & Context Drift explain how claims trace to source.
Use this in your own project. When code and context disagree, ask for a scoped drift check and follow the cited source. Refresh only supported claims.