Checker backend SDK
SV-Gap separates the evaluation contract from any one structural checker. Built-in and third-party backends implement one operation:
check(manifest: Manifest) -> CheckResult
Contract
A backend must expose stable name and version strings and return:
passwhen it completed and emitted no configured failing finding;failwith one or more inspectable findings;unknownwhen required intent or analyzer coverage is insufficient; ortool_errorwhen execution could not complete.
It must never translate missing intent, unsupported syntax, timeout, or tool
failure into pass. Findings use stable rule identifiers, severity, a concise
message, and JSON-serializable evidence. Tool and rule-deck versions belong in
the result.
Registration
Register a zero-argument backend factory using the svgap.backends Python entry
point group:
[project.entry-points."svgap.backends"]
my-open-checker = "my_svgap_backend:MyBackend"
from svgap.model import CheckResult, Manifest
class MyBackend:
name = "my-open-checker"
version = "1.0"
def check(self, manifest: Manifest) -> CheckResult:
...
After installation, svgap doctor lists the backend. Select it in a manifest:
[structural]
backend = "my-open-checker"
Plugins cannot replace a built-in name. The plugin package must document its tool license, installation requirements, source-location behavior, supported intent, rule identifiers, timeout behavior, and known false-positive and false-negative classes.
Acceptance tests
Every backend contribution should include:
- a capability probe;
- at least one passing and failing fixture per rule;
- missing-intent and unsupported-syntax tests;
- normalized
unknownandtool_errorcases; - report-schema validation; and
- a differential table against the reference backend where scopes overlap.
Commercial-tool adapters may live outside this Apache-2.0 repository. The core project and its default CI assume only redistributable open-source tools.