Skip to content

feat(cesar): bind mutation tools to the latest response, not just the… - #275

Merged
cukas merged 1 commit into
mainfrom
feat/cesar-harness-improvements
Jul 18, 2026
Merged

feat(cesar): bind mutation tools to the latest response, not just the…#275
cukas merged 1 commit into
mainfrom
feat/cesar-harness-improvements

Conversation

@cukas

@cukas cukas commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

… turn

Per-response lease binding (#3): the stale-turn fence checked only that a tool's envelope belonged to the ACTIVE turn. Within one turn, a mutation dispatched by response N could still execute after the model had already produced response N+1 — the plan it belonged to was superseded but the write landed anyway.

  • Add optional responseSeq to ControlPlaneEnvelopeV1 (turn-protocol).
  • isCurrentCesarResponse: per-response comparator; legacy seq-less envelopes stay accepted for backward compatibility.
  • nextCesarResponseSeq: each model round-trip claims a fresh seq and advances the runtime's active envelope.
  • isActiveCesarResponse: active turn AND latest responseSeq.
  • Mutation fence (session.kern) now requires the latest response; read-only tools remain exempt (Feat/agent mode #1 behavior preserved).
  • _cesarSend wrapper stamps a fresh seq at all 17 brain send sites.

… turn

Per-response lease binding (#3): the stale-turn fence checked only that a
tool's envelope belonged to the ACTIVE turn. Within one turn, a mutation
dispatched by response N could still execute after the model had already
produced response N+1 — the plan it belonged to was superseded but the
write landed anyway.

- Add optional responseSeq to ControlPlaneEnvelopeV1 (turn-protocol).
- isCurrentCesarResponse: per-response comparator; legacy seq-less
  envelopes stay accepted for backward compatibility.
- nextCesarResponseSeq: each model round-trip claims a fresh seq and
  advances the runtime's active envelope.
- isActiveCesarResponse: active turn AND latest responseSeq.
- Mutation fence (session.kern) now requires the latest response;
  read-only tools remain exempt (#1 behavior preserved).
- _cesarSend wrapper stamps a fresh seq at all 17 brain send sites.

Co-Authored-By: agon (KERN) <292465531+KERN-Agon@users.noreply.github.com>
@cukas
cukas merged commit 293deb0 into main Jul 18, 2026
1 check passed
@cukas
cukas deleted the feat/cesar-harness-improvements branch July 18, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant