Repository navigation
feat(workspace): the seat-level decision record — why a thing was approved, deferred or killed (abilityai/trinity-enterprise#638) - #2949
Conversation
…tus vocabulary is checked at the sink; the portal routes are executed by a test (Abilityai/trinity-enterprise#638) Review findings on PR #2949: `effective_status` returned `routed` verbatim, so a direction record kept to avoid evaporation accreted forever — it now expires at `review_by` like an active one (the doc already said so). `DECISION_STATUSES` was declared and never read; `insert_seat_decision` now refuses a status outside it. Three tests execute the portal route layer (roster gate first, receipt → HTTP detail, action body forwarded). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
/review ReportBranch: Execution coverage (Step 2.5)
Mutations (feature PR, run anyway): flipping the expiry boundary ( Critical FindingsNone. Informational Findings (fixed in
|
|
|
…roved, deferred or killed, as a platform primitive (Abilityai/trinity-enterprise#638) Operator ruling R25: the approve / defer / kill judgments a role companion and its human make every week live nowhere — they evaporate with the chat. This gives a seat (agent × person, the ent#637 memory scope) a lintable record of its judgment, recorded by the companion over MCP or the person in Agent details, expiring unless reconfirmed, corrected by supersession, and read back into every turn so the criterion is reused. It is the evidence base for the autonomy dial (tandem-06 §2.2, #641). The record (tandem-07 §7a): outcome (approved | deferred | killed) · what was decided · the alternatives that were live · the criterion that discriminated · who decided (role + person) · decided_at + review_by · what would reverse it · notes (the only prose) · ask_class · cites · request_id (the #611 gate). - Grammar with receipts (services/seat_decision_service.py): prose where a field belongs → 422 decision_prose_only naming every failing field; no alternatives → 422 decision_is_a_note; a citation outside the seat's own records → 422 unknown_citation; a request_id that is not this agent's queue item → 422 unknown_request. Nothing is stored on refusal. - Direction is not a seat decision (R C3): the caller declares scope; a direction record is kept as `routed` — visible, expiring, outside the evidence — with the canon-proposal hint, so it neither evaporates nor pollutes the record. - Expiry is computed on read (review_by before today; equal is not expired), never written; correction inserts a new row chained by supersedes_id and flips the old one in one CAS transaction; close / reverse are status flips (reverse needs a reason — the evidence); reconfirm moves review_by. A non-active target is a named 409. Nothing is deleted. - Evidence: reused = records cited by a LATER record (a superseding record does not implicitly cite); per ask_class the distinct criteria, reversals, expired and `stable` (≥3, one criterion, no reversal) — #641's input. - Two surfaces, one seat rule. MCP `record_decision` / `list_seat_decisions` (src/mcp-server/src/tools/decisions.ts → POST/GET /api/agents/{name}/ decisions, routers/seat_decisions.py): the seat is resolved from execution_id exactly as write_user_memory does, never supplied; Idempotency-Key honoured (the tool derives one over the arguments); decided_by_role from assignment_provider.resolve_assignment or the caller, never a container read; NO email in the answer (decider = seat | owner); enforce:{param:"agent_name"} policy rows. The person records, corrects, reconfirms, closes and reverses in Agent details (client_portal/ seat_decisions.py, PortalAgentDecisions.vue, clientPortal store slice). - Readers: own seat always; the agent OWNER (role_card._is_owner) every seat writable; a stakeholder the assignment provider recognises through the optional seam method kinds_for(agent, reader) every seat read-only; no provider → own seat only. Writes: own seat, or the owner on a named seat. - Read into context: the seat's active decisions ride the shared memory block (platform_prompt_service.format_user_memory_block) on every caller, bounded and email-free — what makes a criterion reusable. - Storage: seat_decisions on both tracks (SQLite seat_decisions_table + Alembic 0068 ← 0067, has_table guard + IF NOT EXISTS indexes), cleanup CASCADE, JSON lists in TEXT, stats in Python, bounded reads. Tests: tests/unit/test_ent638_seat_decisions.py (45 — grammar table, lifecycle over a real SQLite file, evidence, readers, both routers, both tracks, facade parity), src/frontend/tests/unit/portalAgentDecisions.spec.js (8, mounted), src/mcp-server/src/tools/decisions.test.ts (5). Mutation checks: the expiry boundary and the email-free agent shape each turn tests red. Deferred (trinity-dev DEBT_INBOX 2026-09-22): readers per role rather than per agent; auto-record from an answered decision request (#611); the canon-folder export (the role pack's record-decision, #510 — field names already match). Refs Abilityai/trinity-enterprise#638 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…tus vocabulary is checked at the sink; the portal routes are executed by a test (Abilityai/trinity-enterprise#638) Review findings on PR #2949: `effective_status` returned `routed` verbatim, so a direction record kept to avoid evaporation accreted forever — it now expires at `review_by` like an active one (the doc already said so). `DECISION_STATUSES` was declared and never read; `insert_seat_decision` now refuses a status outside it. Three tests execute the portal route layer (roster gate first, receipt → HTTP detail, action body forwarded). Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
431c28f to
17d4a15
Compare
|
merge-train: rebased onto
Base is now |
17d4a15 to
ec77ba8
Compare
|
Addendum: |
…metric_points as 0071 (abilityai/trinity-enterprise#638) — mechanical, per the merge-train note on the PR dev gained 0068–0070 after this branch forked, so 0068_seat_decisions off 0067 was a second head (#2068 class): upgrade head would have applied zero revisions. Co-Authored-By: Claude Fable 5.1 <[email protected]>
ec77ba8 to
93c8c34
Compare
vybe
left a comment
There was a problem hiding this comment.
merge-train: validated (lane B+schema), rebased onto dev, all checks green on the retargeted run.


Refs abilityai/trinity-enterprise#638
What this is
Operator ruling R25: the approve / defer / kill judgments a role companion and its human make every week live nowhere — they evaporate with the chat that held them. This gives a seat (agent × person, the ent#637 memory scope) a small, lintable decision record, recorded by the companion over MCP or the person in Agent details, expiring unless reconfirmed, corrected by supersession, and read back into every turn so the criterion is reused. It is the evidence base for the autonomy dial (tandem-06 §2.2, #641). Paradigm's COO asked for it first.
The record (tandem-07 §7a):
outcome(approved | deferred | killed) · what wasdecided· thealternativesthat were live · thecriterionthat discriminated (the reusable part) · who decided (role + person) ·decided_at+review_by· what wouldreverseit ·notes(the only prose) ·ask_class·cites·request_id(#611's gate).Acceptance criteria → where
tools/decisions.ts(record_decision,list_seat_decisions) →routers/seat_decisions.py;client_portal/seat_decisions.py+PortalAgentDecisions.vue; readers via the optional seam methodassignment_provider.kinds_for(own seat always, owner every seat writable, a recognised stakeholder every seat read-only, no provider → own seat only)notesseat_decision_service.validate_record— one line ≤ 280 per field, alternatives ≥ 1decision_prose_only{receipt.fields}naming every failing field; 422decision_is_a_note; nothing storedreview_byunless reconfirmed; superseded stays as historyexpiredcomputed on read (equal is not expired),reconfirmmoves the date;supersede= new row + CAS flip of the old, nothing deletedstats():reused= cited by a LATER record (superseding does not cite); perask_classcriteria / reversals / expired /stable(≥3, one criterion, 0 reversals) — #641's inputscope: direction→ kept asrouted(visible, expiring, outside the evidence) + the canon hint. Reviewed choice: refuse-and-drop would be the evaporation R25 closes, and no canon-proposal route exists in TrinityDecisions worth your attention
execution_idexactly aswrite_user_memory(seat run stamp → verified channel email → 422no_seat);to_agentlabels the deciderseat/owner. An execution can be an anonymous public turn — the audience the assignment provider must never expose identities to.format_user_memory_block), keyed off the record's own seat, bounded, fail-open.role_card._is_owner, admin dropped —PortalPrincipalcarries no role; ownership is what the sibling routes gate on. A shared platform user is not an owner (tested).decided_by_rolefromassignment_provider.resolve_assignment(sync, in-memory) or the caller;x-roleis agent-writable anyway.Idempotency-Keythroughidempotency_service(the tool derives one over the arguments; a retry records once);supersedecannot fork under a double submit; any action on a non-active row is a named 409.access.tsrows areenforce:{param:"agent_name"}(the server refuses to boot on a missing row).Tests
tests/unit/test_ent638_seat_decisions.py— 45: grammar table (every refusal code + receipt), lifecycle over a real SQLite file, evidence (later-citation rule, stability incl. paraphrase fold / different criterion / reversal / expired), the bounded email-free prompt block + the composer hook, readers (own / owner / provider kinds incl. absent method, raise, bad kind), the agent router (seat resolution per trigger, foreign execution 403, receipt + idempotency release, replay snapshot, email-free list), the portal service (own vs owner vs shared platform user, named seat, direction hint, uniform 404), both tracks + registry + single head, facade signature parity,# mcp:header + registration.src/frontend/tests/unit/portalAgentDecisions.spec.js— 8, mounted (@vitest-environment jsdom): render criterion-first + evidence line, empty state, expired / routed / history / other seat read-only, record (chips, posted body, re-read), refusal on the named field, direction hint, close viaConfirmDialog+ reverse with inline reason, correct → supersede.src/mcp-server/src/tools/decisions.test.ts— 5: body withoutagent_name, deterministic key (retry same / different decision differs), user-key refusal, backend receipt assuccess:false, policy rows.<→<=) and returning the email in the agent shape each turn tests red.check_alembic_heads→ 1 head (0068_seat_decisions).Docs
requirements/core-agent.md§5.37 ·feature-flows/workspace-seat-decisions.md(+ index) ·architecture/workspace.md,database.md,api-endpoints.md,backend.md,mcp-server.md.Deferred (trinity-dev
DEBT_INBOX.md, 2026-09-22)Readers per role rather than per agent · auto-record from an answered decision request (#611) · the canon-folder export (the role pack's
record-decision, #510 — field names already match; the plan's canon-placement tension with tandem-03 §3 is recorded there).🤖 Generated with Claude Code