Repository navigation
Activate the new daemon binary when upgrading the Linux login service - #203
harshsaver wants to merge 4 commits into
Conversation
…#178) service install is now the idempotent upgrade path: it replaces the stable executable (skipping byte-identical reinstalls), reactivates the user service, restarts only when the running daemon is not on the new build, and verifies health/version before reporting success. install upgrades a stale managed daemon instead of reusing it. Activation failures are reported as failures; unchanged reinstalls never restart.
🤖 Agentbox PR audit: changes requestedWhat needs to change Fix the recovery paths before treating this as ready for the real Linux qualification run.
For that run:
Recommended alongside these fixes: report the latest verification state on timeout. Optional cleanup: simplify the duplicate upgrade decisions and improve manual-daemon conflict diagnostics. Add unit-only-change and macOS bootstrap-failure tests when adjusting those paths. What this PR changes
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 5 turns, commit 8092013)PR audit: #203 — Activate the new daemon binary when upgrading the Linux login serviceHead: 8092013 Sign-off
Decisioncomment — fix the false-success and recovery paths, then record the real Linux A-to-B upgrade required by the PR and issue #178. What changes (plain language)
FindingsBlocking
Non-blocking
Fix plann/a Message to the developerFix the recovery paths before treating this as ready for the real Linux qualification run.
For that run:
Recommended alongside these fixes: report the latest verification state on timeout. Optional cleanup: simplify the duplicate upgrade decisions and improve manual-daemon conflict diagnostics. Add unit-only-change and macOS bootstrap-failure tests when adjusting those paths. Questions for Harshn/a Verification
Audit log
Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it. |
…ess split B1: record a pending-activation marker before copying/activating so a retry after a failed or interrupted attempt reactivates and verifies the replacement process even when files and versions already match (same-version rebuilds, copy-without-activation). 'Already current' now requires positive evidence on both Linux and macOS. B2: drive the restart decision from managed-service state, never HTTP readiness. An unhealthy/unreachable managed daemon is restarted and verified (restart also starts inactive units); normal install propagates genuine inspection errors instead of swallowing probe/helper failures. Unsupported platforms and absent/unmanaged units stay not-applicable so manual-daemon flows are unchanged. Also report the latest observed daemon state on verification timeout, cover unit-only drift, and document the resulting guarantees.
|
Fix round for the 2026-11-13 audit is pushed as 6fb50c0 (all 11 CI checks green). What changed:
Item 4 limitation, stated honestly: this was developed on macOS, so no real Linux systemd --user run was possible here. The closest verifiable equivalent I ran locally is the full suite plus vet: go test ./... (all packages pass), go vet ./..., and the new mock-manager tests above which exercise the fail/restart/verify sequencing including process replacement. The real disposable-user Linux A-to-B transcript from the audit is still needed before merge. |
🤖 Agentbox PR audit: changes requestedWhat needs to change The readiness fix and direct-service retry fix read correctly. Complete the remaining recovery path and remove the extra Linux start before recording integration evidence.
Optional cleanup: simplify repeated currentness checks and unused marker payload, clarify manual-daemon conflicts, and mention the intentional What this PR changes
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 3 turns, commit 6fb50c0)PR audit: #203 — Activate the new daemon binary when upgrading the Linux login serviceHead: 6fb50c0 Sign-off
Decisioncomment — complete marker recovery, remove the unnecessary initial Linux start, and record the required real Linux upgrade run. What changes (plain language)
FindingsBlocking
Non-blocking
Fix plann/a Message to the developerThe readiness fix and direct-service retry fix read correctly. Complete the remaining recovery path and remove the extra Linux start before recording integration evidence.
Optional cleanup: simplify repeated currentness checks and unused marker payload, clarify manual-daemon conflicts, and mention the intentional Questions for Harshn/a Verification
Audit log
Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it. |
- stableExecutable records pending activation before the new bytes become visible; a failed recording leaves the old executable in place. - pendingServiceActivation treats an unreadable/rejected marker as pending, so an unevaluated managed daemon can never read current; the follow-up marker write fails loudly while the file stays unreadable. - Linux activation uses plain enable; restart alone starts an inactive unit, so a stopped service is started exactly once. - Regression tests: copy-without-activation then same-version restart, recording failure keeps old bytes, unreadable marker fails normal install, and enable --now fails the fake manager outright.
|
Round-3 audit items 1, 2, 4 done at 815d26f (all 11 CI checks green, incl. Linux race + Windows).
Item 3 (real Linux A-to-B run) still outstanding — no Linux systemd here. Local: full go suite, vet, build green. |
🤖 Agentbox PR audit: changes requestedWhat needs to change The code changes requested in the previous audit read as fixed. Finish the outstanding real Linux verification on this revision and paste the commands, results and assertions into the PR. The existing Ubuntu CI job is a practical route to try; a working disposable Linux user environment is also sufficient. A permanent CI regression is preferable if the runner supports it.
The 19:56 audit comment contains the earlier checklist. If the CI environment cannot provide a working user manager, record the exact attempted setup and failure so the infrastructure limitation can be assessed. No failed CI attempt is currently documented. Local macOS availability and passing fake-manager tests do not complete the existing Linux requirement. What this PR changes
Full audit (Claude (claude-opus-5-5, xhigh) × Codex (gpt-6.1-sol, xhigh), 3 turns, commit 815d26f)PR audit: #203 — Activate the new daemon binary when upgrading the Linux login serviceHead: 815d26f Sign-off
Decisioncomment — no additional code blocker found; complete and record the real Linux upgrade verification already required by the PR and issue #178. What changes (plain language)
FindingsBlocking
Non-blocking
Fix plann/a Message to the developerThe code changes requested in the previous audit read as fixed. Finish the outstanding real Linux verification on this revision and paste the commands, results and assertions into the PR. The existing Ubuntu CI job is a practical route to try; a working disposable Linux user environment is also sufficient. A permanent CI regression is preferable if the runner supports it.
The 19:56 audit comment contains the earlier checklist. If the CI environment cannot provide a working user manager, record the exact attempted setup and failure so the infrastructure limitation can be assessed. No failed CI attempt is currently documented. Local macOS availability and passing fake-manager tests do not complete the existing Linux requirement. Questions for Harshn/a Verification
Audit log
Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it. |
Makes service install the documented, idempotent upgrade path: it replaces the stable executable (skipping byte-identical reinstalls), records pending activation before any replacement, reactivates the user service, restarts the managed daemon unless it is provably already on the new build, and verifies the running health/version before reporting success.
Linux flow: daemon-reload + enable (no --now), then restart when the running daemon is not provably current; restart alone starts an inactive unit, so a stopped service is started exactly once. macOS keeps bootout+bootstrap but skips both when already current. install upgrades a stale managed daemon instead of silently reusing it; an unreadable pending marker conservatively forces activation (the follow-up marker write then fails loudly), and normal install fails loudly on an unevaluated managed daemon instead of claiming success. Manually started daemons (no managed unit) keep the existing reuse path. Restart keeps the same data directory (workspaces, messages, credentials preserved); the success message tells operators to reconnect MCP.
Failure handling: restart errors, daemons that never reach the new version, failed marker recording (old bytes stay in place), and unreachable managed daemons all return errors that name the failed step; nothing on those paths prints success.
Tests: fake systemctl/launchctl managers on PATH plus an HTTP health stand-in cover A-to-B upgrade (version-driven and byte-driven), copy-without-activation followed by same-version activation, recording-failure keeps-old-bytes, unreadable-marker install failure, unchanged reinstall, fresh install (exactly one start; enable --now fails the fake outright), restart failure, stale-after-restart verification, stable-copy skip, and the managed-daemon staleness check. Full go suite, vet, and build green locally on macOS; CI re-running on the fix head.
Linux-only verification gap: implemented and tested on macOS, so no run against a real user systemd (systemctl --user with linger, actual daemon stop/start across the restart) was performed here; the Linux command sequences and version verification are covered by the fake-manager tests above, which also run on Linux CI. A real A-to-B pass on a disposable Linux user environment (install build A as a user service, upgrade from build B, compare health/version, no-restart repeat, same-version replacement, bus-down retry, --only codex pass, uninstall) is still needed before merge.
Fixes #178