You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Refactor/Chore] Prevent new deployment edition checks outside feature policies #46696
I confirm that I am using English to submit this report, otherwise it will be closed.
【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
Please do not modify this template :) and fill in all the required fields.
Description
Add a deployment edition guard for production Python and stubs under api/.
Reject new DeploymentEdition imports, qualified enum references, and direct
edition decisions such as Cloud or Enterprise comparisons and match cases.
Tests under api/tests can still set up deployment scenarios, and existing
production usages retain their Git baseline.
The feature policy modules allowed to resolve edition-dependent capabilities are:
api/services/feature_service.py
api/services/system_feature_service.py
api/services/knowledge_fs/feature_service.py
Diagnostics and api/AGENTS.md tell contributors where to reuse or add a named
capability. Use FeatureService for product capabilities and workspace
entitlements, or SystemFeatureService for deployment-wide system policies.
Motivation
Direct edition checks spread Cloud and Enterprise policy across business code.
Named capabilities give callers one place to find which policy enables a feature.
Checking new decisions separately from imports also catches new branches in
modules that already import the enum.
Additional Context
Use ast-grep and Python AST filtering through make lint and Python Style CI.
Compare CI changes against the target revision. Preserve existing occurrences
across formatting, import alias changes, and ordinary file renames. Treat
decisions moved from an exempt module into guarded code as new occurrences.
Activity
chore(web): guard new deployment edition dependencies
chore: merge upstream main into edition guard branch
fix(web): preserve edition guard aliases and moved imports
docs: centralize feature flag policy guidance
docs: focus feature flag guide on lint fixes
docs: summarize feature flag design principles
docs: retain concrete system feature admission rules
docs: clarify effective bootstrap values