Repository navigation
feat(cli): add kindling stats command - #153
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements C4 (
kindling stats) fromplans/execution/2026-06-22-conversion-surface-delivery.mdTask 1.4.SqliteKindlingStore::memory_stats(now)returnsMemoryStats(observations total/redacted/by kind/earliest and latest ts; capsules total/open/closed/by type; summaries; pins total/active/expired/by target). PlainCOUNT/MIN/MAXaggregates 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.KindlingService::stats()/stats_at(now)(the usual_atclock seam), with the stats types re-exported fromkindling-serviceso the planned TUI (C6) can reuse them without depending on the store.kindling stats [--db <path>] [--json]with a human-readable table and a camelCase--jsonshape (database,observations.byKind,capsules.byType,summaries,pins.byTarget, timestamps plus ISO dates).status. There is no daemon endpoint, so--via-daemondoes not reroute this verb (documented in the module docs andlib.rs).docs/architecture.mdsubcommand list.Testing
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)stats_counts_without_exposing_redacted_contentstats_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_sectionskindling demo --reset --db <tmp>thenkindling 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