fix: Journal creates a fresh daily note while the old note stays in Trash #981

Closed
kayg wants to merge 0 commits from fix/journal-trash-fresh into dev
Owner

Journal restored today's note from Trash, including its old content. It now opens a fresh empty daily note and leaves the retained file, Trash metadata and history untouched. Explicit restore keeps both notes at separate real file paths.

Identity and lookup

ADRs 0023 and 0067 preserve the retained note's stable id and history. The replacement gets a deterministic user-scoped successor of the reserved id using the existing idempotent-id helper. Concurrent opens choose the same successor. Repeated deletion advances the chain; permanent-removal tombstones and restored copies at numbered paths also reserve their identities. No retained file is re-keyed.

Daily lookup uses the live date path. The old canonical-id fallback and implicit restore_day path are removed. Explicit restore uses the existing exclusive placement and numbered-name rules, consistent with ADRs 0043 and 0045: for example, 2026-11-06.md and 2026-11-06 2.md. Empty notes retain ADR 0021 behavior: their file is written on the first edit.

Journal navigation resolves the day again through the parent callback, so it cannot reuse a stale trashed id and still closes the places drawer and clears selection.

Bounds and failure handling

Existing date-file opens keep their indexed lookup. Empty daily allocation validates the fixed date filename and probes its four possible extension spellings (md, mD, Md, MD), avoiding a scan of Home. The existing guarded first-save path preserves outside writes that appear after placeholder allocation.

Identity selection uses O(D) indexed/history checks for D reserved incarnations of this day, O(1) memory and bounded UUID ids. Allocation after selection is O(1) in Home size. The focused allocator module is 213 lines including tests and documentation.

failure effect detection recovery test
today is trashed old content stays separate reserved identity choose successor notes, daily and browser regressions
restore destination occupied neither side is overwritten exclusive placement numbered destination notes and browser tests inspect both files
identity permanently removed old id cannot be reused history tombstone next successor repeated deletion and restart
concurrent opens one daily incarnation deterministic id and lifecycle lock reuse room eight concurrent opens
outside date file occupies destination outside bytes stay intact four exact probes plus index conflict, then watcher reconciliation all four extension variants

Validation

Failing-first notes, daily, browser and drawer regressions are recorded in the comments. At head e3b923e76583839e83e62323a9c0c99c323303d2, the last commit adds only component documentation; its Svelte check passes and its bundle bytes exactly match the tested UI code.

gate result
cargo fmt --all --check pass
cargo clippy -j4 --workspace --all-targets --locked -- -D warnings pass
cargo test -j4 --workspace --locked --no-fail-fast 1,589 passed, 0 failed, 22 default ignored
notes daily_identity / daily crate 3 / 24 passed
bun run test 109 passed
bun run check 0 errors, 16 existing warnings
Chromium/dev-01, Journal and Trash specs, 390 and 1440 10 passed, 2 expected skips
WebKit/dev-02, same matrix 10 passed, 2 expected skips
bash perf/web.sh --bundle-only --gate vs pinned dev first JS brotli 230804 → 230723 B, CSS 18383 → 18383 B; served total -81 B
daily-open perf, both locks, control + ABAB creation paths improve; existing opens flat within measured dev-only variation, all positive deltas disclosed
orchestrator screenshot/code review pending
Mac-only checks pending, VM paused

Raw JS changes by +51 B and gzip JS by +29 B; served brotli first-paint bytes decrease. Rust source is unchanged since the full green workspace run at 2eb3df3dcb57b4c50265877fa8041c5eae9e7ded. The final measurement binary is SHA-256 d48d4ef20712cb37e9527a704544b1c99806b0c330924c1a9ef5ed07e2010501; pinned dev is 7a9bd54eb8f385364c712198af45b31d706493fd.

Evidence: Rust and Chromium logs, web units, Svelte, WebKit, failing drawer and bundle reports, qualified perf harness and every raw sample. Exact browser commands and all perf deltas are in the comments. Final interleaved-control qualification records existing-open p50/p95/p99 deltas of +0.79%/+0.94%/+4.63%, within dev-only spreads of 1.09%/2.35%/24.88%; VM tails remain noisy. Both perf locks are stopped and fixture/build outputs cleaned. All heavy commands run through VM slots. No production data or services accessed. Do not merge.

Journal restored today's note from Trash, including its old content. It now opens a fresh empty daily note and leaves the retained file, Trash metadata and history untouched. Explicit restore keeps both notes at separate real file paths. ### Identity and lookup ADRs 0023 and 0067 preserve the retained note's stable id and history. The replacement gets a deterministic user-scoped successor of the reserved id using the existing idempotent-id helper. Concurrent opens choose the same successor. Repeated deletion advances the chain; permanent-removal tombstones and restored copies at numbered paths also reserve their identities. No retained file is re-keyed. Daily lookup uses the live date path. The old canonical-id fallback and implicit `restore_day` path are removed. Explicit restore uses the existing exclusive placement and numbered-name rules, consistent with ADRs 0043 and 0045: for example, `2026-11-06.md` and `2026-11-06 2.md`. Empty notes retain ADR 0021 behavior: their file is written on the first edit. Journal navigation resolves the day again through the parent callback, so it cannot reuse a stale trashed id and still closes the places drawer and clears selection. ### Bounds and failure handling Existing date-file opens keep their indexed lookup. Empty daily allocation validates the fixed date filename and probes its four possible extension spellings (`md`, `mD`, `Md`, `MD`), avoiding a scan of Home. The existing guarded first-save path preserves outside writes that appear after placeholder allocation. Identity selection uses O(D) indexed/history checks for D reserved incarnations of this day, O(1) memory and bounded UUID ids. Allocation after selection is O(1) in Home size. The focused allocator module is 213 lines including tests and documentation. | failure | effect | detection | recovery | test | |---|---|---|---|---| | today is trashed | old content stays separate | reserved identity | choose successor | notes, daily and browser regressions | | restore destination occupied | neither side is overwritten | exclusive placement | numbered destination | notes and browser tests inspect both files | | identity permanently removed | old id cannot be reused | history tombstone | next successor | repeated deletion and restart | | concurrent opens | one daily incarnation | deterministic id and lifecycle lock | reuse room | eight concurrent opens | | outside date file occupies destination | outside bytes stay intact | four exact probes plus index | conflict, then watcher reconciliation | all four extension variants | ### Validation Failing-first notes, daily, browser and drawer regressions are recorded in the comments. At head `e3b923e76583839e83e62323a9c0c99c323303d2`, the last commit adds only component documentation; its Svelte check passes and its bundle bytes exactly match the tested UI code. | gate | result | |---|---| | `cargo fmt --all --check` | pass | | `cargo clippy -j4 --workspace --all-targets --locked -- -D warnings` | pass | | `cargo test -j4 --workspace --locked --no-fail-fast` | 1,589 passed, 0 failed, 22 default ignored | | notes `daily_identity` / daily crate | 3 / 24 passed | | `bun run test` | 109 passed | | `bun run check` | 0 errors, 16 existing warnings | | Chromium/dev-01, Journal and Trash specs, 390 and 1440 | 10 passed, 2 expected skips | | WebKit/dev-02, same matrix | 10 passed, 2 expected skips | | `bash perf/web.sh --bundle-only --gate` vs pinned dev | first JS brotli 230804 → 230723 B, CSS 18383 → 18383 B; served total -81 B | | daily-open perf, both locks, control + ABAB | creation paths improve; existing opens flat within measured dev-only variation, all positive deltas disclosed | | orchestrator screenshot/code review | pending | | Mac-only checks | pending, VM paused | Raw JS changes by +51 B and gzip JS by +29 B; served brotli first-paint bytes decrease. Rust source is unchanged since the full green workspace run at `2eb3df3dcb57b4c50265877fa8041c5eae9e7ded`. The final measurement binary is SHA-256 `d48d4ef20712cb37e9527a704544b1c99806b0c330924c1a9ef5ed07e2010501`; pinned dev is `7a9bd54eb8f385364c712198af45b31d706493fd`. Evidence: [Rust and Chromium logs](https://git.kayg.org/attachments/fc53b77d-d48d-4650-8ed7-c3b012521950), [web units, Svelte, WebKit, failing drawer and bundle reports](https://git.kayg.org/attachments/bca7b738-c485-4ef9-bd98-99bced380164), [qualified perf harness and every raw sample](https://git.kayg.org/attachments/3e561c5a-be33-4664-8b7f-060d4be4f1b8). Exact browser commands and all perf deltas are in the comments. Final [interleaved-control qualification](https://git.kayg.org/kayg/calternal/pulls/981#issuecomment-81924) records existing-open p50/p95/p99 deltas of +0.79%/+0.94%/+4.63%, within dev-only spreads of 1.09%/2.35%/24.88%; VM tails remain noisy. Both perf locks are stopped and fixture/build outputs cleaned. All heavy commands run through VM slots. No production data or services accessed. Do not merge.
test: reserve daily identities through repeated deletion and expiry
Some checks failed
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled
33098f0ad5
Author
Owner

Regression evidence and current gates (candidate c35a1d9dc, pinned dev 7a9bd54eb):

  • RED: dev-01 cargo test -j4 -p calternal-notes daily_identity -- --nocapture failed at assert_ne!(fresh, old) with the unchanged canonical selector. cargo test -j4 -p calternal-daily a_day_whose_note_is_in_the_trash -- --nocapture failed returning created:false, old canonical id and old content.
  • RED: dev-02 CI=1 CALTERNAL_BIN=... bunx playwright test e2e/journal-trash.spec.ts --project=webkit-390 --workers=1 --retries=0 failed at expect(fresh).not.toBe(old) before the fix. The repeated flow then caught a second issue: the canonical id restored at a numbered filename was being selected as today's note. Date lookup now uses the date path, and numbered restores reserve their own identities.
  • GREEN: dev-02 playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=webkit-390 --project=webkit-1440 --workers=1 --retries=0: 9 passed, 1 existing desktop-only spec skipped on phone. New Journal cases run at both widths, in the same session and after reload, with both real restored files checked.
  • GREEN: bun run test in apps/web: 109 passed. bun run check and direct bunx svelte-check --tsconfig ./tsconfig.json: 0 errors, 16 existing warnings in 10 files.
  • First paint: PERF_WORK=... PERF_OUT=... bash perf/web.sh --bundle-only --gate on both pinned dev and candidate, same dev-02 Nix shell: first JS brotli 230804 -> 230779 B (-25 B), CSS brotli 18383 -> 18383 B (unchanged). Raw JS +3 B, gzip JS +5 B. The served brotli first-paint total decreases by 25 B; budget gates pass.

All heavy commands through ~/bin/slot. Chromium, final Rust head and perf qualification remain in progress. Browser plugin is unavailable; the task explicitly requires VM Playwright. No production data or services accessed.

Regression evidence and current gates (candidate c35a1d9dc, pinned dev 7a9bd54eb): - RED: dev-01 `cargo test -j4 -p calternal-notes daily_identity -- --nocapture` failed at `assert_ne!(fresh, old)` with the unchanged canonical selector. `cargo test -j4 -p calternal-daily a_day_whose_note_is_in_the_trash -- --nocapture` failed returning `created:false`, old canonical id and old content. - RED: dev-02 `CI=1 CALTERNAL_BIN=... bunx playwright test e2e/journal-trash.spec.ts --project=webkit-390 --workers=1 --retries=0` failed at `expect(fresh).not.toBe(old)` before the fix. The repeated flow then caught a second issue: the canonical id restored at a numbered filename was being selected as today's note. Date lookup now uses the date path, and numbered restores reserve their own identities. - GREEN: dev-02 `playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=webkit-390 --project=webkit-1440 --workers=1 --retries=0`: 9 passed, 1 existing desktop-only spec skipped on phone. New Journal cases run at both widths, in the same session and after reload, with both real restored files checked. - GREEN: `bun run test` in apps/web: 109 passed. `bun run check` and direct `bunx svelte-check --tsconfig ./tsconfig.json`: 0 errors, 16 existing warnings in 10 files. - First paint: `PERF_WORK=... PERF_OUT=... bash perf/web.sh --bundle-only --gate` on both pinned dev and candidate, same dev-02 Nix shell: first JS brotli 230804 -> 230779 B (-25 B), CSS brotli 18383 -> 18383 B (unchanged). Raw JS +3 B, gzip JS +5 B. The served brotli first-paint total decreases by 25 B; budget gates pass. All heavy commands through ~/bin/slot. Chromium, final Rust head and perf qualification remain in progress. Browser plugin is unavailable; the task explicitly requires VM Playwright. No production data or services accessed.
Author
Owner

The perf gate rejected the initial candidate c35a1d9dc. Under both VM locks, perf-01, 100k fixture notes, dev/dev control followed by ABABABAB, existing opens were around 0.55–0.56 ms and new empty notes around 46 ms for both binaries, but after-Trash opens were ~48 ms on candidate versus ~7.5 ms on dev. General create was walking the Home for name allocation. This is not accepted as a passing result.

Added a failing-first notes test for the fixed date destination: unindexed .md, .mD, .Md, .MD files must remain untouched and return a conflict, instead of silently making a numbered daily note. The adapter using general create failed; the bounded allocator passes all four variants. cargo test -j4 -p calternal-notes daily_identity: 3 passed; cargo test -j4 -p calternal-daily: 24 passed; WebKit targeted matrix: 9 passed, 1 existing desktop-only skip. All through the build slot on dev-02. Candidate 2eb3df3dc is rebuilding for fresh control + ABAB qualification.

The earlier workspace run hit /tmp inode exhaustion in signin_finishes_before_a_large_recount, independent_login_completes_before_recount and directory_move_during_initial_recount_must_track_later_deletes. The root filesystem had ample space; /tmp was 99% full by inode count. Re-running with a job-owned TMPDIR on root; no unrelated files or jobs were touched.

The perf gate rejected the initial candidate c35a1d9dc. Under both VM locks, perf-01, 100k fixture notes, dev/dev control followed by ABABABAB, existing opens were around 0.55–0.56 ms and new empty notes around 46 ms for both binaries, but after-Trash opens were ~48 ms on candidate versus ~7.5 ms on dev. General create was walking the Home for name allocation. This is not accepted as a passing result. Added a failing-first notes test for the fixed date destination: unindexed `.md`, `.mD`, `.Md`, `.MD` files must remain untouched and return a conflict, instead of silently making a numbered daily note. The adapter using general create failed; the bounded allocator passes all four variants. `cargo test -j4 -p calternal-notes daily_identity`: 3 passed; `cargo test -j4 -p calternal-daily`: 24 passed; WebKit targeted matrix: 9 passed, 1 existing desktop-only skip. All through the build slot on dev-02. Candidate 2eb3df3dc is rebuilding for fresh control + ABAB qualification. The earlier workspace run hit `/tmp` inode exhaustion in `signin_finishes_before_a_large_recount`, `independent_login_completes_before_recount` and `directory_move_during_initial_recount_must_track_later_deletes`. The root filesystem had ample space; `/tmp` was 99% full by inode count. Re-running with a job-owned TMPDIR on root; no unrelated files or jobs were touched.
Author
Owner

Final functional/Rust gates for head 2eb3df3dcb:

gate exact command (inside VM Nix shell, through ~/bin/slot) result
format, dev-01 cargo fmt --all --check pass
clippy, dev-01 cargo clippy -j4 --workspace --all-targets --locked -- -D warnings pass
full workspace, dev-01 cargo test -j4 --workspace --locked --no-fail-fast 1,589 passed, 0 failed, 22 default ignored, 127 result summaries including doctests
Chromium, dev-01 CI=1 CALTERNAL_BIN=.../target/release/calternal bunx playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=chromium-390 --project=chromium-1440 --workers=1 --retries=0 9 passed, 1 existing desktop-only skip
WebKit, dev-02 CI=1 CALTERNAL_BIN=.../target/debug/calternal bunx playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=webkit-390 --project=webkit-1440 --workers=1 --retries=0 9 passed, 1 existing desktop-only skip
focused notes, dev-02 cargo test -j4 -p calternal-notes daily_identity -- --nocapture 3 passed
daily, dev-02 cargo test -j4 -p calternal-daily 24 passed
web units bun run test in apps/web 109 passed
generated actions + Svelte bun run check in apps/web pass, 0 errors, 16 existing warnings
direct Svelte bunx svelte-check --tsconfig ./tsconfig.json 0 errors, 16 existing warnings
first-paint bytes, same UI tree as final head PERF_WORK=... PERF_OUT=... bash perf/web.sh --bundle-only --gate on pinned dev and candidate brotli JS 230804 -> 230779 B, CSS 18383 -> 18383 B; raw JS +3 B, gzip JS +5 B; served total -25 B

The final workspace run used a job-owned /dev/shm/journal-trash-981 TMPDIR (47 GB and >12 million free inodes). The earlier /tmp inode failures are not present. Full output has no failed test results or cargo errors.

Final release binary SHA-256: d48d4ef20712cb37e9527a704544b1c99806b0c330924c1a9ef5ed07e2010501, verified on dev-01, control-host relay and perf-01. Perf is the only outstanding requested gate. The first final-control launch was stopped because the asynchronous lock wait had not yet acquired both locks; its sample is discarded. No result from that launch will be used. Waiting for perf-01 first, then perf-02, before starting a fresh dev/dev control and ABAB session. The earlier rejected candidate results remain recorded above. Mac-only gates remain pending: Mac VM paused.

