Skip to content

det: refuse a COPY member found in several directories without an engine answer (#4461) - #4549

Merged
squid-protocol merged 1 commit into
mainfrom
fix/4461-det-copy-ambiguity
Oct 6, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
fix/4461-det-copy-ambiguity

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4461.

What

The det translator's fallback COPY search (no engine answer: a run without an engine, e.g. det-port copy_dirs, or a member outside the estate) took the first directory holding the member. It now collects one candidate per directory and raises CopyAmbiguous (subclass of CopyNotFound, so existing refusal handling applies) naming the COPY and listing every candidate when more than one distinct file holds it. A single match still resolves. Engine answers and CopyUnresolved are unchanged; #4486 (SYSLIB-collision rule) is not decided here.

Details: same file via two directory spellings is one candidate; copybook extensions still beat program extensions (CBSA INQCUST); the translator's shipped system members (DFHAID etc.) are a fallback only.

Evidence

  • New tests/cobol_mainframe/test_copy_ambiguous_4461.py (8 tests: ambiguity listing, order is no substitute, single match, dedupe, ext precedence, shipped fallback, out-of-estate with an engine, engine answer still decides).
  • Det-port: all 36 equivalence cases translate as before (det_port.py run --all-cases --translate-only; mortgage-mpmt 24/27 is its baseline). No case relied on first-hit order, so no case.json changed and no evidence re-proof was needed.
  • pr_gates (lint, audits, secrets, xray, gauntlet, suite) pass; golden failed once on an unrelated CSS drift in the zero-dep leg (first run, fresh venvs) and passed on rerun. --ratchets: 6/6 pass (ports, port-surface, estate, fact-crosscheck, completeness, ground-truth). translator-copy-search-order ledger cause stays empty.

Left (why "Part of")

det/cics.py declared() still resolves a DTO field's copybook by first-hit name over copy_dirs. That file is another lane's (#4534), so it was left alone; follow-up: route it through the same ambiguity check.

🤖 Generated with Claude Code

https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR

…st-hit (#4461)

Where no engine answer decides a COPY (a run without an engine, or a member outside the estate), the translator's directory search now collects one candidate per directory and raises CopyAmbiguous (a CopyNotFound) listing them when more than one distinct file holds the member. A single match still resolves; the same file via two directory spellings is one candidate; a copybook extension still beats a program extension; the shipped system members are a fallback, never a rival. Engine answers and CopyUnresolved are untouched (#4486 not decided).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W3KVtYHQp8KsfKcHsdiPbR
@squid-protocol squid-protocol added bug Unintended behavior or logic failure in the engine data-integrity Issues relating to RAM state or SQLite database fidelity legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 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 6, 2026 07:24
@squid-protocol
squid-protocol merged commit 6dc791e into main Oct 6, 2026
37 of 39 checks passed
@squid-protocol
squid-protocol deleted the fix/4461-det-copy-ambiguity branch October 6, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unintended behavior or logic failure in the engine data-integrity Issues relating to RAM state or SQLite database fidelity legacy-modernization COBOL refractor, dead-code extraction, and JCL forging priority: high Core feature broken, but workarounds exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant