rpg_source.zig: settle() enforces the validator rules condition_literal and bif_numeric (also root.zig) #791

Manually merged
binjovi-bot merged 1 commit from enforce3 into trunk 2026-11-12 01:48:37 +00:00
Owner

After blocks, loop_exit, return and interface, settle() enforces the last two validator rules. They run
only when the earlier steps flip nothing, on the current text; when anything flips settle resets and renders again
as before. It never runs dropUnreferenced, nameSymbols or fitGlobals again, and it adds no placeholder.

  • condition_literal (refuseConditions, RNF7423): a DOW, DOU, IF or WHEN whose condition is a bare number
    becomes a failure line ending (validator: condition_literal). The parts of its block then fail through
    blocks (the ENDDO), and a LEAVE or ITER that is left with no emitted loop fails through loop_exit.
  • bif_numeric (refuseNumerics, RNF0553): a statement with a %REM operand declared as other than a number
    becomes a failure line ending (validator: bif_numeric).

Both use one helper (refuseFound) with the statement number of the finding, as refuseInterfaces does. A
statement that two entries share, or that is not code, is left alone and the finding stays in the receipt.

Other typing (RNF7416, RNF7421, call arguments) stays report-only. Nothing else about the emitter changes.

Why dow 1;: the source is dow '1';. The statement is recovered as partial: the condition is the constant
character '1' and the recovery stops at type inference of an indicator. No object fact or committed twin proves
that dow *on; or dow '1' = '1' compiles to the same object, so the form is not guessed: the refusal is the safe
action, and the one DOW per program is a failure.

Measured, enforce2 build (v0.1.999 in the coordinator bin) against this build (statements, emitted, failures,
placeholders; validator counts):

program before after
asyncage 584, 315, 272, 21; bif_numeric 1, condition_literal 1 584, 309, 278, 21; none
asyncdemo 621, 339, 285, 20; same 621, 333, 291, 20; none
asyncbg 597, 320, 279, 21; same 597, 314, 285, 21; none
asynccncl 608, 330, 281, 21; same 608, 324, 287, 21; none
asyncprom 619, 324, 297, 21; same 619, 318, 303, 21; none
asynctime 630, 346, 288, 20; same 630, 340, 294, 20; none

In each program six statements fall: the DOW (condition_literal), its ENDDO (blocks), three LEAVEs inside it
(loop_exit) and the one %REM statement (bif_numeric). The text between the DOW and the ENDDO stays code. These
programs do not compile today.

The 852 committed twin emits are byte-identical (no row differs), so no matching twin changes, and none has a
finding of these two rules.

Tests: src/rpg_source_enforce3_test.zig.

Gate (coordinator, base v0.1.507)

  • dev emits p1-p5 same; L10-test unchanged; committed twins: emit-bytes-diff identical.
  • 87 standing captures: 6 changed, the six Async programs only: emitted -6, failures +6 each (the DOW 1, its ENDDO, three LEAVEs, one %REM statement). Gate FAIL lists exactly those six moves (intended: text that could not compile becomes a refusal).
  • agree: suspect 93 -> 87, conflict 0, params_wrong 24, decl_missing 87, decl_extra 31.
  • Known gap, to be queued: a refused DOW leaves its body as plain code (reads as running once); only head, ENDDO and LEAVEs fail.
After `blocks`, `loop_exit`, `return` and `interface`, `settle()` enforces the last two validator rules. They run only when the earlier steps flip nothing, on the current text; when anything flips `settle` resets and renders again as before. It never runs `dropUnreferenced`, `nameSymbols` or `fitGlobals` again, and it adds no placeholder. - `condition_literal` (`refuseConditions`, RNF7423): a DOW, DOU, IF or WHEN whose condition is a bare number becomes a failure line ending `(validator: condition_literal)`. The parts of its block then fail through `blocks` (the ENDDO), and a LEAVE or ITER that is left with no emitted loop fails through `loop_exit`. - `bif_numeric` (`refuseNumerics`, RNF0553): a statement with a %REM operand declared as other than a number becomes a failure line ending `(validator: bif_numeric)`. Both use one helper (`refuseFound`) with the statement number of the finding, as `refuseInterfaces` does. A statement that two entries share, or that is not code, is left alone and the finding stays in the receipt. Other typing (RNF7416, RNF7421, call arguments) stays report-only. Nothing else about the emitter changes. Why `dow 1;`: the source is `dow '1';`. The statement is recovered as `partial`: the condition is the constant character `'1'` and the recovery stops at type inference of an indicator. No object fact or committed twin proves that `dow *on;` or `dow '1' = '1'` compiles to the same object, so the form is not guessed: the refusal is the safe action, and the one DOW per program is a failure. Measured, enforce2 build (v0.1.999 in the coordinator bin) against this build (statements, emitted, failures, placeholders; `validator` counts): | program | before | after | |---|---|---| | asyncage | 584, 315, 272, 21; bif_numeric 1, condition_literal 1 | 584, 309, 278, 21; none | | asyncdemo | 621, 339, 285, 20; same | 621, 333, 291, 20; none | | asyncbg | 597, 320, 279, 21; same | 597, 314, 285, 21; none | | asynccncl | 608, 330, 281, 21; same | 608, 324, 287, 21; none | | asyncprom | 619, 324, 297, 21; same | 619, 318, 303, 21; none | | asynctime | 630, 346, 288, 20; same | 630, 340, 294, 20; none | In each program six statements fall: the DOW (`condition_literal`), its ENDDO (`blocks`), three LEAVEs inside it (`loop_exit`) and the one %REM statement (`bif_numeric`). The text between the DOW and the ENDDO stays code. These programs do not compile today. The 852 committed twin emits are byte-identical (no row differs), so no matching twin changes, and none has a finding of these two rules. Tests: `src/rpg_source_enforce3_test.zig`. ## Gate (coordinator, base v0.1.507) - dev emits p1-p5 same; L10-test unchanged; committed twins: emit-bytes-diff identical. - 87 standing captures: 6 changed, the six Async programs only: emitted -6, failures +6 each (the `DOW 1`, its ENDDO, three LEAVEs, one `%REM` statement). Gate FAIL lists exactly those six moves (intended: text that could not compile becomes a refusal). - agree: suspect 93 -> 87, conflict 0, params_wrong 24, decl_missing 87, decl_extra 31. - Known gap, to be queued: a refused DOW leaves its body as plain code (reads as running once); only head, ENDDO and LEAVEs fail.
Enforce the validator rules condition_literal and bif_numeric in settle()
Some checks reported errors
binjovi/ci A newer source or plan superseded this Build
e2a0954b8e
sean force-pushed enforce3 from e2a0954b8e
Some checks reported errors
binjovi/ci A newer source or plan superseded this Build
to 84eeba1364
All checks were successful
binjovi/ci Binjovi completed the frozen plan
2026-11-12 01:36:42 +00:00
Compare
binjovi-bot manually merged commit 84eeba1364 into trunk 2026-11-12 01:48:37 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/sourcerer!791
No description provided.