Final functional/Rust gates for head **2eb3df3dcb57b4c50265877fa8041c5eae9e7ded**: | gate | exact command (inside VM Nix shell, through ~/bin/slot) | result | | --- | --- | --- | | format, dev-01 | `cargo fmt --all --check` | pass | | clippy, dev-01 | `cargo clippy -j4 --workspace --all-targets --locked -- -D warnings` | pass | | full workspace, dev-01 | `cargo test -j4 --workspace --locked --no-fail-fast` | 1,589 passed, 0 failed, 22 default ignored, 127 result summaries including doctests | | Chromium, dev-01 | `CI=1 CALTERNAL_BIN=.../target/release/calternal bunx playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=chromium-390 --project=chromium-1440 --workers=1 --retries=0` | 9 passed, 1 existing desktop-only skip | | WebKit, dev-02 | `CI=1 CALTERNAL_BIN=.../target/debug/calternal bunx playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=webkit-390 --project=webkit-1440 --workers=1 --retries=0` | 9 passed, 1 existing desktop-only skip | | focused notes, dev-02 | `cargo test -j4 -p calternal-notes daily_identity -- --nocapture` | 3 passed | | daily, dev-02 | `cargo test -j4 -p calternal-daily` | 24 passed | | web units | `bun run test` in apps/web | 109 passed | | generated actions + Svelte | `bun run check` in apps/web | pass, 0 errors, 16 existing warnings | | direct Svelte | `bunx svelte-check --tsconfig ./tsconfig.json` | 0 errors, 16 existing warnings | | first-paint bytes, same UI tree as final head | `PERF_WORK=... PERF_OUT=... bash perf/web.sh --bundle-only --gate` on pinned dev and candidate | brotli JS 230804 -> 230779 B, CSS 18383 -> 18383 B; raw JS +3 B, gzip JS +5 B; served total -25 B | The final workspace run used a job-owned `/dev/shm/journal-trash-981` TMPDIR (47 GB and >12 million free inodes). The earlier `/tmp` inode failures are not present. Full output has no failed test results or cargo errors. Final release binary SHA-256: `d48d4ef20712cb37e9527a704544b1c99806b0c330924c1a9ef5ed07e2010501`, verified on dev-01, control-host relay and perf-01. Perf is the only outstanding requested gate. The first final-control launch was stopped because the asynchronous lock wait had not yet acquired both locks; its sample is discarded. No result from that launch will be used. Waiting for perf-01 first, then perf-02, before starting a fresh dev/dev control and ABAB session. The earlier rejected candidate results remain recorded above. Mac-only gates remain pending: Mac VM paused.
Author
Owner

Final UI follow-up at 8db59991f5: Journal now sends its day target through the parent callback, preserving drawer closure and selection cleanup. A new WebKit tablet regression first failed with the drawer still present; it now passes. No Rust changes since the recorded green workspace gates/binary.

bun run test: 109 passed. bun run check: 0 errors, 16 existing warnings. WebKit/dev-02: CI=1 CALTERNAL_BIN=../../target/debug/calternal bunx playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=webkit-390 --project=webkit-1440 --workers=1 --retries=0: 10 passed, 2 skipped (existing desktop-only Trash case and tablet-only drawer case on phone).

Final first-paint comparison, PERF_WORK=... PERF_OUT=... bash perf/web.sh --bundle-only --gate, same dev-02 Nix environment: JS brotli 230804 -> 230723 B (-81 B); CSS brotli 18383 -> 18383 B. Raw JS 812602 -> 812653 (+51 B), gzip 271280 -> 271309 (+29 B). Served brotli first-paint bytes decrease. Perf locks remain queued behind another run; no measurements are running without both locks. Chromium rerun uses a job-owned tmpfs TMPDIR because the shared /tmp has exhausted its inodes.

Final UI follow-up at 8db59991f57965336f4c94f46579ecf946571373: Journal now sends its day target through the parent callback, preserving drawer closure and selection cleanup. A new WebKit tablet regression first failed with the drawer still present; it now passes. No Rust changes since the recorded green workspace gates/binary. `bun run test`: 109 passed. `bun run check`: 0 errors, 16 existing warnings. WebKit/dev-02: `CI=1 CALTERNAL_BIN=../../target/debug/calternal bunx playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=webkit-390 --project=webkit-1440 --workers=1 --retries=0`: 10 passed, 2 skipped (existing desktop-only Trash case and tablet-only drawer case on phone). Final first-paint comparison, `PERF_WORK=... PERF_OUT=... bash perf/web.sh --bundle-only --gate`, same dev-02 Nix environment: JS brotli 230804 -> 230723 B (-81 B); CSS brotli 18383 -> 18383 B. Raw JS 812602 -> 812653 (+51 B), gzip 271280 -> 271309 (+29 B). Served brotli first-paint bytes decrease. Perf locks remain queued behind another run; no measurements are running without both locks. Chromium rerun uses a job-owned tmpfs TMPDIR because the shared /tmp has exhausted its inodes.
Author
Owner

Chromium/dev-01 is green at 8db59991f5: CI=1 CALTERNAL_BIN=$HOME/Developer/Worktrees/journal-trash-base/target/release/calternal bunx playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=chromium-390 --project=chromium-1440 --workers=1 --retries=0: 10 passed, 2 expected skips, matching WebKit. This run used TMPDIR=/dev/shm/journal-trash-981, including Nix evaluation, avoiding the shared /tmp inode exhaustion. All heavy commands used ~/bin/slot. Perf is queued; orchestrator screenshot review remains for the parent, Mac-only gates pending while the VM is paused.

Chromium/dev-01 is green at 8db59991f57965336f4c94f46579ecf946571373: `CI=1 CALTERNAL_BIN=$HOME/Developer/Worktrees/journal-trash-base/target/release/calternal bunx playwright test e2e/journal-trash.spec.ts e2e/trash.spec.ts --project=chromium-390 --project=chromium-1440 --workers=1 --retries=0`: 10 passed, 2 expected skips, matching WebKit. This run used `TMPDIR=/dev/shm/journal-trash-981`, including Nix evaluation, avoiding the shared /tmp inode exhaustion. All heavy commands used ~/bin/slot. Perf is queued; orchestrator screenshot review remains for the parent, Mac-only gates pending while the VM is paused.
Author
Owner

Qualified perf session 1, 6 November 12:51:58–12:53:43 IST (after the 09:12 pinning), 100k fixture-only Home on perf-01. Both shared-disk locks confirmed acquired before launch: perf-01 at 12:50:44 IST, then perf-02 at 12:51:40 IST. Both released immediately after completion. CPU affinity [0,1,2,3] recorded for every server session.

Command: PERF_START_SERIAL=20 ~/bin/slot python3 -u ~/perf/journal-trash-981/bench.py ~/perf/journal-trash-981 C1 C2 C1 C2 A B A B A B A B. Each letter restarts the server; C1/C2/A use pinned dev 7a9bd54eb8, B uses final Rust binary d48d4ef20712cb37e9527a704544b1c99806b0c330924c1a9ef5ed07e2010501. 1,000 existing, 80 new-empty, 40 after-Trash samples per session; 50 existing warmups; nearest-rank p95/p99. Values below are medians of session percentiles, in ms. Harness, every raw sample, CPU counters and session output.

path percentile dev candidate delta dev/dev control delta
existing p50 .568360 .566815 -0.27% -10.83%
existing p95 .679343 .709514 +4.44% -17.24%
existing p99 2.066763 2.350319 +13.72% -16.66%
new empty p50 46.098736 5.310478 -88.48% +0.68%
new empty p95 50.576755 6.871316 -86.41% +0.22%
new empty p99 55.795393 20.153123 -63.88% +8.86%
after Trash p50 7.874766 7.376131 -6.33% -2.70%
after Trash p95 11.578471 10.693823 -7.64% +48.91%
after Trash p99 64.810630 22.687396 -64.99% +0.15%

The existing-open p95/p99 increases are within the dev/dev variation, but are unresolved rather than called a pass. A longer follow-up is queued: 1,000 warmups and 20,000 existing samples per fresh session, same control+ABAB plan and both locks. Creation paths improved at all recorded percentiles. No production data accessed. The prematurely launched run-12 and partial run-13 remain discarded and are not in this qualified artifact.

Qualified perf session 1, 6 November 12:51:58–12:53:43 IST (after the 09:12 pinning), 100k fixture-only Home on perf-01. Both shared-disk locks confirmed acquired before launch: perf-01 at 12:50:44 IST, then perf-02 at 12:51:40 IST. Both released immediately after completion. CPU affinity [0,1,2,3] recorded for every server session. Command: `PERF_START_SERIAL=20 ~/bin/slot python3 -u ~/perf/journal-trash-981/bench.py ~/perf/journal-trash-981 C1 C2 C1 C2 A B A B A B A B`. Each letter restarts the server; C1/C2/A use pinned dev 7a9bd54eb8f385364c712198af45b31d706493fd, B uses final Rust binary d48d4ef20712cb37e9527a704544b1c99806b0c330924c1a9ef5ed07e2010501. 1,000 existing, 80 new-empty, 40 after-Trash samples per session; 50 existing warmups; nearest-rank p95/p99. Values below are medians of session percentiles, in ms. [Harness, every raw sample, CPU counters and session output](https://git.kayg.org/attachments/3e561c5a-be33-4664-8b7f-060d4be4f1b8). | path | percentile | dev | candidate | delta | dev/dev control delta | |---|---|---:|---:|---:|---:| | existing | p50 | .568360 | .566815 | -0.27% | -10.83% | | existing | p95 | .679343 | .709514 | +4.44% | -17.24% | | existing | p99 | 2.066763 | 2.350319 | +13.72% | -16.66% | | new empty | p50 | 46.098736 | 5.310478 | -88.48% | +0.68% | | new empty | p95 | 50.576755 | 6.871316 | -86.41% | +0.22% | | new empty | p99 | 55.795393 | 20.153123 | -63.88% | +8.86% | | after Trash | p50 | 7.874766 | 7.376131 | -6.33% | -2.70% | | after Trash | p95 | 11.578471 | 10.693823 | -7.64% | +48.91% | | after Trash | p99 | 64.810630 | 22.687396 | -64.99% | +0.15% | The existing-open p95/p99 increases are within the dev/dev variation, but are unresolved rather than called a pass. A longer follow-up is queued: 1,000 warmups and 20,000 existing samples per fresh session, same control+ABAB plan and both locks. Creation paths improved at all recorded percentiles. No production data accessed. The prematurely launched run-12 and partial run-13 remain discarded and are not in this qualified artifact.
Author
Owner

Longer qualification (same held locks), 13:43–13:48 IST: 1,000 warmups, 20,000 existing opens per session, 12 fresh sessions C1 C2 C1 C2 A B A B A B A B. Harness and every raw sample.

path percentile dev ms candidate ms delta dev/dev delta
existing p50 .568483 .572388 +0.69% +0.47%
existing p95 .696646 .696661 +0.002% +0.94%
existing p99 3.083267 3.452920 +11.99% -0.50%
new empty p50 48.110177 6.826559 -85.81% -0.15%
new empty p95 54.173066 10.185706 -81.20% +3.00%
new empty p99 67.332679 33.408469 -50.38% +11.27%
after Trash p50 10.552528 9.904296 -6.14% -0.20%
after Trash p95 19.640892 13.778664 -29.85% +5.20%
after Trash p99 63.909285 21.279292 -66.70% -7.89%

The p95 increase from the short run disappears, but existing-open p99 is still unresolved. Individual dev A-session p99s are 2.773, 3.393, 3.482 and 1.958 ms. No passing perf claim is made yet. The existing date-file return path is unchanged in source. Checking scheduler effects with an existing-only run: 50k samples/session, separate client CPU 0 and server CPUs 1–3, per-core CPU counters, and controls before, between and after A/B pairs. Both shared-disk locks remain held for this active investigation; they will be released at completion. No code changed between these sessions.

Longer qualification (same held locks), 13:43–13:48 IST: 1,000 warmups, 20,000 existing opens per session, 12 fresh sessions C1 C2 C1 C2 A B A B A B A B. [Harness and every raw sample](https://git.kayg.org/attachments/6c0c3a16-429f-4496-ae00-25d66b38d44a). | path | percentile | dev ms | candidate ms | delta | dev/dev delta | |---|---|---:|---:|---:|---:| | existing | p50 | .568483 | .572388 | +0.69% | +0.47% | | existing | p95 | .696646 | .696661 | +0.002% | +0.94% | | existing | p99 | 3.083267 | 3.452920 | +11.99% | -0.50% | | new empty | p50 | 48.110177 | 6.826559 | -85.81% | -0.15% | | new empty | p95 | 54.173066 | 10.185706 | -81.20% | +3.00% | | new empty | p99 | 67.332679 | 33.408469 | -50.38% | +11.27% | | after Trash | p50 | 10.552528 | 9.904296 | -6.14% | -0.20% | | after Trash | p95 | 19.640892 | 13.778664 | -29.85% | +5.20% | | after Trash | p99 | 63.909285 | 21.279292 | -66.70% | -7.89% | The p95 increase from the short run disappears, but existing-open p99 is still unresolved. Individual dev A-session p99s are 2.773, 3.393, 3.482 and 1.958 ms. No passing perf claim is made yet. The existing date-file return path is unchanged in source. Checking scheduler effects with an existing-only run: 50k samples/session, separate client CPU 0 and server CPUs 1–3, per-core CPU counters, and controls before, between and after A/B pairs. Both shared-disk locks remain held for this active investigation; they will be released at completion. No code changed between these sessions.
Author
Owner

Final qualification, head e3b923e765. No code or binary changes between the three qualified sessions.

Existing-open-only follow-up: 6 November 13:50:36–13:59:33 IST, after the 09:12 pinning. Both shared-disk locks held throughout: perf-01 acquired first at 13:42:31 IST, perf-02 at 13:43:11 IST. Client CPU [0], server [1,2,3], 100k fixture notes, 1,000 warmups, 50,000 timed opens per fresh session. Controls before, between and after A/B pairs.

Exact command: PERF_START_SERIAL=60 ~/bin/slot python3 -u ~/perf/journal-trash-981/bench-isolated.py ~/perf/journal-trash-981 C1 C2 A B A B C1 C2 A B A B C1 C2.

Harness, all 700,000 raw samples, per-core CPU counters, affinities and output.

existing open dev ms candidate ms delta dev/dev median delta full dev-only control range ms
p50 .5479765 .5523023 +0.79% +0.05% .5468695–.5528460
p95 .6847180 .6911300 +0.94% -0.36% .6814570–.6974660
p99 3.3131230 3.4665060 +4.63% -14.81% 2.8034030–3.5009300

Qualification: existing opens are flat within measured dev-only variation (control max/min spreads 1.09%, 2.35%, 24.88%). This uses the control, not a latency budget, to assess the positive deltas. Unchanged dev moved from 2.80 ms p99 initially to 3.49/3.50 ms in the middle; the final dev-only pair changed from 3.479 to 2.964 ms. The earlier p99 increase therefore cannot be treated as an established code regression. VM tail latency remains a material measurement limitation; every positive delta stays visible for review.

Creation paths improved in both all-path sessions. In the longer session, new-empty p50/p95/p99 improved 85.81%/81.20%/50.38%; after-Trash improved 6.14%/29.85%/66.70%. Every delta and earlier unresolved results are recorded above, with raw samples attached. The general-create candidate remains rejected; run-12 and partial run-13 remain discarded.

Final-head Svelte/bundle verification produces exactly the tested bytes: JS brotli 230723 versus dev 230804 B (-81 B), CSS 18383 B unchanged; Svelte 0 errors, 16 existing warnings. Final-head log and JSON. Raw/gzip JS increases remain disclosed in the description.

Both own perf holders are stopped. Fixture data/state, measurement binaries and throwaway VM target directories are removed; small logs/reports remain. No production data or services accessed. PR is open into dev, never merged. Orchestrator screenshot/code review and paused Mac-only checks remain pending.

Final qualification, head e3b923e76583839e83e62323a9c0c99c323303d2. No code or binary changes between the three qualified sessions. Existing-open-only follow-up: 6 November 13:50:36–13:59:33 IST, after the 09:12 pinning. Both shared-disk locks held throughout: perf-01 acquired first at 13:42:31 IST, perf-02 at 13:43:11 IST. Client CPU [0], server [1,2,3], 100k fixture notes, 1,000 warmups, 50,000 timed opens per fresh session. Controls before, between and after A/B pairs. Exact command: `PERF_START_SERIAL=60 ~/bin/slot python3 -u ~/perf/journal-trash-981/bench-isolated.py ~/perf/journal-trash-981 C1 C2 A B A B C1 C2 A B A B C1 C2`. [Harness, all 700,000 raw samples, per-core CPU counters, affinities and output](https://git.kayg.org/attachments/603bcc5e-7810-4f85-a36a-45ebd80f1236). | existing open | dev ms | candidate ms | delta | dev/dev median delta | full dev-only control range ms | |---|---:|---:|---:|---:|---:| | p50 | .5479765 | .5523023 | +0.79% | +0.05% | .5468695–.5528460 | | p95 | .6847180 | .6911300 | +0.94% | -0.36% | .6814570–.6974660 | | p99 | 3.3131230 | 3.4665060 | +4.63% | -14.81% | 2.8034030–3.5009300 | Qualification: existing opens are flat within measured dev-only variation (control max/min spreads 1.09%, 2.35%, 24.88%). This uses the control, not a latency budget, to assess the positive deltas. Unchanged dev moved from 2.80 ms p99 initially to 3.49/3.50 ms in the middle; the final dev-only pair changed from 3.479 to 2.964 ms. The earlier p99 increase therefore cannot be treated as an established code regression. VM tail latency remains a material measurement limitation; every positive delta stays visible for review. Creation paths improved in both all-path sessions. In the longer session, new-empty p50/p95/p99 improved 85.81%/81.20%/50.38%; after-Trash improved 6.14%/29.85%/66.70%. Every delta and earlier unresolved results are recorded above, with raw samples attached. The general-create candidate remains rejected; run-12 and partial run-13 remain discarded. Final-head Svelte/bundle verification produces exactly the tested bytes: JS brotli 230723 versus dev 230804 B (-81 B), CSS 18383 B unchanged; Svelte 0 errors, 16 existing warnings. [Final-head log and JSON](https://git.kayg.org/attachments/bf4f9f3b-d84c-4f3f-b451-285fba2a2e64). Raw/gzip JS increases remain disclosed in the description. Both own perf holders are stopped. Fixture data/state, measurement binaries and throwaway VM target directories are removed; small logs/reports remain. No production data or services accessed. PR is open into dev, never merged. Orchestrator screenshot/code review and paused Mac-only checks remain pending.
Author
Owner

Merged into dev by the orchestrator (U1 GREEN; perf within the dev-only control range).

Merged into dev by the orchestrator (U1 GREEN; perf within the dev-only control range).
kayg closed this pull request 2026-11-06 08:35:46 +00:00
Some checks failed
Markdown extraction contract / markdown-native-contract (pull_request) Has been cancelled
CI / server (pull_request) Has been cancelled
CI / rust (pull_request) Has been cancelled
CI / web (pull_request) Has been cancelled
Markdown extraction contract / markdown-editor-contract (pull_request) Has been cancelled

Pull request closed

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

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!981
No description provided.