Skip to content

fix: share named session worktrees - #150479

Open
RomneyDa wants to merge 1 commit into
mainfrom
fix/shared-session-worktrees
Open

RomneyDa wants to merge 1 commit into
mainfrom
fix/shared-session-worktrees

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

What this fixes

Creating another session with an existing named session worktree previously failed because the checkout was treated as belonging to one session.

Model

A named session worktree is a shared resource:

  • session rows reference the worktree's stable ID;
  • the worktree does not maintain a session-membership graph;
  • when another session reuses the name, legacy creator metadata is cleared;
  • archive, delete, and reset detach the session without removing a shared checkout;
  • ordinary idle GC remains responsible for eventual cleanup, while count/size pressure does not evict shared checkouts;
  • publication, worker placement, dispatch, project visibility, and parent-worktree inheritance resolve the session row's worktree ID rather than ownerId;
  • sandbox-required sessions use the same worktree projection;
  • manual and Workboard worktrees remain exclusive;
  • reuse with a different explicit base ref is rejected instead of silently changing the checkout.

There is no new schema version, migration, peer-authorization closure, or durable binding table.

User-facing behavior

Two sessions that explicitly request the same worktree name in the same repository receive the same checkout. Deleting one session leaves the checkout available to the other. Concurrent sessions are intentionally operating on the same files and can therefore observe or conflict with each other's edits.

Validation

Exact head: 64fb787aa001937021c728d4fac6a538536835b6

  • pnpm check
  • pnpm tsgo:core
  • exact-head regressions for named reuse, independent session deletion, idle-vs-pressure GC, shared sandbox projection, and publication recovery
  • full worker-placement consumer suite
  • full GitHub publication boundary/shared-read suites, with the final changed recovery case rerun after fixture correction
  • git diff --check

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 25, 2026, 6:02 PM ET / 22:02 UTC (Revision 15).

ClawSweeper review

What this changes

The branch lets sessions that request the same named Git worktree use one checkout and changes session lookup, sandbox projection, publication, and cleanup to follow the stored worktree ID.

Merge readiness

⛔ Blocked before merge - 16 items remain

Current main and the latest release still reject cross-session reuse of a named worktree, so this PR remains useful. Its unchanged head retains five previously reported lifecycle defects; review also found a cross-guest workspace isolation breach and a stable-release rollback incompatibility.

