Repository navigation
Closed
Labels
priority/p2-mediumPriority P2: standard workscope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaulttype/testType test: a new or changed test
Milestone
Description
Context & Rationale
Two digests are persisted outside the PR that computes them.
NormalizedFinding.fingerprint (security/normalization.py:150-160):
- It is sha256 over tool, rule_id, path and the canonical message, joined by '␟' and truncated to the first 32 hex characters.
- Suppression policies store it and match it only on exact equality (
security/suppression.py:59-60). - SARIF emits it as
partialFingerprintsunderdevopsCli/v1(config/constants.py:2030).
run_store.digest (ai/run_store.py:54-57):
- It names stored baselines:
{subject_key}.json(:430,:447) and the Valkey keys (:267,:302). - Subjects embed
digest()values (commands/review.py:1599,benchmark.py:183,prompt_eval.py:193).
Tests check only relations, such as line-insensitivity and round-trip (tests/test_security_sarif.py:227-255). A refactor that reorders the hashed parts, or changes the separator, the canonicalisation or the json.dumps options, passes every test while silently reopening every suppression and orphaning every stored baseline.
Scope & Deliverables
- Deliverable:
- In
tests/test_security_sarif.py:- 3-4 fixed
NormalizedFindinginputs pinned to literal 32-hex fingerprints; - an assertion that
CONST_SARIF_FINGERPRINT_KEYisdevopsCli/v1, with a comment stating the rule: an algorithm change bumps the key, updates the pins and adds a CHANGELOG line in the same commit; - a golden
tests/golden/sarif_report.json, compared withto_sarifoutput and validated againsttests/fixtures/sarif-schema-2.1.0.json.
- 3-4 fixed
- In
tests/test_run_store.py: literal digests for 2 fixed dicts.
- In
- Acceptance criteria:
- Swapping two hashed parts, changing the separator or changing the canonicalisation fails the fingerprint pin.
- Changing
digest()'sjson.dumpsoptions fails the run-store pin. - The golden SARIF file validates against the schema and equals
to_sarifoutput. - The new tests run in at most 1 s, with no new dependency.
- Key questions: none.
- Constraint: none beyond the version-key rule above.
Strategic Alignment
- Milestone: Backlog
- Depends on: none
Metadata
Metadata
Assignees
Labels
priority/p2-mediumPriority P2: standard workscope/securitySecurity linters (trivy, bandit, gitleaks, kubeconform) and Vaulttype/testType test: a new or changed test
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 8, 2026
Placed in v0.2.31 on 2026-10-08 at the owner's request ("Populate 10 security and ci issues into each v0.2.30, v0.2.31, and v0.2.32 milestone"). This is a person's placement. Release theme: finding identity v2, URL credential masking, tests that leave no state, the Docker endpoint check and the Argo CD/OTel perimeters. Position 1 of 10 in the release's planned merge order. This item still needs refinement before its release starts (see the planning note), so its board Status stays New.
test(security): pin the finding fingerprint and run-store digest to l…
dan-petty-bot commentedon Oct 9, 2026
What changed
#1478, merged into
release/v0.2.31as 80d418c.5 file(s) changed.
How it was verified
Check runs at 5b62b3b:
Acceptance Criteria of
docs/agent/tasks/task-855-pin-fingerprint-and-digest.md:tests/test_security_sarif.py:NormalizedFindinginputs (covering line-based, symbol-based, multi-tool, and canonical message variation) to literal 32-hex SHA-256 fingerprints (test_finding_fingerprints_are_pinned_to_literal_values).CONST_SARIF_FINGERPRINT_KEY == "devopsCli/v1"with documentation that an algorithm change bumps the key, updates the pins, and adds a CHANGELOG line in the same commit (test_sarif_fingerprint_key_pinned).test_swapping_parts_or_changing_separator_or_canonicalisation_alters_fingerprint).tests/golden/sarif_report.json.to_sarifoutput equals the golden report, and validated the golden document againsttests/fixtures/sarif-schema-2.1.0.json(test_golden_sarif_report_matches_and_validates_against_schema).tests/test_run_store.py:run_store.digestto literal 16-hex SHA-256 digests for 2 fixed dicts (test_digest_pinned_to_literal_values).json.dumpsserialization options changes the digest (test_digest_fails_when_json_options_differ).changelog.d/855.mdunder### Security.uv run devops cipasses.feat(release): v0.2.31 (#1490)