Skip to content

fix: restore green CI — drop heapless from the graph, gate byte-tools oracle off unix - #2955

Merged
chaliy merged 3 commits into
mainfrom
eve/clever-mccarthy-tkz93i
Nov 19, 2026
Merged

chaliy merged 3 commits into
mainfrom
eve/clever-mccarthy-tkz93i

Conversation

@chaliy

@chaliy chaliy commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Two independent CI-green fixes. They are bundled because the second blocks the
first from merging, and this session is authorized to push only one branch — see
Note on scope below.

1. fix(deps): drop heapless from the dependency graph. Our two postcard
dependencies now set default-features = false. This removes heapless and its
chain (atomic-polyfill, critical-section, hash32, spin, lock_api,
rustc_version) from both the workspace and fuzz lockfiles, clearing nine
unsoundness advisories. Now-obsolete suppression RUSTSEC-2023-0089 is retired
from deny.toml and the threat model.

2. fix(test): gate the non-UTF-8 byte-tools oracle off unix.
byte_stream_tests::byte_tools_match_real_bash_on_non_utf8_input gains
#[cfg_attr(not(unix), ignore = ...)], turning the Windows nightly green.

No library or product behavior changes. No source file outside tests is touched.

Why

The heapless advisories (Audit job)

Nine heapless 0.7.17 unsoundness advisories were published 2026-11-18:
RUSTSEC-2026-0574, 0575, 0576, 0577, 0578, 0579, 0580, 0581, 0582. Cargo scans run
--deny unsound over every discovered lockfile, so scripts/audit-lockfiles.sh
fails on both ./Cargo.lock and ./crates/bashkit/fuzz/Cargo.lock with
error: 9 denied warnings found!.

The advisory database is fetched at job time, so this went red with nothing in the
tree changed
. main is not red in GitHub's history only because its last run
(04:09 UTC) predates the database carrying them; the next push or nightly on main
would have failed. This is precisely the drift the scheduled scan exists to catch.

postcard 1.1.3 is its newest release and requires heapless ^0.7, so there is no
upgrade to the patched 0.9.4 — an ignore entry looked unavoidable. It is not.
heapless is an optional postcard dependency, and postcard's feature table reads:

default      = ['heapless-cas']
heapless-cas = ['heapless', 'dep:heapless', 'heapless/cas']

postcard's default feature exists solely to enable heapless. Both of our manifests
asked for features = ["alloc"] while leaving default features on, so we pulled in
heapless entirely by accident. The only postcard APIs used in this repo are
to_allocvec, from_bytes and to_slice, all of which need alloc alone.

So this is a root-cause fix rather than a suppression: the unsound code leaves the
build instead of being accepted.

The retired suppression

RUSTSEC-2023-0089 (atomic-polyfill) was suppressed with removal condition
"Upstream drops the dependency", since it arrived via postcard → heapless 0.7.
atomic-polyfill is now absent from every discovered lockfile. The threat model
requires verifying "the advisory's own patched release, dependency removal, or
explicit upstream withdrawal rather than the scanner's silence" — this is dependency
removal, confirmed by grep across all six cargo lockfiles, so the entry is deleted
rather than left to rot.

The Windows nightly oracle

byte_tools_match_real_bash_on_non_utf8_input landed in #2945 without the platform
gate that every other host-bash oracle in the file carries, and the Windows nightly
went red on its first run afterwards
(run 44462677580).

On windows-latest, bash is the WSL launcher, which prints a UTF-16 "no
distribution installed" notice instead of running the script. The failure was in the
test's own precondition — assert!(expected.status.success()) at
byte_stream_tests.rs:263 — before any Bashkit output was compared. Nothing about
tee/split/cut was mismatching.

This is the gate the knowledge contract already mandates in
knowledge/operations/testing.md: "A new oracle test needs the same attribute, or
the nightly goes red."
windows-nightly.yml's own header states the same intent, so
no knowledge update is needed for this half.

I audited the rest of the nightly's scope for the same gap. Seven candidates surfaced
and all were already covered: harness_example_tests via module-level #[cfg(unix)],
dev_fd_path_tests::stream_aliases_and_append_match_bash via a runtime
if !cfg!(unix) { return; }, one regex false positive, and diagnostic_prefix_tests
passes on Windows as-is. Hence the one-line change.

Before / After

Audit — ./scripts/audit-lockfiles.sh, the exact failing step
(run 44496424248):

Before:  Scanning ./Cargo.lock for vulnerabilities (776 crate dependencies)
         error: 9 denied warnings found!      # heapless 0.7.17, x2 lockfiles
         Process completed with exit code 1

After:   Scanning ./Cargo.lock for vulnerabilities (771 crate dependencies)
         warning: 3 allowed warnings found    # chrono, chrono-tz, ttf-parser
         AUDIT SCRIPT EXIT=0                  # zero denied lines, all 6 lockfiles

Supporting dependency checks, both of which CI runs:

cargo deny check licenses sources  ->  licenses ok, sources ok
cargo vet --locked                 ->  Vetting Succeeded (575 exempted, was 580)

Windows nightly — verified on a real runner via workflow_dispatch on this
branch (run 44496429379, success):

Before:  test byte_stream_tests::byte_tools_match_real_bash_on_non_utf8_input ... FAILED
         test result: FAILED. 1856 passed; 1 failed; 57 ignored

After:   test byte_stream_tests::byte_tools_match_real_bash_on_non_utf8_input ... ignored,
             compares against host Unix bash/tools
         test result: ok. 1856 passed; 0 failed; 58 ignored

Linux is unaffected; the oracle still executes and passes:

$ cargo test -p bashkit --test integration byte_stream_tests
test byte_stream_tests::byte_tools_match_real_bash_on_non_utf8_input ... ok
test result: ok. 17 passed; 0 failed; 0 ignored

Risk

  • Low

Specifics worth a reviewer's attention:

  • Dropping postcard's default features cannot change our wire format. heapless-cas
    only adds impls for heapless container types, which this repo never serializes; the
    encoding of our own types is unchanged. Snapshot round-trips in
    zapcode_vendor/snapshot.rs and the bashkit-monty postcard tests cover this.
  • The Windows nightly no longer runs this host-oracle comparison, which it could
    never run correctly. Windows keeps byte-exactness coverage through the non-oracle
    tests in the same file (xxd_reverse_rebuilds_exact_bytes,
    sort_refuses_to_rewrite_non_utf8_file_in_place,
    binary_base64_head_cat_pipeline_preserves_exact_bytes, and others), which assert
    against fixed expected bytes rather than a host tool.
  • Retiring a security suppression is the one genuinely judgement-dependent change
    here. It is safe only because the crate is gone from the graph, not because the
    scanner went quiet. If postcard ever re-enables heapless by default, the advisories
    reappear as hard failures rather than being silently accepted — which is the intended
    direction.

Note on scope

These are two unrelated concerns and AGENTS.md prefers separate PRs. They are
together here because the Audit failure blocks any PR from merging, including the
nightly fix, and this session is authorized to push only eve/clever-mccarthy-tkz93i.
Splitting them would have required pushing a second branch without permission. Each
concern is a separate commit, so they remain independently reviewable and revertable.

The crates/bashkit/fuzz/Cargo.lock diff also carries pre-existing drift: it picks
up nix 0.32.0 and adds encoding_rs, simdutf8, core_detect and
multiversion_no_op. I confirmed that drift reproduces on an unmodified tree, so it is
not from this change — any re-resolve produces it, and cargo fuzz build does not pass
--locked, so CI already resolved these. Only the heapless-chain removal in that file
is attributable here.

One unrelated pre-existing issue, reported but not fixed: cargo deny check advisories
fails on unmodified main over chrono/chrono-tz being unmaintained. CI never runs
that subcommand (its cargo-deny step is check licenses sources), and a current
cargo-deny is stricter than the pinned action, so the threat model's "keep the cargo
list and deny.toml in sync so a local cargo deny check advisories matches CI" does
not currently hold. Out of scope for a CI-green fix; flagging it for a decision.

Checklist

  • Tests added or updated
  • Backward compatibility considered

Generated by Claude Code

The `byte_tools_match_real_bash_on_non_utf8_input` oracle landed in #2945
without the platform gate every other host-bash oracle in the file carries,
so the Windows nightly went red on its first run. On windows-latest `bash`
is the WSL launcher, which prints a UTF-16 "no distribution installed"
notice instead of running the script, so the test's own
`assert!(expected.status.success())` precondition fails before any Bashkit
behavior is compared.

Gate it with the documented attribute, as required by
knowledge/operations/testing.md ("A new oracle test needs the same
attribute, or the nightly goes red"). Windows keeps byte-exactness coverage
through the non-oracle tests in the same file.

Claude-Session: https://claude.ai/code/session_01Wy7MBvn3d6d1NUGLBgnLEU
@bashkit-pr-reviewer

Copy link
Copy Markdown

Review summary — #2955 gate non-UTF-8 byte-tools oracle off unix

Verdict: Looks good — no findings. The one-line #[cfg_attr(not(unix), ignore = "compares against host Unix bash/tools")] on byte_tools_match_real_bash_on_non_utf8_input is exactly what this test needs, and it matches the three sibling oracle gates in the same file. No review comments posted.

Why the gate is correct:

  • The test shells out to host bash (Command::new("bash"), crates/bashkit/tests/integration/byte_stream_tests.rs:263), so off-Unix it would hit the WSL launcher / missing GNU tools rather than a real oracle — the exact case knowledge/operations/testing.md (Windows CI §, ~L325–329) says must be ignored off unix with this attribute.
  • Ignore message is byte-identical to the existing gates (lines 121, 193, 223), so nightly skip reporting stays uniform. No iconv -l availability guard is needed here (unlike the two iconv oracles) since this test only exercises tee/split/cut byte passthrough.
  • No behavior, VFS, or sandbox surface changes — test-only diff, one added line, no truncation (truncated: false).

Context read beyond the diff: checked out the PR head at 73d2e5c1 (/workspace/bashkit), read byte_stream_tests.rs:110–280 (all four oracle gates + the new test body), knowledge/operations/testing.md Windows CI section, and AGENTS.md coding-agent guidance. Did not build or run tests per project review rules; reasoned from code.

Could not review: nothing — full diff visible, checkout succeeded. (The PR description's note about an xtask benchmark conflict refers to an older base and is not in the current diff.)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit ca57fc5 Commit Preview URL

Branch Preview URL
Nov 19 2026, 09:53 AM

Nine `heapless` 0.7.17 unsoundness advisories were published on 2026-11-18
(RUSTSEC-2026-0574 through 0582). Cargo scans run `--deny unsound` over every
discovered lockfile, so `scripts/audit-lockfiles.sh` now fails on both the
workspace lock and `crates/bashkit/fuzz/Cargo.lock`. The advisory database is
fetched at job time, so this went red with nothing in the tree changed.

`postcard` 1.1.3 is its newest release and requires `heapless ^0.7`, so there
is no upgrade to a patched 0.9.4. But `heapless` is an optional postcard
dependency and postcard's `default = ["heapless-cas"]` exists only to enable
it. Both of our manifests asked for `features = ["alloc"]` while leaving
default features on, so we pulled in heapless by accident: the only postcard
APIs used here are `to_allocvec`, `from_bytes` and `to_slice`, all of which
need `alloc` alone.

Declaring postcard with `default-features = false` drops heapless and its
chain (`atomic-polyfill`, `critical-section`, `hash32`, `spin`, `lock_api`,
`rustc_version`) from both lockfiles.

That also satisfies the recorded removal condition for RUSTSEC-2023-0089
(`atomic-polyfill`), which is now absent from every discovered lockfile, so the
suppression is retired from `deny.toml` and the threat model rather than left
to rot.

The fuzz lockfile additionally carried pre-existing drift: re-resolving it
picks up `nix` 0.32.0 and adds `encoding_rs`, `simdutf8`, `core_detect` and
`multiversion_no_op`. That drift reproduces on an unmodified tree and
`cargo fuzz build` does not pass `--locked`, so CI already resolved these.

Verified: `scripts/audit-lockfiles.sh` exits 0 with no denied warnings across
all six cargo lockfiles, `cargo deny check licenses sources` reports
"licenses ok, sources ok", and `cargo vet --locked` succeeds.

Claude-Session: https://claude.ai/code/session_01Wy7MBvn3d6d1NUGLBgnLEU
@chaliy chaliy changed the title fix(test): gate non-UTF-8 byte-tools oracle off unix fix: restore green CI — drop heapless from the graph, gate byte-tools oracle off unix Nov 19, 2026
…tract

`scripts/check_monty_fork.py` holds the fork manifests at upstream Monty 1.5.0
outside `bashkit fork:` markers, so turning postcard's default features off in
`bashkit-monty` read as unrecorded drift and failed the `Lint` job.

Mark the entry with the reason and a removal condition, the way the existing
`getrandom` and `jiter` markers do.

`knowledge/operations/dependencies.md` described a marker as covering a
dependency's *version*. The check compares the whole dependency spec, so a
feature or `default-features` divergence is markable too; postcard is the first
of that kind, every marker before it being a version bump. Say so, and record
why postcard diverges for a security reason rather than a shared-crate bump.

Claude-Session: https://claude.ai/code/session_01Wy7MBvn3d6d1NUGLBgnLEU
@chaliy
chaliy merged commit 72127b6 into main Nov 19, 2026
64 checks passed
@chaliy
chaliy deleted the eve/clever-mccarthy-tkz93i branch November 19, 2026 10:28
@chaliy chaliy mentioned this pull request Nov 19, 2026
2 tasks done
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