Skip to content

[codex] Add durable daemon restart and session browsing#69

Merged
marquesds merged 4 commits into
mainfrom
marquesds/daemon-restart-session-search
Jun 22, 2026
Merged

[codex] Add durable daemon restart and session browsing#69
marquesds merged 4 commits into
mainfrom
marquesds/daemon-restart-session-search

Conversation

@marquesds

Copy link
Copy Markdown
Owner

Why

Restarting the Kaizen daemon preserved SQLite history for the Web app but silently stopped registered workspace scanners, so CLI capture became stale. The Observe page also made large histories difficult to inspect because it had no pagination or unified filtering.

What

  • Add kaizen daemon restart with bounded lifecycle IPC and startup readiness.
  • Restore registered workspace capture, scanner health, and search projections before the daemon reports ready.
  • Add 30-row server-side pagination and one prompt-first search field across prompts, session IDs, agent, model, visible status, branch, and tools.
  • Move Project controls into the navbar and keep the layout usable at mobile widths.
  • Include the refreshed Kaizen brand asset and Web asset contract coverage.

How

Daemon startup now rebuilds its supervisor from the machine registry, runs initial scans before binding the socket and Web server, and reports scanner failures through structured warnings and capture health. Lifecycle requests use a 500 ms IPC timeout, while legitimate migration and scan startup remains bounded at 30 seconds.

Session search uses an additive SQLite prompt projection, Unicode default case folding, parameterized queries, visible derived statuses, and separate SQL paths so empty and ordinary searches avoid the status event rollup. Snapshot responses expose additive page metadata consumed by small focused Web modules.

Test plan

  • cargo test --quiet — 575 passed, 4 intentionally ignored performance harnesses
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • node --check for all changed JavaScript modules
  • Staged diff whitespace and secret review
  • Isolated daemon proof: seeded 31 sessions, dropped the prompt projection, restarted twice, confirmed 31 CLI sessions, one restored watcher, and 31 rebuilt projection rows
  • Browser proof: Unicode prompt search, raw-status rejection, 30+1 pagination, navbar Project controls, loaded brand image, 390 px layout with no horizontal overflow, and zero console warnings/errors
  • Mandatory six-axis diff review — no required findings

Risk + rollback

Schema change is additive; rollback can revert commit without deleting session data. Older binaries ignore the new projection table. Visible-status searches still aggregate workspace event history, while empty and ordinary searches use the cheaper path. VisualizationQuery gains a pre-1.0 Rust field; JSON remains backward-compatible through serde defaults.

No feature flag: change is local-only, additive, and covered by daemon, SQLite, Web, and browser regression tests.

AI Assistance

  • Implementation and test scaffolding were AI-assisted; all staged changes were reviewed and exercised locally.
  • Daemon lifecycle, SQL, dependency licensing, asset routing, and accessibility received an explicit independent six-axis review with no required findings.

Daemon restarts stopped registered scanners, while Observe users could not page or filter session history. CLI capture became stale and large histories were hard to inspect.

Restore registered capture before readiness, add bounded restart handling, prompt-first Unicode search, server-side pagination, navbar project controls, and refreshed brand assets.

AI-assisted implementation and test scaffolding; independently reviewed. Tests: cargo test, strict Clippy, rustfmt, JavaScript syntax, isolated daemon and browser smoke.
@marquesds marquesds self-assigned this Jun 22, 2026
CI blocked on RUSTSEC-2026-0185, and the lockfile retained quinn-proto 0.11.14 with a high-severity remote memory exhaustion flaw.

Upgrade the transitive lock entry to patched 0.11.15. No source or public API changes.
macOS nextest could read the daemon log before redirected stderr became visible even though capture status already reported the scanner failure, making CI flaky.

Poll the log for at most two seconds while preserving immediate capture-health assertions and a hard failure when the event never appears.
CI runs without a RUST_LOG filter, so the lifecycle test could not observe the scanner warning it asserts. Set the warning filter on the restart process to make the test environment deterministic.
@marquesds marquesds marked this pull request as ready for review June 22, 2026 22:40
@marquesds marquesds merged commit d9a76b5 into main Jun 22, 2026
9 checks passed
@marquesds marquesds deleted the marquesds/daemon-restart-session-search branch June 22, 2026 22:40
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