Storage tiering: text on SSD, large files on HDD, mirrored real trees, per-disk reflink dedupe (T1/T3/T4) #731
Open
opened 2026-10-28 16:37:32 +00:00 by kayg
·
54 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#731
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?
Decided by kayg on 2026-10-20 (backend grill T1, T3, T4 revised, T5), never tracked by an issue. Found on 28 Oct when kayg asked whether the storage split was done.
Done already (#642, ADR 0062, train AM #647): the Home (all user files) and app state (auth, indexes, history, journal, caches, server key) live in separate roots (
--data,--state). That puts app data on the SSD, but the whole Home on one disk.Not built (this issue):
calternal mount) shows the joined tree.Order for prod: build and break-test this, then create the two 4K XFS reflink=1 disks (SSD/NVMe and HDD), then migrate prod once into the final layout, so it never migrates twice. Gates: perf on the tiered layout, crash and kill -9 tests across the two-disk journaled step, and dedupe correctness (no shared extent ever modified in place).
Grill before build: ADR 0062 needs an amendment for the tiered layout.
🤖 Generated with Claude Code
Starting the approved storage break test. Worktree /home/agent/wt/storage-break is detached at origin/dev, base SHA
3d0c6e33d5. No branch will be pushed and no product fixes will be made. Disposable roots and reports are outside the repository. Scope is the implemented #642 split; #731 tiering is not implemented. ADR 0062 explicitly refuses missing durable state, which differs from the requested empty-state restart check; I will test and report that behavior rather than bypass startup safety.Starting the docs-only ADR 0062 tiering amendment on branch
docs/adr-0062-tiers, based onorigin/devat3d0c6e33d588335c745a660163bf8bf5cdc8412d. I will read the storage and Files decisions, write the amendment and break-test/performance plans, validate Markdown and links, then open a PR into dev. No merge or deploy.Finding:
origin/devat3d0c6e33d588335c745a660163bf8bf5cdc8412dhas no ADR 0051 (git ls-tree -r --name-only origin/dev). Relevant existing decisions are ADR 0027 (storage and dedupe), ADR 0043 (files are the truth on every device), and ADR 0048 (format plugins). I will amend ADR 0062 in place and mark its original all-HDD Home decision as historical, keeping this to one changed file.Finding: ADR 0027 still specifies a content store and hardlink fallback, while #731 requires mirrored real files and per-disk reflinks. The amendment will explicitly supersede those parts of 0027, keep fingerprints rebuildable in state, and use full independent copies when reflinks are unavailable. No file will depend on a content-store lookup. Linux FICLONE requires source and destination on the same filesystem and isolates later writes with copy-on-write: https://man7.org/linux/man-pages/man2/ioctl_ficlone.2.html (read with Firecrawl).
Finding: the requested copy, fsync, verify, then remove sequence necessarily has a window with two physical copies. A crash can stop there; two filesystems have no common atomic rename. The amendment will state the enforceable pass criterion: every crash retains a valid copy, one journal-selected authoritative version, and replay converges to exactly one final file. Raw disk trees can temporarily show both versions of a move; the app presents one committed tree. This limit must be visible rather than hidden by a promise of physical atomicity. Divergent outside edits are retained as real conflict files.
Validation limitation: the designated perf VM is unreachable from this worker. SSH to root@10.69.69.63 times out; the 10by32-01-std hostname access attempt is logged separately. Local uid is agent (1002), sudo requires a password, and cgroup I/O controls are not writable. Therefore I cannot honestly report slow-HDD ack p95/file-durable p95, dm-delay, full-device, or cross-physical-disk results. I will continue the real-binary crash/recovery and startup misuse checks with disposable ext4 directories. No shared disk will be filled or shared device configuration changed.
Finding under runtime verification: contacts keep original vCard wire data only in state. crates/contacts-actions/src/cards.rs says the durable original is a history companion, with a .vcf copy under state/users//contacts/raw/. ADR 0063 explicitly keeps unknown vendor properties only in that original. This appears inconsistent with ADR 0062's rule that nothing which is the only copy of a user file may live only in state. I am checking with a vCard containing a distinctive unknown property, rather than treating static inspection as a demonstrated data-loss case.
Finding from break-testing the design: path checks and watcher events do not exclude an outside writer holding the old inode open during cross-disk retirement. Such a writer can write after the source path is renamed or removed. The draft requires verified per-file write exclusion before retiring the source, defers the move when that cannot be established, and adds T-A3 for kayg (online per-file exclusion or offline maintenance). The numbered outside-edit gate explicitly includes this open-inode case. This is a design constraint, not a claim of an implemented fix.
Crash-loop finding: 1,000 SIGKILL rounds completed, with 1,000 acknowledged main-note appends checked exactly once after every restart. The final harness assertion was too broad: it counted hidden .calternal-tmp-*.md staging files along with canonical notes. Inspection found one canonical Crash.md with the final token, plus 550 leftover staging markdown files totaling 3,459,778 bytes. These are hidden staging remnants, not demonstrated duplicate user-visible notes. They nevertheless fail the requested no-orphan invariant and survived many restarts. Proposed fix: add conservative startup cleanup for owned note staging files under the Home lock, through the existing filesystem layer. I am separately validating canonical file equality and preserving this distinction in the report.
Finished the docs-only ADR 0062 amendment in place. PR: #732 (into
dev).Branch:
docs/adr-0062-tiers. Base:3d0c6e33d588335c745a660163bf8bf5cdc8412d. Head:0840c7036d74082ce045035507a79e8626ca3f9e. Only the ADR changed. Nothing merged or deployed; this issue remains open.Open questions for kayg:
missing disk and matching state are restored, or offer an explicitly partial,
read-only joined view? Recommendation: retain fail-closed app startup and
stop service on runtime loss; plain-file access to the survivor remains
available. Partial service adds recovery and incomplete-tree semantics and
should need its own design and break tests.
identical file on the same disk, or should candidate indexes be per person?
Recommendation: per-person candidates within each disk, avoiding cross-user
timing and allocation signals and simplifying deletion and permissions.
“Already uploaded” remains restricted to one’s own files either way, as
already decided in #731.
write exclusion during retirement, or limit moves to an offline maintenance
window when external tools cannot cooperate? Recommendation: use verified
per-file exclusion where the platform supports it and defer the move
otherwise, offering an offline pass. Do not treat watcher silence or a
successful hash check as proof that an open outside writer is finished.
The break test with an open old inode must pass before online retirement is
enabled; best-effort copying must never silently lose that writer’s bytes.
Gate output verbatim:
Confirmed file-over-app violation (high): import a vCard with FN:Audit Person and X-STORAGE-BREAK:opaque-original-value-642 using contacts.import, wait for the raw-card copy, then stop the server. Exact scan output:
{"opaque_original_in_Home": [], "opaque_original_in_state_vcf": ["users/0b0e0f0a-1111-4222-8333-944455556666/contacts/raw/bf33903d-c2ad-8b91-880e-cdaa1f585ca4.vcf"]}
The readable contact markdown exists in Home, but its original unknown property exists only in state. This conflicts with ADR 0062's original-user-data rule; ADR 0063 explicitly chose state-only wire metadata. Proposed fix: the existing contact format module should own a durable Home original-card asset with coordinated recovery; state copies should be rebuildable. No fix in this job.
Separately, the acknowledged-write boundary is confirmed: with CALTERNAL_NOTES_SAVE_MS=600000, notes.append returned HTTP 200; exact checks were {"pending_marker_in_Home": false, "pending_marker_in_API": true}. Empty state then refused startup both with and without --create; corrupt auth refused with "file is not a database". This matches ADR 0062/storage.md, but does not meet the requested ability to rebuild the full current Home from empty state. Missing durable auth/history are deliberate refusals, not silent recovery.
The workspace gate initially failed because the real SyncClient bridge lacked y-protocols/sync in this fresh checkout; bun install --frozen-lockfile has now passed. Reruns will distinguish setup from a product failure. Targeted editor recovery tests passed: 2 files, 17 tests.
Full-filesystem evidence from two private 32 MiB tmpfs mounts (different st_dev values 54 and 57): filling each mount reached [Errno 28] No space left on device and free_bytes=0. With state full, append returned HTTP 500, retryable=true; save also returned HTTP 500. After space was freed and a hard restart, that unacknowledged token was absent. With Home full, append returned HTTP 200; save returned HTTP 503, code=not_saved_yet, retryable=true. After freeing space and a hard restart, the acknowledged token was present. This supports history-backed acknowledgements and predictable retry behavior in these cases; it is not HDD-latency or power-loss evidence.
Wrong pairing, empty state and corrupt auth refused. An independent second server on the same Home waited the documented lock grace and exited 1; the first server remained healthy. Outside edits while running and while stopped were observed. A derived-metadata deletion rebuilt the note list and search hit while durable auth/history were retained. Canonical file bytes matched the API after the main 1,000-kill run, including all 1,000 acknowledged and 142 retried in-flight tokens exactly once; 550 hidden staging files still remained.
New crash-recovery finding (medium, reproduced in a separate-filesystem run): after the rename in round 65, notes.job returned state=failed, done=0, steps=2, error="We couldn't find that." The summary said from="Trash fixture 57.md", to="Trash fixture 64.md". The destination file existed, but notes.get reported path="Trash fixture 64.md" with title="Trash fixture 57" and body heading "# Trash fixture 57". The user file bytes remained readable; no content loss is claimed.
The stopped Home/state were copied for inspection. After another restart the job was still failed. Retrying notes.rename with the original key rename-64 returned HTTP 200 with replayed=true and cached state=running, rather than repairing the persistent failed job. The paired roots still matched and four SQLite quick_check results were all OK. The 1,000-round ext4 run had not inspected every bulk-job state; this additional tmpfs run did, and stopped at this failure. A rename-only reduction is underway. Proposed fix: make rename replay recognize a placement already at its destination and finish the remaining history/index steps; ensure recovery has the necessary note lookup state before replay. The exact ordering cause is still an inference. No product fix made.
The workspace gate remains failed on the timing-dependent anchors.rs:113 snapshot assertion (a background save added title: Day); the block-change refusal itself was correct, and the isolated rerun passed. Remaining workspace packages and doc tests passed.
Finished storage break test. Head SHA
3d0c6e33d5(unchanged detached origin/dev). No product fixes or pushes. Disposable roots removed. The report below includes ranked findings, minimal reproductions, limits and gate output verbatim.Storage break test result
Verdict: FAIL for the requested file-over-app guarantee. Acknowledged-edit recovery passed the tested kill rounds. Original contact data exists only in state, rename recovery can strand a half-finished job, and interrupted note saves leave orphan staging files. Slow-HDD latency validation is blocked.
Base/head:
3d0c6e33d588335c745a660163bf8bf5cdc8412d, detachedorigin/dev, fetched at start. No product changes, commits, branch pushes, merges, deployments or issue closures. #731 tiering is not implemented and was not claimed tested.Ranked findings
High: original contact bytes are not preserved by Home alone. Import a vCard containing
X-STORAGE-BREAK:opaque-original-value-642, wait for its state raw-card copy, then stop. The contact markdown exists in Home, but the distinctive unknown field occurs only instate/users/<uuid>/contacts/raw/<id>.vcf. The original is also a history companion; both copies are in state. This loses original user data, beyond historical versions. ADR 0063 deliberately keeps unknown wire metadata only in the original, conflicting with ADR 0062's original-user-file guarantee. Minimal API repro: POST/api/v1/actions/contacts.importwith{"cards":["BEGIN:VCARD\r\nVERSION:4.0\r\nUID:audit-contact\r\nFN:Audit Person\r\nX-STORAGE-BREAK:opaque-original-value-642\r\nEND:VCARD\r\n"]}on a disposable split server; compare a recursive byte search for the marker in Home and state after the copier finishes. Proposed fix: extend the existing contact format/persistence module to own durable original cards in Home with coordinated recovery; retain rebuildable state copies. Reconcile ADRs 0062/0063/0064. Do not reimplement vCard rules elsewhere.Medium: rename recovery can strand a half-finished job. A rename-only reproducer completed seven renames, then killed the eighth before receiving a response. After restart and retry, the file was
Rename 8.md, but heading/title wereRename 7;notes.jobwas failed, done=0, steps=2, error="We couldn't find that." The note body stayed readable. A prior mixed run found the same failure at rename-64, and it remained failed after a further restart. An original-key retry can return a cached running report while the persistent job is failed. Minimal command:/usr/local/bin/build-slot.sh timeout 270 unshare -Urm python3 /home/agent/wt/storage-break-report/rename-mount.py. It exited 42 after eight kills (42 denotes reproduced defect). This is a recovery-completion defect; no acknowledged completed rename or note-body loss is claimed. Proposed fix: make move placement replay recognize an already-placed destination by identity and finish remaining history/index steps; check index readiness before replay. The exact cause is an inference requiring code investigation. No fix made.Medium: SIGKILL leaves note staging files indefinitely. First ext4 run left 550 hidden
.calternal-tmp-*.mdfiles, 3,459,778 bytes, still present after one additional restart/save. Canonical note IDs are unique; these are staging remnants, not demonstrated visible duplicate notes. Minimal sequence: create/save one note; repeatedly append, begin a save, SIGKILL during the 0–12ms scheduling window, restart; count Home.calternal-tmp-*files.harness.pyis the full reproducer. Proposed fix: conservative recovery/cleanup through the existing filesystem module while holding the Home lock. Guarded exchange can put an outside writer's bytes in a temporary path, so blindly deleting every matching filename would be unsafe.Contract discrepancy: empty-state automatic reconstruction is deliberately unsupported. With
CALTERNAL_NOTES_SAVE_MS=600000,notes.appendreturned HTTP 200; the new marker was innotes.getand absent from every Home file. After SIGKILL, presenting an empty state root refused startup, with and without--create. Corrupt auth refused withfile is not a database. This matches ADR 0062 anddocs/storage.md, which explicitly warn Home-only backups lose acknowledged pending edits. It fails the stronger job requirement to restore all current files automatically from Home alone. Proposed decision: either change the guarantee/documentation explicitly, or introduce a separately designed Home durability/recovery path that preserves the SSD acknowledgement latency contract. Do not bypass pairing checks or silently recreate auth/history.What is lost with state
The tested implementation refuses to serve, rather than silently dropping state. Offline Home remains readable, but it is not a complete copy of every latest acknowledged/original byte. State contains auth people/passkeys, roles/capabilities, groups/memberships, invites/grants/keys and quotas; edit/version/deletion history and pending file saves; journal/request deduplication and job/undo recovery; original vCard wire metadata (and, by code/ADR inspection, inline photo wire bytes). Search and note lookup/list caches can be rebuilt with durable auth/history retained. Current flushed markdown, task metadata stored in markdown, uploaded fixture bytes, preferences and Trash files remain Home data. Loss of auth/history/journal and pending edits is documented in ADR 0062/storage.md; loss of original contact wire fields contradicts the broader original-file rule. Future task manual ordering is read-only/unimplemented on this SHA and was not presented as a current data-loss case.
Kill and file evidence
First counted run: 1,000 SIGKILLs and 1,000 acknowledged appends checked exactly once after each restart. Operation scheduling: 143 saves, 143 renames/file moves, 143 Trash deletes, 143 restores, 143 uploads, 143 contact imports, 142 additional in-flight appends. Ambiguous requests were retried with the original request key. Final canonical file matched API bytes, all 1,000 primary tokens and all 142 in-flight append tokens appeared exactly once. The original final harness assertion scanned hidden staging files as ordinary markdown and exited 1; the corrected canonical check passed. Separate inventory verified 143 exact numeric upload payloads and 143 imported contact markdown files, no duplicate canonical note IDs, and matching pairing markers. Later audit fixtures are counted separately. There was no separately instrumented move-block kill case and no whole-device power loss.
Canonical check, verbatim:
The separate-filesystem run with terminal-job checks stopped at rename-64 (65 injected kills). Its earlier uninspected-job trial logged at least 375 rounds before a restore 404; those are not presented as a completed second 1,000-round run. A rename-only reduction reproduced in 8 more kills. Total: at least 1,448 injected kills across these runs, excluding native-suite, pilot and cleanup kills. Only the first 1,000-round loop completed in full. Separate-filesystem failure output, verbatim:
Rename-only reduction output, verbatim:
Original-card location after a clean graceful shutdown, verbatim:
Layout, misuse and recovery
Initial Home/state were separate directories on
/dev/sda1ext4. No local sudo was available. Private user/mount namespaces subsequently permitted two bounded tmpfs mounts (32 MiB each for ENOSPC; 128 MiB each for the second kill loop); their different st_dev values are recorded in the logs. This tests separate filesystem instances, not separate physical disks or rotational latency. No shared disk was filled, mounted, throttled or reconfigured.Empty state, corrupted auth and wrong pairing refused. A second server waited the documented 40 seconds, exited 1, and the first remained healthy. Read-only Home permissions refused with EACCES. Outside edits were observed through the watcher while running and on restart while stopped. Removing only derived notes metadata/lookup state preserved note text, rebuilt the note list and search result. An initial malformed tasks.list request was a harness error; the dedicated task-note rebuild check below uses the documented status frontmatter and required list/today arguments.
Final full-device/readonly results, verbatim:
Task rebuild, verbatim:
No claim is made that every randomized kill landed inside its intended syscall or that file bytes were compared against history at every individual restart. The loop checked acknowledged tokens through the API at every restart, then canonical bytes at the end; existing deterministic crash suites cover additional placement boundaries.
Timings and test gates
Slow-HDD acknowledgement p95 and file-durable p95: NOT MEASURED.
root@10.69.69.63(the perf script's designated VM address) timed out;10by32-01-stddid not resolve. No perf run was attempted on another machine or on production. Local cgroup I/O controls were not writable; tmpfs is not a substitute for HDD latency. No hardware persistence/power-loss claim is made from process kills or tmpfs. The deterministic split-save test did confirm an acknowledgement while preparation/placement was paused, with recovery after kill, but is not a latency measurement. The official 100k HDD/SSD performance gate and all-SSD comparison remain NOT RUN.All local heavy commands ran under one
/usr/local/bin/build-slot.shjob at a time, cargo-j3; no Playwright was needed. Build:source /etc/calternal/env.sh; cargo build --locked -p calternal -j3passed in 52.82s. Targeted command:cargo test --locked -p calternal -j3 --test storage_startup --test notes_crash --test notes_crash_typing --test attachments_crash -- --nocapturepassed: 16 tests, 1 ignored. Split fault injection:cargo test --locked -p calternal-notes -j3 storage_crash -- --nocapture: 2 passed (one child entrypoint plus the parent exercising prepare/place), 429 filtered. Editor:bun run test --maxWorkers=1 test/recovery.test.ts test/history-recovery.test.ts: 17 passed in 2 files, 9.84s. Dependencies installed with frozen lockfile only after needed.Initial
cargo test --workspace --locked -j3: 1053 passed, 1 failed, 19 ignored across 52 completed test groups (including doc tests); exit 101 because the Bun bridge could not resolve y-protocols/sync with node_modules absent, then Rust parsed EOF as JSON. Afterbun install --frozen-lockfile, isolated failing test passed (0.66s). Full workspace rerun: 1053 passed, 1 failed, 19 ignored across 52 completed test groups (including doc tests); exit 101. The failure at anchors.rs:113 compared otherwise-identical text before/after a background save added title: Day. The block-move request correctly refused with BlockChanged; isolated rerun passed in 0.24s. Proposed fix: settle server-owned frontmatter before the invariant snapshot in the test helper, preserving the block-refusal/body assertions. The gate remains red. Remaining skipped workspace packages were run explicitly: 100 passed, 0 failed, 1 ignored across 22 completed test groups (including doc tests); exit 0. Explicit workspace doc run: 0 passed, 0 failed, 0 ignored across 20 completed test groups (including doc tests); exit 0. The rerun used an ext4 TMPDIR under the disposable roots; the initial run used native /tmp (tmpfs), explaining much of the timing difference, without proving a performance regression.Final workspace summaries, verbatim:
All recorded gate exit lines, verbatim (initial harness failures retained transparently):
Harness limitations/corrections: initial pilot restored an already-live note; initial standalone audits bound Python default roots too early; initial full-device namespaces included an unconfigured private network; first readonly remount replayed an unmapped uid option. These are harness errors, not product findings. Corrected runs are identified above. Disposable setup-message lines were redacted from diagnostics. Reports and scripts live outside git at
/home/agent/wt/storage-break-report; all disposable roots under /home/agent/wt/storage-break-roots were deleted after final checks; private mounts were released. No product fixes were made.T-A2 decided (kayg, 28 Oct): dedupe is server-wide, across people on the same disk, not per person. kayg also requires "incredible testing that there are no cross-user escalations or leaks."
Rules that follow (to go into the ADR 0062 amendment, PR #732):
Test gates before it ships (beyond the existing two-user leak suite from #409):
🤖 Generated with Claude Code
kayg ticked in the roadmap doc, 28 Oct:
Starting the approved docs-only answer amendment. Working from docs/adr-0062-tiers at
0840c7036d; origin/dev base is3d0c6e33d5and is already an ancestor. I will amend ADRs 0062/0063/0064 and run Markdown, link and scope gates. The hard rule says open-PR branch pushes are ignored, so publication will use a new branch docs/adr-0062-answers and a new PR; PR #732 description will point to it. No merge or deploy.kayg, 28 Oct, on server-wide dedupe: "we don't let the user know that some other user has it even when it is being deduped. only admins can see it happening. this needs to be very very robust."
Findings and choices for the docs amendment: #731 comments 67049 and 67052 decide T-A1–T-A3; #642 comment 67053 decides FO1. The existing ADR scopes dedupe per person and uses candidates during import, which contradicts the decided full-upload-first rule. The amendment now places background dedupe after full independent placement and acknowledgement and adds all four isolation gates. FO1 cannot rebuild current accounts and permissions from note text alone: the safe documented choice is protected Home recovery snapshots owned by the existing storage/auth modules, validated against an installation UUID pinned outside state. Wrong Homes, swapped roots and corrupt nonempty state remain rejected. Instant SSD acknowledgements also leave the explicitly bounded one-second pre-materialization window: Home-only recovery loses only history after catch-up, while pending bytes still require state. This boundary is stated and tested rather than hidden. Current vCards will be named .calternal-contact-.vcf beside notes, owned by the contact format module; state copies become caches. These are future implementation requirements, not claims that the current binary already passes them.
Finished the docs-only answer amendment. Head:
a4ad276127bcc8a772bfc2a19002eb789f8c2e5a. Branch:docs/adr-0062-answers. PR: #736. Updated #732 description to the final decisions and replacement PR; no tiering questions remain. Only ADRs 0062/0063/0064 changed; no evidence artifacts committed. No merge, deployment or issue closure.The hard rule against ineffective open-PR branch pushes required a new branch/PR instead of pushing docs/adr-0062-tiers. origin/dev at
3d0c6e33d5was already an ancestor, so no base merge was needed.Gate output verbatim:
Starting the XFS project quota feasibility probe. Tracking branch: job/xfs-quota-probe-20261029. Base SHA:
a779a46f42. No product code changes planned. Scripts and evidence stay in ~/codex-jobs/xfs-quota-probe; tests touch only a new scratch tree on /srv/quota-probe. I will test setup permissions, accounting, reflinks, query cost, enforcement and restore behavior.First finding: project setup and usage reads have different permissions on the supplied XFS mount (kernel 6.12.113+deb13-amd64).
Verbatim initial probe output:
The server can label directories it owns without capabilities on this kernel. Reading project usage requires a privileged path; a one-time directory setup helper alone is insufficient. I am checking the matching kernel source and accounting semantics next. No product code changed.
Accounting and reflink finding from /srv/quota-probe:
The 92 semantic checks passed against an independent stat walk for settled allocated blocks. The kernel counts allocated inode space, not logical bytes per name. A 16 MiB sparse file with one written byte charged 4096 bytes. Two hard-link names to a 65536-byte file charged 65536, not 131072. Rename and hard link across inherited project boundaries returned EXDEV. Ordinary mv copied and unlinked and inherited the destination ID. Moving a file out into an unprojected directory succeeded but retained its original project ID and charge.
Cross-project cp --reflink=always and FIDEDUPERANGE both succeeded and charged both projects fully. Peer edits/deletion did not immediately change the other project's charge. However, the following controlled result prevents claiming strict dedupe invisibility with raw allocated usage (verbatim):
The writer's own charge can reveal whether shared extents still have a peer. The final report will distinguish this from the successful full-charging test. GNU tar --xattrs --acls also lost source project IDs when restoring into an unprepared tree; restoring into a pre-labelled inherited root used the destination project correctly. No product changes.
Query and enforcement findings:
Warm quota reads do not grow with the number of test projects. With 1, 100 and 10,000 test projects, seven-sample median times for 10,000 requests to the same Home were 43.086, 41.510 and 41.665 ms (about 4.2 microseconds/request including CLI formatting and amortized startup). Random-Home reads were 41.695, 43.140 and 43.509 ms per 10,000. Spawning sudo and xfs_quota for one request cost about 8 ms. This mount-specific measurement ran in one local build slot because the supplied disk exists here; no application perf gates ran. No cold-cache claim: cache dropping is not authorized on this host. The dataset had 1/100/10,000 NEW test projects plus the earlier semantic probe projects, not exactly those total filesystem cardinalities.
Enforcement does work, but the app must handle ENOSPC as well as EDQUOT. Verbatim outside writer result at a 1 MiB project hard limit:
A cross-Home clone over the destination limit also failed with "No space left on device". Matching Linux v6.12 source explicitly returns ENOSPC for project dquots and EDQUOT for other types. The product HTTP server has not been exercised; the raw kernel error alone does not prove clean user-facing error handling.
Final detail checks matched GNU du exactly: 1000 one-byte files used 4,132,864 allocated bytes, of which 36,864 were directory blocks; apparent size was 1000 bytes. A buffered 10,001-byte write was visible to quota inspection before fsync/close as 12,288 bytes. Matching kernel source shows returned usage includes current allocation plus reservations, so concurrent reads are admission accounting, not an exact logical walk snapshot. A first unlink observation also retained an inode charge briefly during reclaim.
Soft limit result after polling the actual allocation error (no fixed sleep):
Startup Q_XGETQSTATV succeeded without capabilities and reported project flags 0x30 (accounting and enforcement on). Missing accounting was tested only through the decoder's simulated state; I did not disable accounting or remount the supplied disk. ext4 project quotas and rsync restores remain explicitly untested (no configured ext4 project-quota mount and no rsync executable). The report will preserve these limits.
XFS project quotas feasibility — #754 / #731
29 October 2026. Host: 6by32-compute02. Kernel: 6.12.113+deb13-amd64. xfs_quota 6.13.0. Supplied test filesystem: /srv/quota-probe, /dev/loop0, 20 GiB XFS, 4 KiB blocks, reflink enabled, prjquota. All file mutations ran as uid 1002 with CapEff zero; only inspection and limit commands used the permitted sudo xfs_quota. Scratch tree: /srv/quota-probe/xfs-probe-20261029. Scripts: ~/codex-jobs/xfs-quota-probe/probe/.
Decision
NO-GO as a direct replacement for #754's logical, per-filename Home counter, and NO-GO for the strict claim that raw allocated usage cannot reveal cross-user dedupe. The kernel facility itself works and is fast. It could be an allocated-space accounting/enforcement backend if the product explicitly accepts the differences and resolves the dedupe visibility result.
Reasons established by tests:
No product code, commits, pushes, merges, deployments, or new PRs. Tracking branch job/xfs-quota-probe-20261029 points to the base/head
a779a46f42. The shared checkout stayed on dev. Its pre-existing untracked result.md was left untouched.1. Setup and privileges
Test: FS_IOC_FSGETXATTR / FS_IOC_FSSETXATTR on an owned directory, first setting fsx_projid, then FS_XFLAG_PROJINHERIT. Both succeeded with no capabilities. The separate unprivileged xfs_quota project -s -p PATH ID test recursively labelled a populated tree, including its existing nested file. No edits to /etc/projects or /etc/projid were needed.
On this host, the server can set up and repair directories it owns without root, in the initial user namespace. The Linux v6.12 VFS path requires ownership or CAP_FOWNER; it restricts changes to project IDs/inheritance in a noninitial user namespace. CAP_FOWNER is relevant to operating on someone else's inode, not required for the owner. CAP_SYS_ADMIN is required for project quota reads and limit changes. Those distinctions come from VFS file attributes and quotactl permission checks, and the owner/read tests below. Nonowner capability grants and user namespaces were not experimentally varied.
The minimal deployment setup is an administrator enabling prjquota on each backing XFS mount and provisioning a narrow runtime helper with CAP_SYS_ADMIN to read project quotas and administer limits. Do not give the entire server that capability just to query usage. The helper should accept fixed operations on configured mounts and registered project IDs. Empty new Homes can be labelled by the owning server before publication. Alternatively, the helper can perform project -s once per new Home, and after restores or migration of existing trees. Existing nonempty trees need a recursive labelling pass while writers are quiesced. Record a stable unique Home-to-project mapping per filesystem; do not reuse an ID while any charged inode remains, including outside paths and open unlinked files. /etc/projects is a userspace convenience, not a kernel requirement.
Usage read test: direct unprivileged quotactl(QCMD(Q_XGETQUOTA, PRJQUOTA), /dev/loop0, ID, ...) returned EPERM. Unprivileged xfs_quota quota silently returned no rows with exit zero, whereas sudo returned the row. Therefore do not interpret an empty CLI response or exit zero as a zero-byte Home. An unprivileged limit command explicitly failed. Q_XGETQSTATV state inspection did succeed without capabilities.
Verbatim initial output:
Verbatim setup, reflink control, dedupe and restore output (the later sections discuss the same tests):
2. Accuracy, outside programs, renames and hard links
Test: after each operation, compare sudo quota records to an independent bytes-path os.walk/lstat count. The walker reports regular-file logical bytes per name, logical bytes per distinct inode, allocated st_blocks * 512 per distinct inode including directories, and unique inode count. Filenames are bytes, so invalid UTF-8 is supported. File writes were fsynced unless the test explicitly says otherwise. CLI block output is in KiB and converted to bytes; the direct XFS quota ABI uses 512-byte basic blocks. See fs_disk_quota ABI.
The 92 assertions passed in the final semantic run. Settled allocated block counts matched the walk. The initial run observed a recently unlinked inode still in quota after the walk stopped seeing it; inode accounting can await reclaim. The final checks assert it covers the live inode count rather than claiming instant path equality. Source confirms the returned usage includes current usage plus reservations, so it is an admission accounting snapshot rather than an atomic logical tree snapshot. See quota values returned by XFS.
Observed behavior:
Cross-project moves in the server therefore need explicit copy/clone-then-unlink with failure cleanup; they cannot rely on rename atomicity. Staging files must already carry the destination project (prefer staging inside that Home), otherwise rename into its inherited directory returns EXDEV. Distinct projects prevent hard links between Homes, but same-UID tools can relabel files or clear inheritance. This is accounting for correctly labelled, trusted OS writers, not a boundary against an inode owner deliberately escaping a quota. Restrict access to unprojected directories and audit/repair labels after administrative operations.
Verbatim complete final semantic run:
3. Reflink and dedupe privacy
Tests: GNU cp --reflink=always across projects, plus direct FIDEDUPERANGE with a 4 MiB identical range. Both succeeded; FIDEDUPERANGE returned status 0 and 4194304 bytes deduplicated. Both projects continued to charge the full 4194304 bytes. Clone edits preserved source content. Deleting either peer left the surviving peer fully charged. The full output appears in sections 1 and 2.
The control test used three separate pairs: no clone; live clone in another project; clone created and then deleted. Each original was 4 MiB, then received the same 4096-byte overwrite followed by fsync/close. Verbatim:
This distinguishes the existence of a peer through the writer's resulting usage. No claim is made that an idle surviving file's quota changes directly on peer deletion; that did not happen in the tested sequence. The failed strict-privacy condition is the subsequent local edit. Reducing CoW hints, trimming reservations, or hiding/coarsening displayed usage were not tested as fixes; they would need separate privacy and enforcement tests. Raw XFS usage must not be represented as proven invisible dedupe for T-A2.
4. Read cost at 1, 100 and 10000 projects
Test: create 1, then 100, then 10000 newly labelled projects, retaining earlier semantic-probe projects. These are dataset sizes, not exact totals on the filesystem. For each stage run one quota read, 10000 repeats of one Home, and 10000 seeded random Home reads through xfs_quota quota -p. One warmup then seven measured processes; check every requested row was returned. All output was captured. The batch includes formatting and amortized sudo/CLI startup. No privileged direct-syscall benchmark was possible under the sudo allowlist; the unprivileged direct syscall only tests EPERM.
Warm lookup cost is effectively constant per Home over this range, around 4.2 microseconds/request for the batch, easily small enough for upload admission. Single-process-per-upload CLI use costs about 8 ms; a persistent helper avoids most startup overhead. The kernel uses an indexed per-ID dquot lookup, with radix-tree cached records, rather than walking the Home or all projects. See XFS dquot lookup. This supports the requested O(1)-per-Home operational conclusion; it is not a proof of constant cold disk latency under every filesystem size or contention level. Mutex contention, cold cache, many-mount summation and production load were not measured.
This specific local mount measurement ran through timeout 360 /usr/local/bin/build-slot.sh python3 .../query-cost.py, holding one build slot. The task specifically supplied the local mount for this measurement; no application perf harness or VM performance gate ran. No cache drop was authorized on this host, so these are warm results only, not cold or production budget claims.
Verbatim output:
5. Enforcement and application errors
Tests: set a 1 MiB hard limit; a separate Python process with O_SYNC repeatedly writes 4096-byte blocks. It stopped after exactly 1048576 bytes with ENOSPC (28). Creating another file under the exhausted project also returned ENOSPC. Cloning a 2 MiB file into a project with a 1 MiB hard limit failed with the same error. Thus outside tools are constrained, including reflinks.
XFS project quota failure is not EDQUOT on this kernel. The project-specific ENOSPC return is explicit in XFS quota reservation; other quota types return EDQUOT. A tiny 64 KiB limit even rejected file creation at open before any data write, consistent with filesystem reservation needs. A limit need not translate to exactly usable payload bytes, especially with directories, metadata and staging/replacement space.
With bsoft=1m and bhard=4m, a 2 MiB write was allowed during the default seven-day grace. Only the test project's timer was changed to one second; poll allocations until the actual refusal, not a fixed sleep or rounded CLI timer text. The expired soft limit returned ENOSPC. Global grace was not changed, and the probe limits were cleared afterwards.
The OS caller gets an ordinary catchable I/O error and may have a partial file. The product server's HTTP error response is untested. A future adapter must map ENOSPC/EDQUOT, clean temporary/partial files, and handle errors at create/write/fsync/clone/rename. Distinguish a quota refusal from a genuinely full mount via the helper where useful. Current core error catalogue maps StorageQuota to HTTP 413, and promises small files/notes still save; a blanket filesystem hard limit blocks allocations from those writers too. Preserve that policy deliberately if adding enforcement; this feasibility probe does not change it.
Verbatim hard-limit and initial soft-grace output:
Verbatim successful soft-grace enforcement test:
6. Inheritance, restore and absent accounting
Tests: a new subdirectory inherited both the project ID and PROJINHERIT; its new file inherited the ID. A project-zero file could not rename into the inherited Home: EXDEV. GNU mv then copied it into a newly created inode with the Home's ID and removed the source. The project ID is not silently lost on a normal rename into a correctly inherited root; that rename is rejected. Moves outward and explicit owner relabelling are the converse risks described in section 2.
GNU tar 1.35 --xattrs --acls -cpf / -xpf did not preserve the source project ID or inheritance in a newly created, unprepared destination. Both nested dir and file had project zero. The exact same archive restored into a prepared inherited root used its destination project, including inherited subdirectories. Running unprivileged project -s recursively after restoring repaired the unprepared tree. These are ioctl-backed inode attributes, not ordinary named xattrs that --xattrs alone promises to preserve. Do not admit writes based on restored quotas until recursive setup/check finishes. rsync is not installed and was not tested; do not assume rsync -a or -X preserves these attributes. Reapply project setup after any restore unless that restore path is specifically verified. The actual tar and inheritance output is in sections 1 and 2; project -c verification is below.
Startup test: direct unprivileged Q_XGETQSTATV reported flags 0x30: project accounting ON, enforcement ON. Decoder tests for zero flags and accounting-only flags are explicitly simulated. A live no-prjquota XFS mount was NOT tested: no mount privilege is available, and turning accounting off would require remounting to restore it. I did not alter the supplied mount's accounting or enforcement state.
At startup, inspect each configured data mount, query Q_XGETQSTATV and require FS_QUOTA_PDQ_ACCT for this backend; require FS_QUOTA_PDQ_ENFD too if relying on kernel hard limits. Confirm the privileged usage read actually works and validate the Home's project ID/inheritance. Handle unsupported/version/error states explicitly; EPERM means the reader lacks permission, not that usage is zero. If accounting is absent or unavailable, use the requested full-Home recount backend on change and before upload admission while a change is pending. Keep pending state through any concurrent changes and serialize upload reservations. An unavailable watcher needs a recount before every admission or an explicit readiness failure, not a falsely clean cached count. If the fallback remains logical while XFS is allocated, backend changes change user-visible usage: this is another reason not to ship a silent direct substitution.
For #731's two-disk Home, each filesystem has independent project accounting. Label both trees, sum both mount records and coordinate admission/reservations across them. Giving each mount the full Home limit permits twice the global quota. Tiering moves across mounts require copy/unlink and can temporarily need both charges. Those multi-mount crash and concurrency cases were not exercised here.
Verbatim startup test:
Verbatim GNU du, buffered-write and recursive project-check tests:
7. ext4
Untested. A read-only mount inventory showed / is ext4 with rw,relatime,discard,errors=remount-ro, without configured project quotas. There is no supplied ext4 project-quota test mount. No ext4 image was made or mounted, and no test files were written to another disk for this question. XFS results must not be generalized to ext4. rsync was also explicitly unavailable.
Verbatim inventory:
Evidence and limits
Scripts are one-shot probes with fixed, reserved scratch names/project IDs; use a fresh namespace before rerunning. The query dataset uses IDs 1760000 through 1769999; semantic/setup tests use IDs near 1754001 through 1754405. Scratch files were retained for inspection and limits cleared. Nothing was committed to the repo.
Harness corrections are preserved in the raw logs: the first parser read the wrong CLI column; an initial strict inode-equality assertion exposed deferred reclaim; enforcement initially assumed EDQUOT and then assumed rounded zero timer text meant the kernel had expired it. The final tests use the correct column, state the reclaim limitation, check ENOSPC, and poll the actual allocation error. These are not hidden application test successes. The early runs are in semantics-first.log / extra.log / enforcement.log; successful final evidence and explicitly labelled excerpts are reproduced above. The extra and enforcement scripts were corrected afterwards, syntax checked, and a fresh independent verification gate below rechecks the actual filesystem evidence. No full product test suite was needed or run because product code was unchanged.
The remaining untested items are ext4 project quotas, rsync-specific preservation, a live XFS mount without accounting, privilege-granted/nonowner/user-namespace variations, product HTTP behavior, cold cache, restart/crash persistence and multi-mount admission. The no-go conclusion does not depend on those gaps: logical/allocated incompatibility and the controlled sharing-dependent charge were directly observed.
Completion and final gate
Finished. Head SHA:
a779a46f42(unchanged from base). Fresh verification reran the sharing control, hard-limit error, live usage comparisons and permission/state checks. This is a probe evidence gate, not a claim that product builds or the proposed replacement pass. Verbatim gate output:Starting slice 1 on feat/tiering-731 from origin/dev at
d83e54dbe5. Reading T-A1, T-A2, T-A3, FO1, ADRs and repository guidance before implementation. Local Cargo commands will use one build slot and -j3 to follow the shared-host hard rule; the later -j12 request conflicts with that rule. No perf workloads will run locally.Finding from base
d83e54db: Notes stores one physical notes_dir in Home, and scan, watcher, search and room reads join paths directly to it. Attachments has a separate one-root reader and writer using beneath::Folder. Auth quota owns a single Usage counter. No DAV/WebDAV file routes exist in this base (only a future DAV installation kind). CLAUDE.md is absent from both /home/agent/calternal and this worktree. The implementation must introduce a shared joined namespace rather than merely sending each app to a different disk. Format claims will be supplied by format owners; storage will not inspect extensions. T-A3 will conservatively defer online retirement where verified write exclusion is unavailable; an explicit offline pass requires all outside writers stopped.Started the documentation-only plan on branch
docs/tiering-731-plan, based onorigin/devatd83e54dbe571b625504001a8b6add90d44ca6161(the #736 amendment). Reading all #731 decisions, ADRs 0062–0064, repository guidance, current storage paths and performance gates before writingdocs/plans/0731-tiering.md. No product code, merge or deployment.Findings for the plan, against base
d83e54db: (1) CLAUDE.md is absent in /home/agent/calternal and this worktree, and a scoped filename search of the repo/worktrees found no CLAUDE.md or AGENTS.md. I will use the binding instructions and accepted ADRs. (2) notes/src/rename.rs:210 reads one notes_dir; notes/src/lib.rs and the scan/search/room paths likewise use a physical root. A shared joined reader must replace these call sites, not just change placement. (3) ADR 0062 T-A3 rules out retiring an inode on the strength of hashes/watchers alone. The safe initial limit is deferred retirement without proved exclusion, plus offline completion. (4) #731 comment 69181 rejects raw XFS project usage as logical quota and shows a CoW allocation side channel (4321280 versus 4194304 bytes after the same local edit). The plan will require logical accounting over the joined Home and keep physical allocation admin-only. These are design findings; no implementation or performance result is claimed.Plan review finding: reference-only WIP
5fce7ebuses one per-person serial mutex around Home::list, recursive usage and import placement. Its namespace::entries enumerates and sorts the whole folder, and placement::place calls that enumeration for name admission. At 50,000 siblings this makes paging/import and unrelated work wait on folder size. The plan requires paged SSD child lookup, bounded background discovery and no namespace mutex held during copy/hash I/O. Direct opens still include both-tree metadata costs in the unchanged 15 ms gate; the first code PR must measure those costs rather than assume they fit.Final self-review finding: checking a source path and then unlinking it leaves a namespace replacement race, even if the old inode is write-excluded. The plan now retires by no-replace rename into a protected holding directory, verifies the captured inode and bytes, then unlinks only the proved copy. It requires source and target write exclusion through retirement, and defers moves that would threaten the one-second materialization deadline. This adds explicit test boundaries rather than treating a hash or advisory lock as a safe deletion guard.
Resuming the documentation-only plan on docs/tiering-731-plan at
8c6e7b136f. I will check the plan against all issue decisions, ADRs 0062–0064 and the existing performance gates, then push the doc and open a PR into dev. No product code, merge or deploy.Resume finding: checkpoint
8c6e7b136fadds 191 evidence/browser files under .job-731; its parente7553c07eechanges only docs/plans/0731-tiering.md. The checkpoint is already on the remote branch, and no open PR uses that branch. I will preserve those local artifacts in the job folder and remove the checkpoint from this job branch before opening the documentation-only PR. The plan is 2,319 words; its prior length gate records four A4 pages. The issue decisions and ADRs agree on fail-closed disk loss, full-upload-first server-wide dedupe, deferred source retirement without write exclusion, and protected Home recovery.Final plan check found one wording problem in the property-model postcondition: it required replay to converge without conflicts, while section 3 and ADR 0062 require distinct outside versions to survive as conflicts. It now says no duplicate events or duplicate conflict files. Legitimate conflicts remain required. Fresh Forgejo rendering returns HTTP 200, all seven requested sections and both tables render, and all five relative links resolve. Only docs/plans/0731-tiering.md is in the proposed diff; checkpoint artifacts are preserved outside the repo.
PR #761 is open into dev at
2cf7e3fbd8. The fresh PDF length check is currently blocked waiting in /usr/local/bin/build-slot.sh; no renderer output or PDF has appeared yet. I am leaving other jobs undisturbed. Fresh Markdown, link, section, diff and scope checks have passed. The previous 2,319-word version rendered to four A4 pages; the final version is 2,321 words. I will post the final gate output once the queued render completes. No product tests or performance measurements are claimed.The shared slot became available. The first fresh PDF render exited 133 before producing a PDF, with: chrome_crashpad_handler: --database is required. This is a local Chromium setup failure, not a product or plan failure. Retrying through the same build-slot wrapper with XDG config and cache directories explicitly isolated inside the job folder. Head remains
2cf7e3fbd8; PR #761 and the document are unchanged.Finished the documentation-only storage tiering plan. PR: #761 (Plan: storage tiering (#731), into dev).
Branch: docs/tiering-731-plan. Base:
d83e54dbe5. Head:2cf7e3fbd8. Only docs/plans/0731-tiering.md changes; four A4 pages. The checkpoint artifacts are excluded from the proposed history and preserved outside the repo. Nothing merged or deployed; #731 remains open.The queued fresh render passed after the isolated Chromium config/cache retry (exit 0). Markdown, links, length, requirements and clean scope all pass. No product code or performance result is claimed.
Gate output verbatim:
Independent design review of PR #761 started. Review worktree: detached at origin/docs/tiering-731-plan. Base and reviewed SHA:
2cf7e3fbd8. I will check issue decisions, ADRs, current storage paths, operation costs, concurrency and recovery, and test coverage. No product code or branch pushes are planned.Independent review of PR #761 at
2cf7e3fbd8.B1. Ordinary saves need the same old-inode protection as tier retirement
Plan: lines 33, 73, 76–77, 94–96, 177–186. Code: fsio/swap.rs, particularly
after_swapat lines 191–219;notes/src/room/save.rs:153–199.Scenario: an outside program holds a writable descriptor to a note. Calternal checks the old bytes and exchanges its freshly synced snapshot into the public name. The outside program writes and fsyncs through its old descriptor. The current writer sees the same device/inode at the displaced temporary name and unlinks it. Closing the outside descriptor destroys that durable outside version. This does not require a tier move or dedupe.
A deterministic syscall probe reproduced this sequence. The current guard compares device/inode, not a guarantee that the inode cannot change. Adding a final hash/version check merely moves the last race boundary: the outside write can follow that check. The plan explicitly requires exclusion for retirement/dedupe but still describes ordinary saves as reusable “guarded placement.” Its outside-write row therefore assumes a stronger primitive than the existing one provides.
Required revision: cover every destructive replacement/cleanup, including saves, companion updates, undo and restore. Define either verified exclusion or retention of displaced writable versions with a safe reclamation rule. State what happens to FO1's one-second requirement when such protection cannot be obtained. Put this exact old-descriptor schedule in the materialization gate, before tier moves are enabled. “Pending move” alone does not solve a save that already acknowledged typing.
Independent review of PR #761 at
2cf7e3fbd8.B2. Home-only recovery lacks a byte-complete transaction and a restartable bootstrap
Plan: lines 50–59, 70–80, 177–179. Decision: ADR 0062:404–458; ADR 0063:64–85.
Scenario 1: updating a contact replaces its note, then crashes before replacing the original-card companion. State is lost at the same time. The specified intent fields are paths, IDs, expected versions/hashes, directory identities and progress. None reconstructs the missing new card, including an unknown field or original inline photo, or necessarily restores the overwritten old note. A record saying “finish the pair” is insufficient if its only complete payload was in state. The permitted pre-materialization loss window does not license leaving an incoherent materialized pair with neither a complete old nor complete new version available.
Scenario 2: empty-state reconstruction creates some databases and crashes. Next startup sees nonempty, incomplete state. The plan says to preserve/refuse corrupt nonempty state, but also promises repeated recovery is idempotent. It does not identify a durable rebuild generation/marker that distinguishes its own interrupted bootstrap from foreign corruption. Refusing forever after the first interrupted rebuild violates the recovery requirement.
Scenario 3: a revocation reaches the Home log before the state transaction, or the state transaction commits before its final Home proof. Crash between them, then lose state. “Current auth” and “Home proofs precede acknowledgements” do not identify the commit point or resolve which authorization generation is authoritative. Falling back to an older complete snapshot can resurrect a revoked credential; refusing all partial snapshots can make an otherwise recoverable Home unusable.
Required revision: give a small state machine with its durable commit point, immutable byte payload/staging ownership, authorization sequence, paired-file recovery rule, snapshot/log cutoff and retirement rule. Specify creation and fsync of the recovery directory and all changed parents on their own filesystems. Show how a new complete snapshot plus its log suffix replaces the old generation without a gap, how torn tails differ from corrupt committed records, and how recovery itself resumes after each boundary. This is a design requirement, not a request to write the implementation in this PR.
Independent review of PR #761 at
2cf7e3fbd8.B3. Quota is not reconciled with the actual whole-Home owner or a consistent two-tree scan
Plan: lines 117–126; operation table at 30–38. Code on quota branch: usage.rs, lines 1–26, 188–255;
usage/scan.rs:52–110;auth/src/quota.rs:74–108.perf/quota-simplecounts the whole physical Home, charges every regular-file name including hard-link aliases, fences directory/inode events, excludes foreign mounts, and refuses admission on incomplete coverage. Admission joins or runs a fresh recount with an approximately two-second deadline. It does not already implement the plan's stable logical-ID event ledger or journal-staging exclusions. Simply routing it through the paged reader changes its correctness mechanism.Scenario: count SSD before an outside cross-tree move/copy-delete and HDD afterwards. The file can be counted twice, or neither time in the reverse schedule. If watcher delivery is delayed or lost, a logical commit generation need not change at all. Even an app tier move changes its physical copies without changing logical usage. A cursor that crosses commit generations or skips a “pending” prefix cannot certify a fresh whole-Home total. A separate contact-history provider can change between the file walk and provider read as well.
Scenario: a large dirty Home requires a cold recount before an upload. One million entries in two seconds requires at least 500,000 entries/s before watch installation, inode coverage and fence costs. The plan budgets 120 seconds for reconciliation but omits quota admission from the cost table. It neither promises successful admission for that Home nor explicitly chooses retryable unavailability. Replacing a cold walk with an index lookup without proving freshness is unsafe.
Required revision: agree an owner contract that covers both roots under one validated observation/fence, membership and move receipts, contact-history/provider generations, failed entries, raw names, native overflow, mounts and reservations. Define whether pending scans retry, restart or retain a pinned generation; bound retries and make unknown usage fail closed. List create/upload, overwrite, Trash/restore/purge, cancellation, outside changes and state-loss reservation recovery explicitly. Add recount/admission cost and availability budgets at 100k/1M. Preserve the branch's known failure vectors instead of reducing the problem to “no double-release.”
Independent review of PR #761 at
2cf7e3fbd8.B4. The 15 ms open is not established by construction
Plan: lines 32, 45–46, 100–108, 171–173. Code:
notes/src/lib.rs:253–285;home.rs:237–241,291–295; index.rs:144;scan.rs:144–160; room/load.rs:44;history.rs:803–823.The proposed joined lookup removes enumeration from one layer, but the current caller still has these costs:
ids.jsonl; reopening an unloaded index does the same under its mutex: O(N) bytes/entries.Scenario: open one cold note after index unloading, with 100k siblings, 100k historical edits and HDD metadata displaced by a recount. The reader can do zero directory enumeration and still miss the gate badly. Returning “pending” in 1 ms is not a successful 15 ms note open.
Required revision: name the replacement of the full index reload, the ID lookup and incomplete-index behavior, bounded checkpoint plus tail replay without pruning history, and the cold-HDD strategy/latency allocation. Keep exact-path conflict probes if required, but acknowledge that they make 15 ms a measured feasibility gate, not a consequence of the big-O expression. Separate successful completion latency from pending/error response latency. Current perf opens only 24 sampled editor notes (
crates/perf/src/scenarios/open.rs:12–26); ensure the gate covers cold first-person use and history-heavy notes rather than a namespace microbenchmark.Independent review of PR #761 at
2cf7e3fbd8.B5. Full-upload-first does not make physical-capacity errors invisible across users
Plan: lines 183–192. Decision: issue #731 comment 67049, T-A2.
Scenario: B uploads and receives a full-file acknowledgement. Background work can reclaim that independent allocation by cloning A's matching file. Near physical exhaustion, B's next upload succeeds in the matching case and fails ENOSPC in the unmatched case. Logical quota and a logical free-space display can be identical in both worlds. A generic error string still leaks through success versus failure. The same issue affects copy-on-write headroom, snapshot/companion placement and FO1 materialization. Deduplication being delayed until after the first acknowledgement does not erase later observations.
The plan says errors reveal no match, but supplies no physical capacity reservation/admission policy that makes this true. Its finite timing gate also examines only p50/p95 within ±5%. A repeatable difference under that margin, in tails, or in post-dedupe read/write latency can still be an existence signal. This is not resolved by hiding XFS usage; the issue's quota probe already warns against sharing-dependent physical accounting.
Required revision: explicitly gate dedupe on a capacity/headroom and resource-isolation policy, with a safe disabled outcome if the strict T-A2 promise cannot be established. Test controlled near-full disks, delayed dedupe, peer purge, identical local edits and repeated adaptive observations, including binary success/error outcomes and later operations. State the measurable threat/observation model honestly; two quantiles and an isolation audit do not prove “no timing path.” Do not silently weaken T-A2 or claim the current design meets it.
Independent review of PR #761 at
2cf7e3fbd8.S1. Descriptor safety needs an ownership/ancestor and mount policy, not just
beneathPlan: lines 61–65, 76, 79, 100–108. Code:
fsio/src/beneath.rs:52–82,223–250;calternal/src/storage.rs:99–118.Scenario: after the server opens
A/Work, an outside tool renames that directory elsewhere, then the server places a file relative to its still-open directory descriptor. Placement can succeed in the new location. The descriptor's inode identity is unchanged. A deterministic probe confirmed this. Post-placement detection cannot undo the period during which another namespace could see the bytes, and rollback itself can race a replacement.Separately, Linux
beneathusesBENEATH | NO_MAGICLINKS, notNO_XDEV; it permits a mount below the Home. Root role validation does not constrain such descendants. A same-filesystem bind mount can retain st_dev while introducing another ownership or quota domain. Mount disappearance beneath an already-open descriptor can also leave operations using a detached tree while the pathname now resolves elsewhere.Revision: state the trusted outside-writer privileges and supported namespace model. Define whether renaming ancestors is excluded during placement, what generation a pinned reader authorizes, and which mount identities are admitted/rechecked. Safest initial policy: reject/report nested mounts and unsupported topology consistently in reader, writer, migration and quota; do not follow them simply because path lookup remains beneath a root. Add rename-out, bind-mount and detached-root schedules. The existing two-process/root-lock row is useful, but should also test root/lock replacement and aliases with different state directories while a blocking writer outlives shutdown.
Independent review of PR #761 at
2cf7e3fbd8.S2. Raw names, aliases and case-only rename need explicit rows
Plan: lines 75–77, 87–93, 103–108. Code:
fsio/src/beneath.rs:104–115;notes/src/rename.rs:210–224;fsio/src/lib.rs:109–146; quota branchusage/scan.rs:83–101.Scenario: two names with raw bytes
ff 2e 6d 64andfe 2e 6d 64both become the same replacement-character string under lossy UTF-8 conversion. CurrentFolder::namesanddisk_namesuse that conversion. The kernel probe confirmed the collision. A Unicode-folded index cannot use that lossy string as a safe write/delete identity. Silently dropping them from the joined scan can also undercount quota.Scenario: outside hard links alias a file within a Home or into another accessible tree; a write through an alias is missed by path-only watching. Symlinks can point into the other tier or form cycles. “No app-created hardlinks” does not define handling of outside aliases. Dedupe's independent-inode assumption and per-name quota rule need an explicit compatibility policy. True hard links across distinct filesystems are impossible, but SSD Home/state or two SSD Homes may share a filesystem; symlinks and bind aliases can span tiers.
Scenario: a case-only rename on a supported case-insensitive filesystem needs
source -> temp -> destination, as currentrename_safelyshows. Crash after the intermediate rename, or an outside create of either spelling, leaves more states than “two directory renames.” Also test NFC/NFD collisions and case changes of ancestors on both trees.Revision: preserve raw filesystem identity separately from display/portable keys; choose lossless representation or explicit preserved unsupported-entry status. Define symlink/hard-link behavior and per-name charges, link-count changes during operations, no-follow behavior and alias event coverage. Model every extra rename/fsync boundary. The eventual-observation limit for newly created outside case collisions is acceptable if stated; exact-path probes must not be presented as detecting all folded collisions immediately.
Independent review of PR #761 at
2cf7e3fbd8.S3. Sizes specify counts but not a capacity or aggregate workload
Plan: lines 15–23, 150–159.
Scenario: 200k photos averaging 8 MiB occupy about 1.53 TiB. Hashing all of them once in 120 seconds would require about 13 GiB/s, before metadata, reads for validation or other people. The plan does not necessarily require hashing them all in that interval, but “reconciliation” and “changed bytes” do not say whether content validation, indexing or only metadata discovery is complete. A first deployment, plugin update or fingerprint-index loss changes that answer dramatically.
Likewise 100 people each with 100k notes means 10M SSD notes; ten active large Homes means 1M active notes. The specified “one large Home, others sharing the remaining files” distribution does not test that case or establish a supported aggregate maximum. A 1 MiB/10k-line note is a useful regression fixture, but claimed text and original-card photos have no tiering size cutoff. H=100k edits gives no byte/CRDT-state budget without edit sizes. Queue/disk headroom and path depth are unspecified.
Revision: keep all existing counts, but add byte-size distributions and totals per tier, simultaneous versus individual maxima, aggregate active-Homes limits, note/history/photo-companion extremes, directory depth and empty-directory counts, RAM/cache/watch/FD budgets, and required temporary/recovery space. Define metadata discovery, full validation and dedupe completion as separate costs. Do not invent a placement-by-size rule to solve this.
Independent review of PR #761 at
2cf7e3fbd8.S4. “Every operation” omits important paths and understates some current work
Plan: lines 25–38, 110–126. Code:
fsio/src/lib.rs:95–160,318–358;fsio/src/usage.rs:287–341;notes/src/rename.rs:210–248;notes/src/room/save.rs:145–180;notes/src/history.rs:803–823.Scenario: reusing
rename_safelyfor a 10k-descendant folder invokesusage::moved, which scans the registered counter's entire file map while holding its state mutex. That is O(all counted files), not the advertised parent-ID switch. Existing note rename also enumerates all sibling disk names. The plan proposes stable parent IDs, but does not explicitly retire these old hooks and flat-path indexes; a reader seam alone leaves them intact. Per-entry B-tree mutations can add log N factors to K/R completion work, and rewriting links entails loading, editing, journaling and materializing the linking notes, not just changing an index key.Save also serializes current text, hashes it and encodes CRDT state. Tier-copy verification needs target rereads and source verification: say which bytes are read on each disk and when, not only O(B). Bulk fsio currently uses
syncfson Linux; reusing it can flush unrelated writes on the same filesystem, which matters for latency isolation.Revision: add upload/admission, classify/reclassify, dedupe, conflict retention, Trash/restore/purge, export/backup, auth snapshotting, Home-only rebuild, quota recount and rollback. Charge buffers, full content/CRDT passes, indexes and flushes to the actual owner and disk, and distinguish admission from successful durable completion. Define which old helpers/indexes are replaced in each slice. This need not be a huge table: operations sharing one protocol can refer to it with their differing byte/entry costs.
Independent review of PR #761 at
2cf7e3fbd8.S5. The one-second maximum needs a deadline protocol and an explicit fault boundary
Plan: lines 33, 66, 78, 163, 177–179. Code:
notes/src/home.rs:58–69currently uses 750 ms quiet and 5 seconds maximum;room/save.rs:83–123,145–199accepts live changes while a frozen save runs.Scenario: continuous typing is acknowledged just after the materializer freezes its snapshot. That acknowledged edit needs the next snapshot. An already-running copy, fsync, pair placement or merge occupies the necessary resource for another second. Deferring admission of new moves does not preempt that I/O. Existing scheduling cannot meet the new bound simply by changing placement disks. With an outside old-inode writer, B1's safe deferral can itself outlast the deadline.
Scenario: a Home becomes full or stalls immediately after an SSD ack. Reporting degraded status afterwards is correct, but cannot make that already-acknowledged edit satisfy a universal one-second guarantee. The ADR treats this as a visible failed gate, not permission to erase the sample.
Revision: define oldest-unmaterialized-ack tracking, coalescing/coverage semantics, maximum batching interval with execution headroom, scheduling/resource reservations, and when new acknowledgements are backpressured. Define coverage for an acknowledged edit subsequently undone/deleted, and deletion tombstones if applicable. Require deterministic clocks/barriers, independent durable pair reads, and report all misses even under faults. Say plainly that a stalled/unavailable disk can violate the target; do not promise an unconditional physical deadline.
Independent review of PR #761 at
2cf7e3fbd8.S6. Missed events plus preserved timestamps are missing from reconciliation
Plan: lines 55, 76, 87–89, 133–145. Code:
notes/src/scan.rs:7–10,397–410caches size and mtime;fsio/src/lib.rs:641–651uses wall time in temporary names.Scenario: an outside program rewrites a same-length file and restores its mtime, while events are lost; the clock can also move backwards. Reusing the current size/mtime scan treats it as unchanged. Classification, search and fingerprints can remain stale even though the journal never inferred a phase from timestamps. Avoiding timestamp-based replay is good but does not establish discovery freshness.
Revision: add equal-size/preserved-mtime replacement, inode reuse, backward/forward wall-clock jumps and missed events to the model and real tests. Use monotonic time for deadlines and durable sequence/unique IDs for protocol identity; specify how a full validation finds metadata-identical changes and charge that byte work separately. If only eventual content auditing is feasible, expose that exact limit and prohibit provisional metadata from certifying fresh quota or a dedupe candidate.
Independent review of PR #761 at
2cf7e3fbd8.S7. The test outline needs protocol-specific adversaries and anti-vacuity checks
Plan: lines 130–164, 183–192.
The first-code-PR timing is already explicit and correct. The problem is what those harnesses model. Maps of file versions plus syscall boundaries do not automatically model shared inodes, raw names, moved directory descriptors, mount IDs, sparse logical sizes, mmap writers, permission/ACL inheritance or partial overwrite of a journal record. A model with a magical safe replacement primitive will approve B1. A persistence model that always persists a whole intent at once will approve B2.
Scenario: all contended operations return pending forever. No half-action is acknowledged, unauthorized bytes stay hidden, and the invariants can pass, while useful successful opens/moves never finish. A reader-only first slice can also ship a generic crash harness without exercising the later byte-bearing pair/recovery protocol. “Interleave outside actions at every boundary” does not by itself check outcomes before an eventually quiescent replay.
Revision: require the concrete counterexamples above as named, shrunk vectors; short/partial writes and failed fsyncs on intent creation, phase append, checkpoint and cleanup; independent disk persistence orders; request cancellation after publication; duplicate requests during recovery; revocation with in-flight readers; cross-user alias/dedupe/move/quota interactions; and byte-exact Home-only bootstrap interrupted repeatedly. Test temporary/recovery ENOSPC and inode exhaustion separately from a full final destination. Make every slice activate its actual protocol hooks, and measure successful completion counts, pending duration, bounded queues/watch counts and quiescent progress under stated availability assumptions. The statistical gate must include B5's discrete outcomes, not only quantiles. Run tests on filesystems/topologies matching the claimed support; local syscall probes on the review host are not substitutes.
Independent review of PR #761 finished. Verdict: revise. Reviewed/head SHA:
2cf7e3fbd8(unchanged). Full review: #761 (comment)Five blocking gaps: ordinary-save old-inode protection; byte-complete Home recovery and restartable bootstrap; consistent two-tree whole-Home quota; unbounded open costs; dedupe capacity/error privacy. Seven should-fix findings and all evidence are in the review. All 12 findings have separate comments on this issue.
Local outputs: ~/codex-jobs/review-761/review.md and result.md. No product code, commits, pushes, merge, deployment or issue closure. No product/performance result is claimed.
Gate output verbatim:
kayg, 29 Oct: with server-wide dedupe, each user's quota counts every file they uploaded at full size, whether or not it was deduped. Dedupe saves space for the server only.
🤖 Generated with Claude Code
Round 2 design revision pushed to
docs/tiering-731-plan: b1e3ad02. Replaces the plan reviewed in comment 69394. Maximum three review rounds per change; no additional review round was started here.All blocking and should-fix findings are addressed by a mechanism or an explicit limit:
perf/quota-simpleatd0e6d6f6(three independent rounds passed). Requires one two-root observation/invalidation generation, native directory/inode fence, stable provider generations and existing fail-closed coverage rules. Every regular-file name counts full logical size, including deduped files and temporary/retained copies; no invented staging exclusions or second accounting ledger. Admission is ≤2 s or quietly retried; cold 100k/1M successful admission is not promised. Create/overwrite/Trash/restore/purge/cancellation/state-loss behavior is stated.ids.jsonlreload and flat paths with paged ID/child indexes; replace all-history replay with checkpoints and a ≤256-update/256 KiB tail without pruning history. Distinguish unavailable/pending from successful opens. Both-tree probes remain, with explicit latency allocation and cold-HDD/large-CRDT feasibility risk; failure blocks cutover. Cold first-person, index-reopen and history-heavy editor opens are required.after_swap, debounce and broadsyncfspaths.The failure table and second-pass five likely failures were rewritten. Final performance measurements now run only on x86_64 perf-test VMs with uncached 4K disks, using build-host binaries; never on
10by32-*because Mac RAM caches their reads.Validation: docs-only diff;
git diff --checkagainst both previous HEAD and PR base; relative links resolve; all 12 findings covered; four-page A4 print layout (10 pt body / 9 pt tables). Local print proof:/home/agent/codex-jobs/revise-761-round2/plan-print-check.pdf. No product build/tests, performance/crash runs, deploy, merge or production cutover.kayg referenced this issue2026-11-05 23:21:12 +00:00