WIP: Fix one-text block identity ownership and recovery #743

Closed
kayg wants to merge 2 commits from proto/block-identity-v7b into dev
Owner

Empty linked blocks could lose their owner after composed split/join edits. Fence edits lost block-map boundaries, and concurrent edits could become unreachable in history. This change anchors empty rows to separators, preserves format maps through native edits, and retains causal history ranges without storing per-block text copies.

Split and join remain separator edits in one Yrs text per note. The format module owns metadata patches, offsets and saved map checksums. Cached typing does not materialize or hash the note. Native Undo actions are isolated so an ineffective action cannot consume earlier typing. Transaction deletion intentions are distinct from tombstones merely received on pull.

Validation passes: workspace formatting; workspace clippy over all targets with -D warnings; workspace tests, including the older 1,000-seed stress target; 41/41 independent probes; 16 supplemental checks; and verify3 at 200,000 seeds split evenly between three and five devices, with zero failing seeds and 6,651,414 admission checks. The independent oracle, scenarios, invariants, existing probes and stress test are unchanged.

This supersedes draft #741 because this forge ignores pushes to an open PR branch. Head: 2c3083949d. No merge or deployment was performed. The prototype remains isolated from the app; UI integration and Home-scale latency measurements are outside these gates. Server admission still clones the document and refreshes broad indexes.

Gate evidence is on issue #671: #671 (comment), #671 (comment), #671 (comment), #671 (comment), #671 (comment), #671 (comment), #671 (comment), #671 (comment), #671 (comment), #671 (comment).

Related issue: #671.

Empty linked blocks could lose their owner after composed split/join edits. Fence edits lost block-map boundaries, and concurrent edits could become unreachable in history. This change anchors empty rows to separators, preserves format maps through native edits, and retains causal history ranges without storing per-block text copies. Split and join remain separator edits in one Yrs text per note. The format module owns metadata patches, offsets and saved map checksums. Cached typing does not materialize or hash the note. Native Undo actions are isolated so an ineffective action cannot consume earlier typing. Transaction deletion intentions are distinct from tombstones merely received on pull. Validation passes: workspace formatting; workspace clippy over all targets with -D warnings; workspace tests, including the older 1,000-seed stress target; 41/41 independent probes; 16 supplemental checks; and verify3 at 200,000 seeds split evenly between three and five devices, with zero failing seeds and 6,651,414 admission checks. The independent oracle, scenarios, invariants, existing probes and stress test are unchanged. This supersedes draft #741 because this forge ignores pushes to an open PR branch. Head: 2c3083949d6d28a1d633479e4408c8f60b3aeb4c. No merge or deployment was performed. The prototype remains isolated from the app; UI integration and Home-scale latency measurements are outside these gates. Server admission still clones the document and refreshes broad indexes. Gate evidence is on issue #671: https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68173, https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68174, https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68175, https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68176, https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68177, https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68178, https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68179, https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68180, https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68181, https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68182. Related issue: #671.
Prototype block IDs in one shared text per note
Some checks failed
CI / server (pull_request) Successful in 1m0s
CI / rust (pull_request) Failing after 6m26s
CI / web (pull_request) Has been cancelled
c7d5a6cdc5
Fix native block ownership and recoverable history
Some checks failed
CI / server (pull_request) Successful in 1m14s
CI / rust (pull_request) Successful in 20m49s
CI / web (pull_request) Has been cancelled
2c3083949d
kayg changed title from Fix one-text block identity ownership and recovery to WIP: Fix one-text block identity ownership and recovery 2026-10-28 19:52:01 +00:00
Author
Owner

Independent verdict: UNSOUND at 2c3083949d.

The fresh harness completed 300,000 seeded runs with 3, 5 and 8 devices. 249,495 passed and 50,505 failed: 31,755 text or identity property failures, plus 18,750 B4 whole-file duplicate imports refused instead of quietly rekeyed. Refused imports are reported separately from observed corruption.

All four minimal corruption regressions fail:

  • Fence split exposes a marker as code and saves another marker (seed 1; split/remote edit/Undo also fails at seed 8).
  • Table split strands marker syntax as human source (seed 17); some split parts also get the wrong range (seed 305).
  • An accepted outside edit changing a marker to ^id! silently exports only ! (seed 11).
  • Joining a table to an empty block makes the table link absorb the following TAIL block (seed 18).

The separate server decision oracle passes 2,000 sequences and 45,000 admissions. Eight additional contracts and the 29 existing v7/authority tests pass. The new generator and oracle were written independently; no verify3 scenario, generator or oracle source was opened or reused.

The p95 gate remains BLOCKED: the required perf host cannot be resolved and the configured VPN is stopped/NeedsLogin. No local perf substitute ran. The ignored 10,000-line benchmark is included for the required host under perf-lock. Production UI and browser integration remain outside the isolated prototype's coverage.

Full report, device counts, minimal reproductions and verbatim gate output.

Harness pushed to test/ids-verify4, head a314fc5179. Only test code is committed; findings and logs are in issue comments and the local job folder.

campaign_exit=101
regressions_exit=101
baseline_exit=0
contracts_exit=0
perf=BLOCKED: required host unresolved and Tailscale NeedsLogin
Independent verdict: UNSOUND at 2c3083949d6d28a1d633479e4408c8f60b3aeb4c. The fresh harness completed 300,000 seeded runs with 3, 5 and 8 devices. 249,495 passed and 50,505 failed: 31,755 text or identity property failures, plus 18,750 B4 whole-file duplicate imports refused instead of quietly rekeyed. Refused imports are reported separately from observed corruption. All four minimal corruption regressions fail: - Fence split exposes a marker as code and saves another marker (seed 1; split/remote edit/Undo also fails at seed 8). - Table split strands marker syntax as human source (seed 17); some split parts also get the wrong range (seed 305). - An accepted outside edit changing a marker to ^id! silently exports only ! (seed 11). - Joining a table to an empty block makes the table link absorb the following TAIL block (seed 18). The separate server decision oracle passes 2,000 sequences and 45,000 admissions. Eight additional contracts and the 29 existing v7/authority tests pass. The new generator and oracle were written independently; no verify3 scenario, generator or oracle source was opened or reused. The p95 gate remains BLOCKED: the required perf host cannot be resolved and the configured VPN is stopped/NeedsLogin. No local perf substitute ran. The ignored 10,000-line benchmark is included for the required host under perf-lock. Production UI and browser integration remain outside the isolated prototype's coverage. [Full report, device counts, minimal reproductions and verbatim gate output](https://git.kayg.org/kayg/calternal/issues/671#issuecomment-68241). Harness pushed to [test/ids-verify4](https://git.kayg.org/kayg/calternal/src/branch/test/ids-verify4/crates/block-ids/tests/verify4.rs), head a314fc5179320035d2c4417829b5d7644c03020a. Only test code is committed; findings and logs are in issue comments and the local job folder. ```text campaign_exit=101 regressions_exit=101 baseline_exit=0 contracts_exit=0 perf=BLOCKED: required host unresolved and Tailscale NeedsLogin ```
Author
Owner

Closing: superseded by #745, then #758 (named in the PR body or comments). Branch kept.

Closing: superseded by #745, then #758 (named in the PR body or comments). Branch kept.
kayg closed this pull request 2026-11-04 13:04:34 +00:00
Some checks failed
CI / server (pull_request) Successful in 1m14s
CI / rust (pull_request) Successful in 20m49s
CI / web (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!743
No description provided.