Skip to content

tools: branch_solver -- z3 checks the stated infeasible outcomes (211 of 555 confirmed) (#4175) - #7577

Merged
squid-shepherd[bot] merged 7 commits into
mainfrom
feat/branch-solver
Nov 3, 2026
Merged

squid-shepherd[bot] merged 7 commits into
mainfrom
feat/branch-solver

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Closes #4175.

What

tests/tools/branch_solver.py: z3 over the det translator's own reading of a COBOL program (det/stmt.py, det/expr.py, det/layout.py). It records, for each IF and EVALUATE outcome, the condition under which the program reaches and takes that outcome, and asks z3 about it.

python tests/tools/branch_solver.py check [CASE ...]           # the stated infeasible outcomes (tests/equivalence/infeasible_outcomes/)
python tests/tools/branch_solver.py reach CASE LINE:OUTCOME --inputs   # an input that takes an outcome, in strengthen.py / survivor_attack.py `try` format
python tests/tools/branch_solver.py paragraphs CASE             # which paragraphs any input enters (checks "never PERFORMed" survivor verdicts)

It gives three answers only:

  • confirmed: unsatisfiable, and the walk was complete.
  • witness: an input reaches the outcome, with the values z3 chose.
  • inconclusive: a timeout, or a construct the walk does not follow.

It commits nothing. z3 is the new solver extra. The tests importorskip it, like the other box-only tools.

Soundness (why confirmed can be trusted as far as the model goes)

Everything the walk does not model is over-approximated, so imprecision can only turn a confirmed into a witness or inconclusive:

  • Items the walk can't follow: items under OCCURS, REDEFINES or ADDRESS OF, FILE SECTION records, ambiguous names, and subscripted or ref-modified operands read fresh on every read and are never assigned. One exception: a subscripted read of a never-written, all-VALUE WORKING-STORAGE record (a table of constants) takes one of its image's values.
  • Unmodelled statements: CALL, EXEC, STRING, READ and the like set their receiving items fresh. CICS options have direction (FROM/FILE/... are read, RESP/INTO/SET/... are written), every CICS command sets the EIB, and SQL writes only its INTO host variables plus the SQLCA. All phrases (AT END / NOT AT END, ...) run.
  • Loops are summarised: everything the body can write is set fresh at the head; the exit takes UNTIL and one iteration its negation. VARYING keeps index >= FROM when the body never writes the index. A paragraph re-entered by GO TO, or a range PERFORMed again while it runs (HANDLE labels), is walked once more from the all-fresh state.
  • Value sets: a fresh value is constrained by its PICTURE and by the item's flow-insensitive value set (VALUE, constant MOVE / SET / INITIALIZE, and copies). This is what keeps a loop flag at 'N' or 'Y'.
  • Handlers and exits: HANDLE CONDITION / AID / ABEND labels and SQL WHENEVER labels are branches. ALTER, NEXT SENTENCE, EXIT PARAGRAPH / PERFORM and ENTRY make the walk incomplete, which reports any confirmed as inconclusive.
  • Encoding: fixed-length text is bit-vectors, not z3 strings. String theory timed out on CardDemo screens; bit-vectors decide them in under a second.
  • Assumed, and stated in the docstring: numeric DISPLAY items hold valid numbers (family U is never checked), the program is entered at its first statement, and a callee changes only what it is passed. Caller context is not an input, so a family G claim resting on callers shows up as witness.

Result: every stated infeasible outcome (main @ 97bed71, 99 cases, 555 claims)

family claims confirmed witness inconclusive
C (constant) 72 57 13 2
G (callers' guard) 425 137 220 68
R (IBM-documented response) 53 17 36 0
U (undefined by IBM) 5 0 5 0
all 555 211 274 70
  • 211 claims now have a machine proof behind them, from the program alone.
  • The 13 C witnesses are walk imprecision, not wrong claims, except one:
    • STRING results are not modelled (the four 9000-READ-ACCT claims on WS-RETURN-MSG 88s).
    • Counter bounds of a plain PERFORM UNTIL are not modelled (the POPULATE-* paragraphs).
    • Subscript validation done earlier is not tracked (menu/adminmenu).
    • Two crucible claims rest on register X36.
    • The exception, cbsa-bankdata 917:true: the claim rests on the probability of 100 FUNCTION RANDOM failures in a row. That is a stated assumption, not a constant, so family R (or an assumption entry) fits it better than C. The owner decides.
  • G / R witnesses are expected. They say the program alone does not settle the claim: it rests on callers or on IBM's documented condition sets, which the walk leaves open.
  • 63 of the 70 inconclusive are one program, zecs-zecs002, whose EVALUATEs are lowered HLASM that the coverage naming cannot pair. The other 7 are ALTER / ENTRY / NEXT SENTENCE, or outcome names the walk's reading does not have.
  • Speed: the whole sweep takes ~15 min at two lanes on nyx. The slowest case is cbsa-bnk1dcs at 180 s, and most cases take under 5 s.

Mutant work (item 1 of the ask)

  • The case_gap survivors are stale. The 353 case_gap survivors on the E ladder come from docs/language_status/mutation_scores.json, i.e. stale model-port runs. LGSTSQ's Q= gap, for example, already has a scenario.
  • The det-port (L5) ledgers hold no case-gap at all. Of their 5,178 survivors, 874 touch program fields, and every one of those is a CON mutant on a field's layout constant. None is a translated branch condition: the existing scenarios kill those already. The top 25 of survivor_attack.py next are all COMMAREA-length plumbing.
  • What the solver adds for mutants today:
    1. paragraphs checks reachability claims behind survivor verdicts. It confirms "POPULATE-TIME-DATE is never PERFORMed" for acctctrl, updacc and updcust (22 survivors).
    2. reach --inputs writes inputs strengthen.py / survivor_attack.py try accept, with printable text preferred. For example, carddemo-userdel 199:false → PF3 with a non-blank CDEMO-FROM-PROGRAM.

Walk bugs found while sweeping (all fixed, each with a test)

  • An 88 on a group compared against a 0-byte text.
  • PERFORM SECTION ran only the section's header paragraph, because det keeps the header as a paragraph of the same name.
  • Recursion through HANDLE labels.
  • An EVALUATE without WHEN OTHER was named OTHER (coverage names it none).
  • SET of a group 88; INITIALIZE overwrote FILLER; ROUNDED was truncated; ADDRESS OF aliasing; EXIT PROGRAM in a main batch program.

Rulings applied (2026-11-03)

  • z3 pinned in CI as above.
  • cbsa-bankdata 917:true is no longer an infeasible entry (neither C nor R: an input reaches it, improbably; the RANDOM seed comes from the PARM, so no constant-seed family C). The ledger file is deleted; the outcome stays an uncovered branch (47/48), a stated assumption of the proof, never netted. pr_gates --fast: 9/9.

Class / Sibling gaps

Class: stated infeasible outcomes in tests/equivalence/infeasible_outcomes/ checked by the solver (555 claims across families C, G, R, U, table above); every claim gets one of confirmed / witness / inconclusive, so all members are handled by the same mechanism. Sibling gaps: (1) "stated assumption" has no reporting class of its own yet: only family U is named in evidence_report.py / estate_evidence.py, so the bankdata 917:true assumption is recorded in its test, not in the evidence report (needs a new family across three files, beyond the 5-file limit; owner call); (2) the Next items below (STRING results, PERFORM UNTIL counters, survivor_attack.py facts wiring) are separate mechanisms.

Checks

  • tests/tools/test_branch_solver.py: 19 tests on small programs, one per rule. All pass with z3 installed; the file is skipped without it. Per the 2026-11-03 rulings, z3-solver==5.3.3.0 is now pinned (hash-locked) in ci/requirements/treesitter.in / .txt, which the full-suite job installs, so CI runs it. Not run locally with z3 in this round (the selfscan venv has none).
  • audit_check.py: all clear (ruff, format, mypy, dead-key).
  • mypy on the file itself: clean.

Files: 3 in the first round; this round adds tests/tools/test_infeasible_outcomes.py plus the regenerated ci/requirements/treesitter.{in,txt} and the deleted cbsa-bankdata.json ledger file.

Next

  • Model STRING results and plain PERFORM UNTIL counter bounds. That would turn most of the remaining C witnesses into confirmations.
  • Wire paragraphs / check into survivor_attack.py facts (a separate PR).

🤖 Generated with Claude Code

…4175)

Checks stated infeasible branch outcomes (confirmed / witness /
inconclusive, sound over-approximation of everything it does not model)
and finds inputs that take an outcome, emitted in the strengthen.py /
survivor_attack.py input format. z3 is the new `solver` extra.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

squid-protocol and others added 2 commits November 2, 2026 18:57
The claim rests on how unlikely 100 FUNCTION RANDOM failures in a row are,
not on a constant: branch_solver finds a path through the program alone
(#4175). Owner ruling 2026-11-02: refile as R.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread tests/tools/branch_solver.py Fixed
Comment thread tests/tools/branch_solver.py Fixed
Comment thread tests/tools/branch_solver.py Fixed
Comment thread tests/tools/branch_solver.py Fixed
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 3, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

squid-shepherd Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

PR #7577 @ 215e3c4: 2 failed check(s)

== Analyze (python) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41549650320/job/125634138692
repro: no local equivalent; read the check page
errors:
expect-error: false
##[error]Process completed with exit code 1.
log tail:
CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR: codeql-results
CODEQL_UPLOAD_SARIF__LANGUAGE_PYTHON__CODEQL: CODEQL_UPLOAD_SARIF__LANGUAGE_PYTHON__CODEQL
CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY: true
GH_TOKEN: ***
PR: 7577
REPO: squid-protocol/gitgalaxy
##[endgroup]
### CodeQL: 4 new result(s), 1 blocking (fails this PR)
PR analysis 397 results, main's 393. New means not on main, in a file this PR changed.
- py/unused-local-variable: 3
- py/implicit-string-concatenation-in-list: 1
| Level | Rule | Where |
|---|---|---|
| note | py/unused-local-variable | tests/tools/branch_solver.py:649 |
| note | py/unused-local-variable | tests/tools/branch_solver.py:708 |
| note | py/unused-local-variable | tests/tools/branch_solver.py:759 |
| warning | py/implicit-string-concatenation-in-list | tests/tools/branch_solver.py:1651 |
##[error]Process completed with exit code 1.
Post job cleanup.
Post job cleanup.
Existing job run UUID is 0f4b336f-997c-4a21-853f-1db4a7db37bf.
CodeQL job status was success.
Sending status report for init-post step.
Status report sent for init-post step.
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/de79ca4f-c0ef-4d93-936f-21819049a3c5' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

== full-suite part 2/3 (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41549650435/job/125634814484
repro: python -m pytest -q tests/test_source_reads.py::test_no_source_read_loses_a_byte
failing tests: tests/test_source_reads.py::test_no_source_read_loses_a_byte
errors:
fail-on-cache-miss: false
E AssertionError: #3813: decode through gitgalaxy.core.source_text (read_source / open_source / decode_bytes) instead of a lossy errors= handler or a text-mode read of an estate file:
tests/test_source_reads.py:146: AssertionError
FAILED tests/test_source_reads.py::test_no_source_read_loses_a_byte - AssertionError: #3813: decode through gitgalaxy.core.source_text (read_source / open_source / decode_bytes) instead of a lossy errors= handler or a text-mode read of an e
##[error]Process completed with exit code 1.
log tail:
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
OMP_NUM_THREADS: 1
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
PYTEST_ADDOPTS: --ignore=tests/cobol_mainframe
##[endgroup]
Multiple search paths detected. Calculating the least common ancestor of all paths
The least common ancestor is /home/runner/work/_temp. This will be the root directory of the artifact
With the provided path, there will be 2 files uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: test-times-part-2.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 932002
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 23591e061fca8ad62f7ed4df64533a872438e224a34c7fa8f8f05a071b4971c9
Finalizing artifact upload
Artifact test-times-part-2 successfully finalized. Artifact ID 13192195422
Artifact test-times-part-2 has been successfully uploaded! Final size is 932002 bytes. Artifact ID is 13192195422
Artifact download URL: https://github.com/squid-protocol/gitgalaxy/actions/runs/41549650435/artifacts/13192195422
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/3793183e-d73a-426e-bd76-ca788f7f6af0' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Nov 3, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 3, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (f002861) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft November 3, 2026 00:13
@squid-shepherd squid-shepherd Bot added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md labels Nov 3, 2026
@squid-protocol

Copy link
Copy Markdown
Owner Author

Rulings (made by Claude at the owner's request, 2026-11-03; the owner may override)

1. z3 in CI: yes, pin it. Add z3-solver (MIT license, an installed dependency, not vendored code) at an exact version to the pinned requirement that the tools test job installs. Then test_branch_solver.py runs in CI instead of being skipped. A test that never runs in CI is no evidence for the 211 machine-checked claims. The solver extra in pyproject.toml stays the opt-in for local installs; a scan never imports the solver.

2. cbsa-bankdata 917:true: an assumption entry, not C and not R.

  • C means "a test of a constant", and R means "a response the command never raises (IBM's documented conditions)". Neither fits: an input does reach the outcome, just improbably (100 FUNCTION RANDOM failures in a row).
  • An infeasible claim must be certain, and a probability is not. So drop the infeasible entry and record the outcome as a stated assumption, reported by name. That follows the "undefined by IBM" handling in mainframe-evidence-policy rule 7: never counted as proven, never as infeasible.
  • Exception: if branch_solver.py shows the RANDOM sequence is fixed by a constant seed in the program, it is family C with that seed cited.
  • BANKDATA is on the ladder's skip list, so no ladder level moves on this.

Merge path: mark ready, re-approve the current head, merge. Then retarget #7578 → #7580 → #7581 → #7583 to main one at a time as each lower PR merges. Open the missing feat/solver-more PR, then retarget #7584 onto it.

@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Nov 3, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 3, 2026 15:43
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 3, 2026 15:45
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 3, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (92cc4cb) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft November 3, 2026 15:59
auto-merge was automatically disabled November 3, 2026 15:59

Pull request was converted to draft

@squid-shepherd squid-shepherd Bot added the shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md label Nov 3, 2026
@squid-protocol squid-protocol added shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Nov 3, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 3, 2026 16:17
@squid-shepherd squid-shepherd Bot added the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Nov 3, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 3, 2026 16:37
@squid-shepherd

squid-shepherd Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

squid-shepherd Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd squid-shepherd Bot removed the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Nov 3, 2026
@squid-shepherd
squid-shepherd Bot merged commit b7b9a89 into main Nov 3, 2026
110 of 141 checks passed
@squid-shepherd
squid-shepherd Bot deleted the feat/branch-solver branch November 3, 2026 18:09
squid-shepherd Bot pushed a commit that referenced this pull request Nov 3, 2026
…7581, #7583, solver-more, #7584) (Part of #4175) (#7608)

* tools: branch_solver -- z3 over the det reading of a COBOL program (#4175)

Checks stated infeasible branch outcomes (confirmed / witness /
inconclusive, sound over-approximation of everything it does not model)
and finds inputs that take an outcome, emitted in the strengthen.py /
survivor_attack.py input format. z3 is the new `solver` extra.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* infeasible outcomes: cbsa-bankdata 917:true is family R, not C (owner)

The claim rests on how unlikely 100 FUNCTION RANDOM failures in a row are,
not on a constant: branch_solver finds a path through the program alone
(#4175). Owner ruling 2026-11-02: refile as R.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test_infeasible_outcomes: bankdata 917 is pinned as family R (owner ruling)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* survivor_attack facts + ladder-slice: use branch_solver (#4175)

`facts` settles an `unreachable` verdict whose reason says a paragraph is
never reached when branch_solver finds no input that enters it (attack
result `solver-unreachable`, accepted by det_mutation.py state), and prints
the reasons it questions without recording them. `packet` shows the
solver's verdict on the paragraphs a reason names. ladder-slice asks the
solver for inputs and checks infeasible entries before they are written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* branch_solver: encode text one byte per character, nothing lossy (#3813, test_source_reads)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* branch_solver: drop unused locals and an implicit string concatenation (CodeQL)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* branch_solver: fault plans for RESP-driven arms; strengthen.py backend (#4175)

Each EXEC CICS answers one response symbol (its RESP item and EIBRESP hold it,
one of IBM's DFHRESP values). `reach --inputs` prefers responses a scenario's
fault plan can give (equivalence_cics_faults.py's tables) and emits the
`faults` entry: command, resource, nth 1, resp, resp2. `backend CASE
PROMPT_FILE` answers strengthen.py's prompt, so `strengthen.py run
--backend-command` closes gaps with the oracle and no model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* branch_solver fields + survivor_attack: settle Field mutants of items no reachable statement uses (#4175)

`branch_solver.py fields CASE` lists the WORKING-STORAGE items whose accessor no
reachable statement runs; anything the runtime may touch outside a statement
(LINKAGE, FILE, EIB, DFHAID, SQLCA, FILE STATUS, ODO objects, ADDRESS OF, DTO
records, numeric-edited items set at creation, BMS maps a reachable SEND/RECEIVE
names) counts as used. `facts` settles a mutant of such an item's Field
declaration as `solver-unread`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* field_observability: settle det-port Field-declaration mutants no input can see (#4175)

Three facts, every doubt left to an attack:
- dead window: X and the bytes of both windows are read by no reachable
  statement and no runtime reader (DTOs, LINKAGE, FILE, SQLCA, sent maps,
  EIBCALEN / EIBAID-under-HANDLE-AID / ADDRESS EIB);
- map subfield: an unnamed BMS attribute / length whose bytes and the
  mutant's only hold X'00', spaces or typed lengths when SEND MAP reads them
  (a walk flag proves every SEND follows a clear; protected fields without
  FSET are never keyed, IBM 3270);
- DFHAID: every key press satisfies the same EIBAID comparisons with the
  mutant as without.
Plus offset-only relocation when nothing else touches either window.
survivor_attack facts records `solver-unobservable` (det_mutation accepts it).
The walk gains flow-sensitive Boolean flags (branch_solver Walk(flags=)).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* branch_solver reach: map input fields into `receive`; prefer the case's own values (#4175)

A symbolic map's input field the condition reads (<map>I's <field>I) goes into
the scenario's `receive`, and a witness first tries values the case's
scenarios already use for the same field, so a data-dependent path (a READ
that must find the record) has a chance. Oracle check: with the DELETE-NOTFND
scenario of carddemo-userdel removed, strengthen.py with the solver as backend
re-covered DELETE-USER-SEC-FILE:313:WHEN@323 (30/32 -> 31/32, proven).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* branch_solver: SQLCODE as a solver input; reach emits sql_faults (#4175)

Each EXEC SQL's SQLCODE is one symbol (free for check); reach prefers 0, the
codes the case's sql_faults already plan and the common ones, and emits
{line, nth, sqlcode}. A LINKed program's input names no AID unless the case's
scenarios do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* branch_solver: STRING literal prefixes; one-way loop counters keep their start bound (#4175)

STRING ... INTO x (no POINTER): the literal pieces it starts with (each cut at
its delimiter) are x's first bytes, the rest any value. A numeric item that
holds a known number at a PERFORM UNTIL head and that the loop (its ranges to
their end, GO TO paths with fall-through) only increases (ADD / COMPUTE x = x
+ n) or only decreases stays >= / <= that number. The loop-body closure now
stops a PERFORMed range at its end instead of falling through.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* field_observability: length-only mutants of items only moved into shorter items (#4175)

An alphanumeric item or group the program only ever reads by MOVE X TO Y, each
Y alphanumeric and no longer than the shorter window, hands Y the same leading
bytes with either length (WS-CURDATE-MM-DD-YY 8 -> 9, moved into CURDATEO).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* branch_solver: caller-aware check (--callers); --github report for CI (#4175)

estate_entry: what the estate's programs can send a program's COMMAREA (XCTL /
LINK naming it, RETURN TRANSID of its transaction), region by region (offset,
size, kind, scale), to a fixpoint over the estate: a sender's values come from
its own value sets, which see ITS entry values through whole-area moves --
copy-in from LINKAGE, through unstructured buffers (INITIALIZE fills kept),
reference modifications at a literal or LENGTH OF x + n. Every doubt is any
value. `check --callers` reports `confirmed-callers` for a witness no input
the estate sends reaches (assumption: its programs are the only callers).
`check --github` writes the report to the job summary and warns on family C
witnesses (solver-check.yml).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: solver-check -- branch_solver verdicts on a PR's stated infeasible outcomes (#4175)

A PR that touches tests/equivalence/infeasible_outcomes/ gets branch_solver's
verdict on every claim of the cases it touches in the job summary, and a
warning on the file for a family C claim an input of the program reaches.
Informational: never fails (the det sweep stays the gate). Not a required
check; the path filter is the selector. Hash-pinned install set
ci/requirements/solver.txt (z3-solver 4.15.4.0, tree-sitter-language-pack
1.22.1), generated with tests/tools/pin_ci_requirements.sh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ci: pin z3-solver in the treesitter lock; bankdata 917:true is a stated assumption, not infeasible (#7577 rulings)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* solver-check: list it as a non-gate, trigger on the tools it runs, pair the corpora cache, retry the pip install

The combined solver branch failed four CI-rule tests on its new workflow:
gate_controls (every PR workflow is a gate or says why not), workflow
inputs (a path-filtered workflow triggers on what it reads), cache keys
(a corpora restore pairs with a guarded save) and ci_retry (a hash-pinned
pip install goes through ci_retry.sh).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvf2aRvMjAx5eu3BDUj

* solver-check: a case the PR deleted no longer aborts the bash -e step; list branch_solver.py as a cics spec importer (Part of #4175)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* solver-check: list ready_for_review and carry the draft condition (test_workflow_draft_gate)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* test_cics_spec: branch_solver imports DFHRESP (#4175)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* test_cics_spec: drop the duplicate branch_solver entry

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: Joe Esquibel <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
squid-shepherd Bot pushed a commit that referenced this pull request Nov 4, 2026
…; BANKDATA 917:true netted, back to L4 (#7700)

* infeasible outcomes: family P (practically unreachable, owner ruling); BANKDATA 917:true netted, back to L4

Owner ruling 2026-11-04: BANKDATA's last branch outcome (GOD010 line 917, IF OPENED-DATE-ATTEMPTS > 100) needs 100
failed FUNCTION RANDOM opened-date draws in a row, probability under 15^-100. #7577's z3 check finds the input, so
92cc4cb removed it as infeasible and BANKDATA fell from L4 to L3 (47/48). The owner rules it netted anyway, as its
own class:

- family P "practically unreachable, by owner ruling" in infeasible_outcomes.py, open only to the cases in
  PRACTICAL_CASES (problems_in refuses it elsewhere); BANKDATA is the first and only member.
- evidence_report / estate_evidence report it by name with counts ("practically unreachable"), never under
  "stated infeasible" and never as proven, like the U class; a proof that reaches it still refutes it.
- mainframe-evidence-policy.md section 9 records the ruling and that it overrides #7577's 2026-11-03 ruling for
  BANKDATA only.

The committed det-sweep ledger nets to 47/47 (100%) through the same path DELACC uses (13/13), so BANKDATA reads L4
at the next evidence refresh.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Regenerate docs_read_by_tests.txt for the family P rule edit

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
squid-shepherd Bot pushed a commit that referenced this pull request Nov 4, 2026
…4 stance, Open World level build (Part of #7065) (#7699)

* progress slide: external vs internal estates, L4 highlighted, below-L4 stance, Open World level build (Part of #7065)

Owner request 2026-11-04: with the L1-L4 ladder finished, the "where we stand" slide now
- highlights L4+ as its own hero tile (five tiles: L1, L2, L4, L5, CICS commands);
- drops the per-level count table: one-line, larger legend, full-width bars, an "N / M at L4+" cell per row;
- splits the ladder into external estates (burned, the headline totals) and internal estates (cics-crucible, the
  estate crucible), kept out of every total;
- names every burned program below L4 with its ruling (source defect, refused by design, owner hold, or the
  report's next step), so a refusal reads as a stance, not a dropped program;
- adds a card per Open World level (Batch Badlands, Alternate Index Archipelago, Warlords of the Message Seas,
  The Hierarchy Keep): built % = planned constructs whose horrors are all in the pinned baseline, horrors and
  passes at the pin, first-time run date once recorded.

New tests/estate_crucible/levels.json holds each level's planned constructs (from #7065 and the level docs),
mapped to merged horror ids only; a test refuses a half-pinned construct. ladder_exclusions gains short reasons
and HELD_BELOW_L4 (BANKDATA: its last branch outcome is reachable per #7577's z3 check, owner skip 2026-10-30).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* ladder_exclusions: no BANKDATA hold (#7700 nets its last outcome by owner ruling); test uses a synthetic hold

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* progress slide round 3: one story top to bottom, plain words, ladder in three matching bands (Part of #7065)

Owner request 2026-11-04 after four reviews of the slide (a data-viz designer, a skeptical buyer, an evidence
auditor, a story editor), merged where they agree and the owner's direction where they don't:

- Order: header with the GnuCOBOL / not-z/OS caveat in plain words -> the six steps defined once -> four program
  tiles (L4 the hero) -> results ladder -> results by age of code -> planted bugs (L5) -> what the translator can
  do -> how faithful the runtime is -> work done. Section titles are computed claims ("Results: 125 of 129 ...").
- Ladder: one panel, three bands of the same geometry: real codebases (with the "not at every branch yet, each
  named" box right under them and a computed "net of N reviewed infeasible / undefined by IBM" line), our CICS
  test suite, and our Open World practice codebases as L0 bars ("being built: 12 of 20 planned constructs, 60% of
  our plan"; "first run pending"). Level horror counts are per level (27 of 27), not the crucible's 88 of 90.
- Honesty: no "blind" for our own levels; "proved sort cases" -> "sort equivalence cases"; "none needed" ->
  "0 claimed"; a stale level (L4*) now counts at its level and is reported, not dropped; issue counts are labelled
  activity, not evidence; plain names for the milestones and the runtime rule families.
- Colour: ladder hues mean a ladder level only; every other bar is one neutral ink; the runtime status palette no
  longer reuses ladder hues and its two warm statuses are no longer neighbours.
- levels.json carries members_at_pin (COBOL programs / JCL jobs per level app at the pin); a test checks them
  against the pinned estate-crucible key when a clone is present.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* progress slide: results panel split in half, levels left and the L5 planted-bug bars right; L5 table gone

Owner request 2026-11-04: the L1-L4 ladder no longer takes a whole panel. Each codebase row now carries two bars:
left, L0-L4 (an L5 program counts at L4 there); right, its L5 work in its own single-hue ramp (pass, pass not
yet counted, tested with planted bugs still open, not yet tested). The "N / M at L4+" sum column and the L5 table
are gone; the L5 raw and sample shares and the hand-written ports' score are one line each under the bars. Our
CICS test suite and the Open World levels show "L5 not yet started" the same way. L5's level swatch is the L5
bar's pass shade, so L5 is one colour everywhere. Segment labels print only where they fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* progress slide: headline tiles first with our test suite's numbers; L5 tile counts planted bugs caught

Owner request 2026-11-04: the four headline boxes come first, the level legend under them. Each box now carries
the real-codebase figure and, under a rule, our CICS test suite's (85 / 85, or "L5 not yet started"). The L5 box
leads with the planted bugs our tests caught (12,350 of 18,585 run, 66%) and says how many programs pass L5,
rather than "11 / 129". Under the bars, the L5 note gives the full accounting: caught, explained as harmless
(equivalent / unreachable, labelled reviewed claims not yet audited, per the 2026-11-01 L5 audit), and the share
of the 42,693 possible planted bugs run. Explained survivors are not added to the caught count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* progress slide: one internal-test-suites band; JCL step flow row computed; level plan at v0.7.0

- Bands 2 and 3 are one band, "Our internal test suites": the CICS test programs and the Open World practice
  codebases, never in a total (owner 2026-11-04).
- Capability ledger: a computed "JCL step flow" row. The jcl_flow evaluator is run live on the 14 IBM-written FLOW
  fixture scenarios (the bar) and on CardDemo's 34 answers over its 8 EXEC COND jobs (34 of 34). Without the
  corpus (the docs run) it reads tests/equivalence/jcl/carddemo/measured.json, recorded by
  `capability_ledger.py jcl-measure CORPORA`, only while its answers hash matches; a corpus-gated test keeps the
  record equal to a live run. The old row is "JCL job execution" (steps still wired by the case).
- levels.json follows the v0.7.0 pin (#7702): the horrors of slices 4-5 and Hierarchy Keep slice 1 (H-0083..85,
  H-0094..98) and the v0.7.0 member counts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* capability ledger: "Code pages and national text" group (EBCDIC pages, cultural dialects, multicultural estate)

Owner 2026-11-04: the slide hid the World Tour work. Three computed rows:
- EBCDIC code pages: the pages the scanner decodes (ebcdic_codecs / ebcdic_dbcs: 15 single-byte national, 5
  double-byte) and how many the generated Java decodes too (a JDK charset name): 20 / 20.
- Cultural dialects: the Cultural Gauntlet's source dialects x data code pages, and its known-failing cells read
  from the CI ratchet (tests/cultural_gauntlet/baseline.txt): 10 dialects in 7 pages, 0 failing.
- Multicultural test estate: the estate crucible's phase-2 horrors (H-0035..H-0049) passing at the pin: 15 / 15.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* status slide: estate sizes and JCL coverage, recorded from the pinned corpora (Part of #7065) (#7707)

Owner 2026-11-04 (follow-up to #7699): show how big the real codebases are and how much of their JCL the
step-flow reader covers.

- tests/tools/estate_size.py measures, per burned estate: the ladder's programs and their lines, the copybooks they
  COPY / EXEC SQL INCLUDE and those members' lines, JCL members, jobs job_flow reads with a step, jobs whose flow
  depends on COND / IF, and jobs with IBM-based run / bypass answers. The docs run has no corpus, so the numbers
  are recorded in tests/fixtures/estate_size.json (`estate_size.py CORPORA --write`); test_estate_size.py re-counts
  and compares wherever the corpora are present, and checks the counters on small inputs.
- The slide's real-codebase rows carry a size line (e.g. "30k lines · 72 copybooks · 55 jobs"; all six: 76k lines,
  116 copybooks, 143 jobs). The capability ledger gains "JCL in the real codebases": 143 jobs read in 213 JCL
  members, 18 depend on COND / IF, 8 of them answer-checked (CardDemo).

Stacked on #7699.

Co-authored-by: Claude Opus 5.5 <[email protected]>

* change_classifier: regenerate docs_read_by_tests.txt for the slide and estate_size changes

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

equivalence: solver-driven scenario generation to raise branch coverage

2 participants