feat(github-app): publish public-safe check-run annotations (#272) - #349
Merged
JSONbored merged 1 commit intoJun 3, 2026
Conversation
JSONbored
approved these changes
Jun 3, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@enjoyandlove this is in good shape.
A few notes:
- The check-run output stays on the public-safe side of the boundary instead of leaking review-only detail.
- Permission and validation failure paths are handled explicitly, which is the right shape for GitHub App behavior.
- The tests cover the key sanitizer and check-run failure cases.
No code changes requested.
Validation expected:
- Keep the current CI/check-run suite green through merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #272
src/rules/advisory.ts—formatCheckRunOutputnow acceptsdetailLevel("minimal"|"standard"|"deep").minimalpreserves existing static output.standardlists public-safe finding text usingpublicTextwhere set,titleas fallback, with severity emoji labels.deepadds action hints for findings that carrypublicText. All text is sanitized by a newsanitizeForCheckRun()that stripsreward,wallet,hotkey,trust score,reviewability,scoreability,farming, and related terms.src/github/app.ts— AddedCheckRunOutcomediscriminated union (published|permission_missing).createOrUpdateCheckRunnow acceptsdetailLevel, wraps Octokit calls in try/catch, and returns{ kind: "permission_missing" }on 403 or message-matched permission errors instead of throwing. Non-permission errors still rethrow. DefaultdetailLevelis"minimal"so all existing callers are unaffected.src/queue/processors.ts— Passessettings.checkRunDetailLeveltocreateOrUpdateCheckRun. Passes the real advisory (with findings) instead of the previous hard-coded empty-findings override. Handlespermission_missingby recording agithub_app.check_run_permission_missingaudit event rather than silently succeeding.Scope
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint— skipped (no workflow files changed)npm run typechecknpm run test:coverage— 857 tests pass, branch coverage 97.02% (above threshold)npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
npm run actionlint— no workflow files were modified.npm run test:workers,build:mcp,test:mcp-pack,ui:*— no MCP package or UI files were changed.Safety
sanitizeForCheckRun()strips all forbidden terms; tests assert output never matches the forbidden-terms pattern at every detail level.permission_missingoutcome tested end-to-end.Notes
formatCheckRunOutputdefault remains"minimal"— all call sites that don't passdetailLevelare unaffected. Theprocessors.tscaller now passessettings.checkRunDetailLevel, so behavior is controlled entirely by the per-repo setting.permission_missingaudit event (github_app.check_run_permission_missing) is recorded withoutcome: "error"and the warning text, giving operators a clear signal to fix the GitHub App permission without a noisy exception in the job queue.findingsin the advisory are now passed through toformatCheckRunOutputrather than being cleared. The sanitizer andpublicText-first selection ensure no private finding details reach the check-run output.