Skip to content

Implement Milestone 1 operable-shell foundation - #1

Merged
TusanHomichi merged 2 commits into
mainfrom
claude/repo-setup-complete-y2qmmk
Aug 28, 2026
Merged

TusanHomichi merged 2 commits into
mainfrom
claude/repo-setup-complete-y2qmmk

Conversation

@TusanHomichi

@TusanHomichi TusanHomichi commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Turns the placeholder crate into the first working slice of the Milestone 1 operable shell, and pins the toolchain.

What's included

  • CLI: consolebook serve / doctor / backup, with --data-dir / CONSOLEBOOK_DATA_DIR (default ./data) and a local-only default bind of 127.0.0.1:7770.
  • Storage: every SQLite connection comes from one explicit options object; startup re-reads the PRAGMAs (foreign keys, WAL, synchronous NORMAL, 5s busy timeout) and fails closed if any invariant does not hold. Migrations are embedded and application-owned; migration 0001 creates the single-row instance identity table.
  • HTTP: Axum server with GET /api/health (database round trip, 503 when degraded) and graceful shutdown on SIGINT/SIGTERM.
  • doctor: read-only diagnostics — never creates the database, never migrates. Reports layout, pragma invariants, migration state, integrity_check, instance identity, and backup inventory; exits non-zero on failure.
  • Backups: consistent VACUUM INTO snapshots, validated by opening the snapshot as its own database and requiring a clean integrity check, then fsynced along with the directory. Snapshots that fail validation are deleted rather than left looking usable.
  • Logging: structured tracing without record content.
  • Toolchain: pinned to Rust 1.98 to match other ConaryLabs projects (edition 2024 was already set workspace-wide).

Docs

  • ADR 0003 records the connection-invariant and backup decisions promised as follow-up in ADR 0001.
  • README updated to describe the real commands instead of the placeholder.

Testing

  • 10 integration tests: invariant enforcement, identity stability across reopens, health ok/degraded, doctor pass/fail/no-side-effects, backup round trip and validation.
  • cargo fmt --check, cargo clippy --all-targets (pedantic, zero warnings), cargo test all clean on 1.98.
  • Smoke-tested the binary end to end: serve → health → doctor → backup → graceful SIGTERM shutdown.

Deliberately out of scope (next slices of Milestone 1)

First-run setup codes, administrator accounts and recovery, the embedded SvelteKit shell, and scheduled backup retention.

claude added 2 commits August 28, 2026 08:23
Turn the placeholder crate into the first working slice of the server:

- CLI with serve, doctor, and backup subcommands (--data-dir /
  CONSOLEBOOK_DATA_DIR, local bind by default)
- SQLite storage built from one explicit options object; startup verifies
  foreign keys, WAL, synchronous mode, and busy timeout and fails closed
- embedded application-owned migrations; migration 0001 creates the
  single-row instance identity table
- Axum HTTP API with GET /api/health (database round trip, 503 when
  degraded) and graceful shutdown on SIGINT/SIGTERM
- read-only doctor diagnostics: layout, pragmas, migration state,
  integrity check, identity, backup inventory
- validated backups: VACUUM INTO snapshot, integrity-checked as its own
  database, fsynced, deleted if validation fails
- structured logging without record content
- integration tests covering invariants, identity stability, health,
  doctor, and backup round trips
- ADR 0003 records the connection-invariant and backup decisions;
  README updated to describe the real commands

Still ahead in Milestone 1: first-run setup codes, administrator
accounts and recovery, the embedded SvelteKit shell, and scheduled
backup retention.
Match the toolchain used across ConaryLabs projects instead of floating
on whatever stable the build host has.
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.

2 participants