Skip to content

docs(data-drains): describe the resolved feature, not the bare flag - #7475

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/data-drains-flag-docs
Sep 4, 2026
Merged

docs(data-drains): describe the resolved feature, not the bare flag#7475
waleedlatif1 merged 2 commits into
stagingfrom
fix/data-drains-flag-docs

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Fixes the Data drains self-hosted flag paragraph, raised on the v0.8.22 release PR (#7473). The finding holds up on both points.

The bare flag is not what gates the feature. enterpriseFeatureEnabled resolves explicit ?? (ENTERPRISE_ENABLED || legacyDefault), and ENTERPRISE_FEATURE_LEGACY_DEFAULTS.dataDrains is false — so with DATA_DRAINS_ENABLED unset and ENTERPRISE_ENABLED set, data drains are on. The first sentence credited the bare variable and the second sentence then contradicted it. The paragraph now leads with the resolution, including that an explicit false always wins.

The reason given for the public twin was wrong. Inside a workspace, WorkspaceHostProvider seeds the deployment shape from the server-resolved host context, useDeploymentShape() returns that seeded value, and the settings sidebar gates 'data-drains': features.dataDrains from it (components/settings/navigation.ts; settings/navigation.ts says so in a comment: "the sidebar applies deployment and entitlement visibility from the host context"). So the page follows the server whether or not the twin is set, and "set it so the browser's configuration matches the server's" misdescribed what the browser reads.

The advice to set it stands, with the accurate reason: it backs browserFallbackShape() wherever nothing has seeded the shape, and it is what sim-setup doctor compares (packages/sim-setup/src/twins.ts).

One qualification to the original finding: it proposed treating the twin as "doctor consistency only", which understates it — the twin is still the client fallback outside a seeded workspace, so the page says both roles rather than dropping one.

Type of Change

  • Bug fix (documentation accuracy)

Testing

bun run lint, bun run check:audits (45), and bun run docs-manifest:check all pass. Every claim was traced to source before rewriting: enterprise-entitlements.ts, env-flags.ts, deployment-shape.ts, workspace-host-provider.tsx, components/settings/navigation.ts, and sim-setup/src/twins.ts.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

🤖 Generated with Claude Code

Two things were wrong in the self-hosted flag paragraph.

The first sentence attributed the page and the endpoints to
`DATA_DRAINS_ENABLED` alone, which the next sentence then contradicted.
`enterpriseFeatureEnabled` resolves `explicit ?? (ENTERPRISE_ENABLED || legacy
default)`, and the legacy default for data drains is `false` — so the feature is
on with the variable unset whenever `ENTERPRISE_ENABLED` is set, and an explicit
`false` always wins. The paragraph now leads with that resolution.

The rationale given for the public twin was also wrong. Inside a workspace
`WorkspaceHostProvider` seeds the deployment shape from the server-resolved host
context, `useDeploymentShape()` returns that seeded value, and the settings
sidebar gates `data-drains` on `features.dataDrains` from it — so the page
follows the server regardless of the twin, and "set it so the browser matches
the server" misdescribed what the browser reads. The twin still backs
`browserFallbackShape()` where nothing has seeded the shape, and it is what
`sim-setup doctor` compares, so the advice to set it stands with the real reason.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs Ready Ready Preview Sep 4, 2026 3:39am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread apps/docs/content/docs/platform/enterprise/data-drains.mdx Outdated
`isEnterpriseEnabled` is `isTruthy(env.ENTERPRISE_ENABLED)`, so
`ENTERPRISE_ENABLED=false` is set and still resolves off. "Is set" would have
implied an unset `DATA_DRAINS_ENABLED` turns drains on there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Corrects the self-hosted Data Drains documentation to describe effective feature resolution rather than attributing behavior solely to the feature-specific flag.

  • Documents precedence between DATA_DRAINS_ENABLED and ENTERPRISE_ENABLED, including explicit opt-out behavior.
  • Clarifies that workspace UI uses the server-resolved deployment shape.
  • Explains the public flag’s fallback and setup-diagnostics roles.

Confidence Score: 5/5

The documentation-only change appears safe to merge.

The corrected statements align with the implementation’s entitlement resolution, workspace deployment-shape seeding, client fallback, access gating, dispatcher behavior, and setup-doctor comparison.

Important Files Changed

Filename Overview
apps/docs/content/docs/platform/enterprise/data-drains.mdx The revised guidance accurately reflects feature-flag precedence, server-seeded workspace behavior, browser fallback behavior, and setup diagnostics.

Reviews (2): Last reviewed commit: "docs(data-drains): say the master switch..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit 20cadc8 into staging Sep 4, 2026
6 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/data-drains-flag-docs branch September 4, 2026 03:40
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