Revision: 2 Last modified: 2026-12-04T20:58:46Z
Builds a real workable-items tracker (SQLite) inside a throw-away consumer-shaped
fixture project, for fastcycle tests that read <ROOT>/docs/workable_items.db.
The canon checkout ships no tracker DB, so the fastcycle suites that read one could not be
genuinely exercised. This helper creates a fixture project whose DB is produced by the
real engine (scripts/workable-items, built with go build) — no mocks (§11.4.289).
Only the history timestamps are then rewritten with sqlite3, so the scenario is
deterministic (the engine stamps "today"). The engine's own validate must still accept the
resulting DB; the helper fails if it does not.
goonPATH(builds the engine).sqlite3onPATH(seeds timestamps, reads the DB).
Both are the tests' required topology (§11.4.69). Their absence is reported by the caller as
hardware_not_present, never as a failure.
# fresh mktemp fixture; prints exactly one line: the absolute DB path
DB="$(tests/lib/make_fixture_tracker.sh)"
# explicit fixture directory (must not exist, or must be empty)
tests/lib/make_fixture_tracker.sh /tmp/my-fixture/pRun the suites through the fixture so their ROOT is the fixture (that is what makes
docs/workable_items.db resolve):
bash <FIXTURE_DIR>/constitution/scripts/fastcycle/tests/test_select_sample_r5_regression.shThe caller owns cleanup of <FIXTURE_DIR> (use a ${VAR:?}-guarded rm).
<FIXTURE_DIR>exists and is non-empty → exit 2.goorsqlite3missing → exit 2.- Engine build,
add,close, orvalidatefailure → exit 3. - The script prints the DB path on stdout only; all evidence goes to stderr.
- Symlinks
<FIXTURE_DIR>/constitution→ this checkout, so the tests resolve the canon through a consumer layout. - Builds
<FIXTURE_DIR>/bin/workable-itemsfromscripts/workable-items. - Seeds 17 items (
ATM-601..607, 700, 951..958, 960) viaadd+close, each with its ownevidence/<id>/ev.log, then rewriteson_date/created_atfor a deterministic scenario. - Seeds the bulk-import cluster:
ATM-810..819(Task), all closed on 2026-08-18 and sharing one evidence dirnameevidence/bulk/, of whichATM-819is additionally retroactive (Opened→closure gap 10 s). A cluster is identified by(dirname(evidence_path), closure on_date); ten distinct dirnames (as step 3 produces) give ten groups of size 1, so the cluster dimension would be unrepresentable. - Seeds two
Reopenedrows:ATM-954(2026-08-12,created_aton the same day) andATM-956(on_date 2026-08-10,created_at2026-06-01 — a different day, and outside the later windows). - Runs the engine's
validate; exits 3 if it rejects the DB.
Steps 4 and 5 exist for the S13 real-data control needle (CON-583). S13 asserts that two sample-selection alternatives each change at least one outcome on this corpus:
| Alternative | Needs the corpus to carry | Seeded by |
|---|---|---|
retroactive before bulk (precedence) |
an item that is both bulk and retroactive | step 4 (ATM-819) |
reopened window keyed on created_at |
a Reopened row whose created_at day differs from its on_date day, positioned so window membership flips |
step 5 (ATM-956) |
Both are seeded into the corpus rather than asserted away in the test, so S13 keeps its full strength.
tests/gates/test_fastcycle_real_db.sh— the gate that builds this fixture and asserts the fastcycle suites are genuinely exercised.scripts/fastcycle/tests/test_select_sample_r5_regression.sh— S13's real-data oracle pass.scripts/fastcycle/tests/test_reopen_rate_red.sh— the sibling suite; control needle #2.scripts/workable-items/— the real engine the fixture is built from.
2026-11-25 — bash tests/gates/test_fastcycle_real_db.sh → RESULT: PASS
(items=27, history=56, 12 ok / 0 NOT ok).