Skip to content

The porting loop on CardDemo: an unattended model proves 5 programs, and the tooling it needed - #4040

Merged
squid-protocol merged 7 commits into
mainfrom
feat/porting-loop
Sep 30, 2026
Merged

squid-protocol merged 7 commits into
mainfrom
feat/porting-loop

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

This PR runs the porting loop (#3753) unattended on CardDemo and fixes the tooling gaps it exposed. A model ports each program from its ticket, the equivalence harness proves the port, and a failed proof becomes the next attempt's feedback. Full write-up: docs/language_status/porting_loop.md.

Results

The model is Claude Sonnet 5.5, run headless (claude -p) with no tools, no MCP and no repository settings, from an empty directory. It sees only the ticket's prompt.

program kind proven on attempt proof covers
CBACT04C (INTCALC) batch 1 2 outputs, 19 fault runs
CBTRN02C (POSTTRAN) batch 1 4 outputs, 28 fault runs
CBTRN03C (TRANREPT), new case report 1 447 lines, 24 fault runs
COMEN01C, new case CICS 1 11 scenarios
CSUTLDTC, new case CALL + LE CEEDAYS 2 11 CALLs

CardDemo is development data, so these are loop / tooling numbers, not fresh-estate trial numbers.

What failed, and the fix (each is in this PR)

  • Missing API in the ticket. The prompt lacked CobolFiles / CobolAbend, so the port did not compile. They're now in the prompt, and the rule states return types.
  • KSDS WRITE semantics. A WRITE of an existing key must be status 22, but the port used save(). Added CobolFiles.writeKeyed / rewriteKeyed and a rule, plus a rule on record copies and silent READ errors.
  • CICS test clock. The equivalence test never set the task's clock, so task.now() was null for any port that followed the rules. It is now set.
  • CALLed program signature. void handleCall(String…) could not return BY REFERENCE results or the RETURN-CODE. It is now CobolRef<T> / int (call forge; test_service_calls updated).
  • Unrunnable programs. The harness could not run a CALLed subprogram, and INQUIRE PROGRAM was untranslated. Added:
    • the new case kind call (tests/tools/equivalence_call.py);
    • a documented CEEDAYS model (tests/equivalence/le/ceedays.c), which refuses what IBM's docs don't settle (other pictures; a month outside 1–12: 2508 or 2517?);
    • INQUIRE PROGRAM in the translator, stub and CicsTask, injectable.
  • Unusable feedback. Proof feedback used to be Maven noise. report.json now carries a feedback section: the first differing records / events, failing fault runs, and errors once each with the port's own stack frames.

Also in here

Verification

  • tests/cobol_mainframe + tests/cics_crucible + tests/tools: 1342 passed, 29 skipped (plain pytest, outside the repo).
  • New test_porting_loop_tooling.py: 11 passed with EQUIVALENCE_E2E=1, including:
    • CEEDAYS checked against Python's calendar;
    • end-to-end proofs of the three committed loop ports.
  • CICS crucible --ci: 108/44/0, unchanged, and the coverage ledger reproduces.
  • ACCTVIEW's committed port still proves with the changed CicsTask.
  • audit_check.py all clear; trial.py check valid.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ

…and the tooling it needed

tests/tools/porting_loop.py drives port_runner end to end on one equivalence case. A model
(Claude Code headless: no tools, no MCP, run in the attempt's own directory, so it sees only
the ticket's prompt) ports the program. The harness proves it: every output / event / CALL and
every fault run. A failed proof's findings are the next attempt's feedback.

Results (Claude Sonnet 5.5):
- INTCALC (CBACT04C): attempt 1, 19 fault runs.
- POSTTRAN (CBTRN02C): attempt 1, 28 fault runs.
- TRANREPT (CBTRN03C), new case: attempt 1, 447 report lines, 24 fault runs.
- COMEN01C, new CICS case: attempt 1, 11 scenarios.
- CSUTLDTC, new CALL case: attempt 2, 11 CALLs through CEEDAYS.
Details, and what each failure taught: docs/language_status/porting_loop.md.

The failures were in what we gave the model; each is fixed here:
- the prompt lists CobolFiles / CobolAbend, and the file-status rule states return types;
- CobolFiles.writeKeyed / rewriteKeyed: a KSDS WRITE of an existing key is 22, not save();
  rule on record copies and silent READ errors;
- the CICS equivalence test sets the task's clock (task.now() was null);
- a CALLed program's BY REFERENCE elementary item is a CobolRef<T>, and handleCall /
  call<Target> return the RETURN-CODE (the void/String signature could not be correct);
- new case kind "call" (equivalence_call.py) and a documented CEEDAYS model
  (tests/equivalence/le/ceedays.c) that refuses what IBM's docs don't settle;
- EXEC CICS INQUIRE PROGRAM in the translator, stub and CicsTask, injectable like READ;
- proof feedback in report.json: first differing records / events, failing fault runs,
  compiler / test errors once each with the port's own frames.

New cases: carddemo-trnrpt (its last transaction out of range, so the program's NEXT SENTENCE
defect is proven), carddemo-menu, carddemo-dateutil. Each has the loop's port, unedited, with
port/provenance.json. .gitignore now admits equivalence case.json and provenance.json.
Filed along the way: #4037 (reserved-word column), #4031 (engine END- paragraphs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
Comment thread tests/tools/equivalence.py Fixed
Comment thread tests/tools/equivalence_call.py Fixed
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

squid-protocol and others added 4 commits September 30, 2026 10:51
…ailure, build a case

The `porting-loop` skill records the loop's workflow and what this round taught:
- how to run it (JDK 17, the corpora cache, the no-tools headless model, parallelism);
- a table for deciding who owns a failure (ticket, harness, runtime, generator, model, case), with the fix each
  round made;
- how to build a case worth measuring (faults, coverage gaps, IBM services modelled only where documented);
- how to commit a proven port with provenance;
- the environment traps.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
…on ignore rule

PR #4025 described committing provenance.json with each crucible port (model, backend, attempt,
ticket hash, attempt history), but .gitignore's blanket *.json dropped every one; they survived only
in that PR's worktree. Copied back unchanged, and the ignore rule now admits them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
…red pieces live in equivalence_common

CodeQL flagged equivalence.py importing equivalence_call, which imported equivalence back for
diff_records and java_failure_report. equivalence_cics had the same back-import for the failure
report. The harness already keeps what every module shares in the leaf module equivalence_common
("no cycle; re-exported here"), so the record diff (diff_records with its two helpers) and
java_failure_report move there verbatim, and equivalence.py re-exports them. The submodules now
import only equivalence_common. No behaviour change: the harness tests pass, and the CALL case
and a batch case with fault runs still prove end to end.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RZE6us7fUL6Hynk59rWLvZ
@squid-protocol
squid-protocol merged commit 828997e into main Sep 30, 2026
38 checks passed
@squid-protocol
squid-protocol deleted the feat/porting-loop branch September 30, 2026 17:38
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.

2 participants