Skip to content

fix(deploy): the tracked checkout is a durable fact resolved every tick — a core built in a lease worktree tracked the lease and read "git fetch absent" for 4.5 h after the merge pruned it (card 790c6bcb) - #4248

Merged
joelteply merged 1 commit into
canaryfrom
fix/the-tracked-checkout-is-a-durable-fact
Sep 20, 2026

Conversation

@joelteply

@joelteply joelteply commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

The defect (card 790c6bcb)

The checkout the deploy decision tracks had two resolvers (modules/deploy_tracker.rs::from_env, bin/continuum.rs::tracked_repo_dir), both CONTINUUM_TRACK_REPO_DIR else the repo root of CARGO_MANIFEST_DIR — wherever the binary was BUILT — and the tracker's copy resolved it once at construction.

IntelMac, 2026-09-19 21:38Z → 02:0xZ: the running core had been built in the #4228 lease worktree; airc work merge pruned it; for 55 ticks (4.5 h) the tracker read SourceUnavailable { "git fetch canary absent" } — a git failure, not the truth ("the checkout I track is gone") — while canary moved four tips past it. Every lease build on every node carries the same pointer.

The fix

  • One resolver: runtime::tracked_checkout, called by both owners. The candidate (the recorded fact, else the build-time root) resolves to the durable main working tree of its repo (git rev-parse --path-format=absolute --git-common-dir's parent): a worktree resolves to the clone it came from, a plain checkout to itself. Gone → CheckoutError::Gone(path); a directory that is no checkout → NotARepo; both name the fix.
  • Resolved every tick: the source holds no dir; a vanished checkout is named by path in the tick's SourceUnavailable on the first tick after. tree_dirty reads the same resolution.
  • Recorded by install: continuum install's core arm records the durable checkout it deployed from as CONTINUUM_TRACK_REPO_DIR (once; --check records nothing), so a core built by an install from a lease tracks the clone, not the lease.

Tests

a_worktree_resolves_to_the_durable_main_checkout_and_a_pruned_one_is_named_gone: temp repo + worktree — worktree → main, main → main, pruned worktree → Gone by path (message names the key), plain dir → NotARepo.

Receipt on IntelMac: 33 passed / 0 failed (tracked_checkout + deploy_tracker + source_hygiene, all ratchets green), REAL_EXIT 0; cargo check --lib --bin continuum REAL_EXIT 0. Live: with the key pinned by hand and the core rebooted onto fd1960e, the first tick read the tip (deploy.track.request_written tip 6d43075, running fd1960e) — the read this change makes automatic.

Faster or slower?

Neither for a citizen: two bounded git calls per 5-minute tick on the tracker's own task, off the cognition path.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

…ck — a core built in a lease worktree tracked the lease and read "git fetch absent" for 4.5 h after the merge pruned it (card 790c6bcb)

The checkout the deploy decision tracks had two resolvers (`modules/deploy_tracker.rs::
from_env`, `bin/continuum.rs::tracked_repo_dir`), both `CONTINUUM_TRACK_REPO_DIR` else the
repo root of `CARGO_MANIFEST_DIR` — wherever the binary was BUILT — and the tracker's copy
resolved it once at construction. IntelMac, 2026-09-19 21:38Z → 02:0xZ: the running core
had been built in the #4228 lease worktree; `airc work merge` pruned it; for 55 ticks the
tracker read `SourceUnavailable { "git fetch canary absent" }` — a git failure, not the
truth ("the checkout I track is gone") — while canary moved four tips past it. Every lease
build on every node carries the same pointer.

- `runtime::tracked_checkout` is THE resolver, both owners call it. The candidate (the
  recorded fact, else the build-time root) resolves to the DURABLE main working tree of
  its repo (`git rev-parse --path-format=absolute --git-common-dir`'s parent): a worktree
  resolves to the clone it came from, a plain checkout to itself. A candidate that is gone
  is `CheckoutError::Gone(path)`, a directory that is no checkout is `NotARepo`; both
  Display the fix (`set CONTINUUM_TRACK_REPO_DIR`).
- `DeployTrackerModule` resolves on EVERY tick (one `is_dir` + one bounded git call) —
  the source no longer holds a dir; a vanished checkout is named by path in the tick's
  `SourceUnavailable`, on the first tick after. `tree_dirty` reads the same resolution.
- `continuum install`'s core arm RECORDS the durable checkout it deployed from as
  `CONTINUUM_TRACK_REPO_DIR` (once; read mode records nothing), so the core built by an
  install from a lease tracks the clone, not the lease.
- Test: a temp repo + worktree — the worktree resolves to main, main to itself, the
  pruned worktree is `Gone` by path, a plain dir is `NotARepo`.

Receipt on IntelMac: with the key pinned by hand and the core rebooted onto fd1960e,
the first tick read the tip (`deploy.track.request_written` tip 6d43075, running
fd1960e) — the read this change makes automatic.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply

Copy link
Copy Markdown
Contributor Author

APPROVE at exact head dc01e71.

One resolver (runtime::tracked_checkout) for both owners, resolved on every tick with one is_dir and one bounded git call, a worktree resolving to the clone it came from via --git-common-dir, and Gone/NotARepo that name the fix in their Display — that is the shape. Two things I checked: the build-root fallback in candidate() now ALSO resolves through durable_checkout_of, so a lease-built core with nothing recorded lands on the main clone rather than the lease (the IntelMac's exact case fixed even before the install arm records anything); and deploy-consume shares the resolver, so the 5090's consumer, once its task runs at all, tracks the same clone. The real repo + worktree test is the right kind.

Nit, not a condition: tree_dirty maps a Gone/NotARepo to None via .ok() — the tip read names the failure the same tick, so nothing is lost, but if a later reader ever consults tree_dirty alone it would read a vanished checkout as "not dirty". Merge on green.

@joelteply
joelteply merged commit 1f3597a into canary Sep 20, 2026
6 checks passed
@joelteply
joelteply deleted the fix/the-tracked-checkout-is-a-durable-fact branch September 20, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant