Created
Jul 03, 12:27
Started
Jul 03, 12:27
Completed
Jul 03, 21:53
DevOps handoff
Type
Bug
Shape
backend
Worktree Slug
scope-span-invariant-per-agent
Repositories
mcritchie-studio
Release Slug
—
Branch
feat/scope-span-invariant-per-agent
Local URL
—
QA URL
—
Production URL
—
Acceptance Criteria
Expected Test Plan
Checks Run
Agent Context
Audit 2026-07-02 high finding #4. AtomicEvent enforces ONE open span per session_id: open_event! runs for_session(sid).open.update_all(close) closing ANY open span; close_event! closes for_session(sid).open.order(:seq).last. But pr-review-sop + qa-release spawn parallel soul reviewers that each narrate bin/atomic-event start --agent <soul> in the SHARED parent session (subagents inherit CLAUDE_CODE_SESSION_ID) — so LIGHT's start silently closes PRIMARY's in-flight span (NULL outcome), PRIMARY's end finds no open span (204, CLI prints success on a DROPPED verdict), corrupting the exact trajectories Alex grades. Fix = per-agent lanes: scope the single-open invariant per (session_id, agent). open_event!(agent: X) closes only X's open lane; close_event!(agent: X) closes X's lane; close_all_open! STILL closes every lane (session-end teardown). CLI: end/next resolve the effective agent (explicit --agent OR the #335 sticky heartbeat agent) and send it on close so it targets the right lane. Controller close action + close_params accept :agent. Normalize the agent the SAME way for the WHERE scope as the before_validation coercion (unknown->nil) so lane keys match. KNOWN LIMIT (document, do not claim fixed): raw AtomicAction attribution stays best-effort last-open-span — actions carry no agent and the subagent hook posts under the parent session id (harness-level). This fixes the SPAN/verdict collision (the graded signal), not per-agent action attribution. Regression-test-first: two agents' concurrent spans don't close each other; each end closes its own lane; nil (orchestrator) lane independent of soul lanes; close_all closes all.
Stage Timeline
Who handled each stage, the time it took (measured), and the model / tokens / cost reported (best-effort) — plus who's on it right now. — means the agent didn't report that metric.
Conversation
QA review feedback, agent handoffs, and follow-up notes for this task.
No task feedback has been recorded yet.
Sealed-bid sizing
Edit →Alex (PM)
—
Avi (PO)
SMALL
Dev
SMALL
Actual
XL
We emailed a one-tap sign-in link to . It expires shortly and can only be used once.
No email? Check spam, or close this and try again.