LET'S MAKE AN AIGENT / CRAIG 1.0
Know what CRAIG can explain.
CRAIG stands for Cobol Rules Articulation Illustration Generator. It is a working browser-local application with a deterministic tokenizer and recursive scope parser for a documented COBOL subset. It is not a full COBOL compiler, a runtime, or a production migration validator.
Quick start
- Open CRAIG. The built-in lending program and copybook are analyzed automatically.
- Choose Upload COBOL to replace the example with your files. Select programs and copybooks together. Use Add copybooks to merge additional files.
- In Source workspace, choose the format, edit source, or create a file to paste code.
- Click Analyze project. Inspect extracted rules, original source ranges, and analysis gaps.
- Add reviewer notes and mark interpretations reviewed. Explore rule illustrations and boundary test candidates.
- Export a report, analysis JSON, rules CSV, or a reopenable project JSON. SVG diagrams and test-case CSV have separate download buttons.
Supported extraction
| Construct | Behavior |
|---|---|
| Fixed/free format | Auto detection or explicit selection. Fixed source uses columns 8–72; sequence area is ignored. Original source lines are retained. A SOURCE FORMAT directive takes precedence. |
| Comments and strings | Fixed comment indicators and free inline *> comments; single/double quoted literals with doubled-quote escapes. Continued literal forms require preprocessing. |
| Plain COPY | Resolves a supplied copybook by case-insensitive base name; recursively expands it with original file/line provenance. Library qualification and REPLACING require preprocessing. |
| Data declarations | Named levels 01–88, PIC/PICTURE, basic USAGE, VALUE, REDEFINES and OCCURS inventory. Group/condition names have no inferred business description. FILLER is omitted. |
| IF / ELSE | Nested lexical guards, explicit END-IF, and separator-period scope termination. Conditions remain COBOL text; abbreviated condition syntax is not expanded or evaluated. |
| EVALUATE | Single selection subject, consecutive WHEN alternatives, WHEN OTHER, and nesting. Selection text is retained; runtime matching and complex selection semantics are not evaluated. |
| MOVE | Basic non-CORRESPONDING assignments with source-derived articulation. |
| COMPUTE / arithmetic | Basic COMPUTE, ADD … TO, SUBTRACT … FROM, MULTIPLY … BY, DIVIDE … BY/INTO, and source text including GIVING/ROUNDED. Numeric execution and storage behavior are not simulated. |
| DISPLAY / CALL | Output statements and program call references. Literal calls are matched against supplied program names; dynamic targets remain unresolved. |
| PERFORM | Paragraph references are inventoried only. Invocation conditions are not propagated into paragraph rules. Inline loop bodies are withheld. |
| Boundary candidates | Explicit field-to-number comparisons using =, <>, <, >, <=, >= and an unambiguous basic numeric PIC. Below/at/above values use exact decimal arithmetic and valid basic PIC ranges. No COBOL tests are executed. |
Explicit limitations
CRAIG extracts lexical source actions, not complete business semantics. It does not calculate prior values, prove reachability, expand paragraph calls, follow interprogram state, model REDEFINES aliases, or infer policy purpose. GOBACK/STOP and conditional exits can make later lexical rules unreachable. The catalog is source order, not execution order.
Unsupported constructs generate findings. SQL/CICS and other EXEC blocks are not parsed. READ/WRITE and file exception clauses, SET, SEARCH, STRING/UNSTRING, CORRESPONDING, inline loops, and many dialect extensions are outside the subset. Unsupported constructs are withheld to an explicit matching terminator or the next separator period; later rules may have partial context. An exception clause on an otherwise recognized action withholds the containing sentence. Missing copybooks, COPY REPLACING, preprocessing directives, fixed continuation/debug lines, decimal-comma conventions, and multi-program compilation files withhold procedure extraction for that program. Split units or use compiler-preprocessed free-format source.
A report without detected gaps still does not establish valid COBOL or full semantic coverage. The analyzer is deliberately bounded; retain original runtime tests and business-owner review before any modernization decision.
Storage and privacy
The application has no analysis API endpoints, external third-party scripts, analytics, or LLM dependency. Static hosting serves the app assets; imported source is not transmitted to that host. Source files are read into browser memory. A web worker is used on static hosting when available; opening the files directly uses the same analyzer on the main thread.
Save in this browser explicitly writes one project, including source, into localStorage for this origin. Nothing is saved automatically. Load saved project restores it; Remove browser copy deletes that saved copy while keeping the in-memory project. localStorage is not encrypted; do not use it for source that your policies prohibit storing in browser storage. Reports, project JSON, and exports may contain the complete source and notes.
Source changes invalidate review marks. Notes on unchanged rules can survive reanalysis. Reanalysis of unchanged files retains reviews and notes. Reloading without explicit save/export loses the in-memory project. Imported project JSON is validated and reanalyzed; exported analysis results are not trusted as executable input.
Import and project limits
- UTF-8/ASCII or Windows-1252 source imports. EBCDIC must be converted externally.
- 60 source files, two million source characters total, 180,000 tokens per file, 20 copybook nesting levels, 90 parser nesting levels.
- Unique case-insensitive filenames. Ambiguous copybook base names are flagged.
- The rules list is paginated. Large data, dependency, gap, and case tables show the first 500 rows; reports contain all rows. Rule illustration selection lists up to 3,000 rules.
- Browser worker analysis has a 20-second timeout; split larger projects. Direct-file fallback runs synchronously within the same input limits.
- CSV cells that could be interpreted as spreadsheet formulas are prefixed with an apostrophe.
Deploy under letsmakeanaigent
Copy the entire craig/ folder beside your existing INDEX.HTML. Paste the supplied integration block into the main page's body. The block links to ./craig/index.html; CRAIG's home links point back to ../INDEX.HTML. Change those paths if your main file uses different capitalization or nesting. No Node/Python server is needed in production.
Reference semantics
The scope and copybook handling boundaries were checked against IBM's language documentation: scope terminators, COPY, and numeric literals. CRAIG implements only the extraction subset described above.
CRAIG 1.0.0 · letsmakeanaigent · Deterministic extraction, traceable evidence.