Skip to content

estate-crucible scorer: diff every fact channel against the generated key (#4317 phase 0) - #4324

Merged
squid-protocol merged 1 commit into
mainfrom
test/estate-crucible-scorer
Oct 4, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
test/estate-crucible-scorer

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

What

Phase 0 of #4317, gitgalaxy side: a scorer for squid-protocol/estate-crucible v0.1.0. That repo is a synthetic z/OS estate whose answer key is written by the generator that writes the code. This PR does not gate CI (no workflow; #4317 phase 5) and does not touch gitgalaxy/.

  • tests/_estate_crucible_pin.py: PINNED_REF = "v0.1.0", modelled on tests/_cics_crucible_pin.py: one sed-readable line, ESTATE_CRUCIBLE_PATH, else ../estate-crucible beside the main checkout, and an off-pin guard with ESTATE_CRUCIBLE_ALLOW_UNPINNED=1.
  • tests/tools/estate_crucible.py: scans <crucible>/estate with galaxyscope, loads the master DB through GalaxyIR, and reads directly the columns GalaxyIR does not carry (calls_out_to, transfers_to, synthetic_unit_data, raw_imports, excluded_artifacts). It then diffs 14 channels per fact: programs, unit extents, PERFORM / GO TO / CALL edges per owning unit, call sites, COPY imports (raw + edge), data items, record layouts (GalaxyIR.record_layout offsets / lengths), SQL statements / tables, JCL steps / DDs, BMS fields, CSD resources, transactions. Each check is pass / fail / missing / phantom / unscored. Each horror gets a verdict, and a failure caused by another horror is listed under it as a cascade (depends_on). Options: --json and --md.
  • tests/estate_crucible/test_estate_crucible_scorer.py: unit tests for each channel's projection with hand-made engine facts, which need no checkout. Also an end-to-end test that skips cleanly when no checkout is present.

Run: python tests/tools/estate_crucible.py [--crucible PATH] [--md out.md].

Scorecard: origin/main ca88a6bb vs estate-crucible v0.1.0

Per channel

channel pass fail missing phantom unscored
programs 8 0 2 0 0
units 39 0 1 3 0
edges 31 0 7 12 0
call_sites 11 2 2 2 0
copies 14 0 4 1 0
data_items 95 4 0 0 32
layouts 30 4 0 0 4
sql_statements 4 0 0 0 2
sql_tables 1 0 0 0 0
jcl_steps 9 0 0 0 0
jcl_dds 10 0 0 0 5
screen_fields 10 0 0 0 0
csd_resources 6 0 0 0 0
transactions 2 0 0 0 0
total 270 10 16 18 43

Per horror

horror issue verdict checks not passing
H-0001 #4300 FAIL 14 missing edges 0000-MAIN -perform-> 2000-APPLY-UPDATES @20; missing edges 0000-MAIN -goto-> 9999-ABEND @23; missing edges 0000-MAIN -call-> ACCTLOG @26; missing edges 0000-MAIN -call-> WS-AUDIT-PGM @28 (+10 more)
H-0002 #4301 PASS 17
H-0003 #4302 FAIL 4 missing units (main line); missing edges (main line) -perform-> 1000-INITIALIZE @52; missing edges (main line) -perform-> 2000-PROCESS-TRAN @53; missing edges (main line) -perform-> 9000-TERMINATE @54
H-0004 #4303 FAIL 7 missing copies RPTHDR @21; missing copies RPTTOT @22; missing copies RPTCNT @22; fail layouts WS-RPT-HEAD @21 (+1 more)
H-0005 #4304 FAIL 8 phantom edges 2000-REFRESH-BALANCE.calls_out_to CUSTAUDT; phantom edges 2000-REFRESH-BALANCE.calls_out_to PRODPROC; phantom call_sites CALL PRODPROC @39; phantom call_sites CALL CUSTAUDT @42
H-0006 #4305 FAIL 8 phantom edges 2000-DETAIL.calls_out_to 3; phantom edges 2000-DETAIL.calls_out_to TEST; phantom edges 2000-DETAIL.calls_out_to WS-N; phantom edges 2500-SCAN-HISTORY.calls_out_to 005800 (+2 more)
H-0007 #4306 FAIL 8 phantom units SCHEMA; phantom units IDMS-CONTROL; phantom units PROTOCOL
H-0008 #4307 FAIL 2 missing programs LNCALC; missing programs LNRATE; cascade: 2 check(s) elsewhere

Verdict on each seed

horror issue verdict why
H-0001 #4300 fails as expected split PERFORM / GO TO / CALL / COPY read the next line's sequence number (002100, 002400, 002700, 002900, raw import 001400). Both CALL sites are dropped. Knock-on: copy_members = 001400, so the record layout is unresolved.
H-0002 #4301 passes: fixed by #4315 (d89bf68b, issue closed) Same pin, pre-fix engine 1155f6bf: fails on all three shapes. CUSTINQ 0000-MAIN ends at 28 (key 42), RETURN-TO-MENU at 48 (key 53), 4000-FIND-BLANK at 69 (key 72), and 8 PERFORM edges are missing. So the plant does catch the bug.
H-0003 #4302 fails as expected No unit or synthetic slice for ACCTPOST's main line, and its 3 PERFORM edges are lost.
H-0004 #4303 fails as expected 01 X. COPY Y. and two COPYs on one line give no raw import or edge. record_data.copy_members does see them, but the layouts cannot expand.
H-0005 #4304 fails as expected EXEC SQL CALL becomes a COBOL CALL site and a callee (PRODPROC, the schema, and CUSTAUDT). sql_statement_data is right.
H-0006 #4305 fails as expected TEST, WS-N, 3, and after EXIT PERFORM the next token: END-IF, or in a numbered member the next line's sequence number 005800 (#4300 compounding).
H-0007 #4306 fails as expected IDMS-CONTROL and PROTOCOL are units. New shape: the DATA DIVISION's IDMS SCHEMA SECTION is a unit too (not listed in #4306).
H-0008 #4307 fails as expected Both LNRATE (padded, no period) and LNCALC (PROGRAM-ID LNCALC.) are missing. Cascade: CALL 'LNCALC' and JCL EXEC PGM=LNRATE do not resolve. Note: the padded shape passes when an AUTHOR. paragraph follows the PROGRAM-ID line. The plant has none, as in CBLDB22.

Mismatches outside the seeds (engine wrong, key checked)

  1. USAGE read past the entry's period (engine bug, new). When the last DATA DIVISION entry has no USAGE, it gets usage = DISPLAY from the PROCEDURE DIVISION's DISPLAY verb. Examples: ACCTUPD 01 WS-MSG PIC X(40). (followed by ... TO WS-MSG / DISPLAY WS-MSG) and ACCTAUD 01 LK-UPD-CONTROL. In mainframe_boundary.py (~l.1034), _USAGE_CLAUSE.search(window) runs on window, which extends to the next level number or _ENTRY_LIMIT. It should run on entry (cut at the period), as the NATIONAL check beside it already does.
  2. A bare COPY after a COPY-ed 01 is folded into that 01 (engine). CUSTINQ: 01 WS-COMMAREA. / COPY CUSTCOMM. / COPY CUSTMS. / COPY DFHAID. gives copy_members = CUSTCOMM,CUSTMS,DFHAID. CUSTMS (a symbolic map) and DFHAID each begin with their own 01, so the layout of WS-COMMAREA becomes unresolved (bytes None; key 50). IBM: an 01 in copied text starts a new record.

Projection choices (documented in the scorer, not findings): the engine excludes the BMS symbolic-map copybook CUSTMS.cpy as machine-generated (excluded_artifacts) and resolves COPY CUSTMS to the BMS mapset, so the key lists the mapset as an alternative and that member's facts are unscored. SYSOUT DDs are unscored, because job_flow_data records only DSN DDs (core/job_flow.py). REDEFINES overlays in layouts are unscored, because record_layout skips them by design. EXEC SQL CALL procedure names are unscored, because there is no column for them.

Seen while probing, not scored yet (phase 1): a JCL raw_imports entry for DSN=PROD.ACCT.MASTER(+1) is truncated to PROD.ACCT.MASTER( ((0) keeps its generation). In a numbered member, a sequence number on an otherwise blank line extends the preceding unit's extent.

Local checks

python tests/ruff_audit.py --ci, tests/mypy_audit.py --ci and tests/dead_key_audit.py --ci all pass. pytest tests/estate_crucible: 9 passed (end-to-end included, with the checkout at the pin).

Cross-repo

Companion: squid-protocol/estate-crucible v0.1.0 (already tagged; generator, key, 8 seed horrors, GnuCOBOL compile check green). Merge order: none needed, since the crucible tag exists. Nothing re-runs after merge: this is not a gate.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

… key (#4317)

tests/_estate_crucible_pin.py pins squid-protocol/estate-crucible v0.1.0;
tests/tools/estate_crucible.py scans its estate/, reads the master DB through
GalaxyIR (plus calls_out_to / transfers_to, synthetic units, raw_imports) and
scores 14 channels per fact: pass / fail / missing / phantom / unscored, with a
per-horror verdict. Not a CI gate yet (#4317 phase 5).

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

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant