Skip to content

golden_export junit: the byte check as generated Java, GoldenCheck + a JUnit class (Part of #4052) - #7553

Merged
squid-shepherd[bot] merged 5 commits into
mainfrom
churn/4055-20261102T1543Z
Nov 2, 2026
Merged

squid-shepherd[bot] merged 5 commits into
mainfrom
churn/4055-20261102T1543Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #4055 (slice 2 of #4052, after #7545): golden_export.py junit DIR --out SRC writes the golden byte check as Java source for a generated project, so the golden files keep protecting the Java once the mainframe and this tool are gone.

What changed

  • junit subcommand: writes golden.index (the manifest flattened to tab-separated lines, so the Java needs no JSON library), GoldenCheck.java (no dependencies; problems(goldenDir, javaDir)) and GoldenRegressionTest.java (JUnit 5; reads golden.dir / java.out.dir, fails on any problem).
  • Design decision: the Java check is a port of check(), not a new comparison, so there is one definition of "differs". A test compiles the generated GoldenCheck with javac and asserts it prints exactly check()'s messages, in order, over five runs (identical, changed byte, bad return code with missing/extra outputs, missing run, abended run with junk datasets).
  • Byte equality stays stricter than the harness's field comparison; declared differences are not applied here (stated in the module docstring).

Evidence: pytest tests/tools/test_golden_export.py 10 passed (the javac test ran, not skipped); pr_gates --fast 9/9; per-test time ratchet 0 over, 0 warned. No engine, golden-master or ledger input changed, so no ratchet re-bless.

Class / Sibling gaps

Class: the pieces of "proof cases become the Java regression suite" (#4052): export, byte check, field check, generated JUnit, wiring into the project, mutant-kill proof, non-batch case kinds. Handled here: the generated JUnit class and its Java byte check. Sibling gaps (different mechanism, not here):

  • Wiring: running the port on the case inputs into java.out.dir inside the generated project (the harness's run_java step); status missing.
  • Mutant-kill proof ("fails on a mutant the proof kills"); needs the wiring first.
  • Field-level comparison and declared differences in Java (record layouts, decimals); the byte check is stricter, never looser.
  • CICS, CALL and Db2 case kinds (export refuses them today).

Remaining slices (#4052)

  1. Harness step that writes java.out.dir and copies golden/ + the two classes into the generated project (equivalence_java.py, golden_export.py, a test).
  2. Mutant-kill demonstration on one proven port (uses det_mutation.py).
  3. Field-level comparison with declared differences (Declared differences: equivalence except where a person approved a difference #4051 dependency).

Checklist: partial [c:4b726470] -- wiring into the project, mutant-kill proof, field-level comparison, non-batch kinds

🤖 Generated with Claude Code

…a JUnit class) (Part of #4052)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 2, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 2, 2026 15:52
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 2, 2026 15:55
@squid-shepherd squid-shepherd Bot added the shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md label Nov 2, 2026
@squid-shepherd
squid-shepherd Bot disabled auto-merge November 2, 2026 16:07
@squid-shepherd

squid-shepherd Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

PR #7553 @ 7f10bb7: 2 failed check(s)

== full-suite (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41475924145/job/125386540613
repro: python -m pytest -q tests
errors:
##[error]Process completed with exit code 1.
log tail:
Commit: 21505ad2541d5be6135ed84fc33697146cf75b8e
Build Date: 2026-10-21T00:45:21Z
Worker ID: {a6537078-0d17-46f2-a9d9-f943e82a3046}
Region: eastus
Cloud: Azure
##[endgroup]
##[group]Operating System
Ubuntu
24.04.5
LTS
##[endgroup]
##[group]Runner Image
Image: ubuntu-24.04
Version: 20261025.353.1
Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20261025.353/images/ubuntu/Ubuntu2404-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20261025.353
##[endgroup]
##[group]GITHUB_TOKEN Permissions
Contents: read
Metadata: read
##[endgroup]
Secret source: Actions
Cache mode: write
Prepare workflow directory
Prepare all required actions
Complete job name: full-suite
##[group]Run echo "full-suite parts: $PARTS (tested-tree skip: $SKIP, suite plan: $PLAN)"
echo "full-suite parts: $PARTS (tested-tree skip: $SKIP, suite plan: $PLAN)"
# #4935: "skipped" is a pass only when the gate proved this tree green on the PR; otherwise it is a failure.
# #6278: or when the suite plan proved the PR changes only prose no test or engine code opens (mode skip).
test "$PARTS" = "success" || { test "$PARTS" = "skipped" && { test "$SKIP" = "true" || test "$PLAN" = "skip"; }; }
shell: /usr/bin/bash -e {0}
env:
PARTS: failure
SKIP:
PLAN: select
##[endgroup]
full-suite parts: failure (tested-tree skip: , suite plan: select)
##[error]Process completed with exit code 1.
Cleaning up orphan processes

== full-suite part 1/3 (failure) -- main
https://github.com/squid-protocol/gitgalaxy/actions/runs/41475924145/job/125383625273
repro: stale base (main changed engine source since this branch, and this PR touches none of it): git merge origin/main; if the test still fails after the merge it is this PR's
failing tests: tests/cobol_mainframe/test_java_subprocess_utf8.py::test_no_java_subprocess_in_tests_decodes_with_locale_charset
errors:
fail-on-cache-miss: false
[--ai-guardrails] [--fail-on-secrets]
[--fail-on-malware]
--fail-on-secrets CI/CD Gate: Fail build if hardcoded secrets are
--fail-on-malware CI/CD Gate: Fail build if ML threat inference flags
CI/CD Gate: Fail build if any file exceeds this risk
CI/CD Gate: fail the build if any file's structural
E AssertionError: tests/tools/test_golden_export.py:113: java/javac uses text= without encoding='utf-8'; capture bytes and decode, or pass encoding
tests/cobol_mainframe/test_java_subprocess_utf8.py:255: AssertionError
FAILED tests/cobol_mainframe/test_java_subprocess_utf8.py::test_no_java_subprocess_in_tests_decodes_with_locale_charset - AssertionError: tests/tools/test_golden_export.py:113: java/javac uses text= without encoding='utf-8'; capture bytes a
##[error]Process completed with exit code 1.
log tail:
PYTHONUTF8: 1
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
##[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-1.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 687948
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 38a78d60ff71396d66e49a1c24f4d5918ee5856ea6278ddebd8e1cb63e832a47
Finalizing artifact upload
Artifact test-times-part-1 successfully finalized. Artifact ID 13157448745
Artifact test-times-part-1 has been successfully uploaded! Final size is 687948 bytes. Artifact ID is 13157448745
Artifact download URL: https://github.com/squid-protocol/gitgalaxy/actions/runs/41475924145/artifacts/13157448745
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/a95a8929-94db-4d31-9662-f2d4a3e7a78a' 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 2, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 2, 2026 16:39
@squid-shepherd

squid-shepherd Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

squid-shepherd Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

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

squid-shepherd Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd squid-shepherd Bot removed the shepherd:waiting-on-main Bot: the failing check fails on main too (main's to fix). Guide: docs/ci.md label Nov 2, 2026
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 2, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (6665adc) 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 2, 2026 16:44
auto-merge was automatically disabled November 2, 2026 16:44

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 2, 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 labels Nov 2, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

1 similar comment
@squid-shepherd

squid-shepherd Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review November 2, 2026 16:44
@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 2, 2026
@squid-shepherd

squid-shepherd Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 2, 2026 16:45
@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 2, 2026
@squid-shepherd
squid-shepherd Bot merged commit 8d034fe into main Nov 2, 2026
68 of 91 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/4055-20261102T1543Z branch November 2, 2026 17:17
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.

1 participant