Repository navigation
fix(store): review follow-ups to #751 project-record repair - #755
Merged
Merged
Conversation
Review of #751 (merged as fae5488) found these; each is fixed here. - project doctor: a SQLite project's record must be complete only where this process runs the Store's calls. A worker's Sandboxes read the entry that worker keeps, so a host stub there is not a project.record fault. A failed project.record no longer skips project.listed or the --full project.data walk. - sandbox.create: the repair is decided by the record (no manifest, no installed, or bytes that do not decode), not by one refusal message, and is best effort: a repair that fails or cannot complete the record leaves the call's own refusal as it was. The repaired record is decoded in hand (discovery::project_of) instead of reading the entry again. - store.move: a record the record phase leaves incomplete is a line of log/repair.jsonl (call, store, project, why) instead of a silent drop. - project.init on a worker: a manifest/installed pair that is not a complete Disposable pair (restored::complete) is left out and logged in log/repair.jsonl, for a move or Sandbox create to complete. - restore and record repair share one Store scan, restored::found_in. Tests: doctor_targets checks project.listed still runs after a project.record failure; project_family checks store.move logs a record it cannot rebuild; installed_repair removes a Sandbox it did start instead of requiring create to fail; restored_records follows repair_project's new return (the written record). No tests deleted. Ran (TMPDIR=/tmp, 120 s limit each): restored_records 7, installed_repair 1, doctor_targets 7, project_family 7, backup_family 5, project_doctor_full 3, project_init_worker 7, store_family 5 (1 ignored), store_transfer_crash 6, layerfs-control doctor 12, project_delete_worker 14, store_transfer_recovery 4, restore_install 3: all pass. fmt, Clippy (-D warnings) on layerfs-store/-sandbox/-control/-api and the product boundary guard pass. Not run: a doctor of a project whose Store is on a ready worker machine (needs a running VM), a restore from a bucket. Docs: doctor, home, sandboxes, projects, sqlite-and-postgresql. Durable: NOT_RUN — disabled by owner until explicit reauthorization. Production LOC: 206,108 -> 206,163 (delta +55) core 40,988 -> 40,988 (0) engine 95,845 -> 95,845 (0) control 58,950 -> 59,005 (+55) layerfs-store +48, layerfs-control +8, layerfs-sandbox -1 api 10,325 -> 10,325 (0) reference absent (retired R9c; last counted 65,417 at tree 498dd19) Method: tools/production_loc.py --detail on parent fae5488 and the staged tree Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
yifanxuaaa
added a commit
that referenced
this pull request
Nov 22, 2026
…rol-plane fixes) Brings in the six origin commits (#751, #754, #755 and the store.move manifest repairs) beside the local LF14 commit 712f4d0. Production LOC: 205907 -> 206226 (delta +319); first-parent comparison (parent 712f4d0 vs the merged tree), counted with tools/production_loc.py --root on git archive extracts of both snapshots; control scope 58808 -> 59068 (delta +260). Reference absent (retired R9c; last counted 65,417 at tree 498dd19). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Tier: P1 (control/crates/layerfs-store) ; risks: risk:store ; gate: yes: risk:store ; de-escalated: none
Follow-up to #751 (merged as
fae5488566); refs #749.Reason
Review of #751 found these problems in its project-record repair:
project doctorfailedproject.recordfor SQLite projects whose Store is still on its worker. Those projects work: the worker's Sandboxes read the entry the worker keeps (route::in_workermerges the host record into it and keeps its manifest).project.recordskippedproject.listedand the--fulldata walk, so an incomplete record hid every other problem with the project.sandbox.create, any repair error (Unsupportedfrom the kernel guard,Unavailablefrom the diagnostic open, home-lock expiry) replaced the originalNoSuchProjectrefusal.sandbox.createrepaired only when the refusal had one exact message, so a record with noinstalled, or with manifest bytes that do not decode, was never repaired. After a repair it also read the project a second time.store.movedropped every repair result (let _ =): a record it could not rebuild left no trace before the worker's copy was retired.init_on_workersilently kept the stub when the worker's manifests did not decode, and accepted a non-Disposable pair.projects_in_diagnostic.What changed
doctor/project_target.rs): a complete record is required only when the Store's calls run in this process (place::on_machine_readgivesLocal).project.listedandproject.datarun whateverproject.recordfinds.layerfs-sandbox/src/lifecycle.rs): repair is attempted when the record has noinstalled, or the refusal isNoSuchProjectorFailed.repair_projectre-checks the record withrestored::complete. The repair is best effort: if it fails or does not complete the record, the call's own refusal is returned. The record it writes is decoded in hand by the newdiscovery::project_of, with no second read.sqlite/transfer/phases.rs):complete_existingnow returns each record it left incomplete, with why. Each one is a line oflog/repair.jsonl, and the move still finishes.project/family.rs): the worker's pair is kept only whenrestored::completeaccepts it. Otherwise it is left out and logged inlog/repair.jsonl, and an older worker that sends none is still accepted.backup/restored.rs,backup/restore.rs):restored::found_in(&dyn HistoryCatalog)is the one project/mainlisting for both restore and repair.repairlog), sandboxes, projects, sqlite-and-postgresql.Tests
doctor_targets:project.listedstill runs after aproject.recordfailure.project_family:store.movelogs a record of a stack the Store does not hold inlog/repair.jsonl, and does not log a repaired one.installed_repair: no longer requiressandbox createto fail; a Sandbox it does start is removed.restored_records: followsrepair_project's new return (the written record).Verification (macOS, Apple Silicon,
b07327ba1f)Built with
--no-runfirst, then each binary run underTMPDIR=/tmpwith a 120 s limit. All passed:restored_recordsinstalled_repairdoctor_targetsproject_familybackup_familyproject_doctor_fullproject_init_workerstore_familystore_transfer_crashlayerfs-controldoctorproject_delete_workerstore_transfer_recoveryrestore_installcargo +1.85.1 clippy --locked --all-targets -p layerfs-store -p layerfs-sandbox -p layerfs-control -p layerfs-api -- -D warnings: pass.cargo +1.85.1 fmt --all -- --check: clean for this change.api/crates/layerfs-cli/tests/rendering.rsalready fails it on the base and is left alone.python3 -B tools/check_product_boundary.py: PASS.found_in.NOT_RUN— disabled by owner until explicit reauthorization.Production LOC
Production LOC: 206,108 -> 206,163 (delta +55)Reference absent (retired R9c; last counted 65,417 at tree 498dd1917812). Method:
tools/production_loc.py --detailon parentfae5488566and the staged tree.🤖 Generated with Claude Code