fix(seed): rules receipt reported two committed rulesets missing on a cold loaded start (e2e leg exit 1)
What
During the pre-push battery's e2e leg (a full wipe + --profile fault up, 2026-09-05 ~08:08Z, host load average ~15), the devstack seed exited 1 at its rules RECEIPT step:
georgia-authz-afcars_submission (1.1.0) — created (seed log line 17 — the FIRST georgia file)
...
georgia-placement-matching (v1.0) — created (line 74)
... all 123 fixtures reported "created" ...
ERROR: ruleset receipt failed — georgia-authz-afcars_submission=1.1.0 is not live in craig_rules (version hash side)
ERROR: ruleset receipt failed — georgia-placement-matching=v1.0 is not live in craig_rules (version hash side)
ERROR: rule sets did not converge (see warnings above) — NOT writing the rules marker.Only the (version hash side) check fired — the per-file CONTENT check (GET /v1/rules/sets/by-name/<name> canonical compare, run in the same receipt loop) did NOT fail for either name, so the API could read both rows while the direct psql -tA … SELECT name || '=' || version FROM rule_sets (devstack/seed/seed.sh:258) did not list them.
Post-mortem state (same stack, minutes later, via the API with an admin token): both rows exist, revision = 1, correct versions, created_at INSIDE the seed run (afcars 08:08:27.74Z, placement-matching 08:08:39.82Z; the neighbouring georgia-authz-case 08:08:29.29Z). The rules service logged slow statement … COMMIT … elapsed 1.415 s at 08:08:50Z. The seed ran exactly once in this stack (one "Obtaining admin token" line); set -e + pipefail are on, so the psql read did not fail — it returned rows that lacked exactly these two.
Why it matters
The receipt is the seed's fail-loud convergence gate (#1118 (closed) / #1556 (closed)). A false negative stops the whole devstack and fails the battery's e2e leg (ERROR: e2e tests failed (exit 1) → the push is refused) for a docs-only change. The create path (api/rule_set_claims.rs::create_rule_set_tx on the claim transaction, finish_create after commit) commits before answering 200, so a committed row should be visible to any later statement — the receipt's evidence is contradictory and needs diagnosability before it can be trusted either way.
Acceptance criteria
- The receipt logs, for each missing
(name, version), what the DB DID return for that name (SELECT name, version, active, revision, created_at FROM rule_sets WHERE name = $1) so a recurrence is diagnosable from the log line alone. - The receipt's version check reads through the SAME path the content check uses (the API by-name read, which is what the loader converged against), or re-reads the DB once after a bounded delay before declaring a miss — with the reason recorded in
seed.sh. - A regression test in
tools/craig-seed(or the xtask seed harness) that runs the receipt against a DB where a row is committed by a concurrent connection just before the receipt statement, proving the receipt sees it. -
docs/modules/ROOT/pages/known-issues.adoccarries the entry until the root cause is understood (cold loaded start; two of 123 rows; the rows were present and correct afterwards).
Context
- Battery run: push of
feature/1630-intake-assessment-plan-v13(docs-only, MR !1575 (closed)) at v25 (091e289a); the e2e leg's composeupattempt 1/5 stderr ends withservice "craig-seed" didn't complete successfully: exit 1. - Related: #1118 (closed) (receipt), #1556 (closed) (content compare), #1316 (closed) (the If-Match update leg), #1621 (closed) (fixture-jurisdiction receipt).
- Seed source:
devstack/seed/seed.sh:216-300; create route:services/craig-rules/src/api/rule_set_claims.rs.