Repository navigation
test(#4109): fold the scan DB's function rows and import graph into the golden master - #4119
Merged
Merged
Conversation
…he golden master The golden master snapshotted only <repo>_galaxy_audit.json. What the engine computes per FUNCTION lives only in <repo>_galaxy_master.db -- archetype, z-score, call list, fan-in/out, PageRank, usage status -- and the resolved import graph is in edge_data; none of it was regression-tested on the corpus. Two functions swapping archetypes inside one file was invisible. tests/golden_db_snapshot.py folds a canonical slice of the DB into the audit dict as a new per-file section, "11. Scan DB Snapshot" (rows keyed "<func>@<line>", floats rounded, ids and mode-dependent token mass excluded). golden_store already splits each per-file sub-key into its own part file, so the slice inherits the whole toolchain unchanged: deep_compare diffs it, update_golden_master blesses it, crucible_check checks it. golden_diff.load_and_sanitize attaches it whenever a fresh audit JSON has its sibling *_master.db, so every reader of a fresh scan (the golden test, the bless, bless_scope, scope_check, rebase_rebless) sees the fixture's shape. Blessed: 2,084 files, 45,550 functions, 2,506 import edges; 8 new part files, ~17 MB per fixture; byte-identical in both modes. No existing part changed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4109: the DB slice, the largest gap. SARIF, SBOM, graph SQLite, GPU JSON and the LLM brief stay open on the issue.
Problem
The golden master snapshotted only
<repo>_galaxy_audit.json. Everything the engine computes per function lives only in<repo>_galaxy_master.db(archetype, z-score, call list, fan-in/out, PageRank, usage status), and so does the resolved import graph (edge_data). None of it was regression-tested on the corpus. For example, two functions swapping archetypes inside one file left the per-file mix unchanged, so the golden diff showed nothing.What this adds
tests/golden_db_snapshot.pyfolds a canonical slice of the DB into the audit dict as a new per-file section,11. Scan DB Snapshot:function_data, keyed"<func>@<start_line>"edge_data, as sorted"<kind>:<dst path>"token_massare excluded, so the slice is byte-identical in full-precision and zero-dependency mode (verified).golden_storealready splits every per-file sub-key into its own part file, so the slice inherits the existing toolchain unchanged:deep_comparediffs it,update_golden_master.pyblesses it, andcrucible_check.pychecks it.golden_diff.load_and_sanitizeattaches the slice whenever a fresh audit JSON has its sibling*_master.db. Every reader of a fresh scan therefore sees the fixture's shape: the golden test, the bless,bless_scope,scope_checkandrebase_rebless. Fixture directories never get it attached twice.Golden master
calls_out_tois the largest part at 4.7 MB.crucible_check.pypasses in both modes.Tests
tests/test_golden_db_snapshot.pybuilds a synthetic DB and checks:load_and_sanitizeattaches the slice to a fresh scan and never to a fixture directory.test_golden_storecanonical-bytes check: green. audit_check all clear; Python 3.9 compiles.Merge order
#4113 changes the function population, but this slice reads
function_data, which #4113 doesn't touch, so they don't interact. If another PR re-blesses first, re-runcrucible_check.py --update --yeshere (orrebase_rebless.py).🤖 Generated with Claude Code