Skip to main content
Version: 0.4.1

SARIF in code scanning

kq validate --format sarif writes one SARIF 2.1.0 log on standard output, for code-scanning viewers, CI systems and AI assistants that read SARIF. SARIF output is free, like every format: it needs no license.

Upload it to code scanning​

Write the log to a file and upload it with GitHub's own action, so each finding shows in the repository's code scanning alerts:

- run: kq validate --format sarif models/my-model > kq.sarif
continue-on-error: true
- uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: kq.sarif

The summary line goes to standard error, so the file stays a valid log. continue-on-error lets the upload run when the model has an error, which makes kq validate exit with 1.

What the log holds​

  • A result per finding, an error at level error and a lint at warning, placed at its file and position. A build error is a result too, under its KB code.
  • Each rule links to its page, so an alert opens the rule's explanation and its fix. See Validation.
  • Each result carries a fingerprint made from the rule and the Ids of what the finding is about, so moving, reformatting or renaming leaves it unchanged, and code scanning follows one finding from run to run.
  • Policy findings are a second run of their own, an exempted breach marked as suppressed with its reason.

One result​

The web shop's call naming the order service instead of its API, web-shop -> order-service over http auth user-token, is one result in the log:

{
"ruleId": "KQ022",
"ruleIndex": 17,
"level": "error",
"message": {
"text": "Connection from Component \"Web Shop\" (my-model/storefront/web-shop) lands on Component \"Order Service\" (my-model/storefront/order-service); name the Interface or Channel it uses"
},
"locations": [
{
"physicalLocation": {
"artifactLocation": {
"uri": "models/my-model/model/my-model.kq"
},
"region": {
"startLine": 15,
"startColumn": 5
}
}
}
],
"fingerprints": {
"kanoniq/v1": "e7b9b00945f480c08aaded0ac90c427b8b8e0c5b7d453c92d670242a7f7daa60"
}
}

Its rule, at ruleIndex in the run's list of rules, names KQ022 as connection-names-its-target and links its page in helpUri.

© 2026 Extenza Works. All rights reserved.