Priority: P2
Reviewed head: 64fb787aa001937021c728d4fac6a538536835b6
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The branch has focused tests, but unresolved lifecycle defects, guest isolation, and rollback compatibility leave it unready.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Authority-chain proof required: the current-head Gateway fixture shows two administrator-created sessions sharing a checkout, but no distinct-guest allowed/forbidden final filesystem result or stale-authority recovery trace is provided. The persisted owner_id change also lacks a v2026.9.6 update and rollback case; the earlier version-18 migration claims concerned a force-pushed design. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🧂 unranked krab (1/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Authority-chain proof required: the current-head Gateway fixture shows two administrator-created sessions sharing a checkout, but no distinct-guest allowed/forbidden final filesystem result or stale-authority recovery trace is provided. The persisted owner_id change also lacks a v2026.9.6 update and rollback case; the earlier version-18 migration claims concerned a force-pushed design. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 12 items Pinned introduced change: The pinned parent-to-head diff permits session-to-session name reuse and clears the persisted owner ID after another session joins.
Current main still lacks reuse: Current main rejects a named live checkout whose owner differs from the requesting session and rejects a stored binding with a different owner ID.
Keyed creation loses the validated binding: Preparation accepts an existing ownerless bound worktree, but allocation receives only the optional request name; an omitted name makes the service's owner and name lookups miss that shared record.
Findings 7 actionable findings [P1] [P1] Carry the stored worktree ID through keyed creation
[P1] [P1] Retire only the resetting session's sandbox runtimes
[P2] [P2] Recheck sharing before exclusive cleanup removes a checkout
Security Needs attention Cross-guest access to a shared sandbox projection: A guest who can create a session on the same agent and select the known worktree name can receive another guest's checkout and projection path; the current proof exercises only one administrator identity.

How this fits together

Gateway session creation asks the managed-worktree service for a Git checkout and stores its ID in the session row. Dispatch, sandbox execution, publication, reset, and garbage collection then use that binding to find or retire the checkout.

flowchart LR
 A[Session creation request] --> B[Named worktree selection]
 B --> C[SQLite worktree registry]
 C --> D[Git checkout]
 D --> E[Sandbox and worker dispatch]
 C --> F[Reset and cleanup]
Loading

Decision needed

Question Recommendation
May sessions created by different authenticated guests intentionally share one named worktree and sandbox workspace despite the documented per-guest isolation contract? Keep guest isolation: Permit named reuse only among sessions of the same authenticated creator and keep other guests' workspaces separate.

Why: The current contract promises distinct guest workspaces, while this PR makes a matching name sufficient to join one; choosing a different trust boundary requires maintainer intent.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Authority-chain proof required: the current-head Gateway fixture shows two administrator-created sessions sharing a checkout, but no distinct-guest allowed/forbidden final filesystem result or stale-authority recovery trace is provided. The persisted owner_id change also lacks a v2026.9.6 update and rollback case; the earlier version-18 migration claims concerned a force-pushed design. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • [P1] Carry the stored worktree ID through keyed creation (P1) - After two sessions share a checkout, a later keyed sessions.create without worktreeName accepts the stored ownerless binding here but passes no name or bound ID to allocation. Owner and name lookup then miss the checkout and a new one can replace the session's binding, moving it away from its files.
  • [P1] Retire only the resetting session's sandbox runtimes (P1) - The new exclusive-owner check runs after reset has already called shared local-workspace settlement with retireRuntime: true. That settlement selects by worktree ID, so resetting one session retires the peer's sandbox runtime before this guard can skip checkout removal.
  • [P2] Recheck sharing before exclusive cleanup removes a checkout (P2) - Pressure cleanup can select a still ownerful record, then another session adopts it and this write clears owner ID without changing the activity stamp. The cleanup guard checks its captured owner and stamp, so it can proceed against the now-shared checkout.
  • [P2] Record shared adoption as worktree activity (P2) - This adoption leaves lastActiveAt unchanged. Once the old timestamp is seven days old, idle GC skips owner-based session protection for the ownerless record and can remove a checkout used by a recently joined session.
  • [P2] Invalidate rollback after another session adopts the checkout (P2) - When a restored shared checkout is published for preparation, another session can adopt its already ownerless record without changing any fields checked by rollbackPreparation. If the first preparation then fails, its rollback can delete the checkout now bound to the other session.
  • [P1] Preserve separation between sandbox-required guests (P1) - Late discovery on this unchanged head: clearing owner ID lets a second authenticated guest name the first guest's checkout, and this new condition then skips session identity checks for their shared projection. The added test confirms reuse across session IDs, while the documented role-required sandbox contract promises separate guest workspaces. Constrain adoption to an authorized creator boundary before exposing the workspace.
  • [P1] Keep persisted sharing state readable after rollback (P1) - Late discovery on this unchanged head: this write makes owner_id NULL in an existing SQLite row without a version fence or rollback transform. The tagged v2026.9.6 session preparer and dispatcher require the original session key as owner ID, so rolling back after sharing makes even the original session's checkout unusable.
  • Resolve security concern: Cross-guest access to a shared sandbox projection - A guest who can create a session on the same agent and select the known worktree name can receive another guest's checkout and projection path; the current proof exercises only one administrator identity.
  • Resolve merge risk (P1) - The new shared-resource policy conflicts with documented separation between authenticated guests; maintainers must decide whether sharing may cross that boundary.
  • Resolve merge risk (P1) - The persistent ownerless marker is unreadable by the latest stable worktree consumers after rollback, and the current design has no demonstrated published-driver upgrade and rollback path.
  • Complete next step (P2) - Resolve the seven findings, decide the authenticated-guest sharing boundary, and provide current-head final-effect authority and stable-release upgrade/rollback proof.
  • Improve patch quality - Prove allowed and nearest-forbidden guest access at the final workspace I/O boundary, including authority loss before I/O.
  • Improve patch quality - Repair keyed creation, reset, cleanup, idle activity, and preparation rollback against shared adoption.
  • Improve patch quality - Show an existing-state update and rollback using the published stable driver and this candidate.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] [P1] Carry the stored worktree ID through keyed creation — src/gateway/session-worktree-preparation.ts:344-347
  • [P1] [P1] Retire only the resetting session's sandbox runtimes — src/gateway/session-reset-service.ts:1563-1568
  • [P2] [P2] Recheck sharing before exclusive cleanup removes a checkout — src/agents/worktrees/service.ts:433-435
  • [high] Cross-guest access to a shared sandbox projection — src/gateway/worker-environments/local-workspace-projection.ts:143
Agent review details

Security

