-
Notifications
You must be signed in to change notification settings - Fork 98
Implement an immutable SDK request context with scoped metadata propagation #467
Copy link
Copy link
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsbackendBackend services, application logic, persistence integration, and server-side functionalityBackend services, application logic, persistence integration, and server-side functionalityconsistencyPattern and convention standardization across the codebase for uniformityPattern and convention standardization across the codebase for uniformityexpertExpert difficulty tasks requiring deep expertise and architectural decision-makingExpert difficulty tasks requiring deep expertise and architectural decision-makingtype-safetyTypeScript type system improvements and strict type enforcementTypeScript type system improvements and strict type enforcement
Description
Activity
Metadata
Metadata
Assignees
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsbackendBackend services, application logic, persistence integration, and server-side functionalityBackend services, application logic, persistence integration, and server-side functionalityconsistencyPattern and convention standardization across the codebase for uniformityPattern and convention standardization across the codebase for uniformityexpertExpert difficulty tasks requiring deep expertise and architectural decision-makingExpert difficulty tasks requiring deep expertise and architectural decision-makingtype-safetyTypeScript type system improvements and strict type enforcementTypeScript type system improvements and strict type enforcement
Difficulty: Expert
Type: Feature
Recommended labels (if available in this repo): backend, type-safety, consistency, expert
Background
As the GuildPass SDK grows, individual operations may need to carry scoped metadata such as request identifiers, caller tags, tracing values, or diagnostic attributes through internal layers.
Passing mutable plain objects through many functions can create hidden coupling and accidental mutation.
This issue introduces a generic immutable request-context primitive without integrating it into transport or client methods.
Problem
There is currently no standard SDK mechanism for safely propagating scoped metadata through nested operations.
A mutable context object can be changed by one internal function and unexpectedly affect unrelated callers or sibling operations.
Expected Outcome
Implement an immutable request context that supports typed metadata lookup, derivation, and controlled propagation.
Suggested Implementation
The design may include APIs conceptually similar to:
A stronger typed-key design is preferred over an unrestricted global string dictionary if practical.
The context should:
Acceptance Criteria
pnpm typecheckpasses.pnpm buildpasses.pnpm testpasses.Likely Affected Files/Directories
Independence Requirement
This issue must be independently implementable from the current SDK baseline and must not depend on middleware, diagnostics, or transport contributions.