Skip to content

test: add E2E structural validation and CI workflow for typed-wasm#7

Merged
hyperpolymath merged 3 commits into
mainfrom
feat/e2e-validation-tests
Apr 4, 2026
Merged

test: add E2E structural validation and CI workflow for typed-wasm#7
hyperpolymath merged 3 commits into
mainfrom
feat/e2e-validation-tests

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

  • Adds tests/e2e.sh — 53-check structural E2E validation script covering: all 12 type-safety levels documented in LEVEL-STATUS.md, spec documents (grammar + level spec), all Idris2 ABI .idr files (L1-L12), Zig FFI files, ReScript parser files, configuration files (ipkg, selur-compose.toml, deno.lock), RSR required files, SPDX headers, and Node.js smoke test invocation
  • Adds .github/workflows/e2e.yml — three-job CI workflow: fast structural check, Node.js smoke test, and full Idris2 + Zig build-then-E2E

Test plan

  • E2E_BUILD=0 bash tests/e2e.sh passes locally (53 passed, 0 failed)
  • node tests/e2e/e2e-smoke.mjs passes locally
  • Verify structural CI job passes
  • Verify smoke CI job passes
  • Verify build-e2e CI job succeeds with Idris2 + Zig

🤖 Generated with Claude Code

hyperpolymath and others added 3 commits April 4, 2026 12:00
… config

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@hyperpolymath
hyperpolymath merged commit b3fb584 into main Apr 4, 2026
16 of 25 checks passed
@hyperpolymath
hyperpolymath deleted the feat/e2e-validation-tests branch April 12, 2026 11:06
hyperpolymath added a commit that referenced this pull request May 19, 2026
…, SPDX-only) (#36)

Not a relicence; owner-sanctioned carve-out. A8(1). Refs LICENCE-DEBT-LEDGER-2026-05-18.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request Jun 3, 2026
…t (refs #126 — source-line resolution defers to #129) (#159)

## Summary

Closes the prose-readability slice of #126: reword all `#[error(...)]`
templates and replace `tw-verify`'s `{:?}` debug-dump with a grouped,
location-anchored bulleted list.

## Changes

**lib.rs — error message rewording (Display-only; no API breaks)**

Pattern: `L<n> (<aspect>): <subject is X but should be Y>`.

| Variant | Old (excerpt) | New (excerpt) |
|---|---|---|
| `LinearUsedMultiple` | "Level 10 violation: function 0, param 0 —
Linear (own) param loaded 5 times on some path" | "L10 (linearity):
function #0 parameter #0 is a Linear (own) resource but is used 5 times
on some control-flow path; Linear resources must be consumed exactly
once (possible duplication)" |
| `ExclBorrowAliased` | "Level 7 violation: function 0, param 0 —
ExclBorrow (mut) param aliased (2 simultaneous references)" | "L7
(aliasing): function #0 parameter #0 is an ExclBorrow (&mut) reference
but 2 simultaneous borrows occur on some control-flow path; at most one
is permitted" |
| `ModuleNotIsolated` | "Level 13 violation: {reason}" | "L13 (module
isolation): {reason}" |
| `LinearImportCalledMultiple` | "Level 10 boundary violation: caller fn
7 calls import 'consume' 2 time(s)…" | "L10 (linearity, cross-module):
caller function #7 calls Linear import 'consume' 2 times on some
control-flow path; Linear imports must be called at most once on every
path" |
| `MissingDependentRegions` | "Level 2 violation: typedwasm.access-sites
section emitted without companion typedwasm.regions section
(MissingDependentCarrier)" | "L2 (region binding):
typedwasm.access-sites section is present but the companion
typedwasm.regions section is missing — access-site (region, field) keys
have nothing to resolve against" |

Same treatment for `LinearNotUsed`, `LinearDroppedOnSomePath`,
`LinearImportDroppedOnSomePath`, `CapabilitiesError::*`,
`AccessSiteError::*`.

**VerifyError Vec-wrappers**: replaced raw `{:?}` debug with a
`display_first_then_ellipsis` helper that renders as `"3 L7/L10/L13
ownership violation(s) — <first error's full Display>; … and 2 more"`.

**bin/tw-verify.rs — grouped output**

Replaces the previous flat `{:?}` / `{e}` printouts with grouping:

- `OwnershipError`s are bucketed by `func_idx` (with `(module-scope)`
bucket for L13). Per bucket, errors are sorted by `param_idx` and
printed as ` - <message>`.
- `CrossError`s are bucketed by `caller_func_idx`.
- L2 / L15 errors get an explicit `FAIL <pass> ({n} violation(s))`
header + bulleted list.

Sample output (before / after) — see commit message for details.

## Out of scope

Source-line resolution ("at `.twasm` line N") **defers to #129** (source
maps). The verifier still has only wasm-level indices today; the `#0`
parameter / `#N` function notation makes that boundary explicit in the
prose.

## Test plan

- [x] `cargo test -p typed-wasm-verify` — 65 lib tests pass (62 baseline
+ 3 new Display tests)
- [x] `cargo test -p typed-wasm-verify --all-features` — 80 lib + 10
cross-compat + 5 cross-compat-real all green
- [x] `cargo clippy -p typed-wasm-verify --all-features --tests` — no
new warnings (the pre-existing `collapsible-match` at `verify.rs:323`
remains; not mine)
- [x] No test compared raw error strings (all use `matches!` on
variants), so rewording is backwards-compatible for the test suite

Refs #126. Source-line resolution defers to #129.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request Jun 16, 2026
…template residue

Safe-auto items from the repo tidy-up audit (#7):
- docs/proof-debt.md + docs/wiki/Proof-Debt-Status.md: "22/22 modules" / "22
  Idris2 modules" → 24 (verified: find src/abi -name '*.idr' | wc -l = 24;
  AFFIRMATION.adoc already records 24 — these were the laggards).
- .github/CODEOWNERS: remove the dead "Replace hyperpolymath with..." scaffold
  comment (the substantive owner rules below it are correct).

Purely factual / dead-comment edits; no renames, dates, or licence/owner lines
touched. Larger findings are owner-gated and listed separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <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.

1 participant