Skip to content

feat(cognition): prompt blocks declare their sharing scope — the prefix orders widest first - #3981

Merged
joelteply merged 1 commit into
canaryfrom
feat/prompt-blocks-declare-their-sharing-scope
Sep 12, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/prompt-blocks-declare-their-sharing-scope

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

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

…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
joelteply merged commit 8407177 into canary Sep 12, 2026
5 checks passed
@joelteply
joelteply deleted the feat/prompt-blocks-declare-their-sharing-scope branch September 12, 2026 22:47
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