Skip to content

fix(entitlements-core): evaluate dynamically resolved tenant entitlements - #2707

Merged
kang-heewon merged 3 commits into
trunkfrom
fix/2599-dynamic-entitlement-tenant
Sep 8, 2026
Merged

fix(entitlements-core): evaluate dynamically resolved tenant entitlements#2707
kang-heewon merged 3 commits into
trunkfrom
fix/2599-dynamic-entitlement-tenant

Conversation

@kang-heewon

@kang-heewon kang-heewon commented Sep 8, 2026

Copy link
Copy Markdown
Member

Summary

EntitlementGuard evaluates the framework Context or request tenant when principal and user tenant claims are absent, supporting organization switching. Conflicting tenant sources fail before entitlement lookup.

HTTP pipelines reject conflicting raw-request and HTTP-context tenants before invoking any configured guard, including AccessGuard-only routes. Existing HTTP tenant injection and request access from exception filters remain supported. Applications must validate tenant selection and organization membership before injecting these values.

Both affected packages have patch changesets. Public signatures and dependencies are unchanged.

Closes #2599

Validation

Elevated profile for authorization tenant resolution.

  • All 73 entitlements-core tests pass. Seven new regression cases fail against the original guard, covering dynamic tenant sources and switching across asynchronous scopes.
  • PipelineRunner and RateLimitGuard: 26 tests pass. The conflict regression fails against the original pipeline. Real AccessGuard and EntitlementGuard pipeline checks pass six conflict, matching-tenant, and normal-injection cases, including 403 filtering without invoking the authorization service or handler.
  • Affected-package lint, independent code review, and independent verification pass. Final cleanup required no changes. Full compiler diagnostics were used; editor diagnostics were unavailable.
  • Full build, tests, and guarded typecheck each pass 243/243 tasks on 93167e9bca0153713c1fa38994bb9369db68fc0b. Normal pre-push tests and guarded typecheck also pass; all hooks completed successfully.
  • Review companion architecture policy and 120 public API snapshots pass. All 27 applicable repository gates have aggregate passing evidence: 26 pass in pnpm check; the Problem registry passes with the original base pinned. The unpinned registry check sees newer trunk workflow codes as removals from this earlier branch. No registry files were changed to suppress that discrepancy.

Base compatibility

Original validation base: c2a26539a965065486813fda9462a0bae6d82212.
Final assessed trunk: cb1995eaa53eae734a28f234503867d34cc2c92c. The candidate below covers the earlier 9d14704 base.

Cumulative drift changes billing order/webhook behavior, workflow Problems, package-role policy, and LLM metering. Inspection found no changed guard assumptions. The conflict-free candidate d03334a65903cd4bc8c693a4316b1ab35d645ee3 (tree d50fd18076f4f589eac51e7da54513ae59605040) passes architecture policy across 122 packages and 6,170 imports. Earlier combined-base registry and public API checks remain applicable to their unchanged declarations and snapshots. Later drift adds optional text-tenant RLS SQL construction and aligns release promotion evidence with selected test lanes. Neither changes guard dependencies, runtime tenant context, or this PR’s validation assumptions. The cumulative drift companion passes; no further executable compatibility check was selected. No rebase was needed.

CI

CI, review companion, and benchmark pass on the final head. All four required checks pass, including validate; coverage-security, generated-apps, package-artifacts, core-verification, and real-resource-tests also pass. Final review-state inspection found no requested changes, pending review requests, or unresolved threads. Ordinary squash merge is permitted by repository policy.

Copilot AI lite review requested due to automatic review settings September 8, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

📊 Benchmark Results

✅ All benchmarks passed

Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 63.8μs 30.0ms 8.2μs +680.9% -
CrocoApp lambdaHandler (10 controllers) 2.1ms 50.0ms 258.4μs +714.4% -
Lambda cold-start simulation 2.2ms 80.0ms 418.1μs +418.1% -
Lambda cold-start with headers 1.7ms 80.0ms 369.7μs +350.9% -
Lambda cold-start with binary body 1.6ms 80.0ms 339.1μs +366.8% -
Lambda cold-start with query params 1.6ms 80.0ms 301.3μs +419.4% -
Lambda cold-start with authorizer context 1.6ms 80.0ms 299.8μs +420.3% -
Lambda cold-start realistic scenario 1.6ms 80.0ms 299.2μs +430.0% -
EventBusConfig.start (10 handlers) 1.6μs 10.0ms 1.4μs +14.0% -
EventPublisher.publishNow single event 1.8μs 2.0ms 1.7μs +7.8% -
DefaultHandlerResolver.resolve × 10 0.1μs 5.0ms 0.1μs +0.0% -
Container.get singleton (cold) 96.9μs 5.0ms 70.3μs +37.9% -
Container.register × 50 components 3.1ms 10.0ms 3.2ms -2.5% -
Container.validate (50 components) 3.9ms 20.0ms 3.4ms +14.3% -
Container.get singleton (warm) 1.4μs 500.0μs 1.6μs -14.7% -
TelemetryRuntime.init (lambda preset) 13.0μs 200.0ms 1.1ms -98.8% -
lambdaPreset config creation 1.5μs 2.0ms 1.4μs +4.3% -

Updated: 2026-09-08T08:23:10.876Z · Commit: 93167e9

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b049aabf14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/transports-http/src/libs/HttpExecutionContext.ts Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T07:51:24.998585Z b049aab PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Important

Approval pending

CodeRabbit has no unresolved comments, but it could not review the latest commit because the review limit was reached. Follow the review guidance in this comment to continue.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kang-heewon
kang-heewon merged commit 6754896 into trunk Sep 8, 2026
21 checks passed
@kang-heewon
kang-heewon deleted the fix/2599-dynamic-entitlement-tenant branch September 8, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants