Skip to content

Identify derived summary inputs in the shared catalog - #650

Merged
zzylol merged 4 commits into
mainfrom
feat/maintenance-input-identity
Sep 11, 2026
Merged

zzylol merged 4 commits into
mainfrom
feat/maintenance-input-identity

Conversation

@zzylol

@zzylol zzylol commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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 input SummaryDefinitionIds plus the maintenance program's semantic SHA-256. The program remains in OwnedPostAsapDag. 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.

@zzylol
zzylol merged commit fb98a40 into main Sep 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant