Skip to content

test(platform): zero the platform-boundary ledger through the facade - #2119

Merged
zackees merged 2 commits into
mainfrom
agent/zero-baseline
Nov 20, 2026
Merged

zackees merged 2 commits into
mainfrom
agent/zero-baseline

Conversation

@zackees

@zackees zackees commented Nov 20, 2026

Copy link
Copy Markdown
Member

Part of #1315 (phase 9/9); #1315 stays open for the closing three-host audit.

Why

The platform-boundary ledger reached 40 rows when this pass started and stood at 6 after the QEMU runtime-library migration. Those last six were all test-only OS branches — the one place where #[cfg(...)] could still be used to avoid asking the facade. This PR removes them, so ci/platform_boundary_ledger.tsv, dylints/enforce_platform_boundary/src/baseline.txt and the research inventory all read zero.

What changed

site before after
fbuild-core/tests/it/platformio_package_resolution.rs 2 × #[cfg(windows)] the file-URL mapping is host-adaptive, so the expected path is named at run time — the case now asserts on both hosts instead of compiling for one
fbuild-daemon/.../emulator/tests_npm_cache.rs #[cfg(windows)] around the PATHEXT clear clearing PATHEXT only means something where PATHEXT exists
fbuild-daemon/.../emulator/tests_process.rs #[cfg(windows)] + #[cfg(not(windows))] bodies one body branching on the runtime host fact; the shell's spelling now comes from platform::executable::native_name instead of a literal cmd.exe inside a host branch
fbuild-packages/tests/it/qemu_linux_runtime.rs file-level #![cfg(target_os = "linux")] bundle provisioning is a Linux host policy: the file compiles everywhere and skips at run time

Emptying the ledger exposed five validation tests that borrowed row 0 from the committed data (IndexError on an empty ledger, plus two vacuous assertions). They now build a synthetic row over a real non-exempt source file, so they exercise the validation logic rather than whatever happens to be baselined.

Receipts (real output)

  • enforce_platform_boundary.py --print-totals → rows=0; dylint_rows=0, exit 0
  • platform_boundary_research.py --check → exit 0 (inventory regenerated: --write, 6 rows removed, no line churn elsewhere)
  • python -m unittest ci.test_enforce_platform_boundary ci.test_platform_boundary_research → Ran 30 tests … OK
  • soldr cargo test -p fbuild-core --test it platformio_package_resolution → 22 passed; 0 failed
  • soldr cargo test -p fbuild-daemon --lib emulator:: → 47 passed; 0 failed; 3 ignored
  • soldr cargo test -p fbuild-packages --test it --no-run → compiles with the file-level gate gone
  • soldr cargo clippy -p fbuild-core -p fbuild-daemon --all-targets --no-deps -- -D warnings → 0 warnings, exit 0
  • soldr cargo fmt --all -- --check → exit 0
  • wc -l platformio_package_resolution.rs → 997 (under the 1000 cap; the if/else was restructured so rustfmt does not split it into zero headroom)

Red proofs

  • A single re-injected #[cfg(windows)] in platformio_package_resolution.rs makes the gate fail with new occurrence: … #[cfg(windows)] 0 host host_mechanic + Dylint baseline and independent scanner disagree, exit 1 — an empty baseline is still a guard, not a no-op.
  • windows_file_url_maps_to_drive_path passes on Linux with the /C:/platforms/custom arm, i.e. the host-adaptive expectation is measured, not assumed. The .exe spelling fix was forced by the repo's own test_executable_spelling_does_not_bypass_the_executable_facade guard, which caught my first draft.

Honest limits

  • The Windows/macOS halves of the two runtime branches are proven by compilation (both QEMU modules carry zero cfg(target_os); every symbol the test calls is host-neutral) and by the full / windows / Check lane, not by a local run.
  • esp_qemu_starts_without_any_host_library_install stays #[ignore]d (it downloads ~20 MB); the compile is the check here, the guard is a one-line is_linux() skip.
  • Full python -m unittest discover -s ci reports 6 unrelated environmental failures on this box (No module named 'zstandard', No module named 'ci_lint', an external slicer subprocess, and two type-checker fixtures) — none touch this diff.

The last six baselined occurrences were all test-only OS branches, so the
ledger, the Dylint baseline and the research inventory now read zero.

Each site asks the facade instead of compiling for one host:

- platformio_package_resolution: the file-URL mapping is host-adaptive
  (`Url::to_file_path` keeps the drive letter on Windows and folds it into
  a leading `/C:` segment elsewhere), so the expectation is named at run
  time and the case now covers both hosts instead of compiling for one.
- emulator/tests_npm_cache: clearing PATHEXT only means something where
  PATHEXT exists.
- emulator/tests_process: the script-runner shape is a runtime host fact,
  and the shell's spelling now comes from `platform::executable::native_name`
  rather than a literal `cmd.exe` inside a host branch.
- qemu_linux_runtime: bundle provisioning is a Linux host *policy*, so the
  file compiles everywhere and skips at run time.

Emptying the ledger exposed five validation tests that borrowed row 0 from
the committed data; they now build a synthetic row, so they test the
validation logic rather than whatever happens to be baselined.
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The cross-target pass derives its package list from baseline.txt and then
asserted that list was non-empty. Zeroing the ledger is phase 9's terminal
state, so that assert now aborts the whole step under `bash -e` and the job
fails with no diagnostic at all (`test 0 -gt 0`, exit 1, no output).

An empty ledger means no crate carries target-specific source, so there is
nothing a cross-target pass could police: skip those passes and keep the
whole-workspace Linux pass. Separate the row count from the derived list so
a parse regression still fails - a non-empty ledger must yield packages and
every data row must name a crate package.
@zackees
zackees added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit d3f6c86 Nov 20, 2026
31 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 21, 2026
@zackees
zackees deleted the agent/zero-baseline branch November 24, 2026 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant