Skip to content

policy: expand structured concurrency guidance for scope isolation#173

Open
taras wants to merge 1 commit intofeat/durablyfrom
policy/structured-concurrency-guidance
Open

policy: expand structured concurrency guidance for scope isolation#173
taras wants to merge 1 commit intofeat/durablyfrom
policy/structured-concurrency-guidance

Conversation

@taras
Copy link
Member

@taras taras commented Feb 26, 2026

Motivation

The structured concurrency policy needed clearer direction on when to use Context.with(), scoped(), resource(), and createScope(), especially around scope isolation and teardown responsibilities.

Approach

  • Add explicit decision guidance for:
    • single context overrides (Context.with())
    • middleware/context isolation (scoped())
    • lifecycle-bearing values (resource())
    • entrypoint-only createScope() usage with destroy binding
  • Add compliant/non-compliant examples for each pattern.
  • Expand the verification checklist and common mistakes section to enforce scope hygiene.

Expand the policy with concrete guidance for Context.with(), scoped(), resource(), and createScope() usage, including compliant/non-compliant examples and a stronger verification checklist around scope lifecycle hygiene.
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch policy/structured-concurrency-guidance

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 and usage tips.

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