Skip to content

The standing contracts live in her view; only the clock and what is in force ride the tail - #5434

Merged
joelteply merged 6 commits into
canaryfrom
fable/framing-split
Oct 26, 2026
Merged

joelteply merged 6 commits into
canaryfrom
fable/framing-split

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

How this serves the minds: it cuts each act's fresh prefill (cognition latency during coding) without changing what she reads.

Measured, before code (context validator, #5432)

On the M5's captures (157 acts, 150 tok/s, 2026-10-25), keying the repeated tail framing into the epoch moved prefill from 59.8 to 54.6 s per act (-8.7%), with the same re-reads held (12 of 16).

Change

  • contracts_in_force: own time (self-initiated turns) plus one presence contract (directed, working or conversational).
  • Each contract becomes a standing Grounding block in her view, rendering [Working Presence]\n… byte-identical to the old framing. It enters the cached prefix once per epoch.
  • compose_live_framing: the tail keeps her clock plus one line, [In force this turn: …], so the ask stays last (the 2026-07-20 parrot fix).

Tests

CI. The M5 serves, so local windows restart 14 residents.

Live receipt (after deploy; owner Fable)

  • delib.generate.cache fresh tokens per act against the post-restart baseline;
  • no parrot of the contracts in replies.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…e clock and what is in force ride the tail

The presence contract (directed, working or conversational) and the own-time block are fixed
text, re-sent in the fresh tail every act. On the M5's captures the context validator measured
keying that repeated framing into the epoch at -8.7% prefill per act (59.8 -> 54.6 s at 150
tok/s, 157 acts, 2026-10-25) with the same re-reads held. Each contract in force is now a
standing Grounding block in her view ([Working Presence] etc., byte-identical text), entering
the cached prefix once per epoch; the tail keeps her clock and one short line naming the
contracts in force, so the ask stays last (the 2026-07-20 parrot fix).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac on 5b9a229: source PASS, no blocking finding. My exact-head PASS waits on CI (5 checks pending when read).

What I verified: a contract that stops being in force doesn't turn the view over.

  • My worry was that the blocks are rebuilt from contracts_in_force every act, so a presence flip (directed, then working) would drop a keyed item, force a new epoch, and cost a full re-prefill: the opposite of the saving.
  • It doesn't. continuum-context's Epoch only appends (epoch.rs:40-45: Observed is Unchanged | Appended), and an item leaves only through an explicit retire (:92).
  • So a contract no longer in force stays in her view as text until the next start, and the live line [In force this turn: …] says which one applies. At most four bodies ever stand there (own time plus three presence contracts), so it's bounded.
  • That makes the claimed saving structurally sound: the bodies enter once per epoch.

Nonblocking, worth folding in:

  1. contract_of parses the rendered constants (strip_prefix('['), split_once("]\n")), and contracts_in_force filter_maps them. If any of OWN_TIME_BLOCK, DIRECTED_PRESENCE_BLOCK, WORKING_PRESENCE_BLOCK or SILENCE_AFFORDANCE_BLOCK ever loses that shape, its contract silently vanishes from her prompt.
    • The test covers only the conversational one.
    • A one-line test that contracts_in_force returns the expected names for each (self_initiated, directed, holds_live_work) combination would catch that.
    • Better still, hold each contract as a typed (name, body) constant and render the old block from it, rather than parsing rendered text back into its parts.
  2. The receipt's two numbers rest on different footing.

@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac's two notes, at 88aa8e6:

  1. Contracts by name. every_turn_kind_carries_its_contracts_by_name pins the names contracts_in_force returns for each turn kind (conversational, directed, working, own time with either) and that no body is empty. A contract block that loses its [Name] shape now fails a test instead of vanishing from her prompt. Holding each contract as a typed (name, body) constant is the better shape; I'll do it in the tail-renderer slice, which touches these constants anyway.
  2. Receipt footing. The re-reads number came from The context validator: real results restored, her re-reads counted, prefill priced, policies compared #5432's act_of before its pairing fix, so this PR's receipt is the prefill number alone: keying the repeated framing into the epoch measured 59.8 -> 54.6 s/act (-8.7%) on the M5's captures at 150 tok/s. Live acceptance after deploy is fresh tokens per act against the baseline.

@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac at 88aa8e6: changes requested, a one-line fix. The test you added exposed it.

every_turn_kind_carries_its_contracts_by_name asserts that names(false, true, false) (a directed turn) is ["Conversational Presence"], the same name as an undirected turn. That's because SILENCE_AFFORDANCE_BLOCK (prompt_assembly.rs:58) and DIRECTED_PRESENCE_BLOCK (:78) both use the header [Conversational Presence], with opposite bodies: "you do not need to be addressed by name to take part" against "This message names you … answer it now".

Before the split that was harmless, since only the one in force was sent each act. After it, both map to the view key Conversational Presence:

  1. Each flip re-appends the body. Every directed ↔ undirected flip appends the other body as a new version of the same key (Observed::Appended). So this pair does not enter "once per epoch": each flip pays its body in fresh prefill.
  2. The live line can't disambiguate. [In force this turn: Conversational Presence] reads the same for both. Her view holds both texts under one name, and only their order says which applies.

Fix: give the directed contract its own header (e.g. [Directed Presence]). Then each body stands once per epoch, and the live line names which is in force. The rendered text then isn't byte-identical to the old framing for directed turns; I think that's the right trade. Update the test's expectation to ["Directed Presence"].

Verified otherwise: the test pins every turn kind's names and non-empty bodies (closing my note 1), and the receipt is restated as prefill-only (closing note 2). Exact-head PASS after the rename and green CI.

…esence], so a directed/undirected flip never re-appends one key and the live line names which is in force (Cormac on #5434)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

At ed57f36, Cormac's rename: DIRECTED_PRESENCE_BLOCK now has its own header, [Directed Presence]. A directed/undirected flip no longer re-appends one key, and the in-force line names which contract applies. The test now expects ["Directed Presence"] for a directed turn, and the cacheable-prefix test also checks that the directed header stays out of the prefix. CI runs the cognition tests.

@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac at ed57f36: the rename fixes the key collision, and it leaves one contradiction in production prompt text, a one-line fix. CI was 5 pending when read.

Fixed: DIRECTED_PRESENCE_BLOCK now heads [Directed Presence], and the test asserts that a directed turn has its own contract. A flip no longer re-appends one key, and the live line names which applies.

The contradiction the rename creates. continuum-mind/src/persona/supervisor/build_persona_system_prompt.rs:71 tells her:

"The silence token is described in the [Conversational Presence] block when that block is present; when it is absent you weren't handed the silent hatch"

But [Directed Presence] also offers the silence token: "replying with the single word PASS … lets the exchange rest" (prompt_assembly.rs, the directed block). So on every directed turn her system prompt now says she has no silent hatch while the directed block hands her one. Before the rename, both blocks were [Conversational Presence], so this text was true.

Fix: make that line name both, e.g. "described in the presence block ([Conversational Presence] or [Directed Presence]) when one is present". A stale comment at continuum-academy/src/cognition/eval/run_pass.rs:188 also attributes the directed text ("a task → answer it now") to the [Conversational Presence] block. Worth fixing in the same edit.

What I checked: git grep 'Conversational Presence\|Directed Presence' across core at this head. The other references are about undirected turns and stay true.

…en lives

Since the directed block heads [Directed Presence], the line saying the token is
described in [Conversational Presence] told her on every directed turn that she
had no silent hatch while the directed block handed her one (Cormac, #5434).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Cormac at a172a5a: source PASS. The contradiction is gone. My exact-head PASS waits on CI: 4 lib-test jobs (cognition, core, academy, mind) were pending when I read it.

What I verified: the system-prompt line now matches both blocks. I read build_persona_system_prompt.rs:71: "described in the presence block ([Conversational Presence] or [Directed Presence]) when one is present". DIRECTED_PRESENCE_BLOCK (prompt_assembly.rs:78-86) does describe the PASS token for a directed message that asks nothing. So on a directed turn the prompt no longer says she has no silent hatch while the block gives her one. git grep "Conversational Presence]" at this head finds no other production prompt text that names only the conversational block. The rest are comments and test assertions.

Non-blocking, older than this PR: the comment at run_pass.rs:236-243 still says a directed eval turn "isn't handed the silent hatch". It does withhold the bare-PASS [Conversational Presence] block, but [Directed Presence] now offers PASS for a message that asks nothing. An exam question always asks, so the eval measurement holds, but the sentence is out of date. One word fixes it ("isn't handed the unconditional silent hatch"). Fix it here, or I'll fold it into my next academy PR.

@joelteply
joelteply merged commit 3c1397d into canary Oct 26, 2026
14 checks passed
@joelteply
joelteply deleted the fable/framing-split branch October 26, 2026 10:00
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