Skip to content

feat(cobol-to-java): migration worklist — every generator TODO as one plan (#3651) - #3687

Merged
squid-protocol merged 2 commits into
mainfrom
feat/migration-worklist-3651
Sep 26, 2026
Merged

squid-protocol merged 2 commits into
mainfrom
feat/migration-worklist-3651

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Closes #3651. Part of #3625.

What

Every cobol-to-java run now writes migration_worklist.md and migration_worklist.json next to the generated project. Together they list every TODO the generators left, as one plan:

  • Each item has a stable ID (WL-0001), a category, and the COBOL source it belongs to. It also gives the file:line in the generated project, the symbol(s) it affects, and the facts it rests on (source line, ledger field and field-testing status, from traceability.json, Java conversion: machine-readable traceability manifest (every generated artifact -> its source facts) #3650).

  • Categories each carry a suggested resolution. For example, a COMMAREA mismatch says: "for each caller, confirm which layout the callee reads… map that caller's record onto the DTO, or give the callee one DTO per entry".

  • Nature is the effort class a pilot plans with:

    • conflict: two facts disagree, so a person decides which one the Java follows;
    • fact-gap: a fact is missing, so supply it and re-run;
    • review: the Java runs as generated, but check it on the target;
    • port: business logic to write.

    No hours are invented. The counts per nature are the inputs to an estimate.

  • The markdown has summary tables by nature, category and COBOL source, then a checklist (- [ ]) per category grouped by program. A team can work straight from it.

  • The audit gets a new section [3] MIGRATION WORKLIST with the counts.

corpus items conflict fact-gap review port
CardDemo 209 31 5 55 118
CBSA 162 33 6 46 77
GENAPP 338 72 0 185 81
DSF 8 0 0 1 7
zECS 90 0 1 74 15
zopeneditor 13 0 2 1 10

How the join works

Two sources are joined per file:

  1. TODO comments in the Java, resources and build files. These are the ground truth, with line numbers; a Javadoc TODO keeps its wrapped lines.
  2. The manifest's TODOs. These add symbols and facts. A manifest TODO claims the first Java TODO with the same text in its file.

A manifest TODO with no Java line is still an item. That covers per-statement DB2 notes, and RESPs past the class comment's 30-entry cut-off. If the same Java note is recorded for several endpoints, it becomes one item listing every symbol.

The only fold is explicit: the DB2 repository's once-per-class "this SQL is DB2's" line, where its statements are already itemised. I reconciled this on all 6 corpora: every Java TODO is accounted for, and there are no duplicates.

An item belongs to the program whose Service or Controller it sits in. The controller supplies an estate-relative class→COBOL-file map, so a COMMAREA mismatch is filed under the callee, not under the callers its facts cite.

Drift guard. test_every_generator_todo_has_a_category scans every TODO: template in tools/cobol_to_java/*.py. A generator that starts writing a new kind of TODO fails CI until it gets a category.

A #3650 fix found along the way

TraceLog deduped on (file, symbol, kind). Unchecked RESPs are class-level entries, so the manifest kept only the first per service. The key now includes the facts' sources: different COBOL lines are different findings. Manifest TODOs went from 113 to 256 on GENAPP and from 6 to 74 on zECS.

Safety

  • Generated Java is byte-identical to main. I ran 6 corpora × 3 configs and diffed everything except the manifest, the audit and the worklist: 1,627 files, no differences.
  • Refraction snapshots re-blessed. The excerpts and full snapshots change only in the audit's section [3] and the two new worklist files per corpus.
  • Tests: tests/cobol_mainframe + tests/tools_recorders gave 884 passed. Preflight --java is all PASS. The new test_migration_worklist.py covers:
    • classify and normalize;
    • the join (claim, manifest-only, merge, fold, same-text-different-line);
    • the TraceLog regression;
    • a real scan: a CSD, three programs, two callers passing different records, and unchecked RESPs.

Observation (not changed here)

A resolved caller's record outranks the callee's own LINKAGE DFHCOMMAREA, even when that declares concrete fields of a different width (31 vs 6 bytes in the test estate). That is the #3615 precedence. The worklist shows the resulting mismatch correctly. I'm filing it as a separate issue for discussion.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

… plan (#3651)

Every run now writes migration_worklist.md + .json next to the generated project.
Each open item is filed by category and COBOL source, with its file:line, symbol(s),
the fact it rests on (from traceability.json) and a suggested resolution. Items are
grouped by nature (conflict / fact-gap / review / port), and the audit gets a
section [3] with the counts.

Two sources joined per file: TODO comments in the Java, resources and build files
(the ground truth, with lines) and the #3650 manifest's TODOs (symbols and facts).
Every TODO is accounted for: an item, a manifest twin, or the DB2 repository's
declared once-per-class summary. A drift test fails when a generator writes a TODO
kind with no category.

Fixes a #3650 bug found by the reconciliation: TraceLog deduped on
(file, symbol, kind), keeping only a service's FIRST unchecked RESP. Different
COBOL lines are now different findings (GENAPP manifest TODOs 113 -> 256).

Generated Java byte-identical to main (6 corpora x 3 configs); refraction
snapshots re-blessed: the audit's section [3] and the two worklist files only.

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 bfca9b1 into main Sep 26, 2026
36 checks passed
@squid-protocol
squid-protocol deleted the feat/migration-worklist-3651 branch September 26, 2026 00:05
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: migration worklist from the generators' TODOs (by category and program)

2 participants