Skip to content

[BUG] core/access.rs, state.rs, guards.rs, zk_hooks.rs never wired into the module tree #162

Description

@N-thnI

Status: ✅ Resolved on main — fixed by PR #157, commit 7073d25. Verified against a freshly-fetched origin/main before editing this issue.

Description

engine-core/src/core/access.rs, state.rs, guards.rs, and zk_hooks.rs existed on disk with full implementations and their own #[cfg(test)] unit tests, but core/mod.rs never declared them as modules. Rust silently excludes undeclared files from the crate — these modules were never compiled, never tested, and never linted as part of any cargo invocation.

Affected Component

engine-core/src/core/mod.rs

Original Behavior (Bug)

core/mod.rs declared only:

pub mod control_plane;
pub mod engine;
pub mod proxy;

access.rs, state.rs, guards.rs, zk_hooks.rs sat in the same directory but were absent from this list. cargo build/cargo test never touched them, and core/control_plane.rs's references to crate::core::zk_hooks::* failed to resolve (E0433: could not find zk_hooks in core).

Expected Behavior

Every .rs file intended to be part of the crate is declared as a module and participates in cargo build, cargo test, and cargo clippy.

Root Cause

The four files were added in commit 364f6f5 ("Core Development – Hardened Foundation", #149) but the corresponding pub mod declarations were never added to core/mod.rs — lost in the same merge history that left several other engine-core files with duplicated/conflicting content (see PR #157's description for the full scope of that corruption).

Resolution

core/mod.rs now declares all six modules:

pub mod access;
pub mod control_plane;
pub mod guards;
pub mod proxy;
pub mod state;
pub mod zk_hooks;

zk_hooks.rs has no #[test] functions of its own — it's exercised through control_plane.rs's register_proof/get_proof, which are covered by core/tests.rs. access.rs, state.rs, and guards.rs each ship their own dedicated unit tests, which now run as part of the crate for the first time.

Verification

$ git show origin/main:engine-core/src/core/mod.rs
pub mod access;
pub mod control_plane;
pub mod guards;
pub mod proxy;
pub mod state;
pub mod zk_hooks;

$ cargo build -p engine-core
    Finished — control_plane.rs's zk_hooks references resolve cleanly

$ cargo test -p engine-core core::access
running 6 tests ... test result: ok. 6 passed; 0 failed

$ cargo test -p engine-core core::state
running 5 tests ... test result: ok. 5 passed; 0 failed

$ cargo test -p engine-core core::guards
running 4 tests ... test result: ok. 4 passed; 0 failed

$ cargo test --workspace
test result: ok. 78 passed; 0 failed; 0 ignored
  • AC-1: cargo build -p engine-core succeeds; control_plane.rs's zk_hooks::register_proof/get_proof calls resolve.
  • AC-2: cargo test -p engine-core runs and passes the previously-dead tests: core::access (6), core::state (5), core::guards (4).
  • AC-3: cargo test --workspace reports 78 passed, 0 failed — the newly-included tests are part of that total.

Definition of Done

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26bugSomething isn't workingengine-coreRust/Soroban engine-core crate

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions