CI baseline cleanup: tesseract install, named skips, retire tolerance rule - #135
Merged
Conversation
… rule Backend tests can now show genuinely green. Installs tesseract-ocr in CI (matching the Dockerfile), and replaces the moxfield/Google-Drive "known failure" tolerance with real pytest.mark.skipif + named reasons gated on an actual capability probe. Retires the "known 14-failure baseline" judgment rule in docs/lessons.md and CLAUDE.md - from now on a red Backend-tests check means something real. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016i9S7LQsCL3FGaih3ZTRBJ
CI's first real run caught this - ModuleNotFoundError crashed test collection outright, since OpenSSL isn't installed there (the CI failure path never needs it, unlike the local dev venv where it's present transitively). Wrap the import itself in the capability probe. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016i9S7LQsCL3FGaih3ZTRBJ
WilfordGrimley
marked this pull request as ready for review
July 19, 2026 17:00
4 tasks
WilfordGrimley
added a commit
that referenced
this pull request
Jul 19, 2026
…E_API_KEY rotation didn't clear the CI skip CORR-0009: a directive claimed PR #136/#137 were merged via UI when they weren't (conflated with two unrelated credential rotations) -- caught by gh api verification before any branch deletion or downstream claim, zero actual damage. docs/lessons.md: rotating GOOGLE_DRIVE_API_KEY alone didn't clear the 4-skipped baseline on a fresh re-run -- likely still blocked on pyOpenSSL not being installed in the CI runner (per #135's own commit note), not conclusively fixed by the rotation alone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d
WilfordGrimley
added a commit
that referenced
this pull request
Jul 19, 2026
…tions ledger, docs manifest (#136) * Phase 1/2 orchestration groundwork: guard hook, SessionStart context, worker roster Adds a committed .claude/settings.json wiring two hooks: guard_master.py (PreToolUse) blocks gh pr merge / git merge into master unconditionally, and git push to master only from worker worktree checkouts, leaving the interactive main-checkout push-to-master convention untouched; and session_context.sh (SessionStart) injects live branch/CI/PR state, using the correct fork-vs-upstream repo slug and the Checks API (not the legacy Status API, which silently hides Actions failures). Adds four scrubbed, public worker agent definitions (.claude/agents/worker-{backend,frontend,docs,upstream}.md) and a tiered report schema mirror (docs/reports/schema.json) for the six-field standing report format. Carves committed exceptions into .gitignore's blanket /.claude/ ignore so these files are actually trackable. Documents the branch-protection trade-off (real backstop vs. workflow cost) in docs/infrastructure.md without applying it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d * Fix guard_master.py stub-logging path leak; add corrections ledger, docs manifest, lessons triage ritual guard_master.py fixes: exempt git merge --ff-only from the unconditional git-merge-into-master block (a fast-forward sync isn't an authorization decision); fix log_stub() resolving repo root from the script's own on-disk path instead of cwd, which was writing real ledger entries from test-fixture invocations. Adds corrections/ (blameless CORR-NNNN ledger, seeded with 7 verified incidents from this week's real history), docs/MANIFEST.md (routing table: path/purpose/governs-what/authority), and a lessons-to-gates triage ritual documented in docs/lessons.md. Broadens CLAUDE.md's gh-CLI upstream-parent-resolution note to cover list/view, not just create/merge. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d * Add CORR-0008 (ramp-probe serialized latency) + report-as-evidence ledger rule Establishes that a corrections entry may cite a report instead of a commit SHA when no discrete commit exists for the fix (owner decision). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d * Add CORR-0009 (planner asserted unconfirmed merges); note GOOGLE_DRIVE_API_KEY rotation didn't clear the CI skip CORR-0009: a directive claimed PR #136/#137 were merged via UI when they weren't (conflated with two unrelated credential rotations) -- caught by gh api verification before any branch deletion or downstream claim, zero actual damage. docs/lessons.md: rotating GOOGLE_DRIVE_API_KEY alone didn't clear the 4-skipped baseline on a fresh re-run -- likely still blocked on pyOpenSSL not being installed in the CI runner (per #135's own commit note), not conclusively fixed by the rotation alone. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wio5Yq81k96aHjSJMFB62d --------- Co-authored-by: Claude Sonnet 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.
Summary
Owner directive, promoted to orchestration prerequisite: the merge-on-green auto-mode classifier can't function while a known-red CI baseline is treated as normal. Three fixes, one PR:
.github/actions/test-backend/action.ymlnow installstesseract-ocr tesseract-ocr-engbefore running tests, matchingdocker/django/Dockerfile's own install. CI now actually exercises OCR code instead of every touching test needing to be mocked/skipped.assert None): diagnosed as a missingMOXFIELD_SECRETrepo secret in this fork's CI (not a code bug, not external-service flakiness) -Moxfieldgets silently excluded fromget_import_sites(), so the query falls through toNone. Fixed with a namedpytest.mark.skipif(not settings.MOXFIELD_SECRET, reason=...)on just those two parametrized cases.JSONDecodeErrorin CI /AttributeErrorlocally, same root cause different failure point): both need real, working Google Drive credentials this fork's CI doesn't have (noGOOGLE_DRIVE_API_KEYsecret) and a local dev venv may not have either (drifted pyOpenSSL). Addedgoogle_drive_credentials_available()toconftest.py- a real capability probe (checksOpenSSL.crypto.signexists AND real credential construction succeeds) - and gated both tests on it with a named skip reason.Also retires the "known 14-failure baseline" judgment rule that every session was expected to apply by memorizing exact test names/exception types -
docs/lessons.mdandCLAUDE.mdupdated: from now on, a red Backend-tests check means something real.Test plan
pytest cardpicker/from the host venv: 979 passed, 0 failed, 4 skipped (the 4 skips carry real named reasons, verified individually) - genuinely clean baseline, not just fewer failuresClaude-Session: https://claude.ai/code/session_016i9S7LQsCL3FGaih3ZTRBJ