Skip to content

Journal promotions for crash recovery; surface rejected saves and sync playground tabs - #908

Merged
ktjn merged 5 commits into
mainfrom
fix/persistence-stale-save-handling
Nov 5, 2026
Merged

ktjn merged 5 commits into
mainfrom
fix/persistence-stale-save-handling

Conversation

@ktjn

@ktjn ktjn commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Playground persistence: a 'stale' save result no longer shows as saved (hook enters memory-only); tabs announce saved revisions over a BroadcastChannel — clean tabs adopt a newer revision, tabs with unsaved edits go memory-only.
  • Crash recovery: FileTransaction writes an fsync'd journal (.modelable/locks/compilation.journal) before replacing files and removes it at the commit point. The next lock holder rolls back a leftover journal; an unreadable journal blocks compilation. Direct compilation calls recover() before staging so it never builds output from a half-promoted workspace.
  • Formal model: CompilationProtocol.tla models the journal and recovery. All four configs pass (194/300/422/574 states). A model without the pre-staging recovery failed B and C, and a mutant removing it fails again.
  • Spec: Level 2 evidence re-run at 68d8cf8c, whole-product.yaml pins refreshed (LF blob hashes), MOD-PROD-11 model-check evidence now passing (status left specified).
  • Test fix: test_release_workflow.py still expected setup-uv@v10.3.2 after chore(deps): bump astral-sh/setup-uv from 10.3.2 to 10.3.3 in the actions group #906; it failed the full suite and the pre-push gate.

Verification

  • ruff, mypy ratchet, full pytest pass; web unit tests pass; local pre-push gate (browser e2e, release preflight, FHIR, etc.) passed on the pushed commit.
  • whole-product.yaml verifies in an LF export; on CRLF Windows checkouts the source pins mismatch (same as compilation.yaml).

Not covered

  • Crash during preparation or during recovery is not modeled or recovered (stray .modelable-* files possible, nothing replaced).
  • compilation.yaml pins are stale (not touched). VS Code extension tests and manual WebLLM chat conformance not run.
  • Dirty tabs only warn; no merge/take-theirs UI.

🤖 Generated with Claude Code

ktjn and others added 5 commits November 5, 2026 07:20
A stale save result was shown as saved; the hook now enters memory-only.
Tabs announce saved revisions over a BroadcastChannel: clean tabs adopt a
newer revision, tabs with unsaved edits are marked memory-only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
FileTransaction writes a fsync'd journal before replacing files and removes
it at the commit point; the next lock holder rolls back a leftover journal.
Direct compilation recovers before staging so it never builds output from a
half-promoted workspace. Changelog also covers the web persistence changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…idence

The updated CompilationProtocol model passes all four configs once direct
compilation recovers before staging; a mutant without that recovery fails.
Level 2 evidence re-run at 68d8cf8 and pins refreshed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Matches compilation.yaml; CRLF working copies on Windows will not verify.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The dependabot bump to v10.3.3 updated every workflow but left this
assertion on v10.3.2, so the full suite and the pre-push gate failed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ktjn
ktjn merged commit cdab2da into main Nov 5, 2026
1 check passed
@ktjn
ktjn deleted the fix/persistence-stale-save-handling branch November 5, 2026 09:25
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