Conversation
The runtime's materialization index was keyed by a bare `u64` whose meaning lived only in the field name, `materializations_by_policy_fingerprint`. That name points at PolicyFingerprint, which its own module doc calls a "Legacy routing wrapper", superseded by an explicit `stored_output_id`. Every caller had to know which of the two identities that integer was. Key the index on StoredOutputId, the type whose doc says "Runtime routing uses this identity, never the semantic definition hash", and rename the field to `materializations_by_output`. `runtime_materializations`, the three accessors and the `Index` impl follow. No serialized bytes change. InstalledPrecomputePlan is `#[derive(Debug, Clone)]` with no Serialize at all, its own doc calling it an internal execution index derived from a validated plan. StoredOutputId and PolicyFingerprint are the same u64 behind two `#[serde(transparent)]` newtypes with conversions both ways, so even `state_schema_id`, which does reach a published document, formats the identical string. Fixtures keep holding raw ids. `from_raw_ids` is the one place that says so, rather than each test wrapping literals, and `From<u64> for StoredOutputId` lets a value already established as an output id convert without ceremony. This is step 1 of #785. It does not retire PolicyFingerprint: `from_config` still derives one from an explicit `stored_output_id`, so adoption changes how a fingerprint is computed rather than removing it. Retirement needs `stored_output_id` to become required, which is a separate change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of #785.
The runtime's materialization index was keyed by a bare
u64:The integer's meaning lived only in the field name, and that name points at
PolicyFingerprint, which its own module doc calls a "Legacy routing wrapper" superseded by an explicitstored_output_id. Every caller had to know which of the two identities the integer was.It is now keyed on
StoredOutputId, whose doc says "Runtime routing uses this identity, never the semantic definition hash", and the field ismaterializations_by_output.runtime_materializations, the three accessors and theIndeximpl follow.No serialized bytes change
Three things were verified rather than assumed:
InstalledPrecomputePlanis#[derive(Debug, Clone)]with noSerialize. Its doc calls it an internal execution index derived from a validated plan, and it is rebuilt byfrom_precompute_planon decode.PolicyFingerprintappears as a serde field on no struct. Both it andStoredOutputIdare#[serde(transparent)]newtypes over the sameu64, with conversions in both directions.state_schema_id, which formats"{BACKEND_COMPAT}:summary-state:v1:{id}". Same number, identical string.So no schema bump, which is a correction to what #785 originally claimed.
Fixtures
Tests keep holding raw ids. A
#[cfg(test)] from_raw_idssays that once, at the boundary, instead of every fixture wrapping its literals, andFrom<u64> for StoredOutputIdlets a value already established as an output id convert without ceremony. Production construction still goes throughfrom_precompute_plan, which takes the ids from the plan.What this does not do
It does not retire
PolicyFingerprint.from_configstill derives one from an explicitstored_output_id:So adoption changes how a fingerprint is computed, not whether one exists. Retirement needs
stored_output_idto become required so that fallback has no callers; that is a separate change.Validation
19 files, +156 / −111.
cargo test -p data_plane --lib946 passed,-p control_plane --lib433 passed,cargo fmt --checkandcargo clippy --all-targetswith-D warningsclean.Rebased onto
mainafter #763 merged, so it targetsInstalledPrecomputePlanrather than theStreamingConfigthat #763 replaced.🤖 Generated with Claude Code