Skip to content

test: golden master snapshots SARIF, SBOM, graph sqlite, GPU JSON, LLM brief (#4109) - #4240

Merged
squid-protocol merged 1 commit into
mainfrom
test/4109-golden-all-outputs
Oct 3, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
test/4109-golden-all-outputs

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #4109 (with #4119, every output the issue lists is now covered; GPU coordinates are deliberately excluded, as the issue itself proposed).

What this adds

tests/golden_outputs_snapshot.py adds one top-level golden section, 12. Scan Output Snapshots, with one fixture file per output. golden_diff.load_and_sanitize attaches it to every fresh scan that has the sibling files and never to a fixture directory. Same pattern as #4119, so deep_compare, update_golden_master.py and crucible_check.py need no change and no CI workflow change was needed.

Output Snapshot
_galaxy_sarif.json rules/tool/invocations whole; results sorted, one lossless JSON string each
_galaxy_sbom.json CycloneDX doc, components sorted
_galaxy_graph.sqlite meta; row counts; per-file 12-hex SHA-256 digest of each table's rows (keyed by path, not autoincrement id)
_galaxy_gpu.json meta, per-key digests of global_summary, per-file digest of the galaxy row (interned ids and file indices resolved to strings), per-column digests, singularity rows
_galaxy_llm.md full brief as a line list

Masks (only fields that vary between scans, or that other automation refreshes)

  • SBOM serialNumber (fresh UUID per scan) and metadata.timestamp.
  • Graph sqlite meta: timestamp, commit, branch (same facts sanitize already masks in the audit).
  • GPU meta.session: timestamp, duration_seconds, target_directory (machine path), git_audit (same as the audit masks).
  • LLM brief section 0: Git Remote row, and the archetype-validation rows (Archetype Brains, Function/File archetypes, Composition (file/repo)), which archetype-validation.yml refreshes on main independently of engine output (the audit's Archetype Validation is masked for the same reason). Brain-provenance rows stay.
  • Normalisation, not masking: SARIF results/SBOM components/GPU singularity sorted (parallel completion order); GPU and graph rows keyed by path; floats rounded to 6 places.
  • Tool/engine version strings are kept: constant ("vlatest") and the audit already compares them.

Skipped

  • GPU pos_x/pos_y/pos_z: corpus-wide layout solve, so any change moves every coordinate. The audit already fails on the real cause; a layout digest would only restate it as noise.

Determinism proof

Blessed twice in a row in each leg (full: galaxy_venv; zero-dep: PyYAML only) from fresh scans on crucible v1.6.0 with the PATH shim (engine path verified): the second bless reported "No drift detected" in both. No existing fixture part changed (only new files). The two legs differ in all five new parts (zero-dep mode flags, no token mass, no ML threat data), as the existing fixtures do.

Size

5 new parts per fixture, ~1.9 MB each (gpu 600 KB, graph 743 KB, sarif 356 KB, llm 136 KB, sbom 98 KB), vs ~17 MB for #4119 and ~42 MB existing. Bless time +~9 s.

Tests

tests/test_golden_outputs_snapshot.py (7 tests, synthetic scan outputs): every output present; masked fields and reordering do not diff; GPU coordinates and scan order do not diff; for each of SARIF, SBOM, LLM, GPU (4 mutations), and graph sqlite, a deliberate one-field change makes deep_compare fail.

pr_gates

7/7 pass: lint, audits, secrets, xray, gauntlet, golden, suite.

Merge order

Merge this BEFORE the #4108 crucible-pin PR, which must then re-bless the new snapshots too. Other open PRs touching golden masters (#4058-fix, #4231, #4213-fix) re-bless after merging main, never hand-merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_013sNMtAg6s9dyyjNgnjRHi8

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit be25613 into main Oct 3, 2026
29 checks passed
@squid-protocol
squid-protocol deleted the test/4109-golden-all-outputs branch October 3, 2026 19:19
squid-protocol added a commit that referenced this pull request Oct 3, 2026
* Remove dead CONTEXT_VIOLATION_MATRIX config and its misleading wiki pseudo-code (#1090)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013sNMtAg6s9dyyjNgnjRHi8

* fix(signals): anchor hardware_bridge/cryptography on the top-level package (#4238)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013sNMtAg6s9dyyjNgnjRHi8

* fix(security): test site-packages relative to the venv, not the absolute scan path (#4239)

Leftover of #4058 (PR #4232). Also makes the three `.git`-in-parts rglob filters
(cobol port_runner, cics_transaction_reader, galaxy_ir) relative to their scan root.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013sNMtAg6s9dyyjNgnjRHi8

* golden: re-bless twisted/transport.py cryptography 9 -> 2 (#4238)

Both legs; only the one file moved (hardware_bridge/cryptography now anchored).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013sNMtAg6s9dyyjNgnjRHi8

* golden: re-bless section 12 snapshots after merging main (#4240); only twisted/transport.py moved

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013sNMtAg6s9dyyjNgnjRHi8

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant