Repository navigation
Keep partial writes atomic, fill missing journal entries, and pick the true latest revision - #17
Merged
Merged
Conversation
…e true latest revision Journal supplement on replay - A request stored as completed whose checkpoint, notifications or operation.succeeded event were not written (for example the process stopped right after completion) now gets the missing entries filled when the same request is replayed in local mode. This applies only to 20 measured commands; the handler is not run again, entries are written once in one transaction with the actual time and a supplemented mark, and nothing is written if the chain or stored data is not in a known shape. A per-operation gate prevents a concurrent writer and a replay from filling the same tail. Hosted review mode is unchanged. No half-written records - memory/validate, memory/changeSet/propose and memory/retire/propose write their two MEMORY control records in one short transaction, so a failure on the second write leaves no row. - R2 closed-loop failures write the sandbox rejection and the research-test hold together, after the sandbox work has finished. A final non-retried failure writes completion, admission and recovery candidate in one outer transaction. Retry, plain and success paths keep their boundaries, and no transaction is held while the sandbox runs or across an await. SandboxService.accepting_observation gains an opt-in defer_rejection keyword (default unchanged). Clear message when only the reference step fails - When research was committed but the later reference step failed, the error now says, in Korean and English, that the research (in v2: its intermediate records) was saved, gives the reason, and asks the user to check the saved result before sending the same question again. data.research_saved is true. The notice appears only after the research commit is proven readable for this project, thread and request; otherwise the previous error is returned. Error codes, reason_code and the recorded exception type are unchanged. Current revision under clock changes - Stores chose the current revision by created_at, so a newer revision written while the system clock had moved back lost to an older one (18 of 19 checked tables). All affected writers append rows, so the current revision is now the last stored one: plan executions and outcome series by their revision number then rowid, control records by version then rowid (read and latest list), and the other tables by rowid. Schema, writers, canonical heads and history lists are unchanged; the thread checkpoint list keeps its display order while pause/resume guards use the real latest checkpoint. Two control-record revisions with the same version can still be written concurrently; the choice is now deterministic. Verification: full suite on the exact tree - Python 5503 tests (0 failures, 0 errors, 2 skipped), web tests, lint, typecheck and build, ruff, architecture and module budget checks, and the README quick-start smoke test all pass.
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.
Journal supplement on replay
were not written (for example the process stopped right after completion) now gets the
missing entries filled when the same request is replayed in local mode. This applies only
to 20 measured commands; the handler is not run again, entries are written once in one
transaction with the actual time and a supplemented mark, and nothing is written if the
chain or stored data is not in a known shape. A per-operation gate prevents a concurrent
writer and a replay from filling the same tail. Hosted review mode is unchanged.
No half-written records
control records in one short transaction, so a failure on the second write leaves no row.
after the sandbox work has finished. A final non-retried failure writes completion,
admission and recovery candidate in one outer transaction. Retry, plain and success paths
keep their boundaries, and no transaction is held while the sandbox runs or across an
await. SandboxService.accepting_observation gains an opt-in defer_rejection keyword
(default unchanged).
Clear message when only the reference step fails
Korean and English, that the research (in v2: its intermediate records) was saved, gives
the reason, and asks the user to check the saved result before sending the same question
again. data.research_saved is true. The notice appears only after the research commit is
proven readable for this project, thread and request; otherwise the previous error is
returned. Error codes, reason_code and the recorded exception type are unchanged.
Current revision under clock changes
system clock had moved back lost to an older one (18 of 19 checked tables). All affected
writers append rows, so the current revision is now the last stored one: plan executions
and outcome series by their revision number then rowid, control records by version then
rowid (read and latest list), and the other tables by rowid. Schema, writers, canonical
heads and history lists are unchanged; the thread checkpoint list keeps its display order
while pause/resume guards use the real latest checkpoint. Two control-record revisions
with the same version can still be written concurrently; the choice is now deterministic.
Verification: full suite on the exact tree - Python 5503 tests (0 failures, 0 errors,
2 skipped), web tests, lint, typecheck and build, ruff, architecture and module budget
checks, and the README quick-start smoke test all pass.