Skip to content

feat(repo): agent sessions on a partial clone (P37d, ADR-0050) - #194

Merged
tonibergholm-codento merged 2 commits into
mainfrom
adr-0050-sessions
Oct 19, 2026
Merged

tonibergholm-codento merged 2 commits into
mainfrom
adr-0050-sessions

Conversation

@tonibergholm

Copy link
Copy Markdown
Member

What

sc ws fork/run/harvest/abandon and sc work were refused on a partial clone. ADR-0049 removed the blocking reason (merge), and this closes the last open piece of the partial-clone arc by deciding the product question: yes, with the host's view as the agent's world.

  • View, not complete tree. A workspace sees the host's sparse view (sc ws already did). sc work used to give each agent the complete tree; on a partial clone there is none, so agents get the view too. Widen it with sc sparse set or sc backfill --all.
  • Filled before any write. Fork and sc work call ensure_view on the base: a lazy, online clone fetches the view closure by id; any other clone fails with GapInView and the sc backfill hint before a checkout, manifest or branch exists.
  • Harvest. The workspace commit already grafts out-of-view subtrees from the base (snapshot_files); the tracked-path walk is now bounded by the view on a partial clone (full clones are unchanged). Landing uses merge_with_identity (the ADR-0049 engine), and the clean-or-fallback probe is answered by tree_merge_filled (would_merge_cleanly_partial): any conflict falls back to a work-<i> branch as on a full clone.
  • The two old tests that asserted the refusals are replaced by partial_sessions.rs.

ADR-0050 records the decision. ADR-0049, ROADMAP and CLAUDE.md are updated (the refusal list shrinks; capability row P37d).

Verification

  • New tests: fork lays out the view only; a clean harvest lands a two-parent merge and carries docs/ unread and unfetched; a same-line conflict falls back to work-1 and leaves main alone; an untouched workspace is Unchanged; sc work agents cannot see docs/, commit to agent-1, leave docs/ carried, and leave no session residue.
  • cargo fmt, cargo clippy --workspace --all-targets -D warnings, cargo test --workspace, demo/run_ws_demo.sh and demo/run_lazy_fetch_demo.sh pass.

🤖 Generated with Claude Code

sc ws fork/run/harvest/abandon and sc work work on a partial clone. A
workspace or agent sees the host's sparse view only (sc work no longer gets a
complete tree there); the view closure is filled (lazy, online) or refused
with the gap error before anything is written; a workspace commit grafts the
out-of-view subtrees from the base without reading them; and harvest lands
through the ADR-0049 merge, with any conflict falling back to a work-<i>
branch as on a full clone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T09:14:25.463177Z daf143a New commits
🔒 Security Review ✅ Completed 2026-10-19T09:16:34.387440Z daf143a New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b262184406

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/repo/src/ws.rs Resolved
…nd drop a failed harvest's candidate

Sol review: fork and sc work relied on materialize's preflight, which a
workspace layout (not a partial clone) skips, so a view gap surfaced mid-write
as a raw NotFound; they now run preflight_view against the host layout first.
A harvest whose probe or landing fails before any write left its candidate
work-<i> branch behind, and a retry minted another; it is deleted on that path
(a real conflict keeps it).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tonibergholm-codento
tonibergholm-codento merged commit a6fbcd4 into main Oct 19, 2026
7 checks passed
@tonibergholm
tonibergholm deleted the adr-0050-sessions branch October 19, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants