Skip to content

Foundry's Prism kernel decides which device's copy of the visitor's work wins (FA-94) - #240

Open
humuhumu33 wants to merge 4 commits into
mainfrom
workspace-sync
Open

humuhumu33 wants to merge 4 commits into
mainfrom
workspace-sync

Conversation

@humuhumu33

Copy link
Copy Markdown
Contributor

Why

Two devices of one Prism ID each keep the visitor's work. When they meet, each must decide, for everything the other sends, whether to take it or keep its own, and both must end with the same copy. That decision is the kernel's, proved.

What changes (app/src/Workspace.lex.tex)

A sixth kind of workspace request, 5, merge a record another device sent. It takes 14 words (122 bytes, inside the 128-byte wire).

  • Facts:
    • the workspace is open;
    • the place syncs;
    • the sealed bytes are authentic and in their place;
    • the record fits;
    • this device holds the place;
    • the sent record is a deletion;
    • both times as high and low 32-bit words;
    • whether the sender wins a tie.
  • Answers: take for a newer copy, an absent place, or a tie the sender wins; keep otherwise.
  • Refusals, by name: a closed workspace; a device-local place (recordLocalOnly, new); an unauthentic or misplaced record; a copy over quota, unless it's a deletion.

Evidence

  • Three theorems in WorkspaceProofs:
    • mergeNeverTakesOlderHolds;
    • mergeConvergesHolds: two devices exchanging one place never both take, whatever else holds;
    • mergeTakesOnlyWhatMayEnterHolds.
  • Thirteen workspaceWords_merge words proved by evaluation, each an acceptance vector.
  • private_workspace_fa_94 holds the arm, the theorems, and the words to the vectors one for one. It failed before the model and passes after. private_workspace_fa_91 still holds all 32 workspace words to their vectors.
  • Count: application_main_integration now counts 368 vectors.

Lean runs in this PR's CI (just app). Locally, the SDK image was still downloading.

Next

Once this merges, the kernel pin workflow builds the guest. Studio's sync (FA-95, stacked on #238) asks it.

🤖 Generated with Claude Code

humuhumu33 and others added 4 commits November 16, 2026 21:29
…ork wins (FA-94)

A sixth kind of workspace request, merge a record another device of the visitor's
Prism ID sent: the newer copy is taken, a place this device does not hold is taken,
and a tie goes to the sender only when it wins the tie, so two devices never both
take and converge on one copy. A device-local place, an unauthentic or misplaced
record, a closed workspace, and a copy over quota unless it is a deletion are refused
by name.

Three theorems (never older, converges, only what may enter) and thirteen merge words,
each an acceptance vector the guest replays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ind the repository root in one line

The doubled parentheses around the older-copy comparison did not parse
(LLP2001 at WorkspaceProofs.lex.tex:283). Eight conformance tests now take the
repository root as CARGO_MANIFEST_DIR/../.., so the counted lines shrink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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