Skip to content

feat(build): add multi-language fuzzing infra (CFLite + Codecov flags)#453

Open
WilliamBerryiii wants to merge 33 commits intomainfrom
feat/issue-150-fuzzing-infrastructure
Open

feat(build): add multi-language fuzzing infra (CFLite + Codecov flags)#453
WilliamBerryiii wants to merge 33 commits intomainfrom
feat/issue-150-fuzzing-infrastructure

Conversation

@WilliamBerryiii
Copy link
Copy Markdown
Member

@WilliamBerryiii WilliamBerryiii commented Apr 28, 2026

Description

Adds multi-language fuzzing infrastructure to edge-ai using ClusterFuzzLite, cargo-fuzz, Atheris, and Jazzer.js, wired into a PR-only workflow with per-component Codecov flags.

  • Wire ClusterFuzzLite Dockerfile, build scripts, and PR-only workflow
  • Add cargo-fuzz harness for 501-rust-telemetry; Atheris stubs for 505/506/509/510
  • Extend Detect-Folder-Changes.ps1 + matrix-folder-check.yml with fuzz outputs
  • Add 11 per-component Codecov flags (carryforward); SHA-pin CFLite actions
  • Wave 2 soft-fail (continue-on-error: true) until two clean sprints

Related Issue

Closes #150

Type of Change

  • New feature (non-breaking change which adds functionality)
  • CI/CD pipeline change

Implementation Details

22 files / 860 insertions:

  • CFLite scaffold (.clusterfuzzlite/): Dockerfile, build.sh, language-specific build helpers
  • Workflows: PR-only cflite_pr.yml (SHA-pinned to 82652fb4...); fuzz outputs added to Detect-Folder-Changes.ps1 and matrix-folder-check.yml
  • Codecov: 11 per-component flags with carryforward; Codecov-action v4.5.0 (e28ff129...) using OIDC (id-token: write)
  • Rust harness: cargo-fuzz target parse_telemetry for 501-rust-telemetry (libfuzzer-sys 0.4.12, nightly-2026-04-01)
  • Python stubs: Atheris harnesses for 505, 506, 509, 510
  • JS harness: Jazzer.js 2.1.0 + c8 10.1.2

Wave 2 components run with continue-on-error: true until two clean sprints.

Testing Performed

  • cargo-fuzz parse_telemetry ran 55.02s without crashes
  • Lint sweep clean (Rust fmt, ESLint, mdlint, N802, DR-10)
  • SHA pinning verified: 130/130 actions pinned across 31 workflows

Validation Steps

  1. Inspect .clusterfuzzlite/ scaffold and language build scripts
  2. Confirm cflite_pr.yml triggers only on PR and uses SHA-pinned actions
  3. Verify per-component Codecov flags include carryforward
  4. Confirm Wave 2 jobs use continue-on-error: true

Checklist

  • Conventional Commit message
  • No breaking changes to existing components
  • Workflows SHA-pinned
  • Codecov flags scoped per component

Security Review

Not triggered — no changes under deploy/, SECURITY.md, or src/000-cloud/010-security-identity/. New CI workflow uses SHA-pinned third-party actions and OIDC for Codecov.

Additional Notes

🧪 - Generated by Copilot

Note: Python 3.11 (temporary)

ClusterFuzzLite Python harnesses run on Python 3.11, not 3.12:

* Wire ClusterFuzzLite Dockerfile, build scripts, and PR-only workflow
* Add cargo-fuzz harness for 501-rust-telemetry; Atheris stubs for 505/506/509/510
* Extend Detect-Folder-Changes.ps1 + matrix-folder-check.yml with fuzz outputs
* Add 11 per-component Codecov flags (carryforward); SHA-pin CFLite actions
* Wave 2 soft-fail (continue-on-error: true) until two clean sprints

🧪 - Generated by Copilot
@WilliamBerryiii WilliamBerryiii requested a review from a team as a code owner April 28, 2026 19:10
Bill Berry added 6 commits April 28, 2026 13:05
The receiver fuzz crate inherits the parent nightly toolchain pin which uses profile=minimal and lacks the clippy component. Skip any crate path ending in /fuzz during clippy crate discovery so the workflow stays green.

Also add a top-level doc comment to parse_telemetry.rs to trigger the fuzz-pr.yml path filter and exercise the fuzz pipeline on this PR.
…startup_failure on PRs without fuzz changes
…dation/main

- Pin ClusterFuzzLite actions to v1 SHA 884713a6c30a92e5e8544c39945cd7cb630abcd1 to fix startup_failure

- Convert fuzz-pr.yml to reusable workflow (workflow_call)

- Add fuzz job to pr-validation.yml and fuzz-main job to main.yml

- All fuzz jobs use continue-on-error: true (Wave 2 soft-fail)
- emit lowercase 'true'/'false' for changesInFuzz{Rust,Python,Js} so case-sensitive GHA gating matches
- harden default fuzz folder outputs to {"folderName":[]} for matrix compatibility
- broaden JS fuzz regex to match .mjs/.cjs and /tests/fuzz/ paths

🐛 - Generated by Copilot
@WilliamBerryiii WilliamBerryiii marked this pull request as draft April 29, 2026 05:02
@WilliamBerryiii WilliamBerryiii marked this pull request as draft April 29, 2026 05:02
Bill Berry added 3 commits April 29, 2026 15:42
…seBranch

- rename -IncludeIaCFolders to -IncludeAllIaC
- rename -IncludeApplications to -IncludeAllApplications
- explicitly pass -BaseBranch to prevent positional binding corruption

🐛 - Generated by Copilot
- replace array splat with hashtable to bind named parameters correctly
- positional binding caused BaseBranch="-BaseBranch" and ApplicationPath empty
- unblocks fuzz Rust/Python/JS jobs on PR #453

🐛 - Generated by Copilot
- add software-properties-common and deadsnakes PPA to Dockerfile
- install python3.12-venv and bootstrap pip via get-pip.py
- works around OSS-Fuzz base-builder-rust:v1 being Ubuntu 20.04 focal

🐍 - Generated by Copilot
Bill Berry added 8 commits April 29, 2026 19:51
- atheris 3.0.0 does not support python 3.12

- deadsnakes ppa on ubuntu 20.04 focal lacks python3.12-dev/venv

- 24.04 base image upgrade tracked in #454

Refs #454

🐛 - Generated by Copilot
…back on noble

- add build-essential, cmake, python3 apt packages so node-gyp can compile
- install prebuild, cmake-js, node-gyp globally before @jazzer.js/core@2.1.0
- resolves exit 127 from missing prebuild CLI when napi prebuilt binary is unavailable for noble + Node 20

🐛 - Generated by Copilot
- detect cargo-fuzz layout by requiring both fuzz/Cargo.toml and parent Cargo.toml
- skip Python pytest fixture dirs named 'fuzz' (e.g. sensor-simulator/tests/fuzz)
- emit skip message for visibility in CI logs

🛠️ - Generated by Copilot
- drop ubuntu-24-04 base tag (glibc 2.38) that broke bad_build_check on
  ubuntu-20.04 runner (glibc 2.31); use default base-builder-rust
- remove Python (Atheris) and Node.js (Jazzer.js) toolchain layers and
  COPY of build_python.sh/build_js.sh from Dockerfile
- comment out Py/JS dispatch in build.sh
- gate fuzz-python and fuzz-js workflow jobs with if: false; preserve
  original change-detect expressions as comments for restore
