Skip to content

CI baseline cleanup: tesseract install, named skips, retire tolerance rule - #135

Merged
WilfordGrimley merged 2 commits into
masterfrom
ci-baseline-cleanup
Jul 19, 2026
Merged

CI baseline cleanup: tesseract install, named skips, retire tolerance rule#135
WilfordGrimley merged 2 commits into
masterfrom
ci-baseline-cleanup

Conversation

@WilfordGrimley

Copy link
Copy Markdown

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:

  1. Tesseract missing (10 failures): .github/actions/test-backend/action.yml now installs tesseract-ocr tesseract-ocr-eng before running tests, matching docker/django/Dockerfile's own install. CI now actually exercises OCR code instead of every touching test needing to be mocked/skipped.
  2. Moxfield x2 (assert None): diagnosed as a missing MOXFIELD_SECRET repo secret in this fork's CI (not a code bug, not external-service flakiness) - Moxfield gets silently excluded from get_import_sites(), so the query falls through to None. Fixed with a named pytest.mark.skipif(not settings.MOXFIELD_SECRET, reason=...) on just those two parametrized cases.
  3. Sources/OpenSSL x2 (JSONDecodeError in CI / AttributeError locally, same root cause different failure point): both need real, working Google Drive credentials this fork's CI doesn't have (no GOOGLE_DRIVE_API_KEY secret) and a local dev venv may not have either (drifted pyOpenSSL). Added google_drive_credentials_available() to conftest.py - a real capability probe (checks OpenSSL.crypto.sign exists 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.md and CLAUDE.md updated: 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 failures
  • pre-commit clean (ruff/isort/black/mypy/prettier)
  • CI itself (tesseract-ocr install can only be verified by actually running in the CI environment - local host already has tesseract, so this specific fix's necessity isn't visible in the local run above)

Claude-Session: https://claude.ai/code/session_016i9S7LQsCL3FGaih3ZTRBJ

… 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
WilfordGrimley marked this pull request as ready for review July 19, 2026 17:00
@WilfordGrimley
WilfordGrimley merged commit 6c6ea19 into master Jul 19, 2026
6 checks passed
@WilfordGrimley
WilfordGrimley deleted the ci-baseline-cleanup branch July 19, 2026 17:01
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant