Skip to content

fix(app): keep distinct identities for cell-backed crew helpers - #1964

Merged
santoshkumarradha merged 8 commits into
app/v3from
lane/d6-team-accept
Nov 3, 2026
Merged

santoshkumarradha merged 8 commits into
app/v3from
lane/d6-team-accept

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Crew proposal helpers backed by cell transcripts now keep distinct conversation identities.

- <session>/.cell/transcript.jsonl -> .cell
+ <session>/.cell/transcript.jsonl -> <session>

The cause is appAgentID deriving identity from the immediate transcript parent. The fix reuses session.DirOf, which already understands cell and legacy layouts. The public proposal regression checks the original manager, six distinct helpers, their briefs and reporting relationships, and replay without duplicate membership.

Evidence

  • Before, TestAppCrewProposalSeatsCellHelpersBeforeReturning fails with repeated agent .cell.
  • After, six focused proposal acceptance tests pass with go test ./cmd/codeaf -run '^TestAppCrewProposal(SeatsCellHelpersBeforeReturning|SeatsSixHelpersBeforeReturning|ReservedManagerHandle|RejectsDuplicateHelpersBeforeCreating|ResumesFailedHelper|CanCorrectNameBeforeCrewExists)$' -count=1 -timeout=90s.

Merge Danger

Door: two-way.

Blast Radius: identity.

This changes cell-backed app agent IDs to their actual session IDs. Legacy transcript IDs retain their existing spelling. Existing broken .cell desktop state is not migrated.

Proposal Later

inbox.later previously searched live conversation asks, but crew proposals live in the crew layer. A focused regression first failed with not_found for agent/crewprop:prop1. The route now persists the proposal's Later mark and emits ask.opened with later: true. inbox.back uses the same route to restore it. Reopening proposals preserves the mark. The test verifies Later, reopen, Back and acceptance without answering or deleting the proposal.

Review correction

An independently reviewed interleaving could close a proposal after Later saved it but before Later published its open ask. The paused-publication regression reproduced the answered item returning to Later. A proposal-only lifecycle lock now orders durable Later/Back updates and ask events with proposal dismissal. Crew formation keeps its separate lock. Eight focused proposal tests pass. The persistence regression now creates a fresh backend and layer reader against the saved state rather than reopening with cached memory.

The concurrency regression bounds each channel wait at five seconds and releases paused publication on early test failure. It waits for the answer goroutine to start before giving it 100 ms to complete while publication is paused. That scheduling allowance remains a test limitation: an exceptionally descheduled answer goroutine could miss the pre-fix interleaving. The initial failing run did observe the resurrection directly. Eight targeted tests pass after the bounded-wait update.

While the app closes

The proposal lock lives on the crew run, and a closing app can have none. TestAppCrewProposalLaterWhileClosingRefuses crashed the engine with a nil dereference before this was handled, and TestAppCrewProposalAnsweredWhileClosingStaysForgotten left an answered proposal saved to reopen at the next launch. Later now refuses and the answer still forgets the proposal.

santoshkumarradha and others added 7 commits October 26, 2026 11:22
Cell transcripts live in .cell, so the immediate transcript parent collapsed every helper into the same app agent. Reuse session.DirOf instead. Laziness Protocol keeps layout knowledge in its existing authority; Test Behavior Not Implementation covers public proposal acceptance and replay.

Focused proposal acceptance tests: 6 passing. The new cell-layout regression first failed with repeated agent .cell.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
LaterInbox searched only live conversation asks even though crew proposals belong to the crew layer. Preserve the proposal with a durable Later mark, emit the updated ask, and restore it through Inbox Back. No proposal answer or deletion occurs.

Test Behavior Not Implementation covers public LaterInbox, ListInbox, reopen and acceptance. Red regression returned not_found. Seven focused proposal tests now pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Later could publish AskOpened after a concurrent keep answer deleted the proposal and emitted AskClosed. A public-seam paused-publication regression reproduced the answered item returning to Later.

Use one proposal lifecycle lock for durable Later/Back updates through event publication and for dropProposal. Keep the formation lock separate. Test Behavior Not Implementation checks final Inbox state; a fresh backend now verifies the saved Later mark. Eight focused proposal tests pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fail each channel wait after five seconds and release paused publication during early cleanup. Wait for the answer goroutine to start before its 100 ms interleaving allowance. Eight focused proposal tests pass. The scheduling allowance remains documented in the PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A proposal changed while the app closes, before its crew run started, has no
run to order it: Later refuses instead of crashing, and an answer still forgets
the saved proposal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@santoshkumarradha
santoshkumarradha marked this pull request as ready for review November 2, 2026 17:18
@santoshkumarradha
santoshkumarradha merged commit f23e01b into app/v3 Nov 3, 2026
@santoshkumarradha
santoshkumarradha deleted the lane/d6-team-accept branch November 3, 2026 09:28
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.

1 participant