Skip to content

State what stays compatible, and test each promise - #51

Merged
binary-knight merged 1 commit into
mainfrom
compat-policy
Nov 10, 2026
Merged

binary-knight merged 1 commit into
mainfrom
compat-policy

Conversation

@binary-knight

Copy link
Copy Markdown
Owner

Groundwork for 1.0: a written compatibility policy, with a test behind each promise in it.

docs/COMPATIBILITY.md covers:

  • the commands and their flags, and exit codes 0 (ran, gates passed), 2 (a gate failed) and 1 (could not run)
  • the report format, schema_version 1, where fields can be added but not removed, renamed or retyped
  • the scoring: weights of 25/15/8/3/0, the cap at 100, finding IDs that are never reused, and the two findings whose severity follows their evidence (FS-001, PRIV-003)
  • the GitHub Action's inputs and outputs
  • how a score can still change between minor versions: a new check or a corrected one, each recorded by version and in the changelog

verify, submit and benchmark are named experimental, and their help text says so. Human-readable output, the JSON of matrix, combine and verify, and the Python modules are outside the promise.

Tests. tests/test_compatibility.py checks every report in examples/ against the new schema, and checks that the schema declares every field they use. It also covers freshly written reports and assert results, the weights, which findings have variable severity, exit codes, the Action's inputs and outputs, and each stable command's flags against tests/fixtures/cli_surface.json. A missing command or flag fails. A new flag has to be added to the fixture.

Report changes. Reports now record agentsec_version beside probe_version, because scoring lives in the package and a scoring change was not visible in a report. Reports written by earlier versions do not have the field, and --baseline treats its absence as no change. --baseline and agentsec history note when either version differs.

A correction. The README and the gate's own note said a probe version difference fails --baseline. Since the gate was added in #6, the code has failed only when a finding is new or more severe, and passed with a note otherwise. The README and the note now describe that, and the policy promises it.

Also: JSON Schemas for the blast-radius report and the assert result in agentsec/data/, agentsec --version, PyPI classifiers (Development Status 4 - Beta), and jsonschema as a test dependency. Locally 512 tests pass and 13 skip without network.

🤖 Generated with Claude Code

docs/COMPATIBILITY.md says what holds from one version to the next: the
commands, flags and exit codes, the report format, the scoring weights
and finding IDs, and the GitHub Action's inputs and outputs. It names
verify, submit and benchmark as experimental and says how a score can
still change. tests/test_compatibility.py checks each promise.

Reports now record agentsec_version beside probe_version, so a change in
scoring is visible in the report. --baseline and agentsec history note a
difference in either version. A difference with nothing worse passes, as
the gate always has. The README and the gate's note said it failed, and
now match the code.

JSON Schemas for the blast-radius report and the assert result ship in
agentsec/data/, and every report in examples/ is checked against the
first. Also adds agentsec --version, the experimental labels in help,
PyPI classifiers, and jsonschema as a test dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
def _constructed():
"""Each finding id the scorer can emit, with the severity argument as written."""
found = {}
for m in re.finditer(r'_f\(\s*"([A-Z]+-\d{3})",\s*(?:\(?\s*f?"(?:[^"\\]|\\.)*"\s*)+\)?,\s*([^,]+),', SCORING_SRC):
@binary-knight
binary-knight merged commit 5d2f203 into main Nov 10, 2026
17 of 18 checks passed
@binary-knight
binary-knight deleted the compat-policy branch November 10, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants