Skip to content

R06: persist constructor task templates across restart - #265

Merged
Oleksii-debug merged 10 commits into
r06-compose-packaged-app-update-verify-0911from
r06-constructor-template-restart-persistence-0929-sol
Sep 29, 2026
Merged

Oleksii-debug merged 10 commits into
r06-compose-packaged-app-update-verify-0911from
r06-constructor-template-restart-persistence-0929-sol

Conversation

@Oleksii-debug

@Oleksii-debug Oleksii-debug commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

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

  • packaged base: r06-compose-packaged-app-update-verify-0911@fa587e6c287097d859eeb550d0901d1fd90d8c72;
  • frozen candidate: r06-constructor-template-restart-persistence-0929-sol@c36b6880084c89b03d753676cfa7e234c8383abe;
  • current package is exact merge-base; candidate is BEHIND 0;
  • lasting package→candidate delta is exactly six paths:
    • .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() called new_draft(), which immediately persisted a blank node draft, then added task_type and response_mode only 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:

  • introduce one internal _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, applies task_type + response_mode, and only then performs its single durable write;
  • unknown task types still fail before any draft write.

Defect 2 — canonical fork exposes a crash window with durable blank state

The packaged application uses RecoverableAuthoringService, but inherited fork_record() first called new_draft() (durable blank draft) and only afterwards entered recoverable save_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;
  • preserves existing observable semantics: revision == 2, stable base_identity, blank undo entry, and the historical two-step timestamps (created_at from creation; updated_at/change record from save);
  • commits history + populated draft through the existing write-ahead transaction before any draft component write;
  • no second architecture and no weakening of identity protection.

Regression coverage

Focused tests prove:

  • SINGLE_CHOICE template semantics survive direct store reload and fresh AuthoringService / RecoverableAuthoringService instances;
  • revision/status/change-record creation semantics stay stable;
  • invalid task types create no durable draft;
  • real transport authoring.new_node_from_task_type → full PlatformApplication restart → authoring.load_draft preserves an ORDERING template exactly;
  • canonical fork recovery succeeds after simulated process death immediately after transaction intent, history, or draft writes;
  • when crash occurs immediately after intent, no blank draft has been written;
  • restart drains the pending transaction, restores full fork, keeps stable identity/revision/undo state;
  • advancing-clock regression locks original fork timestamp behavior.

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 c36b6880084c89b03d753676cfa7e234c8383abe are created but still QUEUED, not PASS:

  • DEV10 36622720828;
  • Constructor V2 Direct 36622720788;
  • DEV1 36622720814;
  • Library/Search 36622720856;
  • QA67 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=IMPLEMENTED
CONSTRUCTOR_FORK_WRITE_AHEAD_RECOVERY=IMPLEMENTED
CANONICAL_CONTENT_MUTATION=NONE
DIRECT_PACKAGE_CONTAINMENT=PASS
READY_FOR_INTEGRATION=NO pending terminal exact-head hosted qualification and fresh changed-head review.

@Oleksii-debug Oleksii-debug left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 applies task_type and response_mode before 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_draft change record, stable base_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 Oleksii-debug left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-phase now and explicitly sets updated_at=now, while preserving created_at from 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.

@Oleksii-debug
Oleksii-debug merged commit 4a1202e into r06-compose-packaged-app-update-verify-0911 Sep 29, 2026
10 checks passed
Oleksii-debug added a commit that referenced this pull request Sep 29, 2026
Oleksii-debug added a commit that referenced this pull request Sep 29, 2026
…re_archive_platform/authoring/recoverable.py
Oleksii-debug added a commit that referenced this pull request Sep 29, 2026
…re_archive_platform/authoring/service.py
Oleksii-debug added a commit that referenced this pull request Sep 29, 2026
Oleksii-debug added a commit that referenced this pull request Sep 29, 2026
…est_constructor_template_persistence.py
Oleksii-debug added a commit that referenced this pull request Sep 29, 2026
…est_constructor_template_transport_restart.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant