GeezerVison is showing github.com — feat(mcpx): testsupport/gen core (ChaCha8 streams) + FuzzStripJSONC proof target (#1956) by dezren39 · Pull Request #2636 · developing-today/code
Conversation
dezren39
commented
Oct 30, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Implements #1956 Approach C core — queue task 3251. Stdlib only; go.mod/go.sum untouched, rapid NOT adopted.
internal/testsupport/gen — the generator core:
Source interface (Uint64() uint64) — the only draw generators make.
- ChaCha8 streams keyed exactly per mcpx testing: one seed per run -- format (UUIDv7), derivation, and how it reaches every test #1949 §2 derivation v1:
root = SHA-256("mcpx-test-seed/v1\0" || seedID), stream(t, g@v) = SHA-256(root || 0 || "g@v" || 0 || t) as the ChaCha8 key. Adding/removing tests never shifts another test's inputs; a generator version bump never shifts another generator.
BytesSource fuzz adapter: big-endian Uint64 draws from a []byte, zeros past the end, never panics.
- Draws do their own range reduction (Lemire
Intn), per mcpx testing: one seed per run -- format (UUIDv7), derivation, and how it reaches every test #1949's stability rule — nothing depends on math/rand/v2 Rand-method stability, only on ChaCha8's specified stream.
- Size-growing runner (
Sizes/Run): sizes double small-to-large, the shrinking substitute — a failure is within 2× of the smallest failing size.
Golden stability test pins the exact first draws of the bytes@1 stream for a fixed test-vector seed: if generation output ever changes, the test fails and the change must land as a new generator version, never silently.
Proof target — FuzzStripJSONC in internal/config: fuzz bytes become a BytesSource, the generator draws the input, and StripJSONC must never panic, never grow its input, and be deterministic. f.Add seeds plus a corpus under testdata/fuzz/FuzzStripJSONC/ run as ordinary tests under plain go test ./....
Verified before pushing (laptop): go test green for testsupport/gen and the full internal/config package; a 15s -fuzz run completed 1.33M execs with no crash. Full go test ./... runs in CI on this PR.
Left as named follow-on work on #1956 (per the packet): fuzz targets for codegen.TypeFor, launcher.Expand, settings.ParseBytes; the generator registry (#1958); the scheduled -fuzz soak job (#1985 family).
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…roof target (#1956)
Approach C core, stdlib only (go.mod untouched): internal/testsupport/gen with the Source interface, ChaCha8 streams keyed by stream(test, name@version) under SHA-256 derivation v1 from #1949, a BytesSource fuzz adapter (big-endian draws, zeros past the end), Lemire Intn, and a size-growing runner (the shrinking substitute). Golden test pins the bytes@1 stream output for a fixed test-vector seed, so a generator-output change can only land as a new version. Proof target: FuzzStripJSONC in internal/config drives StripJSONC through BytesSource, with f.Add seeds plus a seed corpus under testdata/fuzz/ that runs under plain go test; a 15s local -fuzz run (1.33M execs) found no crash. Follow-on work left named on #1956: fuzz targets for codegen.TypeFor, launcher.Expand, settings.ParseBytes, the #1958 registry, and the -fuzz soak job.
coderabbitai
Bot
commented
Oct 30, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 3 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
10d548dd-16da-4ce0-8379-16e94615d22b
Commits
-
Reviewing files that changed from the base of the PR and between dd2c88f and 65cf3e9.
Files ignored due to path filters: 2
-
pkgs/mcpx/internal/testsupport/gen/gen.go is excluded by !**/gen/**
pkgs/mcpx/internal/testsupport/gen/gen_test.go is excluded by !**/gen/**
Files selected for processing: 6
-
pkgs/mcpx/internal/config/stripjsonc_fuzz_test.go
pkgs/mcpx/internal/config/testdata/fuzz/FuzzStripJSONC/seed-0
pkgs/mcpx/internal/config/testdata/fuzz/FuzzStripJSONC/seed-1
pkgs/mcpx/internal/config/testdata/fuzz/FuzzStripJSONC/seed-2
pkgs/mcpx/internal/config/testdata/fuzz/FuzzStripJSONC/seed-3
pkgs/mcpx/internal/config/testdata/fuzz/FuzzStripJSONC/seed-4
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-10-30T08:39:16.437145Z |
4ba9a55 |
PR opened |
ℹ️ 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" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ba9a559ad
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+27
to
+28
|
|
size := gen.Intn(src, 4096)
|
|
|
input := gen.Bytes(src, size)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve the intended corpus inputs when selecting the size
For the checked-in corpus and f.Add seeds, Intn consumes the first eight payload bytes as a length, so StripJSONC never receives the intended examples. For example, // only a comment becomes a comment followed by NUL padding, the block-comment seed loses its opening /*, and the seven-byte binary seed becomes empty input. This undermines the targeted comment/string edge-case coverage during ordinary go test runs. Derive the size from len(data) without consuming the source, or encode a separate length prefix in every seed so the intended payload reaches the stripper intact.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 65cf3e9: the size is no longer drawn from the source. input := gen.Bytes(src, len(data)) — Bytes over a BytesSource round-trips (pinned by TestBytesSourceReadsZerosPastTheEnd), so every seed/corpus payload now reaches StripJSONC byte-for-byte intact, including // only a comment, the block-comment seed, and the 7-byte binary seed.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Derive the input size from len(data) instead of drawing it from the
BytesSource: gen.Intn consumed the first eight payload bytes as a
length, so seed-corpus examples never reached StripJSONC intact
(Codex P2 finding on PR #2636). Bytes over a BytesSource round-trips,
so the full payload now reaches the stripper unchanged.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 30, 2026
This was referenced Nov 8, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|