Skip to content

fix: Hypatia annotations read "null" on an unanchorable absolute path - #59

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/hypatia-annotations
Sep 4, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
fix/hypatia-annotations

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

The gate here works. Its annotations do not.

This repo's Static Analysis Gate was repaired in the earlier wave and now genuinely fires. What it
reports, however, is unreadable: every annotation says [hypatia] null, on a path GitHub cannot
anchor to the diff.

1. \(.message) — a key the findings do not have

A Hypatia finding carries action, file, line, reason, rule_module, severity, type. There is no
.message. jq interpolates a missing key as JSON null, so every annotation, for every finding,
in every run, read null.

Fixed with a fallback chain — .reason // .message // .type // "finding" — so it stays correct if
the finding schema later grows a .message.

2. .file is an absolute runner path

.file arrives as /home/runner/work/<repo>/<repo>/path/to/thing. GitHub can only place an
annotation on a diff line if the path is workspace-relative, so these annotations were emitted
into nowhere. --arg ws "$GITHUB_WORKSPACE" plus ltrimstr($ws + "/") makes them relative.

Positive control, on a real artifact

Both jq programs, run against a genuine hypatia-findings.json downloaded from a completed run:

OLD  ::error file=0-AI-MANIFEST.a2ml,line=1::[hypatia] null
     ::error file=scorecard.yml,line=1::[hypatia] null

NEW  ::error file=0-AI-MANIFEST.a2ml,line=1::[hypatia] Required file missing
     ::error file=scorecard.yml,line=1::[hypatia] Issue in scorecard.yml

Scope

Annotations only. No threshold, no scanner invocation, no gate condition and no exit code is
touched — the pass/fail behaviour of this workflow is byte-for-byte unchanged. The check should stay
exactly the colour it is today; only what it says changes.

Post-conditions asserted by the transform before this branch was written: no \(.message) survives
anywhere; --arg ws and ltrimstr($ws are both present; no un-fixed jq header remains; and — as a
guard against applying this to the wrong repo — the earlier wave's --exit-zero is still present and
the old 2>&1 fold is still absent.

…y vacuous

The gate in this repo already fires correctly. Its ANNOTATIONS do not.

1. Every annotation read "[hypatia] null". Findings carry no `.message` key --
   the real keys are action, file, line, reason, rule_module, severity, type --
   so `\(.message)` interpolated JSON null on every single finding.

2. `.file` is an absolute runner path (/home/runner/work/<repo>/<repo>/...).
   GitHub cannot anchor an absolute path to the diff, so the annotation never
   appeared on the changed lines. It is made workspace-relative here.

Fallback chain is `.reason // .message // .type // "finding"`, so this stays
correct if the finding schema later grows a `.message`.

Proven by positive control against a real hypatia-findings.json artifact:
  OLD: ::error file=0-AI-MANIFEST.a2ml,line=1::[hypatia] null
  NEW: ::error file=0-AI-MANIFEST.a2ml,line=1::[hypatia] Required file missing

No threshold, no scanner logic and no gate condition is changed.
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 26dd784f-d4b0-4f85-ae2f-64d061ed797c

📥 Commits

Reviewing files that changed from the base of the PR and between 1c40d06 and 1fde62a.

📒 Files selected for processing (1)
  • .github/workflows/static-analysis-gate.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit 5e1f56d into main Sep 4, 2026
23 of 26 checks passed
@hyperpolymath
hyperpolymath deleted the fix/hypatia-annotations branch September 4, 2026 01:34
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