Propose COBOL COMMAREA forwarding length guards

Proprietary

Guard a fixed-target CICS LINK or XCTL that forwards the unchanged incoming COMMAREA. Require explicit approval that its advertised length must be backed by actual received bytes. Require exact caller and ordinary COPY snapshots, a complete admitted entry interval and an approved existing terminal exit. Accept a positive literal length or a proven local halfword value within the declared area. Require a concrete short arrival to reach the original command. Retain that conditional finding when an unresolved exit or layout prevents an edit. Insert a typed IF sentence only when every arrival has a known unchanged count and at least one accepted arrival remains. Preserve every original byte outside the guard. Reprove the same command with exactly the accepted arrivals and the same advertised length. Keep native counts above 9999, aliases, unknown effects, alternate entries, NEXT SENTENCE and incomplete source unresolved. Application-team review remains required. The proof does not establish allocation size, command success or a callee read. Do not change the original length, target or response handling. Do not add retries, commits, rollbacks, ABEND or new error routines. Preserve known received counts after a supported incoming-area MOVE or plain character DISPLAY only when they cover its complete read extent. Keep paths with an earlier short read unknown. They cannot authorize a later guard insertion. Successful output remains unproven.

io.moderne.mainframe.security.ProposeCommareaForwardLengthGuard

Required

Exact repository-relative source path covered by the approved contract.

Exact program ID. Retain quotes for a literal ID. Literal contents match case exactly.

Lowercase SHA-256 of the complete UTF-8 source text without a byte order mark. The approved entry and exit contract must cover this exact snapshot.

JSON object mapping every ordinary data COPY name to its approved lowercase SHA-256.

Explicit approval of RECEIVED_BYTES_ONLY at this site. The original advertised forwarding length must be backed by actual received bytes, even when more storage might be allocated.

One-based EXEC CICS line selected by the approved source contract.

Exact outermost-first dotted declaration name of the incoming LINKAGE area.

Exact outermost-first dotted declaration name of the actual received byte count at normal entry. Its storage must be separate from the area.

Smallest admitted incoming byte count. Every integer through the maximum must be admitted by the approved contract.

Largest admitted byte count. Must be at most 32767 and no larger than the declared incoming record. The complete interval must fit the existing numeric proof.

Existing paragraph approved for insufficient received lengths at this exact site. An optional IN or OF section qualifier is supported. The contract must establish that this path preserves required cleanup, messages and transaction behavior.

Provenance of the approved entry and exit contract. The recipe records this input and does not fetch or infer the contract.

mod run . --recipe=io.moderne.mainframe.security.ProposeCommareaForwardLengthGuard \ -P sourcePath=security/cbl/VFWGLIT.cbl \ -P programName=VFWGLIT \ -P sourceSha256=0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \ -P copybookSnapshots='{}' \ -P forwardingPolicy=RECEIVED_BYTES_ONLY \ -P forwardLine=15 \ -P commarea=DFHCOMMAREA \ -P receivedLength=DFHEIBLK.EIBCALEN \ -P minimumLength=0 \ -P maximumLength=16 \ -P approvedExit='LENGTH-ERROR IN ERROR-HANDLERS' \ -P contractSource='mainframe-fixtures/README.md fictional incoming-area contract'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.