feat(digest): vouch digest — read-only operator briefing (#324)#351
feat(digest): vouch digest — read-only operator briefing (#324)#351dhgoal wants to merge 1 commit into
Conversation
fold four viewports over an existing .vouch/ into one glance so an operator returning after a day or a week sees where to spend attention before opening the review queue: - pending proposals awaiting review, oldest proposed_at first (the same set as kb.list_pending, rendered as an actionable list) - approvals/rejections in a --since window, read from the authoritative audit.log.jsonl and titled from the decided/ record - active claims aged past --stale-days (the exact metrics/lint predicate) - citation-coverage movement over the window read-only by construction: it composes metrics.compute and store reads and never routes through propose_*/approve/reject, so the review gate is untouched and there is nothing to approve. no new on-disk state, no schema migration. --format text|json|markdown; the json shape is a documented, stable to_dict() schema. defaults to a 7d window since a digest is inherently "since last look". ships cli-only; a kb.digest mcp method is deferred to keep this one concern per pr.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@dhgoal – Could you please attach a screenshot? I'd like to see how the digest command presents the claims. It doesn't need to be polished visually, but it should clearly display all the essential details, such as the session ID and the summary. And thanks for your first contribution |
closes #324.
vouch metricsanswers "is the review gate healthy?" with aggregate gauges.vouch digestis its human-facing counterpart: named, oldest-first lists of what to act on now, folded into one glance for an operator returning to a kb after a day or a week.it composes four viewports over an existing
.vouch/, all derived from files that already exist on disk:store.list_proposals(PENDING), oldestproposed_atfirst (the same set behindkb.list_pending), shown as an actionable list rather than the countmetrics.pending_nowgives.audit.log.jsonlviaaudit.read_events, reusing the_APPROVE_RE/_REJECT_REmatching inmetrics.pyand titled best-effort from thedecided/record.last_confirmed_at or updated_at or created_at) is older than--stale-days, the exact predicate inmetrics._fill_corpus_metrics/vouch lint, listed oldest first.nowis reused verbatim frommetrics.computeso the digest never disagrees withvouch metrics;at window startis that same coverage restricted to the cohort of claims that already existed at the--sincecutoff (evaluated against the current source/evidence set — it shows how coverage moved as newer claims landed, not a historical snapshot, since vouch retains no past citation state). unbounded window → no baseline → delta is null.review gate & scope
read-only by construction. it calls
list_*/read_eventsand formats; it never routes throughpropose_*/approve/reject, so the review gate is untouched and there is nothing to approve. no new on-disk state, no schema migration —storage.pystays pure i/o and the compose logic lives in a newsrc/vouch/digest.py.tests/test_digest.py::test_digest_writes_nothingsnapshots every file's mtime+size and asserts a digest run creates/modifies nothing.surface
--sincereusesmetrics.parse_sinceverbatim (duration / iso date /all) but defaults to7dsince a digest is inherently "since last look".--stale-daysmirrorsmetrics.DEFAULT_STALE_DAYS.--limitcaps each list (default 10) so the briefing stays a briefing.--format jsonis a documented, stableto_dict()schema;markdownis pasteable into a standup note.shipped cli-only on purpose — the issue makes
kb.digestconditional ("if exposed over mcp…"), and the four-site registration is a separate concern; keeping this pr to one concern per CONTRIBUTING.compute_digest()+Digest.to_dict()are already factored so a follow-up can wire the mcp method with no rework.what breaks for an existing
.vouch/nothing. purely additive; a new read-only command over files that are already committed.
tests
tests/test_digest.py(15 tests): oldest-first pending ordering,--limitcapping whiletotalstays full, decision window-filtering (a 100d-old approval excluded from a 7d window) and all-history, the stale predicate (retired claims exempt), the coverage delta (null when unbounded; movement when a new uncited claim lands after the cutoff), empty-kb rendering, the stableto_dict()schema, bad-input errors, and the cli text/json/markdown paths.make checkgreen (pytest, mypy, ruff).