- preserve build_python.sh/build_js.sh and existing harnesses for the
  follow-up per-language builder containers (split from #150)

Refs #150
Refs #453

🐛 - Generated by Copilot
…tion

Wrap Invoke-ScriptAnalyzer in try/catch so PSSA internal crashes surface
the offending file as a warning instead of failing the entire lint job.

🛡️ - Generated by Copilot
…ners (#459)

Extend the ClusterFuzzLite image to fuzz Python and JavaScript harnesses
alongside the existing Rust scaffolding by parameterizing the base image
and dispatching to language-specific build scripts at runtime.

Container changes:
- Parameterize Dockerfile with ARG LANGUAGE (default rust); FROM now
  resolves to gcr.io/oss-fuzz-base/base-builder-${LANGUAGE} so the
  ClusterFuzzLite action's language: input drives the base layer.
- Copy build_rust.sh, build_python.sh, and build_js.sh into the image
  and dispatch from build.sh via case on ${LANGUAGE:-rust}.

Python harness (services 505, 509, 510; 506 deferred to WI-02):
- build_python.sh installs per-service requirements.txt when present,
  builds each harness with PyInstaller --onefile, and emits an ASAN
  wrapper script that exports LD_PRELOAD for libasan before exec.

JavaScript harness (service 513):
- build_js.sh runs npm ci (falling back to npm install) before emitting
  the Jazzer.js wrapper so @jazzer.js/core resolves at fuzz time.
- Add @jazzer.js/core ^2 as devDependency in 513 package.json.

CI and docs:
- Re-enable fuzz-python and fuzz-js jobs in fuzz-pr.yml (drop if: false).
- Remove orphan fuzz-py-506 flag from codecov.yml.
- Add .clusterfuzzlite/README.md describing the polyglot architecture.
- Add docs/build-cicd/clusterfuzzlite.md with troubleshooting section.

Decisions:
- ID-02=A: bash-only build scripts (rejected pwsh shim to keep image
  size down and avoid pulling the PowerShell supply chain into a
  fuzzing base image).
- ID-03=A: fold into existing PR #150 by stacking on the parent
  feat/issue-150-fuzzing-infrastructure branch rather than opening a
  new PR.

Closes #459

🐛 - Generated by Copilot
@WilliamBerryiii WilliamBerryiii self-assigned this May 1, 2026
@WilliamBerryiii WilliamBerryiii marked this pull request as draft May 1, 2026 05:22
Bill Berry added 3 commits May 1, 2026 11:00
…rFuzzLite CI (#459)

- DD-05: hadolint DL3006 waiver in .clusterfuzzlite/Dockerfile + README note; codecov.yml gains fuzz-js-513 flag (and re-adds fuzz-py-506 per DD-04).
- DD-06: add fuzz_smoke.py harnesses for services 505/509/510 and a fuzz_smoke.mjs harness for service 513; extend HARNESSES arrays in build_python.sh and build_js.sh so the new harnesses are built.

🧪 - Generated by Copilot
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

📚 Documentation Health Report

Generated on: 2026-05-01 20:37:40 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

…rds, fix shell lint

- set python and js fuzz sanitizer to none in fuzz-pr.yml
- install atheris before harness build in build_python.sh
- add distpath/preinstalls/symbolizer and other words to .cspell.json
- fix case-arm spacing in .clusterfuzzlite/build.sh

🛠️ - Generated by Copilot
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

📚 Documentation Health Report

Generated on: 2026-05-01 23:04:31 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

@WilliamBerryiii WilliamBerryiii marked this pull request as ready for review May 1, 2026 23:21
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

📚 Documentation Health Report

Generated on: 2026-05-01 23:31:10 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

📚 Documentation Health Report

Generated on: 2026-05-02 00:14:28 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

…o none

- install atheris+pyinstaller in .clusterfuzzlite/Dockerfile when LANGUAGE=python so compile.py import succeeds
- switch fuzz-pr.yml javascript sanitizer from address to none (CFL JS rejects address)
- format fuzz_smoke harnesses (PEP8 blank line after docstring)

🐛 - Generated by Copilot
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

📚 Documentation Health Report

Generated on: 2026-05-02 00:56:05 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

- Dockerfile: CFLite does not forward language: as a build-arg, so the LANGUAGE
  ARG always defaulted to rust at image-build time, leaving atheris uninstalled
  for python harnesses. Switch to a fixed base-builder-rust base and install
  atheris+pyinstaller unconditionally.
- fuzz-pr.yml: javascript jobs require sanitizer in {address,memory,undefined,
  coverage}; replace 'none' with 'coverage'.
- build_python.sh: prefer 'python3 -m pip' over the bare pip3 shim.

🛠 - Generated by Copilot
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

📚 Documentation Health Report

Generated on: 2026-05-03 03:01:57 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

…arnesses

The OSS-Fuzz compile step exports FUZZING_LANGUAGE (canonical), not LANGUAGE,
inside the build container. build.sh fell through to its rust default in every
language job, so python and js jobs built rust binaries that then failed
bad_build_check (.pkg architecture probe).

🛠 - Generated by Copilot
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

📚 Documentation Health Report

Generated on: 2026-05-03 03:40:45 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

📚 Documentation Health Report

Generated on: 2026-05-04 17:51:27 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

📚 Documentation Health Report

Generated on: 2026-05-04 19:01:21 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

…heck

- build_js.sh: replace 'npm ci' with 'npm install --no-audit --no-fund'
  to tolerate lockfile drift in 513-tiered-notification-service.
- build_python.sh: add 'LLVMFuzzerTestOneInput' comment marker to the
  generated wrapper so OSS-Fuzz bad_build_check recognizes the
  PyInstaller-backed Atheris targets as fuzz targets.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

📚 Documentation Health Report

Generated on: 2026-05-05 00:11:51 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

📚 Documentation Health Report

Generated on: 2026-05-06 01:10:07 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 43
AI Assistant Guides (Copilot) 17
Total 513

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

…g-infrastructure

# Conflicts:
#	.github/workflows/matrix-folder-check.yml
#	codecov.yml
#	scripts/build/Detect-Folder-Changes.ps1
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

📚 Documentation Health Report

Generated on: 2026-05-06 04:43:04 UTC

📈 Documentation Statistics

Category File Count
Main Documentation 218
Infrastructure Components 196
Blueprints 39
GitHub Resources 44
AI Assistant Guides (Copilot) 17
Total 514

🏗️ Three-Tree Architecture Status

  • ✅ Bicep Documentation Tree: Auto-generated navigation
  • ✅ Terraform Documentation Tree: Auto-generated navigation
  • ✅ README Documentation Tree: Manual README organization

🔍 Quality Metrics

  • Frontmatter Validation:
    success
  • Link Validation: success

This report is automatically generated by the Documentation Automation workflow.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.41%. Comparing base (9b33d69) to head (3a77bd4).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #453   +/-   ##
=======================================
  Coverage   32.41%   32.41%           
=======================================
  Files          40       40           
  Lines        5902     5902           
=======================================
  Hits         1913     1913           
  Misses       3989     3989           
Flag Coverage Δ
rust 32.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(dynamic-analysis): add cargo-fuzz infrastructure to scheduled CI (soft warning)

3 participants