Plan: private staging redesign (#759b) #771
Open
opened 2026-10-30 06:38:11 +00:00 by kayg
·
8 comments
No Branch/Tag specified
main
port/tasks-float-2
fix/train-1116-2
fix/train-1116-3
fix/train-1116-1
fix/flake-1134
fix/server-1182
dev
port/notes-float-3c
docs/auto-update-ig
feat/dav-transport
port/tasks-float-1
wip/mail1011-sv-order-1116
fix/flake-1179
fix/flake-1178
fix/guards-1153-fsio-split
fix/guards-1153-notes-split-we
fix/guards-1153-notes-lib
fix/guards-1153-notes-home
fix/guards-1153-ui-primitives
fix/guards-1153-primitives-e2e
fix/guards-1153-visibility-doc
feat/paper-grey-1116
fix/flake-1165
fix/flake-1119
docs/imap-766-plan-v2
fix/e2e-unique-ports
t3/paged-search-reconcile-final
wip/mail1011-final-1115
docs/tasks-float-port
perf/editor-first-paint-1c
feat/imap-notes-fetch
feat/imap-notes-projection
feat/imap-notes-readonly
feat/imap-notes-auth
feat/imap-notes-server-foundation
wip/mail1011-txn-ownvocab-1115
wip/mail1011-txn-novocab-1115
perf/p1117-final-harness
perf/single-shot-repeats
port/tasks-matrix
wip/mail1011-txn-1115
fix/static-gates-1155
feat/files-s1-identity-r7
fix/files-r7-idle-loop
fix/daily-train-1152
port/notes-float
fix/editor-tables-test-types
port/notes-float-listscript
feat/tasks-actions
port/notes-float-phone-preload
perf/sound-comparator
port/notes-float-listscroll
port/notes-float-budgets
port/notes-float-suite-fix-b
port/notes-float-sidebar-fix
port/notes-float-trim
port/notes-float-3-lists
fix/attachments-meta-capability
docs/carddav-writes-v2-plan
feat/contacts-companion-pure
issue/carddav-read-perf-fix-r2
issue/carddav-read-r2
port/notes-float-devsync2
review/calendar-2
review/switcher-a-pills
port/notes-float-switcher-a
port/port-tables-2
review/switcher-ends
wip/whiteboard-s1-1114
port/port-tables
wip/mail1011-perfneutral
review/photo-tint
port/notes-float-shell
wip/local/collections-db
wip/local/mail-p1
wip/local/cold-growth-on-tiering
wip/local/tiering-v3-s1
wip/local/wal1051-cap
wip/local/tiering-v3-s1-resume
wip/local/index-position-startup-scan
port/notes-float-flat
port/notes-float-promote
wip/handover/mail1011-candidate
wip/handover/files-s1-candidate
port/notes-float-shell-only
port/notes-float-perf
feat/whiteboard-s1
feat/tiering-v5
fix/app-switch-hitch
wip/local/files-s1-dev-v4-final
feat/files-s1-dev-v4
fix/c2-glass-shared
feat/flat-lists
wip/handover/whiteboard-s1-resume
wip/att-lazy-861
feat/switcher-browse
wip/att-lazy-860
feat/tasks-float
recovered/flat-backup-candidate
perf/stalls-1054-kc
land/ai-toolbar
feat/collections-db
feat/collections-db-fixes
codex/mail-1011-redesign-20261111
fix/ai-toolbar
backup/macos-vm/st3-head
perf/trim-candidate-phonestack
feat/switcher-three
fix/1051-index-idle-checkpoint
perf/stalls-1054-kb
perf/stalls-1054-k
perf/stalls-1054-r3
fix/c2-contrast-tail
perf/stalls-1054-r3-preview
feat/collections-before
feat/tiering-v4
fix/timelog-caret
wip/local/tasks-actions
docs/tasks-writes-v2-plan
st3-r3
feat/pass8
review/calendar-2-before-1111
wip/tiering-v3-cold4
perf/stalls-1054-r2
fix/suite-A4
fix/suite-A5-probe
fix/suite-A6
fix/suite-A3
fix/suite-A2
fix/suite-A5
fix/suite-A1
wip/local/attachments-861-fix
feat/contrast
wip/local/ports-861
storage/wal-checkpoint-off-save-1051
wip/local/mail-1011-reconcile-20261110
feat/style-sheet-fixes
feat/money-round
perf/stalls-1054
wip/tiering-v3-cold5
t3/mail-1011-liveness
feat/iphone-fixes
feat/notes-approve
wip/local/shrow-work
feat/files-s1-identity
feat/quickfix
wip/tiering-v3-cold
wip/local/shared-row-swipes
backup/macos-vm/pfx-B
backup/macos-vm/pfx-C
backup/macos-vm/pfx-D
feat/contrast-r1
feat/tiering-v3-s2-tags
feat/folder-drop
t3/photos-s1
feat/tiering-v3-s1-namespace
wip/local/photos-s1
t3/photos-plan-slice-one
recovered/backup/p1b-61505
t3/paged-search-reconcile
t3/smooth-pane-transitions
t3/index-position-startup-scan
fix/private-staging-759b-r2
backup/macos-vm/hk/hk1009/pr877
backup/macos-vm/hk/hk1009/pr878
docs/undo-block-ids-plan
fix/undo-768
backup/macos-vm/hk/hk1009/pr875
backup/macos-vm/hk/hk1009/pr904
proto/block-identity-v7d
backup/macos-vm/hk/hk1009/pr846
backup/macos-vm/hk/hk1009/pr860
backup/macos-vm/hk/hk1009/pr861
backup/macos-vm/hk/hk1009/pr849
backup/macos-vm/hk/hk1009/pr848
backup/macos-vm/hk/hk1009/pr853
backup/macos-vm/hk/hk1009/pr957
backup/macos-vm/hk/hk1009/pr893
backup/macos-vm/hk/hk1009/pr889
backup/macos-vm/hk/hk1009/pr902
docs/imap-notes-plan
docs/quota-plan-2
fix/parallel-test-flakes
docs/calendar-backend-v2-plan
feat/calendar-ical-converter
backup/macos-vm/hk/hk1009/pr808
docs/contacts-import-v2-plan
issue/610-pm-midnight
feat/calendar-v2-s1-containment
backup/macos-vm/hk/hk1009/pr854
backup/macos-vm/hk/hk1009/pr845
backup/macos-vm/hk/hk1009/pr917
docs/dav-recorder-v2-plan
plan/previews-865
plan/save-log-durable-entry
backup/macos-vm/hk/hk1009/pr934
fix/e2e-data-on-ram
backup/macos-vm/hk/hk1009/pr888
feat/appwindow3
feat/appwindow2
feat/appwindow
feat/money-p1
feat/keys-sheet
review/calendar-2-themes
feat/smooth-cursor
fix/float-style
review/calendar-2-float
release/2026-11-06-hotfix
archive/port/rows-drop-code
archive/port/rows-actions
archive/port/rows
scratch/tasks-894-ui-gates
review/calendar-2-night-wip
recovered/flaky/toast-reduced
release/2026-11-05
archive/flaky/rows-drop-fixed
archive/flaky/rows-actions
archive/flaky/rows
sim/bm15-final
sim/bm15-bis-932
sim/bm15-bis-909
sim/bm15
sim/bm15-bis-887
perf/tiering-option-b
fix/sw-lazy-precache
archive/plan/save-log-durable-entry
mock/money-fix2
archive/fix/e2e-data-on-ram
mock/appearance-all
mock/pill-press
mock/pill-press-mac
backup/macos-vm/appearance-after
mock/auto-swipes
mock/mail-actions
backup/macos-vm/mock/mail-actions
mock/money-static
archive/review/standards-917
perf/tiering-761-fix
mock/type-audit
mock/third-pane
feat/contacts-import-v2-s1
perf/executor-hot-path
archive/port/hidden-blocks
archive/port/devices
scratch/executor-on-894
scratch/executor-spans2
scratch/executor-spans
archive/port/rows-drop
feat/tiering-761-d-scale
feat/tiering-761-c-index
feat/tiering-761-b-reader
archive/review/sharing-pr3-review-9fec3d1f
perf/ports-lazy-budgets
feat/tiering-761-a-migration
archive/review/sharing-pr3-review
archive/review/sharing-pr3-review-code
archive/plan/previews-865
archive/port/port-attachments-3
archive/port/contacts-merge
fix/motion-audit-859
fix/motion-audit-859-mac
archive/port/port-pickers
archive/port/port-tables-2
archive/port/port-tables
recovered/local/sharing-s1-pr2-room-snapshot-candidate
archive/fix/parallel-test-flakes-code-minipc01
docs/imap-766-readonly-slice
feat/dav-recorder-v3
research/788-diagnosis
archive/fix/parallel-test-flakes
archive/perf/pr792-cold-index-edit
docs/sharing-slice-1
recovered/feat/dav-recorder-v2
recovered/feat/dav-recorder-v2-edd7bbb
spike/imap-766-s0-cases
archive/fix/undo-768
recovered/feat/dav-recorder
recovered/feat/dav-recorder-901acd4
feat/contacts-import
perf/cold-growth-on-764
perf/cold-growth-on-tiering
recovered/feat/tasks-set-status
feat/tasks-move-reorder
feat/tasks-delete-promote-duplicate
feat/carddav-writes
perf/quota-on-tiering
perf/quota-simple
perf/cold-growth-on-quota-stack
recovered/perf/cold-growth-on-tiering
feat/calendar-identity
feat/calendar-event-parser
feat/calendar-props-maps
port/glass-when-ring
recovered/feat/tiering-761-s1-wip-8132a84
recovered/feat/tiering-761-s1-wip-9da4094
recovered/feat/tiering-761-s1-wip-724512c
recovered/feat/tiering-761-s1-wip-66e667e
recovered/feat/tiering-761-s1
wip/6by32-01-tier-761-s1-pause-20261030
spike/imap-766-s0
wip/6by32-02-calternal-pause-20261030
wip/8by64-01-review-688-pause-20261030
wip/6by32-01-verify-744-pause-20261030
wip/6by32-01-verify-742-pause-20261030
fix/private-staging-759b
wip/6by32-01-review-748-pause-20261030
wip/6by32-01-review-733c-pause-20261030
wip/6by32-01-review-733b-pause-20261030
review/calendar-month
wip/local/bm15-trash
plan/759b-staging
review/767b-tests
review/preview-2026-10-29
docs/tiering-731-plan
wip/c6b02-review-733d
wip/c6b02-bm1-full-a
docs/deploy-plan
fix/storage-owner-liveness-642
fix/storage-fix-7
feat/tiering-731
wip/tiering-731-first-attempt
perf/idle-honest-2
fix/storage-private-tmp-642-dev
fix/storage-exact-file-quarantine-642
perf/one-flush-save
review/calendar-static
review/indexing-ring
review/when-field-2
proto/block-identity-2-review
proto/block-identity-review
review/when-field
issue/tasks-create-ids
issue/tasks-create
review/combined
review/task-polish
review/top-buttons
review/q1-q5
archive/integ325-293
archive/integ325-ci
issue/calendar-adr
archive/old/train/2026-10-23bk2
archive/old/train/2026-10-23bk
issue/469-mockup-9a
issue/smart-tasks-mockup
issue/469-menus
issue/652-signout-flake
issue/652-history-fix7
issue/652-history-fix6
archive/old/issue/spring-check-perf
issue/spring-check-perf
issue/659-rename-fast
archive/old/train/2026-10-21ar
issue/search-hardening-3
issue/652-history-fix5
issue/660-port-sheets-glass
issue/652-history-fix4
issue/652-history-fix3
issue/652-history-fix2
issue/652-history-flake
train/2026-10-21an
issue/settings-admin-port
issue/search-port
train/2026-10-20am
issue/storage-split-fix2
issue/storage-split
archive/old/issue/folder-ids-fix
train/2026-10-20al
archive/old/issue/folder-ids
train/2026-10-20ak
issue/tables-mockup
train/2026-10-19aj
train/2026-10-19ai
issue/469-merge-fixes
issue/sidebar-band
archive/old/issue/608-settings-spec
train/2026-10-19ah
issue/swipe-offscreen
train/2026-10-19ag
archive/old/issue/590-nlp-adr
archive/old/issue/587-event-after-write-2
train/2026-10-19af
archive/old/issue/587-event-after-write
issue/469-pill-room-c
issue/469-pill-room
train/2026-10-19ae
issue/469-narrow-handle
issue/397-ios-swipe-2
issue/469-desk-fixes
archive/old/issue/auto-update-adr
issue/469-filter-gap
issue/469-port-1b
issue/442-opacity-flake
issue/327-web-fast-3
archive/old/issue/469-port-1
issue/469-port-1
issue/327-web-fast-2
archive/old/issue/327-web-fast
archive/old/issue/425-stt-bench-vq1
archive/old/issue/445-no-bleed
archive/old/issue/400-swipe-mockup-2
issue/426-client-review
issue/426-client-2
issue/426-client
archive/old/issue/476-safe-area-lab
archive/old/issue/445-top-light
issue/471-blocks-mockup
archive/old/issue/448-links-app-2
archive/old/issue/448-links-app
archive/old/issue/398-cold-links
issue/434-442-small-2
issue/434-442-small
archive/old/issue/398-unload
archive/old/issue/445-bottom-band
issue/445-bottom-band
issue/351-rem-3
issue/351-rem-2
issue/351-rem
archive/old/issue/327-first-note
issue/395-width-phone
archive/old/issue/327-typing
issue/396-ios-edges
issue/397-ios-swipe
archive/old/issue/327-notes-index
issue/345-347-contrast-empty-2
archive/old/issue/44-arenas
issue/44-arenas
archive/integ325
archive/old/issue/327-perf-harness
archive/old/issue/44-thp
issue/44-thp
archive/old/issue/285-sticky-pills
archive/old/issue/44-trim-3
issue/44-trim-3
archive/old/issue/165-cards
archive/old/issue/165-picker-2
archive/old/issue/212-multi-select
No results found.
Labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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#771
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Redesign plan for #759 / #642 after the BM2 findings in #770; plan only, no product code or builds.
Read the plan — branch
plan/759b-staging, commitc7464621, based onorigin/devatd83e54db, worktree/home/agent/wt/plan-759bon 6by32-compute01.Recommends disposable app-created scratch versus conservative adopted-file recovery, bounded private retention with admin reporting, and no per-chunk receipt/intent writes. Includes states, SIGKILL failure table, per-upload metadata/sync costs, reuse/removal scope, and first-PR performance/scaling/crash gates (≥95% of dev throughput on the perf VM; zero scratch leftovers after next-start recovery).
Decisions for kayg: whether same-UID direct edits to app-controlled scratch are outside the preservation promise; seven-day private retention followed by restoration/admin recovery; and process-associated owner locks, since explicit OFD/flock unlock plus CLOEXEC alone does not solve SIGKILL with a fork-only child.
#759 is paused pending review of this plan. No merge or deployment.
Independent plan review, round 1. Reviewed
plan/759b-stagingbd64b7a8against devd83e54db, on 6by32-compute01. Read #759 and its decision table (69306), #642/69195, #770/70275 and 70298, current storage docs/ADR, and the fsio, attachment, upload and action-executor paths. Static review only; no builds, measurements, product edits or pushes.Verdict: approve with edits. The app-scratch/adopted split is the right simplification, conditional on kayg accepting the stated same-UID boundary. The failure table is not yet an implementable guarantee. No P0 found.
P1 — A fork-only child can still prevent the next server from starting. Plan §2, lines 54–67, changes operation ownership, but must explicitly cover installation ownership too. Dev
crates/fsio/src/lib.rs:582–615takesFile::try_lock()and explicitly unlocks only inDrop;crates/calternal/src/storage.rs:108–113requires those Home/state locks before startup. On Linux these descriptor-associated locks survive in the fork child's inherited open descriptions. Scenario: server holds both root locks, forks a child that neither execs nor closes them, then receives SIGKILL. POSIX operation locks disappear correctly, but the new server cannot acquire the installation locks and never reaches recovery. CLOEXEC and explicit destructor unlock do not solve this case. Make the death-safe ownership decision cover these locks, preserve exclusion against another state root, and test an actual server restart with the child alive. The sentence “cover … data/state recovery” is insufficiently specific about changing this prerequisite.P1 — Publication reconciliation needs a stable key and an admission barrier; dev does not already supply them. Plan lines 41–45 and table lines 92–94 promise retry reconciliation. Dev
attachments/src/place.rs:96–110publishes, drops pending, then best-effort updates the hash index.engine/src/execute.rs:134–162stores idempotency only after the handler returns.calternal/src/main.rs:165–169starts attachment cleanup in the background. Scenario: kill after exclusive placement but before index/result commit; on restart retry the same upload before recovery processes its intent. Neither the hash index nor engine dedup proves the first placement, so a second name can be published. Persist the user, original idempotency key and action/input identity, not merely an HTTP request ID, and gate affected keys/placement on reconciliation. Define finalization after the engine's durable result commit, including commit failure. Keep unrelated startup/health fast. The table's reference to “existing idempotency reconciliation” is false for this window.P2 — The POSIX choice is sound, but its lifetime protocol and acceptance tests need to cover process-wide lock semantics. Plan lines 58–63 correctly identify fork, sibling threads and the any-close hazard. F_SETLK is available on Linux (including OrbStack Linux guests) and macOS; it is not inherited by a fork child and is released when the owning process dies. However, one centralized fd alone is not enough: record locks belong to the process, are not counted per guard, and a same-process acquisition can convert an existing lock. Scenario: overlapping shared root-handshake guards A/B use the same range; A explicitly unlocks while B is between mkdir and owner-lock installation. A separate recovery process can now enter unless a process-local root gate/reference count prevents it. Similarly, a scanner opening and closing another fd to that lock inode drops the process's locks. Require one inode-keyed owner of all opens/dups/unlocks and local root/recovery synchronization, with a fixed lock order. Add tests for overlapping guards, same-process concurrent recovery and an independent process probing the lock after an unrelated same-inode fd closes. Run the owner/fork/restart cases on Linux and native macOS; a Linux VM running on a Mac does not validate Darwin semantics. These are missing from the explicit first-PR matrix, not evidence that F_SETLK itself is unsuitable.
P2 — The two completion fsyncs are not justified by the stated crash model, and the cost accounting misses a directory. Plan lines 105–115 explicitly limit the new claim to process death. A fully written record installed before publication remains in the surviving kernel after SIGKILL; physical record/directory flushes are not required solely for that guarantee. Some completion metadata is needed for finding #2; dev does not close the gap. Either remove the two extra flushes for this limited contract, or explain the additional power-loss guarantee and its full ordering. Also, dev
fsio/src/beneath.rs:177–186publishes within one directory and syncs that directory. Moving publication from private staging to a public directory changes two parents; durable retirement needs the source parent accounted for too (comparefsio/src/directory.rs:58–67). The fixed overhead therefore needs a complete syscall/durability budget, including construction and retirement, rather than simply “reuse dev's … directory syncs.” Zero extra per-chunk work is credible; ≥95% throughput is plausible, not established by O(N). Gate end-to-end response time, include small uploads as well as the proposed large ones, and measure concurrent note-save latency so extra metadata flushes cannot hide behind good aggregate throughput.P2 — Held evacuation needs its own missing stop boundaries, or should be simplified. Plan lines 69–78 and table line 97 say exclusive destination plus inventory makes replay idempotent, without specifying their order. Scenario: move the unknown inode to
recovered/, then die before installing the inventory; the source is gone and the claimed export/disposition record is missing. Copying instead needs crash handling after destination creation, after its durability, and before source retirement, without duplicate recoveries. Define a replayable destination identity/intent before mutation and retire source/metadata last, or use a same-filesystem exclusive move into a self-describing operation directory that recovery can enumerate. Also add stops after completion-intent installation but before placement, after placement but before attachment index update, after index update but before engine commit, and during intent retirement. For cancellation, explicitly require payload removal before deletion of its last authority record. The broad existing table rows do not establish these orderings.P2 — The proposed hardlink fallback contradicts the current accepted ADR and is unnecessary scope. Plan table line 93 retains link/unlink publication. Current
docs/adr/0062-user-files-on-hdd-app-data-on-ssd.md:140–145supersedes the hardlink fallback, and lines 170–175 explicitly forbid falling back to hardlinks on ext4. Devfsio/src/lib.rs:163–175already supports exclusive native rename on Linux and Apple and safely refuses unsupported operations. Scenario: crash after link but before unlink leaves the app-created public/private alias the newer ADR disallows, adding another recovery branch and authority exception. Use native exclusive rename for the new private path and fail safely when unavailable; if a compatibility exception is intended, obtain and document it explicitly.The proposed first-PR tests are otherwise feasible and useful: real-child deterministic stops plus an ordinary-binary randomized kill loop complement each other. Random byte/time offsets do not prove syscall-boundary coverage. Use an injectable clock for deadline tests, explicit client counts and a defined paired-run statistic for the perf gate, fresh content/keys to avoid dedup measuring a different workload, and a precise recovery barrier that does not require idle live uploads to disappear. No performance or platform pass is claimed by this review.
Cuts that preserve the product rules:
server/src/upload.rs:34–74: global/per-user permits) and quota machinery. Those do not by themselves bound accumulated recovered bytes; account for those bytes and apply existing admission/backpressure rather than introducing a second configurable cap system in this PR.Plan references above are to bd64b7a8; dev references are to d83e54db.
Revised the plan after round-1 comment 70310 and pushed
32fa5d90toplan/759b-stagingonly.Revised plan
Question 1 remains in plain language; question 2 is removed; question 3 remains decided. The test plan includes an injectable clock and a precise recovery barrier that permits live idle uploads and persistent lock files.
Validation: rendered the document to 3 A4 pages with its print styles;
git diff --checkpassed. Only the plan changed. No code changes, builds, runtime/platform tests or performance measurements were run; those remain first-implementation-PR gates.Independent plan review, round 2 of at most 3. Reviewed
plan/759b-staging32fa5d9079against devd83e54db, on 6by32-compute01. Verified the remote branch head. Read round-1 review 70310 and response 70315, #759/69306, #642/69195, #770/70275 and 70298, storage docs/ADR 0062, and the requested dev paths. Static review only; no builds, runtime tests, measurements, plan edits or pushes.Verdict: approve with edits. No P0/P1 finding in this round; the stated redesign trigger is not met. Two P2 edits remain. Approval of the fast scratch path remains conditional on kayg's answer to Question 1; this review does not decide the same-UID preservation boundary.
Findings, ranked
P2 — NEW: Restore the destination-inheritance requirement and account for its cost. Evidence: plan §1 lines 19–27, 63–66, §3 138–142, 177–185. The previous plan explicitly retained #759's inheritance rules (
bd64b7a8:123–125); the revision omits that requirement and its test. Devcrates/attachments/src/stage.rs:165–174creates the payload in the final destination folder;crates/fsio/src/beneath.rs:134–145lets that kernel create inherit the destination's policy. Cross-directory staging already checks inherited group, setgid and attributes incrates/fsio/src/lib.rs:395–415, 438–453;crates/fsio/src/directory.rs:43–49rechecks policy before publication.Scenario:
Documents/YYYY/YYYY-MM-DDhas a setgid group/default ACL different from.calternal/tmp/<operation>. A new upload is created privately and renamed into that public folder. Rename preserves the inode's existing group/ACL; it does not apply the destination's defaults. The upload can be acknowledged successfully while ordinary filesystem clients who previously inherited access can no longer read it. Reusing the exclusive rename alone does not preserve dev's behavior.Concrete edit: explicitly preserve destination-equivalent group/ACL/security inheritance and revalidate the relevant policy before publication, using the existing fsio policy machinery where applicable. Define a safe refusal or supported private staging strategy for mismatches; a fallback must still meet the no-public-prefix rule. Add a destination-policy-change/mismatch test and include the required metadata calls in the cost trace. This is a missing requirement, not a request for a new permissions subsystem.
P2 — NEW: The new p95 acceptance gates lack a sample/overlap protocol. Evidence: plan §3 157–167 specifies client counts and three cold/five warm pairs, but no upload count or minimum run duration, no minimum note-save sample count, and no required overlap of those samples with upload activity. Dev
crates/perf/src/scenarios/uploads.rs:16–45supplies a different fixed workload: twenty 8 MiB uploads and ten edits per upload separated by 20 ms.crates/perf/src/stats.rs:52–58, 84–96computes nearest-rank percentiles and treats single-sample runs differently. That existing scenario does not implement the newly specified size/client/rate matrix.Scenario: a 4 KiB warm upload finishes before the first periodic note save. Three/five paired runs can then produce no overlapping save samples, or a purported p95 based on one or a few saves taken mostly after upload completion. Such a run cannot establish the intended concurrent-save latency gate, even when the upload ratio passes. Repeating the existing fixed 8 MiB scenario would also miss the required small-upload workloads.
Concrete edit: require the first PR to extend the harness, predeclare requests/duration and minimum valid samples per workload, sustain uploads while collecting the 1-save/second client, and reject missing/insufficient/non-overlapping samples. Define paired ratios as head/dev throughput and head/dev within-run p95, reporting cold and warm separately. Keep the stated thresholds. This adds a reproducible measurement contract, not another benchmark system.
Round-1 resolution audit
DataLock, locks every validated root and preserves exclusion with another state root. §3 177–183 requires a real server restart/recovery with the fork-only child alive on Linux and native macOS. This now covers the prerequisite in devfsio/src/lib.rs:582–615/calternal/src/storage.rs:108–113.attachments/src/place.rs:96–110andengine/src/execute.rs:149–162.fsio/src/beneath.rs:208–217.Remaining checks and limits
calternal/src/main.rs:142–169listens and starts recovery in the background. First-PR tests should hold one scope unresolved while proving/healthz, another user's work and unrelated note saves still progress; recovery should commit reconstructed outcomes without recursively entering an execution path waiting on its own gate.stage.rs:190–194,fsio/src/lib.rs:75–81); dev publication is payload+one parent (beneath.rs:177–185), while the proposal is payload+two parents. Thus the proposed fixed total is P(N) + 5 + I + E, one publication-parent fsync beyond dev. The construction/owner/provenance/completion/retirement operations are now visible in the budget. This is still a budget, not an exhaustive measured syscall count; inheritance work from finding 1 must be included. Database opens/checkpoints and newly created public folders must remain separate, as the plan says.perf-test-02/03, using binaries built elsewhere and the stated runner/cache controls, are feasible. Native Darwin owner/fork/restart tests belong onmacos-01-stdor the Mac Studio.PreparedDirectory's optimized implementation is Linux-only in dev (directory.rs:88–94); test its Linux path there and its safe decline/applicable platform behavior on macOS, rather than claiming Linux guest results validate Darwin. No platform or perf pass is claimed here.Plan line references: 32fa5d90. Dev file references: d83e54db.
Verdict: approve with edits.
Applied round-2 findings (orchestrator), plan head
657546c675:Round 2 found no P0/P1. Plan is ready for kayg (Question 1 pending).
Implementation preflight stopped under the “code proves the plan wrong → comment here” rule. No product implementation, push, or PR yet.
Commit-outcome evidence can expire before completion reconciliation. Reviewed approved plan
657546c6against devd83e54dbon10by32-01-std.The plan requires a completion record/public inode to survive a failed or uncertain engine commit, then reconciliation to resolve the durable commit outcome and commit/replay the original key/events exactly once. It does not bound restart delay or specify how that evidence survives idempotency retention.
Dev has a seven-day default (
crates/store/src/lib.rs:78–91). Its writer unconditionally prunes old idempotency rows before processing its first command on open (writer.rs:47,79–81), and again after commits. The permanent journal retains request IDs and event data, but no original idempotency key or canonical action/input hash (schema.rs:18–33).attachments.addedcarries name/type/shelf/size/content hash, not a key-bound commit witness (attachments/src/actions.rs).Concrete stop sequence:
Deterministic characterization passed (one test, zero sleeps): commit an
attachments.addedevent with key/input/result; set only the fixture idempotency timestamp to zero through SQLite; reopen using the default retention; enqueue an empty commit as the exact post-prune writer barrier. The original event remains, lookup of the original key returns None, and committing the same key/event again succeeds and produces two journal events. This demonstrates the existing-store behavior, not a completed redesign or a full crash test.Command, verbatim:
Please specify the intended commit-evidence lifetime/protocol in the plan: e.g. pin key-bound commit evidence until completion retirement with pruning ordered behind intent discovery, or persist an exact commit correlation witness that reconciliation can verify against the retained journal. An original request ID could be an additional correlation field, but the completion must still bind the original key/action/input, and the replay/retention behavior needs an explicit test. This is distinct from changing normal retention for already-retired uploads. Also add deterministic stops spanning expiry/pruning and the commit-before-retirement boundary.
I have not selected or implemented either protocol, changed retention, or weakened tests. The temporary diagnostic is preserved locally at
/tmp/759b-plan-evidence/diagnostic.patchwith its log; the worktree source was restored. Full gates, death matrix, performance, and native Darwin tests were not run because implementation stopped at this finding. Branch/worktree:fix/private-staging-759b,/home/agent/wt/impl-759b, still atd83e54db.Resolved by the orchestrator (plan head
1b411e508f): pin approach. The writer's idempotency prune excludes keys of outstanding completion records, and per-user completion discovery runs before the first prune on open. Records retire only after resolution, so evidence always exists; normal retention unchanged. Tests added to the plan: expiry-crossing restart resolves exactly once; stops between engine commit and retirement. Implementation resumes.Implementation stopped under the “code proves the plan wrong → stop and comment here” rule. The expiry/pruning resolution in 70564 is understood; this is a separate installation-lock transition gap in approved plan
1b411e508fagainst devd83e54db, on 10by32-01-std (Linux arm64).Mixed-generation installation owners are not mutually excluded. Dev
crates/fsio/src/lib.rs:582–615usesstd::fs::File::try_lock()(Linux flock). The plan replaces it with process-associated POSIXF_SETLK. These are independent lock families on this local Linux filesystem. A deterministic two-process characterization demonstrated both orderings: a new POSIX owner remains alive while an independent process acquires the exact devFile::try_lock()primitive on the same persistent.lockinode; and a dev-primitive owner remains alive while the new POSIX owner acquires it. Neither process exits or releases its lock before the other acquires. No sleeps or deadlines are used.This affects the installation prerequisite, before staging recovery:
calternal/src/storage.rs:108–113takes these same Home/state locks. Its startup/shutdown contract (storage.rs:11–12, 29–32, testsstartup_waits_for_a_previous_server_to_release_both_rootsanda_lock_held_past_the_longest_grace_still_fails_startup) explicitly requires a new server to wait while the previous server can still write. Merely changing the lock family lets a new binary bypass an old binary still running or finishing shutdown; a later old-binary start can likewise bypass the new owner, including with another state root sharing the Home. I tested the actual locking primitives in separate processes, not two full server instances.Evidence: first added an independent POSIX exclusion probe. It failed against dev as expected. After an experimental registry-backed POSIX DataLock change, the existing fsio suite plus that probe passed (36 tests, no existing tests changed). The mixed-generation characterization then produced:
That last pass characterizes the gap; it is not an acceptance/regression pass. The full experimental patch, standalone test text, commands and logs are preserved on this VM at
/tmp/759b-implementation-evidence/(experimental-owner-and-characterization.patch,mixed-generation-test.rs,mixed-generation.log,lock-red.log,locks.log,README.txt).Please settle the transition in the plan: either an explicit, enforceable offline upgrade/rollback requirement for the lock-family boundary, or a compatibility/fencing protocol with mixed-generation tests in both acquisition orders. Holding a legacy flock for the new server's lifetime without additional design reintroduces the living fork-child/SIGKILL problem; checking and immediately unlocking it only protects against an already-running old owner, not a later old opener. I have not selected a transition protocol or silently added a new deployment requirement.
All experimental source changes have been restored;
fix/private-staging-759bremains clean atd83e54dbe5. No commit, push or PR.target/has been deleted and lease heartbeathb-877b57b0.servicestopped. Full gates, the ≥1,000-offset death loop, release/perf runs and native macOS tests were not run because this implementation stopped at the demonstrated plan gap. Native macOS owner/drop/duplicate/fork-restart, Home/state exclusion, shared-guard/alias-close, inheritance and recovery checks remain pending.Resolved by the orchestrator (plan head
f8b1db010c): offline upgrade across the flock to POSIX boundary. Deploy and rollback already stop the old server before starting the other (scripts/deploy-prod.sh, PR #773). The new server probes each installation lock with a non-blocking flock at startup, refuses while it is held, and releases it immediately without holding it, so the fork-child issue does not return. No mixed-generation fencing. Tests: an old-style flock holder blocks startup; release lets it proceed. Implementation resumes.kayg referenced this issue2026-11-05 23:21:12 +00:00