Skip to content

Load evidence in one pass, share turn building, add --json outputs - #8

Merged
Yanir-R merged 1 commit into
mainfrom
claude/project-thread-gzszoa
Nov 12, 2026
Merged

Yanir-R merged 1 commit into
mainfrom
claude/project-thread-gzszoa

Conversation

@Yanir-R

@Yanir-R Yanir-R commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Requested by Yanir

What changed

Findings from a code-quality pass over the whole repo (structure, duplication, state handling, efficiency, tests). The layering in docs/ARCHITECTURE.md held up; these are the concrete gaps:

  • Efficiency: Store.list() ran one evidence query per memory, and every personakit_read calls it. It now loads all evidence for the selection in one query. get() is unchanged.
  • Duplication: both source adapters built Turn objects the same way. That is now ingest.common.append_turn.
  • State: stats.collect queried the per-state counts twice; it now queries once.
  • Structured, deterministic output: sweep, list and stats accept --json and print one sorted-key JSON document, byte-for-byte repeatable. list --json carries no quotes (only a count).

Default (text) output is unchanged.

Why

Keep the store the single place that owns SQL, keep logic out of the CLI, and give scripts and tests a stable machine-readable surface instead of parsing text.

How to verify

python3 -m unittest discover -s tests -t . (90 tests). New tests: list and get return identical ordered evidence, and the three --json outputs parse, hold the expected fields and repeat identically.

Checklist

  • Every commit is signed off (git commit -s), see CONTRIBUTING.md (repository owner is exempt from the DCO check)
  • No personal data, real paths, hostnames or credentials in code, tests, fixtures or docs
  • Test fixtures use invented data only
  • No duplicated logic; the change respects the module boundaries in docs/ARCHITECTURE.md
  • Docs updated if behavior or privacy claims changed

Generated by Claude Code

@Yanir-R Yanir-R self-assigned this Nov 12, 2026
@Yanir-R
Yanir-R merged commit fcaa8e5 into main Nov 12, 2026
4 checks passed
@Yanir-R Yanir-R mentioned this pull request Nov 12, 2026
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants