Skip to content

Feature: Close learning feedback loop #207

Description

@trevor-vaughan

Problem

The learning infrastructure is already in place — learning.go detects recurring findings and StoreLearning persists them to SQLite with embeddings and categories. The next step is to connect this stored knowledge back into the review workflow so that agents can reference prior findings and build institutional memory over time.

Proposed Solution

Modify the Guard and Adversary agents to query stored learnings during review. Add a "patterns from prior findings" section to agent context so reviewers can reference past issues and surface relevant patterns.

Alternatives

Instead of creating an additional memory engine, it may be beneficial to pull in one of the existing projects

Acceptance Criteria

  • Guard agent queries StoreLearning results during review
  • Adversary agent queries StoreLearning results during review
  • "Patterns from prior findings" section added to agent context
  • Measure and document repeat finding reduction rate
  • Stored learnings are queryable by category, severity, and recency

Activity

  1. jflowers commented on Jun 12, 2026

    @jflowers
    Contributor

    Thanks for filing this, Trevor — great observation that the learning infrastructure needed to be connected back into the review workflow.

    I did a thorough audit of the current codebase against each acceptance criterion, and the good news is that a significant portion of this work has already landed. Here's where things stand:

    What's Already Done

    1. Guard agent queries stored learnings during review — ✅ Complete
    The Guard agent now has a "Step 0: Prior Learnings" section that queries dewey_semantic_search with the file paths from the diff, includes relevant learnings as "Prior Knowledge" context, and gracefully degrades if Dewey is unavailable. Originally implemented via hivemind_find (Spec 019 FR-009/FR-010) and migrated to Dewey by Spec 022.

    2. Adversary agent queries stored learnings during review — ✅ Complete
    Identical implementation to the Guard — the Adversary also has Step 0 with dewey_semantic_search, surfacing recurring security findings and constraint violations.

    3. "Patterns from prior findings" section added to agent context — ✅ Substantially Complete
    All nine Divisor agents (Guard, Adversary, Architect, SRE, Testing, Curator, Herald, Envoy, Scribe) plus Cobalt-Crush have a standardized "Step 0: Prior Learnings" section. The terminology ended up as "Prior Learnings" / "Prior Knowledge" rather than "Patterns from prior findings," but the intent is fully addressed.

    What Remains

    4. Queryable by category, severity, and recency — ⚠️ Partially Done
    The data model design in Spec 021 supports tag-based category filtering and dewey_semantic_search_filtered with source_type/has_tag parameters. However:

    • Severity is not stored as a first-class attribute of learnings
    • The Go backend's LoadFeedback() returns everything unfiltered (no category/severity/recency parameters)
    • The upstream dewey_store_learning tool may still be pending (dewey#25)

    5. Measure and document repeat finding reduction rate — ❌ Not Started
    There is no metric tracking, comparison logic, or documentation for repeat finding reduction rates. The adjacent AnalyzeWorkflows() detects recurring patterns and analyzeVelocityPatterns() tracks iteration trends, but neither measures reduction rates specifically.

    Minor Housekeeping Note

    A couple of files still reference the deprecated hivemind_store/hivemind_find instead of the migrated dewey_* tools — specifically worker.md and learning-systems/SKILL.md. These were outside the scope of Spec 022's migration but should be updated.

    Recommendation

    Given the split, it might make sense to close this issue for criteria 1–3 (the core feedback loop is closed) and open focused follow-up issues for the remaining work:

    • Filtering support for learnings by category, severity, and recency (criterion 4)
    • Repeat finding reduction metrics and documentation (criterion 5)
    • Stale hivemind references cleanup

    Happy to help break those out if that sounds reasonable!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions