Status: ✅ Resolved on main — fixed by PR #157, commit 7073d25. Verified against a freshly-fetched origin/main before editing this issue.
Description
engine-core defined three separate #[contract] structs — EngineCore (core/mod.rs), CoreEngine (core/engine.rs), and ControlPlane (core/control_plane.rs) — each with its own initialize method. On the WASM target, contract methods are exported by name into a flat symbol namespace, so three initialize exports in one crate is a hard link error. This only reproduced on the exact build CI runs; a plain native cargo build/cargo test never touches WASM codegen and passed silently, which is why it shipped undetected.
Affected Component
engine-core/src/core/mod.rs, engine-core/src/core/engine.rs (removed), engine-core/src/core/control_plane.rs
Original Behavior (Bug)
$ cargo build --target wasm32-unknown-unknown --release
error: symbol `initialize` is already defined
--> engine-core\src\core\control_plane.rs:66:1
|
66 | #[contractimpl]
| ^^^^^^^^^^^^^^^
Expected Behavior
The crate exports exactly one contract ABI. cargo build --target wasm32-unknown-unknown --release — the exact command .github/workflows/ci.yml runs — succeeds.
Root Cause
EngineCore and CoreEngine were early, unfinished draft contracts (no reentrancy guard, no circuit-breaker integration, raw panic! instead of typed errors) superseded by ControlPlane, the fully integrated, tested entry point (audit/circuit-breaker/governance/version/zk_hooks all wired through it, covered by core/tests.rs). Neither EngineCore nor CoreEngine was referenced anywhere else in the repo — confirmed via a full-repo grep for both type names before removal.
Resolution
- Removed the
EngineCore struct/impl and its now-unused CoreState/IntegrityProof types from core/mod.rs.
- Deleted
core/engine.rs (CoreEngine, EngineRole, CoreError) entirely, along with its pub mod engine; declaration.
ControlPlane (core/control_plane.rs) remains the sole #[contract] entry point and is unchanged in its public ABI.
Verification
$ git cat-file -e origin/main:engine-core/src/core/engine.rs
fatal: path 'engine-core/src/core/engine.rs' does not exist in 'origin/main' # confirmed removed
$ git show origin/main:engine-core/src/core/mod.rs | grep -c EngineCore
0 # confirmed removed
$ cargo build --target wasm32-unknown-unknown --release
Finished `release` profile [optimized] target(s) in 18.01s
$ cargo test --workspace
test result: ok. 78 passed; 0 failed; 0 ignored
Definition of Done
Description
engine-coredefined three separate#[contract]structs —EngineCore(core/mod.rs),CoreEngine(core/engine.rs), andControlPlane(core/control_plane.rs) — each with its owninitializemethod. On the WASM target, contract methods are exported by name into a flat symbol namespace, so threeinitializeexports in one crate is a hard link error. This only reproduced on the exact build CI runs; a plain nativecargo build/cargo testnever touches WASM codegen and passed silently, which is why it shipped undetected.Affected Component
engine-core/src/core/mod.rs,engine-core/src/core/engine.rs(removed),engine-core/src/core/control_plane.rsOriginal Behavior (Bug)
Expected Behavior
The crate exports exactly one contract ABI.
cargo build --target wasm32-unknown-unknown --release— the exact command.github/workflows/ci.ymlruns — succeeds.Root Cause
EngineCoreandCoreEnginewere early, unfinished draft contracts (no reentrancy guard, no circuit-breaker integration, rawpanic!instead of typed errors) superseded byControlPlane, the fully integrated, tested entry point (audit/circuit-breaker/governance/version/zk_hooks all wired through it, covered bycore/tests.rs). NeitherEngineCorenorCoreEnginewas referenced anywhere else in the repo — confirmed via a full-repo grep for both type names before removal.Resolution
EngineCorestruct/impl and its now-unusedCoreState/IntegrityProoftypes fromcore/mod.rs.core/engine.rs(CoreEngine,EngineRole,CoreError) entirely, along with itspub mod engine;declaration.ControlPlane(core/control_plane.rs) remains the sole#[contract]entry point and is unchanged in its public ABI.Verification
cargo build --target wasm32-unknown-unknown --releaseexits 0.cargo test --workspacepasses (78/78).EngineCoreorCoreEnginein the repo.Definition of Done
main(PR Fix merge-corrupted engine-core, jest/eslint setup, repo cruft #157,7073d25).cargo clippywarnings introduced by this change (4 pre-existing warnings onmainpredate this fix — unrelated, minor: empty lines after doc comments, a slow zero-fill loop, amatches!suggestion)..github/workflows/ci.yml's very first step iscargo build --target wasm32-unknown-unknown --release, run on every push tomain/feat/**and every PR intomain— this fix is exercised by CI on every change going forward, no CI update needed for this specifically.