Skip to content

feat(prebuilt): framework identity term over component stamps (#1882) - #2168

Merged
zackees merged 2 commits into
mainfrom
agent/1882-framework-term
Nov 24, 2026
Merged

zackees merged 2 commits into
mainfrom
agent/1882-framework-term

Conversation

@zackees

@zackees zackees commented Nov 24, 2026

Copy link
Copy Markdown
Member

Adds the framework term of the prebuilt-framework fingerprint: the per-component identity of an installed ESP32 framework, read from the stamps the components wrote in staging (docs/design/artifact-serving-decisions.md §8a), plus its first real consumer.

Refs #1882. #1882 stays open (the planner/transfer ladder of 8b is not in this PR).

What lands

  1. fbuild_packages_fetch::component_id::component_term(&[ComponentIdentity]) -> Option<String>
    • Domain-tagged, TERM_SCHEMA-versioned hash over (component, version, content_id, recipe) of every component.
    • Order-independent (sorted by component name) and install-history independent: it re-hashes stamps, never the installed tree.
    • None for an empty identity list (no identity → no fingerprint, never an invented one) and for a duplicate component name (an ambiguous tree cannot present a canonical id).
  2. Esp32Framework::framework_identity(mcu, sdk_variant) -> Option<String> (esp32_framework/identity.rs)
  3. Consumer: Esp32FingerprintMetadata gains framework_identity: Option<String> (the esp32 fast-path fingerprint key). Every other field describes the board/toolchain/flags; this one covers the framework bytes those flags point at, so an SDK re-install or a compat patch that lands the same paths with different bytes can no longer replay a stale fast path.
    • #[serde(skip_serializing_if = "Option::is_none")]: a legacy, unstamped tree serializes exactly as before, so no existing fast path is invalidated by this field; only a stamped tree gains the term.

Tests (real output at head)

  • soldr cargo test -p fbuild-packages-fetch --lib component_term → 8 passed / 0 failed (order independence, sensitivity to content id / recipe / version / component name, empty → None, duplicate component → None, every component covered).
  • soldr cargo test -p fbuild-library --lib framework_identity → 6 passed / 0 failed:
    • install-history independence: building esp32dev into the same core tree leaves the esp32c3 term byte-identical (decision 8a's test 18);
    • no identity, no term: a complete-but-unstamped (legacy) tree → None (test 20);
    • a required chip-variant tree without its own stamp → None; the same tree identified for the plain MCU;
    • a missing required variant tree → None;
    • the skeleton stamp changes the term.
  • soldr cargo test -p fbuild-build-esp --lib fingerprint → 5 passed / 0 failed, including an_unstamped_framework_leaves_the_metadata_unchanged (the legacy metadata JSON has no framework_identity key).
  • ci.test_enforce_platform_boundary → 14 tests OK; ci/enforce_platform_boundary.py totals unchanged.
  • LOC: identity.rs 55, identity_tests.rs 167, tests.rs 967 / libs.rs 970 (<1000).

Not in this PR

--prebuilt-core / FBUILD_PREBUILT_CORE, the Catalog/index readers, the daemon fetch ladder and any publish (§8c is maintainer-only). A flag whose only consumer would be a planner that does not exist yet is dead code, and the design doc rejects landing that.

Adds the framework term of the prebuilt-framework fingerprint: the
per-component identity of an installed ESP32 framework, read only from the
stamps the components wrote in staging (decision 8a), plus its first real
consumer.

- component_id::component_term(): domain-tagged, TERM_SCHEMA-versioned hash
  over (component, version, content_id, recipe); order-independent, and
  install-history independent because it never re-hashes the installed tree.
  None for an empty identity list or a duplicated component name.
- Esp32Framework::framework_identity(mcu, sdk_variant): requires the core
  stamp and the sdk stamp of every required variant; includes the mcu
  skeleton stamp when present; None for a legacy, half-installed or
  half-merged tree.
- Esp32FingerprintMetadata::framework_identity: the esp32 fast-path
  fingerprint now covers the framework bytes its flags point at, so an SDK
  re-install or compat patch landing the same paths with different bytes
  cannot replay a stale fast path. Skipped when None, so a legacy tree
  serializes exactly as before and no existing fast path is invalidated.

Refs #1882; the issue stays open (8b planner/transfer is not in this PR).
@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

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