10 KiB
Created
Created by LocalTicketBackend create.
Plan
Preflight / implementation intent
Classification: implementation-ready with coordination risk.
Intent:
- Add a local, workspace-scoped role session registry and Ticket claim index for
yoi panelorchestration state. - Store registry data under the configured user data directory, not under git-tracked
.yoi/ticketsfiles and not under the runtime directory. - Model
Ticket -> at most one active local Pod claimwhile allowingPod/session -> 0..N related Tickets. - Represent pre-Ticket Intake sessions even before a Ticket exists.
- Join Ticket state, local registry data, and Pod metadata in panel state/actions where practical, without introducing automatic polling/spawn.
Requirements:
- Define a stable workspace key/path for registry storage under
manifest::paths::data_dir()or an equivalent existing user-data boundary. - Keep local Pod names, socket paths, runtime status, and local claim state out of git-tracked Ticket frontmatter/thread files.
- Make claim creation race-aware: when starting Intake for an existing Ticket, claim before spawn/restore; if a claim exists, do not start a second Pod silently.
- Treat stale claims explicitly with diagnostics/reclaim affordance rather than auto-replacing them.
- Intake is not 1:1 with Ticket: support no related Ticket and multiple related Tickets in the local model.
- Preserve the current interim access path where
ticket-*Pods are visible in the panel.
Code map:
crates/manifest/src/paths.rs: existing data/config/runtime directory boundary; registry should use durable user data, not runtime.crates/tui/src/multi_pod.rs: Intake launch path (prepare_intake_launch/finish_intake_launch), panel snapshot construction, selected actions.crates/tui/src/workspace_panel.rs: Ticket rows, related Pod display,workflow_state = intakerow behavior, Panel view model.crates/client/src/ticket_role.rs: Ticket role launch context and Pod naming; useful integration point but should not write git-tracked Ticket assignment.- Existing Pod list/status model is in
crates/tui/src/multi_pod.rs/workspace_panel.rs; use it for liveness/restorability rather than persisting live status as authority.
Boundaries / non-goals:
- Do not store local Pod assignment in Ticket metadata/thread.
- Do not assume Intake Pod and Ticket are 1:1.
- Do not add polling that auto-starts Intake for
workflow_state = intakeTickets. - Do not replace Orchestrator scheduling.
- Do not implement the real Companion Pod lifecycle here.
- Do not remove selected-Pod direct-send here;
workspace-panel-remove-direct-pod-sendowns that and is being implemented in parallel.
Coordination note:
workspace-panel-remove-direct-pod-sendis active in branchwork/workspace-panel-remove-direct-pod-sendand may touchmulti_pod.rs/workspace_panel.rs. Keep this registry implementation as additive/localized as possible and report any likely merge conflicts.
Validation:
- Add focused unit tests for registry serialization/path behavior, one-active-claim-per-Ticket invariant, and non-1:1 Intake/Ticket relation.
- Run focused
cargo test -p tui workspace_panel --liband relevant new registry tests; runcargo test -p tui multi_pod --libif integration touches panel runtime paths; run formatting/checks appropriate for the diff.
Intake summary
Implementation intent is clear: add a user-data workspace-scoped local role/session registry and Ticket claim index, enforce one active local Pod claim per Ticket, allow one Intake session to relate to multiple Tickets or none, and keep local Pod assignment out of git-tracked Ticket records.
State changed
Ticket intake complete; workflow_state intake -> ready.
Implementation report
Delegation
Implementation delegated to child Pod panel-role-session-registry-coder-20260607 in worktree .worktree/workspace-panel-local-role-session-registry on branch work/workspace-panel-local-role-session-registry.
Scope:
- Add a durable user-data workspace-scoped local role session registry and Ticket claim index.
- Enforce one active local Pod claim per Ticket while allowing a role session/Intake Pod to relate to zero or more Tickets.
- Keep local Pod assignment out of git-tracked Ticket metadata/thread.
- Preserve no-polling semantics and the interim
ticket-*Pod visibility path.
Coordination note: workspace-panel-remove-direct-pod-send is active in parallel and may touch multi_pod.rs / workspace_panel.rs; the child was instructed to keep the registry implementation additive/localized and report likely conflicts.
The child should commit implementation work in the child worktree and report diff/tests. Merge, review, Ticket closure, and cleanup remain with the parent/human workflow.
Implementation report
Review delegation
External review delegated to panel-role-session-registry-reviewer-20260607 with read-only scope over the repository.
Review focus:
- Validate the local user-data registry and Ticket claim model against the ticket intent.
- Check one-active-claim-per-Ticket behavior, non-1:1 Intake/Ticket support, claim-before-spawn behavior, stale claim handling, and workspace-key/path choices.
- Confirm local Pod assignment is not written to git-tracked Ticket metadata/thread.
- Explicitly review semantic/merge conflicts with current
develop, becauseworkspace-panel-remove-direct-pod-sendhas already landed and touchedmulti_pod.rs/workspace_panel.rsafter this implementation branch was created.
The reviewer is instructed not to modify files and to return approve/request-changes guidance with evidence and merge-readiness notes.
Review: request changes
Request changes.
Blockers:
-
Semantic conflict with current
develop: direct Pod send is reintroduced.workspace-panel-remove-direct-pod-sendhas landed, but this branch still carries the old direct-send path and adds backDirectSendRequest,prepare_send,finish_send,DirectSendError,NextUserAction::SendToPod, and Pod-row direct-send behavior. The registry branch must be rebased/resolved so it preserves current panel behavior: no selected-Pod direct send, Pod rows open/attach only. -
The role session record is missing required fields. The Ticket requires local role sessions to include at least role, pod name, origin, created/updated timestamps, and related Ticket refs. Implemented
RoleSessionRecordonly has pod_name, role, optional session_id, and ticket_ids. Add origin, created_at, updated_at, and keep related Ticket refs compatible with the non-1:1 Intake/Ticket model. -
Launch failure / registry recording can lose local coordination state. Existing-Ticket path claims before launch, but
launch_intake_with_handoffreleases the claim on any launch error.launch_ticket_role_pod_with_optionscan fail afterspawn_podsucceeds during connect, pre-run/send, or run-acceptance, leaving a live/restorable/stale Pod with no claim and allowing a later second launch. Successful pre-Ticket Intake registry recording is also best-effort only, so a successful launch can silently fail to be represented.
Non-blocking concerns:
- Claim creation uses
create_new, which is good for one-claim invariant, but the file is visible before JSON content is fully written; transient partial reads can produce poor diagnostics. role-sessions.jsonupdates are read-modify-write without locking, so concurrentrecord_sessioncalls can lose refs.- Workspace key/path behavior is likely acceptable for local user-data but should be a conscious decision; symlinked/moved workspaces create distinct registries, and full workspace_root is stored in JSON.
Positive evidence:
- Registry files are under user data dir, not
.yoi/tickets. - The implementation does not modify git-tracked Ticket files for local Pod assignment.
- Normal existing-Ticket Intake checks existing claim and refuses a second Pod, with status derived from current Pod list.
- Panel display preserves interim
ticket-*heuristic while adding claim Pod names. - Pre-Ticket Intake names are unique and do not require Ticket id.
Merge readiness: not merge-ready. Needs rebase/semantic conflict fix against current develop, schema additions, and failure-behavior hardening, followed by focused tests and build validation.
Review: approve
Approved after fixup commit 2f3f54b.
Reviewer verified:
- The selected-Pod direct-send path is not reintroduced; no
DirectSendRequest,prepare_send,finish_send,DirectSendError, orNextUserAction::SendToPodpanel path remains. - Pod rows use open/attach-style behavior and Companion non-empty submit remains rejected with the Companion lifecycle diagnostic.
RoleSessionRecordincludesrole,pod_name,origin,created_at,updated_at,related_tickets, and optionalsession_id.RoleSessionOrigindistinguishes pre-Ticket Intake from existing-Ticket claims.- Related Tickets are represented as a vector, preserving 0..N Ticket relationships.
- Existing-Ticket claim is created before launch and is not broadly released after launch failures that may have spawned a Pod.
- Pre-Ticket successful launch surfaces registry recording failure as a warning/diagnostic.
- Claim files avoid visible partial JSON by writing a temp file then linking into place.
role-sessions.jsonupdates use a local lock guard.- Live/restorable/stale status is derived from current Pod list/metadata at panel render time.
- Local Pod assignment is stored under user data panel workspace storage, not
.yoi/tickets. git merge-tree --write-tree develop work/workspace-panel-local-role-session-registryexits 0, and no semantic conflict with current direct-send removal was found.
Non-blocking follow-ups:
- Registry lock has no stale-lock recovery.
- Temp claim files may remain after a crash before link/cleanup, though they are not read as claim JSON.