Repository navigation
fix(session-control): admit a chat slot bound to a member's V2 store - #11606
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the operator model intends any chat tab bound to a member store — not only the pinned DM slot — to inherit the Suggestions
[DESIGN-REVIEWED] 76189e7 |
GPT 5.6 Review — ✅ human override acceptedHuman judgment by @iamwhatever overrides the GPT 5.6 finding for This comment is updated in place on each push. The model was not re-run because an authorized human decision supersedes it. False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
74aba1a to
f31eb15
Compare
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS The switch-bypass extension to chat tabs and worker trees exceeds the reported defect — which occurred with both switches ON — and rests on DM-slot symmetry. Not justified as shipped
What this change shipsInventory (8 items) — 6 justifiedIntent: let a crew member running in an ordinary dashboard chat tab dispatch and control worker sessions instead of dying on its first
[FIRST-PRINCIPLES-REVIEWED] 76189e7 |
1691b01 to
82673b9
Compare
55f827f to
56d7228
Compare
56d7228 to
4588171
Compare
4588171 to
a1c31db
Compare
a1c31db to
d7669fd
Compare
|
self-added: yes
|
d2a755a to
0ce5d27
Compare
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
Let an ordinary dashboard chat slot bound to a crew member's private V2
memory store use session control, not only the member's `member-*` DM
slot. The HTTP gate admits "the caller's verified scope is a member-owned
store" and the inner ownership fence ("a member may only control sessions
it created") stays.
The gate carries the admission it made into the inner fence. The member
store record is mutable config: an operator's writer can un-assign the
member, drop `memory_version` (coerced to 1 by the loader) or drop the
entry between the gate and `authorize_target`, and a fence that re-reads
the record there would collapse to `bool(_created_by)` and let an admitted
member reach a foreign same-workspace session. `_private_caller_refusal`
marks the request on member admission; every route hands the mark to
`authorize_target` as `precomputed_ownership_fenced=True`, the same
parameter `close_target` already uses to keep config reads out of its
synchronous re-check. The switch bypass still reads the record live, so an
un-assigned member loses the bypass at once (tightening only).
`_store_is_member_owned` is one fail-closed boolean: a V2 record with a
non-empty `owner_member` whose owner is still an active agent bound to
exactly that store. A retired or re-bound owner, a missing record, an
unreadable config or a degraded `memory_stores` section all withhold
member status.
A member-created worker is itself member-bound and may dispatch its own
children (nested conductor); depth is capped by the conductor agent, not
this fence, and every node stays creator-fenced.
Updates the session-control spec and pins: the carried admission on both
member spellings; a record flip after admission (un-assign, V1 downgrade,
dropped record, degraded config) refused at the fence, unit-level and
through the real read route; the legacy V1 named-store tab keeping owner
reach; the five routes refusing a member-store caller at the exact fence
code; the close re-check reading no config; a member worker dispatching a
grandchild.
0ce5d27 to
76189e7
Compare
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
self-added: yes
|
|
/ai-review override gpt 76189e7: The caller-fence verdict is frozen identically across both the initial admission gate and the synchronous recheck, so reusing it in the recheck cannot grant reach the admission gate didn't already grant under global session_control; the recheck re-reads target mirror/link/replacement live, and the close is non-destructive and reopenable. |
Human judgment recorded@iamwhatever marked the gpt AI finding as false positive, not applicable, or explicitly accepted for
This decision applies only to this commit. A new push requires a new judgment. |
…irodotdev#11606) Let an ordinary dashboard chat slot bound to a crew member's private V2 memory store use session control, not only the member's `member-*` DM slot. The HTTP gate admits "the caller's verified scope is a member-owned store" and the inner ownership fence ("a member may only control sessions it created") stays. The gate carries the admission it made into the inner fence. The member store record is mutable config: an operator's writer can un-assign the member, drop `memory_version` (coerced to 1 by the loader) or drop the entry between the gate and `authorize_target`, and a fence that re-reads the record there would collapse to `bool(_created_by)` and let an admitted member reach a foreign same-workspace session. `_private_caller_refusal` marks the request on member admission; every route hands the mark to `authorize_target` as `precomputed_ownership_fenced=True`, the same parameter `close_target` already uses to keep config reads out of its synchronous re-check. The switch bypass still reads the record live, so an un-assigned member loses the bypass at once (tightening only). `_store_is_member_owned` is one fail-closed boolean: a V2 record with a non-empty `owner_member` whose owner is still an active agent bound to exactly that store. A retired or re-bound owner, a missing record, an unreadable config or a degraded `memory_stores` section all withhold member status. A member-created worker is itself member-bound and may dispatch its own children (nested conductor); depth is capped by the conductor agent, not this fence, and every node stays creator-fenced. Updates the session-control spec and pins: the carried admission on both member spellings; a record flip after admission (un-assign, V1 downgrade, dropped record, degraded config) refused at the fence, unit-level and through the real read route; the legacy V1 named-store tab keeping owner reach; the five routes refusing a member-store caller at the exact fence code; the close re-check reading no config; a member worker dispatching a grandchild. Co-authored-by: EC2 Default User <ec2-user@ip-172-31-10-71.ec2.internal>
Problem / Motivation
A crew member such as
kirocrew-conductordoes its work by dispatching workersessions:
session_create,session_send,session_read_message,session_stop,session_close. It runs not only in its pinnedmember-*DMslot but also in an ordinary dashboard chat tab (
chat-<n>-<ts>) bound to itsprivate V2 memory store. The five session-control routes admit a private member
only by the
member-*key, so a conductor in a normal chat tab is refusedmember_scope_deniedand cannot dispatch at all — even withagent.session_controlandagent.member_dispatchboth on.Why it matters
The member operating model is unusable from the surface most people actually
open a member in. Every conductor run from a chat tab is dead on its first
session_create.What changed (motivation → approach → change)
The gate now recognises a member by its store, not only its key. A caller
whose verified private scope is a member-owned V2 store is admitted like a
member-*DM slot, and the same creator-ownership fence bounds it: a memberreaches only the sessions it created.
Admission and the fence read the store record differently, on purpose. The
record is mutable config. An operator's own writer can un-assign the member,
drop
memory_version(the loader coerces a missing key to1), or drop theentry — and any of those can land between the gate and
authorize_target,because the body read and the prewarms suspend in between. A fence that re-reads
the record there would fall back to
bool(_created_by)and let an admittedmember reach a foreign same-workspace session. So the gate carries its
admission into the fence:
_private_caller_refusalmarks the request, eachroute hands the mark to
session_control.pyascaller_fenced, andauthorize_targettakes it asprecomputed_ownership_fenced=True— theparameter
close_targetalready uses to keep config reads out of itssynchronous re-check. The switch bypass still reads the record live at every
gate, so an un-assigned member loses its bypass at once; that direction only
tightens.
flowchart LR subgraph before [Before] G1[HTTP gate<br/>admits member]:::ctx --> B1[body read, prewarms]:::ctx --> F1[fence re-reads<br/>config record]:::removed --> R1[record flipped:<br/>unfenced]:::removed end subgraph after [After] G2[HTTP gate<br/>admits member]:::changed -- "carry admission" --> F2[authorize_target<br/>precomputed_ownership_fenced=True]:::added --> R2[record flipped:<br/>still creator-fenced]:::added G2 -.-> P2[switch bypass<br/>still reads record live]:::ctx end classDef added fill:#DCFCE7,stroke:#16A34A classDef changed fill:#FEF3C7,stroke:#D97706 classDef removed fill:#FEE2E2,stroke:#DC2626,stroke-dasharray:4 3 classDef ctx fill:#E0F2FE,stroke:#0284C7 linkStyle 2 stroke:#DC2626,stroke-dasharray:4 3 linkStyle 3 stroke:#16A34A,stroke-width:2px linkStyle 4 stroke:#16A34A,stroke-width:2px🟩 added · 🟨 changed · 🟥 removed · 🟦 unchanged
The gate's decision travels with the request, so a config write after admission
can no longer turn a member into an unfenced caller. A refusal raised on a carried
verdict says
this session can only control sessions it created itself: theverdict says whether the caller is fenced, not which class it is, and reading the
class there would mean a config read inside close's no-suspension window.
_store_is_member_owned(dashboard/session_control.py) is one fail-closedboolean:
Trueonly for a V2 record with a non-emptyowner_memberwhose owneris still an active agent bound to exactly that store. A retired or re-bound
owner, a missing record, an unreadable config or a degraded
memory_storessection all withhold member status — admission and bypass fall back under the
global switch, never wider.
A member-created worker is bound to the member's store at birth, so it is itself
a member caller and may dispatch its own children (a nested conductor). This is
intended: depth is capped by the conductor agent, not this fence, and every node
stays fenced to what it created.
docs/system-specs/modules/session-control.mdrecords both the carried admission and this recursion.
Tests
test/test_session_control_member_gate.py— the gate marks a request on bothmember spellings and marks nothing for an owner or a refused caller; each of
the four target-taking routes (
stop/close/send/read) forwards thecarried verdict to its core function (
Truefor a member,Nonefor anowner), so a route that forgets the carry fails a test; through the real
readroute with a realDashboardState, a store record that flips rightafter admission still gets
403 not_creatoron a foreign tab.test/test_member_session_control.py—_store_is_member_ownedon everyrecord shape (member, V1, ownerless, retired owner, re-bound owner, missing,
unreadable, degraded); a flipped record (un-assign, V1 downgrade, dropped
entry, degraded config) is refused at the fence with the carried verdict while
the inline fence provably would not bind; a legacy V1 named-store tab keeps
owner reach; the close re-check loads no config; a member worker dispatches a
grandchild and is fenced off what it did not create.
test/test_member_memory_api.py— a member-store caller against all fiveroutes, with a resolvable caller and target, refused at the exact fence code
(
memory_delegation_deniedfor create,not_creatorfor the rest), and theowner's tab untouched.
Manual verification
N/A — unit and route-level coverage sufficient: the route test drives the real
handler against a real
DashboardState.Related Issues
no linked issue: follow-up to the merged narrow admission (#11438); no tracking
issue was filed for the chat-tab case.
Pattern harvest
Rule candidate: review-prompt
Pattern: an authorization decision made on a verified signal at the gate is
carried into the inner check, never re-derived there from mutable state.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)