Skip to content

fix(oracle): point the extracted test module at the crate root (GH-214) - #218

Closed
noahgift wants to merge 3 commits into
mainfrom
fix/oracle-test-imports
Closed

fix(oracle): point the extracted test module at the crate root (GH-214)#218
noahgift wants to merge 3 commits into
mainfrom
fix/oracle-test-imports

Conversation

@noahgift

Copy link
Copy Markdown
Contributor

Closes #214.

bashrs-oracle's test module has not compiled since PMAT-229 (b2debf1710).

lib_cont.rs pulls the file in with #[path = "lib_tests_oracle_creat.rs"] mod tests_extracted;, so inside it super is lib_cont — not the crate root, where the types actually live. That refactor renamed the file into the submodule and use super::* quietly stopped reaching any of them.

Six types, not the two the issue recorded: Oracle, ErrorCategory, Corpus, OracleConfig, ErrorFeatures, DriftStatus.

Why it survived months of green

Nothing in the pipeline built this workspace member:

  • CI's reusable sovereign-ci workflow defaults to --lib, which scopes to the root package (bashrs-specs)
  • the infra clean-room gate ran cargo test --lib at the workspace root — same blind spot (paiml/infra#170)

It surfaced only when that gate was fixed to test the crate it gates, at which point B2 failed on the first honest run.

Verification

RED on origin/main cargo test -p bashrs-oracle --lib --no-run19 × E0433
GREEN with this fix 48 passed, 0 failed

That includes the 6 tests_extracted::tests::* tests which had not been compiled, let alone run, since February.

Follow-up in this PR

A second commit adds test_workspace: true to ci.yml so a workspace member cannot rot invisibly again — pending a local cargo test --workspace --lib --no-run proving every member builds in that scope. I won't flip it on an assumption; turning your CI red would be a worse outcome than the bug.

🤖 Generated with Claude Code

noahgift and others added 3 commits August 11, 2026 19:45
…214)

bashrs-oracle's test module has not compiled since PMAT-229 (b2debf1).

lib_cont.rs pulls the file in with `#[path = "lib_tests_oracle_creat.rs"] mod
tests_extracted;`, so inside it `super` is lib_cont — NOT the crate root, where
Oracle, ErrorCategory, Corpus, OracleConfig, ErrorFeatures and DriftStatus
actually live. That refactor renamed the file into the submodule and `use
super::*` quietly stopped reaching any of them. Six types, not the two the
issue recorded.

Nothing in the pipeline built this workspace member, so it stayed broken for
months while every gate read green:
  - CI's reusable sovereign-ci workflow defaults to `--lib` (root package only)
  - the infra clean-room gate ran `cargo test --lib` at the WORKSPACE ROOT,
    which scopes to `bashrs-specs` (5 stub tests) — paiml/infra#170

It surfaced only when that gate was fixed to test the crate it gates, at which
point B2 failed on the first honest run.

RED on origin/main:  E0433 x19, `cargo test -p bashrs-oracle --lib --no-run`
GREEN with this fix: 48 passed, 0 failed — including the 6 tests_extracted::*
tests that had not been compiled, let alone run, since February.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…214)

The reusable sovereign-ci workflow defaults to `--lib`, which scopes to the ROOT
package. This workspace's root is `bashrs-specs`; the published crate is rash/,
and bashrs-oracle, bashrs-runtime and bashrs-wasm are never built by CI at all.
That is why bashrs-oracle's test module could stop compiling in February and
every check stayed green until an unrelated gate fix exposed it.

`test_workspace: true` opts into `--workspace --lib` (PMAT-159).

Verified locally BEFORE enabling, because flipping this on an assumption would
red the entire pipeline rather than fix anything:

  cargo test --workspace --lib --no-run
  -> 0 errors; 5 unittest binaries built (bashrs, bashrs_oracle,
     bashrs_runtime, bashrs_specs, bashrs_wasm)

That check was run WITH the import fix in the previous commit; without it,
bashrs-oracle does not compile — which is exactly the failure this flag is meant
to surface from now on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ed (Refs #214)

Enabling test_workspace surfaced 23 failures in
rash/src/testing/shellcheck_validation_tests.rs. They shell out to shellcheck
and `.expect()` the result, so they PANIC wherever it is absent — and the CI
container does not have it. They had never run before, because `--lib` scoped to
the root stub package. That is the flag doing its job.

Installed rather than skipped. That module states its own critical invariant —
"every generated script must pass `shellcheck -s sh`" — so making it skip when
the tool is missing would trade a red for a SILENT GREEN, which is the failure
mode this repo keeps paying for. infra's clean-room gate already installs
shellcheck for bashrs for exactly this reason; CI should not be weaker than the
release gate.

Uses the reusable workflow's existing extra_pkgs input (same mechanism as the
clean-room's EXTRA_PKGS).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@noahgift

Copy link
Copy Markdown
Contributor Author

Superseded by the rebuilt branch — same two files, cleanly on main after #219/#221/#222.

@noahgift noahgift closed this Aug 11, 2026
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.

bashrs-oracle test module has not compiled since PMAT-229 (b2debf1710) — no CI or gate builds it

1 participant