Conversation
Introduce a reusable workflow (graymatter-fuzz-source.yml) that runs the graymatter fuzz-m1-source against any target implementation, with automatic issue creation on failure (@-mentioning a configured user). - Add SourceConfig, getSourceConfig(), and fuzzSource() to tests/common.ts - Add tests/fuzz-source/ test suite (mirrors picofuzz/minifuzz pattern) - Add typeberry-fuzz.yml as the first caller workflow - Document fuzz source workflows and review checklist in agents.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a reusable GitHub Actions fuzz-source workflow, a TypeBerry caller, Docker-based test helpers and end-to-end fuzz-source tests, and documentation updates describing workflow usage and a review checklist. Changes
Sequence DiagramsequenceDiagram
participant Caller as Workflow Caller
participant Init as Init Job
participant Fuzz as Fuzz Job
participant Docker as Docker Engine
participant Notify as Notify Job
participant GHAPI as GitHub API
Caller->>Init: workflow_call with inputs
Init->>Docker: pull target & conformance-fuzzer images
Init-->>Caller: init complete
Caller->>Fuzz: start fuzz job (depends on init)
Fuzz->>Docker: start target container (shared volume)
Fuzz->>Docker: start fuzz source container (env, cmd, memory)
Docker-->>Fuzz: run/monitor, enforce timeouts
Fuzz-->>Caller: success/failure
alt failure and mention provided
Caller->>Notify: run notify job
Notify->>GHAPI: search for existing issue with labels
alt no existing issue
Notify->>GHAPI: create issue with details and mention
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The socket created by the target is owned by root. Running the graymatter source as user 1000 causes EACCES when connecting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The target creates the socket as root. External fuzz source containers may run as a non-root user (e.g. graymatter), causing EACCES on connect. Fix by chmod 777 on the socket after target readiness, before starting the source. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/graymatter-fuzz-source.yml:
- Around line 28-32: The workflow currently only uses docker_platform for init
pulls so container runs can use the host arch; propagate the selected platform
by adding platform fields to the TargetConfig and SourceConfig interfaces, read
them from TARGET_PLATFORM and SOURCE_PLATFORM environment vars, and then pass
the platform into the docker run commands in tests/common.ts by inserting
--platform <value> immediately before config.image in startTarget() and
fuzzSource(); ensure the env vars are set from the workflow inputs and default
to the existing docker_platform value when missing.
In `@tests/fuzz-source/common.ts`:
- Around line 1-2: The test reuses a fixed shared-volume name which allows stale
sockets to bypass readiness; update createSharedVolume to generate a unique
per-run name (e.g., include timestamp/PID or crypto.randomUUID) and have
tests/fuzz-source/common.ts call it so each fuzz run gets its own volume; also
stop silently swallowing docker volume rm errors in createSharedVolume
(propagate or log the failure) and harden waitForSocket to verify the socket is
actually connectable (reference createSharedVolume, waitForSocket, and the
/shared/jam_target.sock path) rather than only testing file existence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e79cacdf-cb30-45e1-8d74-b321ea903151
📒 Files selected for processing (6)
.github/workflows/graymatter-fuzz-source.yml.github/workflows/typeberry-fuzz.ymlagents.mdtests/common.tstests/fuzz-source/common.tstests/fuzz-source/fuzz.test.ts
There was a problem hiding this comment.
🧹 Nitpick comments (3)
.github/workflows/graymatter-fuzz-source.yml (3)
56-56: Actionlint "perf" label warning is a false positive.The static analysis tool flagged the
perflabel as unknown, but this is expected for custom self-hosted runner labels. Consider adding anactionlint.yamlconfig file to silence this warning:self-hosted-runner: labels: - perf🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/graymatter-fuzz-source.yml at line 56, Actionlint is reporting the custom self-hosted runner label "perf" as unknown; add an actionlint config to whitelist that label by creating an actionlint.yaml that defines a self-hosted-runner.labels list containing "perf" (so actionlint recognizes the custom label used in the workflow file where runs-on: [self-hosted, perf] is declared).
108-108: Consider parameterizing--num-blocksfor flexibility.The fuzz source command hardcodes
--num-blocks 100. For different test scenarios (quick smoke tests vs. thorough fuzzing), exposing this as a workflow input would add flexibility.🔧 Suggested change
Add a new input:
fuzz_iterations: required: false type: number default: 100 description: "Number of blocks to fuzz"Then reference it:
- SOURCE_CMD: 'fuzz-m1-source --num-blocks 100 --target {TARGET_SOCK}' + SOURCE_CMD: 'fuzz-m1-source --num-blocks ${{ inputs.fuzz_iterations }} --target {TARGET_SOCK}'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/graymatter-fuzz-source.yml at line 108, The workflow hardcodes "--num-blocks 100" in the SOURCE_CMD which reduces flexibility; add a new workflow input (e.g., fuzz_iterations) with a default (100) and use that input in SOURCE_CMD so the command becomes "fuzz-m1-source --num-blocks ${ { inputs.fuzz_iterations } } --target {TARGET_SOCK}" (reference the SOURCE_CMD variable and the fuzz-m1-source invocation) to allow configurable iteration counts for smoke vs thorough runs.
54-80: Init image pulls may not benefit fuzz job on different runners.The
initandfuzzjobs both target[self-hosted, perf]runners but may land on different machines. The Docker images pulled duringinitwon't be cached forfuzzif they run on separate hosts.Consider either:
- Combining into a single job if image caching is the primary goal
- Accepting the potential re-pull overhead (current approach is still valid, just slightly less efficient)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/graymatter-fuzz-source.yml around lines 54 - 80, The init job pulls Docker images that the fuzz job expects but since 'init' and 'fuzz' are separate jobs both targeting [self-hosted, perf] they may land on different hosts and the pulled images won't be available to 'fuzz'; fix by merging the 'init' steps (checkout, setup-node, npm ci, docker pull lines for ${{ inputs.docker_image }} and the graymatter fuzzer) into the 'fuzz' job so image pulls and preparation run on the same runner as the fuzz step (i.e., move the docker pull commands and installation steps from the 'init' job into the 'fuzz' job) or explicitly accept the current design and remove the unnecessary separate 'init' job if re-pulls are acceptable.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/graymatter-fuzz-source.yml:
- Line 56: Actionlint is reporting the custom self-hosted runner label "perf" as
unknown; add an actionlint config to whitelist that label by creating an
actionlint.yaml that defines a self-hosted-runner.labels list containing "perf"
(so actionlint recognizes the custom label used in the workflow file where
runs-on: [self-hosted, perf] is declared).
- Line 108: The workflow hardcodes "--num-blocks 100" in the SOURCE_CMD which
reduces flexibility; add a new workflow input (e.g., fuzz_iterations) with a
default (100) and use that input in SOURCE_CMD so the command becomes
"fuzz-m1-source --num-blocks ${ { inputs.fuzz_iterations } } --target
{TARGET_SOCK}" (reference the SOURCE_CMD variable and the fuzz-m1-source
invocation) to allow configurable iteration counts for smoke vs thorough runs.
- Around line 54-80: The init job pulls Docker images that the fuzz job expects
but since 'init' and 'fuzz' are separate jobs both targeting [self-hosted, perf]
they may land on different hosts and the pulled images won't be available to
'fuzz'; fix by merging the 'init' steps (checkout, setup-node, npm ci, docker
pull lines for ${{ inputs.docker_image }} and the graymatter fuzzer) into the
'fuzz' job so image pulls and preparation run on the same runner as the fuzz
step (i.e., move the docker pull commands and installation steps from the 'init'
job into the 'fuzz' job) or explicitly accept the current design and remove the
unnecessary separate 'init' job if re-pulls are acceptable.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 13d503db-3554-45ee-aa7a-a257d997cd47
📒 Files selected for processing (4)
.github/workflows/graymatter-fuzz-source.yml.github/workflows/typeberry-fuzz.ymltests/common.tstests/fuzz-source/common.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- tests/fuzz-source/common.ts
- .github/workflows/typeberry-fuzz.yml
- tests/common.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/graymatter-fuzz-source.yml (1)
54-56: Consider adding actionlint configuration for custom runner labels.The static analysis tool flags
perfas an unknown label, but this is a valid custom label for your self-hosted runners. To silence these warnings and document your custom labels, consider adding anactionlint.yamlconfig file:self-hosted-runner: labels: - perf🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/graymatter-fuzz-source.yml around lines 54 - 56, The actionlint warning is caused by the custom runner label "perf" used in the init job's runs-on declaration; add an actionlint configuration that declares your self-hosted runner labels so actionlint recognizes "perf". Create an actionlint.yaml containing a self-hosted-runner section with a labels array that includes "perf" (so the analyzer accepts the runs-on: [self-hosted, perf] usage in the init job). Ensure the file is committed to the repo root or the location actionlint expects so the linter picks it up.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/graymatter-fuzz-source.yml:
- Around line 54-56: The actionlint warning is caused by the custom runner label
"perf" used in the init job's runs-on declaration; add an actionlint
configuration that declares your self-hosted runner labels so actionlint
recognizes "perf". Create an actionlint.yaml containing a self-hosted-runner
section with a labels array that includes "perf" (so the analyzer accepts the
runs-on: [self-hosted, perf] usage in the init job). Ensure the file is
committed to the repo root or the location actionlint expects so the linter
picks it up.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 28e344d2-cba0-4a90-a29a-25775e8fd904
📒 Files selected for processing (1)
.github/workflows/graymatter-fuzz-source.yml
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Default docker_memory to 2048m in graymatter-fuzz-source and demo-source - Hardcode timeout to 10 minutes in reusable-picofuzz Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each team gets a <team>-fuzz.yml calling demo-source.yml to run the graymatter fuzz source on the demo runner. Temporary push trigger on the PR branch for testing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GHA workflows now pass their timeout_minutes input as TIMEOUT_MINUTES env var to test processes. TS test files read it via getTimeoutMs(), falling back to previous hardcoded defaults for local development. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Typeberry workflows: trigger on any PR (validates reusable workflows and shared test code) - Other team workflows: trigger on PRs that modify their own file - Remove temporary push-on-branch triggers from all fuzz workflows Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add NUM_RUNS support: the fuzzer source is restarted between runs while the target keeps running, allowing memory to be reclaimed. Typeberry fuzz now does 9x10k blocks instead of 1x90k. Demo default bumped to 5k blocks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
graymatter-fuzz-source.ymlworkflow that runs the graymatterfuzz-m1-sourceagainst any target implementationtypeberry-fuzz.ymlas the first caller workflowtests/fuzz-source/,fuzzSource()intests/common.ts) following the existing picofuzz/minifuzz patternagents.mdTest plan
Fuzz: typeberryworkflow manually from Actions tab🤖 Generated with Claude Code
Summary by CodeRabbit
Tests
CI/CD
Documentation