Repository navigation
fix(pi-004): reserve pending deletion and uncommitted page IDs (draft) - #25
Draft
jamespatrickjackson-lang wants to merge 10 commits into
Draft
jamespatrickjackson-lang wants to merge 10 commits into
jamespatrickjackson-lang wants to merge 10 commits into
Conversation
This was referenced Nov 14, 2026
…story and delete safety
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PI-004 final source package: permanent page identities (DRAFT, no merge)
Approved owner invariant: presentation page IDs are permanent identities, not recyclable ordinals. This PR extends the original two collision fixes to cover deletion/archive/Save/reload while preserving existing legacy page files, archived records, scientific layer ownership and real project data.
Verified baseline:
main a8df8211db350b195c89cedcfc39192c48382cb8. Final head:122fd0f3a6608d741582cf421a2d360a7f25de9b. The PR remains a separate, draft, unmerged implementation of Issue #23.Backward-compatible identity decision
NN_pageIDs and filename layouts are left unchanged.p_<uuid>namespace; retries reject collisions against live/archived IDs, pending tombstones, same-session issued IDs and the persisted identity ledger.ProjectManifest.issuedPageIds?: string[]tosrc/pages/types.ts; every new page/Sub Master creation records its ID in the reducer's project manifest, including if later deleted. Manual Save serializes it withproject.json, allowing Save/reopen to reject previously issued IDs. Legacy projects without this field load normally.deletePageByIdrejects unknown/stale IDs. FaileddeleteFilenow surfaces as a Save error and preserves pending tombstones. Existing historical archive files are checked before any writes; a differingpages/_archive/{id}.jsoncauses a fail-closed conflict, never an overwrite. Identical archive bytes are left untouched.Strict edge: A page ID generated immediately before an unsaved browser crash has no durable ledger entry. Cryptographic UUIDv4 provides practical non-reuse, not a formal zero-probability guarantee across unsaved sessions. A formal guarantee would require an atomic durable issuance journal / asynchronous interface redesign, which was not introduced under this scope.
Exact changed files
src/editor/EditorContext.tsx,src/pages/types.ts,tests/tools/page-id-reservations.test.mjs,tests/tools/permanent-page-identity.test.mjs. Noprojects/, authored example page, scientific assets, raw data, source files, or provenance files changed.RED/GREEN receipts
3fc194e8e1a3774a2435de433c03d4301a28981f, Actions #43636928052: 679 PASS/2 expected PI-004 FAIL; build PASS.2e52de5aa7c1911ad8a6a5838ab71572664a1ccc, Actions #43646995108 expected FAIL; implemented afterward.a026a55168c2007fd10df448964470d2d81e5006, Actions #43648074660 expected FAIL; source guard implemented afterward.The synthetic scratch-disk test creates an isolated temporary project.json, immutable legacy archive and synthetic data file; reloads JSON and checks an attempted ID collision; verifies protected source/archive bytes unchanged; cleans up its own scratch directory. This is not the real development writer or mounted browser Save/reopen.
Integration and outstanding holds
Disposition: source and scratch-serialization candidate for independent owner review; not production-persistence acceptance.