BOHICA-LABS / BOHICA-LABS/vsdd-factory

Phase-3 Wave-integration: missing 'release-profile tests compile' gate lets test-hook cfg mis-gating reach main

Open
#533 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2
Forks
1
Avg merge
6h 43m
Merged PRs (30d)
29

Description

## Symptom

A test-hook static (`PANIC_MID_RELOAD_INJECT`) was landed on main gated as:

```rust
#[cfg(any(test, debug_assertions))]
pub static PANIC_MID_RELOAD_INJECT: AtomicBool = AtomicBool::new(false);
```

Under `cargo build --release --tests` the release profile has `debug_assertions=off` and `cfg(test)=false`, so the symbol vanishes but the integration test (`tests/story_015_hot_reload.rs`) still references it — release-profile test compilation fails.

The defect passed every wave-integration gate the factory currently runs (dev-profile `cargo test --workspace` passes because `debug_assertions=on`; `cargo build --release` passes because the symbol isn't referenced from the crate binary). It only surfaced on the next wave's Red Gate when the wave-6 stub-architect tried to compile the test target in release profile.

## Concrete instance

- Product repo: `ArcavenAE/akey` (private)
- Offending main-branch commit: `8757303` (STORY-015)
- Fix PR: [ArcavenAE/akey#68](https://github.com/ArcavenAE/akey/pull/68) — cfg extended to include `feature = \"test-helpers\"` matching sibling pattern in the same file
- Fix also adds a CI regression gate:

```yaml
- name: Release-profile test compilation
# Catches regressions where a test-only symbol is gated in a way that
# release builds strip it (e.g. #[cfg(any(test, debug_assertions))] without
# feature = \"test-helpers\").
run: cargo build --workspace --release --tests
```

## Engine gap

`workflows/phases/phase-3-tdd-implementation.lobster` wave-integration step and `orchestrator-per-story-delivery` gate steps do not enforce **release-profile test compilation** as a required check. The reasonable defaults exercised are:

1. `cargo test --workspace` — dev profile only
2. `cargo build --workspace --release` — release binary only, no test targets
3. `cargo clippy --workspace --all-targets --release` — compiles test targets but under a different cfg context (RUSTFLAGS + clippy driver interact with feature resolution); did not catch this in our run

None of the three catches a test-only symbol that is stripped under release-profile cfg while still being referenced from a test target.

## Proposed fix

Add a mandatory step to wave-integration (and ideally to per-story Green-Gate) equivalent to:

```
cargo build --workspace --release --tests
```

Compile-only. Running tests in release is not the intent — the goal is to catch cfg-mismatch regressions where dev-profile builds compile but release-profile test builds don't. Fast enough to run per-story (few seconds beyond what clippy already runs), high signal, near-zero false positives.

The same gate belongs in the engine's own CI so factory-generated projects inherit it. `templates/ci/ci.yml.tmpl` (or wherever the template lives) should include the step by default.

## Related

- Product-side fix + regression gate landed at ArcavenAE/akey#68 — reproducible reference implementation of the CI step
- Adjacent engine defect: #525 (Phase-4 rebuild-fresh preflight for evaluator dispatch — different symptom, same class of \"artifact drift between what CI verified and what the next phase consumes\")

## Severity

P2. Silent test-hook regression on main. Symptom is limited to test-only symbols, but any downstream consumer (next wave's Red Gate, holdout evaluator that runs `--release --tests`, external contributor rebuilding tests in release) hits it as a hard compile error with a confusing diagnostic.

## Reproducing / verifying the fix

```
git clone git@github.com:ArcavenAE/akey.git
cd akey
git checkout 8757303 # main pre-fix
cargo build --workspace --release --tests
# expected: fails on unresolved import PANIC_MID_RELOAD_INJECT

git checkout
cargo build --workspace --release --tests
# expected: passes
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.