Skip to content

Fix Extraction hardening: jcl #961 - #963

Merged
squid-protocol merged 4 commits into
mainfrom
fix-extraction-jcl
Aug 2, 2026
Merged

squid-protocol merged 4 commits into
mainfrom
fix-extraction-jcl

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fix Extraction hardening: jcl #961: Harden JCL extraction rules against implicit syntax, parameters, and dataset dependencies

This fix was developed using the rigorous 5-stage agent pipeline, addressing critical extraction flaws in JCL:

What the Agents Found:

  1. func_start: The EXEC statement stepname is actually optional. The previous regex strictly required a stepname (e.g. ([A-Za-z0-9_#$@]+)), missing all unnamed job steps entirely.
  2. args: JCL parameters (PARM= on EXEC steps and symbolic parameters on PROC definitions) were completely ignored (None). The agents mapped the syntax for both, including edge cases like single-quoted strings with escaped quotes ('O''BRIEN').
  3. _dependency_capture: The previous extraction only captured INCLUDE MEMBER=.... The agents identified that the most critical JCL dependencies—datasets (DD DSN=...) and procedure libraries (JCLLIB ORDER=...)—were ignored.

Red Team Adversarial Testing:
Constructed an extensive JCL adversarial testing suite with 38 distinct test scenarios encompassing:

  • Missing stepnames and special characters.
  • Multi-line JOB statements and inline comments parsing.
  • Escaped quotes within parameters.
  • Valid vs. invalid dependencies (e.g., filtering out temporary datasets like &&TEMP).

Engineering Implementation:

  • Updated func_start to make the stepname capture group optional (* instead of +).
  • Implemented args extraction to capture EXEC ... PARM= values and PROC variables.
  • Expanded _dependency_capture to parse dataset names (DD DSN=...) and JCLLIB dependencies, explicitly ignoring internal back-references (*) and temporary datasets (&&).

QA Auditing (Crucible):
Verified the changes via crucible_check.py. As expected, this caused significant structural drift across the JCL ecosystem. The JCL total_mass correctly expanded, and architectural fingerprints shifted accurately given the massive influx of previously blind dependencies (e.g. datasets). The new JCL golden master (golden_master_zero_dep_audit.json) has been regenerated and committed.

Known Limitations:

  • No Block Shielding for Instream Data: Since JCL has no AST and is evaluated purely line-by-line, the regex engine remains vulnerable to matching JCL lookalikes embedded within instream data (//SYSIN DD * or //DD DATA).
  • Multi-line Continuations: Native line continuations wrapping arguments or dependencies mid-string across lines (using the column 72 X marker) cannot be robustly reassembled with single-line regex rules.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit 3d16590 into main Aug 2, 2026
28 checks passed
@squid-protocol
squid-protocol deleted the fix-extraction-jcl branch August 2, 2026 02:40
@squid-protocol

Copy link
Copy Markdown
Owner Author

closes #850

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