Skip to content

A Turn that names no activity runs on scratch, never unpinned over a resident (card 1ca5abe1, f3ba3b56 item 4) - #5191

Merged
joelteply merged 1 commit into
canaryfrom
1ca5abe1/a-turn-that-names-no-activity-runs-unpin
Oct 21, 2026
Merged

joelteply merged 1 commit into
canaryfrom
1ca5abe1/a-turn-that-names-no-activity-runs-unpin

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

A Turn request with no (persona, room) key (a nil-room cognition/eval forked
onto her live lane, or a caller that dropped its room) got turn_key None. On a
pool WITH a scratch slot, admission pins nothing for it, and the Turn branch
sent no id_slot with cache_prompt on: the server placed it by similarity and
could overwrite a resident's KV, silently (only slot_pin.decision pinned=false).

One placement rule now, inference::slots::placement: only a Turn that names its
activity owns a slot; every other request, a keyless Turn included, takes the
slot its admission borrowed or the scratch slot, and without a scratch slot it
does not persist a cache (cache_prompt off), exactly as non-Turn traffic did. A
keyless Turn is reported as inference.turn.keyless with its purpose, and it no
longer registers an in-flight guard for a slot that is not hers.

inference/slots.rs's test module moves to slots/tests.rs (#![cfg(test)]):
slots.rs 2,848 -> 1,976 lines; lines past 1000 157,971 -> 157,145
(source-hygiene 37/37 on IntelMac, this tree, clean rebuild). Test:
only_a_keyed_turn_owns_a_slot. Not compiled here; CI compiles.

Co-Authored-By: Claude Opus 5.5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

@joelteply

Copy link
Copy Markdown
Contributor Author

Source review at 99defce: the extracted placement rule preserves keyed Turn placement and non-Turn placement/cache disabling. The keyless Turn now uses the scratch slot whose operation permit admit_turn already acquires; this closes the mismatch between admission custody and the transmitted id_slot. No source blocker found in that narrow change; exact-head CI remains required.

Please correct the probe text 'never on a resident slot': without scratch, admission can intentionally borrow a physical resident slot after saving/detaching its owner. The guarantee is no unowned overwrite, not never using that physical slot. Keep absent-pool behavior distinct; cache_prompt=false alone is not proof of slot isolation. This review is source inspection, not a live KV preservation receipt.

joelteply added a commit that referenced this pull request Oct 19, 2026
joelteply added a commit that referenced this pull request Oct 19, 2026
@joelteply
joelteply force-pushed the 1ca5abe1/a-turn-that-names-no-activity-runs-unpin branch from e37c7a7 to b364592 Compare October 19, 2026 18:12
joelteply added a commit that referenced this pull request Oct 20, 2026
@joelteply
joelteply force-pushed the 1ca5abe1/a-turn-that-names-no-activity-runs-unpin branch from b364592 to ed4847a Compare October 20, 2026 02:35
joelteply added a commit that referenced this pull request Oct 20, 2026
@joelteply
joelteply force-pushed the 1ca5abe1/a-turn-that-names-no-activity-runs-unpin branch from ed4847a to 49a76e1 Compare October 20, 2026 03:35
…ned over a resident (card 1ca5abe1, f3ba3b56 item 4)

Re-applied onto canary 445ae4b after #5245 split slots.rs and openai_adapter.rs
(the request placement now lives in openai_adapter/stream.rs) and #5249 moved the
probe macro to continuum_base. The slots test move this PR used to carry is already
on canary.

A Turn with no (persona, room) key (a nil-room eval on her live lane, or a caller that
dropped its room) went out UNPINNED with cache_prompt on whenever the pool had a
scratch slot, so the server placed it by similarity and could overwrite a resident's
KV. The one placement rule is now slots::placement (slots/placement.rs): only a keyed
Turn owns a slot. Every other request, a keyless Turn included, takes the slot its
admission borrowed or the scratch slot, and without a scratch slot never persists a
cache. A keyless Turn probes inference.turn.keyless with its purpose, and only a keyed
Turn registers an in-flight slot guard.

Test: slots::tests::only_a_keyed_turn_owns_a_slot pins the four cases.
source-hygiene 43/43 on IntelMac. Core compile is CI's.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
@joelteply
joelteply force-pushed the 1ca5abe1/a-turn-that-names-no-activity-runs-unpin branch from 49a76e1 to 5f6e909 Compare October 21, 2026 17:01
@github-actions github-actions Bot added size: M and removed size: XL labels Oct 21, 2026
@joelteply

Copy link
Copy Markdown
Contributor Author

Codex SOURCE PASS for the rebased patch at 5f6e909. Re-read the full patch at the split stream.rs/slots/placement.rs seams and the surrounding activity-key/admission flow. The keyless Turn follows unattributed placement, disables persisted cache when scratch is absent, and cannot register a resident in-flight guard; keyed Turn behavior is retained. The probe now names the borrowed-and-saved case correctly and uses continuum_base::probe!. Placement cases and assertions survived the port. Require green CI on this exact head; no local compilation or live validation claimed.

@joelteply
joelteply merged commit 20b0017 into canary Oct 21, 2026
9 checks passed
@joelteply
joelteply deleted the 1ca5abe1/a-turn-that-names-no-activity-runs-unpin branch October 21, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant