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
Owner

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):

  • T1, tiering by kind: small user data (notes, contacts, money, calendar, tasks text) on the SSD; large user data (files, photos, media, note attachments) on the HDD.
  • T3, placement by content: decided by the content signature, never the extension. Text a format plugin claims goes to the SSD; everything else goes to the HDD.
  • T4 revised, mirrored real trees: both disks hold real files with real names in the user's own folder structure, each disk only its subset. Folder operations apply to both as one journaled step. Every view (app, File Provider, WebDAV, calternal mount) shows the joined tree.
  • Dedupe per disk at import: BLAKE3 fingerprint, per-disk index in app data, FICLONE from the existing file, source verified unchanged before and after. Needs a copy-on-write filesystem on BOTH disks (XFS reflink=1). ext4 works without dedupe. A Health check probes reflink support at startup. "Already uploaded" only ever considers your own files.
  • T5 inbox and direct drops: a background pass dedupes files and moves any on the wrong disk.

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

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):** - **T1, tiering by kind:** small user data (notes, contacts, money, calendar, tasks text) on the SSD; large user data (files, photos, media, note attachments) on the HDD. - **T3, placement by content:** decided by the content signature, never the extension. Text a format plugin claims goes to the SSD; everything else goes to the HDD. - **T4 revised, mirrored real trees:** both disks hold real files with real names in the user's own folder structure, each disk only its subset. Folder operations apply to both as one journaled step. Every view (app, File Provider, WebDAV, `calternal mount`) shows the joined tree. - **Dedupe per disk at import:** BLAKE3 fingerprint, per-disk index in app data, FICLONE from the existing file, source verified unchanged before and after. Needs a copy-on-write filesystem on BOTH disks (XFS reflink=1). ext4 works without dedupe. A Health check probes reflink support at startup. "Already uploaded" only ever considers your own files. - **T5 inbox and direct drops:** a background pass dedupes files and moves any on the wrong disk. **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](https://claude.com/claude-code)
Author
Owner

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 approved storage break test. Worktree /home/agent/wt/storage-break is detached at origin/dev, base SHA 3d0c6e33d588335c745a660163bf8bf5cdc8412d. 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.
Author
Owner

Starting the docs-only ADR 0062 tiering amendment on branch docs/adr-0062-tiers, based on origin/dev at 3d0c6e33d588335c745a660163bf8bf5cdc8412d. 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.

Starting the docs-only ADR 0062 tiering amendment on branch `docs/adr-0062-tiers`, based on `origin/dev` at `3d0c6e33d588335c745a660163bf8bf5cdc8412d`. 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.
Author
Owner

Finding: origin/dev at 3d0c6e33d588335c745a660163bf8bf5cdc8412d has 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: `origin/dev` at `3d0c6e33d588335c745a660163bf8bf5cdc8412d` has 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.
Author
Owner

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: 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).
Author
Owner

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.

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.
Author
Owner

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.

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.
Author
Owner

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 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/<uuid>/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.
Author
Owner

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.

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.
Author
Owner

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.

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.
Author
Owner

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:

  1. T-A1. Partial app reads after disk loss? Refuse all app access until the
    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.
  2. T-A2. Physical dedupe across people? May import clone another person’s
    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.
  3. T-A3. How do direct writers coordinate with tier moves? Require per-file
    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:

PASS Markdown: Forgejo GFM render HTTP 200; 15 headings, 1 table, 7 break tests, 3 open questions.
PASS Links/anchors: 9 relative file links resolve and render correctly; 4 fragment links resolve to rendered heading IDs.
PASS External links: 2 targets checked HTTP 200 (issue through authenticated repo endpoint).
PASS git diff --check: exit 0.
PASS Scope: only docs/adr/0062-user-files-on-hdd-app-data-on-ssd.md changed; no untracked repository files.
PASS Requirements review: T1/T3/T4/T5, file-over-app, per-disk dedupe, disk loss, guarded moves, both migration sources, break/perf plans, and T-A1/T-A2/T-A3 covered.
NOTE Cross-disk moves retain one authoritative version; temporary physical duplicates are unavoidable and replay removes them safely.
NOTE Docs-only: implementation, crash and performance gates are specified, not executed.
Finished the docs-only ADR 0062 amendment in place. PR: https://git.kayg.org/kayg/calternal/pulls/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: 1. **T-A1. Partial app reads after disk loss?** Refuse all app access until the 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. 2. **T-A2. Physical dedupe across people?** May import clone another person’s 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. 3. **T-A3. How do direct writers coordinate with tier moves?** Require per-file 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: ```text PASS Markdown: Forgejo GFM render HTTP 200; 15 headings, 1 table, 7 break tests, 3 open questions. PASS Links/anchors: 9 relative file links resolve and render correctly; 4 fragment links resolve to rendered heading IDs. PASS External links: 2 targets checked HTTP 200 (issue through authenticated repo endpoint). PASS git diff --check: exit 0. PASS Scope: only docs/adr/0062-user-files-on-hdd-app-data-on-ssd.md changed; no untracked repository files. PASS Requirements review: T1/T3/T4/T5, file-over-app, per-disk dedupe, disk loss, guarded moves, both migration sources, break/perf plans, and T-A1/T-A2/T-A3 covered. NOTE Cross-disk moves retain one authoritative version; temporary physical duplicates are unavoidable and replay removes them safely. NOTE Docs-only: implementation, crash and performance gates are specified, not executed. ```
Author
Owner

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.

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.
Author
Owner

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.

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.
Author
Owner

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.

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.
Author
Owner

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, detached origin/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

  1. 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 in state/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.import with {"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.

  2. 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 were Rename 7; notes.job was 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.

  3. Medium: SIGKILL leaves note staging files indefinitely. First ext4 run left 550 hidden .calternal-tmp-*.md files, 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.py is 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.

  4. Contract discrepancy: empty-state automatic reconstruction is deliberately unsupported. With CALTERNAL_NOTES_SAVE_MS=600000, notes.append returned HTTP 200; the new marker was in notes.get and absent from every Home file. After SIGKILL, presenting an empty state root refused startup, with and without --create. Corrupt auth refused with file is not a database. This matches ADR 0062 and docs/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:

{"canonical_file_matches_API": true, "acknowledged_tokens_exactly_once": 1000, "orphan_staging_files_after_additional_restart": 550}

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:

{"rounds": 25, "sigkills": 25, "acknowledged_appends": 25, "operation_counts": {"0": 4, "1": 4, "2": 4, "3": 4, "4": 3, "5": 3, "6": 3}}
{"rounds": 50, "sigkills": 50, "acknowledged_appends": 50, "operation_counts": {"0": 8, "1": 7, "2": 7, "3": 7, "4": 7, "5": 7, "6": 7}}
Traceback (most recent call last):
  File "/home/agent/wt/storage-break-report/harness-cross.py", line 78, in <module>
    settle(result[1]['result'])
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/home/agent/wt/storage-break-report/harness-cross.py", line 23, in settle
    assert report['state']=='running',report
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: {'done': 0, 'error': "We couldn't find that.", 'job': '2f1f5288fc99868ccb39520b395ad53c', 'kind': 'rename', 'notes': ['7e9af9a0-f9be-8524-8fc6-b0a662d1f1d7'], 'state': 'failed', 'steps': 2, 'summary': {'from': 'Trash fixture 57.md', 'note': '7e9af9a0-f9be-8524-8fc6-b0a662d1f1d7', 'title': 'Trash fixture 64', 'to': 'Trash fixture 64.md'}}
{"SQLite_quick_checks": 4, "all_ok": true}
cross-filesystem harness exit=1 elapsed_seconds=3.662
Traceback (most recent call last):
  File "/home/agent/wt/storage-break-report/cross-mount.py", line 18, in <module>

Rename-only reduction output, verbatim:

{"FOUND_RENAME_RECOVERY_FAILURE": true, "round": 8, "sigkills": 8, "before_kill_responses": [], "job": {"done": 0, "error": "We couldn't find that.", "job": "cacad5952f85009ff252f6709a1af23c", "kind": "rename", "notes": ["7f5fcf19-92aa-828a-89c2-0d457ce6ac14"], "state": "failed", "steps": 2, "summary": {"from": "Rename 7.md", "note": "7f5fcf19-92aa-828a-89c2-0d457ce6ac14", "title": "Rename 8", "to": "Rename 8.md"}}, "note": [200, {"result": {"id": "7f5fcf19-92aa-828a-89c2-0d457ce6ac14", "lineage": "1f544c3246774fbc808b66c1118e6732", "path": "Rename 8.md", "text": "---\ncalternal-id: 7f5fcf19-92aa-828a-89c2-0d457ce6ac14\ndate: 2026-10-28T17:21:21+00:00\nlast edited: 2026-10-28T17:21:21+00:00\ntitle: Rename 7\n---\n# Rename 7\nkeep these bytes\n", "title": "Rename 7", "version": 15}, "token": "24ed38e5f2f7-25", "replayed": false}], "retry_response": [200, {"result": {"done": 0, "error": null, "job": "cacad5952f85009ff252f6709a1af23c", "kind": "rename", "notes": ["7f5fcf19-92aa-828a-89c2-0d457ce6ac14"], "state": "running", "steps": 2, "summary": {"from": "Rename 7.md", "note": "7f5fcf19-92aa-828a-89c2-0d457ce6ac14", "title": "Rename 8", "to": "Rename 8.md"}}, "token": "24ed38e5f2f7-24", "replayed": false}]}

Original-card location after a clean graceful shutdown, verbatim:

{"graceful_shutdown_exit": 0, "opaque_original_in_Home": [], "opaque_original_in_state_vcf": ["users/0b0e0f0a-1111-4222-8333-944455556666/contacts/raw/bf33903d-c2ad-8b91-880e-cdaa1f585ca4.vcf"]}

Layout, misuse and recovery

Initial Home/state were separate directories on /dev/sda1 ext4. 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:

{"Home_dev": 54, "state_dev": 57}
{"full": "full-state", "fill_error": "[Errno 28] No space left on device", "free_bytes": 0}
{"full": "full-state", "append": [500, {"error": {"code": "internal", "message": "Something went wrong on our side. Trying again might help.", "request_id": "01a18383-8f37-734b-86c0-070404c9dde5", "retryable": true}}]}
{"full": "full-state", "save": [500, {"error": {"code": "internal", "message": "Something went wrong on our side. Trying again might help.", "request_id": "01a18383-8f3a-770e-bbbe-e1c7ef7ea85c", "retryable": true}}]}
{"after_recovery": "full-state", "token_present": false}
{"full": "full-home", "fill_error": "[Errno 28] No space left on device", "free_bytes": 0}
{"full": "full-home", "append": [200, {"result": {"version": 2}, "token": "9bc86634001d-2", "replayed": false}]}
{"full": "full-home", "save": [503, {"error": {"code": "not_saved_yet", "message": "Not saved yet. Trying again.", "request_id": "01a18383-9240-72f9-b149-9558d38003ff", "retryable": true}}]}
{"after_recovery": "full-home", "token_present": true}
{"readonly_mount": "refused", "error": "startup exit 1"}
{"FINAL": "FULL DEVICE AUDIT COMPLETED", "layout": "two isolated 32MiB tmpfs mounts in private user/mount namespace"}

Task rebuild, verbatim:

{"task_rebuild": {"group_by": "status", "groups": [{"count": 1, "items": [{"broken": false, "completed": null, "created_ms": 1793207800000, "due": null, "id": "a9f8448f-e57c-8b96-b995-cbbc83534834", "important": false, "overdue": false, "path": "Break task.md", "pinned": false, "priority": null, "repeat": null, "scheduled": null, "status": "todo", "tags": ["work"], "time": null, "title": "Break task", "updated_ms": 1793207800000, "urgent": false, "waiting": false, "waiting_on": null}], "key": "todo"}], "incomplete": false, "more": false, "total": 1}, "task_text_preserved": "---\nstatus: todo\ntags: [work]\ncalternal-id: a9f8448f-e57c-8b96-b995-cbbc83534834\ndate: 2026-10-28T17:16:40+00:00\nlast edited: 2026-10-28T17:16:40+00:00\n---\n# Break task\nplain task metadata\n"}

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-std did 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.sh job at a time, cargo -j3; no Playwright was needed. Build: source /etc/calternal/env.sh; cargo build --locked -p calternal -j3 passed in 52.82s. Targeted command: cargo test --locked -p calternal -j3 --test storage_startup --test notes_crash --test notes_crash_typing --test attachments_crash -- --nocapture passed: 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. After bun 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:

test result: ok. 31 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 85.45s
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.47s
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.33s
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.01s
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 8.13s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.02s
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.70s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s
test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 1.49s
test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.33s
test result: ok. 10 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 13.91s
test result: ok. 19 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.85s
test result: ok. 29 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.64s
test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.58s
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.30s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.36s
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.25s
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.13s
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.39s
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.27s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.81s
test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.73s
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.43s
test result: ok. 2 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 6.71s
test result: ok. 19 passed; 0 failed; 3 ignored; 0 measured; 0 filtered out; finished in 7.28s
test result: ok. 10 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 125.42s
test result: ok. 14 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 3.64s
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.53s
test result: ok. 24 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 1.78s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.09s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 27 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.65s
test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s
test result: ok. 130 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 73.22s
test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.28s
test result: ok. 15 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.83s
test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.51s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 35 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.46s
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 37 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.67s
test result: FAILED. 424 passed; 1 failed; 6 ignored; 0 measured; 0 filtered out; finished in 463.88s
Remaining workspace packages:
test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.70s
test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s
test result: ok. 12 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 1.88s
test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.44s
test result: ok. 28 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 10.42s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Workspace doc tests:
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

All recorded gate exit lines, verbatim (initial harness failures retained transparently):

post-kill inventory exit=1
startup/file audit exit=1
private full-device audit exit=1
storage/crash suites exit=0
split fault-injection suite exit=0
workspace tests exit=101
corrected inventory exit=1
corrected startup/file audit exit=0
corrected private full-device audit exit=1
bun install exit=0
editor recovery tests exit=0
canonical byte recovery exit=0
isolated syncclient rerun exit=0
full-device audit with shared network exit=1
task rebuild and full lock wait audit exit=0
workspace tests after dependency install exit=101
full-device and readonly mount final audit exit=0
task note index rebuild audit exit=0
1000 kills on separate tmpfs filesystems exit=1
original card location after graceful shutdown audit exit=0
isolated anchor refusal rerun exit=0
workspace packages after notes failure exit=0
workspace doc tests exit=0
separate-filesystem 1000 kills with job completion checks exit=1
rename-only crash repro exit=42 (42 means defect reproduced)
fixture cleanup exit=0

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.

Finished storage break test. Head SHA 3d0c6e33d588335c745a660163bf8bf5cdc8412d (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`, detached `origin/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 1. **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 in `state/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.import` with `{"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. 2. **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 were `Rename 7`; `notes.job` was 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. 3. **Medium: SIGKILL leaves note staging files indefinitely.** First ext4 run left 550 hidden `.calternal-tmp-*.md` files, 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.py` is 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. 4. **Contract discrepancy: empty-state automatic reconstruction is deliberately unsupported.** With `CALTERNAL_NOTES_SAVE_MS=600000`, `notes.append` returned HTTP 200; the new marker was in `notes.get` and absent from every Home file. After SIGKILL, presenting an empty state root refused startup, with and without `--create`. Corrupt auth refused with `file is not a database`. This matches ADR 0062 and `docs/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: ```text {"canonical_file_matches_API": true, "acknowledged_tokens_exactly_once": 1000, "orphan_staging_files_after_additional_restart": 550} ``` 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: ```text {"rounds": 25, "sigkills": 25, "acknowledged_appends": 25, "operation_counts": {"0": 4, "1": 4, "2": 4, "3": 4, "4": 3, "5": 3, "6": 3}} {"rounds": 50, "sigkills": 50, "acknowledged_appends": 50, "operation_counts": {"0": 8, "1": 7, "2": 7, "3": 7, "4": 7, "5": 7, "6": 7}} Traceback (most recent call last): File "/home/agent/wt/storage-break-report/harness-cross.py", line 78, in <module> settle(result[1]['result']) ~~~~~~^^^^^^^^^^^^^^^^^^^^^ File "/home/agent/wt/storage-break-report/harness-cross.py", line 23, in settle assert report['state']=='running',report ^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError: {'done': 0, 'error': "We couldn't find that.", 'job': '2f1f5288fc99868ccb39520b395ad53c', 'kind': 'rename', 'notes': ['7e9af9a0-f9be-8524-8fc6-b0a662d1f1d7'], 'state': 'failed', 'steps': 2, 'summary': {'from': 'Trash fixture 57.md', 'note': '7e9af9a0-f9be-8524-8fc6-b0a662d1f1d7', 'title': 'Trash fixture 64', 'to': 'Trash fixture 64.md'}} {"SQLite_quick_checks": 4, "all_ok": true} cross-filesystem harness exit=1 elapsed_seconds=3.662 Traceback (most recent call last): File "/home/agent/wt/storage-break-report/cross-mount.py", line 18, in <module> ``` Rename-only reduction output, verbatim: ```text {"FOUND_RENAME_RECOVERY_FAILURE": true, "round": 8, "sigkills": 8, "before_kill_responses": [], "job": {"done": 0, "error": "We couldn't find that.", "job": "cacad5952f85009ff252f6709a1af23c", "kind": "rename", "notes": ["7f5fcf19-92aa-828a-89c2-0d457ce6ac14"], "state": "failed", "steps": 2, "summary": {"from": "Rename 7.md", "note": "7f5fcf19-92aa-828a-89c2-0d457ce6ac14", "title": "Rename 8", "to": "Rename 8.md"}}, "note": [200, {"result": {"id": "7f5fcf19-92aa-828a-89c2-0d457ce6ac14", "lineage": "1f544c3246774fbc808b66c1118e6732", "path": "Rename 8.md", "text": "---\ncalternal-id: 7f5fcf19-92aa-828a-89c2-0d457ce6ac14\ndate: 2026-10-28T17:21:21+00:00\nlast edited: 2026-10-28T17:21:21+00:00\ntitle: Rename 7\n---\n# Rename 7\nkeep these bytes\n", "title": "Rename 7", "version": 15}, "token": "24ed38e5f2f7-25", "replayed": false}], "retry_response": [200, {"result": {"done": 0, "error": null, "job": "cacad5952f85009ff252f6709a1af23c", "kind": "rename", "notes": ["7f5fcf19-92aa-828a-89c2-0d457ce6ac14"], "state": "running", "steps": 2, "summary": {"from": "Rename 7.md", "note": "7f5fcf19-92aa-828a-89c2-0d457ce6ac14", "title": "Rename 8", "to": "Rename 8.md"}}, "token": "24ed38e5f2f7-24", "replayed": false}]} ``` Original-card location after a clean graceful shutdown, verbatim: ```text {"graceful_shutdown_exit": 0, "opaque_original_in_Home": [], "opaque_original_in_state_vcf": ["users/0b0e0f0a-1111-4222-8333-944455556666/contacts/raw/bf33903d-c2ad-8b91-880e-cdaa1f585ca4.vcf"]} ``` ## Layout, misuse and recovery Initial Home/state were separate directories on `/dev/sda1` ext4. 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: ```text {"Home_dev": 54, "state_dev": 57} {"full": "full-state", "fill_error": "[Errno 28] No space left on device", "free_bytes": 0} {"full": "full-state", "append": [500, {"error": {"code": "internal", "message": "Something went wrong on our side. Trying again might help.", "request_id": "01a18383-8f37-734b-86c0-070404c9dde5", "retryable": true}}]} {"full": "full-state", "save": [500, {"error": {"code": "internal", "message": "Something went wrong on our side. Trying again might help.", "request_id": "01a18383-8f3a-770e-bbbe-e1c7ef7ea85c", "retryable": true}}]} {"after_recovery": "full-state", "token_present": false} {"full": "full-home", "fill_error": "[Errno 28] No space left on device", "free_bytes": 0} {"full": "full-home", "append": [200, {"result": {"version": 2}, "token": "9bc86634001d-2", "replayed": false}]} {"full": "full-home", "save": [503, {"error": {"code": "not_saved_yet", "message": "Not saved yet. Trying again.", "request_id": "01a18383-9240-72f9-b149-9558d38003ff", "retryable": true}}]} {"after_recovery": "full-home", "token_present": true} {"readonly_mount": "refused", "error": "startup exit 1"} {"FINAL": "FULL DEVICE AUDIT COMPLETED", "layout": "two isolated 32MiB tmpfs mounts in private user/mount namespace"} ``` Task rebuild, verbatim: ```text {"task_rebuild": {"group_by": "status", "groups": [{"count": 1, "items": [{"broken": false, "completed": null, "created_ms": 1793207800000, "due": null, "id": "a9f8448f-e57c-8b96-b995-cbbc83534834", "important": false, "overdue": false, "path": "Break task.md", "pinned": false, "priority": null, "repeat": null, "scheduled": null, "status": "todo", "tags": ["work"], "time": null, "title": "Break task", "updated_ms": 1793207800000, "urgent": false, "waiting": false, "waiting_on": null}], "key": "todo"}], "incomplete": false, "more": false, "total": 1}, "task_text_preserved": "---\nstatus: todo\ntags: [work]\ncalternal-id: a9f8448f-e57c-8b96-b995-cbbc83534834\ndate: 2026-10-28T17:16:40+00:00\nlast edited: 2026-10-28T17:16:40+00:00\n---\n# Break task\nplain task metadata\n"} ``` 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-std` did 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.sh` job at a time, cargo `-j3`; no Playwright was needed. Build: `source /etc/calternal/env.sh; cargo build --locked -p calternal -j3` passed in 52.82s. Targeted command: `cargo test --locked -p calternal -j3 --test storage_startup --test notes_crash --test notes_crash_typing --test attachments_crash -- --nocapture` passed: 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. After `bun 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: ```text test result: ok. 31 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 85.45s test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.47s test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.33s test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.01s test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 8.13s test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.02s test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.70s test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.24s test result: ok. 1 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 1.49s test result: ok. 5 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.33s test result: ok. 10 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 13.91s test result: ok. 19 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.85s test result: ok. 29 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.64s test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.58s test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.30s test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.36s test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.25s test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.13s test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.39s test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.27s test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.81s test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.73s test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.43s test result: ok. 2 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 6.71s test result: ok. 19 passed; 0 failed; 3 ignored; 0 measured; 0 filtered out; finished in 7.28s test result: ok. 10 passed; 0 failed; 2 ignored; 0 measured; 0 filtered out; finished in 125.42s test result: ok. 14 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 3.64s test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.53s test result: ok. 24 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 1.78s test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s test result: ok. 11 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.09s test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 27 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 16 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.65s test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.06s test result: ok. 130 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 73.22s test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.28s test result: ok. 15 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.83s test result: ok. 5 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.51s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 35 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.46s test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 37 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.67s test result: FAILED. 424 passed; 1 failed; 6 ignored; 0 measured; 0 filtered out; finished in 463.88s Remaining workspace packages: test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 9 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.70s test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s test result: ok. 12 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 1.88s test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.07s test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.44s test result: ok. 28 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 10.42s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s Workspace doc tests: test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s ``` All recorded gate exit lines, verbatim (initial harness failures retained transparently): ```text post-kill inventory exit=1 startup/file audit exit=1 private full-device audit exit=1 storage/crash suites exit=0 split fault-injection suite exit=0 workspace tests exit=101 corrected inventory exit=1 corrected startup/file audit exit=0 corrected private full-device audit exit=1 bun install exit=0 editor recovery tests exit=0 canonical byte recovery exit=0 isolated syncclient rerun exit=0 full-device audit with shared network exit=1 task rebuild and full lock wait audit exit=0 workspace tests after dependency install exit=101 full-device and readonly mount final audit exit=0 task note index rebuild audit exit=0 1000 kills on separate tmpfs filesystems exit=1 original card location after graceful shutdown audit exit=0 isolated anchor refusal rerun exit=0 workspace packages after notes failure exit=0 workspace doc tests exit=0 separate-filesystem 1000 kills with job completion checks exit=1 rename-only crash repro exit=42 (42 means defect reproduced) fixture cleanup exit=0 ``` 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.
Author
Owner

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):

  • Physical sharing only: each person's file stays their own file with their own name, permissions, versions and Trash. A shared extent is copy-on-write, so editing or deleting one person's copy never changes another's.
  • No existence signal: an upload always writes the full file first and acknowledges it the same way, whether or not anyone else has it; dedupe runs afterwards in the background. Upload time, response, quota (logical size per person) and free-space reporting never depend on someone else having the same bytes. "Already uploaded" only ever looks at your own files.
  • Fingerprint index lives in app data, server-only; never exposed through any API, log, error or timing path.
  • Deleting forever only frees space when no one references the extent any more.

Test gates before it ships (beyond the existing two-user leak suite from #409):

  • Multi-user property test: random users uploading, editing, renaming, sharing, unsharing, trashing and purging identical and near-identical files; after every step each user sees exactly their own bytes, names and metadata, and nothing about anyone else.
  • Side-channel checks: upload latency, quota, error messages and free space are statistically indistinguishable whether or not another user holds the same file.
  • Permission matrix: every API route and plugin (notes, files, contacts, photos, DAV, WebDAV, search) called as user B with user A's IDs, paths, fingerprints and share links: always not-found, never a hint.
  • Independent review round by a separate job, worded as a defensive isolation audit, until a round finds nothing.

🤖 Generated with Claude Code

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): - Physical sharing only: each person's file stays their own file with their own name, permissions, versions and Trash. A shared extent is copy-on-write, so editing or deleting one person's copy never changes another's. - No existence signal: an upload always writes the full file first and acknowledges it the same way, whether or not anyone else has it; dedupe runs afterwards in the background. Upload time, response, quota (logical size per person) and free-space reporting never depend on someone else having the same bytes. "Already uploaded" only ever looks at your own files. - Fingerprint index lives in app data, server-only; never exposed through any API, log, error or timing path. - Deleting forever only frees space when no one references the extent any more. Test gates before it ships (beyond the existing two-user leak suite from #409): - Multi-user property test: random users uploading, editing, renaming, sharing, unsharing, trashing and purging identical and near-identical files; after every step each user sees exactly their own bytes, names and metadata, and nothing about anyone else. - Side-channel checks: upload latency, quota, error messages and free space are statistically indistinguishable whether or not another user holds the same file. - Permission matrix: every API route and plugin (notes, files, contacts, photos, DAV, WebDAV, search) called as user B with user A's IDs, paths, fingerprints and share links: always not-found, never a hint. - Independent review round by a separate job, worded as a defensive isolation audit, until a round finds nothing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

kayg ticked in the roadmap doc, 28 Oct:

  • T-A1: if one disk is lost, the app stops (fail closed) until the disk is replaced and restored from backup; the surviving disk stays readable as plain files. No half-Home app mode.
  • T-A2: server-wide dedupe (see the comment above for the rules and test gates).
  • T-A3: a tier move happens only when no other program is writing the file (verified per-file exclusion where the platform supports it); otherwise it waits, with an offline tidy-up pass for stubborn cases. Never lose an outside writer's bytes.
kayg ticked in the roadmap doc, 28 Oct: - **T-A1:** if one disk is lost, the app stops (fail closed) until the disk is replaced and restored from backup; the surviving disk stays readable as plain files. No half-Home app mode. - **T-A2:** server-wide dedupe (see the comment above for the rules and test gates). - **T-A3:** a tier move happens only when no other program is writing the file (verified per-file exclusion where the platform supports it); otherwise it waits, with an offline tidy-up pass for stubborn cases. Never lose an outside writer's bytes.
Author
Owner

Starting the approved docs-only answer amendment. Working from docs/adr-0062-tiers at 0840c7036d; origin/dev base is 3d0c6e33d5 and 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.

Starting the approved docs-only answer amendment. Working from docs/adr-0062-tiers at 0840c7036d74082ce045035507a79e8626ca3f9e; origin/dev base is 3d0c6e33d588335c745a660163bf8bf5cdc8412d and 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.
Author
Owner

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."

  • Users: never any signal, during or after dedupe (no progress, no "saved space", no change in quota, timing, errors or free space).
  • Admins only: Settings > Health (admin section, people.manage only, the same rule as device sync health A8) shows dedupe activity and totals: jobs running, bytes saved, shared extents, errors. Proposed: aggregate only, not which users share which file, so even the admin view isn't a who-has-what map; per-file detail only if kayg asks for it.
  • Every dedupe admin route is in the cross-user permission matrix test (non-admin gets not-found), and the robustness bar is the same as the isolation gates above.
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." - Users: never any signal, during or after dedupe (no progress, no "saved space", no change in quota, timing, errors or free space). - Admins only: Settings > Health (admin section, people.manage only, the same rule as device sync health A8) shows dedupe activity and totals: jobs running, bytes saved, shared extents, errors. Proposed: aggregate only, not which users share which file, so even the admin view isn't a who-has-what map; per-file detail only if kayg asks for it. - Every dedupe admin route is in the cross-user permission matrix test (non-admin gets not-found), and the robustness bar is the same as the isolation gates above.
Author
Owner

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.

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-<calternal-id>.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.
Author
Owner

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 3d0c6e33d5 was already an ancestor, so no base merge was needed.

Gate output verbatim:

PASS Markdown: 0062-user-files-on-hdd-app-data-on-ssd.md: Forgejo GFM HTTP 200, 16 headings, 1 tables.
PASS Markdown: 0063-contact-notes-keep-original-vcard-lines.md: Forgejo GFM HTTP 200, 5 headings, 0 tables.
PASS Markdown: 0064-contacts-sync-over-carddav.md: Forgejo GFM HTTP 200, 26 headings, 0 tables.
PASS Links/anchors: 18 relative file links and 1 heading fragments resolve against Forgejo rendering.
PASS git diff --check: exit 0 (against origin/dev).
PASS Scope: only ADR 0062, ADR 0063 and ADR 0064 changed; no untracked repository files.
PASS Decisions: T-A1–T-A3 and FO1 recorded; no tiering questions remain; every changed ADR has a 2026-10-28 changelog.
NOTE Docs only: implementation, crash, isolation and performance gates are specified, not executed.
Finished the docs-only answer amendment. Head: `a4ad276127bcc8a772bfc2a19002eb789f8c2e5a`. Branch: `docs/adr-0062-answers`. PR: https://git.kayg.org/kayg/calternal/pulls/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 3d0c6e33d588335c745a660163bf8bf5cdc8412d was already an ancestor, so no base merge was needed. Gate output verbatim: ```text PASS Markdown: 0062-user-files-on-hdd-app-data-on-ssd.md: Forgejo GFM HTTP 200, 16 headings, 1 tables. PASS Markdown: 0063-contact-notes-keep-original-vcard-lines.md: Forgejo GFM HTTP 200, 5 headings, 0 tables. PASS Markdown: 0064-contacts-sync-over-carddav.md: Forgejo GFM HTTP 200, 26 headings, 0 tables. PASS Links/anchors: 18 relative file links and 1 heading fragments resolve against Forgejo rendering. PASS git diff --check: exit 0 (against origin/dev). PASS Scope: only ADR 0062, ADR 0063 and ADR 0064 changed; no untracked repository files. PASS Decisions: T-A1–T-A3 and FO1 recorded; no tiering questions remain; every changed ADR has a 2026-10-28 changelog. NOTE Docs only: implementation, crash, isolation and performance gates are specified, not executed. ```
Author
Owner

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.

Starting the XFS project quota feasibility probe. Tracking branch: job/xfs-quota-probe-20261029. Base SHA: a779a46f4299ade3a222aab7448d11db84b6c0d2. 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.
Author
Owner

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:

CapEff: 0000000000000000
SET project ID as owner: SUCCESS
SET PROJINHERIT as owner: SUCCESS
Q_XGETQUOTA id=1754001 errno=1 Operation not permitted

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.

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: ``` CapEff: 0000000000000000 SET project ID as owner: SUCCESS SET PROJINHERIT as owner: SUCCESS Q_XGETQUOTA id=1754001 errno=1 Operation not permitted ``` 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.
Author
Owner

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):