Needs attention: The diff adds no dependency or automation source, but named adoption can cross the documented guest sandbox workspace boundary.

PR surface

Source +75, Tests +198, Docs 0. Total +273 across 30 files.

View PR surface stats
Area Files Added Removed Net
Source 13 121 46 +75
Tests 16 240 42 +198
Docs 1 3 3 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 30 364 91 +273

Review metrics

Metric Value Why it matters
Production versus test lines production +121/-46; tests +240/-42 The PR body explains the shared-resource model behind production growth and adds substantial regression coverage.
Persisted ownership fields 1 existing SQLite field reinterpreted A NULL owner_id becomes durable sharing state that older readers interpret differently.

Merge-risk options

Maintainer options:

  1. Constrain and repair sharing (recommended)
    Keep per-guest isolation, repair the keyed-create and lifecycle races, and demonstrate stable-release upgrade and rollback on existing state.
  2. Approve a broader sharing contract
    A maintainer could explicitly accept cross-guest sharing after defining access controls, updating the guest contract, and seeing allowed and forbidden final-effect proof.
  3. Pause the shared-resource model
    Keep the PR open for a narrower design if isolation and rollback compatibility cannot both be preserved.

Technical review

Best possible solution:

Keep named sharing within an authorized creator boundary, carry the stored worktree ID through allocation, fence reset and cleanup against remaining users, and prove a rollback-compatible storage transition.

Do we have a high-confidence way to reproduce the issue?

Yes. Source gives specific keyed-creation, shared-reset, cleanup-race, and cross-guest scenarios; this read-only review did not execute the branch.

Is this the best way to solve the issue?

No. Stable-ID lookup is useful, but the ownerless marker does not preserve guest isolation, lifecycle custody, or stable rollback behavior.

