Skip to content

refactor(platform): migrate executable identity behind the facade - #2115

Merged
zackees merged 1 commit into
mainfrom
agent/executable-identity
Nov 20, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/executable-identity

Conversation

@zackees

@zackees zackees commented Nov 20, 2026

Copy link
Copy Markdown
Member

Phase 9/9 of #1315 — executable identity capability.

What changed

crates/fbuild-paths/src/executable_hash.rs selected its memo policy with a
#[cfg(unix)] / #[cfg(not(unix))] pair, and two more sites still called
std::env::current_exe directly. All three now ask the platform facade:

  1. New capability platform::fs::executable_memo_supported() — true for
    Linux and macOS (inode + change-time data moves exactly when the image is
    replaced), false for Windows (its metadata set cannot distinguish a
    replacement), asserted per concrete host.
  2. executable_hash keeps ONE implementation. The existing unix body is
    unchanged; it is entered only when the capability reports support, otherwise
    the image is hashed directly — byte-for-byte the policy the cfg pair encoded.
    MEMO_HEADER, file_identity and write_memo lose their gates with it.
  3. dev_daemon_namespace::hash_current_exe and the python facade's fake
    daemon spawn use platform::executable::current_image() (the existing
    facade function) instead of std::env::current_exe.

Ledger 24 -> 15 rows (executable_hash 7, dev_daemon_namespace 1,
python_facades 1), Dylint baseline 24 -> 15, research inventory
regenerated with --write, and the boundary unittest's explicit row count
updated to 15 so a re-baseline cannot pass silently.

Tests

  • soldr cargo test -p fbuild-paths --lib — 109 passed / 0 failed (1 ignored).
  • New a_written_memo_is_trusted_instead_of_rehashing: after the first call it
    spoofs the stored digest in the memo file; a second call must return the
    spoiled hash, so the reuse path is proven to run rather than being a
    values-only assertion (skipped where the capability says unsupported). The
    existing invalidation test additionally asserts a supported host writes the
    memo and an unsupported host writes none.
  • soldr cargo test -p fbuild-core --lib platform::fs — 10 passed / 0 failed.
  • soldr cargo clippy -p fbuild-paths -p fbuild-core --all-targets --no-deps -- -D warnings — exit 0.
  • soldr cargo check --workspace --all-targets --exclude fbuild-python — exit 0
    (fbuild-python cannot link on this host: no shared libpython3.14;
    cargo check -p fbuild-python --tests is clean instead).
  • soldr cargo fmt --check — clean.
  • ci/enforce_platform_boundary.py --print-totals — rows=15; dylint_rows=15, exit 0.
  • ci/platform_boundary_research.py --check — exit 0.
  • python -m unittest ci.test_enforce_platform_boundary ci.test_platform_boundary_research — 30 tests OK.

#1315 stays open (remaining cells: esp_qemu 6 + esp_qemu_runtime 3 and the
residue in the emulator/toolchain tests, plus the phase-8 group and the
closing three-host audit table).

Phase 9/9 of #1315: the executable hash memo and the two remaining
direct `std::env::current_exe` call sites now go through
`fbuild_core::platform`, so callers carry no host conditionals.

- `platform::fs::executable_memo_supported()` states whether this host
  can key a short-lived executable hash memo (unix hosts: yes, from
  inode/ctime data; Windows: no, its metadata set cannot detect a
  replacement), asserted per concrete host.
- `fbuild_paths::executable_hash` keeps ONE implementation: the memo
  path runs when the capability says the host supports it, otherwise
  the image is hashed directly — the same policy the old
  `#[cfg(unix)]`/`#[cfg(not(unix))]` pair encoded.
- `dev_daemon_namespace::hash_current_exe` and the python facade test
  use `platform::executable::current_image()` instead of
  `std::env::current_exe`.

Ledger 24 -> 15 rows, Dylint baseline 24 -> 15, research inventory
regenerated, and the boundary unittest's explicit row count updated.

Tests: new `a_written_memo_is_trusted_instead_of_rehashing` spoofs the
stored digest so a rehash would fail it, proving the reuse path runs.
@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

@zackees
zackees added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 6f73858 Nov 20, 2026
32 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 21, 2026
@zackees
zackees deleted the agent/executable-identity 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