feat(sample-data): list-driven sample data generation for --test - #20
Merged
Xander-git merged 1 commit intoMay 30, 2026
Merged
Conversation
Replace the single hardcoded `--add-test-samples` equipment literal with a
declarative `SAMPLES` list expanded by a generator that seeds a full demo
tree (equipment -> projects -> runs). Every folder's metadata is written
through the real production producers (ReadmeGenerator, CreationWriter,
EquipmentCacheWriter) so it cannot drift from what the wizard writes.
- sample_data/{spec,generator,__init__}: Pydantic SAMPLES + generator +
generate_samples() facade with a guardrailed destructive wipe.
- controller/metadata_assembly: extract build_readme_context /
build_creation_json (+ moved helpers) shared by the controller and the
seeder; creation.py now delegates (behavior-preserving, parity-tested).
- config/test_bootstrap: shared write_starter_test_config /
bootstrap_test_config (light module; no pystray import) used by both the
tray flag and the new dev command.
- dev/seed: `python -m exlab_wizard.dev.seed` (always wipe + regenerate).
- tray/main: delete the inline TESTRIG literal; seed via the shared
bootstrap on first launch only (never wipes an existing sandbox).
Deterministic (fixed clock; README/creation.json/payload bytes identical
across runs; only equipment.json's writer-stamped timestamps differ).
Seeded equipment roots are base paths so run-walking (quiescence poller /
validator) discovers the tree. Destructive wipe is fenced to the -test
sandbox with strict-subpath containment. Full suite green (2362 passed,
3 skipped); ruff + mypy clean.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the single hardcoded
--add-test-samplesequipment literal with a list-driven sample-data generator. A declarativeSAMPLESlist (2 equipment / 3 projects / 7 runs) is expanded into a full on-disk demo tree under the-testsandbox, with every folder's metadata written through the real production producers (ReadmeGenerator,CreationWriter,EquipmentCacheWriter) so it can't drift from what the wizard writes.Design spec:
docs/superpowers/specs/2026-05-29-sample-data-generation-design.md.What changed
sample_data/—spec.py(PydanticSAMPLES),generator.py(SampleDataGenerator+generate_samples()facade + guardrailed destructive wipe),__init__.py.controller/metadata_assembly.py— extractedbuild_readme_context/build_creation_json(+ moved pure helpers) now shared by the controller and the seeder.controller/creation.pydelegates to them (behavior-preserving, guarded by parity tests).config/test_bootstrap.py— sharedwrite_starter_test_config/bootstrap_test_configin a light module (no pystray import), used by both the tray flag and the dev command.dev/seed.py—python -m exlab_wizard.dev.seed(always wipe + regenerate).tray/main.py— deletes the inlineTESTRIGliteral; seeds via the shared bootstrap on first launch only (never wipes an existing sandbox).Design notes
creation.json/payload bytes are byte-identical across runs. Onlyequipment.json's writer-stampedfirst_seen_at/last_modified_atdiffer (documented; excluded from the determinism assertions).EquipmentConfig.local_root/nas_rootare base roots so run-walking (orchestrator quiescence poller / validator, which composelocal_root / equipment.id) discovers the tree.-testsandbox (_app_name()ends in-test) with strict-subpath containment; only ever removeslocal_root/<prefixed_id>. Symlink-escape and out-of-sandbox cases are tested.SYNCED/BLOCKED_BY_VALIDATIONvalues are deliberate UI fixtures written intocreation.json; no run is actually verified or transferred.Test plan
uv run pytest tests/unit tests/integration --ignore=tests/integration/test_pyinstaller_smoke.py→ 2362 passed, 3 skipped (44 new tests: assembly parity, generator e2e, determinism, guardrails incl. symlink escape, base-root fidelity, dev command, tray no-op).ruff check/ruff format --check/mypyclean on all changed files.python -m exlab_wizard.dev.seedrun produces the expected tree (2 equipment, 3 projects, 7 runs, 10 metadata triples, 2equipment.json, 3test_runs.json, 1 scan-trigger payload) and is byte-deterministic across two runs.🤖 Generated with Claude Code