|
1 | | -## 2026-02-25 — Gate iscc-wasm `conformance_selftest` behind Cargo feature |
| 1 | +## 2026-02-25 — Review of: Gate iscc-wasm `conformance_selftest` behind Cargo feature |
2 | 2 |
|
3 | | -**Done:** Added `conformance` Cargo feature to iscc-wasm that gates the `conformance_selftest` WASM |
4 | | -export. Production WASM binaries no longer include the selftest function (and its embedded JSON |
5 | | -vectors/parsing logic) unless explicitly opted in. CI workflow updated to enable the feature during |
6 | | -testing. |
| 3 | +**Verdict:** PASS |
7 | 4 |
|
8 | | -**Files changed:** |
| 5 | +**Summary:** Clean, minimal implementation adding a `conformance` Cargo feature to iscc-wasm that |
| 6 | +gates the `conformance_selftest` WASM export. All 54 wasm-pack tests pass with the feature enabled, |
| 7 | +CI workflow correctly updated, and no quality gate circumvention. |
9 | 8 |
|
10 | | -- `crates/iscc-wasm/Cargo.toml`: added `[features]` section with `conformance = []` |
11 | | -- `crates/iscc-wasm/src/lib.rs`: added `#[cfg(feature = "conformance")]` gate on |
12 | | - `conformance_selftest` export |
13 | | -- `crates/iscc-wasm/tests/unit.rs`: added `#[cfg(feature = "conformance")]` gate on |
14 | | - `test_conformance_selftest_returns_true` test |
15 | | -- `.github/workflows/ci.yml`: changed wasm-pack test command to |
16 | | - `wasm-pack test --node crates/iscc-wasm --features conformance` |
| 9 | +**Verification:** |
17 | 10 |
|
18 | | -**Verification:** All 54 wasm-pack tests pass (9 conformance + 45 unit). Clippy clean. All 14 |
19 | | -pre-commit hooks pass. All 5 verification criteria from next.md satisfied: |
| 11 | +- [x] `wasm-pack test --node crates/iscc-wasm --features conformance` passes all 54 tests (9 |
| 12 | + conformance + 45 unit) |
| 13 | +- [x] `cargo clippy -p iscc-wasm -- -D warnings` clean |
| 14 | +- [x] `grep -q '^\[features\]' crates/iscc-wasm/Cargo.toml` exits 0 — features section exists |
| 15 | +- [x] `grep -q 'cfg.*feature.*conformance' crates/iscc-wasm/src/lib.rs` exits 0 — feature gate |
| 16 | + present |
| 17 | +- [x] `grep -q '\-\-features conformance' .github/workflows/ci.yml` exits 0 — CI updated |
20 | 18 |
|
21 | | -- `[x]` `wasm-pack test --node crates/iscc-wasm --features conformance` passes all 54 tests |
22 | | -- `[x]` `cargo clippy -p iscc-wasm -- -D warnings` clean |
23 | | -- `[x]` `grep -q '^\[features\]' crates/iscc-wasm/Cargo.toml` exits 0 |
24 | | -- `[x]` `grep -q 'cfg.*feature.*conformance' crates/iscc-wasm/src/lib.rs` exits 0 |
25 | | -- `[x]` `grep -q '\-\-features conformance' .github/workflows/ci.yml` exits 0 |
| 19 | +**Issues found:** |
| 20 | + |
| 21 | +- (none) |
26 | 22 |
|
27 | 23 | **Next:** Remaining `[low]` issues: iscc-wasm stale CLAUDE.md (DataHasher/InstanceHasher documented |
28 | | -as unbound), iscc-jni exception mapping, and TypeScript port evaluation. |
29 | | - |
30 | | -**Notes:** The next.md template suggested |
31 | | -`wasm-pack test --node crates/iscc-wasm -- --features conformance` (with `--` separator), but this |
32 | | -is incorrect — `--` in wasm-pack passes args to the test runner binary (wasm-bindgen-test-runner), |
33 | | -not to cargo. The correct syntax is `wasm-pack test --node crates/iscc-wasm --features conformance` |
34 | | -(features as extra options after the path). This was discovered and fixed during implementation. The |
35 | | -issue #3 in issues.md (`conformance_selftest unconditionally exported`) is now resolved by this |
36 | | -change. |
| 24 | +as unbound), iscc-jni exception mapping, and TypeScript port evaluation. Define-next should pick the |
| 25 | +next highest-value item from the remaining low-priority issues. |
| 26 | + |
| 27 | +**Notes:** The advance agent correctly identified that next.md's suggested CI syntax |
| 28 | +`wasm-pack test --node crates/iscc-wasm -- --features conformance` (with `--` separator) is wrong — |
| 29 | +`--` in wasm-pack passes args to wasm-bindgen-test-runner, not to cargo. The correct form is |
| 30 | +`wasm-pack test --node crates/iscc-wasm --features conformance`. This is now documented in |
| 31 | +learnings.md. Issue #3 (`conformance_selftest unconditionally exported`) resolved and deleted. |
0 commit comments