Skip to content

feat(core): add a synthetic archive generator for demos and checks - #17

Merged
hsusul merged 2 commits into
mainfrom
p1-0-synth
Oct 26, 2026
Merged

hsusul merged 2 commits into
mainfrom
p1-0-synth

Conversation

@hsusul

@hsusul hsusul commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Why

Later P1 checks need a reproducible fake archive. No check should read real agent history.

What changed

  • Add crates/lore-core/examples/synth.rs. It takes <out_dir> <claude_count> <codex_count> <seed> and calls lore_core::synthetic::generate.
  • Add scripts/synth-archive.sh. It runs the example in release mode and passes the exit code through.
  • A missing or bad argument prints a one-line usage to stderr and exits 2.
  • The script keeps the caller's cwd, so a relative <out_dir> resolves where the caller is.

Scope

  • Two new files. No other file is touched. No Cargo.toml change was needed, because Cargo finds examples/ on its own.
  • lore_core::synthetic is unchanged.

Blast Radius

  • None at runtime. The example is not built by cargo build or shipped in the app.
  • cargo clippy --all-targets and cargo test now also compile the example.

Verification

  • scripts/synth-archive.sh /tmp/p1-0-a 30 20 7 printed /tmp/p1-0-a and claude 30 codex 20, exit 0.
  • A second run into /tmp/p1-0-b and diff -r /tmp/p1-0-a /tmp/p1-0-b printed nothing.
  • find counted 30 files under claude/projects and 20 under codex/sessions.
  • lorectl scan --archive /tmp/p1-0-arch with CLAUDE_CONFIG_DIR and CODEX_HOME set to the generated homes and LORE_ARCHIVE_DIR unset reported ingested 50 skipped 0 failed 0.
  • lorectl search health --archive /tmp/p1-0-arch returned hits (41 output lines).
  • Counts of 0 5 and 5 0 wrote only Codex files and only Claude files, exit 0.
  • No arguments, a missing seed, a non-numeric count, and an extra argument each printed the usage line and exited 2. The missing-seed run created nothing.
  • Into a directory holding other/note.txt and two unrelated .jsonl files, the generator left their SHA-1 sums unchanged and added 50 session files.
  • time scripts/synth-archive.sh /tmp/p1-0-big 3000 1000 7, three runs: 4.55 s, 8.43 s, 3.51 s. The median is 4.55 s against a 60 s budget. The output is 3000 and 1000 files, 16 MB.
  • cargo fmt --all -- --check passed.
  • cargo clippy -p lore-core -p lore-ipc -p lorectl --all-targets --all-features -- -D warnings passed.
  • cargo test -p lore-core synthetic passed 7 tests in the library target.

Not verified here:

  • lorectl mcp is not on main yet (PR 15), so the search_sessions check is not run.
  • main's CI "Rust core" job is red from an unrelated egress-sandbox issue that PR 16 fixes. This PR does not touch it.
  • /deslop and /no-comments are not installed here, so both were skipped.

Add a synth example and scripts/synth-archive.sh so every later check can run
on a reproducible fake Claude and Codex profile instead of real agent history.
@hsusul
hsusul merged commit a8cf643 into main Oct 26, 2026
5 checks passed
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.

1 participant