Skip to content

fix(seat-decisions): an assignment kind never widens the seat-decision read (#3660) - #3666

Merged
dolho merged 1 commit into
devfrom
fix/3660-relationship-line
Oct 13, 2026
Merged

dolho merged 1 commit into
devfrom
fix/3660-relationship-line

Conversation

@dolho

@dolho dolho commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Workspace role card tells an agent's primary and approver "Your relationship · no assignment recorded" (#3660, found on 1.0 release row A1).

Why: the card's line and the seat-decision reader gate both read the seam's optional kinds_for. The gate (readable_seats) let anyone holding any kind on the agent read every person's seat decisions. A kind is per agent, not per role, so that is wider than the roster rule (#3381). The enterprise provider therefore keeps kinds_for unregistered, and the card line always reads None.

Fix (step 1 of 3 — option 1 on the issue): separate the two.

  • readable_seats now gives the reader's own seat (writable), and every seat to the owner only. An assignment kind no longer widens the read.
  • kinds_for becomes a display read: it answers the card's relationship line and grants nothing.

No behaviour change on any current build. The removed branch only switched on through kinds_for, which no build registers. This PR is what makes registering it safe.

Rollout order

  1. This PR (OSS, dev).
  2. Enterprise PR abilityai/trinity-enterprise#884: register kinds_for on the provider. Merge only after this one; on its own it would switch the old wide read on.
  3. Pointer-bump PR on dev. This is what makes the line read primary / approver on a build.

Changes

  • services/seat_decision_service.py: readable_seats drops the kind branch; module docstring.
  • services/assignment_provider.py, client_portal/seat_decisions.py: comments say what kinds_for is now for.
  • tests/unit/test_ent638_seat_decisions.py: the test that asserted "a provider kind reads every seat read-only" is split into the owner case, plus a regression for all four kinds. Each case uses a provider that does answer kinds_for: reader_kind returns the kind (the card line works), and readable_seats is the own seat only, without even listing the other seats.
  • Docs: requirements/core-agent.md (Readers), feature-flows/workspace-seat-decisions.md, architecture/workspace.md.

What this gives up: the planned (never shipped) "stakeholders read others' seats read-only". Per-role scoping (#3381) is the way to bring it back.

Test plan

  • New test fails on dev for all 4 kinds, passes with the fix.
  • Mutation: restoring the old branch from a scratch copy turns the 4 new cases red (4 failed, 48 passed); file restored byte-identical.
  • test_ent638_seat_decisions.py + test_ent527_role_card.py: 78 passed (the card's existing test_the_relationship_is_the_viewers_assignment_kind still pins the line when kinds_for answers).
  • Neighbours test_ent465_suggestions, test_ent596_skill_manager, test_ent839_seat_decisions_self_gate, test_ent814_served_seat: 164 passed.
  • Live, local stack running this PR + abilityai/trinity-enterprise#884 (the two together, which is what the pointer bump will ship). Real people signed in by email code on sales-companion, whose roster has Leo = primary (head-of-sales), Maya = approver (cfo), Priya = collaborator:
    • Role card (GET …/client-portal/agents/sales-companion/role): Leo relationship: "primary", Maya "approver", Priya "collaborator" (RC3: all three "no assignment recorded").
    • Seat decisions: each recorded one, then read the list. Leo, Maya and Priya each see only their own seat. The owner (admin) sees all three, writable.
    • Negative control: the pre-fix seat_decision_service.py in the same live setup → Maya (approver) reads Leo's and Priya's decisions (writable: false). That's the leak this PR prevents, so the live check does detect it.

Fixes #3660

🤖 Generated with Claude Code

…n read (#3660)

The role card's "Your relationship" line and the seat-decision reader gate
both read the seam's optional `kinds_for`. The gate let anyone holding a kind
on the agent read every person's seat decisions, so the enterprise provider
kept `kinds_for` unregistered, and the card told the agent's primary and
approver "no assignment recorded".

`readable_seats` now gives the own seat, and every seat to the owner only. A
kind is per agent, not per role, so it can no longer open other seats; per-role
stakeholder reads stay with #3381. No behaviour change on any current build:
the removed branch only switched on through the unregistered `kinds_for`. It
lets the provider register `kinds_for` for the card line next.

Fixes #3660

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@webmixgamer

Copy link
Copy Markdown
Contributor

/review + /validate-pr

Verdict: APPROVE. No critical findings. Merge this first in the 1 → 2 → 3 order.

/review (structural)

Scope: clean. This is step 1 of 3 (option 1 from the #3660 comment).

Execution coverage

Changed symbol Executed by Live consumer Verdict
readable_seats the 4 new kind cases + the owner case; the TestPortalRouter page tests client_portal/seat_decisions.py:34 ✅
reader_kind the new test + test_the_relationship_is_the_viewers_assignment_kind role_card.py:516 (display only) ✅
  • Tests: 78 passed locally.
  • Mutation: with the old kind branch restored, all 4 new cases go red (4 failed, 48 passed). Restored byte-identical.
  • Consumers: after this PR nothing else reads kinds_for. I checked the OSS tree, the enterprise module, MCP and the frontend.
  • Clean: SQL; concurrency; auth (narrowing only; owner, act and record unchanged); the enterprise-docs guard (14 added doc lines); the frontend (d.writable gating still holds); the user docs, which already say "own seat; owner sees every seat".

Informational

  1. Fixes #3660 sits on step 1 of 3 (9/10).
  2. bug: seat-decision readers are scoped per agent, not per role — an approver reads every seat's decisions (blocked on ent#500) #3381 now describes a bug that can't happen (8/10). It says "an approver reads every seat's decisions"; after this PR only the owner reads other seats. Re-scope it to the feature (per-role reads) or close it.
  3. One stale doc row (8/10). docs/memory/feature-flows/workspace-seat-decisions.md:114, the Seam row, still says "reader kinds from the private record".

Low confidence: the page tests run with _provider = None, so the live gate is never driven with a provider that answers kinds_for. seat_decisions.py:34 is a single pass-through, so this is low value.

Learnings: #3660's root cause is a new, durable class worth a fragment under docs/memory/learnings/. One optional seam method served both an access gate and a display line. The provider couldn't answer it without widening the gate, so it held it back, and the display silently stated a confident false negative.

/validate-pr

Lane B (no schema), 7 files (+48/−28), 1 commit, head 3dea26d3f.

Category Status Notes
Commit / base / size ✅ conventional fix(seat-decisions); targets dev; 7 files
Status auto-promotion ✅ ⚠️ Fixes #3660 is present, so the issue auto-promotes. See informational 1
Issue ✅ #3660: P2, type-bug, status-in-progress
Requirements / architecture ✅ requirements/core-agent.md (Readers) and architecture/workspace.md updated
Feature flows ✅ ⚠️ workspace-seat-decisions.md updated. Its section layout is non-standard, but that predates this PR. Line 114 is stale (informational 3)
Security §4.1–4.10 ✅ no keys, emails, IPs, .env, secrets, credential files, infra, mode or host-path changes; no new env reads or new directories
Disclosure guard ✅ the CI pattern ran clean over the added doc lines
Test adequacy / execution coverage ✅ the regression test names #3660; mutation red, then restored
Merge gate ✅ Tier 1 green: regression diff, pytest (head, seed 12345), the 4 required contexts, gitleaks, plus journey-smoke and prod-image-smoke. dev-ci on dev is success

Next: step 3, the OSS pointer bump, needs its own validation (it touches src/backend/enterprise), then a re-test on the build that carries it.

@webmixgamer webmixgamer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving: no critical findings; the /review + /validate-pr report is in the comment above. Merge order: this PR, then abilityai/trinity-enterprise#884, then the pointer bump. Informational items 1–3 there are non-blocking, though I'd still move Fixes #3660 to the bump PR.

@dolho
dolho merged commit 87e6eba into dev Oct 13, 2026
27 checks passed
alex-furman pushed a commit to alex-furman/trinity that referenced this pull request Oct 14, 2026
…c1e1)

One enterprise commit: Abilityai/trinity-enterprise#884 registers the
assignment provider's `kinds_for`, so the Workspace role card's "Your
relationship" line names the viewer's kind (primary / approver /
collaborator / viewer) instead of "no assignment recorded".

Safe on this `dev`: Abilityai#3666 (merged) removed the seat-decision reader gate's
kind branch, so registering `kinds_for` widens no read.

Related to Abilityai#3660

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants