base red: the apps sidebar's start-up receipts take no resource revision (from #33016)
Summary
Base red on feat-cmux-next: cmux-tui::terminal_host_recovery interrupted_public_creation_publishes_once_and_replays_stable_ids_after_two_restarts fails at terminal_host_recovery.rs:3637 (revision "2" where "1" is expected) in every run since e17575a9e2a (#33016). Bisected on the fleet (the test alone, Linux): green at 9168b56a897, red at e17575a9e2a.
Cause (product): #33016 seeds sidebar placement receipts at every daemon start, "On upgrade, receipt existing installs without changing the layout" ("Only metadata is written"). It wrote them with commit_sidebar_ops, a resource commit, so each fresh daemon spent resource revision 1 (and a journal record and a resource event) on a mutation that changes no resource, and the first real change became revision 2. The test counts creation commits only.
Fix: the receipts and the apps.sidebar.initialized marker are written as registry metadata in one transaction (Mux::write_registry_meta, WorkspaceRegistry::write_meta), with the same is_migrated gate (no document, no marker, so the next start initializes again) and the same double check of the marker. No resource revision, no journal record, no event. I asked Leo on #33016 at 16:56Z which side he wanted; no answer by 19:00Z, so per the PL's rule I took the side that matches #33016's stated intent (metadata only, layout unchanged).
Testing
- Red at the base of this branch (feat 5c62c0624e5, job
d0fc910521dca784b7e0c684): the test fails, revision "2". - Green at the head d1bed903f7b: the test alone on Linux (job
53433bcaae55b933cb629370) and macOS (jobe9aba00e986e6ce1f5b79e9e, at 0087b3cc5a1, same code before a clippy-only follow-up); full Linux run (jobb2587e94642cd3bf7875cec7): it passes; Linuxallwith filtersidebar(jobda24016ac3d4a37c35a684b7): 280 of 280 pass (the apps sidebar migration and retry tests included), clippy pass, fmt red only on files this PR does not touch (base). python3 scripts/cmux-next/prepush-gate.py: no new violations.
Observed / Not run
- Observed: the results above.
- Not run: an app launch that reads
cursor.revisionat start.
Changelog
none
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes interrupted_public_creation_publishes_once_and_replays_stable_ids_after_two_restarts by stopping the apps sidebar's start-up receipts from consuming a resource revision.
Seeding the receipts via commit_sidebar_ops made a fresh daemon spend revision 1 on metadata-only writes, so the first real change became revision 2. The receipts and the apps.sidebar.initialized marker are now written as registry metadata in a single transaction through the new write_registry_meta path, which takes no resource revision, writes no journal record, and publishes nothing. The same migration gate applies: if the sidebar document migration did not complete, initialization is skipped and retried on the next start.