Repository navigation
feat(ci): SARIF output and a GitHub Action that gates trust, cost, and drift - #107
Merged
Merged
Conversation
…d drift Everything kitbash checks was previously something one maintainer ran locally and everyone else took on trust. This makes it a required check on the pull request. `kitbash lint --sarif <file>` writes findings as SARIF 2.1.0, the format GitHub code scanning reads, so results land in the Security tab and as inline PR annotations instead of scrolling past in a log. Hard-fail safety lints are `error`; heuristics and budget overruns are `warning`; passing checks are not emitted, so a clean run produces a valid empty report rather than noise. Locations are repo-relative with forward slashes so the same report works on any runner. The report is written even when the lint fails — that is exactly the run whose findings need to reach the Security tab — and never outside the project (exit 2). The composite action bundles three checks other scanners split up or skip: the trust lints, the declared token budgets, and drift — it recompiles and fails if the working tree changes, which catches a hand-edited generated file or a source someone changed without recompiling. Competing scanners emit SARIF for skill content; none also measures token cost or catches source-vs-output drift, the failure a repo with eleven targets actually hits. Both shell steps are written for `bash -e`: a bare `[ test ] && cmd` would have failed the step whenever the test was false, and `git diff` alone would have missed newly generated untracked files, so drift uses `git status --porcelain`. CI dogfoods the SARIF path on our own example skill with the locally built CLI (npm has not seen this version at PR time). Adds 16 tests. 0.18.0.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
This branch was successfully deployed
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.
What
Everything Kitbash checks was previously something one maintainer ran locally and everyone else took on trust. This makes it a required check on the pull request.
kitbash lint --sarif <file>— writes findings as SARIF 2.1.0, so results land in the Security tab and as inline PR annotations instead of scrolling past in a log.remote-exec,visible-text,dynamic-context,secrets) →errorwarningA composite GitHub Action —
singhharsh1708/kitbash@v0.18.0, one step, three checks:kitbash compilechanges the working treeDrift is the one competitors don't have. A skill compiles to eleven targets; nothing stops someone hand-editing a generated
.cursor/rules/*.mdc, or changing the source and forgetting to recompile — then each agent reads something different and nobody finds out. Competing scanners emit SARIF for skill content; none also measures token cost or catches source-vs-output drift.Two bugs caught while writing it
shell: bashwith-e, so a bare[ test ] && args+=(...)returns 1 when the test is false and fails the step instead of skipping the flag. Both conditionals are now fullifblocks, and the array expands as${args[@]+"${args[@]}"}so an empty array is safe.git diff --exit-codemisses newly created untracked files, so a target compiled for the first time would pass silently. Drift now checksgit status --porcelain.Verification
bash -e, including the empty-array case.Ships as 0.18.0.