Skip to content

fix: --copy-libraries gaps draw no edge (#4420) and copy reports persist in the master DB (#4421) - #4424

Merged
squid-protocol merged 1 commit into
mainfrom
fix/4420-copy-gaps-and-collisions-db
Oct 5, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/4420-copy-gaps-and-collisions-db

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Covers #4420 and #4421 together: both change the same --copy-libraries report (gaps are new, collisions are persisted alongside them) and the same estate-scorer lines.

What was broken

Fix

  • NetworkRiskSensor._resolve_in_libraries: a program with a declared search order is held to it. A member in none of its libraries (or not in the library IN names) returns no edge and records a gap (copy_member_gaps: importer, member, libraries searched). Undeclared importers (no matching syslib entry) and unknown library names keep the default resolver. Runtime-supplied members (SQLCA, DFHAID) stay unresolved with a gap row, no fallback.
  • Both reports are written to new repo_data.copy_member_collisions / copy_member_gaps JSON columns (NULL when no libraries declared), restored by StateRehydrator.load_state and exposed as GalaxyIR.copy_member_collisions / copy_member_gaps.
  • tests/tools/estate_crucible.py: second scan removed, collisions read from GalaxyIR. Also fixed the key-gap check: a copy gap now only looks at import edges (ORDMAIN legitimately CALLs ORDPRICE, a call edge, which the old check counted as a hit).

Before -> after

tests/cobol_mainframe/test_copy_gaps_4420_4421.py (new): no edge for a member in no library; gaps for unqualified, IN LIB and runtime-supplied (SQLCA); undeclared importer keeps default resolution; collisions persisted by a --db-only scan and exposed via GalaxyIR; rehydrator restores both; no libraries -> NULL. Plus a scorer test for the copy-gap edge kinds. Real scan of estate-crucible v0.4.0: H-0053 FAIL (6 not passing) -> PASS; H-0052 collision checks unchanged (pass).

Golden masters

Both legs unchanged (the goldens declare no copy libraries); scope check: 0 differences vs origin/main.

Ground-truth ledger

No change.

Estate-crucible

Horrors passing 58/60 -> 59/60 (H-0053). Checks: pass 1369->1378, fail 13->4, phantom 4->1. Channels: copies 63/0/0/3 -> 63/0/0/0, data_items 446/3 -> 449/0, layouts 140/3 -> 143/0, gaps 14/3 -> 17/0. Remaining fails are H-0050 (#4419) and H-0031.
Audits: mypy, ruff, dead_key PASS.

Fixes #4420
Fixes #4421

🤖 Generated with Claude Code

https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

… reports in the master DB (#4421)

A COPY no library of a declared SYSLIB holds no longer falls back to the default
resolver (which linked it to a same-named program source); it draws no edge and is
reported as copy_member_gaps. copy_member_collisions and copy_member_gaps are stored
in repo_data, restored by the state rehydrator and exposed on GalaxyIR; the estate
scorer drops its second --audit-only scan and scores a COPY gap by import edges only.

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

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 5, 2026 10:24
@squid-protocol
squid-protocol merged commit 49cba5d into main Oct 5, 2026
39 checks passed
@squid-protocol
squid-protocol deleted the fix/4420-copy-gaps-and-collisions-db branch October 5, 2026 10:24
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