P0: Backspace deletes into hidden frontmatter; presets shrink the card on phones #980

Closed
opened 2026-11-06 06:07:04 +00:00 by kayg · 5 comments
Owner

P0, prod ad1b89e2 (kayg, 11-06 ~11:35 IST, phone):

  1. After a Style preset change, pressing Backspace repeatedly at the start of the body reached the hidden frontmatter. The properties (calternal-width, calternal-id, date, last edited, page and background settings) became editable body text, with a --- rule above them. That's data corruption, and it breaks ADR 0025 (properties are never editable in the editor).
  2. Changing presets makes the page card smaller on the phone. The note carries a leftover calternal-width: wide.

A fix lane is on it. The plan:

  • frontmatter becomes an atomic, unreachable range;
  • a save-boundary guard;
  • tests that fail first, in both browsers;
  • recovery steps for the affected note.
**P0, prod `ad1b89e2` (kayg, 11-06 ~11:35 IST, phone):** 1. After a Style preset change, pressing Backspace repeatedly at the start of the body reached the hidden frontmatter. The properties (`calternal-width`, `calternal-id`, `date`, `last edited`, page and background settings) became editable body text, with a `---` rule above them. That's data corruption, and it breaks ADR 0025 (properties are never editable in the editor). 2. Changing presets makes the page card smaller on the phone. The note carries a leftover `calternal-width: wide`. A fix lane is on it. The plan: - frontmatter becomes an atomic, unreachable range; - a save-boundary guard; - tests that fail first, in both browsers; - recovery steps for the affected note.
Author
Owner

Hotfix gate run: release/2026-11-06-hotfix @ 3915d151 vs prod ad1b89e2: RED

Hosts: dev-01 (Chromium, x86_64), dev-02 (WebKit, aarch64). CI=1 ~/bin/slot … --workers=1 --retries=0, first run counts. Debug calternal and web build both exit 0 on both hosts.

gate result
Playwright chromium-1440 (frontmatter-unreachable, style-card-box, style-sheet, style-presets, bar-taps, note-bars{,-fit,-motion}, editor, tags, tag-picker, tag-rename, cover, a11y-high, signout) 80 passed, 27 skipped, 0 failed
Playwright chromium-390 (same specs) 87 passed, 0 failed
Playwright webkit-1440 (same specs) 76 passed, 31 skipped, 0 failed
Playwright webkit-390 (same specs) 81 passed, 1 failed: a11y-high "Style: labelled, focus in and kept, Esc returns it to the opener" (see note 2)
frontmatter-unreachable --repeat-each=10 chromium-1440 110/110, chromium-390 110/110, webkit-1440 100/100, webkit-390 100/100
cargo fmt --check pass
cargo clippy -p calternal-notes -- -D warnings fails with E0425 (rt-multi-thread cfg), identical on prod ad1b89e2, not from the hotfix (note 3)
cargo test -p calternal-notes 561 passed, 1 FAILED (note 1)
web unit tests (vitest) 107/107 passed
bun run check 0 errors, 16 warnings
editor unit tests not run separately: no test script in packages/editor was found by me; frontmatter-unreachable.test.ts is in that package. Unverified, see note 4
perf/web.sh --bundle-only --gate ok. first JS brotli 233.040 KB vs 232.808 KB on prod (+0.232 KB), budget 240. CSS 18.4 unchanged, plugins JS 37.860 vs 37.961 (−0.101), total JS 363.918 vs 363.967 (−0.049)
typing latency ABAB ×4 (release binaries, dev-01) inconclusive, see note 5

Notes

  1. Real regression (blocks). room::save::tests::review::review_fuzz_old_new_bytes_history_versions_and_restarts passes on prod ad1b89e2 and fails on the hotfix, same place on 3 runs (2 reruns + the full run): seed 21 step 76: text, after an outside-disk write of ---\ntitle: 'outside 75'\n---\n# disk 75…. The note text is "---\n…last edited: …\n---\n" and the expected value is "---\n…\n---" (differs by one trailing \n). Looks like the new guard_properties repair (put back the closing line break, crates/notes/src/room/save.rs) adds a \n the fuzz oracle (file bytes vs CRDT text) doesn't expect for a note whose entire text is the properties block. Either the guard should not "repair" a block that ends the document, or the oracle needs the same rule. I did not change code.
  2. webkit-390 a11y-high Style flake: reproduces at --repeat-each=10 on the hotfix (2 failed of 10) and on prod ad1b89e2 (4 of 10, 4 of 10) on dev-02, so it is not caused by the hotfix. It is the same "Style dialog not visible" miss #973 saw; #971 had it passing 50/50 on a quieter dev-02. It needs its own stability issue; I did not open one.
  3. clippy E0425 is a pre-existing feature-gating error when calternal-notes is built alone (-p calternal-notes does not enable tokio/rt-multi-thread). The gate can't pass as specified on prod either; the gate command needs a fix (or --workspace).
  4. I ran vitest in apps/web only. The editor package's test (packages/editor/test/frontmatter-unreachable.test.ts) still needs a run by someone who knows its runner.
  5. Typing latency: dev-01 was shared with other agents' jobs (cargo test --workspace, release builds) during the ABAB. Numbers are far outside the 50 ms gate for both builds (both fail p95<50 on every run), so it can't prove flat. Default-mode p50/p95 ms, prod vs hotfix: run1 125.6/512.3 vs 142.8/818.6; run2 126.0/394.2 vs 148.6/949.1; run3 129.8/449.9 vs 91.7/321.2; run4 148.2/414.3 vs 152.2/703.4. Hotfix p95 is higher in 3 of 4 pairs, but the noise is larger than the effect. Needs a quiet rerun on a perf VM; the perf-lock VMs build binaries on dev-01, which I didn't do.

RED: the hotfix breaks a prod-passing calternal-notes test (note 1).

## Hotfix gate run: `release/2026-11-06-hotfix` @ `3915d151` vs prod `ad1b89e2`: **RED** Hosts: dev-01 (Chromium, x86_64), dev-02 (WebKit, aarch64). `CI=1 ~/bin/slot … --workers=1 --retries=0`, first run counts. Debug `calternal` and web build both exit 0 on both hosts. | gate | result | |---|---| | Playwright chromium-1440 (frontmatter-unreachable, style-card-box, style-sheet, style-presets, bar-taps, note-bars{,-fit,-motion}, editor, tags, tag-picker, tag-rename, cover, a11y-high, signout) | 80 passed, 27 skipped, 0 failed | | Playwright chromium-390 (same specs) | 87 passed, 0 failed | | Playwright webkit-1440 (same specs) | 76 passed, 31 skipped, 0 failed | | Playwright webkit-390 (same specs) | 81 passed, **1 failed**: `a11y-high` "Style: labelled, focus in and kept, Esc returns it to the opener" (see note 2) | | `frontmatter-unreachable --repeat-each=10` | chromium-1440 110/110, chromium-390 110/110, webkit-1440 100/100, webkit-390 100/100 | | `cargo fmt --check` | pass | | `cargo clippy -p calternal-notes -- -D warnings` | **fails with E0425** (`rt-multi-thread` cfg), **identical on prod `ad1b89e2`**, not from the hotfix (note 3) | | `cargo test -p calternal-notes` | **561 passed, 1 FAILED** (note 1) | | web unit tests (vitest) | 107/107 passed | | `bun run check` | 0 errors, 16 warnings | | editor unit tests | not run separately: no `test` script in `packages/editor` was found by me; `frontmatter-unreachable.test.ts` is in that package. Unverified, see note 4 | | `perf/web.sh --bundle-only --gate` | ok. first JS brotli **233.040 KB vs 232.808 KB on prod (+0.232 KB)**, budget 240. CSS 18.4 unchanged, plugins JS 37.860 vs 37.961 (−0.101), total JS 363.918 vs 363.967 (−0.049) | | typing latency ABAB ×4 (release binaries, dev-01) | **inconclusive**, see note 5 | ### Notes 1. **Real regression (blocks).** `room::save::tests::review::review_fuzz_old_new_bytes_history_versions_and_restarts` passes on prod `ad1b89e2` and **fails on the hotfix, same place on 3 runs** (2 reruns + the full run): `seed 21 step 76: text`, after an outside-disk write of `---\ntitle: 'outside 75'\n---\n# disk 75…`. The note text is `"---\n…last edited: …\n---\n"` and the expected value is `"---\n…\n---"` (differs by one trailing `\n`). Looks like the new `guard_properties` repair (put back the closing line break, `crates/notes/src/room/save.rs`) adds a `\n` the fuzz oracle (file bytes vs CRDT text) doesn't expect for a note whose entire text is the properties block. Either the guard should not "repair" a block that ends the document, or the oracle needs the same rule. I did not change code. 2. webkit-390 `a11y-high` Style flake: reproduces at `--repeat-each=10` on the hotfix (2 failed of 10) **and on prod `ad1b89e2`** (4 of 10, 4 of 10) on dev-02, so it is not caused by the hotfix. It is the same "Style dialog not visible" miss #973 saw; #971 had it passing 50/50 on a quieter dev-02. It needs its own stability issue; I did not open one. 3. clippy E0425 is a pre-existing feature-gating error when `calternal-notes` is built alone (`-p calternal-notes` does not enable `tokio/rt-multi-thread`). The gate can't pass as specified on prod either; the gate command needs a fix (or `--workspace`). 4. I ran vitest in `apps/web` only. The editor package's test (`packages/editor/test/frontmatter-unreachable.test.ts`) still needs a run by someone who knows its runner. 5. Typing latency: dev-01 was shared with other agents' jobs (`cargo test --workspace`, release builds) during the ABAB. Numbers are far outside the 50 ms gate for both builds (both fail p95<50 on every run), so it can't prove flat. Default-mode p50/p95 ms, prod vs hotfix: run1 125.6/512.3 vs 142.8/818.6; run2 126.0/394.2 vs 148.6/949.1; run3 129.8/449.9 vs 91.7/321.2; run4 148.2/414.3 vs 152.2/703.4. Hotfix p95 is higher in 3 of 4 pairs, but the noise is larger than the effect. Needs a quiet rerun on a perf VM; the `perf-lock` VMs build binaries on dev-01, which I didn't do. RED: the hotfix breaks a prod-passing `calternal-notes` test (note 1).
Author
Owner

Regression fix is ready for gates: PR #983 (40e64fcfe1d07121845fd8b37fdc6b38c86f978f, based on dev db15794ac), cherry-picked with -x and pushed to release/2026-11-06-hotfix as 71827028ca380248019edd2ddcc84fa1ecb33d05. Both commits have identical patch-id b8965802d57c7701f9ed035ac86ed201490daadc. No merge or deployment.

Cause: the save guard copied the editor's requirement for a final line break. A valid closing fence at EOF failed that predicate, entered Repair, and gained a newline. The save guard now accepts EOF as a closed fence. Its existing repair/refusal paths remain unchanged.

Failing first on dev-01 with Nix and slot:

  • cargo test -j4 -p calternal-notes frontmatter_guard: EOF recognition tests failed (None instead of closed block).
  • cargo test -j4 -p calternal-notes file_styles_round_trip_through_the_guard: failed (Repair(Edit { at: 38, delete: 0, insert: "\n" }) instead of Fine).
  • cargo test -j4 -p calternal-notes review_fuzz_old_new_bytes_history_versions_and_restarts: reproduced seed 21 step 76, exactly one extra trailing newline.

After the fix, all 8 guard unit tests pass. The full four gates are running sequentially on both exact heads on dev-01; results will follow here and on #983. Editor runner found: cd packages/editor && bun run test (vitest run, config includes test/**/*.test.ts).

Regression fix is ready for gates: PR #983 (`40e64fcfe1d07121845fd8b37fdc6b38c86f978f`, based on dev `db15794ac`), cherry-picked with `-x` and pushed to `release/2026-11-06-hotfix` as `71827028ca380248019edd2ddcc84fa1ecb33d05`. Both commits have identical patch-id `b8965802d57c7701f9ed035ac86ed201490daadc`. No merge or deployment. Cause: the save guard copied the editor's requirement for a final line break. A valid closing fence at EOF failed that predicate, entered Repair, and gained a newline. The save guard now accepts EOF as a closed fence. Its existing repair/refusal paths remain unchanged. Failing first on dev-01 with Nix and slot: - `cargo test -j4 -p calternal-notes frontmatter_guard`: EOF recognition tests failed (`None` instead of closed block). - `cargo test -j4 -p calternal-notes file_styles_round_trip_through_the_guard`: failed (`Repair(Edit { at: 38, delete: 0, insert: "\n" })` instead of `Fine`). - `cargo test -j4 -p calternal-notes review_fuzz_old_new_bytes_history_versions_and_restarts`: reproduced seed 21 step 76, exactly one extra trailing newline. After the fix, all 8 guard unit tests pass. The full four gates are running sequentially on both exact heads on dev-01; results will follow here and on #983. Editor runner found: `cd packages/editor && bun run test` (`vitest run`, config includes `test/**/*.test.ts`).
Author
Owner

The guard regression is fixed in PR #983, head 40e64fcfe1d07121845fd8b37fdc6b38c86f978f, and the same commit is cherry-picked and pushed to release/2026-11-06-hotfix as 71827028ca380248019edd2ddcc84fa1ecb33d05.

All four requested gates passed on both exact heads: fmt check; full notes crate (dev 568 passed, hotfix 565 passed, each 6 ignored and zero failures); workspace/all-targets clippy with warnings denied; all 526 editor tests on each head. The original save/history fuzz test passes all 24 seeds on both heads, after reproducing the old failure at seed 21 step 76 before the fix.

Cause: an EOF closing fence incorrectly required a final newline. The save guard now accepts that valid boundary without a repair edit. Existing joined-body repair and unwrapped-property refusal remain intact. No merge or deployment.

Commands and full red/green logs: #983 (comment)

The guard regression is fixed in PR #983, head `40e64fcfe1d07121845fd8b37fdc6b38c86f978f`, and the same commit is cherry-picked and pushed to `release/2026-11-06-hotfix` as `71827028ca380248019edd2ddcc84fa1ecb33d05`. All four requested gates passed on both exact heads: fmt check; full notes crate (dev 568 passed, hotfix 565 passed, each 6 ignored and zero failures); workspace/all-targets clippy with warnings denied; all 526 editor tests on each head. The original save/history fuzz test passes all 24 seeds on both heads, after reproducing the old failure at seed 21 step 76 before the fix. Cause: an EOF closing fence incorrectly required a final newline. The save guard now accepts that valid boundary without a repair edit. Existing joined-body repair and unwrapped-property refusal remain intact. No merge or deployment. Commands and full red/green logs: https://git.kayg.org/kayg/calternal/pulls/983#issuecomment-82009
Author
Owner

Hotfix release/2026-11-06-hotfix 71827028 (prod ad1b89e2 + #982 + #983) deployed to prod 15:27 IST. Health 200, version 0.1.0. Backup backup-pre-71827028-20261106T095720689398097Z.tgz. Follow-up: typing latency on a quiet host.

Hotfix release/2026-11-06-hotfix 71827028 (prod ad1b89e2 + #982 + #983) deployed to prod 15:27 IST. Health 200, version 0.1.0. Backup backup-pre-71827028-20261106T095720689398097Z.tgz. Follow-up: typing latency on a quiet host.
Author
Owner

Closing: fixed by merged #982 (+ #983), deployed to prod 2026-11-06 15:27 IST as release/2026-11-06-hotfix 71827028 (see the comment above). (Housekeeping 2026-11-09 night)

Closing: fixed by merged #982 (+ #983), deployed to prod 2026-11-06 15:27 IST as release/2026-11-06-hotfix `71827028` (see the comment above). (Housekeeping 2026-11-09 night)
kayg closed this issue 2026-11-09 18:46:30 +00:00
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#980
No description provided.