Repository navigation
Conversation
jefft72
requested review from
Issacboy123 and
Pepps233
and removed request for
Issacboy123
August 16, 2026 00:11
Issacboy123
force-pushed
the
stack/native-plan-06-persistence-hardening
branch
from
August 16, 2026 03:14
af9ec58 to
ef104c3
Compare
Reject malformed session graphs and update session files atomically without corrupting the active manager.
Require accepted plans to persist their trusted implementation prompt through a dedicated append path.
Exercise plan validation and continuation recovery across persisted session branches and reloads.
Pepps233
force-pushed
the
stack/native-plan-06-persistence-hardening
branch
from
August 16, 2026 04:03
ef104c3 to
4b3eefe
Compare
Contributor
Author
|
Closing to rebuild on a clean base. This stack does not build. Two separate defects are present, and the first masks the second:
Replacement stacks:
The branch behind this PR is retained unchanged as a backup. |
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.
Summary
Hardens persisted session loading and accepted-plan continuation recovery so malformed history cannot silently reshape a conversation graph or partially replace the active session.
The failure cases covered here include malformed or non-object JSONL records, duplicate entry IDs, missing parents, invalid plan lifecycle transitions, and arbitrary user messages persisted where the exact accepted-plan implementation continuation is required.
Reasoning
Session files are a durable trust boundary, and skipping a corrupt record can reconnect its descendants under the wrong state or allow an invalid plan lifecycle to fail open.
The loader therefore tolerates only the narrow crash-recovery case of an incomplete final append after a valid header, while complete malformed records and graph violations remain hard failures.
An accepted plan also represents a one-shot transition from planning to implementation.
Requiring the generated implementation prompt through a dedicated append path prevents an unrelated user message from consuming that transition and makes restoration across branches deterministic.
Changes
appendPlanContinuationMessageas the only API that can consume a pending accepted plan, requires one text content block equal tocreatePlanImplementationPrompt(plan), and blocks ordinary user appends until that continuation is persisted.AgentSessionthrough the dedicated persistence method and marks it persisted only after the trusted append path succeeds.Testing
npm run checkpassed.