Repository navigation
Test case generation, publish failing reports, fix README counts - #2
jackspiece wants to merge 4 commits into
Conversation
The 65,976-case loop in review-worker.cjs could only run after the
SHA-256 pin check, so no test or CI job ever exercised it. Move it
unchanged into review-cases.cjs as runCases(encode), returning
{ cases, groups, failureCount, failures }. The worker keeps the pin
check, smoke test and report writing, and calls
runCases(context.BytesToTextBase16).
The report now also fingerprints review-cases.cjs in harnessSha256,
since that file generates the cases. The seed in the report is
formatted from the exported SEED, so it cannot drift from the
generator.
The new test runs all 65,976 cases against a local Buffer-based
encoder without the third-party target. It checks the case count,
the group counts and their order against results/2026-09-11.json,
and a SHA-256 digest of every generated input. The digest was
computed independently from the generator lines of verify.cjs at
faacbef, the harness that produced that result.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each of the 10 kept failure records held the full input, expected and
actual values, and the worker echoed the whole report to stdout. One
failing 65,536-byte case serializes to about 0.9 MB, so a few long
failures pushed the worker past the 1 MiB output limit in
bounded-process.cjs. verify.cjs then exited 2 and deleted the staged
report, instead of exiting 1 with a published report as
docs/reproduce.md documents.
The worker now prints only { cases, failureCount, report } to stdout.
verify.cjs already publishes the staged file and ignores worker
stdout. Failure records keep the case number, group and input length,
plus the first 32 input bytes, the first 64 expected characters, the
first 64 returned characters or array entries and up to 200
characters of an error message. A returned value that is neither a
string nor an array is still recorded as returned.
The new tests cover a defect that appears only in long inputs, and
failures on the largest inputs that throw a 1 MiB message or return
a string. Both fail against the old record format.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The workflow pins actions to full commit SHAs, but nothing proposed updates to those pins. Check .github/workflows weekly. There is no package.json, so npm is not configured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hero alt text still said six tests exercise the checker, and the code map described verify.cjs as it was before PR #1. State the real count from node --test: 35 tests (6 core checks, 12 faulty-encoder controls, 1 test of 512 generated valid encodings, 3 case-generation tests, 9 process-limit and CLI tests, 4 POSIX-only signal tests). The code map now covers verify.cjs, review-worker.cjs, review-cases.cjs, bounded-process.cjs, validator.cjs, source-record.json and test/. It notes that results/2026-09-11.json came from the harness at faacbef: the report's recorded harness hashes equal validator.cjs and verify.cjs at that commit. README and docs/method.md also describe the case-generation tests, which run against a local reference encoder rather than the external target. The hero PNGs still show "6 checker tests" and need re-rendering. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hacktron Security Check - SkippedReason: Code Review is not active for this organization
Go to: https://app.hacktron.ai/national-college-of-business-and-arts/billing |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 86e2a391fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| test("a correct encoder passes every declared case, with the recorded inputs and groups", () => { | ||
| const inputs = crypto.createHash("sha256"); | ||
| const result = runCases(bytes => { | ||
| inputs.update(`${JSON.stringify(bytes)}\n`); |
There was a problem hiding this comment.
Preserve negative zero in the input digest
If the case generator accidentally changes the declared [-0] case to [0], this regression test still passes because JSON.stringify([-0]) produces [0]; the case and group counts remain unchanged as well. Since the digest is intended to lock every generated input to the recorded harness, encode negative zero distinctly or add a direct Object.is assertion for that case.
Useful? React with 👍 / 👎.
Fixes the three approved items from the A+ audit. Each change is a separate commit.
1. Case generation is testable (
review-cases.cjs)review-worker.cjsintoreview-cases.cjsasrunCases(encode), which returns{ cases, groups, failureCount, failures }. The worker keeps the SHA-256 pin check, the published smoke test and report writing, and callsrunCases(context.BytesToTextBase16).harnessSha256.reviewCasesfingerprintsreview-cases.cjs, which now generates the cases. Without it the report would stop fingerprinting the case generator. The report'sseedis formatted from the exportedSEED, so the seed is no longer written out in two files.test/review-cases.test.cjsruns all 65,976 cases against a localBuffer-based encoder, never the third-party target. It checks the case count, the group counts and their order againstresults/2026-09-11.json, and a SHA-256 digest of every generated input. The expected digest was computed independently: I mechanically extracted and ran lines 30-67 ofverify.cjsat faacbef, the harness behind the recorded result. That commit'svalidator.cjsandverify.cjshash to the result'sharnessSha256values.2. A failing run publishes its report instead of hitting the 1 MiB cap
Before: the worker printed the whole report to stdout, and each of the 10 kept failures held the full input, expected and actual values. Failures on 65,536-byte inputs pushed worker output past the 1 MiB limit in
bounded-process.cjs.verify.cjsthen exited 2 and deleted the staged report, instead of exiting 1 asdocs/reproduce.mddocuments.Now: the worker prints only
{ cases, failureCount, report }.verify.cjsalready publishes the staged file and ignores worker stdout. This short summary is what keeps the run under the cap, because the failure path writes nothing else to stdout or stderr.Failure records are compact:
case,group,inputLength,inputHead(first 32 bytes),expectedHead(first 64 characters),actualHead(first 64 characters or array entries) anderror(first 200 characters). A returned value that is neither a string nor an array is still recorded as returned. The new format is described indocs/reproduce.md.New tests:
Both fail against the old record format.
3. Dependabot
.github/dependabot.ymladds weeklygithub-actionsversion updates for the SHA-pinned actions. There is nopackage.json, so npm is not configured.check.ymlis unchanged.4. README test count and code map
node --teston this branch: 35 tests, 4 POSIX-only. That is 6 core checks, 12 faulty-encoder controls, 1 test of 512 generated valid encodings, 3 case-generation tests, 9 process-limit and CLI tests and 4 signal tests.review-worker.cjs,review-cases.cjs,bounded-process.cjs,source-record.jsonandtest/. It describesverify.cjsas it works since Harden encoder review harness with bounded execution and signal cleanup #1, and notes thatresults/2026-09-11.jsoncame from the harness at faacbef.docs/method.mdsay the new tests run against a local reference encoder, not the external target. The statement that there is no fresh 65,976-case run is unchanged and still true.Skipped
docs/assets/overview.pngandoverview-mobile.pngstill show "6 checker tests". Fixing them means re-rendering the artwork, and no tooling for that is available here, so they are untouched. Until they are re-rendered, the corrected alt text (35 tests) disagrees with the image.Verification
node --test test/*.test.cjslocally on Node 22.23.3 (Windows): 35 tests, 31 pass, 4 skipped (the POSIX-only signal tests). CI runs all 35 on Node 24 (Ubuntu).mainmain's for the correct and the ≥ 4,096 encoders. That covers every field, key order and the failure records, apart fromcheckedAt,elapsedSecondsandharnessSha256(the worker hash changes andreviewCasesis added).docs/reproduce.mdadvises.🤖 Generated with Claude Code