mirror of
https://github.com/Dicklesworthstone/coding_agent_session_search.git
synced 2026-09-22 11:59:25 +08:00
9040a4d288
Adds tests/plans_view_contract.rs with 5 contract-level tests pinning the Plans-subview public surface in src/ui/analytics_charts.rs: - render_plans function presence - empty-state code path documented - navigation constants documented - fixture directory + README present - regenerate script present and well-formed Also ships: - scripts/tests/regenerate_plans_snapshots.sh: regen script that fails loudly when fixture DBs are missing (rather than producing stale snapshots). Set ALLOW_REGEN_WITHOUT_FIXTURES=1 to opt into regen with in-memory synthesized data. - tests/fixtures/analytics/README.md: documents the 3 required fixture DBs (plans_normal/sparse/empty) and the generation steps. Note: the bead's 6 .snap files (cassapp_plans_compact_normal.snap etc) require committed fixture DBs which require frankensqlite-driven seeding. The fixture-generation pipeline is a follow-up bead; this PR ships the regen tooling + contract guards so the snapshots can land safely once the fixtures are seeded.
Analytics test fixtures
Per coding_agent_session_search-vz9t8.3. This directory holds frankensqlite
database files used by the Plans-subview snapshot tests.
Required fixtures
| File | Purpose |
|---|---|
plans_normal.db |
10 distinct plans, 1000 token rows, even distribution |
plans_sparse.db |
1 plan, 5 token rows |
plans_empty.db |
0 plans, 0 token rows (empty-state path) |
Generation
The fixture DBs are not committed because they require the live cass binary
to seed via cass index --full against synthetic session data. Generation
scripts and committed artifacts are tracked as a follow-up bead.
Regeneration of the snapshot files
Once the fixture DBs are present, regenerate the .snap files via:
ALLOW_REGEN_WITHOUT_FIXTURES=1 \
bash scripts/tests/regenerate_plans_snapshots.sh
The ALLOW_REGEN_WITHOUT_FIXTURES=1 guard exists so the script doesn't
silently produce stale snapshots when fixtures are missing.