Repository navigation
fix(asks): an ask to a role several people fill reaches every one of them (abilityai/trinity-enterprise#816) - #3513
Conversation
…them (Abilityai/trinity-enterprise#816) role_addressing.resolve names a single Workspace addressee only when exactly one person resolved, so an ask to a role two people fill was stored with addressed_to_email NULL. The Workspace list filtered on addressed_to_email = viewer, so the ask rendered in nobody's Inbox while the receipt said resolved: true. Per the operator ruling of 2026-10-07 in the issue thread: the ONE ask is delivered to every person the role resolves to (fan-out on read, no duplicate rows), the first answer wins, and Dismiss/Discuss are refused on a shared ask for now. - db/operator_queue: "addressed to this person" is addressed_to_email = viewer OR viewer in resolved_to, as a SQL condition (JSON-quoted, LIKE-escaped, case-insensitive; same on SQLite and PostgreSQL), so the list and its count page over exactly what is shown (#3059). - client_portal/asks/service: _is_addressed_to is the Python twin used by every per-ask door (answer, dismiss, discuss, context), so a non-addressee still gets the uniform 404 (Invariant #8). The projection carries `shared`; a co-addressee's answer reads ended_by=someone_else with answered_by; Dismiss and Discuss on a shared ask are 422 `shared_ask`. - The receipt's `resolved` is now truthful for the multi-person case: a person's Workspace shows the ask. Tests: tests/unit/test_ent816_shared_asks.py (18). Mutation check: with the db/operator_queue.py change reverted, 13 of 18 go red, including test_an_ask_to_a_role_two_people_fill_lands_in_both_inboxes (assert [] == [<ask id>]). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…answered it (Abilityai/trinity-enterprise#816) PortalAsks hides Dismiss and Discuss on a shared ask (the server refuses both with `shared_ask`); queueEnding reads ended_by=someone_else as the projection's answered_by, and the Inbox list's badge says "Answered · <name>". Tests: tests/unit/portalSharedAsk.mount.spec.js (3, mounted). Mutation check: with PortalAsks.vue and utils/operatorQueue.js reverted, all 3 go red, including "offers neither Dismiss nor Discuss, but can still be answered". Co-Authored-By: Claude Opus 5.5 <[email protected]>
…em (Abilityai/trinity-enterprise#816) ask_operator's description now says what `resolved` means and that a multi-person role reaches every person; operating-room flow, workspace and backend area files record the fan-out-on-read rule. Co-Authored-By: Claude Opus 5.5 <[email protected]>
d3dc52c to
1e9bab3
Compare
…he shared replace link (Abilityai/trinity-enterprise#816) Pre-landing review of #3513: - `_ending_of` mapped ANY ending by a person in `resolved_to` to `someone_else` and `_answered_by` then named them. A co-addressee who is also an operator and cancels the shared ask from the Operating Room is an operator's ending: it read "Cancelled by <name>" in the other person's Inbox and carried `answered_by` on a cancel, against the projection's own contract (operator endings stay coarse and unnamed). Now only an answer reads `someone_else`. - The `_linked_request_id` widening (replace links on a shared ask) had no test; a mutation reverting it stayed green. Two tests now pin it, including the withheld case (the replaced ask was never the viewer's). Co-Authored-By: Claude Opus 5.5 <[email protected]>
/review ReportBranch: feature/ent816-multi-person-ask → dev (diffed against the merge-base) Tests run after the fix: Execution coverage (Step 2.5)
Fix mutation: reverting Critical Findings (block merge)None. Findings fixed in this review: commit f7c766c[F1] Data disclosure / contract: a co-addressee's CANCEL was named as [F2] Test gap: the Informational Findings (review required)[I1] Performance: [I2] Product: a co-addressee's email crosses to the other co-addressees when they have no account name (Confidence: 6/10) [I3] Casing rule drift: [I4] Requirements doc not updated (Confidence: 6/10). The ruling changes ask-addressing behaviour, but there is no Clean Categories
Summary
Deferred debt (not pushed to trinity-dev in this run): I1 (memoise 🤖 Generated with Claude Code |
Summary
An ask addressed to a role that two or more people fill was stored with no Workspace addressee, so it showed up in nobody's Inbox. Its receipt still said
resolved: true. After this change the one ask reaches every person the role resolves to. The first answer wins, and the others see who answered.Root cause
role_addressing.resolvesets a single addressee (Resolution.single) only when exactly one person resolved. For 2+ people,ask_service._addressstoredaddressed_to_email = NULL, with every person kept inresolved_to. The Workspace asks list and every per-ask door (_owned_ask) matched onlyaddressed_to_email = viewer, so no viewer could ever match. The receipt computesresolvedasbool(resolved_to), so it reportedtruein exactly that case.The fix (operator ruling, 2026-10-07)
This builds what the operator ruled in the issue thread: deliver the one ask to everyone the role resolves to. The first answer wins and the others see that someone else answered. Dismiss and Discuss are refused on a shared ask for now. Refusing the raise with
role_resolves_to_severalwas rejected, because it would block two-approver gated skills.db/operator_queue._list_conditions, "addressed to this person" now meansaddressed_to_email = viewerORviewer ∈ resolved_to. The membership check (_resolved_to_contains) runs in SQL: it matches the JSON-quoted email with LIKE escaping, ignores case, and works the same on SQLite and PostgreSQL. The list, its count and the agent prefilter therefore cover exactly what is shown (bug: Workspace asks read silently stops at 200 rows with no total #3059). No schema change.client_portal/asks/service._is_addressed_tois the Python twin of that check. It is used by answer, dismiss, discuss, the context read and the replace-link projection. Someone the role does not resolve to still gets the uniform 404 (Invariant security: implement safe tar extraction with symlink/hardlink validation #8).already_resolved. The projection now carriesshared, and when a co-addressee answered first it carriesended_by = someone_elseplusanswered_by, which is that person's account name, or their address if they have no name. An operator's ending is unchanged: stilloperator, still unnamed.shared_ask, andPortalAskshides both buttons. Answering is unaffected.resolved: truefor a multi-person role is now accurate, because each person's Workspace Inbox shows the ask. Theoperatorrole still goes to the Operating Room only (unchanged).ask_operatordescription now explainsresolvedand the multi-person delivery. Docs updated:architecture/workspace.md,architecture/backend.md,feature-flows/operating-room.md.Tests
tests/unit/test_ent816_shared_asks.py: 18 new tests, run through the realraise_askwith a two-person assignment provider. They check that the ask is in both Inboxes, each person's count, that there is one row, the uniform 404 for a non-addressee at every door,shared, the receipt, expiry in each Inbox, that the second answer is refused, the someone-else ending plusanswered_by, that an operator stays unnamed, the Dismiss/Discussshared_askrefusals, and exact membership (lookalike addresses,_/%wildcards, case).db/operator_queue.pychange reverted, 13 of 18 fail, includingtest_an_ask_to_a_role_two_people_fill_lands_in_both_inboxes(assert [] == [<ask id>]).src/frontend/tests/unit/portalSharedAsk.mount.spec.js: 3 mounted tests. WithPortalAsks.vueandutils/operatorQueue.jsreverted, all 3 fail.operator_queue|ent751|3246|ask|ent815|workspaceunit file passed (2031 passed, 7 xfailed).npm run test:unitpassed 333 files and 5453 tests. MCPsrc/operator_queue.test.tspassed 46 of 46.Deferred (not in this PR)
primary, re-recordingto_roleasoperator; a separate receipt andget_my_askfield for "a Workspace will show this"; reporting unaddressed non-operator rows to the operator. With fan-out,resolvedis already accurate for the multi-person case. Theprimary→[]case already reportsresolved: false.Implements abilityai/trinity-enterprise#816
🤖 Generated with Claude Code