fix(runtime-host): recover legacy Root source messages - #3923
Conversation
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Generated-by: Codex
Astro-Han
left a comment
There was a problem hiding this comment.
I reviewed this head and found blocking issues.
[P1] Recovered legacy input appended out-of-order
Missing legacy source inserted at MAX+1 regardless of its original Turn/time; forms [old outputs..., recovered user input] and corrupts catalog preview with stale text + new timestamp.
Fix: recover in original Turn/time order or use non-linear compatible representation with regression for non-empty transcript.
[P1] Two legacy crash cuts still crash Host startup
Missing Root-source transcript with run===undefined or non-terminal Run still throws does not match queue source before nonterminal recovery can run — Host fails despite recoverable receipt.
Fix: allow proof-owned source to materialize fail-closed during later recovery; add crash-cut tests.
Hosted test/windows_recovery: SUCCESS, but code is NO-GO.
简体中文
历史恢复时序与启动崩溃问题。Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.
Generated-by: Codex
|
Implemented the review remediation in c073644. Changes:
Verification:
No design or plan documents are included. Please re-review the updated changes. |
Summary
message_admissionsRoot cause
#3721 made message-admission proof mandatory during handoff. Older terminal Root admissions can still own source messages but have no corresponding
message_admissionsrow, so startup recovery failed withMessage admission does not existbefore the Host became ready.Verification
npm --workspace @maka/storage run test: 970 passed, 16 skipped--test-concurrency=1: 1242 passed, 9 skippednpm run rebuild: passednpm run typecheck: passednpm run lint: passednpm run check:stale: passedThe default parallel Runtime Host invocation exposed an unrelated shared control-cache cleanup race (
ENOTEMPTY/ENOENT) on two runs; the failing Host-kernel case passed in isolation, the serial full suite passed, and all #3902 recovery tests passed in every run.A production Desktop/Host run against an adopted workspace copy reached ready and materialized both legacy messages exactly once with clean SQLite integrity. The real workspace was intentionally not started because one active durable Goal would auto-resume external work.
Closes #3902