Skip to content

feat(prebuilt): canonical prebuilt-core fingerprint over component stamps (#1882) - #2169

Merged
zackees merged 1 commit into
mainfrom
agent/1882-core-plan
Nov 24, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/1882-core-plan

Conversation

@zackees

@zackees zackees commented Nov 24, 2026

Copy link
Copy Markdown
Member

Unit 4 of decision 8a/8 (#1882): the canonical prebuilt-core build fingerprint — the key a published core object is addressed by.

Why

With #2162 / #2164 / #2166 / #2167 / #2168 on main, every framework component carries an identity taken in staging, and the framework term is already a field of the esp32 fast-path metadata. What does not exist yet is the object that turns those identities plus the rest of one exact compiler invocation into a servable key. Decision 8 lists the inputs explicitly: schema + ABI version, toolchain identity, core/SDK/skeleton component IDs, recipe, MCU, variant dir, the ordered canonical argv per TU, and config/header digests. This PR is the function that hashes exactly that set, and nothing else.

What

crates/fbuild-library/src/library/esp32_framework/prebuilt_core.rs (public module):

item behaviour
CoreBuildInputs compiler ABI id, toolchain name/version, mcu, sdk_variant, units: &[CompileUnit], config: &[ConfigDigest]
CompileUnit / ConfigDigest a unit id + its argv in invocation order; a header id + its sha256
Esp32Framework::prebuilt_core_plan(&inputs) -> Option<PrebuiltCorePlan> None unless the framework has an identity and every input is present
PrebuiltCorePlan fingerprint() (64-hex sha256) plus mcu(), sdk_variant(), core_version()
canonical_argv_digest / canonical_config_digest sorted by unit/header id, argv order preserved; None for an empty or unnamed list

Properties, each carried by a test:

  • Install-history independence — the framework term comes from staging stamps (decision 8a option (b)); installing another chip into the same core tree leaves this chip's fingerprint identical. This is the property the closed pilot's option (c) failed.
  • Install-path independence — two trees with identical content under different tempdirs produce one fingerprint. The module cannot sanitise a command line, so the contract is documented on CompileUnit::argv: the caller must pass canonical argv (prefix-mapped, no temp dirs). Anything else is not this module's guess to make.
  • No identity, no serving — an unstamped/legacy tree yields None: no object is addressed, no stamp is written, the caller compiles from source (test 20).
  • Incomplete input never plans — no units, no config digests, an empty toolchain identity, or a variant the tree does not carry all yield None.
  • Ambiguity-free framing — every field is length-prefixed and domain-tagged, so no two input tuples can collide by shifting a character across a field boundary; ABI_SCHEMA versions the whole thing.

Real test output

soldr cargo test -p fbuild-library --lib prebuilt_core
  7 passed; 0 failed; 0 ignored          (first compile, cold worktree)
soldr cargo test -p fbuild-library --lib
  408 passed; 0 failed; 9 ignored        (was 401 before this PR)
soldr cargo clippy -p fbuild-library --all-targets -- -D warnings   exit 0
soldr cargo fmt --all -- --check                                    exit 0
uv run --no-project --with pyyaml python -m unittest ci.test_enforce_platform_boundary
  14 tests OK
uv run --no-project python ci/platform_boundary_research.py --check --host-label linux
  rows=150, rc=0

RED proven, not asserted: replacing self.framework_identity(...)? with a constant makes an_unstamped_framework_never_plans and incomplete_inputs_never_plan FAIL (5 passed / 2 failed); restoring it returns 7/7. Adding a -D to one unit, changing a header digest, or changing the toolchain version each move the fingerprint.

LOC: prebuilt_core.rs 225, prebuilt_core_tests.rs 302 (sibling test module, so tests.rs stays at 967).

Not in this PR

  • No --prebuilt-core / FBUILD_PREBUILT_CORE flag: a flag with no fetch ladder behind it would be unreachable code, which is what decision 8 rejects about the pilot. The flag, the eligibility predicate, the Catalog reader and the rung ladder are the next units.
  • No bucket key rendering: decision 2 fixes the v1/... shape but the <product> name for core objects is not yet ruled, so this PR stops at the fingerprint.
  • No publish (§8c is a maintainer action), no workflow files, no new crate, no stamp writes.

#1882 stays open.

@coderabbitai

coderabbitai Bot commented Nov 24, 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

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
  • 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 24, 2026
Merged via the queue into main with commit 81a224d Nov 24, 2026
34 checks passed
@zackees
zackees deleted the agent/1882-core-plan branch November 24, 2026 21:36
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 25, 2026
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