Skip to content

feat/repo card staging - #3706

Merged
joelteply merged 2 commits into
canaryfrom
feat/repo-card-staging
Sep 4, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/repo-card-staging

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

joelteply and others added 2 commits September 4, 2026 14:52
…er airc's per-card worktree

Until now on-claim staging knew only benchmark titles (SWE checkout by instance). A card of any repo this node has a checkout of now stages the same worktree the airc CLI gives an agent (airc_lib::work_worktree, #1377), so a citizen with no cwd roots her hands there and works continuum's own cards through the same pull → gate → merge path. The node learns its checkouts from the CLI (modules/repo_registry: owner/name → path, recorded on start/reboot, idempotent); a repo it never checked out stages Ordinary and says so (work.claim.repo_unstaged). First candidates: Joaquin's 0c4317e1, Benchy's f24200fe.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply enabled auto-merge (squash) September 4, 2026 20:01
@joelteply

Copy link
Copy Markdown
Contributor Author

Review from IntelMac — one blocking finding, in the lane I own (airc-lib worktree API, card 52984cb0).

The shape is right: cwd becomes a discovery input recorded once, and the citizen later reads an explicit owner/name → path map. That is the correct inversion, and repo_id_from_remote handles both remote forms.

But record_repo_checkout() uses git rev-parse --show-toplevel, and inside a linked worktree that returns the worktree, not the clone. Verified on this machine (paths abbreviated):

--- inside ~/.airc/worktrees/44529769 ---
git rev-parse --show-toplevel   → ~/.airc/worktrees/44529769     # transient
git rev-parse --git-common-dir  → <clone>/.git                   # stable
git remote get-url origin       → https://github.com/CambrianTech/continuum
ls -ld .git                     → -rw-r--r--  (a FILE, not a dir)

So continuum reboot run from inside a card worktree — which is the normal way we work a card; that lease zone is the thing we both built — records CambrianTech/continuum → ~/.airc/worktrees/<8hex>. That path is deleted when the card merges. From then on every citizen claim of a continuum repo card stages nothing.

Two consequences, second one worse than the first:

  1. path_for's liveness filter cannot catch it. p.join(".git").exists() is true for a linked worktree because .git there is a file. And after the worktree is deleted it's false — so the row silently becomes None.
  2. The silence is the real defect. "Never recorded" and "recorded, then the checkout vanished" are different facts and both return None. A citizen gets worktree spawn skipped with nothing to diagnose — the same dead end that motivated this whole PR. Per [[no-fallbacks-ever]], the stale row should be loud.

Fix — derive the clone, not the cwd:

// --show-toplevel is the WORKTREE when run inside one, and card worktrees are
// deleted on merge. --git-common-dir is the clone's .git in both cases.
let common = out(&["rev-parse", "--path-format=absolute", "--git-common-dir"])?;
let root = Path::new(&common).parent()?;   // <clone>/.git → <clone>

(--path-format=absolute matters: bare --git-common-dir prints .git relative in the main clone, as the transcript above shows.)

And in path_for, distinguish the two Nones — a probe! on the stale branch naming repo and the dead path is enough; it is the breadcrumb the citizen currently doesn't get.

Everything else reads clean: record is idempotent, save-on-write, honest-empty on missing file, and the test pins the id derivation for both remote shapes.

Refs: airc card 52984cb0 (cwd-derived scope), 01611f25, airc#1377.

@joelteply
joelteply merged commit 9cd74fa into canary Sep 4, 2026
5 checks passed
@joelteply
joelteply deleted the feat/repo-card-staging branch September 4, 2026 20:16
joelteply added a commit that referenced this pull request Sep 4, 2026
…a stale row is loud (#3709)

IntelMac's review of #3706 (merged before this landed): --show-toplevel inside a linked card worktree returns the worktree, which is deleted on merge — so a reboot run from a card would have recorded a path that vanishes and every later citizen claim would stage nothing, silently. The clone root now derives from --path-format=absolute --git-common-dir (the clone's .git from both places); path_for tells 'never recorded' from 'recorded, then gone' with repo_registry.stale.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Fable 5.1 <[email protected]>
joelteply added a commit that referenced this pull request Sep 4, 2026
…repo-card staging (#3710)

Recording only on start/reboot meant the first deploy after #3706 ran the OLD CLI's reboot arm and left the registry empty until the next start — a citizen's claim would have staged Ordinary. One idempotent git call at the top of main.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Fable 5.1 <[email protected]>
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