Skip to content

fix(sarif): drop schema-invalid fixes — GitHub rejected every upload - #45

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/sarif-invalid-fixes
Jul 28, 2026
Merged

fix(sarif): drop schema-invalid fixes — GitHub rejected every upload#45
hyperpolymath merged 1 commit into
mainfrom
fix/sarif-invalid-fixes

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

No OikosBot SARIF has ever been ingestible by GitHub code scanning.

SARIF 2.1.0 requires every fix object to carry artifactChanges. We emitted fixes[].description alone, so the upload API rejects the entire run:

instance.runs[0].results[1].fixes[0] requires property "artifactChanges"

Every result with a suggestion trips it. Found by the enaction-engine pilot (metadatastician/enaction-engine#21): the analysis step succeeded, the container worked, and the upload step failed — which is precisely why we piloted one repo before sweeping seventeen.

Fix: OikosBot's suggestions are advisory prose, not text replacements, so fix was the wrong SARIF construct. They now appear in the result message and properties.suggestion. The Fix type is deleted with an explanatory note.

Regression guard: a test asserts no emitted fix lacks artifactChanges. Worth noting the trap it closes — serde_json::from_str succeeding proves only parseable JSON, not schema-valid SARIF. I relied on that weaker check earlier and it is what let this ship.

Verified: 51 workspace tests pass. True verification comes after merge, when :latest republishes and the pilot re-runs against GitHub's own validator.

🤖 Generated with Claude Code

SARIF 2.1.0 requires every `fix` object to carry `artifactChanges` — a fix
IS a concrete edit (artifactLocation + replacements). We emitted
`fixes[].description` alone, so GitHub's code-scanning upload rejected the
whole run:

  instance.runs[0].results[1].fixes[0] requires property "artifactChanges"

Every result carrying a suggestion tripped it, so no OikosBot SARIF has
ever been ingestible. Caught by the enaction-engine pilot
(metadatastician/enaction-engine#21) — the analysis step succeeded and the
upload step failed.

OikosBot's suggestions are advisory prose ("use a hash map for O(1)
lookup"), not text replacements, so `fix` was the wrong construct
entirely. They now ride in the result message and in
`properties.suggestion`. The `Fix` type is removed with a note so it is
not reintroduced.

Added a regression test asserting no emitted fix lacks artifactChanges.
Note the trap it guards: serde_json parsing successfully proves only that
the output is valid JSON, NOT that it satisfies the SARIF schema — that
distinction is what let this ship.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gitar-bot

gitar-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

Note

Automatic reviews are paused because your trial's included automatic processing has been used for this period. Upgrade now, or comment "Gitar review" to run a review anytime.
Learn more

Code Review ✅ Approved

Removes schema-invalid SARIF fixes lacking artifactChanges to restore GitHub code scanning ingestion, relocating advisory suggestions to the message and properties. No issues found.

Auto-approved and auto-merge armed: No blocking issues found.
Please see Auto-approve Docs for details on setting custom approval criteria. — merges when pipeline and required approvals pass.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot

gitar-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown

⚠️ Gitar auto-approved this PR but could not enable auto-merge: auto-merge is disabled for this repository — enable "Allow auto-merge" in the repository settings.

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gitar has auto-approved this PR and enabled auto-merge (configure)

@gitar-bot gitar-bot Bot added the gitar-approved Added by Gitar label Jul 28, 2026
@hyperpolymath
hyperpolymath merged commit 223461a into main Jul 28, 2026
25 checks passed
@hyperpolymath
hyperpolymath deleted the fix/sarif-invalid-fixes branch July 28, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gitar-approved Added by Gitar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant