Identify derived summary inputs in the shared catalog - #650
Merged
Merged
Conversation
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.
A materialization computed from existing summaries needs a distinct source identity. Treating it as the original metric/table can alias raw state and route raw samples into the outer accumulator.
Before this PR: catalog sources described only metrics and tables. There was no portable identity for the retained maintenance program between existing summaries and a derived materialization.
After this PR: the existing materialization config and data descriptor share
DerivedInputIdentity: stable inputSummaryDefinitionIds plus the maintenance program's semantic SHA-256. The program remains inOwnedPostAsapDag. Its identity excludes query names, plan-local node numbering, and catalog generations; raw source hash bytes remain unchanged. A non-UTF8 domain prefix prevents an arbitrary raw metric string from impersonating the derived policy preimage. Catalog validation rejects missing and cyclic dependencies.For example, raw
Sum(m)and a sum over finalized inner-summary values have different policy/data identities, while reinstalling the same derived semantics under a new plan generation preserves those identities.Derived execution is deliberately not enabled here. Typed installation and legacy streaming bootstrap reject derived inputs until the immutable maintenance consumer and durable output deduplication are wired. This is the shared identity prerequisite for that follow-up, not a claim that SQL q10 or general summary-over-summary execution now runs. The signature validates typed wire structure and the reachable input cut; full execution compatibility remains the consumer's responsibility.
Verification: 94 shared-type tests passed, including raw/derived separation, generation/node/query-ID stability, serialization, missing/cyclic references, unsupported document versions, literal leaves, and typed install rejection. Production control/data plane compilation passed. The legacy bootstrap rejection regression is also verified separately. Independent source review identified and closed the legacy bootstrap bypass and invalid-document constructor gap. Performance evidence is not applicable to this contract change.