Analyze COBOL COMMAREA write lengths

Proprietary

Analyze direct MOVE writes beyond the received COMMAREA under an explicit entry contract. Support one ordinary character field or fixed DISPLAY group destination, including table-free slices with positive literal bounds. Count the full receiving width, including padding from a shorter source, and include the destination offset. Accept quoted ASCII literals of at most 256 characters, SPACE, SPACES and separate ordinary standalone PIC X sources. Follow the bounded incoming-length flow through IF, EVALUATE, direct jumps and proven exits. Observe the write before applying the existing transfer barrier. Unknown effects and changed counts cannot manufacture witnesses. Require complete unaliased storage and ordinary source without debugging mode or compiler directives. Support validated data copies and the standard native EIBCALEN field under the existing provenance checks. Keep native counts above 9999 unresolved. Ordinary numeric fields retain their existing range proof. Multiple targets, CORRESPONDING, dynamic slices, incoming-area sources and numeric conversions remain unsupported. Report the smallest admitted short count and the exact written extent. This does not establish allocation size, a runtime crash or caller reachability. Missing findings do not establish safety. The recipe does not choose an error exit or change the write. 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.AnalyzeCommareaWriteLengths

Required

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

Program ID covered by the contract. Retain quotes for literal IDs. Their contents match case exactly.

Exact outermost-first dotted declaration name for the incoming COMMAREA. The proof accepts a top-level LINKAGE PIC X item or a record of ordinary PIC X and unsigned DISPLAY PIC 9 integer fields.

Exact outermost-first dotted declaration name containing the actual incoming byte count at normal program entry.

Smallest incoming byte count admitted by the entry contract. Must be between zero and the maximum entry length.

Largest incoming byte count admitted by the entry contract. Must be at most 32767. Every integer in the configured interval must be admitted.

Provenance of the approved entry contract. It binds the area and actual received count at normal entry and defines the admitted lengths. The count must occupy storage separate from the incoming area. The contract is recorded and is not fetched or inferred from names.

mod run . --recipe=io.moderne.mainframe.security.AnalyzeCommareaWriteLengths \ -P sourcePath=security/cbl/VSZWMOVE.cbl \ -P programName=VSZWMOVE \ -P commarea=DFHCOMMAREA \ -P receivedLength=DFHEIBLK.EIBCALEN \ -P minimumLength=0 \ -P maximumLength=32767 \ -P contractSource=mainframe-fixtures/README.md

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