Skip to content

Hand the engine's verified skeleton to the Java generator (#3614) - #3631

Merged
squid-protocol merged 1 commit into
mainfrom
feat/skeleton-handoff-3614
Sep 25, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
feat/skeleton-handoff-3614

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3614 (part of epic #3625).

What

When the refractor runs against the engine (--galaxy-db / --scan), it now writes 06_skeleton/:

  • <key>_skeleton.json per program:
    • the program block: file, PROGRAM-IDs, LOC, copybooks
    • the engine's own channels: units, calls, entry points, DD names, records, transactions, SQL tables and statements, CICS resources and tasks, job submits, MQ, UOW/handlers, FILE-CONTROL, DL/I, web services
    • that program's rows of every cross-file join: entry transactions, navigation, COMMAREA and CALL USING contracts, dynamic and unresolved calls, remote calls, screen bindings, CICS file / TD-queue lineage, async tasks, job submissions, DB2 table access, MQ queues, units of work, error handlers, unchecked RESPs, VSAM files, dataset lineage/flows, IMS calls/access, data flows
  • estate.json:
    • estate-wide joins: job steps, job dataset flow, CSD resources, CICS file / TDQ datasets, DB2 plans, TDQ trigger starts, queue / container / MQ flows, remote resources, IMS segment access
    • inventory, completeness and the API surface

Each section names its ground-truth ledger field and carries that field's field-testing record: its status (field-tested / open / untested), plus how many public and private estates it was tested on. The export states facts only. An empty section means the engine found nothing, and a field missing from the record reads as untested.

The record ships as gitgalaxy/standards/fact_channel_confidence.json (package data). tests/tools/field_testing.py report --write generates it, and check and test_field_testing fail when it is stale.

Java side

  • cobol-to-java reads 06_skeleton/ when it is there.
  • Each agent ticket gets context.verified_skeleton: the program's non-empty sections with their field-testing status.
    • Records, data flows and units are left out and named by file, because they run to thousands of rows.
    • The system prompt adds one instruction: use these facts as given, invent no others, and report in diagnosis any place the slice contradicts an open section.
  • java_migration_audit.txt gets a [2] VERIFIED SKELETON section: facts and programs per ledger field, with field-testing status (public / private).

CardDemo (fresh scan)

44 program skeletons plus estate.json, 8.8 MB in total; the largest is COACTUPC at about 1 MB, mostly data flows. The largest agent ticket is 206 KB. Audit excerpt:

    call targets                        190        40  open (6 / 0)
    data moves                         5355        44  field-tested (6 / 0)
    entry transactions                  153        25  open (4 / 0)
    record fields                       430        44  field-tested (6 / 0)
    units of work and handlers          195        25  field-tested (6 / 0)

Unchanged by default

  • Without --galaxy-db / --scan no skeleton is written, and tickets and audit are byte-identical.
  • refraction_snapshot.py check: 0 differ on all 6 corpora.
  • Full suite: 11521 passed, 29 skipped, 9 xfailed, 3 xpassed.
  • ruff_audit.py --ci: clean.

Tests

tests/cobol_mainframe/test_skeleton_export.py covers:

  • every section maps to a ledger field the confidence file records;
  • every join is an argument-free GalaxyIR method;
  • per-program filtering, including the callee seeing an incoming COMMAREA contract;
  • an unknown field reads as untested;
  • an end-to-end run of refractor then Java generator on a real scan;
  • with no engine, no skeleton is written.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

With --galaxy-db / --scan the refractor now writes 06_skeleton/: one
<key>_skeleton.json per program and an estate.json. A program's skeleton
holds its calls, entry transactions, COMMAREA and CALL USING contracts,
CICS / DB2 / MQ / IMS / VSAM resources, screens, records, data flows,
units of work and error handlers. Each section names its ground-truth
ledger field and carries that field's field-testing status
(field-tested / open / untested) and its public/private estate counts.

The status comes from gitgalaxy/standards/fact_channel_confidence.json.
tests/tools/field_testing.py generates it and ships it as package data;
`check` and the test fail when it is stale.

cobol-to-java puts the skeleton in each agent ticket as
context.verified_skeleton, leaving out the bulk data sections, which the
ticket names by file. The migration audit gets a section listing facts
per channel with their field-testing status. With no skeleton, all output
is unchanged: the refraction snapshot shows 0 differ on all 6 corpora.

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

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 35f1e79 into main Sep 25, 2026
37 checks passed
@squid-protocol
squid-protocol deleted the feat/skeleton-handoff-3614 branch September 25, 2026 15:54
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.

Java conversion: hand the verified mainframe skeleton to the generator

1 participant