Repository navigation
R06: persist constructor task templates across restart - #265
Conversation
Oleksii-debug
left a comment
There was a problem hiding this comment.
INDEPENDENT DIFFERENT-WORKER EXACT-HEAD PERSISTENCE/RECOVERY REVIEW — 7a22c7fe5420734fc06112b70d7126aac23628fe
Reviewed the complete current-package delta and the pre-existing authoring persistence/recovery contracts it composes with.
Containment:
- exact packaged base is
fa587e6c287097d859eeb550d0901d1fd90d8c72; - candidate is AHEAD 8 / BEHIND 0 with exact package merge-base;
- lasting delta is exactly the six declared workflow/service/recovery/regression paths; no canonical Scripture/source/evidence/campaign bytes change.
Template persistence:
_new_draft_record()is construction-only and performs no store write;- ordinary
new_draft()still performs one blank-draft write with revision 1; new_node_from_task_type()validates task type before allocating/persisting a draft, then appliestask_typeandresponse_modebefore its single durable write;- invalid task types therefore cannot leave a durable blank draft.
Fork recovery:
- the override preserves the historical observable fork contract: revision 2,
save_draftchange record, stablebase_identity, and undo containing the initial blank revision; - no blank draft is written before recovery authority exists;
_commit_mutation()writes the complete transaction intent first, then history/snapshots, and draft last; the transaction is deleted only after every component succeeds;- startup replays a surviving transaction idempotently before service use, so simulated failure after intent/history/draft writes converges to the same populated fork;
- identity protection remains enforced both before transaction publication and during transaction validation/replay.
Qualification wiring:
- Constructor V2 Direct Qualification watches all three new regressions, compiles them, and runs each on Ubuntu + Windows;
- the workflow explicitly checks out and asserts the literal PR head before composing the overlay;
- existing lifecycle, crash-recovery, authoring transport, frontend syntax and diff-hygiene gates remain present.
No blocking static defect found. Hosted qualification remains required and this review does not substitute for terminal execution evidence or physical Windows/HUMAN_NVDA acceptance.
DIFFERENT_WORKER_EXACT_HEAD_REVIEW=PASS
CANONICAL_CONTENT_MUTATION=NONE
READY_FOR_INTEGRATION=NO pending terminal exact-head hosted qualification.
Oleksii-debug
left a comment
There was a problem hiding this comment.
INDEPENDENT DIFFERENT-WORKER EXACT-HEAD RE-REVIEW — c36b6880084c89b03d753676cfa7e234c8383abe
This supersedes my review on 7a22c7fe...; the branch advanced by two commits touching only recoverable.py and the fork-recovery regression.
Changed-head delta closes an observable temporal-parity gap in the first fork rewrite:
_new_draft_record()still captures the creation clock for the synthetic blank revision;fork_record()now captures a distinct save-phasenowand explicitly setsupdated_at=now, while preservingcreated_atfrom the blank revision;- the save change-record timestamp uses the same save-phase
now; - revision 2, stable base identity, undo(blank), transaction-first ordering and draft-last replay semantics remain unchanged.
The new deterministic regression drives two clock ticks and proves the historical new_draft() → save_draft() observable timing contract exactly: creation at the first tick, update/change-record at the second tick. Crash-boundary coverage remains intact for failures after intent/history/draft writes.
Current exact-head semantics therefore preserve both restart atomicity and the pre-existing revision/timestamp/history contract. No canonical content/source/evidence mutation is introduced.
DIFFERENT_WORKER_EXACT_HEAD_REVIEW=PASS
TEMPORAL_CONTRACT_PARITY=PASS
READY_FOR_INTEGRATION=NO pending terminal literal-head hosted qualification.
4a1202e
into
r06-compose-packaged-app-update-verify-0911
…-v2-direct-qualification.yml
…re_archive_platform/authoring/recoverable.py
…re_archive_platform/authoring/service.py
…est_constructor_fork_recovery.py
…est_constructor_template_persistence.py
…est_constructor_template_transport_restart.py
Scope
Release-critical Constructor persistence/recovery repair against the exact current packaged authority. No canonical Scripture/source/evidence/campaign bytes are changed.
Exact live lineage
r06-compose-packaged-app-update-verify-0911@fa587e6c287097d859eeb550d0901d1fd90d8c72;r06-constructor-template-restart-persistence-0929-sol@c36b6880084c89b03d753676cfa7e234c8383abe;BEHIND 0;.github/workflows/r06-constructor-v2-direct-qualification.yml;lanes/dev1/repair_overlay/scripture_archive_platform/authoring/service.py;lanes/dev1/repair_overlay/scripture_archive_platform/authoring/recoverable.py;lanes/dev1/repair_overlay/tests/test_constructor_template_persistence.py;lanes/dev1/repair_overlay/tests/test_constructor_template_transport_restart.py;lanes/dev1/repair_overlay/tests/test_constructor_fork_recovery.py.The package advanced during implementation through #260 exact-head qualification repair. Candidate was mechanically reconverged with the new package tree as authority; no overlapping product file was replayed.
Defect 1 — task template silently disappears after restart
AuthoringService.new_node_from_task_type()callednew_draft(), which immediately persisted a blank node draft, then addedtask_typeandresponse_modeonly to the returned in-memory copy. The response therefore looked correct to the Constructor UI, but a store reload or application restart restored the earlier blank draft and silently lost the selected task template.Repair:
_new_draft_record()constructor that builds a complete draft record without persistence;new_draft()still persists its ordinary blank draft once with unchanged revision/status semantics;new_node_from_task_type()validates first, builds in memory, appliestask_type+response_mode, and only then performs its single durable write;Defect 2 — canonical fork exposes a crash window with durable blank state
The packaged application uses
RecoverableAuthoringService, but inheritedfork_record()first callednew_draft()(durable blank draft) and only afterwards entered recoverablesave_draft(). A process death between those phases leaves a blank draft after restart with no write-ahead intent capable of completing the canonical fork.Repair:
RecoverableAuthoringService.fork_record()now constructs blank + populated fork state in memory;revision == 2, stablebase_identity, blank undo entry, and the historical two-step timestamps (created_atfrom creation;updated_at/change record from save);Regression coverage
Focused tests prove:
SINGLE_CHOICEtemplate semantics survive direct store reload and freshAuthoringService/RecoverableAuthoringServiceinstances;authoring.new_node_from_task_type→ fullPlatformApplicationrestart →authoring.load_draftpreserves anORDERINGtemplate exactly;The existing Constructor V2 direct workflow is extended rather than replaced. It compiles and executes all three new regression modules on Ubuntu and Windows while retaining exact-head checkout/assertion and all existing lifecycle, crash-recovery, transport, frontend syntax and diff-hygiene gates. DEV1 CI independently discovers the full repair-overlay suite and runs its Windows release gate on literal PR head.
Qualification truth — frozen head
Current exact-head runs for
c36b6880084c89b03d753676cfa7e234c8383abeare created but still QUEUED, not PASS:36622720828;36622720788;36622720814;36622720856;36622720780(supplementary only because QA67 checks the PR merge ref rather than literal candidate head).No test failure is presently known. Physical Windows/WebView2/HUMAN_NVDA and source/theological final acceptance remain separate gates.
CONSTRUCTOR_TEMPLATE_RESTART_PERSISTENCE=IMPLEMENTEDCONSTRUCTOR_FORK_WRITE_AHEAD_RECOVERY=IMPLEMENTEDCANONICAL_CONTENT_MUTATION=NONEDIRECT_PACKAGE_CONTAINMENT=PASSREADY_FOR_INTEGRATION=NOpending terminal exact-head hosted qualification and fresh changed-head review.