Skip to content

fix: coverage-diff sources ci.env; stamped refs kept in lockstep - #17

Merged
craigmbooth merged 1 commit into
mainfrom
fix/coverage-diff-ci-env-and-ref-lockstep
Aug 4, 2026
Merged

fix: coverage-diff sources ci.env; stamped refs kept in lockstep#17
craigmbooth merged 1 commit into
mainfrom
fix/coverage-diff-ci-env-and-ref-lockstep

Conversation

@craigmbooth

Copy link
Copy Markdown
Collaborator

Two bugs in the same place — the local mirror not actually mirroring — both surfaced while bumping intendent to v3.0.0.

1. coverage-diff didn't source .colormath/ci.env

CI's diff-coverage gate sources it before pytest (gates.yml:60). The local mirror of that same gate did not. So a consumer whose app needs test configuration to import at all — a session secret, a provider key — gets a green gate in CI and a collection error locally, from the same commit.

make preflight is only worth running if it runs what CI runs. Fixed with the identical if [ -f … ]; then set -a; . …; set +a; fi form the CI step uses, so the two are literally the same idiom.

Scope honesty: this closes the half colormath owns, and only that half. Whether the app also reads a local .env is the consumer's business — a .env holding container-only paths still leaks into host runs. A consumer workaround can shed its ci.env-sourcing half here, but not necessarily all of it.

2. The two stamped refs had drifted, and nothing noticed

Ref Purpose Was
gates.ymlcolormath-ref default how CI fetches its gate scripts v3.0.0
Makefile.colormathCOLORMATH_REF how preflight fetches the same scripts v2.0.0

LIFECYCLE's Releasing step 2 stamped only the first, so preflight has been fetching gate scripts from a tag three releases behind CI.

Harmless so far purely by luck. audit-deps.sh, migrations-sync.sh and diff-coverage.sh are byte-identical between v2.0.0 and v3.0.0 — verified. The first script change would have split local from CI with no signal whatsoever.

Worth noting Makefile.colormath's own header already claimed both refs are "stamped per release, so the refreshed file pins itself." The intent was documented; it just wasn't happening.

Three parts to the fix:

  • COLORMATH_REF corrected to v3.0.0
  • LIFECYCLE step 2 now names both refs and says what breaks if you miss the second
  • a refs-lockstep job in colormath's own CI fails the PR when they disagree

That last one is deliberate machinery over habit. LIFECYCLE says "this is a checklist habit, not machinery" — but the checklist already had a stamping step and it was still missed for three releases, so the habit demonstrably isn't sufficient here. Verified the guard both ways: PASS on the matched refs, FAIL when COLORMATH_REF is set back to v2.0.0.

Versioning

Lands under the existing ## Unreleased section rather than claiming its own version — that release is already MINOR for the three new skills, and these are bug fixes riding along.

Verification

  • sh -n on the expanded coverage-diff recipe — clean
  • ci.yml parses; jobs are refs-lockstep, gates
  • drift guard exercised in both directions
  • example/ untouched — neither change alters gate behavior against the fixture

🤖 Generated with Claude Code

https://claude.ai/code/session_01T3dRiaun8tKHmqQWCpMWMo

Two bugs in the same place — the local mirror not actually mirroring — both
found while bumping intendent to v3.0.0.

coverage-diff ran pytest without sourcing .colormath/ci.env, while CI's
diff-coverage gate sources it. A consumer whose app needs test config to
import at all got a green gate in CI and a collection error locally from
the same commit. Now uses the same if/then/fi form as the CI step.

The two stamped refs had drifted and nothing noticed. gates.yml's
colormath-ref default is how CI fetches its gate scripts; COLORMATH_REF in
Makefile.colormath is how preflight fetches the same ones. Releasing step 2
stamped only the first, so COLORMATH_REF sat at v2.0.0 against CI's v3.0.0
— preflight running scripts from three releases back. Harmless purely by
luck: audit-deps.sh, migrations-sync.sh and diff-coverage.sh happen to be
byte-identical across those tags, so the first script change would have
split local from CI with no signal at all.

COLORMATH_REF corrected to v3.0.0, LIFECYCLE step 2 now names both refs,
and a refs-lockstep job fails the PR when they disagree. Machinery rather
than a checklist habit, since the checklist already had the step and it was
still missed.

Lands under the existing Unreleased section rather than claiming its own
version — that release is already MINOR for the three new skills.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3dRiaun8tKHmqQWCpMWMo
@craigmbooth
craigmbooth merged commit ac5e1f7 into main Aug 4, 2026
17 checks passed
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