Full review comments:

  • [P1] [P1] Carry the stored worktree ID through keyed creation — src/gateway/session-worktree-preparation.ts:344-347
    After two sessions share a checkout, a later keyed sessions.create without worktreeName accepts the stored ownerless binding here but passes no name or bound ID to allocation. Owner and name lookup then miss the checkout and a new one can replace the session's binding, moving it away from its files.
    Confidence: 0.96
  • [P1] [P1] Retire only the resetting session's sandbox runtimes — src/gateway/session-reset-service.ts:1563-1568
    The new exclusive-owner check runs after reset has already called shared local-workspace settlement with retireRuntime: true. That settlement selects by worktree ID, so resetting one session retires the peer's sandbox runtime before this guard can skip checkout removal.
    Confidence: 0.93
  • [P2] [P2] Recheck sharing before exclusive cleanup removes a checkout — src/agents/worktrees/service.ts:433-435
    Pressure cleanup can select a still ownerful record, then another session adopts it and this write clears owner ID without changing the activity stamp. The cleanup guard checks its captured owner and stamp, so it can proceed against the now-shared checkout.
    Confidence: 0.91
  • [P2] [P2] Record shared adoption as worktree activity — src/agents/worktrees/service.ts:433-435
    This adoption leaves lastActiveAt unchanged. Once the old timestamp is seven days old, idle GC skips owner-based session protection for the ownerless record and can remove a checkout used by a recently joined session.
    Confidence: 0.9
  • [P2] [P2] Invalidate rollback after another session adopts the checkout — src/agents/worktrees/service.ts:456-465
    When a restored shared checkout is published for preparation, another session can adopt its already ownerless record without changing any fields checked by rollbackPreparation. If the first preparation then fails, its rollback can delete the checkout now bound to the other session.
    Confidence: 0.87
  • [P1] [P1] Preserve separation between sandbox-required guests — src/gateway/worker-environments/local-workspace-projection.ts:143-147
    Late discovery on this unchanged head: clearing owner ID lets a second authenticated guest name the first guest's checkout, and this new condition then skips session identity checks for their shared projection. The added test confirms reuse across session IDs, while the documented role-required sandbox contract promises separate guest workspaces. Constrain adoption to an authorized creator boundary before exposing the workspace.
    Confidence: 0.91
    Late finding: first raised on code an earlier review cycle already covered.
  • [P1] [P1] Keep persisted sharing state readable after rollback — src/agents/worktrees/service.ts:433-435
    Late discovery on this unchanged head: this write makes owner_id NULL in an existing SQLite row without a version fence or rollback transform. The tagged v2026.9.6 session preparer and dispatcher require the original session key as owner ID, so rolling back after sharing makes even the original session's checkout unusable.
    Confidence: 0.95
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 800bf8e10e7c.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Named-worktree sharing is a bounded session improvement that still needs significant correctness and compatibility repair.
  • merge-risk: 🚨 security-boundary: Matching a worktree name can join sandbox-required sessions across the documented authenticated-guest workspace boundary.
  • merge-risk: 🚨 compatibility: The latest stable release rejects ownerless session-worktree rows persisted by this PR.
  • merge-risk: 🚨 session-state: Keyed recreation, reset, and cleanup can change or remove a checkout still bound to another session.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦪 silver shellfish and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: the current-head Gateway fixture shows two administrator-created sessions sharing a checkout, but no distinct-guest allowed/forbidden final filesystem result or stale-authority recovery trace is provided. The persisted owner_id change also lacks a v2026.9.6 update and rollback case; the earlier version-18 migration claims concerned a force-pushed design. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [high] Cross-guest access to a shared sandbox projection — src/gateway/worker-environments/local-workspace-projection.ts:143
    A guest who can create a session on the same agent and select the known worktree name can receive another guest's checkout and projection path; the current proof exercises only one administrator identity.
    Confidence: 0.9

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (14 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-17T11:13:37.679Z sha 3fc36112cf8e218bbd6916d165b2d101a5cc7e93 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-17T11:32:21.320Z sha da6c01242f64fa26f7e12be8fe08d494ada5a1bd :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-17T11:43:46.077Z sha da6c01242f64fa26f7e12be8fe08d494ada5a1bd :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-17T12:19:38.905Z sha 2f56c4ab4ac275c4bd54cd1b9dd23bb1e9656c4d :: blocked before merge. :: none
  • reviewed 2026-09-17T12:31:58.539Z sha 8258396 :: blocked before merge. :: none
  • reviewed 2026-09-17T12:55:43.428Z sha 1a0191f :: blocked before merge. :: none
  • reviewed 2026-09-21T08:47:38.748Z sha 2f9d74b3e48b724418225c96bfde3e8303f01622 :: blocked before merge. :: [P1] [P1] Preserve restored data when rollback snapshot capture fails | [P2] [P2] Acquire allocation custody before rollback checkout custody | [P2] [P2] Move new membership I/O off the Gateway main thread
  • reviewed 2026-09-21T10:00:38.155Z sha 64fb787 :: blocked before merge. :: [P1] [P1] Reuse the stored worktree ID during keyed session creation | [P1] [P1] Limit reset retirement to the resetting session's runtimes | [P2] [P2] Recheck exclusive ownership after acquiring cleanup custody | [P2] [P2] Preserve recent activity protection for shared worktrees | [P2] [P2] Invalidate preparation rollback after another shared adoption

@RomneyDa
RomneyDa force-pushed the fix/shared-session-worktrees branch from a1f54a5 to a134f70 Compare September 17, 2026 06:58
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

All five findings are addressed at a134f7073f94735ca3fa8074b33fc99566ceb534. The PR body now includes exact-head behavior evidence for concurrent allowed/forbidden allocation, final-effect revocation, lifecycle rollback/delete/reset, removal fencing, publication isolation, and legacy DB upgrade/reopen.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@RomneyDa
RomneyDa force-pushed the fix/shared-session-worktrees branch from a134f70 to 64feb18 Compare September 17, 2026 07:47
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review exact head 64feb189c9ce3ddf2ce5078057dd0140de2e90b8. This retains all prior finding repairs and also fixes the first hosted CI failure by keeping worktrees/errors.ts independent of the registry. Exact failing tooling file: 68/68 passed; related lifecycle/error-identity regressions: 26/26 passed; pnpm check:changed: passed.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 17, 2026
@RomneyDa
RomneyDa force-pushed the fix/shared-session-worktrees branch from 64feb18 to 072257a Compare September 17, 2026 08:37
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review\n\nExact head 072257aa04cdf8e52c0f8f836961a31961ab1bc8 addresses all three retained findings and adds the requested final-effect and published-release migration/rollback proof. The PR body has the exact commands and terminal counts.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper assist is taking a look at your question.

I queued a lightweight read-only assist pass. It will post a separate answer comment and will not edit the durable ClawSweeper review comment or trigger close, merge, repair, label, or branch changes.

Request: re-review\n\nExact head 072257aa04cdf8e52c0f8f836961a31961ab1bc8 addresses all three retained findings and adds the requested final-effect and published-release migration/rollback proof. The PR body has the exact commands and terminal counts.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper assist: This needs a full correctness re-review of 072257aa04cdf8e52c0f8f836961a31961ab1bc8. The supplied context documents claimed fixes and new proof, but does not establish that the three retained findings are resolved.

Evidence:

  • The latest completed review, at 07:54 UTC, covers the older head 64feb189.
  • The current PR body reports 175 focused tests passed and scenarios covering unauthorized restoration, file access after peer revocation, missing-checkout recovery, and v17→v18 migration/rollback fencing.
  • Several relevant patches are truncated; no current-head CI check results or completed review are supplied.

Suggested next action: Request @clawsweeper review on the PR to assess the current head and updated proof.


Source: #150479 (comment)
Assist reasoning: medium.

@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. label Sep 17, 2026
@RomneyDa
RomneyDa force-pushed the fix/shared-session-worktrees branch from 072257a to 7b66384 Compare September 17, 2026 10:06
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@RomneyDa
RomneyDa force-pushed the fix/shared-session-worktrees branch from 8258396 to 1a0191f Compare September 17, 2026 12:48
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Revision 4's two P1 authorization findings are addressed at exact head 1a0191f7c522c09e683d8adc692e7a4a439eef11 on current main 3c0fb2025a1d9e542ed4664103899d529a574a3c:

  • inactive archived memberships now resolve through their persisted worktree binding and remain in peer authorization;
  • sessions.files.get/list retain authorization through asynchronous reads and recheck it immediately before publishing results.

Regression coverage exercises both archived-membership isolation and revocation during an admitted read. The PR body has the refreshed exact-head proof.

Hosted CI also exposed a missing release-manifest bump: package.json now advertises state schema v18 alongside the TypeScript and native-reader ceilings. The exact failing native schema-fence suite passes 24/24 locally.

The compact Node shards also exposed stale full mocks and schema-v17 fixture manifests after current main added managed-worktree/config APIs and this PR published schema v18. Those fixtures are aligned now; their complete publication, Talk, and update-command suites pass 204/204 locally. Post-rebase typecheck and line-cap validation are green.

The retained-release corpus then exposed the missing versioned v18 data migration. Doctor/runtime upgrade now creates the canonical binding table and backfills active legacy session-owned worktrees before publishing the v18 fence. Both retained v15/v17 corpus cases pass through Doctor and Gateway startup; the focused state-schema suite passes 41/41 and worktree naming passes 15/15.

The pending-read revocation proof now uses the real authority chain: the production sessions.files.get handler is admitted, completes its filesystem read, then the peer's persisted sharing policy is changed before the handler's final publication guard. The real authorization snapshot rejects the response and no file content is returned. The complete sharing suite passes 7/7.

Hosted CI's exhaustive schema surfaces are aligned with v18, and the oversized sharing/event policy was split into a coherent sibling module. Focused migration tests pass 4/4; authorization/broadcast tests pass 106/106; typecheck and line-cap ratchet are green.

The extraction's final hosted fallout is repaired: suggestion payload inspection uses runtime record coercion instead of a new assertion, the assertion baseline shrinks with the moved code, and the update-campaign fixture supplies the runtime-config API reached through managed worktrees. On the rebased exact head, assertion/line-cap ratchets and typecheck pass; sharing/broadcast tests pass 79/79; migration/campaign tests pass 291/291 with one unrelated state test skipped.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Security-sensitive guard cleared

Current revision: 64fb787aa001937021c728d4fac6a538536835b6

This PR no longer changes files in the maintainer security-review tier.

Separate CODEOWNERS requirements still apply to security policy and enforcement files.

@RomneyDa
RomneyDa force-pushed the fix/shared-session-worktrees branch from 2f9d74b to 64fb787 Compare September 21, 2026 09:51
@RomneyDa RomneyDa changed the title fix: allow authorized sessions to share a worktree fix: share named session worktrees Sep 21, 2026
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Exact head 64fb787aa001937021c728d4fac6a538536835b6 replaces the prior membership/schema design with a single shared-resource commit on current main.

There is no binding table, schema migration, peer-authorization closure, or session-owned cleanup for shared checkouts. Session rows reference the stable worktree ID; consumers resolve that ID; ownerless shared checkouts survive individual session lifecycle changes and pressure GC, then remain eligible for ordinary idle cleanup.

pnpm check and the focused exact-head lifecycle, GC, sandbox-projection, publication, and gateway creation regressions are green. The PR body contains the reduced design and validation.

@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Sep 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: voice-call Channel integration: voice-call cli CLI command changes docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant