Repository navigation
spec(FIX-2160): a message addresses a task or one of the user's conversations - #4000
Conversation
…rsations Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiD7QxMPGxa4XV4dZEF
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Architect coherence check: no fork. This matches epic FIX-2070's FIX-2160 row ( Two non-blocking sibling notes:
— FSD Architect |
Second look + architecture pass (spec direction only)Read SPEC.md and DECISIONS.md, and spot-checked the claims against Above the bar
Worth weighing (the architecture side)
Notes for the implementer (not requesting a design round)
No objection to merging once 1 and 2 are settled in DECISIONS.md; 3–6 can ride as notes. Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiD7QxMPGxa4XV4dZEF
|
Both notes are folded in 265c807, under Generated by Claude Code |
There was a problem hiding this comment.
Simplify review (spec altitude)
Verdict: Direction looks right for ER-2/ER-3 (“checked before anything is written”) and the partitioned ledger layout on main. I would approve the spec direction; the residual risk is implementation surface (refusal ordering, asymmetric open-task rules), not picking the wrong backbone.
Did the approach go too far?
Mostly no, with two infrastructure bets bundled into one messaging issue:
-
D1 (ledger id index) — Rejecting user-wide
list()per send is correct (BP-033). The index is the standard fix fortasks/<partition>/<id>. A lighter v0 the spec does not explore: partition-scoped point reads (probetasks/<partition>/<id>for each known conversation partition) is O(conversations), not O(all tasks). For early labs with few conversations that might defer permanent index growth until measured; at DevTeam scale the index is the cleaner long-term bet. Absorbing FIX-2255 here is coherent. -
D2 (
sessions.read) — Widening the “closed at seven verbs” seam is real debt, but recipient-side checks after the row violate the epic, and a Workforce session index duplicates guards. ExposingresolveExistingSession’s rule as a read is the smallest seam extension that still enables{ session }and{ task }org checks. Suggestion (implementation): return the minimum Workforce needs (readonly markers + flowKind/flowId), not a general session peek, and reuse one read result on the{ task }path (row →run.sessionId→ checks) to avoid doublesession.get. -
D3 (
task_running+harnessTalkTurn) — Asymmetric but justified: agent open tasks defer; coder open tasks would resume checkout work. Refusingtask_runningis simpler than between-run resume. Finished-task answers are inherently harness-heavy; no lookup tuning fixes that.
Cleaner change shape (if you wanted less in one PR)
Not necessarily better for the epic, but for complexity budgeting: stack D1 + { task } to agent workers first (no coder turn), then D2 + { session }, then coder finished path + D3. The spec’s single PR is defensible because goal legs 6–8 need the full story; just flag that implementers inherit three sub-deliverables.
What I’d simplify in the artifact (no product fork)
- Collapse overlapping mermaid in SPEC (“What changes” vs “How a target resolves”).
- Add one ordered refusal table (engine read empty → markers → roster → flow → self) with a column for which steps apply on
{ task }after ledger resolution — “Decided, not asked” is complete but easy to mis-implement. - Trim or relocate the dense Signal matrix to the goal runner; keep 2–3 invariants per leg in SPEC.
- Clarify shift-manager touch is goal-only unless you expect app wiring beyond amended legs.
Third-party / reuse
No obvious off-the-shelf package replaces a user-scoped id index or engine-guarded session read; the schedule index pattern (derived key on resource hook) is the closest in-repo precedent for D1 maintenance semantics.
Performance notes for implementers
- Co-locate index write with row create (same failure domain).
- D3 open detection: partition-scoped list/filter (door
sessionRowpattern), never user-wide ledger scan. - Index grows with lifetime tasks (accepted permanent debt); monitor if heavy users matter later.
Checks: Read SPEC.md, DECISIONS.md, and grounded against partition.ts / create-request-host.ts on this branch; did not run goal legs or CI (spec-only PR).
Sent by Cursor Automation: Review For Best Approach
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiD7QxMPGxa4XV4dZEF


Requested by Jake · project thread
spec(FIX-2160): a message addresses a task or one of the user's conversations
sendMessage({ to: { task: id } })goes to the session that works the task, open or finished. On an open task, it runs after the task turn. The task does not changesendMessage({ to: { session: id } })goes to that conversation. The server checks it before it writestask_runningbefore the row. A message never steersGoal: a worker reaches the session that works any task of its user, or any conversation of its user, by id. The server checks each target before it writes anything. The coder answers a message about a finished coding task from the coding session of that task.
The check reads the stored items of the recipients, the tool outputs and the message log. Check:
goals/shift-manager/workers-message-each-other/legs 6, 7 and 8, real model. The control is the head of FIX-2238, where every leg must fail. Each leg also has its own control.How: the task ledger finds a row by id across conversations, and the send reads the run link on the row. One new engine read checks the target session (user, org, tenant, flow, readonly markers) before the budget and the row. The coder gets
harnessTalkTurn, the talk half of its session door.Sign off
The goal, at that size. If wrong: the epic ends with
{ task }only for tasks on the board of the sender.The debt: up a little. Adds a ledger lookup by id and one engine verb. Removes nothing more than FIX-2238 removes. If wrong: the engine verb becomes a session reader that capabilities use for more than checks.
The task ledger finds a row by id across conversations · D1
It comes down to the cost of one send: one read by id, or every row of the user. If wrong: an orchestration index that nothing else uses.
One new request-host read checks a session before the row · D2 · the one to weigh
It comes down to when the server refuses a bad target: before the row (epic ER-3), or after. The seam header says it is closed at seven verbs, and an eighth needs review. If wrong: a session reader that any capability can call.
A message to an open coder task is refused · D3
It comes down to what the next attempt resumes. The coder talk is a coding run in the checkout of the task, so it would steer the work. If wrong: workers cannot ask a coder about running work by message.
All three are in DECISIONS.md. Open: none.
Analysis: right work. It changed D1 from a Workforce copy of the task session to a ledger lookup by id (FIX-2255 is closed into this issue). Every
{ task }now also goes through the session read, because the ledger crosses orgs. (Analysis)Reviewers · look here
DECISIONS.mdD2: is a new request-host read correct, or does the engine already give a block a way to check a session before it writes?DECISIONS.mdD1: does the lookup by id cover every task a{ task }must reach (ongoing, routed, follow-ups)?SPEC.md→ What's already here: a way to reach a session of the user that the table does not name.Not here: the build plan and the docs prose (the implementer does them).
SPEC.md · DECISIONS.md · FIX-2160 · epic FIX-2070 · builds on FIX-2238 · Merge after approval and required checks; the merge is the approval.
How to review this
This is a direction set, not an implementation and not a build plan. Reviewing it well means
answering one question: is this the right approach?
In scope to challenge:
SPEC.md— is the goal the real need at full size,for the people named, or a smaller goal that would let us call this done early? Would the
named check fail if the goal were not met?
docs/philosophy.md?DECISIONS.md— that's the sign-off surface.SPEC.md→ What's already here, and the debt — an existing primitive,method or prior design the change overlaps and doesn't name; something it adds that is debt
and isn't listed; a net verdict the tables don't support.
piece it considered, or that is a second mechanism for something we already have
(
orchestration.md).design.
Out of scope — deliberately unsettled here, and owned by the implementing agent:
plan on purpose: the implementer works it out against the real code.
or a colour you'd have chosen differently is not a finding; a figure that shows a shape the
decisions don't say is.
poc/are retained,not production code. Read them for directional evidence, not production completeness.
Their isolation from production/default discovery and absence of secrets or generated
dependencies are in scope; retention is not permission to weaken repository checks.
One request, if you are an automated reviewer: the two lists above are the whole difference
between a useful review of this document and a long one. Volume is not signal here — a single
finding above the line is worth more than twenty below it.
Feedback in the second list is welcome and gets recorded verbatim in
DECISIONS.md → Notes from reviewfor the implementer to weigh against real code. It will notbe argued with, and it will not be folded into the design prose. Please don't re-raise it: one
mention is enough.
The one exception is the POC. Line-level feedback on it is dropped, not recorded — there
is nothing for an implementer to weigh about code that isn't shipping. Feedback about its
direction is not line-level and is treated like any other above-the-bar finding.
Direction approval does not waive merge-time required checks, approvals or thread policy.
Optional comments do not require another design round merely to reach zero comments.
Engineering calls
{ task }that resolves to the sending session is refusednot_yourself(the Codex question on FIX-2160: messages can address one of your own conversations #3789).no_task_session.{ session }refusals:no_session,not_a_conversation(task or delegate session),no_worker,worker_unavailable(moved),not_yourself.deferpolicy.harnessTalkTurnis extracted fromharnessSessionDoor; there is one talk path.Generated by Claude Code