Brief P2: log and replay assistant messages exactly, drop the thinking-block risk

Approved 2026-09-17. Evidence is in docs/decisions.md.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
2026-09-17 00:38:32 -07:00
co-authored by Claude Fable 5.1
parent 790136e94f
commit 8421d80e87
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -26,6 +26,7 @@ Approved by the owner on 2026-09-17. One commit each.
| # | Change | Evidence | | # | Change | Evidence |
|---|---|---| |---|---|---|
| P1 | Inference contract 6: the `tools` array is fixed per epoch. `find_tool` returns schemas as a tool result and the model calls them through a `call_tool(name, arguments)` meta-tool. Never instruct the model to call an undeclared tool. | M0 (h): adding a tool re-read the whole prompt; undeclared calls were coerced into `write_file`. | | P1 | Inference contract 6: the `tools` array is fixed per epoch. `find_tool` returns schemas as a tool result and the model calls them through a `call_tool(name, arguments)` meta-tool. Never instruct the model to call an undeclared tool. | M0 (h): adding a tool re-read the whole prompt; undeclared calls were coerced into `write_file`. |
| P2 | Inference contract 2: the session log stores assistant messages exactly as returned, including `reasoning_content`, and replays them unchanged. Remove the "known risk" about dropped thinking blocks. | M0 (e): Ornith's template keeps every think block. |
## Proposed changes to the design brief ## Proposed changes to the design brief
@@ -33,7 +34,6 @@ From M0 and the kickoff review. None is applied yet. Each lands as its own commi
| # | Change | Evidence | | # | Change | Evidence |
|---|---|---| |---|---|---|
| P2 | Inference contract 2: the session log stores assistant messages exactly as returned, including `reasoning_content`, and replays them unchanged. Remove the "known risk" about dropped thinking blocks. | M0 (e): Ornith's template keeps every think block. |
| P3 | Inference contract 7: requests set `return_progress: true`; progress events count as liveness. | M0 (i): otherwise the stream is silent during prefill. | | P3 | Inference contract 7: requests set `return_progress: true`; progress events count as liveness. | M0 (i): otherwise the stream is silent during prefill. |
| P4 | Inference contract 8: the thinking cap uses `reasoning_control` and the control endpoint. | README b10809. Not yet exercised. | | P4 | Inference contract 8: the thinking cap uses `reasoning_control` and the control endpoint. | README b10809. Not yet exercised. |
| P5 | Settle the open question: chat-completions with server-side tool parsing. | M0 (b), (c). | | P5 | Settle the open question: chat-completions with server-side tool parsing. | M0 (b), (c). |
+5 -4
View File
@@ -84,7 +84,10 @@ ordinary outbound networking can reach the whole tailnet and the internet as the
measured with the server's tokenizer, enforced by a test. measured with the server's tokenizer, enforced by a test.
2. **Append-only.** The request for turn N+1 is a strict extension of the request for turn N. 2. **Append-only.** The request for turn N+1 is a strict extension of the request for turn N.
Nothing volatile (time, heartbeat notes, memory refreshes) goes anywhere but the newest message. Nothing volatile (time, heartbeat notes, memory refreshes) goes anywhere but the newest message.
Enforced by a property test on the serialized message array. Enforced by a property test on the serialized message array. The session log stores each
assistant message exactly as the server returned it (`content`, `reasoning_content`,
`tool_calls`) and replays it unchanged. Ornith's template keeps every thinking block, so
dropping or editing one changes the prefix.
3. **No in-place pruning.** Tool results are size-capped when first appended, never trimmed later. 3. **No in-place pruning.** Tool results are size-capped when first appended, never trimmed later.
4. **Compaction is an epoch change.** It happens only when the session is idle, writes a summary, 4. **Compaction is an epoch change.** It happens only when the session is idle, writes a summary,
and starts a new epoch whose prefix is the baseline plus the summary. The old log is kept. and starts a new epoch whose prefix is the baseline plus the summary. The old log is kept.
@@ -109,9 +112,7 @@ ordinary outbound networking can reach the whole tailnet and the internet as the
Open question settled by measurement in M0: use the server's chat-completions endpoint with Open question settled by measurement in M0: use the server's chat-completions endpoint with
server-side tool parsing, or render the template in-process for byte-exact prefix control. Default server-side tool parsing, or render the template in-process for byte-exact prefix control. Default
to chat-completions. Switch only if the M0 cache measurements fail. Known risk: Qwen-style to chat-completions. Switch only if the M0 cache measurements fail.
templates drop earlier thinking blocks from history, which changes the rendered prefix at the last
assistant turn.
## Authority contract ## Authority contract