feat(capture): correction-capture — auto-propose a draft claim when the user pushes back (#430)#458
Conversation
detect a user correction ("no, we deploy from main not release") on the
UserPromptSubmit turn with a cheap no-llm heuristic and file it as a
PENDING claim proposal quoting the correction, tagged auto:correction
and citing the correction message as evidence.
proposes, never approves — there is no code path to proposals.approve,
so the pending queue is the draft state a human still drains. near-
duplicate corrections are suppressed via the vouchdev#147 similarity path plus a
cheap exact-repeat check, and capture.correction.per_session_cap
(default 3) bounds an over-eager heuristic.
driven by a new `vouch capture correction` subcommand wired into the
claude-code UserPromptSubmit hook; config capture.correction.{enabled,
per_session_cap} with defaults in the starter config. tests in
tests/test_capture_correction.py assert the propose-only invariant, the
cap, dedup, and config gating.
closes vouchdev#430
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
✨ 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 |
what changed
correction-capture: when the user pushes back on the agent ("no, we deploy from
mainnotrelease"), that correction now becomes a PENDING claim proposal for review instead of evaporating. a newUserPromptSubmithook (vouch capture correction) runs a cheap, no-llm heuristic on the turn — a pushback opener (no,/actually,/that's wrong…) or a corrective phrase — and, when it fires, files one draft claim quoting the correction, taggedauto:correction, citing the correction message as a content-addressedmessagesource for evidence. core logic lives in the newsrc/vouch/correction.py; it's wired into the claude-code adapter'sUserPromptSubmithook alongside the existing context-hook.why
capture.observeharvests tool outcomes passively, but the single highest-signal event in a session — the user correcting the agent — is invisible to it and is the knowledge most reliably lost. this turns that moment into a reviewable draft, automatically, without ever writing approved knowledge. closes #430.proof
captured from the shipped cli against a fresh kb. a correction files a draft by
auto:correction; a normal instruction is ignored; an exact repeat is deduped; the per-session cap (default 3) bounds the rest — and nothing crosses into approved claims:vouch list-claimsstill shows only the starter claim — nothing auto-proposed reached the approved store.what might break
kb.*method, no object-model / on-disk / bundle / audit change. this is a CLI capture subcommand (the sibling ofvouch capture observe) plus a hook line — the same shape as the existing ambient capture, which is also CLI+hook, not akb.*method.capture.correction(nested under the existingcaptureblock);enableddefaults true,per_session_capdefaults 3. added to the starter config so new KBs carry the default explicitly; existing KBs pick up the defaults defensively (absent key → default). opt out withcapture.correction.enabled: false.UserPromptSubmithook gains avouch capture correction || trueentry. the hook prints nothing and exits 0 on any error, so it can never block the user's turn.proposals.approve(a structural test asserts it imports/calls noapprove), routes exclusively throughproposals.propose_claim, and can only create pending drafts.vep
not a surface change — no
kb.*method, no object-model/on-disk/bundle/audit/transport change, and the newcapture.correctionconfig is additive with safe defaults. perproposals/README.mdthis is day-to-day code (a new capture path composed from existingpropose_claim), so no vep. flagging for the record in case a maintainer reads the config addition differently.tests
make checkpasses locally (lint + mypy + pytest) — pytest 1101 passed / 29 skipped, mypy clean (90 files), ruff clean. run with the[dev,web]extras to match ci.tests/test_capture_correction.py(21 cases): the propose-only invariant (pending claim filed, nothing approved) and a structural no-approveguard, the per-session cap (and that it's per-session), exact-repeat dedup, thecapture.correction.enabledgate + config overrides, and the detection heuristic (positive/negative/marker-stripping).CHANGELOG.mdupdated under## [Unreleased].