Skip to content

feat(cli): add kindling stats command - #153

Merged
joshuaboys merged 1 commit into
mainfrom
feat/cli-stats
Oct 20, 2026
Merged

joshuaboys merged 1 commit into
mainfrom
feat/cli-stats

Conversation

@joshuaboys

Copy link
Copy Markdown
Contributor

Summary

Implements C4 (kindling stats) from plans/execution/2026-06-22-conversion-surface-delivery.md Task 1.4.

  • Store: SqliteKindlingStore::memory_stats(now) returns MemoryStats (observations total/redacted/by kind/earliest and latest ts; capsules total/open/closed/by type; summaries; pins total/active/expired/by target). Plain COUNT/MIN/MAX aggregates over metadata columns only, so no content (redacted or otherwise) is read. Breakdowns are zero-filled in declaration order, so the output is deterministic. No schema change.
  • Service: KindlingService::stats() / stats_at(now) (the usual _at clock seam), with the stats types re-exported from kindling-service so the planned TUI (C6) can reuse them without depending on the store.
  • CLI: new kindling stats [--db <path>] [--json] with a human-readable table and a camelCase --json shape (database, observations.byKind, capsules.byType, summaries, pins.byTarget, timestamps plus ISO dates).
  • Daemon: in-process only, the same as status. There is no daemon endpoint, so --via-daemon does not reroute this verb (documented in the module docs and lib.rs).
  • Docs: README CLI reference, crate README and docs/architecture.md subcommand list.

Testing

  • Store: memory_stats_empty_database_is_zero_filled, memory_stats_counts_by_kind_capsules_and_pins (covers redaction, capsule types, and the pin active/expired split moving with the clock)
  • Service: stats_counts_without_exposing_redacted_content
  • CLI: stats_json_on_empty_database_is_zero_filled, stats_json_counts_kinds_capsules_pins_and_latest_ts (checks redacted content is absent and that two runs give identical output), stats_text_output_has_table_sections
  • Manual: kindling demo --reset --db <tmp> then kindling stats --db <tmp> [--json]
  • cargo fmt --all -- --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test: all green locally

🤖 Generated with Claude Code

Adds a read-only `kindling stats` verb reporting observation counts
by kind, capsule counts by status and type, summaries, pins (active vs
expired) and the observation activity range, as a text table or --json.

The aggregation lives in the store (memory_stats) and is exposed via
KindlingService::stats so the planned TUI (C6) can reuse it. It reads
metadata columns only, so redacted content cannot leak. In-process
only, like status; no daemon endpoint is added.
@joshuaboys
joshuaboys merged commit 7c67f31 into main Oct 20, 2026
26 checks passed
@joshuaboys
joshuaboys deleted the feat/cli-stats branch October 20, 2026 16:27
joshuaboys added a commit that referenced this pull request Oct 20, 2026
Mark C1, C2 and C4 merged (PRs #152, #155, #153), C3 in review
(#154), and PUBDIR-001/002 in review as draft PR #151. Log ISS-004
for daemons leaked by the thin-client and adapter test suites.
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