Repository navigation
COBOL→Java porting loop: bring-your-own LLM, a person approves, the harness proves (#3753) - #3763
Merged
Merged
Conversation
…ic, by default (#3752) Every generated program leaves business logic to write, but no program got a porting ticket by default: the ticket stage needed `--var` slicing, so CardDemo got 0. New cobol_to_java_port_tickets writes one ticket per program with business-logic worklist items, on every skeleton-driven run (features.agent_tickets): ai_agent_jobs/<KEY>_port_ticket.json plus a Markdown twin. A ticket holds: - the target: the service to fill, its public methods and which are still TODO, the overlay path a port lands on, and the chosen target stack (Java / Spring Boot / database / integration / UI; no local paths or credentials); - the source: numbered listings (columns 1-72) of the program and its copybooks, written once each under ai_agent_jobs/sources/ and referenced (DSF's shared includes took tickets from 103 MB to 46 MB), and its paragraphs; - the facts: the verified skeleton's sections, with field-testing status; - the generated classes it builds on: those the service imports (entities with codecs, repositories, DTOs, the batch runtime) and every artifact the traceability manifest ties to the program; - its worklist items, the porting rules the #3624 slice proved, and the deliverable (one Java file, proven by the equivalence harness, approved by a person). The worklist links each program's items to its ticket, JSON and Markdown. Result: CardDemo gets 44 tickets (previously 0), DSF 438. publish_examples leaves ai_agent_jobs/sources/ out of the published examples: the listings are the pinned source, regenerated with the tickets. Tests (test_port_tickets.py, a real scan) pin a ticket's contents, the worklist link and determinism across two runs. Part of epic #3755. Closes #3752 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
…icit concatenation, #3762) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
… MainframeClock Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
# Conflicts: # gitgalaxy/tools/cobol_to_java/cobol_to_java_port_tickets.py
… CobolRecords in the prompt (#3753) - equivalence_java: a sequential input dataset (no entity) is copied into the datasets directory the program opens it from; CBTRN02C's DALYTRAN was never there. - equivalence: a FILLER difference is counted apart (filler_differs) and shown in the report, not failed: no program can name it; after INITIALIZE it holds the runtime's leftover record area. - port_runner: the prompt always carries the runtime helpers (DatasetResolver, MainframeClock, CobolRecords); a re-proof of an attempt starts from a clean report dir; lint (X | None, S310). - port tickets: a rule to decode/encode zoned, COMP-3 and COMP fields only through CobolRecords or the entity codecs, never a hand-written decoder. With these, Gemini 3.1 Pro (via agy, the command backend) ported CBACT04C and CBTRN02C and both were proven by the harness: ACCTFILE 50/50, TRANSACT 50/50; ACCTFILE 50/50, TCATBALF 100/100, TRANFILE 262/262, DALYREJS 38/38, RETURN-CODE 4 = 4. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g # Conflicts: # gitgalaxy/tools/cobol_to_java/cobol_to_java_port_tickets.py
Contributor
…ernal documents write (#3753) - port_runner._post refuses any scheme but http/https before urlopen (Muninn dynamic-urllib-use-detected; nosemgrep as in templates/bitbucket, now with a real guard). - dead_key_audit: "choices" (the chat completion response) and "equal" (the harness's report.json) are written outside gitgalaxy/. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
…and never follows a redirect (#3753) urllib follows a POST's 301/302/303 and forwards every non-content header -- the Authorization / x-api-key included -- to the new location; the backends now use an opener that refuses redirects. Plain http is accepted only to a loopback host (a local vLLM / Ollama), so a key never crosses a network unencrypted; file: and custom schemes are refused. Tests: a real local server answering 302 gets exactly one request and the call fails. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3753. Part of epic #3755; builds on #3752 (merged as #3762).
What it is
python -m gitgalaxy.tools.cobol_to_java.port_runnerturns each porting ticket into done work, and the customer stays in control at every step:Propose with the model you choose. Backends:
openai: any OpenAI-compatible endpoint (a local vLLM or Ollama, Azure, a gateway);anthropic;command: any CLI, e.g. an in-house model oragy.A person can also write the port and
submitit. Keys are read from an env var you name and never stored. The port lands as an overlay, so the generated sources are never edited.Prove.
proveruns the equivalence harness on the overlay: the original COBOL and the port run on the same inputs, and every output record is compared field by field, along with the RETURN-CODE.Approve.
review --approve|--reject --by NAME: nothing is accepted without a person.Status.
statusreports per ticket and per model what was proposed, proven, approved and rejected, from the append-onlyai_agent_jobs/ports/port_log.jsonl. "Percent automated" becomes evidence, not a claim.This differs from tools that say an LLM "converts" COBOL: here you choose the target stack (17 configs), the model and the reviewer, and every port carries a proof.
Measured (CardDemo batch, Gemini 3.1 Pro via
agy, thecommandbackend)Every failure between rounds was traced to its cause and fixed on our side, not by hand-editing the model's answer:
Both ports named the original programs' own defects in comments and preserved the behavior. Both are proven but not yet approved: approval is a person's call. Details are in
docs/cobol_to_java_porting_loop.md.Changes
port_runner.py(new): the prompt carries the ticket's rules, the service, the imported generated classes, the runtime helpers (DatasetResolver, MainframeClock, CobolRecords), the listings, facts and worklist.MainframeClock(gitgalaxy.clock), so a run can be pinned.--port DIR;filler_differs(a FILLER can't be named by any program; after INITIALIZE it holds the runtime's leftover record area).tests/equivalence/carddemo-posttran(CBTRN02C, job POSTTRAN, CardDemo's own data; the source's Apache-2.0 LICENSE and NOTICE included).test_port_runner.py, which runs the loop end to end with stand-in backend and proof commands, plus a FILLER diff test.tests/cobol_mainframe: 675 passed, 1 skipped locally.Not covered here: a hosted API backend was not exercised live, because no keys are configured on this machine; it is covered by the request-shape code path and the missing-key test.
🤖 Generated with Claude Code
https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g