Skip to content

Maintenance pass: log retention, dependency refresh, typecheck + CI#18

Merged
cahaseler merged 3 commits into
mainfrom
claude/admiral-maintenance-roadmap-gpq5cp
Jul 1, 2026
Merged

Maintenance pass: log retention, dependency refresh, typecheck + CI#18
cahaseler merged 3 commits into
mainfrom
claude/admiral-maintenance-roadmap-gpq5cp

Conversation

@cahaseler

Copy link
Copy Markdown
Contributor

Summary

Admiral hadn't had a real maintenance pass in a while (last release published Feb 27; last two commits on main were April 22 and June 27). This does the quick, high-value cleanup identified from a fresh audit against the current gameserver API and admiral's own open issues:

  • fix: prune old log entries to stop unbounded admiral.db growth β€” log_entries had no retention policy, only a manual per-profile "clear log" route. A long-running agent logs every LLM call/tool call/response forever (reported: 18GB db in admiral.db grows very quickly to multiple GBsΒ #5). Caps each profile to its most recent 20,000 entries, trimmed opportunistically every ~200 inserts. Verified manually: 21,000 inserts β†’ exactly the newest 20,000 rows remain.
  • chore: bump @mariozechner/pi-ai to 0.73.1 β€” was pinned to "latest" but the lockfile had it stuck at 0.55.1 (18 minor versions behind), so the model picker was missing every Claude model newer than opus-4-6/sonnet-4-6. Pinned to a real caret range instead of "latest" so future bumps are deliberate. This pulled in the Mistral SDK, which has an optional @opentelemetry/api peer import that bun build --compile resolves statically regardless of the "optional" flag β€” added it as an explicit dependency so the production build doesn't break.
  • chore: add @types/bun, fix tsc errors, add PR CI β€” tsc --noEmit failed out of the box on a fresh clone (no @types/bun, so bun:sqlite/bun:test/ImportMeta.dir didn't resolve), and there was no CI beyond the tag-triggered release build β€” nothing would have caught the @opentelemetry/api build break above before it hit a tagged release. Added @types/bun, fixed the several real unknown-typed resp.json() results it uncovered plus a couple of other latent typing bugs, added typecheck/test package.json scripts, and added .github/workflows/ci.yml running typecheck + test + build on every PR.

Also as part of this pass (already landed on main directly, included here for context):

Technical Approach

See commit messages for detail on each change; each commit is independently reviewable.

Test Plan

  • bun test β€” 15/15 passing
  • bun run typecheck β€” clean (root + frontend)
  • bun run build β€” production binary builds and the frontend bundles successfully
  • Manually verified log-entry trimming behavior against a scratch SQLite db (21k inserts β†’ 20k rows retained, newest kept)

Generated by Claude Code

claude added 3 commits July 1, 2026 13:04
log_entries had no retention policy, only a manual per-profile clear
route, so a long-running agent logs every LLM call/tool call/response
forever (reported: 18GB db). Cap each profile to its most recent
20,000 entries, trimmed opportunistically every ~200 inserts.

Closes #5
Was pinned to "latest" but locked at 0.55.1 (18 minor versions
behind) β€” model picker was missing every Claude model newer than
opus-4-6/sonnet-4-6. Pin to a real caret range instead of "latest"
so upgrades are deliberate.

Also adds @opentelemetry/api as an explicit dependency: pi-ai 0.73.1
pulls in the Mistral SDK, which has an optional peer import on it
that bun's --compile bundler resolves statically regardless of the
"optional" peerDependenciesMeta flag, breaking the production build
without it.
The project had no @types/bun devDependency and no CI beyond the
tag-triggered release build, so `tsc --noEmit` failed out of the box
on a fresh clone (bun:sqlite/bun:test/ImportMeta.dir unresolved) and
nothing caught type or build regressions on PRs. This bumping pi-ai
just now silently broke `bun build --compile` (missing optional
@opentelemetry/api peer dep) with no CI to catch it.

- Add @types/bun so tsc resolves Bun's runtime APIs
- Fix real type-safety gaps this uncovered: several `resp.json()`
  results flowing as unknown into typed code (http.ts, http_v2.ts,
  mcp.ts, schema.ts, routes/models.ts), a bogus type cast in
  agent-manager.ts's slimGameState, an untyped SQLite bindings spread
  in db.ts, and a nonexistent `comment` field on hono's SSEMessage
  (routes/logs.ts) that TS silently let through as an unused,
  no-op property
- Add `typecheck`/`test` package.json scripts
- Add .github/workflows/ci.yml: typecheck + test + build on every PR
@cahaseler cahaseler merged commit 7b7fd52 into main Jul 1, 2026
1 check passed
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.

view_storage maps to faction storage endpoint instead of personal storage

2 participants