Skip to content

Comments

refactor: process resolve for materialization#275

Merged
andreas-karlsson merged 10 commits intomainfrom
materialization-refactor
Feb 20, 2026
Merged

refactor: process resolve for materialization#275
andreas-karlsson merged 10 commits intomainfrom
materialization-refactor

Conversation

@andreas-karlsson
Copy link
Contributor

@andreas-karlsson andreas-karlsson commented Feb 13, 2026

Summary

Refactors the materialization API to use a suspend/resume pattern.

Key changes:

  • New ResolveProcessRequest API with four modes:

    • DeferredMaterializations - suspend if materializations needed
    • StaticMaterializations - provide materializations upfront
    • WithoutMaterializations - error if materializations needed
    • Resume - continue after fetching materializations
  • Unified MaterializationRecord replaces separate ReadOp, ReadResult, VariantData, InclusionData types

  • Kleene logic for expression evaluation - unknown materialization state evaluates to Unknown (not true/false), guaranteeing all needed materializations are discovered in a single pass

  • Single suspend/resume cycle - no retry loops needed

  • Removed wasm_msg_guest_resolve export (replaced by wasm_msg_guest_resolve_flags)

resolveWithContext(
List.of(flag1), "a".repeat(101), Struct.newBuilder().build(), false))
.withMessageContaining("Targeting key is too larger, max 100 characters.");
// Targeting key > 100 chars results in a TargetingKeyError reason, not an exception
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change in semantics. I think it's harmless, but maybe we should still treat it as an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left this change so it's now a targeting-key-error.

@andreas-karlsson andreas-karlsson marked this pull request as ready for review February 19, 2026 08:45
Copy link
Member

@nicklasl nicklasl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@andreas-karlsson andreas-karlsson merged commit 03e1e9f into main Feb 20, 2026
10 checks 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.

2 participants