Skip to content

doctor: resolve mediated pins and stop judging changelog history (#310) - #316

Merged
turinglambdaai merged 1 commit into
mainfrom
fix/doctor-release-scanning
Oct 25, 2026
Merged

turinglambdaai merged 1 commit into
mainfrom
fix/doctor-release-scanning

Conversation

@turinglambdaai

Copy link
Copy Markdown
Owner

Closes #310.

Products adopting raco rivet doctor --release hit two false findings, both from the pin scanner's text-level view:

  1. Env-mediated pins read as empty refs. A workflow install step like rivet.git#${{ env.RIVET_PIN }} (or ${RIVET_PIN}, $env:RIVET_PIN) captured zero characters of [A-Za-z0-9._-] and was classified as the autarx empty-ref incident. The scanner now recognizes the three mediation forms, resolves the name against the same file's env: block (top-level and job-level), and classifies the resolved value normally. A mediation the file cannot resolve stays a finding naming the variable — fail safe, consistent with the incident class the gate exists for.

  2. Historical pins in prose. The tag-vs-installed comparison ran on .md files, so a released changelog section documenting its own past pin (rivet.git#v0.11.0 in the 0.7.0 notes) failed against every future installed release. The comparison now runs only on configuration files (.yml/.yaml/.rkt/.rktd); the shape-based empty-ref check still applies everywhere, since an empty ref is suspicious regardless of context.

Tests extend the release-gate suite in rivet/tests/doctor.rkt: mediated-and-resolved passes; undefined variable fails naming the variable; resolved wrong tag fails the comparison; changelog prose with a past tag passes; empty ref in prose still fails.

Verified against the regexmate repository (the reporter): the two inlined-SHA workflows and the reworded changelog stay green, and the synthetic mediated/undefined/wrong-tag/prose cases classify exactly as the tests assert.

Two release-gate false findings from products adopting the gate:

- A workflow install step that indirects through a variable
  (`rivet.git#${{ env.RIVET_PIN }}`, `${RIVET_PIN}`, `$env:RIVET_PIN`)
  read as an empty ref, because the ref position stopped at the dollar
  sign. The pin regex now matches the mediation forms, resolves the name
  against the same file's env block (top-level and job-level), and an
  unresolvable mediation stays a finding — fail safe, like the empty-ref
  incident class.
- The tag-vs-installed comparison ran on markdown prose too, so a
  released changelog section describing its past pin failed forever.
  The comparison now runs only on configuration files (.yml/.yaml/.rkt/
  .rktd); the shape-based empty-ref check still applies everywhere.

Tests: mediated+resolved passes, undefined variable fails naming the
variable, resolved wrong tag fails the comparison, changelog prose with
a past tag passes, empty ref in prose still fails.
@turinglambdaai
turinglambdaai merged commit 2287e47 into main Oct 25, 2026
23 checks passed
@turinglambdaai
turinglambdaai deleted the fix/doctor-release-scanning branch October 25, 2026 02:32
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.

doctor --release: env-mediated pins read as empty refs, historical changelog refs compared against the installed release

1 participant