Repository navigation
Description
Found while rescanning the opensourcecobol4j fresh estate (#3806, epic #3803) on origin/main 6991970d. This was pre-trial generation with no porting. The generated jp-compat project still does not compile after #3957 / #3965: 10 controllers fail (mvn -o compile, JDK 17).
Defect
generate_rest_controller (gitgalaxy/tools/cobol_to_java/cobol_to_java_api_contract_forge.py) takes the transactional branch whenever base_intent.files_requested is empty and the program is not CICS. That is the case for a batch program with no JCL: PC dialects (GnuCOBOL, opensourcecobol4j, Micro Focus) and any estate scanned without its JCL. For each lineage.inputs entry, the branch then emits @RequestBody <Input>DTO <input>Data, but no <Input>DTO class is generated anywhere (the run reports "Transient DTOs Generated: 0"). The result is cannot find symbol: class TestFileDTO.
#3965 fixed the identifier (./testFileDTO -> TestFileDTO), which only moved the failure from the parser to symbol resolution. Programs 058/059 use a plain ASSIGN "TEST-FILE". They had this same undefined reference yesterday, hidden because javac stopped at the parse errors.
Minimal reproduction (origin/main 6991970)
mkdir -p estate
cat > estate/ASGPATH.cbl <<'COB'
IDENTIFICATION DIVISION.
PROGRAM-ID. ASGPATH.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT TEST-FILE ASSIGN "TEST-FILE"
ORGANIZATION SEQUENTIAL
FILE STATUS F-STATUS.
DATA DIVISION.
FILE SECTION.
FD TEST-FILE.
01 TEST-RECORD PIC X(10).
WORKING-STORAGE SECTION.
77 F-STATUS PIC X(02).
PROCEDURE DIVISION.
OPEN I-O TEST-FILE.
DISPLAY F-STATUS.
CLOSE TEST-FILE.
STOP RUN.
COB
python -c "import sys; sys.argv=['r','estate','--scan']; from gitgalaxy.cobol_refractor_controller import main; main()"
python -c "import sys,glob; sys.argv=['j',glob.glob('estate_gitgalaxy_clean_*')[0]]; from gitgalaxy.cobol_to_java_controller import main; main()"
cd estate_gitgalaxy_java_spring_* && mvn -q -o compile
# AsgpathController.java:[18,22] cannot find symbol -- symbol: class TestFileDTOThe IR has lineage.inputs = ['TEST-FILE'], base_intent.files_requested = [], is_cics = False.
Expected
The generated project compiles. Options:
- Classify a non-CICS program that has FILE-CONTROL files as batch even without JCL: use the SELECT / FD, not only JCL DDs, so it gets the
MultipartFilesignature. - Or have the transactional branch reference only classes that are actually generated, e.g. the FD record's DTO (
...TestRecord), and skip the parameter otherwise.
A regression test should compile a generated project for a no-JCL batch program, the way the CI already compiles the CardDemo output.
🤖 Generated with Claude Code
Activity
Fix #3998: no-scan lineage reads SELECT with the engine's reader (#3999)
CardDemo batch: four more programs proven; loop and harness fixes the…