Skip to content

fix(startup): simplify tool validation and fix font loading - #5614

Open
testikun wants to merge 3 commits into
apache:mainfrom
testikun:codex/remove-tool-ledger-cache
Open

testikun wants to merge 3 commits into
apache:mainfrom
testikun:codex/remove-tool-ledger-cache

Conversation

@testikun

@testikun testikun commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #5613. Follow-up to #5556, based on main including #5606 and #5608.

Tool writes now reconstruct validation state from the current SQLite transaction, scoped to the invocation and explicit parent dependencies. Remove the cross-transaction reducer cache and its LRU/budgets, checkpoint/undo, invalidation versions and settlement synchronization. Scans and writes retain shared validation rules, corruption classification and exact retry semantics. Also remove the leftover MAKA_STARTUP_PROFILE timing layer from SessionManager recovery.

The trade-off is deliberate: the previous same-base ablation retained the startup improvement, while a synthetic single invocation with 200 uninterrupted tool executions was slower without caching (615→1249 ms for 512 B; 839→2056 ms for 4 KiB). Short invocations and heavily interleaved partial writes showed smaller or unstable benefits; some intermediate patterns still benefit. We accept that local cost to remove long-lived consistency obligations whose representative end-to-end value has not been established. These are prior measurements on 518fd529c0, not new performance claims for this PR's base.

Keep bundled fonts as local assets so KaTeX history rendering respects the existing CSP. The memory/model-connection startup readiness fix is already supplied by #5606 on main.

Add two real Host/SQLite regression journeys: mixed prepared/committed/unknown tool outcomes recover once; consumed quoted steering survives SIGKILL without duplicate echo or old-epoch replay. Run both with 1k and 100k background events, checking history digests and repeated recovery. npm run test:startup-correctness groups these with existing storage, tool, queue, background-task and Desktop contracts. Local benchmark drivers, databases and generated reports are excluded.

Verification

  • npm run build and npm run typecheck: passed on the updated base.
  • npm run check:release: 203 passed after making the correctness runner's test file paths explicit; all 7 groups and 36 file entries are unchanged.
  • Biome lint/format: all 3,726 tracked source/config files passed; untracked local benchmark artifacts were excluded. Staged ASF header, protocol and whitespace checks passed.
  • npx knip --workspace apps/desktop and npx knip --workspace packages/ui: passed.
  • npm run test:startup-correctness -- --skip-build: 546 passed, 0 failed/skipped, including both 100k journeys. SessionManager/Graph direct regression: 212 passed.
  • Three independent Electron launches on the updated base passed: memory status=ok, connection catalog available, KaTeX font loaded; error toast / renderer error / awaitReady error counts were 0 / 0 / 0 in every run. Each owned Host exited cleanly.
  • The mixed-state test fails if Client Capability recovery settlement is disabled (expected one unknown-outcome result, observed zero); the production implementation was restored before acceptance runs.
  • No UI layout change. Native startup acceptance uses actual font/memory/connection reads and error counts rather than a screenshot of an unchanged healthy screen. FakeBackend provides model output; SQLite, Host processes and UDS are real. Real provider networks, external tool side effects and cross-platform behavior are outside this local run.

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex implemented the simplification and font fix, authored the mixed-state tests and runner, ran validation, and prepared this submission at @testikun's request. @testikun is the human contributor of record; final review and merge remain with humans.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

Rebuild tool validation from the current transaction's local dependency
closure, removing the retained reducer cache and its consistency protocol.
Remove recovery profiling wrappers and keep fonts as local CSP-safe assets.
Add mixed tool/steering restart checks and a reusable correctness runner.

Refs apache#5613

Generated-by: OpenAI Codex
@github-actions github-actions Bot added the effort/XL Under 2500 readable lines label Sep 23, 2026
Keep the startup correctness file inventory visible to the release contract checker. Remove dynamic path construction without changing any selected test or group.

Generated-by: OpenAI Codex
Keep the self-contained correctness runner and generated-data regression tests in the PR. Retain the handoff document only as local validation material.

Generated-by: OpenAI Codex

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Under 2500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(startup): resolve startup issues and simplify runtime structure

1 participant