Skip to content

feat: lessons as a typed artifact with follow-through tracking (#428)#472

Open
Tet-9 wants to merge 1 commit into
vouchdev:testfrom
Tet-9:feat/428-lessons-follow-through
Open

feat: lessons as a typed artifact with follow-through tracking (#428)#472
Tet-9 wants to merge 1 commit into
vouchdev:testfrom
Tet-9:feat/428-lessons-follow-through

Conversation

@Tet-9

@Tet-9 Tet-9 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #428

What's included
ClaimType.LESSON — resurfaces through the normal retrieval path like any claim, no special-casing
kb.mark_lesson_followed(claim_id, followed, context?) — append-only observation appended to audit.log.jsonl as a lesson.followed event; never edits the claim's text/status/any field
Registered across all four surfaces: CLI (vouch mark-lesson-followed), MCP tool, JSONL handler, capabilities.METHODS, and the _STANDARD tool profile
Repeat guard: no new code needed — propose_claim already runs find_similar_on_propose (#147) for every claim type, so proposing a near-duplicate lesson already surfaces a non-blocking similar_approved/similar_pending warning
Deliberately out of scope
The issue names an "effectiveness computation" system (cross-referenced as #2) as a downstream consumer of these events. That reference resolves to an unrelated PR, and no such system exists anywhere in this codebase under any name (verified via grep across src/vouch/). Rather than invent an unspecified analytics/scoring system, this PR ships events shaped for such a consumer (followed, context, claim_type fields) without building the consumer itself.
Design note
mark_lesson_followed isn't restricted to ClaimType.LESSON — it accepts any claim id, matching the issue's own proposed surface ("either a new ClaimType.LESSON or a flag on workflow/warning claims"). Covered by a dedicated test.

Testing

tests/test_lessons.py: 13 tests — claim type, retrieval resurfacing, observe-not-edit invariant, repeated observations, missing-claim error, not-restricted-to-LESSON, registration across capabilities/JSONL/MCP, and the repeat-guard warning
Full suite: ruff check / mypy clean, existing test_capabilities.py and similarity-warning tests (test_propose_similarity.py) unaffected
CHANGELOG.md updated under [Unreleased]

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 07eaf3f3-3c27-4968-ae3a-d27c092eb0a7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added docs documentation, specs, examples, and repo guidance cli command line interface mcp mcp, jsonl, and http surfaces storage kb storage, migrations, schemas, and proposals tests tests and fixtures size: XL 1000 or more changed non-doc lines labels Jul 13, 2026
@Tet-9 Tet-9 force-pushed the feat/428-lessons-follow-through branch from 2d075f3 to f1b51cc Compare July 13, 2026 19:31
@Tet-9

Tet-9 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@plind-junior , on for review

…dev#428)

Adds ClaimType.LESSON and kb.mark_lesson_followed -- an append-only
observation of whether a surfaced lesson was actually followed in a given
turn. Never edits the claim; appends a lesson.followed audit event with
followed, optional context, and claim_type.

Registered across all four surfaces: CLI (mark-lesson-followed), MCP
(kb_mark_lesson_followed), JSONL (kb.mark_lesson_followed), and
capabilities.METHODS. Added to the _STANDARD MCP tool profile alongside
kb.confirm, its closest existing analogue.

Lessons resurface through the normal retrieval path with no special-casing
anywhere in context.py -- verified directly, not assumed. The propose-time
repeat guard (vouchdev#147) comes for free: propose_claim already runs
find_similar_on_propose for every claim type regardless, so no new code was
needed for that acceptance criterion.

Not restricted to ClaimType.LESSON: mark_lesson_followed accepts any claim
id, matching the issue's own proposed surface ("either a new ClaimType.LESSON
or a flag on workflow/warning claims").

Deliberately does not build the "effectiveness computation" system vouchdev#428
names as a downstream consumer (vouchdev#2) -- that reference resolves to an
unrelated PR and no such system exists anywhere in this codebase under any
name (verified via grep). These events are shaped for such a consumer to
exist later; inventing an unspecified analytics system was out of scope.

tests/test_lessons.py: 13 tests covering the claim type, retrieval
resurfacing, the observe-not-edit invariant, multiple observations, missing-
claim handling, the not-restricted-to-LESSON case, registration in
capabilities/JSONL/MCP, and the repeat-guard warning.
@Tet-9 Tet-9 force-pushed the feat/428-lessons-follow-through branch from f1b51cc to 3094bcf Compare July 14, 2026 03:05
@github-actions github-actions Bot added retrieval context, search, synthesis, and evaluation schemas json schemas and generated schema assets labels Jul 14, 2026
@Tet-9

Tet-9 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@plind-junior , if you may review this now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli command line interface docs documentation, specs, examples, and repo guidance mcp mcp, jsonl, and http surfaces retrieval context, search, synthesis, and evaluation schemas json schemas and generated schema assets size: XL 1000 or more changed non-doc lines storage kb storage, migrations, schemas, and proposals tests tests and fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant