Resolve grants through the originating turn
Use when
Code-mode cells or queued tool operations outlive the turn that created them. Looking up permissions through the currently active turn can remove approved access or borrow another turn’s grant.
Action
Require
the
0.161.0
repair
or
a
reviewed
equivalent
before
relying
on
this
path.
In
owned
adapters,
retain
the
originating
turn
and
environment
identity
with
each
operation
and
approval
request.
Resolve
turn
grants
and
strict-review
requirements
through
that
context,
not
active_turn.
Keep
session-scoped
grants
in
a
separate
live
store.
Route
late
approval
responses
back
to
their
requesting
turn.
Do
not
freeze
everything:
new
grants
and
newly
enabled
strict
review
must
remain
visible
within
their
proper
scope.
Acceptance check
In an authorized disposable fixture, approve a write only for turn A, pause its background cell at a barrier, start B, then release A. Require A’s marker to appear. B’s equivalent write must still request approval and remain absent after denial. Give B a different turn grant; A must not inherit it. Repeat with an explicit session grant and require intended sharing.
Then
let
A
request
permission
after
B
starts:
the
request
must
still
identify
A,
and
approval
must
not
authorize
B.
Exercise
the
upstream
queued-input
case:
enable
strict
review
while
A’s
write_stdin
waits;
NUL-containing
input
must
be
rejected
before
delivery.
Retain
build,
turn/environment
IDs,
approval
events,
decisions,
and
actual
file/receiver
effects.
Use
barriers,
not
timing
guesses.
Evidence
October
7’s
stable
release
includes
merged
PR
#49880.
Tagged
TurnContext
source
separates
retained
turn
grants
from
shared
session
grants.
Public
tests
synchronize
overlapping
turns,
assert
filesystem
effects,
check
late-request
identity,
and
reject
queued
input
after
strict
review
activates.
These
are
inspectable
regressions,
not
just
a
release-note
promise.
Caveat
This fix does not establish revocation, cancellation, restart persistence, or universal permission-drift safety. Session grants intentionally remain live; a new turn alone is not a cancellation receipt. Keep explicit stop/revocation controls and independent task acceptance. Tests were inspected, not run; no independent post-fix runtime result was verified. The reverse-direction grant check extends upstream coverage. Nothing was installed, enabled, or evaluated.