Skip to content

Fix T072: the completeness check a session never reached - #14

Merged
jlgore merged 3 commits into
mainfrom
fix/t072-session-config-completeness
Jul 28, 2026
Merged

Fix T072: the completeness check a session never reached#14
jlgore merged 3 commits into
mainfrom
fix/t072-session-config-completeness

Conversation

@jlgore

@jlgore jlgore commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

The last known failing test on main, plus a flake it uncovered. Test-only — no production code changes.

T072 — no_provider_at_all_reports_what_is_missing

The test asserted that a session with no provider anywhere reports an incomplete configuration naming --provider. It never got there: enforcement is resolved before configuration completeness, so a default build refused the unenforced session first, and an enforce build reported the missing policy instead. The assertion could not hold on either build.

--host settles enforcement identically on both, which is what lets the completeness failure be about the provider. No skip_on_enforcement_build() guard — for the same reason its neighbours have one: this case exits at configuration and never starts a session, so no kernel is involved. Verified failing-then-passing on a default build and an enforce build, where it now runs rather than skips.

Fixing that exposed a second cause. The child inherited the developer's own ~/.config/bee/config.toml — a provider there silently completes the very session this test means to leave incomplete, and a policy there contradicts --host outright. run_with_stdin now runs the child in an empty directory with HOME and XDG_CONFIG_HOME pointed at it, so what the session resolves from flags is the whole subject, as the file's own header claims.

The flake underneath

Running the full suite afterwards failed a test that had nothing to do with any of this. Three tests toggle the process-global NO_COLORviz::grid, tui::theme_bridge, tui::markdown — and each already checks both colour states in one body, with a comment explaining that this is to avoid racing a parallel test. They race each other: same binary, different modules, concurrent by default. a_recognized_fence_is_highlighted_and_no_color_strips_it failed one run and passed the next on identical code.

A shared lock in viz::palette serialises the three. Poisoning is ignored deliberately: a panicking test has already reported its failure, and refusing the lock afterwards would turn one failure into every failure. Eight consecutive lib runs green.

Verification

cargo fmt --all -- --check and cargo clippy --workspace --all-targets --features sec,astgrep-rust,astgrep-python -- -D warnings clean. Full suite green at --features sec,astgrep-rust,astgrep-python with no failures — the first time that has been true on this repo since before 016.

🤖 Generated with Claude Code

jlgore and others added 3 commits July 28, 2026 11:19
`no_provider_at_all_reports_what_is_missing` asserted that a session with
no provider anywhere reports an *incomplete configuration* naming
`--provider`. It never got there. Enforcement is resolved before
configuration completeness, so a build without `--features enforce`
refused the unenforced session first, and a build with it reported the
missing *policy* instead — the assertion could not hold on either.

`--host` settles enforcement on both builds, which is what lets the
completeness failure be about the provider. No `skip_on_enforcement_build`
guard, for the same reason its neighbours have one: this case exits at
configuration and never starts a session, so no kernel is involved.

That exposed the second half. The child inherited the developer's own
`~/.config/bee/config.toml`, where a provider silently completes the very
session this test means to leave incomplete — and a policy there
contradicts `--host` outright. `run_with_stdin` now runs the child in an
empty directory with HOME and XDG_CONFIG_HOME pointed at it, so what the
session resolves from flags is the whole subject, as the file claims.

Verified failing-then-passing on both a default and an `enforce` build;
on the latter it runs rather than skipping.

Closes T072.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three tests toggle the process-global NO_COLOR — `viz::grid`,
`tui::theme_bridge`, `tui::markdown`. Each already checks both colour
states in a single body, and each carries a comment explaining that this
is to avoid racing a parallel test. They race each other: same test
binary, different modules, concurrent by default. One clearing the
variable while another has it set is enough to fail an assertion, which
is how `a_recognized_fence_is_highlighted_and_no_color_strips_it` failed
one run and passed the next on identical code.

A shared lock in `viz::palette` serialises the three. Poisoning is
ignored deliberately: a panicking test has already reported its failure,
and refusing the lock afterwards would turn one failure into every
failure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jlgore
jlgore merged commit aaa3fc6 into main Jul 28, 2026
4 checks passed
@jlgore
jlgore deleted the fix/t072-session-config-completeness branch July 28, 2026 16:26
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.

1 participant