Repository navigation
fix(asks): an answer to an approver ask needs the approver seat - #4181
Merged
Merged
Conversation
…seat (trinity-enterprise#1053) An ask an agent addressed `to: approver` was delivered only to the people seated as approver, but anyone with access to the agent could answer it. `ask_service._seat_fenced` -- the one predicate `may_end` (every answer door) and `addressed_view` share -- now fences that answer to the raise-time `resolved_to` snapshot, as ent#1042 did for `role:<id>` asks. - Carve-out by snapshot: a legacy `approver` row with an empty or unreadable snapshot stays answerable by any person with access. A new one cannot be empty (an unfilled seat is refused `role_unassigned` at raise). - Cancel and bulk cancel are not narrowed; an admin outside the seat may cancel, never answer. - The refusal names the approver role through `role_message` (`_fenced_role_of`), at the Operations and Workspace doors; the MCP respond tool inherits the Operations route. - `addressed_view` widens through the shared predicate: the card goes read-only before the click. Tests: new route-executing `tests/unit/test_ent1053_approver_answer_fence.py`. Red before the change (7 failed: a person outside the seat got 200, the refusal and the view were missing); the empty-snapshot rows were green before and after. The three `approver` parametrizations in `test_ent1042_role_answer_fence.py` are dropped, because `approver` is no longer unfenced. Docs: requirements/security.md, feature-flows/operating-room.md, user-docs approvals, and the MCP `ask_operator` `to` description. Release note: on live installs, pending `approver` asks with a seat snapshot become seat-only to answer at deploy; rows without a snapshot are unaffected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
trinity-ability
approved these changes
Nov 2, 2026
trinity-ability
left a comment
Contributor
There was a problem hiding this comment.
/validate-pr — APPROVE
Lane B (ask_service.py; tests/ contains deleted lines, the three approver cases moving out of the 1042 file) · no schema · surface touched (src/mcp-server/src/tools/), so Step 6.6 applies.
| Category | Status | Notes |
|---|---|---|
| Base / size / commits | ✅ | dev, 8 files (+443/−23), conventional message citing the issue |
| Issue link | ✅ | Fixes abilityai/trinity-enterprise#1053 resolves (P2, status-ready, ruling recorded on the issue). Cross-tracker: no auto-promote, so set status-in-dev by hand after merge and close it manually at the release cut |
| Requirements / flows / user docs | ✅ | requirements/security.md, feature-flows/operating-room.md, user-docs/automation/approvals.md and the ask_operator to text all say the approver seat routes and restricts, with the empty-snapshot carve-out |
| Security §4.1–4.10 | ✅ | no keys, emails, IPs, host paths or mode changes; enterprise-docs-guard pattern over added lines: 0 hits |
| Build / config packaging | ➖ | no new package, no new env var |
| Structural review | ✅ | /review report-only run on this tip: MERGEABLE; /cso --diff clean |
| Merge gate (Tier 1) | ✅ | every PR check green, incl. pytest (head, seed 12345) and regression diff; dev-ci on dev: success; no open dev-ci red issue |
| Test adequacy | ✅ | 18 new tests go through the real Operations route and the Workspace door; non-happy paths covered (outside-seat person, admin outside the seat, legacy NULL/[] rows, cancel not narrowed, single and bulk) |
| Product fit | ✅ | Built to the recorded ruling. One predicate is extended, not a new home; the refusal is a named 403 not_addressee; the card goes read-only from the same predicate |
Execution coverage (§5.4), checked independently in the PR worktree
| changed symbol | executed by | live consumer | verdict |
|---|---|---|---|
_approver_seated / _seat_fenced clause |
TestRoute::*, TestProjection::* |
may_end → /respond, /cancel, bulk-cancel, Workspace answer; addressed_view → queue person view |
✅ |
_fenced_role_of |
test_a_shared_person_outside_the_seat_is_refused, TestPortalDoor::test_the_workspace_sink_layer_names_the_role |
answer() and cancel() refusals |
✅ |
ask_operator to description |
— | schema served over MCP | description text |
Mutation: branch → test_ent1053… + test_ent1042…: 51 passed. With ask_service.py reverted to the base commit, test_ent1053… gives 7 failed / 11 passed. The 7 red tests are exactly the fence tests: outside-seat ×2, approver question, admin answer refused, Workspace refusal wording, both projection cases. The 11 green tests cover the behaviour the ruling keeps unchanged.
Warnings (non-blocking)
- Fail-open on an emptied snapshot. "Empty snapshot ⇒ legacy ⇒ unfenced" also matches a seated row whose snapshot is emptied after the raise (
drop_addressee→resolved_to = kept or None). Then anyone with access can answer it again. That function has no caller in this tree, so this is only a hypothesis here. If a caller ever uses it on approver rows, a raise-time marker would be safer than snapshot emptiness for telling the two cases apart. - The answering MCP tool's description (
respond_to_operator_queue) does not listnot_addresseeyet; that's a small follow-up.
Before merge (carried from the PR body, still open)
- Release-note line: pending
to: approverasks that have a non-empty seat snapshot become seat-only at deploy. An admin outside the seat, who could answer them before, is now refused withnot_addressee, but can still cancel. - Read-only check of legacy
approverrows on a live install: confirm they hold NULL /[](these stay open) and nothing unparseable (the row reader already rejects that).
vybe
marked this pull request as ready for review
November 2, 2026 17:31
This was referenced Nov 12, 2026
webmixgamer
added a commit
that referenced
this pull request
Nov 13, 2026
… the agent, and is refused by name when none can (#4501) (#4506) An ask addressed `to: approver` was filed for whoever the seat provider named, with no reach check. Since the approver answer fence (#4181) only the people recorded at the raise may answer, so a seated approver the agent is not shared with became the one person allowed to decide an ask they could never see: 201 with `resolved: true`, a 404 for them, `403 not_addressee` for everyone else. The raise now records only the seated approvers who can open the agent (`role_addressing.resolve_approver_for_ask`, the rule `role:<id>` asks and gated-skill approvals already apply) and refuses `422 role_cannot_open_agent` when none can. Nothing is filed; the refusal names the role and is logged. Mutation: with the call in `ask_service._address` reverted to the plain resolution, six tests in `tests/unit/test_4501_approver_reach.py` go red. Fixes #4501 Co-authored-by: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes abilityai/trinity-enterprise#1053. An ask addressed
to: approvercan now be answered only by a person seated as approver, the same way asks addressed to a role id already are.What
ask_service._seat_fenced: the clause isto_role == "approver" and _resolved_people(row). An admin outside the seat is refused with 403not_addresseeand a message naming the role and the remedy.ask_operatortodescription now say the seat routes and restricts.Rulings carried (orchestrator, on the operator's behalf)
Fence by snapshot, not by date; cancel unfenced; refusal through
role_message; the addressed view from the shared predicate.Review + security
/review(Fable, report-only): MERGEABLE. Every answer door reaches the one predicate;/cso --diffclean. Recorded:drop_addresseecould empty a snapshot after raise and reopen a row (hypothesis, its only caller is gate-only); the answering MCP tool's description does not listnot_addressee.Tests
test_ent1053_approver_answer_fence.py, 18 through the real router and Workspace door, 7 red on base. 476 + 740 across the neighbours; 15ask_servicesuites shuffled, green. Not run here: full island (CI), live tiers.Before merge
approverrows hold on a live install: NULL and[]stay open, and an unparseable value already breaks the row reader.🤖 Generated with Claude Code
Release notes (added at merge-train, 2026-11-02)
to: approverasks that have a non-empty seat snapshot become seat-only at deploy. An admin outside the seat, who could answer them before, is now refused withnot_addressee, but can still cancel. Legacy approver rows with a NULL or[]snapshot stay open to anyone with access.