Files
Dragan Spiridonov e306b81caf feat(brain): add brain diff and brain search CLI commands
Closes the remaining actionable items in #332:

- C-10: `aqe brain diff <a> <b>` compares two brain exports.
  * Manifest-level always (version, checksum, per-table record counts,
    domain delta). Works for JSONL and RVF exports.
  * Record-level added/removed/changed IDs when both sides are JSONL.
    Append-only tables (witness_chain, qe_pattern_usage) report counts
    only — their dedup columns are identity.
  * Flags: --table <name>, --verbose, --json. Exit 0 when identical,
    1 on any difference.

- C-09: `aqe brain search -i <export>` runs offline filtered search.
  * Default table qe_patterns; `--table <name>` targets any of the 25.
  * Filters: --domain (repeatable), --pattern-type, --since, --until,
    --query (substring across name + description, case-insensitive),
    --limit (default 20), --json.
  * Returns {totalScanned, totalMatched, hits, truncated}. Exit 3 when
    no rows match (distinct from errors).

C-02, C-03, C-05, C-13 are won't-fix and documented on #332 at close.

Tests: 23 new unit tests covering identical/different exports, PK vs
append-only table semantics, domain deltas, combined filters, date
ranges, limits, and error paths.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 07:15:33 +00:00

8.2 KiB