Preview 0.30

P06 - Recover context drift without losing unrelated work

Know before you begin

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. The old lifecycle link also points to ADR-0002 even though P05 accepted ADR-0005. The provenance record names the older CLI object 042746e43698e5d2a6de4c536f1024f893aef805; the prepared source object is 5b41fb168a8b258cfae7eebc46e8b9ea7696ba56.

You will make exactly two ordered single-parent commits after Prepare. The first changes only the context and provenance record. 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.

Why

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.30\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.30/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.30/bin/arbiter-academy"
"$academy" --repository "$PWD" prepare P06-context-drift-recovery

Expected result

Academy prints academy/P06-context-drift-recovery/ATTEMPT_NUMBER and leaves you on that numbered branch.

If that does not happen

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.

Evidence

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, and ADR-0005 without editing. The agent must show why the context is stale before you select a recovery route.

Why

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, and .codearbiter/decisions/0005-terminal-blocked-ticket-lifecycle.md. 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, and .codearbiter/decisions/0005-terminal-blocked-ticket-lifecycle.md. 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, and .codearbiter/decisions/0005-terminal-blocked-ticket-lifecycle.md. 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.

Expected result

You can see that stable text is the default, structured JSON is optional, ADR-0005 replaced the lifecycle reference, and docs/preserved-note.md is outside the repair.

If that does not happen

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.

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.

Why

The host audit makes the available context-recovery routes visible before the scope is changed.

Your agent · Claude Code harness · All operating systems

/ca:context-check

Your agent · Codex harness · All operating systems

$ca-context-check

Your agent · Pi harness · All operating systems

/ca-context-check

Your agent · Pi harness · All operating systems

/skill:ca-context-check

Expected result

The agent identifies the contradicted context claim and offers a scoped recovery decision instead of silently rewriting broad repository context.

If that does not happen

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.

Evidence

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 and ADR-0005 superseded the older lifecycle reference. Do not choose an alternate route or a broader documentation rewrite.

Why

Re-scout refreshes one source-backed claim while preserving unrelated evidence and the prepared exercise boundary.

Expected result

The next instruction is limited to the stale report statement, its lifecycle link, and the provenance entry that names the source.

If that does not happen

If you cannot explain the contradiction from the prepared files, return to the evidence inspection instead of making a route choice.

Evidence

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.

Ask the agent for the exact two-file correction

Send the bounded correction instruction in the selected harness. The agent edits and stages only the two correction files, then stops for your review; it does not commit the handoff yet.

Why

Separating the correction from the handoff makes the two-commit topology reconstructable.

Your agent · Claude Code harness · All operating systems

Apply only the P06 scoped re-scout correction. In .codearbiter/CONTEXT.md replace the stale report sentence with exactly: Workshop Queue report output defaults to stable text and supports structured JSON with --format json. Update the lifecycle reference from ADR-0002 to ADR-0005. In .codearbiter/.provenance/CONTEXT.json update only the sole source hash to 5b41fb168a8b258cfae7eebc46e8b9ea7696ba56. Do not edit docs/preserved-note.md, create the handoff, commit, or touch any other path. Stage exactly those two correction files and stop for my review.

Your agent · Codex harness · All operating systems

Apply only the P06 scoped re-scout correction. In .codearbiter/CONTEXT.md replace the stale report sentence with exactly: Workshop Queue report output defaults to stable text and supports structured JSON with --format json. Update the lifecycle reference from ADR-0002 to ADR-0005. In .codearbiter/.provenance/CONTEXT.json update only the sole source hash to 5b41fb168a8b258cfae7eebc46e8b9ea7696ba56. Do not edit docs/preserved-note.md, create the handoff, commit, or touch any other path. Stage exactly those two correction files and stop for my review.

Your agent · Pi harness · All operating systems

Apply only the P06 scoped re-scout correction. In .codearbiter/CONTEXT.md replace the stale report sentence with exactly: Workshop Queue report output defaults to stable text and supports structured JSON with --format json. Update the lifecycle reference from ADR-0002 to ADR-0005. In .codearbiter/.provenance/CONTEXT.json update only the sole source hash to 5b41fb168a8b258cfae7eebc46e8b9ea7696ba56. Do not edit docs/preserved-note.md, create the handoff, commit, or touch any other path. Stage exactly those two correction files and stop for my review.

Expected result

The staged path list contains exactly .codearbiter/CONTEXT.md and .codearbiter/.provenance/CONTEXT.json.

If that does not happen

If any other path is staged or the note changed, stop. Preserve the attempt and use Reset rather than unstaging around an unclear correction.

Evidence

The first learner commit is allowed to contain only the corrected context and provenance objects.

Review the first commit boundary yourself

Use the selected copyable request to inspect the staged correction before committing. Confirm that only the exact stale statement, lifecycle reference, and one provenance hash changed.

Why

A small staged review prevents a correct concept from becoming an oversized recovery commit.

You · Claude Code harness · All operating systems

Run git diff --cached --name-only and git diff --cached. Show both outputs and assess only whether the staged correction contains exactly .codearbiter/CONTEXT.md and .codearbiter/.provenance/CONTEXT.json, changes the stated stale context/provenance facts, and leaves docs/preserved-note.md untouched. 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 the staged correction contains exactly .codearbiter/CONTEXT.md and .codearbiter/.provenance/CONTEXT.json, changes the stated stale context/provenance facts, and leaves docs/preserved-note.md untouched. 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 the staged correction contains exactly .codearbiter/CONTEXT.md and .codearbiter/.provenance/CONTEXT.json, changes the stated stale context/provenance facts, and leaves docs/preserved-note.md untouched. Do not change files, stage, commit, or clear the boundary; stop for my decision.

Expected result

You can account for both staged paths and see no change to docs/preserved-note.md.

If that does not happen

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.

Evidence

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 !.

Why

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

Expected result

The first descendant of Prepare contains exactly the two correction paths and leaves the worktree clean.

If that does not happen

If the commit gate blocks, preserve its finding and resolve the named issue without expanding the two-file correction scope.

Evidence

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.

Why

The lesson teaches evidence-led recovery, not hand-authoring canonical JSON or blob hashes.

You · Native terminal · Windows

$academy = "$env:LOCALAPPDATA\ArbiterAcademy\preview-0.30\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.30/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.30/bin/arbiter-academy"
"$academy" --repository "$PWD" write-handoff P06-context-drift-recovery

Expected result

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 that does not happen

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.

Evidence

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.

Why

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

Expected result

The staged path list contains only .codearbiter/reports/academy/P06-recovery.json, ready for the second-commit review.

If that does not happen

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.

Evidence

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.

Why

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.

Expected result

The staged boundary contains one canonical report and no recreated or edited preserved note.

If that does not happen

If the handoff mixes another path or claims a different route, stop and use Reset. Do not amend the first correction commit.

Evidence

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.

Why

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

Expected result

There are exactly two ordered single-parent commits after Prepare, and git status --short prints nothing.

If that does not happen

If the commit gate blocks, preserve its finding and correct only the named report condition in a new numbered attempt; do not amend history.

Evidence

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 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.

Why

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.30\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.30/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.30/bin/arbiter-academy"
"$academy" --repository "$PWD" check P06-context-drift-recovery

Expected result

Check prints checkpoint P06-context-drift-recovery: passed; progress: .academy/progress.json.

If that does not happen

If Check fails, preserve the committed attempt and read the failed predicate. Use Reset for a fresh numbered attempt instead of rewriting committed evidence.

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.

Why

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

Expected result

You are back on main and the completed academy/P06-context-drift-recovery/ATTEMPT_NUMBER branch still exists.

If that does not happen

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.

Evidence

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.

Why

A retained failed attempt is evidence you can inspect, not debris to erase.

You · Native terminal · Windows

$academy = "$env:LOCALAPPDATA\ArbiterAcademy\preview-0.30\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.30/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.30/bin/arbiter-academy"
"$academy" --repository "$PWD" reset P06-context-drift-recovery

Expected result

Academy archives the earlier attempt and prints the next academy/P06-context-drift-recovery/ATTEMPT_NUMBER branch.

If that does not happen

If Reset stops, preserve its message and current branch. Resolve only the named repository condition; never force-reset, rebase, or delete the prior attempt.

Evidence

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

Context becomes trustworthy when its claims can be traced to the source and decision that support them. A re-scout repairs a contradiction without pretending all repository context was freshly reviewed. The two commits separate the source-backed correction from the record that describes it; the external verifier then reconstructs both against the prepared baseline. Keeping unrelated work byte-identical makes recovery auditable instead of destructive.

Next step

Continue with P07-threat-model.

Recovery guidance