unshared before 4194304
unshared after 4KiB edit 4194304 stat_blocks_bytes 4194304
shared-live before 4194304
shared-live after 4KiB edit 4321280 stat_blocks_bytes 4321280
shared-deleted before 4194304
shared-deleted after 4KiB edit 4194304 stat_blocks_bytes 4194304

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.

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): ``` unshared before 4194304 unshared after 4KiB edit 4194304 stat_blocks_bytes 4194304 shared-live before 4194304 shared-live after 4KiB edit 4321280 stat_blocks_bytes 4321280 shared-deleted before 4194304 shared-deleted after 4KiB edit 4194304 stat_blocks_bytes 4194304 ``` 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.
Author
Owner

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:

outside writer stage=write accepted_bytes=1048576 errno=28 No space left on device

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.

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: ``` outside writer stage=write accepted_bytes=1048576 errno=28 No space left on device ``` 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.
Author
Owner

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):

outside write after grace errno=28 No space left on device
PASS soft-grace expiry enforced as ENOSPC
Observed allocation refusal after seconds 1.753 attempts 124
SOFT GRACE CHECKS PASSED

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.

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): ``` outside write after grace errno=28 No space left on device PASS soft-grace expiry enforced as ENOSPC Observed allocation refusal after seconds 1.753 attempts 124 SOFT GRACE CHECKS PASSED ``` 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.
Author
Owner

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:

  • Quotas charge allocated blocks and reservations per inode, including directory blocks. They do not count logical length or multiply hard-link names. A 16 MiB sparse file charged 4096 bytes. A 65536-byte inode with two names charged 65536, rather than the existing counter's 131072.
  • Both projects are fully charged for cloned/deduplicated extents. Another Home's edit or deletion did not immediately change the observed charge of the untouched Home. But an identical subsequent local edit charged more when a shared peer existed: 4321280 bytes versus 4194304 without a peer. Thus full charging alone does not satisfy "usage must never reveal that someone else has the same file" on this mount. Likely mechanism: CoW allocation/reservation, consistent with the source and stat output; no mitigation was established by this probe.
  • The project belongs to the inode, not to its current path. A rename out to an unprojected directory succeeded and kept charging the old Home. Open but unlinked files stayed charged until close. The owner could also explicitly change the file's project ID to zero.
  • The unprivileged owner can set up the tree, but reading a project quota requires CAP_SYS_ADMIN at runtime. One-time privileged tree setup alone does not solve access to usage reads.

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:

kernel: 6.12.113+deb13-amd64
caps: CapEff:	0000000000000000
before (2147483648, 0, 0, 0, 0)
SET project ID as owner: SUCCESS
SET PROJINHERIT as owner: SUCCESS
after (2147484160, 0, 0, 1754001, 0)
$ /usr/sbin/xfs_quota -x -c state /srv/quota-probe 
User quota state on /srv/quota-probe (/dev/loop0)
  Accounting: OFF
  Enforcement: OFF
  Inode: N/A
Blocks grace time: [--------]
Blocks max warnings: 0
Inodes grace time: [--------]
Inodes max warnings: 0
Realtime Blocks grace time: [--------]
Realtime Blocks max warnings: 0
Group quota state on /srv/quota-probe (/dev/loop0)
  Accounting: OFF
  Enforcement: OFF
  Inode: N/A
Blocks grace time: [--------]
Blocks max warnings: 0
Inodes grace time: [--------]
Inodes max warnings: 0
Realtime Blocks grace time: [--------]
Realtime Blocks max warnings: 0
Project quota state on /srv/quota-probe (/dev/loop0)
  Accounting: ON
  Enforcement: ON
  Inode: #131 (2 blocks, 2 extents)
Blocks grace time: [7 days]
Blocks max warnings: 0
Inodes grace time: [7 days]
Inodes max warnings: 0
Realtime Blocks grace time: [7 days]
Realtime Blocks max warnings: 0
exit=0
$ sudo -n /usr/sbin/xfs_quota -x -c state /srv/quota-probe 
User quota state on /srv/quota-probe (/dev/loop0)
  Accounting: OFF
  Enforcement: OFF
  Inode: N/A
Blocks grace time: [--------]
Blocks max warnings: 0
Inodes grace time: [--------]
Inodes max warnings: 0
Realtime Blocks grace time: [--------]
Realtime Blocks max warnings: 0
Group quota state on /srv/quota-probe (/dev/loop0)
  Accounting: OFF
  Enforcement: OFF
  Inode: N/A
Blocks grace time: [--------]
Blocks max warnings: 0
Inodes grace time: [--------]
Inodes max warnings: 0
Realtime Blocks grace time: [--------]
Realtime Blocks max warnings: 0
Project quota state on /srv/quota-probe (/dev/loop0)
  Accounting: ON
  Enforcement: ON
  Inode: #131 (2 blocks, 2 extents)
Blocks grace time: [7 days]
Blocks max warnings: 0
Inodes grace time: [7 days]
Inodes max warnings: 0
Realtime Blocks grace time: [7 days]
Realtime Blocks max warnings: 0
exit=0
$ /usr/sbin/xfs_quota -x -c quota -p -b -N 1754001 /srv/quota-probe 
exit=0

Verbatim setup, reflink control, dedupe and restore output (the later sections discuss the same tests):

SETUP AND QUERY PERMISSIONS
$ /usr/sbin/xfs_quota -x -c project -s -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/recursive 1754301 /srv/quota-probe 
Setting up project 1754301 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/recursive)...
Processed 1 (/etc/projects and cmdline) paths for project 1754301 with recursion depth infinite (-1).
exit=0
recursive root {'id': 1754301, 'inherit': True} nested {'id': 1754301, 'inherit': True} file {'id': 1754301, 'inherit': False}
PASS unprivileged xfs_quota project -s recursively labels old contents
$ /usr/sbin/xfs_quota -x -c quota -p -b -n -N -v 1754301 /srv/quota-probe 
exit=0
$ sudo -n /usr/sbin/xfs_quota -x -c quota -p -b -n -N -v 1754301 /srv/quota-probe 
/dev/loop0                   4          0          0   00 [--------] /srv/quota-probe
exit=0
$ /usr/sbin/xfs_quota -x -c limit -p bhard=64k 1754301 /srv/quota-probe 
xfs_quota: cannot set limits: Operation not permitted
exit=1

REFLINK PRIVACY CONTROL
unshared before 4194304
unshared after 4KiB edit 4194304 stat_blocks_bytes 4194304
shared-live before 4194304
shared-live after 4KiB edit 4321280 stat_blocks_bytes 4321280
shared-deleted before 4194304
shared-deleted after 4KiB edit 4194304 stat_blocks_bytes 4194304

FIDEDUPERANGE
before dedupe {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'} {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
FIDEDUPERANGE result (4, 0, 4194304, 0, 0)
PASS cross-project FIDEDUPERANGE accepted
after dedupe {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'} {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}

SNAPSHOT dedupe both fully charged
dedupe-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS dedupe-a allocated quota == independent stat walk
PASS dedupe-a inode quota covers live walk (recently unlinked inodes may await reclaim)
dedupe-b {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS dedupe-b allocated quota == independent stat walk
PASS dedupe-b inode quota covers live walk (recently unlinked inodes may await reclaim)

TAR RESTORE
tar-unprepared root {'id': 0, 'inherit': False} nested {'id': 0, 'inherit': False} data {'id': 0, 'inherit': False}
tar-prepared root {'id': 1754351, 'inherit': True} nested {'id': 1754351, 'inherit': True} data {'id': 1754351, 'inherit': False}
PASS tar --xattrs --acls does not retain source project ID
PASS tar into prepared root inherits destination project
$ /usr/sbin/xfs_quota -x -c project -s -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-unprepared 1754352 /srv/quota-probe 
Setting up project 1754352 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-unprepared)...
Processed 1 (/etc/projects and cmdline) paths for project 1754352 with recursion depth infinite (-1).
exit=0
repaired restore {'id': 1754352, 'inherit': False}
PASS recursive setup repairs restored tree
rsync: NOT TESTED; executable not installed

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:

Operation Result
Normal 10001-byte file 12288 allocated bytes
Sparse 16 MiB file, one written byte 4096 allocated bytes
Separate outside subprocess append Immediately charged without server watcher participation
Truncate and atomic replacement Charge followed the new allocation
Rename within a Home No usage change
rename(2) between inherited Homes EXDEV, even though both paths are on the same filesystem
mv --no-copy between Homes Failed, preserved source
Ordinary GNU mv between Homes Succeeded by copy/unlink; destination inherited its Home's project; charge moved after completion, not via an atomic cross-project rename
Hard link within Home One charged inode; per-name logical total doubled
Hard link across inherited Homes EXDEV
Hard link from Home into unprojected directory Succeeded; writing through outside alias changed original project's usage
Non-UTF-8 filename Counted correctly
Move out into unprojected directory Retained project ID and old charge; no longer matched a path-scoped Home walk
Open, then remove all names Charge stayed until last close
Owner changes file project ID Succeeded; charge transferred even while file remained in old Home's path

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:

All filesystem mutations run as uid 1002 with no capabilities. Only quota inspection/limits use sudo xfs_quota.

SNAPSHOT empty
home-a {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)

SNAPSHOT normal 10001 bytes
home-a {"allocated_unique_with_dirs": 12288, "inodes": 2, "logical_per_name": 10001, "logical_unique": 10001} quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0                  12          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)

SNAPSHOT sparse logical 16MiB with one allocated block
home-a {"allocated_unique_with_dirs": 16384, "inodes": 3, "logical_per_name": 16787217, "logical_unique": 16787217} quota {'allocated': 16384, 'inodes': 3, 'raw': '/dev/loop0                  16          0          0   00 [--------]           3          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)

SNAPSHOT outside subprocess appends 8192
home-a {"allocated_unique_with_dirs": 24576, "inodes": 3, "logical_per_name": 16795409, "logical_unique": 16795409} quota {'allocated': 24576, 'inodes': 3, 'raw': '/dev/loop0                  24          0          0   00 [--------]           3          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)

SNAPSHOT truncate to 3000
home-a {"allocated_unique_with_dirs": 8192, "inodes": 3, "logical_per_name": 16780216, "logical_unique": 16780216} quota {'allocated': 8192, 'inodes': 3, 'raw': '/dev/loop0                   8          0          0   00 [--------]           3          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)

SNAPSHOT atomic replacement
home-a {"allocated_unique_with_dirs": 69632, "inodes": 3, "logical_per_name": 16842752, "logical_unique": 16842752} quota {'allocated': 69632, 'inodes': 3, 'raw': '/dev/loop0                  68          0          0   00 [--------]           3          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)

SNAPSHOT rename within Home
home-a {"allocated_unique_with_dirs": 69632, "inodes": 3, "logical_per_name": 16842752, "logical_unique": 16842752} quota {'allocated': 69632, 'inodes': 3, 'raw': '/dev/loop0                  68          0          0   00 [--------]           3          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)
os.rename A to B errno=18 Invalid cross-device link
PASS os.rename A to B expected errno=18
mv --no-copy exit 1 stderr mv: cannot move '/srv/quota-probe/xfs-probe-20261029/semantics-run2/home-a/renamed' to '/srv/quota-probe/xfs-probe-20261029/semantics-run2/home-b/moved': Invalid cross-device link
PASS mv --no-copy preserves source on EXDEV
ordinary mv exit 0 stderr 
PASS ordinary mv falls back to copy/unlink
ordinary mv destination project {'id': 1754202, 'inherit': False}

SNAPSHOT mv A to B copy then unlink
home-a {"allocated_unique_with_dirs": 4096, "inodes": 2, "logical_per_name": 16777216, "logical_unique": 16777216} quota {'allocated': 4096, 'inodes': 2, 'raw': '/dev/loop0                   4          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 65536, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0                  64          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)

SNAPSHOT hard link within Home charges inode once
home-a {"allocated_unique_with_dirs": 4096, "inodes": 2, "logical_per_name": 16777216, "logical_unique": 16777216} quota {'allocated': 4096, 'inodes': 2, 'raw': '/dev/loop0                   4          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0                  64          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)
hard link B to A errno=18 Invalid cross-device link
PASS hard link B to A expected errno=18
non-UTF8 path repr b'/srv/quota-probe/xfs-probe-20261029/semantics-run2/home-a/bad-\xff-\xfe'

SNAPSHOT non UTF8 filename
home-a {"allocated_unique_with_dirs": 12288, "inodes": 3, "logical_per_name": 16784216, "logical_unique": 16784216} quota {'allocated': 12288, 'inodes': 3, 'raw': '/dev/loop0                  12          0          0   00 [--------]           3          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0                  64          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)
new dir {'id': 1754201, 'inherit': True} new file {'id': 1754201, 'inherit': False}
PASS new subdirectory inherits flag and project
outside file {'id': 0, 'inherit': False}
rename project 0 into inherited Home errno=18 Invalid cross-device link
PASS rename project 0 into inherited Home expected errno=18
outside ordinary mv destination {'id': 1754201, 'inherit': False}

SNAPSHOT outside mv copy/unlink inherits destination
home-a {"allocated_unique_with_dirs": 24576, "inodes": 6, "logical_per_name": 16796504, "logical_unique": 16796504} quota {'allocated': 24576, 'inodes': 6, 'raw': '/dev/loop0                  24          0          0   00 [--------]           6          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0                  64          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)
moved out project {'id': 1754201, 'inherit': False} A quota {'allocated': 24576, 'inodes': 6, 'raw': '/dev/loop0                  24          0          0   00 [--------]           6          0          0   00 [--------] /srv/quota-probe'} A walk {'logical_per_name': 16792408, 'logical_unique': 16792408, 'allocated_unique_with_dirs': 20480, 'inodes': 5}
PASS move out retains project ID

SNAPSHOT delete escaped inode releases original charge
home-a {"allocated_unique_with_dirs": 20480, "inodes": 5, "logical_per_name": 16792408, "logical_unique": 16792408} quota {'allocated': 20480, 'inodes': 5, 'raw': '/dev/loop0                  20          0          0   00 [--------]           5          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0                  64          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)
owner relabel sparse to project 0: SUCCESS; A quota {'allocated': 16384, 'inodes': 4, 'raw': '/dev/loop0                  16          0          0   00 [--------]           4          0          0   00 [--------] /srv/quota-probe'} walk {'logical_per_name': 16792408, 'logical_unique': 16792408, 'allocated_unique_with_dirs': 20480, 'inodes': 5}

SNAPSHOT restored sparse project label
home-a {"allocated_unique_with_dirs": 20480, "inodes": 5, "logical_per_name": 16792408, "logical_unique": 16792408} quota {'allocated': 20480, 'inodes': 5, 'raw': '/dev/loop0                  20          0          0   00 [--------]           5          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0                  64          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)

SNAPSHOT reflink source
clone-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS clone-a allocated quota == independent stat walk
PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim)
clone-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS clone-b allocated quota == independent stat walk
PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim)

SNAPSHOT cross-project cp --reflink=always
clone-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS clone-a allocated quota == independent stat walk
PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim)
clone-b {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS clone-b allocated quota == independent stat walk
PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim)
PASS CoW preserves source bytes

SNAPSHOT clone edits first 4KiB
clone-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS clone-a allocated quota == independent stat walk
PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim)
clone-b {"allocated_unique_with_dirs": 4321280, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4321280, 'inodes': 2, 'raw': '/dev/loop0                4220          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS clone-b allocated quota == independent stat walk
PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim)
PASS other Home edit does not change source charge

SNAPSHOT delete clone
clone-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS clone-a allocated quota == independent stat walk
PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim)
clone-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS clone-b allocated quota == independent stat walk
PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim)
PASS other Home deletion does not change source charge

SNAPSHOT delete original with clone alive
clone-a {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS clone-a allocated quota == independent stat walk
PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim)
clone-b {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0                4096          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS clone-b allocated quota == independent stat walk
PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim)
PASS original deletion does not change clone charge
link Home file OUT to unprojected dir: SUCCESS

SNAPSHOT outside hardlink write updates owning project
home-a {"allocated_unique_with_dirs": 20480, "inodes": 5, "logical_per_name": 16792408, "logical_unique": 16792408} quota {'allocated': 20480, 'inodes': 5, 'raw': '/dev/loop0                  20          0          0   00 [--------]           5          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 12288, "inodes": 2, "logical_per_name": 24576, "logical_unique": 12288} quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0                  12          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)
open unlinked inode: B quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0                  12          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'} B walk {'logical_per_name': 0, 'logical_unique': 0, 'allocated_unique_with_dirs': 0, 'inodes': 1}
PASS open unlinked file charged until close

SNAPSHOT last close releases charge
home-a {"allocated_unique_with_dirs": 20480, "inodes": 5, "logical_per_name": 16792408, "logical_unique": 16792408} quota {'allocated': 20480, 'inodes': 5, 'raw': '/dev/loop0                  20          0          0   00 [--------]           5          0          0   00 [--------] /srv/quota-probe'}
PASS home-a allocated quota == independent stat walk
PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim)
home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0                   0          0          0   00 [--------]           1          0          0   00 [--------] /srv/quota-probe'}
PASS home-b allocated quota == independent stat walk
PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim)
SEMANTICS CHECKS PASSED 92

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:

unshared before 4194304
unshared after 4KiB edit 4194304 stat_blocks_bytes 4194304
shared-live before 4194304
shared-live after 4KiB edit 4321280 stat_blocks_bytes 4321280
shared-deleted before 4194304
shared-deleted after 4KiB edit 4194304 stat_blocks_bytes 4194304

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.

New test projects One read incl. process startup 10000 reads, same Home 10000 reads, random Homes
1 7.915 ms 43.086 ms 41.695 ms
100 8.398 ms 41.510 ms 43.140 ms
10000 8.123 ms 41.665 ms 43.509 ms

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:

Scope: local supplied XFS mount only; xfs_quota Q_XGETQUOTA path via privileged tool. Not an application perf gate.
No cache drop available under allowed sudo; all timings warm and include CLI/privilege startup/formatting.
PROJECTS 1 setup_seconds 0.0
{"projects": 1, "case": "one_read", "requests": 1, "warmup_ms": 9.081, "samples_ms": [8.734, 8.48, 7.893, 7.726, 7.913, 7.915, 8.124], "median_ms": 7.915, "median_us_per_query_with_startup": 7915.437}
{"projects": 1, "case": "same_Home_10000_reads", "requests": 10000, "warmup_ms": 40.217, "samples_ms": [41.12, 46.439, 44.375, 44.377, 41.107, 41.915, 43.086], "median_ms": 43.086, "median_us_per_query_with_startup": 4.309}
{"projects": 1, "case": "random_Home_10000_reads", "requests": 10000, "warmup_ms": 84.911, "samples_ms": [41.528, 39.19, 43.973, 40.619, 41.695, 41.896, 45.07], "median_ms": 41.695, "median_us_per_query_with_startup": 4.169}
PROJECTS 100 setup_seconds 0.004
{"projects": 100, "case": "one_read", "requests": 1, "warmup_ms": 9.098, "samples_ms": [8.076, 8.398, 8.13, 8.2, 8.763, 9.753, 8.692], "median_ms": 8.398, "median_us_per_query_with_startup": 8397.671}
{"projects": 100, "case": "same_Home_10000_reads", "requests": 10000, "warmup_ms": 40.196, "samples_ms": [42.105, 41.51, 40.314, 40.404, 41.977, 40.54, 42.088], "median_ms": 41.51, "median_us_per_query_with_startup": 4.151}
{"projects": 100, "case": "random_Home_10000_reads", "requests": 10000, "warmup_ms": 41.169, "samples_ms": [43.321, 43.14, 41.492, 47.608, 53.02, 42.075, 40.918], "median_ms": 43.14, "median_us_per_query_with_startup": 4.314}
PROJECTS 10000 setup_seconds 0.403
{"projects": 10000, "case": "one_read", "requests": 1, "warmup_ms": 9.153, "samples_ms": [8.04, 8.218, 7.849, 8.144, 7.691, 8.123, 8.799], "median_ms": 8.123, "median_us_per_query_with_startup": 8122.631}
{"projects": 10000, "case": "same_Home_10000_reads", "requests": 10000, "warmup_ms": 40.522, "samples_ms": [40.359, 45.112, 41.68, 41.665, 39.17, 41.508, 46.001], "median_ms": 41.665, "median_us_per_query_with_startup": 4.167}
{"projects": 10000, "case": "random_Home_10000_reads", "requests": 10000, "warmup_ms": 43.262, "samples_ms": [44.054, 42.106, 45.291, 41.428, 44.546, 43.509, 42.835], "median_ms": 43.509, "median_us_per_query_with_startup": 4.351}
QUERY COST CHECKS PASSED: all requested quota records returned for 1, 100, 10000 projects

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:

ENFORCEMENT independent outside process
$ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=1m 1754380 /srv/quota-probe 
exit=0
outside writer stage=write accepted_bytes=1048576 errno=28 No space left on device
PASS XFS inherited project hard quota returns ENOSPC to writer
hard usage {'allocated': 1048576, 'inodes': 2, 'raw': '/dev/loop0                1024          0       1024   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
$ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=64k 1754380 /srv/quota-probe 
exit=0
create under exhausted project limit errno=28 No space left on device
PASS create under exhausted project limit expected errno=28
$ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=0 1754380 /srv/quota-probe 
exit=0
$ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=1m 1754382 /srv/quota-probe 
exit=0
clone over quota exit 1 stderr cp: failed to clone '/srv/quota-probe/xfs-probe-20261029/semantics-run2/clone-limit-v2/dest' from '/srv/quota-probe/xfs-probe-20261029/semantics-run2/limit-source/source': No space left on device
PASS reflink obeys destination hard quota
$ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=0 1754382 /srv/quota-probe 
exit=0
$ sudo -n /usr/sbin/xfs_quota -x -c limit -p bsoft=1m bhard=4m 1754383 /srv/quota-probe 
exit=0
$ sudo -n /usr/sbin/xfs_quota -x -c quota -p -b -n -N -v 1754383 /srv/quota-probe 
/dev/loop0                2048       1024       4096   00  [7 days] /srv/quota-probe
exit=0
soft exceeded within default 7-day grace: write accepted
$ sudo -n /usr/sbin/xfs_quota -x -c timer -p -b 1 1754383 /srv/quota-probe 
exit=0
$ sudo -n /usr/sbin/xfs_quota -x -c quota -p -b -n -N -v 1754383 /srv/quota-probe 
/dev/loop0                2048       1024       4096   00 [00:00:01] /srv/quota-probe
exit=0

Verbatim successful soft-grace enforcement test:

Expiring only this probe project; global grace is unchanged.
$ xfs_quota -x -c 'timer -p -b 1 1754383'
outside write after grace errno=28 No space left on device
PASS soft-grace expiry enforced as ENOSPC
Observed allocation refusal after seconds 1.753 attempts 124
$ xfs_quota -x -c 'quota -p -b -n -N -v 1754383'
/dev/loop0                2048       1024       4096   00  [0 days] /srv/quota-probe
$ xfs_quota -x -c 'limit -p bsoft=0 bhard=0 1754383'
SOFT GRACE CHECKS PASSED

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:

LIVE supplied mount flags=0x30 accounting=ON enforcement=ON backend=project-quota (also verify privileged usage read)
SIMULATED missing accounting flags=0x0 accounting=OFF enforcement=OFF backend=full-Home recount
SIMULATED accounting-only mount flags=0x10 accounting=ON enforcement=OFF backend=project-quota (also verify privileged usage read)

Verbatim GNU du, buffered-write and recursive project-check tests:

DIRECTORY BLOCKS AND DU

SNAPSHOT 1000 one-byte files, including allocated directory blocks
many-tiny-files {"allocated_unique_with_dirs": 4132864, "inodes": 1001, "logical_per_name": 1000, "logical_unique": 1000} quota {'allocated': 4132864, 'inodes': 1001, 'raw': '/dev/loop0                4036          0          0   00 [--------]        1001          0          0   00 [--------] /srv/quota-probe'}
PASS many-tiny-files allocated quota == independent stat walk
PASS many-tiny-files inode quota covers live walk (recently unlinked inodes may await reclaim)
$ du -s -B1 /srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files
4132864	/srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files
$ du -s -B1 --apparent-size /srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files
1000	/srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files
$ du -s -B1 --apparent-size --count-links /srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files
1000	/srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files
quota bytes 4132864 root directory allocated bytes 36864

LIVE BUFFERED WRITE VS QUOTA
before fsync/close: stat bytes 12288 quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0                  12          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
after fsync, still open: stat bytes 12288 quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0                  12          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}

SNAPSHOT after close
buffered-write {"allocated_unique_with_dirs": 12288, "inodes": 2, "logical_per_name": 10001, "logical_unique": 10001} quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0                  12          0          0   00 [--------]           2          0          0   00 [--------] /srv/quota-probe'}
PASS buffered-write allocated quota == independent stat walk
PASS buffered-write inode quota covers live walk (recently unlinked inodes may await reclaim)

EXPLICIT FULL TREE CHECK
$ xfs_quota -x -c 'project -c -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/home-a 1754201'
Checking project 1754201 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/home-a)...
Processed 1 (/etc/projects and cmdline) paths for project 1754201 with recursion depth infinite (-1).
exit=0
PASS project check home-a
$ xfs_quota -x -c 'project -c -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/home-b 1754202'
Checking project 1754202 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/home-b)...
Processed 1 (/etc/projects and cmdline) paths for project 1754202 with recursion depth infinite (-1).
exit=0
PASS project check home-b
$ xfs_quota -x -c 'project -c -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-prepared 1754351'
Checking project 1754351 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-prepared)...
Processed 1 (/etc/projects and cmdline) paths for project 1754351 with recursion depth infinite (-1).
exit=0
PASS project check tar-prepared
$ xfs_quota -x -c 'project -c -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-unprepared 1754352'
Checking project 1754352 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-unprepared)...
Processed 1 (/etc/projects and cmdline) paths for project 1754352 with recursion depth infinite (-1).
exit=0
PASS project check tar-unprepared
reset first hard-limit probe to unlimited exit 0
FINAL EXTRA CHECKS PASSED

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:

$ findmnt -n -t ext4 -o TARGET,FSTYPE,OPTIONS
/ ext4 rw,relatime,discard,errors=remount-ro
$ command -v rsync
(no output; exit 1)

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:

PASS all Python probe scripts compile
PASS report covers all seven questions
PASS recorded semantic run: 92 checks
PASS recorded query rows verified at 1/100/10000 new projects
PASS recorded soft-grace allocation refusal
PASS live allocated stat walk matches project 1754201
PASS live allocated stat walk matches project 1754202
PASS live allocated stat walk matches project 1754211
PASS live allocated stat walk matches project 1754212
PASS live allocated stat walk matches project 1754351
PASS live allocated stat walk matches project 1754352
PASS live allocated stat walk matches project 1754390
PASS live allocated stat walk matches project 1754391
PASS live root and new directory retain project inheritance
PASS fresh cross-project reflink fully charges both projects
Fresh identical-edit charges: unshared=4194304 shared-peer-alive=4321280 shared-peer-deleted=4194304
PASS fresh control reproduces sharing-dependent charge
PASS live unprivileged Q_XGETQUOTA denied with EPERM
PASS live accounting and enforcement remain ON
PASS fresh hard-limit write stops at 1048576 bytes with ENOSPC
PASS base/head unchanged: a779a46f4299ade3a222aab7448d11db84b6c0d2
PASS no tracked product changes
PASS only pre-existing untracked result.md remains
Logical per-name compatibility: NO-GO
Strict cross-user dedupe invisibility with raw usage: NO-GO
Allocated project accounting and warm lookup feasibility: GO with runtime helper and stated limits
Untested: ext4 quotas; rsync; live no-accounting mount; product HTTP; cold cache; crash; multi-mount admission
PROBE EVIDENCE GATE: PASS
# 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: - Quotas charge allocated blocks and reservations per inode, including directory blocks. They do not count logical length or multiply hard-link names. A 16 MiB sparse file charged 4096 bytes. A 65536-byte inode with two names charged 65536, rather than the existing counter's 131072. - Both projects are fully charged for cloned/deduplicated extents. Another Home's edit or deletion did not immediately change the observed charge of the untouched Home. But an identical subsequent local edit charged more when a shared peer existed: 4321280 bytes versus 4194304 without a peer. Thus full charging alone does not satisfy "usage must never reveal that someone else has the same file" on this mount. Likely mechanism: CoW allocation/reservation, consistent with the source and stat output; no mitigation was established by this probe. - The project belongs to the inode, not to its current path. A rename out to an unprojected directory succeeded and kept charging the old Home. Open but unlinked files stayed charged until close. The owner could also explicitly change the file's project ID to zero. - The unprivileged owner can set up the tree, but reading a project quota requires CAP_SYS_ADMIN at runtime. One-time privileged tree setup alone does not solve access to usage reads. No product code, commits, pushes, merges, deployments, or new PRs. Tracking branch job/xfs-quota-probe-20261029 points to the base/head a779a46f4299ade3a222aab7448d11db84b6c0d2. 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](https://github.com/torvalds/linux/blob/v6.12/fs/ioctl.c) and [quotactl permission checks](https://github.com/torvalds/linux/blob/v6.12/fs/quota/quota.c), 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: ```text kernel: 6.12.113+deb13-amd64 caps: CapEff: 0000000000000000 before (2147483648, 0, 0, 0, 0) SET project ID as owner: SUCCESS SET PROJINHERIT as owner: SUCCESS after (2147484160, 0, 0, 1754001, 0) $ /usr/sbin/xfs_quota -x -c state /srv/quota-probe User quota state on /srv/quota-probe (/dev/loop0) Accounting: OFF Enforcement: OFF Inode: N/A Blocks grace time: [--------] Blocks max warnings: 0 Inodes grace time: [--------] Inodes max warnings: 0 Realtime Blocks grace time: [--------] Realtime Blocks max warnings: 0 Group quota state on /srv/quota-probe (/dev/loop0) Accounting: OFF Enforcement: OFF Inode: N/A Blocks grace time: [--------] Blocks max warnings: 0 Inodes grace time: [--------] Inodes max warnings: 0 Realtime Blocks grace time: [--------] Realtime Blocks max warnings: 0 Project quota state on /srv/quota-probe (/dev/loop0) Accounting: ON Enforcement: ON Inode: #131 (2 blocks, 2 extents) Blocks grace time: [7 days] Blocks max warnings: 0 Inodes grace time: [7 days] Inodes max warnings: 0 Realtime Blocks grace time: [7 days] Realtime Blocks max warnings: 0 exit=0 $ sudo -n /usr/sbin/xfs_quota -x -c state /srv/quota-probe User quota state on /srv/quota-probe (/dev/loop0) Accounting: OFF Enforcement: OFF Inode: N/A Blocks grace time: [--------] Blocks max warnings: 0 Inodes grace time: [--------] Inodes max warnings: 0 Realtime Blocks grace time: [--------] Realtime Blocks max warnings: 0 Group quota state on /srv/quota-probe (/dev/loop0) Accounting: OFF Enforcement: OFF Inode: N/A Blocks grace time: [--------] Blocks max warnings: 0 Inodes grace time: [--------] Inodes max warnings: 0 Realtime Blocks grace time: [--------] Realtime Blocks max warnings: 0 Project quota state on /srv/quota-probe (/dev/loop0) Accounting: ON Enforcement: ON Inode: #131 (2 blocks, 2 extents) Blocks grace time: [7 days] Blocks max warnings: 0 Inodes grace time: [7 days] Inodes max warnings: 0 Realtime Blocks grace time: [7 days] Realtime Blocks max warnings: 0 exit=0 $ /usr/sbin/xfs_quota -x -c quota -p -b -N 1754001 /srv/quota-probe exit=0 ``` Verbatim setup, reflink control, dedupe and restore output (the later sections discuss the same tests): ```text SETUP AND QUERY PERMISSIONS $ /usr/sbin/xfs_quota -x -c project -s -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/recursive 1754301 /srv/quota-probe Setting up project 1754301 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/recursive)... Processed 1 (/etc/projects and cmdline) paths for project 1754301 with recursion depth infinite (-1). exit=0 recursive root {'id': 1754301, 'inherit': True} nested {'id': 1754301, 'inherit': True} file {'id': 1754301, 'inherit': False} PASS unprivileged xfs_quota project -s recursively labels old contents $ /usr/sbin/xfs_quota -x -c quota -p -b -n -N -v 1754301 /srv/quota-probe exit=0 $ sudo -n /usr/sbin/xfs_quota -x -c quota -p -b -n -N -v 1754301 /srv/quota-probe /dev/loop0 4 0 0 00 [--------] /srv/quota-probe exit=0 $ /usr/sbin/xfs_quota -x -c limit -p bhard=64k 1754301 /srv/quota-probe xfs_quota: cannot set limits: Operation not permitted exit=1 REFLINK PRIVACY CONTROL unshared before 4194304 unshared after 4KiB edit 4194304 stat_blocks_bytes 4194304 shared-live before 4194304 shared-live after 4KiB edit 4321280 stat_blocks_bytes 4321280 shared-deleted before 4194304 shared-deleted after 4KiB edit 4194304 stat_blocks_bytes 4194304 FIDEDUPERANGE before dedupe {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} FIDEDUPERANGE result (4, 0, 4194304, 0, 0) PASS cross-project FIDEDUPERANGE accepted after dedupe {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} SNAPSHOT dedupe both fully charged dedupe-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS dedupe-a allocated quota == independent stat walk PASS dedupe-a inode quota covers live walk (recently unlinked inodes may await reclaim) dedupe-b {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS dedupe-b allocated quota == independent stat walk PASS dedupe-b inode quota covers live walk (recently unlinked inodes may await reclaim) TAR RESTORE tar-unprepared root {'id': 0, 'inherit': False} nested {'id': 0, 'inherit': False} data {'id': 0, 'inherit': False} tar-prepared root {'id': 1754351, 'inherit': True} nested {'id': 1754351, 'inherit': True} data {'id': 1754351, 'inherit': False} PASS tar --xattrs --acls does not retain source project ID PASS tar into prepared root inherits destination project $ /usr/sbin/xfs_quota -x -c project -s -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-unprepared 1754352 /srv/quota-probe Setting up project 1754352 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-unprepared)... Processed 1 (/etc/projects and cmdline) paths for project 1754352 with recursion depth infinite (-1). exit=0 repaired restore {'id': 1754352, 'inherit': False} PASS recursive setup repairs restored tree rsync: NOT TESTED; executable not installed ``` ## 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](https://github.com/torvalds/linux/blob/v6.12/include/uapi/linux/dqblk_xfs.h). 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](https://github.com/torvalds/linux/blob/v6.12/fs/xfs/xfs_qm_syscalls.c). Observed behavior: | Operation | Result | |---|---| | Normal 10001-byte file | 12288 allocated bytes | | Sparse 16 MiB file, one written byte | 4096 allocated bytes | | Separate outside subprocess append | Immediately charged without server watcher participation | | Truncate and atomic replacement | Charge followed the new allocation | | Rename within a Home | No usage change | | rename(2) between inherited Homes | EXDEV, even though both paths are on the same filesystem | | mv --no-copy between Homes | Failed, preserved source | | Ordinary GNU mv between Homes | Succeeded by copy/unlink; destination inherited its Home's project; charge moved after completion, not via an atomic cross-project rename | | Hard link within Home | One charged inode; per-name logical total doubled | | Hard link across inherited Homes | EXDEV | | Hard link from Home into unprojected directory | Succeeded; writing through outside alias changed original project's usage | | Non-UTF-8 filename | Counted correctly | | Move out into unprojected directory | Retained project ID and old charge; no longer matched a path-scoped Home walk | | Open, then remove all names | Charge stayed until last close | | Owner changes file project ID | Succeeded; charge transferred even while file remained in old Home's path | 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: ```text All filesystem mutations run as uid 1002 with no capabilities. Only quota inspection/limits use sudo xfs_quota. SNAPSHOT empty home-a {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) SNAPSHOT normal 10001 bytes home-a {"allocated_unique_with_dirs": 12288, "inodes": 2, "logical_per_name": 10001, "logical_unique": 10001} quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0 12 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) SNAPSHOT sparse logical 16MiB with one allocated block home-a {"allocated_unique_with_dirs": 16384, "inodes": 3, "logical_per_name": 16787217, "logical_unique": 16787217} quota {'allocated': 16384, 'inodes': 3, 'raw': '/dev/loop0 16 0 0 00 [--------] 3 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) SNAPSHOT outside subprocess appends 8192 home-a {"allocated_unique_with_dirs": 24576, "inodes": 3, "logical_per_name": 16795409, "logical_unique": 16795409} quota {'allocated': 24576, 'inodes': 3, 'raw': '/dev/loop0 24 0 0 00 [--------] 3 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) SNAPSHOT truncate to 3000 home-a {"allocated_unique_with_dirs": 8192, "inodes": 3, "logical_per_name": 16780216, "logical_unique": 16780216} quota {'allocated': 8192, 'inodes': 3, 'raw': '/dev/loop0 8 0 0 00 [--------] 3 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) SNAPSHOT atomic replacement home-a {"allocated_unique_with_dirs": 69632, "inodes": 3, "logical_per_name": 16842752, "logical_unique": 16842752} quota {'allocated': 69632, 'inodes': 3, 'raw': '/dev/loop0 68 0 0 00 [--------] 3 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) SNAPSHOT rename within Home home-a {"allocated_unique_with_dirs": 69632, "inodes": 3, "logical_per_name": 16842752, "logical_unique": 16842752} quota {'allocated': 69632, 'inodes': 3, 'raw': '/dev/loop0 68 0 0 00 [--------] 3 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) os.rename A to B errno=18 Invalid cross-device link PASS os.rename A to B expected errno=18 mv --no-copy exit 1 stderr mv: cannot move '/srv/quota-probe/xfs-probe-20261029/semantics-run2/home-a/renamed' to '/srv/quota-probe/xfs-probe-20261029/semantics-run2/home-b/moved': Invalid cross-device link PASS mv --no-copy preserves source on EXDEV ordinary mv exit 0 stderr PASS ordinary mv falls back to copy/unlink ordinary mv destination project {'id': 1754202, 'inherit': False} SNAPSHOT mv A to B copy then unlink home-a {"allocated_unique_with_dirs": 4096, "inodes": 2, "logical_per_name": 16777216, "logical_unique": 16777216} quota {'allocated': 4096, 'inodes': 2, 'raw': '/dev/loop0 4 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 65536, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0 64 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) SNAPSHOT hard link within Home charges inode once home-a {"allocated_unique_with_dirs": 4096, "inodes": 2, "logical_per_name": 16777216, "logical_unique": 16777216} quota {'allocated': 4096, 'inodes': 2, 'raw': '/dev/loop0 4 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0 64 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) hard link B to A errno=18 Invalid cross-device link PASS hard link B to A expected errno=18 non-UTF8 path repr b'/srv/quota-probe/xfs-probe-20261029/semantics-run2/home-a/bad-\xff-\xfe' SNAPSHOT non UTF8 filename home-a {"allocated_unique_with_dirs": 12288, "inodes": 3, "logical_per_name": 16784216, "logical_unique": 16784216} quota {'allocated': 12288, 'inodes': 3, 'raw': '/dev/loop0 12 0 0 00 [--------] 3 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0 64 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) new dir {'id': 1754201, 'inherit': True} new file {'id': 1754201, 'inherit': False} PASS new subdirectory inherits flag and project outside file {'id': 0, 'inherit': False} rename project 0 into inherited Home errno=18 Invalid cross-device link PASS rename project 0 into inherited Home expected errno=18 outside ordinary mv destination {'id': 1754201, 'inherit': False} SNAPSHOT outside mv copy/unlink inherits destination home-a {"allocated_unique_with_dirs": 24576, "inodes": 6, "logical_per_name": 16796504, "logical_unique": 16796504} quota {'allocated': 24576, 'inodes': 6, 'raw': '/dev/loop0 24 0 0 00 [--------] 6 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0 64 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) moved out project {'id': 1754201, 'inherit': False} A quota {'allocated': 24576, 'inodes': 6, 'raw': '/dev/loop0 24 0 0 00 [--------] 6 0 0 00 [--------] /srv/quota-probe'} A walk {'logical_per_name': 16792408, 'logical_unique': 16792408, 'allocated_unique_with_dirs': 20480, 'inodes': 5} PASS move out retains project ID SNAPSHOT delete escaped inode releases original charge home-a {"allocated_unique_with_dirs": 20480, "inodes": 5, "logical_per_name": 16792408, "logical_unique": 16792408} quota {'allocated': 20480, 'inodes': 5, 'raw': '/dev/loop0 20 0 0 00 [--------] 5 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0 64 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) owner relabel sparse to project 0: SUCCESS; A quota {'allocated': 16384, 'inodes': 4, 'raw': '/dev/loop0 16 0 0 00 [--------] 4 0 0 00 [--------] /srv/quota-probe'} walk {'logical_per_name': 16792408, 'logical_unique': 16792408, 'allocated_unique_with_dirs': 20480, 'inodes': 5} SNAPSHOT restored sparse project label home-a {"allocated_unique_with_dirs": 20480, "inodes": 5, "logical_per_name": 16792408, "logical_unique": 16792408} quota {'allocated': 20480, 'inodes': 5, 'raw': '/dev/loop0 20 0 0 00 [--------] 5 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 65536, "inodes": 2, "logical_per_name": 131072, "logical_unique": 65536} quota {'allocated': 65536, 'inodes': 2, 'raw': '/dev/loop0 64 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) SNAPSHOT reflink source clone-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS clone-a allocated quota == independent stat walk PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim) clone-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS clone-b allocated quota == independent stat walk PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim) SNAPSHOT cross-project cp --reflink=always clone-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS clone-a allocated quota == independent stat walk PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim) clone-b {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS clone-b allocated quota == independent stat walk PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim) PASS CoW preserves source bytes SNAPSHOT clone edits first 4KiB clone-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS clone-a allocated quota == independent stat walk PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim) clone-b {"allocated_unique_with_dirs": 4321280, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4321280, 'inodes': 2, 'raw': '/dev/loop0 4220 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS clone-b allocated quota == independent stat walk PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim) PASS other Home edit does not change source charge SNAPSHOT delete clone clone-a {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS clone-a allocated quota == independent stat walk PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim) clone-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS clone-b allocated quota == independent stat walk PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim) PASS other Home deletion does not change source charge SNAPSHOT delete original with clone alive clone-a {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS clone-a allocated quota == independent stat walk PASS clone-a inode quota covers live walk (recently unlinked inodes may await reclaim) clone-b {"allocated_unique_with_dirs": 4194304, "inodes": 2, "logical_per_name": 4194304, "logical_unique": 4194304} quota {'allocated': 4194304, 'inodes': 2, 'raw': '/dev/loop0 4096 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS clone-b allocated quota == independent stat walk PASS clone-b inode quota covers live walk (recently unlinked inodes may await reclaim) PASS original deletion does not change clone charge link Home file OUT to unprojected dir: SUCCESS SNAPSHOT outside hardlink write updates owning project home-a {"allocated_unique_with_dirs": 20480, "inodes": 5, "logical_per_name": 16792408, "logical_unique": 16792408} quota {'allocated': 20480, 'inodes': 5, 'raw': '/dev/loop0 20 0 0 00 [--------] 5 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 12288, "inodes": 2, "logical_per_name": 24576, "logical_unique": 12288} quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0 12 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) open unlinked inode: B quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0 12 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} B walk {'logical_per_name': 0, 'logical_unique': 0, 'allocated_unique_with_dirs': 0, 'inodes': 1} PASS open unlinked file charged until close SNAPSHOT last close releases charge home-a {"allocated_unique_with_dirs": 20480, "inodes": 5, "logical_per_name": 16792408, "logical_unique": 16792408} quota {'allocated': 20480, 'inodes': 5, 'raw': '/dev/loop0 20 0 0 00 [--------] 5 0 0 00 [--------] /srv/quota-probe'} PASS home-a allocated quota == independent stat walk PASS home-a inode quota covers live walk (recently unlinked inodes may await reclaim) home-b {"allocated_unique_with_dirs": 0, "inodes": 1, "logical_per_name": 0, "logical_unique": 0} quota {'allocated': 0, 'inodes': 1, 'raw': '/dev/loop0 0 0 0 00 [--------] 1 0 0 00 [--------] /srv/quota-probe'} PASS home-b allocated quota == independent stat walk PASS home-b inode quota covers live walk (recently unlinked inodes may await reclaim) SEMANTICS CHECKS PASSED 92 ``` ## 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: ```text unshared before 4194304 unshared after 4KiB edit 4194304 stat_blocks_bytes 4194304 shared-live before 4194304 shared-live after 4KiB edit 4321280 stat_blocks_bytes 4321280 shared-deleted before 4194304 shared-deleted after 4KiB edit 4194304 stat_blocks_bytes 4194304 ``` 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. | New test projects | One read incl. process startup | 10000 reads, same Home | 10000 reads, random Homes | |---:|---:|---:|---:| | 1 | 7.915 ms | 43.086 ms | 41.695 ms | | 100 | 8.398 ms | 41.510 ms | 43.140 ms | | 10000 | 8.123 ms | 41.665 ms | 43.509 ms | 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](https://github.com/torvalds/linux/blob/v6.12/fs/xfs/xfs_dquot.c). 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: ```text Scope: local supplied XFS mount only; xfs_quota Q_XGETQUOTA path via privileged tool. Not an application perf gate. No cache drop available under allowed sudo; all timings warm and include CLI/privilege startup/formatting. PROJECTS 1 setup_seconds 0.0 {"projects": 1, "case": "one_read", "requests": 1, "warmup_ms": 9.081, "samples_ms": [8.734, 8.48, 7.893, 7.726, 7.913, 7.915, 8.124], "median_ms": 7.915, "median_us_per_query_with_startup": 7915.437} {"projects": 1, "case": "same_Home_10000_reads", "requests": 10000, "warmup_ms": 40.217, "samples_ms": [41.12, 46.439, 44.375, 44.377, 41.107, 41.915, 43.086], "median_ms": 43.086, "median_us_per_query_with_startup": 4.309} {"projects": 1, "case": "random_Home_10000_reads", "requests": 10000, "warmup_ms": 84.911, "samples_ms": [41.528, 39.19, 43.973, 40.619, 41.695, 41.896, 45.07], "median_ms": 41.695, "median_us_per_query_with_startup": 4.169} PROJECTS 100 setup_seconds 0.004 {"projects": 100, "case": "one_read", "requests": 1, "warmup_ms": 9.098, "samples_ms": [8.076, 8.398, 8.13, 8.2, 8.763, 9.753, 8.692], "median_ms": 8.398, "median_us_per_query_with_startup": 8397.671} {"projects": 100, "case": "same_Home_10000_reads", "requests": 10000, "warmup_ms": 40.196, "samples_ms": [42.105, 41.51, 40.314, 40.404, 41.977, 40.54, 42.088], "median_ms": 41.51, "median_us_per_query_with_startup": 4.151} {"projects": 100, "case": "random_Home_10000_reads", "requests": 10000, "warmup_ms": 41.169, "samples_ms": [43.321, 43.14, 41.492, 47.608, 53.02, 42.075, 40.918], "median_ms": 43.14, "median_us_per_query_with_startup": 4.314} PROJECTS 10000 setup_seconds 0.403 {"projects": 10000, "case": "one_read", "requests": 1, "warmup_ms": 9.153, "samples_ms": [8.04, 8.218, 7.849, 8.144, 7.691, 8.123, 8.799], "median_ms": 8.123, "median_us_per_query_with_startup": 8122.631} {"projects": 10000, "case": "same_Home_10000_reads", "requests": 10000, "warmup_ms": 40.522, "samples_ms": [40.359, 45.112, 41.68, 41.665, 39.17, 41.508, 46.001], "median_ms": 41.665, "median_us_per_query_with_startup": 4.167} {"projects": 10000, "case": "random_Home_10000_reads", "requests": 10000, "warmup_ms": 43.262, "samples_ms": [44.054, 42.106, 45.291, 41.428, 44.546, 43.509, 42.835], "median_ms": 43.509, "median_us_per_query_with_startup": 4.351} QUERY COST CHECKS PASSED: all requested quota records returned for 1, 100, 10000 projects ``` ## 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](https://github.com/torvalds/linux/blob/v6.12/fs/xfs/xfs_trans_dquot.c); 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: ```text ENFORCEMENT independent outside process $ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=1m 1754380 /srv/quota-probe exit=0 outside writer stage=write accepted_bytes=1048576 errno=28 No space left on device PASS XFS inherited project hard quota returns ENOSPC to writer hard usage {'allocated': 1048576, 'inodes': 2, 'raw': '/dev/loop0 1024 0 1024 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} $ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=64k 1754380 /srv/quota-probe exit=0 create under exhausted project limit errno=28 No space left on device PASS create under exhausted project limit expected errno=28 $ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=0 1754380 /srv/quota-probe exit=0 $ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=1m 1754382 /srv/quota-probe exit=0 clone over quota exit 1 stderr cp: failed to clone '/srv/quota-probe/xfs-probe-20261029/semantics-run2/clone-limit-v2/dest' from '/srv/quota-probe/xfs-probe-20261029/semantics-run2/limit-source/source': No space left on device PASS reflink obeys destination hard quota $ sudo -n /usr/sbin/xfs_quota -x -c limit -p bhard=0 1754382 /srv/quota-probe exit=0 $ sudo -n /usr/sbin/xfs_quota -x -c limit -p bsoft=1m bhard=4m 1754383 /srv/quota-probe exit=0 $ sudo -n /usr/sbin/xfs_quota -x -c quota -p -b -n -N -v 1754383 /srv/quota-probe /dev/loop0 2048 1024 4096 00 [7 days] /srv/quota-probe exit=0 soft exceeded within default 7-day grace: write accepted $ sudo -n /usr/sbin/xfs_quota -x -c timer -p -b 1 1754383 /srv/quota-probe exit=0 $ sudo -n /usr/sbin/xfs_quota -x -c quota -p -b -n -N -v 1754383 /srv/quota-probe /dev/loop0 2048 1024 4096 00 [00:00:01] /srv/quota-probe exit=0 ``` Verbatim successful soft-grace enforcement test: ```text Expiring only this probe project; global grace is unchanged. $ xfs_quota -x -c 'timer -p -b 1 1754383' outside write after grace errno=28 No space left on device PASS soft-grace expiry enforced as ENOSPC Observed allocation refusal after seconds 1.753 attempts 124 $ xfs_quota -x -c 'quota -p -b -n -N -v 1754383' /dev/loop0 2048 1024 4096 00 [0 days] /srv/quota-probe $ xfs_quota -x -c 'limit -p bsoft=0 bhard=0 1754383' SOFT GRACE CHECKS PASSED ``` ## 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: ```text LIVE supplied mount flags=0x30 accounting=ON enforcement=ON backend=project-quota (also verify privileged usage read) SIMULATED missing accounting flags=0x0 accounting=OFF enforcement=OFF backend=full-Home recount SIMULATED accounting-only mount flags=0x10 accounting=ON enforcement=OFF backend=project-quota (also verify privileged usage read) ``` Verbatim GNU du, buffered-write and recursive project-check tests: ```text DIRECTORY BLOCKS AND DU SNAPSHOT 1000 one-byte files, including allocated directory blocks many-tiny-files {"allocated_unique_with_dirs": 4132864, "inodes": 1001, "logical_per_name": 1000, "logical_unique": 1000} quota {'allocated': 4132864, 'inodes': 1001, 'raw': '/dev/loop0 4036 0 0 00 [--------] 1001 0 0 00 [--------] /srv/quota-probe'} PASS many-tiny-files allocated quota == independent stat walk PASS many-tiny-files inode quota covers live walk (recently unlinked inodes may await reclaim) $ du -s -B1 /srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files 4132864 /srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files $ du -s -B1 --apparent-size /srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files 1000 /srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files $ du -s -B1 --apparent-size --count-links /srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files 1000 /srv/quota-probe/xfs-probe-20261029/semantics-run2/many-tiny-files quota bytes 4132864 root directory allocated bytes 36864 LIVE BUFFERED WRITE VS QUOTA before fsync/close: stat bytes 12288 quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0 12 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} after fsync, still open: stat bytes 12288 quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0 12 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} SNAPSHOT after close buffered-write {"allocated_unique_with_dirs": 12288, "inodes": 2, "logical_per_name": 10001, "logical_unique": 10001} quota {'allocated': 12288, 'inodes': 2, 'raw': '/dev/loop0 12 0 0 00 [--------] 2 0 0 00 [--------] /srv/quota-probe'} PASS buffered-write allocated quota == independent stat walk PASS buffered-write inode quota covers live walk (recently unlinked inodes may await reclaim) EXPLICIT FULL TREE CHECK $ xfs_quota -x -c 'project -c -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/home-a 1754201' Checking project 1754201 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/home-a)... Processed 1 (/etc/projects and cmdline) paths for project 1754201 with recursion depth infinite (-1). exit=0 PASS project check home-a $ xfs_quota -x -c 'project -c -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/home-b 1754202' Checking project 1754202 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/home-b)... Processed 1 (/etc/projects and cmdline) paths for project 1754202 with recursion depth infinite (-1). exit=0 PASS project check home-b $ xfs_quota -x -c 'project -c -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-prepared 1754351' Checking project 1754351 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-prepared)... Processed 1 (/etc/projects and cmdline) paths for project 1754351 with recursion depth infinite (-1). exit=0 PASS project check tar-prepared $ xfs_quota -x -c 'project -c -p /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-unprepared 1754352' Checking project 1754352 (path /srv/quota-probe/xfs-probe-20261029/semantics-run2/tar-unprepared)... Processed 1 (/etc/projects and cmdline) paths for project 1754352 with recursion depth infinite (-1). exit=0 PASS project check tar-unprepared reset first hard-limit probe to unlimited exit 0 FINAL EXTRA CHECKS PASSED ``` ## 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: ```text $ findmnt -n -t ext4 -o TARGET,FSTYPE,OPTIONS / ext4 rw,relatime,discard,errors=remount-ro $ command -v rsync (no output; exit 1) ``` ## 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: a779a46f4299ade3a222aab7448d11db84b6c0d2 (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: ```text PASS all Python probe scripts compile PASS report covers all seven questions PASS recorded semantic run: 92 checks PASS recorded query rows verified at 1/100/10000 new projects PASS recorded soft-grace allocation refusal PASS live allocated stat walk matches project 1754201 PASS live allocated stat walk matches project 1754202 PASS live allocated stat walk matches project 1754211 PASS live allocated stat walk matches project 1754212 PASS live allocated stat walk matches project 1754351 PASS live allocated stat walk matches project 1754352 PASS live allocated stat walk matches project 1754390 PASS live allocated stat walk matches project 1754391 PASS live root and new directory retain project inheritance PASS fresh cross-project reflink fully charges both projects Fresh identical-edit charges: unshared=4194304 shared-peer-alive=4321280 shared-peer-deleted=4194304 PASS fresh control reproduces sharing-dependent charge PASS live unprivileged Q_XGETQUOTA denied with EPERM PASS live accounting and enforcement remain ON PASS fresh hard-limit write stops at 1048576 bytes with ENOSPC PASS base/head unchanged: a779a46f4299ade3a222aab7448d11db84b6c0d2 PASS no tracked product changes PASS only pre-existing untracked result.md remains Logical per-name compatibility: NO-GO Strict cross-user dedupe invisibility with raw usage: NO-GO Allocated project accounting and warm lookup feasibility: GO with runtime helper and stated limits Untested: ext4 quotas; rsync; live no-accounting mount; product HTTP; cold cache; crash; multi-mount admission PROBE EVIDENCE GATE: PASS ```
Author
Owner

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.

Starting slice 1 on feat/tiering-731 from origin/dev at d83e54dbe571b625504001a8b6add90d44ca6161. 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.
Author
Owner

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.

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.
Author
Owner

Started the documentation-only plan on branch docs/tiering-731-plan, based on origin/dev at d83e54dbe571b625504001a8b6add90d44ca6161 (the #736 amendment). Reading all #731 decisions, ADRs 0062–0064, repository guidance, current storage paths and performance gates before writing docs/plans/0731-tiering.md. No product code, merge or deployment.

Started the documentation-only plan on branch `docs/tiering-731-plan`, based on `origin/dev` at `d83e54dbe571b625504001a8b6add90d44ca6161` (the #736 amendment). Reading all #731 decisions, ADRs 0062–0064, repository guidance, current storage paths and performance gates before writing `docs/plans/0731-tiering.md`. No product code, merge or deployment.
Author
Owner

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.

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.
Author
Owner

Plan review finding: reference-only WIP 5fce7eb uses 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.

Plan review finding: reference-only WIP 5fce7eb uses 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.
Author
Owner

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.

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.
Author
Owner

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.

Resuming the documentation-only plan on docs/tiering-731-plan at 8c6e7b136f4bae2aa92a942f12f3a6d1b282bd2c. 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.
Author
Owner

Resume finding: checkpoint 8c6e7b136f adds 191 evidence/browser files under .job-731; its parent e7553c07ee changes 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.

Resume finding: checkpoint 8c6e7b136f4bae2aa92a942f12f3a6d1b282bd2c adds 191 evidence/browser files under .job-731; its parent e7553c07ee1667b7aefd5034c883c533fe192b86 changes 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.
Author
Owner

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.

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.
Author
Owner

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.

PR https://git.kayg.org/kayg/calternal/pulls/761 is open into dev at 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. 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.
Author
Owner

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.

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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80; PR #761 and the document are unchanged.
Author
Owner

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:

PASS Markdown: Forgejo GFM HTTP 200; seven required sections, two tables, five second-pass risks.
PASS Links: five relative links resolve locally and render to the correct branch paths.
PASS Length: 2,321 words; 4 A4 pages at 10.5 pt body / 9.5 pt tables, 14 mm margins.
PASS Cost review: seven operations include complexity, syscalls, disks and budgets; existing gates unchanged.
PASS Failure review: eleven rows cover journal boundaries, outside races, open inodes, disk faults, two processes and state loss.
PASS Plan review: first-PR scale/model/crash gates, FO1, joined-reader/quota contracts, slices and five failure checks covered.
PASS git diff --check: exit 0 against origin/dev.
PASS Scope: only docs/plans/0731-tiering.md changed in every proposed commit; worktree clean; no product code or evidence artifacts.
PASS Remote: docs/tiering-731-plan points to 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80.
NOTE Docs only: no product build, crash campaign, isolation audit or performance measurement was run.
Finished the documentation-only storage tiering plan. PR: https://git.kayg.org/kayg/calternal/pulls/761 (Plan: storage tiering (#731), into dev). Branch: docs/tiering-731-plan. Base: d83e54dbe571b625504001a8b6add90d44ca6161. Head: 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. 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: ```text PASS Markdown: Forgejo GFM HTTP 200; seven required sections, two tables, five second-pass risks. PASS Links: five relative links resolve locally and render to the correct branch paths. PASS Length: 2,321 words; 4 A4 pages at 10.5 pt body / 9.5 pt tables, 14 mm margins. PASS Cost review: seven operations include complexity, syscalls, disks and budgets; existing gates unchanged. PASS Failure review: eleven rows cover journal boundaries, outside races, open inodes, disk faults, two processes and state loss. PASS Plan review: first-PR scale/model/crash gates, FO1, joined-reader/quota contracts, slices and five failure checks covered. PASS git diff --check: exit 0 against origin/dev. PASS Scope: only docs/plans/0731-tiering.md changed in every proposed commit; worktree clean; no product code or evidence artifacts. PASS Remote: docs/tiering-731-plan points to 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. NOTE Docs only: no product build, crash campaign, isolation audit or performance measurement was run. ```
Author
Owner

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 design review of PR #761 started. Review worktree: detached at origin/docs/tiering-731-plan. Base and reviewed SHA: 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. 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.
Author
Owner

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_swap at 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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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](https://git.kayg.org/kayg/calternal/src/commit/2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80/crates/fsio/src/swap.rs#L152), particularly `after_swap` at 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.
Author
Owner

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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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.
Author
Owner

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-simple counts 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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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](https://git.kayg.org/kayg/calternal/src/commit/bb36381dd14878c3bdafba1794f4ef89eb0f07a8/crates/fsio/src/usage.rs#L1), lines 1–26, 188–255; `usage/scan.rs:52–110`; `auth/src/quota.rs:74–108`. `perf/quota-simple` counts 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.”
Author
Owner

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:

  • First use loads the entire ids.jsonl; reopening an unloaded index does the same under its mutex: O(N) bytes/entries.
  • An unknown non-daily ID can wait for the startup scan, up to 60 seconds. “Dirty or unindexed names wait” does not provide an open latency bound.
  • A room collects all history updates into a vector, then applies every update. H is unbounded; the plan notices this but chooses no checkpoint/replay bound. Update-application cost and retained CRDT state also need measurement; counting serialized history bytes alone is not a time proof.
  • Every direct open synchronously probes HDD metadata. At depth d, cold pathname lookup can require several storage reads even for an SSD note. O(d) and O(log N) do not bound rotational seek/queue latency below 15 ms under concurrent scan, quota and dedupe traffic.

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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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](https://git.kayg.org/kayg/calternal/src/commit/2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80/crates/notes/src/index.rs#L144); `scan.rs:144–160`; [room/load.rs:44](https://git.kayg.org/kayg/calternal/src/commit/2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80/crates/notes/src/room/load.rs#L44); `history.rs:803–823`. The proposed joined lookup removes enumeration from one layer, but the current caller still has these costs: - First use loads the entire `ids.jsonl`; reopening an unloaded index does the same under its mutex: O(N) bytes/entries. - An unknown non-daily ID can wait for the startup scan, up to 60 seconds. “Dirty or unindexed names wait” does not provide an open latency bound. - A room collects **all** history updates into a vector, then applies every update. H is unbounded; the plan notices this but chooses no checkpoint/replay bound. Update-application cost and retained CRDT state also need measurement; counting serialized history bytes alone is not a time proof. - Every direct open synchronously probes HDD metadata. At depth d, cold pathname lookup can require several storage reads even for an SSD note. O(d) and O(log N) do not bound rotational seek/queue latency below 15 ms under concurrent scan, quota and dedupe traffic. **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.
Author
Owner

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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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.
Author
Owner

Independent review of PR #761 at 2cf7e3fbd8.

S1. Descriptor safety needs an ownership/ancestor and mount policy, not just beneath

Plan: 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 beneath uses BENEATH | NO_MAGICLINKS, not NO_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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### S1. Descriptor safety needs an ownership/ancestor and mount policy, not just `beneath` **Plan:** 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 `beneath` uses `BENEATH | NO_MAGICLINKS`, **not** `NO_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.
Author
Owner

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 branch usage/scan.rs:83–101.

Scenario: two names with raw bytes ff 2e 6d 64 and fe 2e 6d 64 both become the same replacement-character string under lossy UTF-8 conversion. Current Folder::names and disk_names use 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 current rename_safely shows. 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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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 branch `usage/scan.rs:83–101`. **Scenario:** two names with raw bytes `ff 2e 6d 64` and `fe 2e 6d 64` both become the same replacement-character string under lossy UTF-8 conversion. Current `Folder::names` and `disk_names` use 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 current `rename_safely` shows. 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.
Author
Owner

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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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.
Author
Owner

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_safely for a 10k-descendant folder invokes usage::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 syncfs on 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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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_safely` for a 10k-descendant folder invokes `usage::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 `syncfs` on 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.
Author
Owner

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–69 currently uses 750 ms quiet and 5 seconds maximum; room/save.rs:83–123,145–199 accepts 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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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–69` currently uses 750 ms quiet and **5 seconds** maximum; `room/save.rs:83–123,145–199` accepts 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.
Author
Owner

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–410 caches size and mtime; fsio/src/lib.rs:641–651 uses 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 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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–410` caches size and mtime; `fsio/src/lib.rs:641–651` uses 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.
Author
Owner

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 at 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80. ### 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.
Author
Owner

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:

PASS reviewed HEAD unchanged: 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80
PASS worktree clean; no product changes or repository evidence artifacts
PASS PR diff changes only docs/plans/0731-tiering.md
PASS git diff --check against the PR base
PASS review contains 5 blocking and 7 should-fix findings with concrete scenarios
PASS cited source-link targets exist at the pinned commits
PASS three deterministic syscall counterexamples recorded (not product tests)
PASS PR #761 still points to the reviewed HEAD
PASS all 12 finding comments read back verbatim from issue #731
PASS full review.md read back verbatim from PR #761
PASS review.md and result.md saved outside the repository
NOTE Design/source review only; no product build, test suite or performance gates run
REVIEW DELIVERY AND SCOPE GATE: PASS
Independent review of PR #761 finished. Verdict: revise. Reviewed/head SHA: 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80 (unchanged). Full review: https://git.kayg.org/kayg/calternal/pulls/761#issuecomment-69394 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: ```text PASS reviewed HEAD unchanged: 2cf7e3fbd8ca3d3180ce50fbe2cafb8ecc179c80 PASS worktree clean; no product changes or repository evidence artifacts PASS PR diff changes only docs/plans/0731-tiering.md PASS git diff --check against the PR base PASS review contains 5 blocking and 7 should-fix findings with concrete scenarios PASS cited source-link targets exist at the pinned commits PASS three deterministic syscall counterexamples recorded (not product tests) PASS PR #761 still points to the reviewed HEAD PASS all 12 finding comments read back verbatim from issue #731 PASS full review.md read back verbatim from PR #761 PASS review.md and result.md saved outside the repository NOTE Design/source review only; no product build, test suite or performance gates run REVIEW DELIVERY AND SCOPE GATE: PASS ```
Author
Owner

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

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](https://claude.com/claude-code)
Author
Owner

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:

  • B1 — ordinary saves/old writable descriptors: every replacement, including saves, companions, undo/restore and cleanup, retains displaced inodes. Hashes, quiet and inode checks never authorize deletion. Reclamation initially requires an offline exclusion pass covering old descriptors, mmap, aliases and new opens; indefinite retention/space backpressure and FO1 failures are explicit. The exact late-write-after-exchange vector gates materialization before moves.
  • B2 — Home-only recovery: one protected authoritative Home log; immutable byte-complete note/card payloads; PREPARE/APPLY/COMMIT/CLEAN with a synced HEAD commit point. Added auth/revocation ordering, checkpoint cutoff plus linked suffix, committed-corruption refusal versus torn-tail repair, payload retirement, per-filesystem parent syncs and a durable bootstrap-generation marker that survives repeated rebuild crashes. State is a projection. Protected recovery bytes are excluded from ordinary reads/lists/exports.
  • B3 — quota: explicitly owned by #764, perf/quota-simple at d0e6d6f6 (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.
  • B4 — 15 ms opens: replace full ids.jsonl reload 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.
  • B5 — dedupe privacy: split ships with dedupe OFF. Users see quota-full warnings only; physical-capacity warnings are admin-only. Later dedupe needs sharing-independent headroom/capacity and resource isolation, including binary success/error outcomes after dedupe, peer purge and CoW/materialization. Adaptive near-full and later-operation distributions/tails are required; finite tests are not claimed to prove no signal. T-A2 dedupe delivery remains explicitly incomplete.
  • S1 — topology/descriptor safety: online outside writers may edit files; ancestor moves, cross-person aliases, root/lock replacement and mount changes require offline coordination. Reject nested/bind/detached mounts consistently, validate mount/root identities, and hold identity locks through lingering writer exit across different state aliases. Post-checks cannot repair rename-out exposure.
  • S2 — names/aliases: preserve raw names separately from display/folded keys; non-UTF-8 entries remain counted/preserved but unsupported for mutation. Symlinks are no-follow; hard links charge per name, require inode coverage and are unsupported for mutation/dedupe. Journal every case-only intermediate rename/fsync; NFC/NFD and ancestor case collisions have explicit eventual-observation limits.
  • S3 — scale/resources: added byte distributions and tier totals, large text/cards/history, depth/empty directories, 10M-note aggregate/1M-active fixture and 1M-HDD aggregate cap. Added cache/buffer/job/FD/watch/kernel-memory and temporary/recovery space budgets. The 2M-watch ceiling explicitly does not promise simultaneous quota readiness for all 10M notes. Metadata discovery, full byte audit and dedupe completion are distinct costs.
  • S4 — operation costs/owners: expanded the cost table to upload/admission, classification, conflict retention, Trash/restore/purge/undo, export/backup/auth, rebuild, dedupe and rollback. Charge serialization/hash/CRDT passes, target rereads/source verification, B-tree factors and link materialization. Slices explicitly replace old ID reload/sibling scan, whole-map move hook, destructive after_swap, debounce and broad syncfs paths.
  • S5 — FO1 deadline: track oldest uncovered ack/sequence on a monotonic clock; ≤100 ms batching, post-freeze snapshots, causal successor/tombstone coverage, reserved space/I/O and pre-ack backpressure. Every >1 s sample, including a post-ack disk fault, fails; no unconditional physical deadline is claimed.
  • S6 — freshness/clocks: full byte audits detect metadata-identical rewrites after missed events; classify/search freshness remains eventual until audit completion. Fresh quota uses #764 fences, dedupe uses verified bytes/exclusion. Added preserved-mtime/inode-reuse/clock-jump vectors and sequence/random protocol identities.
  • S7 — adversarial tests/progress: first-code-PR harnesses model real shared inodes/mmap/raw names/mounts/ACLs/sparse sizes, short/partial writes, failed fsync and independent disk persistence. Every slice activates its actual hooks. Added repeated byte-exact bootstrap, cancellation/duplicate publication, in-flight revocation, cross-user schedules, temporary/recovery ENOSPC versus inode exhaustion, and successful-completion/pending/resource metrics so all-pending cannot pass under supported availability/exclusion assumptions.

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 --check against 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.

Round 2 design revision pushed to `docs/tiering-731-plan`: [b1e3ad02](https://git.kayg.org/kayg/calternal/commit/b1e3ad02c6236bb59c2ee5fc348a8241bc870167). Replaces the plan reviewed in [comment 69394](https://git.kayg.org/kayg/calternal/pulls/761#issuecomment-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: - **B1 — ordinary saves/old writable descriptors:** every replacement, including saves, companions, undo/restore and cleanup, retains displaced inodes. Hashes, quiet and inode checks never authorize deletion. Reclamation initially requires an offline exclusion pass covering old descriptors, mmap, aliases and new opens; indefinite retention/space backpressure and FO1 failures are explicit. The exact late-write-after-exchange vector gates materialization before moves. - **B2 — Home-only recovery:** one protected authoritative Home log; immutable byte-complete note/card payloads; PREPARE/APPLY/COMMIT/CLEAN with a synced HEAD commit point. Added auth/revocation ordering, checkpoint cutoff plus linked suffix, committed-corruption refusal versus torn-tail repair, payload retirement, per-filesystem parent syncs and a durable bootstrap-generation marker that survives repeated rebuild crashes. State is a projection. Protected recovery bytes are excluded from ordinary reads/lists/exports. - **B3 — quota:** explicitly owned by #764, `perf/quota-simple` at `d0e6d6f6` (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. - **B4 — 15 ms opens:** replace full `ids.jsonl` reload 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. - **B5 — dedupe privacy:** split ships with dedupe OFF. Users see quota-full warnings only; physical-capacity warnings are admin-only. Later dedupe needs sharing-independent headroom/capacity and resource isolation, including binary success/error outcomes after dedupe, peer purge and CoW/materialization. Adaptive near-full and later-operation distributions/tails are required; finite tests are not claimed to prove no signal. T-A2 dedupe delivery remains explicitly incomplete. - **S1 — topology/descriptor safety:** online outside writers may edit files; ancestor moves, cross-person aliases, root/lock replacement and mount changes require offline coordination. Reject nested/bind/detached mounts consistently, validate mount/root identities, and hold identity locks through lingering writer exit across different state aliases. Post-checks cannot repair rename-out exposure. - **S2 — names/aliases:** preserve raw names separately from display/folded keys; non-UTF-8 entries remain counted/preserved but unsupported for mutation. Symlinks are no-follow; hard links charge per name, require inode coverage and are unsupported for mutation/dedupe. Journal every case-only intermediate rename/fsync; NFC/NFD and ancestor case collisions have explicit eventual-observation limits. - **S3 — scale/resources:** added byte distributions and tier totals, large text/cards/history, depth/empty directories, 10M-note aggregate/1M-active fixture and 1M-HDD aggregate cap. Added cache/buffer/job/FD/watch/kernel-memory and temporary/recovery space budgets. The 2M-watch ceiling explicitly does not promise simultaneous quota readiness for all 10M notes. Metadata discovery, full byte audit and dedupe completion are distinct costs. - **S4 — operation costs/owners:** expanded the cost table to upload/admission, classification, conflict retention, Trash/restore/purge/undo, export/backup/auth, rebuild, dedupe and rollback. Charge serialization/hash/CRDT passes, target rereads/source verification, B-tree factors and link materialization. Slices explicitly replace old ID reload/sibling scan, whole-map move hook, destructive `after_swap`, debounce and broad `syncfs` paths. - **S5 — FO1 deadline:** track oldest uncovered ack/sequence on a monotonic clock; ≤100 ms batching, post-freeze snapshots, causal successor/tombstone coverage, reserved space/I/O and pre-ack backpressure. Every >1 s sample, including a post-ack disk fault, fails; no unconditional physical deadline is claimed. - **S6 — freshness/clocks:** full byte audits detect metadata-identical rewrites after missed events; classify/search freshness remains eventual until audit completion. Fresh quota uses #764 fences, dedupe uses verified bytes/exclusion. Added preserved-mtime/inode-reuse/clock-jump vectors and sequence/random protocol identities. - **S7 — adversarial tests/progress:** first-code-PR harnesses model real shared inodes/mmap/raw names/mounts/ACLs/sparse sizes, short/partial writes, failed fsync and independent disk persistence. Every slice activates its actual hooks. Added repeated byte-exact bootstrap, cancellation/duplicate publication, in-flight revocation, cross-user schedules, temporary/recovery ENOSPC versus inode exhaustion, and successful-completion/pending/resource metrics so all-pending cannot pass under supported availability/exclusion assumptions. 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 --check` against 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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#731
No description provided.