Repository navigation
feat(cognition): prompt blocks declare their sharing scope — the prefix orders widest first - #3981
Merged
Conversation
…ix orders widest first
`PromptScope { Substrate, Persona, Activity, Turn }` on every composed block. The tool
catalogue (Substrate: byte-identical for every persona with the same authorized set) now leads
the cacheable prefix; identity and the turn contract (Persona) follow; the standing context
(Activity) after; the clock/presence/recall material (Turn) stays a trailing turn.
Before, the prefix was ordered by hand — identity first, so no two personas shared a byte of
prefix — and three separate fixes (#205, #266, plan B4) each moved one block after a measured
cache break. One ordering declared per block replaces the boolean stable/trailing split for
blocks; a KV pager or a speculator reads the same scopes to know which pages N personas share
and which a context switch swaps.
Honest scope of the receipt: on this server the prompt cache is per slot, so the cross-persona
share needs the fork's KV page reuse to show as hit rate; this PR is its precondition and
changes no per-turn prefill on its own. Test pins the order and that no Turn block reaches the
prefix. Design: docs/planning/UNCERTAINTY-IS-THE-SCHEDULER-SIGNAL.md.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
deleted the
feat/prompt-blocks-declare-their-sharing-scope
branch
September 12, 2026 22:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See the commit.
PromptScope { Substrate, Persona, Activity, Turn }per block; tools lead, identity follows, standing context after, Turn material stays trailing. Precondition for the cross-persona KV share (the fork's page reuse is the other half). Tests: order pinned; no Turn block in the prefix; surface/shaping suites green.🤖 Generated with Claude Code
https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo