Graduate crash-drill script, fix test snapshot-sequence pinning - #405
Merged
Conversation
Copies the production-verified crash_drill.sh (2026-07-23 DRILL-PASS) into scripts/ops/ and documents it in the resume-contract section of catalog-completion-plan.md. Also fixes the _preserve_shared_factory_sequences convention that broke test_views.py snapshots twice today: instead of every module using a shared factory protecting the one module that asserts on exact sequence-derived values, test_views.py now pins those factories to a fixed baseline per test, so its snapshots are self-determined regardless of suite composition or collection order. Removes the now-redundant per-module fixture + _SHARED_FACTORIES list from the other 31 test files. Full backend suite: 1829 passed, 4 skipped, 0 failed. Refs #153. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
5 tasks
4 tasks
WilfordGrimley
added a commit
that referenced
this pull request
Jul 24, 2026
…I onto Tokyo-11 PR #431 landed after the original sweep with its own hardcoded #302-derived literals (CardbackApplyPrompt.tsx, useCardbackReminderGate.tsx, PDFWaitPanel.tsx, SlotCardbackControl.tsx, plus a new DisplayPage.tsx line) - migrated onto var(--bs-*)/var(--theme-*) tokens the same way the rest of the sweep was, including simplifying the primary/info/success at-rest button text to use the token directly (Tokyo-11's action colours are light enough, unlike #302's, so the separate hand-picked tint literals aren't needed any more). CardbackPdfWaitFidelity.spec.ts's own literal assertions updated to match, comment-linked per row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
WilfordGrimley
added a commit
that referenced
this pull request
Jul 24, 2026
… Semi radius) (#438) * Re-theme site to Tokyo-11 (Tokyo Night base, orange action, purple accent, Semi radius) Owner-ruled palette swap (theme-options study, palette 11) on top of #425's token-layer pass: new colour/radius tokens in _theme-tokens.scss, Bootstrap variable + runtime var(--bs-*)/var(--theme-*) wiring in styles.scss (incl. the AAA button-ink flip and a WCAG/APCA audit fold-in: opaque accent focus ring, .btn-close/.fbtoggle target-size fixes, a lightened muted token), accent wiring across D14/chips/toggles/selection outlines, a sitewide sweep of hardcoded old-palette literals onto token references, and matching DisplayLeftRailFidelity.spec.ts updates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Merge master (#427/#405/#440), re-theme PR #431's cardback+PDF-wait UI onto Tokyo-11 PR #431 landed after the original sweep with its own hardcoded #302-derived literals (CardbackApplyPrompt.tsx, useCardbackReminderGate.tsx, PDFWaitPanel.tsx, SlotCardbackControl.tsx, plus a new DisplayPage.tsx line) - migrated onto var(--bs-*)/var(--theme-*) tokens the same way the rest of the sweep was, including simplifying the primary/info/success at-rest button text to use the token directly (Tokyo-11's action colours are light enough, unlike #302's, so the separate hand-picked tint literals aren't needed any more). CardbackPdfWaitFidelity.spec.ts's own literal assertions updated to match, comment-linked per row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Fix PagePreview.tsx CustomCardbackDot missed by #431 merge sweep Post-merge re-scan (coordinator's ask) caught one more #302-derived literal (#431's own PagePreview.tsx diff) - the flip-button custom-cardback indicator dot's warning colour wasn't yet routed to var(--bs-warning). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <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.
Description
Two owner-ordered hygiene items, bundled as one small PR:
Graduate the crash drill. Copies
crash_drill.sh(v5, byte-identical) from the orchestration repo into this repo atscripts/ops/crash_drill.sh— it passed in production 2026-07-23 (kill at 105/1000 committed,DRILL-PASS 2026-07-23T18:31:39Z). Documents it indocs/features/catalog-completion-plan.md's Stage E resume-contract section: the acceptance test now exists as a re-runnable script, and its one edit-point per run is the seeded cohort query. Refs Stage E: streaming assembly + resume contract + kill-test #153 (the drill-slice comment/close on that issue is not part of this PR — orchestrator handles issue state).Conftest hoist → sequence-pinning fix. The
_preserve_shared_factory_sequencescapture/restore convention (forgotten twice today, breakingtest_views.pysnapshots both times) turned out to protect the wrong side:test_views.pyis the only module in the suite whose snapshots (__snapshots__/test_views.ambr) embed afactory_boysequence-derived value (an autogenerated"Artist N"name, reached viabrainstorm_canonical_card's defaultCanonicalCardFactory/CanonicalArtistFactorySubFactory chain). Every other module using the same shared factories had to independently capture/restore its own use of them around itself sotest_views.py's hardcoded values stayed put — fragile, and forgotten 3 times now (seedocs/troubleshooting.md's retired entry for the history).Fix: push the pin to the one module that actually needs it.
test_views.pynow resets its shared factories to a fixed baseline (Factory.reset_sequence(0, force=True)) before every one of its own tests, via a new_pin_shared_factory_sequencesautouse fixture — self-determined regardless of suite composition, collection order, or how many other tests ran first. Removed the now-redundant per-module_preserve_shared_factory_sequencesfixture +_SHARED_FACTORIESlist (and the now-unusedcardpicker.tests.factoriesimports it required) from the other 31 test files that carried it, includingtest_views.py's own oldrequest.node.name-gated single-test-insulation variant, which is no longer needed.docs/troubleshooting.mdanddocs/lessons.mdrewritten in place to describe the new pattern (old entries kept as history, marked RETIRED). Added a Backend-table row + detail note todocs/upstreaming/extractable-primitives.mdand a Tier-1 ladder entry todocs/upstreaming/readiness-audit.mdfor the pattern itself (zero fork-only imports, applicable to anyfactory_boy+ snapshot-testing pairing) — per the docs' own upstreaming-ledger convention, judged honestly: it's a pattern-level primitive, not a file to lift (its current call site,test_views.py, asserts real fork-only fields elsewhere in the same file).Checklist
pre-commitand installed the hooks withpre-commit installbefore creating any commits. (pre-commit run --files <all touched>clean: ruff, isort, black, mypy, prettier all pass)test_views.ambrre-recorded via--snapshot-update, diff confirmed purely additive — the 6 changed keys are exactly the sequence-derived"Artist N"→"Artist 0"values, nothing else)pytest .fromMPCAutofill/, real Postgres/Elasticsearch via testcontainers on the host venv): 1829 passed, 4 skipped, 0 failed (verified twice, before and after the pre-commit auto-fix pass)pytest cardpicker/tests/test_views.py --snapshot-updatein isolation now produces byte-identical output to the full-suite--snapshot-updaterun (the old single-file-vs-full-suite divergence this fix retires)diff-verifiedscripts/ops/crash_drill.shis byte-identical to the orchestration repo's already-passed v5 copycatalog-completion-plan.md,troubleshooting.md,lessons.md,extractable-primitives.md,readiness-audit.md— all edited in place, no new files)Closes nothing; refs #153.