Skip to content

feat(crewlog): a session may read the crew logs it dispatched - #12141

Merged
iamwhatever merged 1 commit into
mainfrom
feat/crew-log-read-any-session
Sep 21, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/crew-log-read-any-session

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

A conductor session cannot read the crew logs of the sub-sessions it dispatched.
That is the ordinary shape of the work -- a conductor checks what a worker actually
did -- and the crew log MCP server merged in #11909 refuses it: its gate admits only
the owner's own dashboard session for any unit other than the caller's.

The premise first put forward for fixing it was wider: sessions on one Kiro Crew
gateway belong to one operator, so any may read any other, and session_read_message
already returns a peer session's transcript. That premise does not hold, and this PR
does not implement it. session_control.authorize_target (session_control.py)
refuses an unattended caller (cron:, taskrunner:), an app-scoped caller or target,
an incognito or temporary caller or target, and a channel-linked or channel-mirrored
caller or target; it addresses only open sessions and sits behind
agent.session_control. So that tool is narrower than an unrestricted read rather
than an example of one. The class it refuses most pointedly is the channel-linked
session, whose conversation is a Slack or Telegram thread that several allow-listed
people read and prompt-injectable content enters -- which "one operator" does not
reach.

Why it matters to the user

Without this, a conductor has no way to see a worker's recorded history and must ask
the worker to narrate it, which is both slower and less reliable than reading the
record. With the wider rule instead, a crew log -- which carries full message bodies
in its message/* entries -- would become readable by a session whose own
conversation is published to a messaging channel, so one read would republish another
session's transcript to an audience that was never party to it.

How it changed

The gate now asks for a valid strict session identity and then a dispatch scope. A
session reads its own unit; the units of sessions it dispatched, transitively; and,
when it is the owner at a dashboard tab whose own caller class allows it, any unit.
The listing carries the same scope as a filter, because an unscoped listing would
name every session on the host and a per-unit gate cannot refuse that after the fact.

Three things make that fence hold, each one closing a gap the previous round left:

The grant does not cross a workspace. A lineage OUTLIVES a workspace switch: the
creating edge is written on the child and nothing rewrites it, so a conductor that
dispatched a child and then moved to another workspace still names that child in its
tree. Switching workspace is ordinary operation, so the recorded lineage alone would
hand that conductor a log belonging to the workspace it left. So the recorded class
now carries the session's workspace, and the fence compares it against the caller's.
Three states refuse -- the workspaces differ, the log's workspace MOVED so its content
spans two and neither owns it, or the log records none, which no live slot can produce.
Unlike the other class members this one is an identity rather than a restriction, so it
is not folded most-restrictively: the first stated workspace is held and a later
different one sets workspace_moved, which is itself the restrictive fact. The arm runs
in the gate AND in the post-read re-check, because a caller can switch workspace while
the payload is built; it is ordered last of the target arms so a caller refused for
publication still gets that more specific reason. CHECKPOINT_VERSION moves to 2,
retiring savepoints that describe the old fold.

The LISTING carries that boundary too, not just the per-unit read. A row names a
unit's slot, model and activity, so a boundary enforced only on content would be walked
around by reading the enumeration instead. The listing asks the per-unit target tests
once per row, for rows admitted by LINEAGE only -- a caller's own row is its own record,
which the per-unit door also answers before any target test, and the owner's unscoped
listing is not narrowed and so is never asked. That is also what bounds the cost: one
fold per unit in the caller's own tree, never one per unit on the host. The rule is
passed down as a callable rather than restated inside the reader, so one authorization
rule has one implementation. The listing's stale re-check compares the caller's
workspace as a VALUE captured at the gate, because a slot's workspace changes IN PLACE
-- holding the slot object would make the check compare the new workspace against
itself and never refuse.

The fence keys on slots, not on unit ids. A slot outlives its ACP session, so a
gateway restart gives the same tab a new session id and therefore a new crew log
unit. A fence keyed on the recorded parent.sid would hand a re-attached conductor a
chain naming one of its own earlier units and lock it out of children it dispatched
minutes earlier. The transitive walk is crew_log/session_tree.py's own fold
(SessionTree.records plus fold_tree), not a second slot map, so the fence and the
Sessions page's tree cannot disagree about who dispatched whom. parent.sid stays on
the entry as the audit citation for which log held the creating call.

A target's class is recorded in its own log. The question "may another session
read this log" is asked about sessions that have closed, and a closed session has no
slot left to ask, so the class is written on session/opened at open time as facts:
memory (the slot's memory mode, required inside the object), app (the owning app,
when one does), channel (true when the conversation is published to a messaging
channel by a link or a mirror; a cron tab's link is not one). Facts rather than a
verdict, because the entry cannot be rewritten and a verdict would freeze one build's
reading of a rule into it. The object's presence is the witness that the class was
recorded, which is why memory is required inside it -- so a session with nothing to
declare ({"memory":"persistent"}) is distinguishable from a log written before the
field existed. A log with no record is REFUSED for a cross-session read rather than
read as "nothing applies", and the refusal names the missing record.

A class can MOVE while a session runs -- a tab gets a channel surface, an app takes the
session -- and the turns that arrive afterwards are in the same log, so the opening
entry alone is not the answer. session/class records a move, appended by the one
emitter that already observes the class every turn and already writes only when there
is something new to say, so no writer in any other subsystem has to be instrumented
and none can be missed. Reading it is the class projection, registered in the fold
registry like its five siblings: it holds each member at the most restrictive value the
log ever recorded, because a log published to a channel for one turn holds that turn's
words for good. It also reports whether the history has a BEGINNING, which is what
refuses a log whose opening entry retention has taken -- and what dates a log, since
the opening class object and session/class were declared together, so a log stating
the first was written by a build that records the second. The fold is incremental
through the registry's own checkpoint, so a scope test costs no whole-file read.

That front-of-log refusal has a consequence worth stating plainly: retention deletes
whole segments off the front by age, so once a long-lived session's opening segment ages
out its log becomes permanently unreadable from another session. The grant expires at the
retention horizon. It fails CLOSED, so nothing is exposed by it, and a refusal is
recoverable where a wrong admission is not -- but it does time-bound the feature, and the
fix is out of scope here: re-anchor the class at segment rotation by writing a snapshot as
each new segment's first entry, which works because each member is already latched at the
most restrictive value the log ever recorded. Filed as #12388. The retention case gets its
OWN refusal text rather than sharing the unrecorded-class one, because the remedies
differ: nothing about an aged-out log will satisfy the read again, where an unrecorded
class is fixed by the session recording one.

The record and the live slot are ONE target test rather than two sequential ones. That
is what makes the record half unskippable: a caller cannot consult the live half alone,
which for a target with no live slot would be no test at all. The live half then covers
the only thing the record cannot, a link acquired in the turn now in flight, whose
entries are not written yet.

The owner arm is held to the caller classes too. Reading every unit is the case
this door shipped with; being exempt from the caller-class test is not. A dashboard
session mirrored to a channel republishes every turn, so that tab would otherwise be
the one caller entitled to read every log and publish it. It keeps its own unit, like
every other excluded caller. This closes the inherited finding the Opus lane raised
on the previous head.

The owner-only branch and its self-scope arm are removed rather than short-circuited,
and the refusal texts for "no placeable unit" and "a unit in another tree" are one
string, so a caller cannot tell them apart and use the difference to learn which
slots are live.

The grant is re-asserted after the entries are read. A
read is decided on the event loop and then performed off it, and that offload is a
suspension point: the target can append a class move while the entries are
being gathered, and returning the payload on the earlier verdict would be a one-shot
delivery of content the refreshed class governs. So the whole target
test runs again before any payload is returned, on all three routes that offload one. The target's class IS folded again, because that fold reads the log's whole
life: a class move appended while the payload was being built makes it answer more
restrictively than it did at the grant, so reusing the grant's answer would return the
words of a channel turn the target took during the read. The re-fold closes that
exactly rather than narrowing it, and the exactness comes from where the class is
RECORDED rather than from when it is sampled: every surface that commits a change to a
session's class records the change as it commits, so a class governing any content in
the log is stated in that log ahead of the content. Because the fold is held at the most
restrictive value
the log ever recorded, a re-fold can only withdraw a grant, never widen one. It is also
incremental, so on a log that did not move it consumes nothing. The creator edge is NOT
folded again: it comes from an entry that cannot be rewritten and an append-only store
can only gain descendants, never take back a unit the caller was already placed above.
Each arm
also leaves a mark saying which target test its grant ran, because the owner arm runs
none by design and re-testing an owner's target here would refuse what the gate
deliberately allowed;
a request reaching the re-check with no mark is refused rather than answered. A read of
the caller's own unit is exempt, on the same ground the
first arm is. The late denial is audited under the operation name the grant was, so the
audit log carries the true sequence.

The caller's class is re-asked too, and what it buys is stated exactly. The route
does not hand another session's content to a caller that is publishing AT THE HANDOFF.
That is the act the route performs and therefore controls, and it is the scenario a
reviewer named: a prompt to paste a dispatched child's log, a mirror bound while the
payload read is suspended, and a reply that publishes the private log to the channel. A
listing is re-checked the same way, by recomputing its scope and comparing, because its
rows were gathered under the scope the caller held at the gate.

That claim needs the caller read TWICE on one arm, which is what makes it exact rather
than nearly true. The lineage arm suspends again to refold the target, so a verdict taken
before that suspension is stale by the time it is used -- a mirror acquired while the fold
ran would be missed, leaving this route's own window open while it closed the larger one.
Both readings refusing is enough, so the second can only add a refusal, never withdraw
one. A review lane found this by reading the sample point against the await; the window is
now covered and pinned by a test that reddens when the second reading is removed.

One residual is KNOWN and named rather than papered over: a caller entitled at the
handoff that acquires a channel link afterwards holds the payload in context and can
publish it on a later turn. Nothing at turn emission inspects a turn for another
session's log content -- the gateway has no provenance tracking on delivered content -- so
no refusal in this route can claw that back. The two cases differ in kind rather than in
timing: the first is the gateway delivering content INTO a published session, the second
is a session becoming published while holding content it was entitled to receive. This
route is the last point of control over the first and has none over the second. Closing
the second needs provenance on delivered content and is not in this change's scope.

This closes the GPT findings on both previous
heads.

Three more refusals, each closing a way a log could be DATED wrongly. The class
fold is only usable as an authorization input if it can say where the log's history
begins, and three things could make it claim a beginning it did not have. A log carries
an opening entry per re-attachment, so an old log written before the class was recorded
gains a later opener that does state one; only the log's FIRST opener now sets the
beginning, because a later one would date a stretch of the log it was not present for.
Retention deletes whole segments off the front, so a log whose oldest surviving segment
starts past seq 1 is refused -- within that file the surviving opener genuinely is the
first one the fold sees, so only the store can tell, and it can for the price of a
directory listing because the first seq is in each segment's name. That listing runs OFF
the event loop and only on the refusal path -- after the scope arm has had its chance to
refuse, and only for a log whose fold came back empty -- because it chooses between two
refusal texts and nothing else, so blocking the gateway for it would spend every
session's latency on wording. A review lane caught it on the loop; a test now reads the
source and fails if it returns there. And a fold cut short at the other end is refused,
as before.

Nothing about integrity changes: there is no write tool, the tool set is still
ratcheted, the agent's file tools still cannot reach the crew-log/ root, and every
read AND every refusal is still SEL-audited under the same action names the browser
routes use.

One identity resolver, so a bare session key cannot crash a read. A key with no
colon is a bare SLOT name, not a key missing its slot -- the crew log's own resolver
states that premise and acts on it, retrying such a key in dashboard: form, because
every namespace spelling carries a colon. The live-slot lookup instead took the second
part of a colon split, which raises IndexError on exactly that key, and this PR's
caller test is what newly reaches it: an ordinary read from a bare-key caller answered
500. Both readers now share one resolver, so the class test and the dispatch fence
cannot disagree about who a caller is. Resolving a bare key is not a widening: every
class test and the lineage walk still run on that slot, and the own-unit resolution
already handled this key shape, so refusing it was two halves disagreeing rather than
a boundary.

The dispatch walk's depth cap is DELETED, and the two passages naming a number are
count-free.
The walk already terminated on every input without it: each pass either
returns or adds a slot to a seen set drawn from a finite node map, so it cannot run
longer than that map. The cap therefore bought no termination safety, and it cost
correctness -- a chain longer than the cap answered "no creator above this" and refused a
grant the tree actually supports. A 40-generation chain now resolves, which is pinned by
a test that reddens if any fixed cap comes back.

Rebased onto current main for the savepoint ratchet. #12030 landed on-disk fold
savepoints with a ratchet that pins each fold's stored state, and a newly registered
fold trips it. Its digest is recorded at the current CHECKPOINT_VERSION rather than bumping:
the version retires savepoints that would resume onto changed meaning, a new fold has
none on any disk (a file is matched to a fold by name), and bumping would retire every
VALID savepoint of the other five to retire nothing. The five existing digests are
byte-identical, which is what says no existing fold's meaning moved.

The grant leaves a MARK, never data. Once the re-check folds the class itself, the
value the gate stored is only ever read to learn which arm granted -- so it is two
sentinels, owner and lineage, rather than a class object under a key named for
one. That removes the isinstance branch and a name that described what the value
used to carry. The spec paragraph and the constant's own docstring said the recorded
class is not asked again, which the re-fold falsified; both now state that the class IS
re-folded and that the creator edge is the one input not asked again, because it comes
from an entry that cannot be rewritten.

A hole in the log's MIDDLE refuses too, which is the third end of the same
question.
The store skips an unreadable interior line on purpose -- one damaged
record must not make a whole file unreadable -- and checks seq continuity only at
segment boundaries. That is right for a fold accumulating totals, where a lost entry
costs a count, and wrong for one whose answer is an authorization ceiling: the skipped
line can be the sole record of a restriction, and the fold still reaches the file's
tail, so nothing stopped early and the short-fold check cannot see it. The class fold
therefore keeps its own seq contiguity and reports a record it could not read as a hole
rather than as silence, and the reader refuses on it. Every other fold keeps the
store's tolerance.

The one hole none of the three checks covers is a damaged LAST line: it lowers the tail
seq too, so the fold and that seq agree, and nothing distinguishes it from an append in
flight -- which is frequent, so refusing on it would refuse ordinary reads. It carries
no exposure, and by construction rather than by luck: a class is recorded at the START
of the turn that runs under it, so a move with nothing after it is a move no turn has
run under, and no content in that log is governed by what was lost.

The class is recorded where it CHANGES, not where it is next sampled. Observing it
at each turn's start cannot see a channel link that commits and is removed inside one
turn, and content authored through that link sits in the log with nothing saying it was
published. So every surface that commits a change records it: the session map announces a
committed mirror or Slack binding through a new bind listener, mirroring the unbind
listener it already had, and the dashboard's note_crew_log_class is the one recorder
both that listener and every direct link assignment reach. It reuses the single existing
computation of (memory, app, channel) rather than adding another spelling of the
app/memory/link/mirror check.

The listener runs SYNCHRONOUSLY inside the map's own lock, unlike the unbind notice which
hops to the gateway loop, and that difference is the guarantee: routing an inbound
message reads that map, so no message can be attributed to the session before the record
has been taken. Best-effort at the call site is safe because the far end is fail-closed --
the append is handed to the crew log's writer without waiting, a write the writer
permanently loses is itself recorded as a dropped write, and the class fold reads that as
a hole. A lost record costs a refusal, never a silent grant.

The one case that argument does not cover is a slot with NO OPEN LOG, because nothing is
handed to the writer at all and so nothing records the loss. It is reachable: an idle
session can be bound to a channel, route a turn, and be unbound again before its first
turn opens a log, and a class read from the live slot at that point states
never-published about a log that holds channel-authored words. A restriction is therefore
MARKED on the slot rather than dropped, and the shared derivation folds the mark in when
the log is finally opened. The mark is never cleared, which matches the fold: each member
is held at the most restrictive value the log ever recorded, so the mark can only add a
restriction.

test/test_crew_log_class_recorder.py keeps that true as the code grows, and its site
lists are derived from the source rather than written out. Every link assignment must have
the recorder as a BLOCK SIBLING -- beside, not merely somewhere in the same function, so
neither a guard nor a different branch can stand in for it. No exemption may name a site
that does not assign a link, so the list cannot rot into a hand-written one. Every
function in the session map that persists a binding must announce it, which pins the
mirror half at the store instead of its twenty-odd callers. And the bind wiring must
appear wherever the unbind wiring does.

Tests

test/test_crew_log_routes.py carries the fence as 30 cases: conductor reads child
and grandchild; a conductor keeps its children across a gateway restart (same slot, new
session id, the child's entry still citing the old unit); sibling refused; own unit;
channel-linked caller refused and still reading its own unit; unattended in both key
spellings; app-owned; incognito; unplaceable caller; a mirrored owner tab refused past
its own unit; a live channel-linked target; a closed target read by its dispatcher; a
closed target's class read from its own log for each of channel, app and incognito; a
target whose log records no class refused; a class ACQUIRED after the log opened
refusing a closed target, and still refusing after the link is dropped again; a history
with no beginning refused; a class that never moved still read, which is the admitting
case the three refusals would otherwise be satisfied without; a fold that stopped short
of the file refused; an out-of-tree target refused without naming its class; no key refused; wrong component refused; the listing carrying the
same scope as a filter; and audit on both the granted and the denied path.
test_crew_log_emit.py pins the recorded class, the empty-declaration case, and that a
caller naming no memory mode records none. test_session_control.py pins the seam that
supplies those facts, including the cron-link exemption and the fail-closed mirror
probe.

The class fold carries six cases of its own in test_crew_log_projection.py: a class
that never moved; the most restrictive value ever held, member by member, since the
three latch by different rules; a history of moves with no opener; an opener with no
class object; a class object with no memory mode refused at append, plus the reader's
own defence against the same shape planted past append validation; and a resume that
cannot widen a class the log already moved away from. The registry's existing
parametrized suites cover the new fold for the shared properties, since they derive
their name list from PROJECTION_NAMES rather than hardcoding five names.

The post-read re-assertion carries eight cases: a caller that acquires a channel link
during the page read is refused, and the same race on the projection route and on the
listing, where the scope is re-derived and compared because a listing's rows were
selected under the scope held at the gate; a target whose class moves during the
page read is refused, while one that holds still is still answered, which is the pair
that shows the re-fold is what decides rather than the live slot; a target that moves
while the caller reads its OWN unit is still answered, which proves the exemption
returns before any target test; and a guard over this module's own source asserting that
every handler which suspends after authorizing passes through the re-check before
answering. That guard exists because the defect a new route would carry is an ABSENT
line, which no assertion about the current routes can see; it carries a count control so
an empty match cannot pass silently. The mark is covered too: the owner arm keeps reading
a target the lineage arm would refuse, and a request carrying no mark is refused rather
than answered.

Twenty mutations were applied one at a time, restoring from a file copy, with the
baseline verified green first and a positive pass count required before any run counted:
keying the fence on the unit instead of the slot (15 failed),
making the walk non-transitive (2), admitting an absent class record (1), ignoring the
recorded channel fact (1), exempting the owner arm from the caller-class test (1),
running the fold inline on the event loop (1), recording no class at all (3),
recording a class with no memory mode (1), dropping the post-read re-check from each of
the page, projection and listing routes (2 each, the race test plus the source guard),
dropping the own-unit exemption from the re-check so it refuses unconditionally (5),
and never comparing the listing's re-derived scope (1). Seven more for the fold and the
single target test: folding the latest class rather than the most restrictive ever held
(2), reporting every history as complete (2), admitting a fold that stopped short of the
file (1), dropping the record half from the target test so the live slot answers alone
(8), ignoring an incomplete history (1), running the target test on the owner arm too
(1), and falling through to the live test with no mark (1). All twenty killed, with
differing failure counts.

One mutation SURVIVED on the way here and is worth recording, because it changed the
design: replacing the no-slot branch's record re-read with a bare admit changed nothing,
since the gate ran the record test on the line above. The branch was defence in depth
dressed as the fix. Folding the two target tests into one removed the second decision
point rather than testing it, and the replacement mutation -- dropping the record half
from the single test -- kills 8 tests.

1137 tests pass across test_crew_log_projection.py, test_crew_log_routes.py,
test_crew_log_emit.py, test_crew_log_checkpoint.py, test_crew_log_types.py,
test_session_control.py, test_mcp_crew_log.py and
test_docs_crew_log_reference.py, run serially. Four
mutations cover this round, baseline verified green first and all killed: letting a
later opener date the log, dropping the front-trim refusal, reusing the grant's
stale fold instead of re-folding, and splitting a colonless key on its absent colon.
Each has an admitting counterpart beside it, because the refusals are otherwise
satisfied by a check that refuses every closed target -- the thing this door exists
not to do.

One mutation SURVIVED and the test it aimed at was deleted rather than strengthened: a
resolver falling back to the whole key when the slot half is empty is indistinguishable
from answering "", because at every route the class test refuses such a key first. A
test on it would assert an incidental artifact, so the reason is recorded where the
code is instead. Gates green on the pushed tree: flake8,
black baseline, isort, comment-history, feature-map, sync-IO-in-async, loop-bound
locks, brand and docs-lint.

The class fold's registration made every documented fold COUNT stale, so the count
and the fold list are corrected wherever they are stated: the feature map's three
crew-log rows, the agent reference page's tool table and its unknown_projection row,
the projection module's spec, and the
route, publisher and bundle docstrings. They all say FIVE, because five is what the
panel draws and five is what the growth push carries.

The class fold is registered but NOT advertised, and that is the point. It is not a
panel value: nothing on a client draws it, so naming it in PROJECTION_NAMES would make
every log growth fold and push a session_projection frame to every owner socket for no
reader, and would advertise a projection with no consumer. It stays in the registry under
INTERNAL_PROJECTION_NAMES, because its one caller asks for it by name
(fold_session(("class",))) and registration is what gives it the shared machinery --
the same checkpoint, the same incremental reuse, the same recreated-log guard. The
savepoint ratchet folds it too, so its stored shape is pinned exactly like the five. A
test asserts both halves, so neither the registration nor the withdrawal can drift
silently; re-adding the name to either advertised set reddens two tests.

Other notes

Refs #11929, which added the session tree and recorded the lineage this fence reads.
Its own module text states that parent.sid is an audit citation for a reader of the
logs themselves rather than a tree key; this fence is that reader and keys on the slot
for the same reason the tree does, so the two share one fold. That PR's spec section
also opened by calling the tree the one reader across logs, which stopped being true
when these two landed together; it now names both and says why neither is expressible
as the other.

The class fold is registered but NOT advertised: it is absent from the
crew_log_projection tool's enum, from its description, and from the growth push, and
present in INTERNAL_PROJECTION_NAMES so the registry still folds it. Advertising it
would name a projection no client draws and push a frame per log growth to every owner
socket for no reader; half-advertising it -- in the description but not the enum -- would
only generate failed calls, so every surface states the same status.

mypy reports two errors, both in src/kiro_crew/transcribe.py, which this branch does
not touch -- they are boto3 stub drift in the local environment, pulled in transitively
by the type check. Zero errors in any file this diff changes.

Issues #11963 and #12025 were closed as not planned in favour of this work.

No linked issue: this PR implements a maintainer decision rather than closing a filed
defect, and the issue numbers above are cited for context only.

@chenmingwei23
chenmingwei23 requested review from a team and hoang-phan98 September 20, 2026 01:30
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 479856e2c7e0dc1026917a5870248b5b7c5afa63 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 479856e

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 479856e2c7e0dc1026917a5870248b5b7c5afa63: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 20, 2026
@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 479856e2c7e0dc1026917a5870248b5b7c5afa63 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify #12388 stays tracked: cross-session reads silently expire once a log's opening segment ages past the retention horizon, time-bounding this feature until re-anchoring lands.

[DESIGN-REVIEWED] 479856e

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 479856e2c7e0dc1026917a5870248b5b7c5afa63 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 479856e

Verdict parsed from the review's SHA-scoped output markers for commit 479856e2c7e0dc1026917a5870248b5b7c5afa63.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 479856e2c7e0dc1026917a5870248b5b7c5afa63: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 479856e2c7e0dc1026917a5870248b5b7c5afa63 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The owner-arm narrowing — a channel-mirrored or linked owner tab loses its read of every unit — is a capability removal no recorded decision covers.

Not justified as shipped

  • Item 3 — inherited: the dispatch grant is licensed by rfc-append-only-ledger.md §6 (in-progress on base: "a dispatch [resolves] into the dispatched session"), but that RFC says nothing about narrowing the owner's existing any-unit read; the diff's own justification leans on symmetry — "one check at the one choke point, rather than an arm that is exempt from the rule the arm beside it enforces" — with the exclusions "mirrored here, from that module's own constants" (session_control.authorize_target). The republication harm is named, but reversing the shipped rule ("The owner at a dashboard tab, and nobody else" — the deleted TestWhoMayReadAnotherUnit pin) for this caller class is a maintainer's call, not the twin gate's.
    Clears when: a maintainer records the owner-arm narrowing — an RFC covering it merged non-draft on base, or /ai-review override first-principles 479856e2c7e0dc1026917a5870248b5b7c5afa63: <decision>.

What this change ships

Inventory (10 items) — 9 justified

Intent: let a conductor session read the crew logs of the sessions it dispatched, without widening to "any session reads any" — an ADDITION.

  1. A session reads/pages/folds/resolves the units of sessions it dispatched, transitively — justified
  2. The listing now answers non-owner callers with their own unit plus their dispatch tree (was: refused outright) — justified
  3. An owner dashboard tab mirrored or linked to a channel is refused reads and listings past its own unit — inherited (symmetry-form provenance; capability removal with no recorded decision)
  4. A session's class (memory, app, channel, workspace) is recorded on session/opened, with session/class entries for later moves — justified
  5. Cross-session reads refuse a log with no class record, no beginning (retention took it — the grant expires at the retention horizon, declared), or a damaged middle — justified
  6. A dispatch grant stops at the workspace boundary; the listing drops cross-workspace rows — justified
  7. Every granted cross-unit read is re-checked after the payload is built, and a withdrawal is audited — justified
  8. A committed channel binding is announced to a new session-map bind listener so the class is recorded before traffic routes — justified
  9. CHECKPOINT_VERSION 1→2, one refold of held savepoints per host — justified
  10. The fence keys on slots, so a gateway restart keeps a conductor's children readable — justified

[FIRST-PRINCIPLES-REVIEWED] 479856e

@chenmingwei23
chenmingwei23 force-pushed the feat/crew-log-read-any-session branch from 4fe5531 to 516273a Compare September 20, 2026 01:41
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 20, 2026
@chenmingwei23

chenmingwei23 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

span=1dee901dc18f disposition=needs-a-decision

Correct on every point, and I am not rebutting it. The deleted pins did
state their own reasons, and two of those reasons are independent of the
one-operator premise: an app agent must not inherit the person, and a
channel-linked caller's reads land in a channel thread in front of
allow-listed humans who are not the operator.
I verified the sibling gate myself at session_control.py:1805-1852 rather
than taking it from this lane.
Your two routes are the right framing and both are outside a worker's
authority: one narrows the change I was told not to narrow, the other is
a human re-confirmation I must not self-authorize. So: still outstanding.

  • Gate removal awaits the maintainer's explicit re-confirmation or a narrowing ruling; not rebutted

@chenmingwei23

chenmingwei23 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

span=852b820d086d disposition=needs-a-decision

Agreed, and worth doing even under route 2. An unshipped namespace is
admitted by default today, so a future surface inherits any-unit reads
without anyone deciding that, which is a different question from the one
the premise answers.
I am holding it rather than shipping it because a known-namespace
allow-list IS a caller-class fence, and adding one while the route-1
versus route-2 ruling is open would pre-empt that ruling in code.
If route 2 is ratified I will add the allow-list with new namespaces
fail-closed, and say so in reading-from-an-agent.md.

  • Fail-closed ratchet for unshipped namespaces accepted in principle; held until the route ruling lands

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 20, 2026
@chenmingwei23

chenmingwei23 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

span=cc118f2f8bc9 disposition=needs-a-decision

Accurate, and it names the gap precisely. The premise is about sessions
belonging to one operator; a messaging surface admits several
allow-listed humans, so the premise does not reach it. The comparison
table in this diff concedes exactly that, which is why the finding can
quote the diff against itself.
I will not paper over it: the honest position is that the flat rule is
unrecorded for those classes, and recording it is a maintainer act.
Clearance is an RFC on base or, pinned to this head:
/ai-review override first-principles 5916d4d:

  • One-operator premise does not cover multi-human messaging surfaces; needs an RFC or a head-pinned override

@chenmingwei23
chenmingwei23 force-pushed the feat/crew-log-read-any-session branch from 516273a to 5916d4d Compare September 20, 2026 01:59
@chenmingwei23 chenmingwei23 changed the title feat(crew log): any identified session may read any unit feat(crew-log): any identified session may read any unit Sep 20, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
@chenmingwei23 chenmingwei23 changed the title feat(crew-log): any identified session may read any unit feat(crewlog): a session may read the crew logs it dispatched Sep 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/crew-log-read-any-session branch from 5916d4d to 8f87f41 Compare September 20, 2026 03:54
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/crew-log-read-any-session branch from c96ef47 to d58b1ec Compare September 20, 2026 18:05
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/crew-log-read-any-session branch from d58b1ec to 918bd3f Compare September 20, 2026 18:30
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for d58b1ecab33124a380595042645d4650c7ad3ae3; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt d58b1ecab33124a380595042645d4650c7ad3ae3: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 918bd3f3beafe7c1efb28c5b110ddd279f19da52; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 918bd3f3beafe7c1efb28c5b110ddd279f19da52: <one-sentence reason>

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/crew-log-read-any-session branch from 918bd3f to 9c21333 Compare September 20, 2026 19:58
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
@chenmingwei23
chenmingwei23 force-pushed the feat/crew-log-read-any-session branch from 9c21333 to 6155cb7 Compare September 20, 2026 20:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 20, 2026
Replaces the owner-only rule on the crew-log read endpoints with a dispatch fence: a caller with a valid strict session identity may list, page and project its own unit, the unit of any session it dispatched transitively, and -- as the owner at a dashboard tab -- any unit. Lineage comes from the recorded session/opened parent edge. The caller-class exclusions session_control.authorize_target applies are mirrored from that module's own constants.
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

item=3 disposition=needs-a-decision

(This round's First Principles comment carries no span= identity, so the item is
pinned by head and by its own number. There is exactly one item under "Not justified
as shipped", so the reference is unambiguous.)

Accurate, and I am not going to argue it down. The narrowing is real and the
finding describes it correctly: an owner dashboard tab that is channel-mirrored
or channel-linked loses a read it has today, and TestWhoMayReadAnotherUnit
pinned the rule this reverses for that caller class.

The harm that motivates it is also real. An owner tab mirrored into a channel
republishes whatever it reads to a surface several allow-listed humans read, so
an any-unit read on that tab is an any-unit read for that channel. That is why
the arm is narrowed and why the exclusions are taken from
session_control.authorize_target's own constants rather than restated here.

But a real harm does not make the removal mine to record. Reversing a shipped
capability for a caller class is a product decision, and the twin gate is not
where product decisions get made -- which is exactly the finding's point. The
RFC that licenses the dispatch grant (rfc-append-only-ledger.md section 6) is
silent on the owner arm, so there is no recorded decision to lean on, and
symmetry with the arm beside it is an argument, not a record.

So I am leaving the code as shipped and leaving this open rather than papering
over it. It clears one of two ways, and both are a maintainer's:

  • an RFC covering the owner-arm narrowing, merged non-draft on base; or
  • pinned to this head:
    /ai-review override first-principles 479856e2c7e0dc1026917a5870248b5b7c5afa63: <decision>

What waiting costs: nothing on merge readiness. CONCERNS is advisory and does
not block PR readiness, and the other three lanes are clean on this head
(Design PASS, GPT 5.6 no blocking, Opus 4.8 no blocking). What is unresolved is
only whether this capability removal is recorded anywhere -- and if the answer
is that it should not happen, the place to say so is here, before merge, not
after a user notices the read is gone.

  • The owner-arm narrowing is a real capability removal with no recorded decision; needs an RFC on base or a head-pinned override. Code left as shipped.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Body-text corrections on 479856e2c7e0dc1026917a5870248b5b7c5afa63

Final verification found three assertions in the PR body that the last two rounds made
stale. Recorded here rather than amended, so the head does not move and no lane
re-rolls. Nothing below changes the code; each item is the body describing the diff with
an older measurement.

All three sit in the Tests section, which still predates the workspace boundary and
the listing filter. Both are described in How it changed; neither reached Tests.

body says measured now
"1137 tests pass" across the 8 named files 1186 pass, same 8 files, serial
"mypy reports two errors, both in src/kiro_crew/transcribe.py" zero errors, 1662 source files
"Four mutations cover this round" + its 4 names those 4 predate the last two rounds; 6 more verified since

1. Test count. 1186 passed across test_crew_log_projection.py,
test_crew_log_routes.py, test_crew_log_emit.py, test_crew_log_checkpoint.py,
test_crew_log_types.py, test_session_control.py, test_mcp_crew_log.py and
test_docs_crew_log_reference.py. The gap is the eleven tests the last two rounds added:
TestTheWorkspaceBoundary (7) and TestTheListingCarriesTheWorkspaceBoundary (4), both
in test_crew_log_routes.py.

2. mypy. The boto3 stub drift the body discloses is gone from this environment, so
the disclosure now understates the result rather than overstating it.

3. Mutations. The four the body names are real and still killed. Six more were
verified this round, baseline green first, each restored from an in-process copy:

Workspace arm -- the whole arm admitting (kills 5); the GATE's call deleted (kills 1);
the per-unit re-check's call deleted (kills 1). The gate's call needs a test that calls
_read_scope_refusal DIRECTLY: every unit read also passes the stale re-check, which
runs the same arm, so a route-level test cannot tell the two sites apart and that
mutation survived until the direct test existed.

Listing filter -- the per-row filter never consulted (kills 2); the filter applied to
the caller's OWN rows as well (kills 1, which is what pins it as lineage-only); the
listing re-check's workspace-move test dead (kills 1).

One retraction while correcting the record: an earlier note of mine claimed
_target_class_refusal's live half had no test coverage. That was wrong, and it came
from grepping for the function name and its refusal texts rather than measuring.
Mutating the _app arm reddens 2 tests; mutating the memory_mode arm reddens 2 more.
No coverage issue is owed.

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