feat(cesar): bind mutation tools to the latest response, not just the… - #275
Merged
Conversation
… 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>
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.
… 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.