Skip to content

feat(core): implement Pattern-Key taxonomy and recurrence deduplication engine #39

Description

@harshsinghmp

Classification

actionable-feature

Context & Rationale

Currently, repeated agent errors, tool failures, and user corrections can lead to duplicate memory records. A structured two-level key taxonomy (area.symptom) allows deterministic grouping, deduping, and recurrence tracking.

Key Capabilities & Scope

  1. Two-Level Taxonomy (area.symptom):
    • Standardize areas: api, auth, build, config, deps, fs, net, runtime, shell, vcs, simplify, harden.
    • Symptoms must be generic (no hostnames, file paths, or versions): e.g. deps.module-not-found, runtime.type-error.
  2. Schema & Deduplication Engine:
    • Add columns to SQLite memory store: pattern_key TEXT, recurrence_count INTEGER DEFAULT 1, first_seen TEXT, last_seen TEXT.
    • Implement "fold-don't-duplicate" logic: on new capture, search by pattern_key; if found, increment count and refresh timestamp.

Verification Criteria

  • SQLite schema migration includes pattern_key and recurrence fields.
  • Capturing identical error keys increments recurrence_count rather than inserting duplicate records.
  • Passes test suite (bun test test/).

Activity

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions