Skip to content

Tests: SIL harness — the real app through Lightroom workflows and a seeded monkey - #25

Merged
emmertex merged 3 commits into
mainfrom
sil-harness
Oct 13, 2026
Merged

emmertex merged 3 commits into
mainfrom
sil-harness

Conversation

@emmertex

Copy link
Copy Markdown
Owner

Adds a software-in-the-loop harness. It drives the real app (<cli> snapshot --library DIR --script -: the desktop UI, engine and catalog running headless on a library on disk) through Lightroom Classic workflows and checks invariants after every step, never exact outputs. Docs: docs/testing-sil.md.

  • --script - streams control requests from stdin, so a driver can hold a conversation with a headless session.
  • Scenarios: sil_workflow (import → cull/filters → Auto/sliders/WB picker/crop/mask/preset → copy/paste + Synchronize → virtual copy + history → albums + smart collection → keywords/metadata → export JPEG/TIFF/Original+Settings → XMP write/read back → print → reopen), sil_raw_workflow (corpus raws; skipped without them), and sil_monkey (seeded random actions, ~8 % hostile, with periodic reopens).
  • Invariants: the process stays alive and answers within 180 s, exits cleanly on EOF with no panic, errors are clean, the selection and view counts are consistent, undo+redo restores the state, reopen keeps everything, exports exist and decode, the XMP round trip is lossless, and the activity stack drains.
  • On failure: the invariant, the last steps, report.txt, a replay.jsonl that <cli> snapshot can replay, and the monkey seed.
  • cargo xtask sil [workflow|raw|monkey] [--seed N] [--steps N]. It also runs under cargo test --workspace. The whole suite takes about 4–7 s once built.

Bugs found and fixed:

  • Undoing an import or a virtual copy left the vanished photos in the selection (24 monkey seeds out of 24 hit it at 400 steps). Regression test: undo_never_leaves_vanished_photos_selected.
  • ui.dialog.confirm / ui.dialog.cancel ignored Read / Save Metadata's overwrite question ({confirm: "dialog"}), so control and MCP clients could not answer it. The workflow scenario covers this.

After the fixes, 32 seeds × 400 steps all pass.

🤖 Generated with Claude Code

…kflows and a seeded monkey

`<cli> snapshot --script -` answers control requests from stdin as they arrive. apps/cli/tests/sil.rs
runs the real app (UI, engine, catalog, files on disk) through import, cull, develop, sync, versions,
collections, metadata, export, the XMP round trip and reopen. It also runs a seeded random monkey
with some hostile arguments. After every step it checks invariants: the app is alive and answers,
errors are clean, the library is consistent, undo then redo returns to the same state, reopening
keeps everything, exports decode, and the activity stack drains. `cargo xtask sil` runs it, and
docs/testing-sil.md documents it.

Bugs it found:
- Undoing a step that created photos (an import, a virtual copy) left them in the selection.
- ui.dialog.confirm / cancel ignored Read / Save Metadata's overwrite question, so agents could not
  answer it.

Sources: own design.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@emmertex
emmertex enabled auto-merge October 13, 2026 06:50
emmertex and others added 2 commits October 13, 2026 18:02
… (the web build has no such catalog dialog), so the wasm build compiles

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@emmertex
emmertex merged commit ac0135b into main Oct 13, 2026
7 of 8 checks passed
@emmertex
emmertex deleted the sil-harness branch October 13, 2026 07:35
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