Skip to content

Release 1.10.0: T8–T10, bugs 5 and 6, macOS signature, Windows hook speed - #79

Open
HackPoint wants to merge 26 commits into
mainfrom
release/1.10.0
Open

HackPoint wants to merge 26 commits into
mainfrom
release/1.10.0

Conversation

@HackPoint

Copy link
Copy Markdown
Owner

Lumen 1.10.0: the move to the new identifier, finished, and what the 1.9.0 report found.

Merge this, then I tag v1.10.0 from main. The release workflow builds and publishes from the tag, updates the Homebrew tap, and the new Evidence workflow then installs what was published on macOS, Windows and Ubuntu and keeps the evidence for the release's evidence doc.

What is in it

F53 v2, tasks T8–T10 (T1–T7 merged in #76):

  • T8: the previous-id constant is gone; the name guard reads every file's path as well as its bytes; the startup scan refuses an early-returning macro it does not know.

  • T9: the cask's zap lists this identifier's exact paths and no glob; a Windows post-install hook removes a second "Lumen" entry in Apps & features and the previous manufacturer's key, both found by content; the CHANGELOG, README, troubleshooting doc and MANUAL_TEST cover the move, the backup, lumen import-ledger and the Homebrew re-tap; pinned issue Homebrew: brew update or upgrade fails for Lumen? Re-tap #78 has the re-tap steps.

  • T10: .github/workflows/upgrade.yml, 6 legs (macOS, Windows, Ubuntu × from 1.8.0 with the login item off, from 1.9.0 with it on), each on the runner's real profile with the platform's own installer:

    • seed;
    • a start killed mid-copy (1.8.0 legs, a debug-only pause seam);
    • a split ledger, where the start must defer (1.9.0 legs);
    • a held file, where the start commits but cannot move (Windows);
    • install, launch, verify;
    • Setup, then the freeze;
    • a re-created folder, reported, then imported.

    Plus the over-1-GiB migration on Windows. Also a 1.5.0 ledger fixture, whose faults now import.

Bugs from the 1.9.0 report:

  • Bug 5: the menu-bar icon keeps its place across the identifier change. Its position is read from the previous app's domain before the move.
  • Bug 6: closing the window never quits. While the icon is hidden, the Dock icon (macOS) or the taskbar entry is the way back.

Found while measuring, fixed here:

  • macOS signature: the published 1.9.0 app fails codesign --verify ("code has no resources but signature indicates they must be present"). The bundle is now signed as a whole, ad hoc (bundle.macOS.signingIdentity: "-"), with a test that keeps it so.
  • Windows hook slowdown: every hook on Windows was 4.7 ms slower than 1.9.0. The redirect asked the shell for the data folder, and referencing dirs::data_dir at all made the binary import shell32. It now reads %APPDATA%.
  • Benchmark baseline: the harness's baseline (v1.8.0 by SHA) no longer existed after the history rewrite; it is now v1.9.0 (cbb8d0f).
  • Benchmark banner: every pre-release summary said "before the 1.8.0 release"; it now names the candidate's own version.

For every release after this one: CI runs on pushes to release/**; .github/workflows/evidence.yml installs a published release as users do and keeps screenshots and raw text. That workflow must be on main before a release is published, which is why it ships here.

How it was checked

  • Locally (macOS, this tree):
    • fmt; clippy on the workspace, the app, and lumen-core for Linux;
    • the Windows cross-check;
    • the hook end-to-end tests;
    • the workspace: 2,073 passed, 0 failed;
    • the frontend: 641 passed;
    • the release-notes script;
    • actionlint and shellcheck on the new workflows and scripts, and PowerShell's parser.
  • CI, on the final commit (229d669): CI, Upgrade, Evidence (fresh installs of the latest published release, 1.9.0, proving the workflow before 1.10.0 exists). All three green. What a runner cannot show is recorded as such, not skipped:
    • Windows app tabs: a release build opens no DevTools port, so its window cannot be driven. The installer's publisher, the CLI in PowerShell and cmd, and the upgrade's savings check are captured.
    • Tray menus: none of the three runners exposes the tray menu. macOS keeps a picture of the icon in the menu bar.
    • Gatekeeper and UAC dialogs: no one is there to click them. The Gatekeeper verdict and the installer's publisher are kept as text.

Benchmark, 1.9.0 then this commit (medians, 200 runs): tokens equal.

macOS Ubuntu Windows
hook that does nothing 2.57 → 2.62 ms 729 → 736 µs 3.25 → 3.30 ms
Read let through 2.47 → 2.39 ms 767 → 772 µs 3.37 → 3.40 ms
Read blocked 5.06 → 4.88 ms 1.21 → 1.25 ms 4.38 → 4.44 ms
per-call identity 4.02 → 5.46 ms* 823 → 842 µs 3.62 → 3.65 ms
meter (Read) 30.57 → 31.16 ms 43.61 → 44.78 ms 52.54 → 54.06 ms

* On macOS this series, the server's start and the large smart_read are slower only when the harness builds the candidate in the same run. The same binary, measured again as a prebuilt candidate, is equal (identity 4.08 → 3.96 ms); see benchmarks/README.md and results/*-macos-prebuilt-*.

Left for 1.10.1, with the reason

…s hidden early returns

Wrong or missing:
- legacy::LEGACY_APP_ID was a placeholder only the app e2e still read (by regex out of
  legacy.rs), to delete a folder the app no longer creates.
- startup_scan read only some!/tried! as `?`: a macro_rules! under any other name that returns
  early hid one from the scan.
- scan_registry's exemption was checked as a ByMatch whose tail `Err(e) => Err(e)` forwards the
  error, so "adopt_other_entries reports it" was never checked.
- adopt_other_entries reported a scan error, but no test pinned it.

Changed:
- Deleted LEGACY_APP_ID and its e2e use (the removal loop goes with it).
- startup_scan refuses any macro_rules! in APP_FILES whose body has `return` or `?` unless its
  name is in TRY_MACROS.
- scan now returns scan_registry's result as it is; the exemption is Handled::Passed, which
  checks that scan returns it unchanged, that adopt_other_entries is scan's only caller, and that
  it matches the result with an Err arm that records a problem.
- Test: an unreadable login-entry list is reported by adopt_other_entries, not dropped.

Tests (red then green):
- Seeds: a renamed early-return macro (attempt!) in a reached function; scan_registry's result
  changed on the way; adopt_other_entries dropping the error; scan called from the closure.
  Each was refused only once the new check existed, and all pass on the real sources, LF and CRLF.
- Reporting test fails with `Err(_) => return out` and passes on the real code.
… (T8)

A fixture or folder named after a protected word published it as surely as a file holding
it, and the guard never looked: scan() searched contents only. It now searches each tracked
path too and reports such a hit as "<path> (its path)".

T8's scope, against what main already holds:
- The hashed, whole-repository guard with no allow-list is protected_names.rs (#75).
- LEGACY_APP_ID and its e2e removal loop went in the previous commit, with the startup-scan
  carry-overs from T7's reviews.
- The bench sandbox finds the previous install by content; pins.rs has no assembled-name
  test; the fixture READMEs use neutral placeholders.
- A case-insensitive git grep for the previous identifier and the company name, run with
  the name assembled at runtime, finds nothing on the branch.

Tests: a_word_in_a_file_path_is_caught (red with the contents-only scan, green now);
a_word_in_the_migration_module_or_the_changelog_is_caught pins that neither is exempt.
…nge (bug 5)

macOS keeps a status item's place per bundle id. Under the new id an upgraded Lumen had none,
so AppKit put the icon leftmost, the first one a full menu bar or the notch hides, and the app
looked as if it had not started. The previous app's position (612 on the owner's Mac) sat in
its preferences file, which the start then moved into the backup.

The start now reads that app's `NSStatusItem Preferred Position …` keys from its domain
(persistentDomainForName, read only) before the satellites move, and writes them into this
app's defaults before the tray is built, unless this app already holds a position: one the
user gave the new icon is the newer choice. Visibility flags are not carried; a hidden one
would be cleared before the tray is built anyway. Off macOS it does nothing.

Tests: the_previous_menu_bar_position_is_carried_only_when_this_app_has_none;
the_menu_bar_position_is_carried_before_the_previous_preferences_move (red with the call after
the satellite move, green before it). Lumen lib: 317 passed.
…ck icon stays (bug 6)

While the menu-bar icon was unavailable, closing the main window quit Lumen. The icon is most
often merely crowded out by a full menu bar or the notch, the fallback then opens the window
and a Dock icon, and a user who closed that window found Lumen gone: "Lumen doesn't run".

health::close_action decides, and the handler acts on it:
- tray reachable: hide the window, as before;
- macOS, no reachable icon: hide the window and keep the Dock icon (Regular activation is made
  sure of first); its click re-opens the window through RunEvent::Reopen;
- elsewhere, no reachable tray: minimize, so the taskbar entry is the way back.
Quitting stays where it was: the tray's Quit, the Dock menu, Cmd-Q.

Tests: closing_the_window_never_quits (both platforms, every tray state). Lumen lib: 318 passed;
clippy clean; the Windows cross-check passes.
A release is now built on its own release/<version> branch with one PR to main at the end.
Its fixes are checked on the branch a batch at a time, before that PR exists.
Zap matched `io.*.lumen` globs, which can take another vendor's `io.<vendor>.lumen`, and
`*.migrated*` backups the 1.10.0 migration no longer makes (its backup lives inside the data
folder). It now lists the new identifier's Application Support (backup included), Caches,
Logs, WebKit, HTTPStorages and its cookies, Cookies, Preferences, Saved Application State,
and the plugin's LaunchAgents/Lumen.plist: owner decision 4 of the F53 v2 spec. The release
copies this file into the tap.

Test: the_cask_zaps_the_new_paths_and_no_migrated_glob (red on the globs, green now).
…ers, found by content (T9)

An install made under Lumen's previous identifier can leave two registry entries that 1.10.0's
installer (keyed on the product name) does not overwrite: a second "Lumen" entry in Apps &
features, whose uninstaller would remove the live install, and the previous manufacturer key.
A post-install hook (windows/hooks.nsh, wired through bundle.windows.nsis.installerHooks)
removes, under HKCU:
- an Uninstall subkey other than "Lumen" whose DisplayName is "Lumen" and whose
  InstallLocation is this $INSTDIR (quoted, as the template writes it, or bare);
- Software\<vendor>\Lumen whose default value is this $INSTDIR, under any vendor but this
  build's ${MANUFACTURER}, and the vendor key when that leaves it empty.
Installer metadata only, never user data (owner decision 3 of the F53 v2 spec). The hook spells
no vendor and no identifier. A key that cannot be deleted is stepped over, so the loops end.

Tests: the_nsis_hooks_are_wired_and_name_no_vendor. The hook compiles under makensis 3.13 with
warnings as errors in a stub that defines what the template defines; its behaviour is proven
by the upgrade workflow on windows-latest (T10).
…ledger (T9)

- CHANGELOG: a 1.10.0 block that opens with what resets and where the backup is, then the data
  move, history coming back for the re-published 1.9.0 (the set-aside lumen.db.pre-legacy and
  lumen import-ledger), the menu-bar position kept, closing the window never quitting, the
  Windows installer cleanup, the cask zap, the re-tap steps and the XDG / redirected-AppData note.
- README: "If brew update or brew upgrade fails" with the re-tap steps (bug 4), and "Upgrading
  to 1.10.0".
- troubleshooting-the-tray: the icon hidden by a full menu bar or the notch, where the backup
  is, import-ledger, the re-created-folder message, deleting a read-only backup.
- MANUAL_TEST: TEST 7, the 1.10.0 upgrade checklist.

The release-notes script cuts the new block; the name guard passes.
…alue (bug 6)

The silent-fallback guard caught an unwrap_or_default() on try_state::<StartupHealth>(): a
missing state would have read as Unknown and hidden the window. It cannot be missing: the
state is managed on the builder, before any window exists. The handler now takes it with
state(), and the guard has nothing to account for. Workspace: 2,027 passed.
…tall on 3 OSes (T10)

.github/workflows/upgrade.yml, on macos-14, windows-latest and ubuntu-22.04, from 1.8.0 with
the login item off and from 1.9.0 with it on (6 legs):
1-2. seed: a previous install on the runner's real profile under the neutral folder name,
     its ledger built from that release's schema, its shims from tests/fixtures/v<version>,
     Claude's settings and MCP entry, the pointer, the login entry, and per OS: Logs and
     Caches and the menu-bar position (macOS), %LOCALAPPDATA%, the second Apps & features
     entry and the previous manufacturer key (Windows), ~/.cache and ~/.config (Linux).
     Its hooks then fire once into the previous ledger.
5. install with the platform's own installer: cp -R over the previous bundle, setup.exe /S,
   dpkg -i.
6. launch, and wait (180 s at most) for the committed marker and the backup.
7. verify: the same rows in the new ledger and the backup; no folder or satellite under the
   previous name; Lumen's Claude entry, the pointer and the shims name the new folder; the
   hooks fire into it; Setup still needed, nothing frozen; one installed app; the menu-bar
   position carried (bug 5); the installer removed the previous entries (Windows); the login
   item as it was.
9. Setup, then the freeze: the backup read-only, the hooks after both.
10. a re-created previous folder: the relaunch names it and the command and merges nothing;
    the installed lumen-cli import-ledger brings its rows in once.
Plus the over-1-GiB migration on windows-latest.

The steps run inside the test binary (setup::hook_e2e::upgrade_ci, ignored), reusing the hook
end-to-end rig against the real home. They refuse to run anywhere but a GitHub-hosted runner
with LUMEN_UPGRADE_JOB=1 (unit-tested; a local run refuses and writes nothing).
… the rewrite

The harness pinned v1.8.0 by SHA (12ad305), a commit that has not existed since the history
rewrite of 2026-10-20, so a full run could not build its baseline. 1.10.0 is measured against
the release before it anyway: the baseline is now v1.9.0 at cbb8d0f, the rewritten tag. The
help text, the README, run.sh and the workflow's note say so. lumen-bench tests pass.
…and Linux (T10)

The Windows and Ubuntu legs failed at "Setup is still needed": it was not. The Setup page runs
Setup as it loads, Home sends the window there while Setup is needed, and on Windows and Linux
the hidden main window loads its page at the start, so the first start ran Setup and froze the
backup. On macOS a hidden window loads nothing until it is first opened, so Setup waits.

The wait step now also waits, where the first start runs Setup, for Setup and the freeze, so
the quit cannot cut them short; verify expects them done there and still to come on macOS.
The README and the 1.10.0 notes say when Setup runs instead of "when Lumen asks".
… hold a file (T10)

The three steps of the spec's §13 the first cut left out:
- Step 4, 1.8.0 legs: the debug app (built with pnpm tauri build --debug --no-bundle) is run
  with LUMEN_TEST_MIGRATE_PAUSE=staged, stops once the move is staged and is killed there.
  killed_mid_copy_lost_nothing: no marker, the previous ledger's rows unchanged, the pointer
  still names it. The next start, the installed build's, finishes the move.
- Step 3, 1.9.0 legs: hold keeps the previous ledger open in WAL and writes every 5 ms;
  deferred_while_held: the start committed nothing, copied nothing, left the pointer, and its
  log says it deferred. Once released, the rows the holder wrote arrive with the rest.
- Step 8, Windows legs: hold_file keeps a file in the previous folder open without
  FILE_SHARE_DELETE; the start commits but cannot move (wait_for_the_commit); write_old adds a
  row as an old binary would; released, the next start moves the folder and merges it once.
verify compares against the seed's rows plus what the holder and the late writer recorded.

The seam (§18): debug builds read LUMEN_TEST_MIGRATE_PAUSE at each phase of the move
(Phase::name: copied, staged, commit, committed, moved), write LUMEN_TEST_MIGRATE_PAUSE_FILE
and sleep until killed. Release builds have no hook.

The helpers run as the test binary itself (HELPERS), since some run in the background and
cargo would hold them on its build lock; launch and quit are .github/scripts/upgrade-app.sh.
actionlint and shellcheck pass on the workflow and the script.
… §18)

1.5.0 shipped the first faults table, before agent_id was added to it, and no fixture had its
shape: the import's core-column checks were only exercised on 1.4.0 (no faults table), 1.8.0
and 1.9.0. tests/fixtures/ledger_schema_v1.5.0.sql is that release's DDL with its migrations
applied (4 of 22 apply; the rest add columns its DDL already has), generated from
lumen-daemon's upgrade_matrix/schema_v1_5_0.rs and re-runnable.

Tests: core_columns_are_in_every_released_schema now includes 1.5.0;
a_1_5_0_ledger_imports_with_its_faults: its read event and its fault are taken, none refused.
The silent-fallback guard, which reads every shell script, caught four '|| true' in
.github/scripts/upgrade-app.sh. A quit that finds no Lumen to quit is not an error there, the
next step checks the state, but it is now said on stderr instead of swallowed.
Every version file the release script knows moves to 1.10.0: the crates, the app's Cargo.toml,
package.json and tauri.conf.json, the plugin manifest and its hook scripts' generator stamp,
the formula and the cask (their sha256 are stamped from the published assets by the release
workflow), and Cargo.lock. The CHANGELOG's 1.10.0 block is dated. No tag: it is made from main
once the release PR is merged.

Local gate on this tree: fmt; clippy on the workspace, the app and lumen-core for Linux; the
hook end-to-end tests single-threaded; the workspace, 2,070 passed (the one failure, the
fallback guard on the upgrade script, is fixed in the commit before); the frontend, 641
passed; the Windows cross-check; the release-notes and resolve-release scripts.
…h form

cargo reports the test binary as D:\a\... on Windows; Git Bash's test -x and the steps that
run it want /d/a/.... The path is converted with cygpath there.
…install it

.github/workflows/evidence.yml, on a published release (and by hand), on macos-14, windows-latest
and ubuntu-22.04, fresh and as an upgrade from 1.9.0 and from 1.8.0 (simulated with the upgrade
helpers: their binaries are no longer published). It installs what the release published the
way users do and keeps, per platform and scenario:
- the app's tabs: Home with the savings headline, Optimizer, Details, Settings with the version
  and the Repeat reads switch (macOS through the accessibility API, Windows and Linux through
  WebDriver on the installed app, lumenator/e2e/evidence.mjs);
- the menu-bar menu with the version on macOS; where a platform cannot show something (the tray
  on Xvfb or a runner's notification area, an installer or Gatekeeper dialog), it says so;
- the CLI (lumen --version, lumen, lumen report, lumen doctor) in Terminal, in PowerShell and
  cmd, and in bash, each as a picture and as raw text;
- the Windows installer's publisher (file details, Authenticode status, the Apps & features
  entry) and Gatekeeper's verdict on macOS for the cask and for a browser-downloaded DMG;
- for an upgrade, the all-time savings before and after from lumen report, which must match.

scripts/evidence/{macos.sh,linux.sh,windows.ps1} do the work and refuse to run off a
GitHub-hosted runner. On a push to a release branch the workflow installs the latest published
release, fresh only, which proves it before the release it is for exists; upgrades need 1.10.0.
It has to be on main before a release is published, which is why it ships with 1.10.0.
shellcheck, actionlint and PowerShell's parser pass on the scripts and the workflow.
The 1.10.0 benchmark against 1.9.0 caught every hook slower on Windows: a hook that does no
work went from 5.67 to 10.37 ms (median, 200 runs), the per-call identity hook from 6.18 to
15.10 ms. Linux was unchanged. Every hook computes the data roots for the migration's redirect,
and the second root came from dirs::data_dir(), which on Windows calls SHGetKnownFolderPath and
so loads shell32 and COM into the process. 1.9.0 never called dirs on a hook's path.

The root now comes from %APPDATA% on Windows, the same folder (a redirected Roaming AppData
included); dirs::data_dir() is the fallback when it is unset, and elsewhere dirs reads only the
environment and is kept.

Tests: the_windows_data_root_is_read_from_appdata (Windows), the_home_based_data_root_comes_first.
The benchmark reruns on all three platforms on this commit.
…orts

Every pre-release summary said it was taken "before the 1.8.0 release" and "not a 1.8.0
result", whatever it measured: the text was written for 1.8.0 and never followed the version.
It now names the version the candidate build reports (1.10.0 here).

Test: a_pre_release_summary_names_the_release_its_candidate_reports.
The first fix stopped calling dirs::data_dir() on Windows but kept it as the fallback, and a
reference is enough for the binary to import shell32, which Windows then loads into every hook
process at start. The benchmark on that commit still had a hook that does no work at 6.58 ms
against 1.9.0's 3.92 (median, 200 runs, windows-latest); Linux was equal throughout.

On Windows dirs is no longer named on the hooks' path: %APPDATA%, else the profile's
AppData\Roaming. Elsewhere dirs::data_dir() stays (it reads only the environment).
results/pre-release-93eb22405b42-*: tokens and latency on macOS (M4, run here), latency on
Ubuntu and Windows (the Benchmarks workflow, run 40321006240), 200 runs per series. Tokens are
equal; latency is equal on Ubuntu and Windows within 3%.

On macOS three series measure slower only when the harness builds the candidate in the same
run (the per-call identity hook +1.4 ms, the server's start, the large smart_read). The same
binary at the same path, given back as a prebuilt candidate, measures equal:
results/pre-release-93eb22405b42-macos-prebuilt-*. The README says both, and that the cause on
the harness's side is not traced.

The README entry also records the two regressions this measurement caught and the commits
before it fixed: Windows hooks 4.7 ms slower through dirs::data_dir importing shell32.
The macOS leg from 1.9.0 failed at "Setup ran at the first start": it had. The Setup page runs
Setup as it loads and Home sends the window there while Setup is needed, so Setup runs at any
start whose window page loads: at once on Windows and Linux, and on macOS whenever a start shows
the window (that leg's app started twice, once deferred by the held ledger). The platform does
not decide it.

The wait now waits for the move, then, if Setup runs at that start, for the freeze; a start that
has not run Setup 20 s after the move is taken not to. verify asserts what holds either way: the
backup is frozen exactly when Setup has run.
The evidence run on the published 1.9.0 found Gatekeeper's verdict on the app, installed by the
cask or from the DMG: "code has no resources but signature indicates they must be present". Only
the executable was signed, by the linker (adhoc, linker-signed, a random identifier); the bundle
had no _CodeSignature, so codesign --verify failed and a quarantined copy is called damaged.

bundle.macOS.signingIdentity "-" makes the bundler sign the bundle ad hoc: built here, it is
"valid on disk" and "satisfies its Designated Requirement", identifier io.hackpoint.lumen,
resources sealed; a quarantined copy is "rejected" by spctl, Gatekeeper's verdict on an app from
an unidentified developer, which the user can open. The upgrade workflow's macOS legs launch this
bundle. The CHANGELOG says so.

Test: the_macos_bundle_is_signed_as_a_whole.
…ls, checks case

From the first evidence run (fresh installs of the published 1.9.0):
- macOS: the window opened on the Setup screen (a fresh install's first screen), which has no
  tabs. It is kept as setup-<label>.png, then Open Lumen is pressed as a user would. The same in
  evidence.mjs for Windows and Linux.
- macOS: the runner's accessibility tree does not expose Lumen's status item, so the menu cannot
  be opened there; the menu bar strip with the icon is kept and the limitation said.
- Windows: msedgedriver attaches only to a debug build ("DevToolsActivePort file doesn't
  exist"). WebView2 opens a debugging port for any app started with
  WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS, so evidence.mjs drives the published app over the
  DevTools protocol there (Node's WebSocket); tauri-driver and msedgedriver are Linux's and gone
  from the Windows jobs. Linux passed through WebDriver as it was.
- Windows: the publisher check used -ne, which ignores case, and passed 1.9.0's "hackpoint"; it
  is -cne now.
…cannot drive

From the second evidence run (fresh install of the published 1.9.0 on windows-latest):
- The publisher check failed on 1.9.0's "hackpoint", which is what 1.9.0 has: the publisher is
  set from 1.10.0 on. Before 1.10.0 it is noted, not failed.
- No page came up on the DevTools port. WebView2's processes outlive the app the script started
  and stopped before, and a relaunch joins them without the port: they are stopped first now.
  Should the published build still open no port (its developer tools are off), evidence.mjs
  exits 3 and the script says the tabs cannot be shown on this runner, instead of failing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant