Skip to content

Add Cargo workspace verification job to CI + pin wasmparser/wasm-encoder#42

Merged
hyperpolymath merged 3 commits into
mainfrom
claude/adoring-volta-LCdCJ
May 23, 2026
Merged

Add Cargo workspace verification job to CI + pin wasmparser/wasm-encoder#42
hyperpolymath merged 3 commits into
mainfrom
claude/adoring-volta-LCdCJ

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Adds a new cargo-verify CI job to catch wasmparser/wasm-encoder API breaks before they land, and pins exact versions of these dependencies to force deliberate ports rather than silent lockfile updates.

This addresses a gap in CI coverage: the post-codegen verifier (typed-wasm-verify crate) was not being tested on every PR, allowing dependabot version bumps to land green even when they broke the Rust workspace. A previous incident (commit 7223ef0) demonstrated this risk when wasmparser's import iterator API changed between 0.221 and 0.250.

Changes

  • CI workflow (e2e.yml): Added cargo-verify job that builds and tests the Rust workspace on every PR

    • Runs cargo build --workspace --locked and cargo test --workspace --locked
    • Ensures dependabot bumps to wasmparser/wasm-encoder are caught immediately
  • Dependency pinning (Cargo.toml): Changed wasmparser and wasm-encoder from "0.250" to "=0.250.0"

    • Exact pins force visible diffs in Cargo.toml when dependabot bumps occur
    • Prevents silent lockfile-only updates that could hide breaking changes
    • Added explanatory comment about wasmparser's API instability in the 0.x line
  • API adaptation (verify.rs, cross.rs): Updated import iteration to use .into_imports()

    • Adapts to wasmparser 0.250's Imports group enum that wraps individual Import values
    • Includes inline comments explaining the 0.250 API change

Testing

The new cargo-verify job runs on every PR and will catch any future wasmparser/wasm-encoder API breaks before they merge. Existing tests pass with the updated import iteration code.

https://claude.ai/code/session_01ExgUTJmU5UQQNLKynwxDjm

claude added 2 commits May 23, 2026 19:31
The 0.221 -> 0.250 bumps (#39, #40) reshaped `ImportSectionReader` to
yield the new `Imports<'a>` group enum instead of `Import<'a>`, breaking
both `verify.rs` (L13 isolation check) and `cross.rs` (linear-import
slot tracking) with 8 x E0609. `.into_imports()` flattens groups back
to individual `Import`s with no semantic change.

Cargo.toml is now exact-pinned (=0.250.0) so future bumps land as a
visible manifest diff rather than a silent lockfile move. Lockfile
regenerated to drop the duplicate `wasmparser` entry the back-to-back
bumps left behind.

53/53 tests pass (43 unit + 10 cross_compat).
No CI was building the Rust crate, which is why the wasmparser /
wasm-encoder 0.221 -> 0.250 bumps (#39, #40) landed green despite
breaking the import iterator in verify.rs and cross.rs (fixed in
7223ef0). Adds a fourth job to e2e.yml that runs
cargo build --workspace --locked and cargo test --workspace --locked
on every PR, so future dependabot bumps that drop the API have to
fix it in the same PR.

--locked is intentional: it fails CI if the lockfile and Cargo.toml
disagree, which is the failure mode that left the duplicate
wasmparser entry in Cargo.lock after the back-to-back merges.
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 25 issues detected

Severity Count
🔴 Critical 6
🟠 High 8
🟡 Medium 11

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/setup-node@v6 needs attention",
    "type": "unpinned_action",
    "file": "e2e.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/setup-node@v6 needs attention",
    "type": "unpinned_action",
    "file": "e2e.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Action actions/upload-artifact@v4 needs attention",
    "type": "unpinned_action",
    "file": "release.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/download-artifact@v4 needs attention",
    "type": "unpinned_action",
    "file": "release.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/typed-wasm/typed-wasm/src/abi/TypedWasm/ABI/SessionProtocol.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "assert_total bypasses totality checker (1 occurrences, CWE-704)",
    "type": "assert_total",
    "file": "/home/runner/work/typed-wasm/typed-wasm/src/abi/TypedWasm/ABI/SessionProtocol.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/typed-wasm/typed-wasm/src/abi/TypedWasm/ABI/Echo.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

This repo uses deno.lock as the lockfile of record. package-lock.json
only appears when someone runs `npm install` locally (e.g. to invoke
rescript via node_modules/.bin/rescript during an audit) and is not
meant to be tracked. Without this entry the stop-hook git check trips
on the untracked file every time.
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 25 issues detected

Severity Count
🔴 Critical 6
🟠 High 8
🟡 Medium 11

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/setup-node@v6 needs attention",
    "type": "unpinned_action",
    "file": "e2e.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/setup-node@v6 needs attention",
    "type": "unpinned_action",
    "file": "e2e.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Action actions/upload-artifact@v4 needs attention",
    "type": "unpinned_action",
    "file": "release.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action actions/download-artifact@v4 needs attention",
    "type": "unpinned_action",
    "file": "release.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/typed-wasm/typed-wasm/src/abi/TypedWasm/ABI/SessionProtocol.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "assert_total bypasses totality checker (1 occurrences, CWE-704)",
    "type": "assert_total",
    "file": "/home/runner/work/typed-wasm/typed-wasm/src/abi/TypedWasm/ABI/SessionProtocol.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "believe_me undermines formal verification (1 occurrences, CWE-704)",
    "type": "believe_me",
    "file": "/home/runner/work/typed-wasm/typed-wasm/src/abi/TypedWasm/ABI/Echo.idr",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit 7544cf0 into main May 23, 2026
18 of 26 checks passed
@hyperpolymath hyperpolymath deleted the claude/adoring-volta-LCdCJ branch May 23, 2026 21:12
hyperpolymath added a commit that referenced this pull request May 24, 2026
## Summary

PR #42 merged with 8 red CI jobs; PR #44 repaired 2 (smoke test,
workflow-security-linter) but left 6 still failing on every PR run. This
PR repairs 4 of the remaining 6 — purely CI infrastructure fixes, no
code-behaviour changes.

## Diagnosis (from PR #44 check_runs + PR #45 confirming persistence)

| Job | Root cause | Status after this PR |
|---|---|---|
| Cargo build + test (typed-wasm-verify) | "Install Rust toolchain" exit
1 — `dtolnay/rust-toolchain@<SHA>` action returned non-zero. Local
`cargo test --workspace --locked` passes 10/10. | fixed (swap action for
rustup) |
| Build + E2E (Idris2 + Zig) | "Install Zig" curl exit 22 (HTTP 404) —
Zig 0.14+ flipped tarball naming from `zig-OS-ARCH-VERSION` to
`zig-ARCH-OS-VERSION`. | fixed (URL + symlink path) |
| Structural E2E (no-build) | `tests/e2e.sh` section 5 asserted
gitignored `.mjs` build outputs exist; section 9 invoked the smoke test
which import-fails when those outputs are absent. Locally passed because
cached artifacts existed; CI clean checkouts always failed. | fixed
(separate sources from outputs; skip smoke cleanly when artifacts
missing) |
| governance / Language / package anti-pattern policy | Shared workflow
flags 6 tracked `.res` files. Honors per-repo `.hypatia-ignore`. | fixed
(add `.hypatia-ignore` with 6 entries) |
| Validate A2ML manifests | Third-party
`hyperpolymath/a2ml-validate-action` exit 1 — log contents not readable
without auth. | **not fixed** — separate investigation |
| Validate K9 contracts | Third-party `hyperpolymath/k9-validate-action`
exit 1 — same. | **not fixed** — separate investigation |

## Changes

- **`.github/workflows/e2e.yml`** — cargo-verify uses `rustup toolchain
install stable` directly (ubuntu-latest preinstalls rustup); Zig install
URL + symlink updated to 0.14+ naming.
- **`tests/e2e.sh`** — section 5 now distinguishes `PARSER_SOURCES`
(required) from `PARSER_OUTPUTS` (skip-if-absent); section 9 skips the
smoke invocation when `Parser.mjs` or `node_modules/@rescript` is
absent.
- **`.hypatia-ignore`** — new file exempting the 6 tracked ReScript
source files (`src/parser/{Parser,Lexer,Checker,Ast}.res`,
`examples/SafeDOMExample.res`, `tests/parser/ParserTests.res`) per the
rule format honored by
`hyperpolymath/standards/.github/workflows/governance-reusable.yml`.
Documented that the exemptions go away when the tree-sitter + Idris2
parser migration lands.

## Verification

Reproduced the structural failure in a clean clone (no node_modules, no
rescript build):

- **Before**: 49 passed, 4 failed, 1 skipped → FAILED
- **After**: 49 passed, 0 failed, 5 skipped → PASSED

Local artifact-populated tree still passes (53 passed, 0 failed, 1
skipped).

Cargo workspace verified locally: `cargo build --workspace --locked` ✓,
`cargo test --workspace --locked` 10/10 ✓.

Zig URL fix is a static rename; will be exercised when the build-e2e job
runs.

## Out of scope

- A2ML + K9 validator failures (need log access to diagnose)
- ReScript removal proper (Track A: tree-sitter grammar → Idris2 parser
→ ReScript cut)
- Property tests, Security aspect dimension, proof-level regression
tests (Track C cleanup)

## Test plan

- [ ] Cargo build + test (typed-wasm-verify) → green
- [ ] Build + E2E (Idris2 + Zig) → green (or fail at idris2/zig build,
not at install)
- [ ] Structural E2E (no-build) → green
- [ ] governance / Language / package anti-pattern policy → green
- [ ] Smoke test (Node.js ReScript parser) → still green (unaffected)
- [ ] governance / Workflow security linter → still green (unaffected)


---
_Generated by [Claude
Code](https://claude.ai/code/session_01ExgUTJmU5UQQNLKynwxDjm)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants