Skip to content

feat(den): capability catalog, org config handoff and preview flags - #7716

Open
benjaminshafii wants to merge 25 commits into
devfrom
feat/deployment-capability-catalog
Open

benjaminshafii wants to merge 25 commits into
devfrom
feat/deployment-capability-catalog

Conversation

@benjaminshafii

@benjaminshafii benjaminshafii commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

What is this about?

One PR for the whole stack: what a deployment can run is a capability, what an organization chooses is org config, and unfinished work is a preview flag with an owner and an expiry date.

What problem does it solve?

Operators could not tell which setting turns Workbot or the gateway on, and flags never expired.

What was the situation before?

Before After
Capabilities Spread over five installers One checked catalog
Flags No end date Owner and expiry
Helm Mistyped values ignored Unknown keys refused
Den API settings One flat list Four groups, read unchanged

How is this implemented?

  • packages/managed-deployments/src/capabilities.ts with a drift test; GET /v1/org reports each capability's state.
  • packages/features/src/previews.ts and retired.ts; pnpm features:check enforces expiry.
  • Helm _validate.tpl; the chart's headlessRunner and workbot are in the catalog.
  • env-schema.ts, tuning.ts, env-prod-parity.test.ts.
  • Den Web: Settings › Capabilities and a Diagnostics Configuration row, each behind a preview.

What else changed?

  • Retires remoteComputers and five previews already on for everyone.
  • Den Web reaches the API without DEN_API_BASE.

Release note

Self-hosted installs refuse mistyped Helm values with a clear message.

Evidence

  • evals/proofs/deployment-capabilities-view.proof.test.ts — before: no Capabilities page; after: installed state beside member access.
  • evals/proofs/diagnostics-config-export.proof.test.ts — before: no Configuration row; after: versions and a mismatch warning.
  • evals/proofs/admin-preview-flags.proof.test.ts — each preview shows its owner and expiry.

Design: P1, P2, P3, P4, P5, P6, S1, S2, S3, C1, C2, C5, C7, V2, V5

@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
openwork-app Ready Ready Preview Nov 28, 2026 1:36am UTC
openwork-den Ready Ready Preview Nov 28, 2026 1:36am UTC
openwork-landing Ready Ready Preview, v0 Nov 28, 2026 1:36am UTC

Request Review

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Deploying openwork with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7bcbea6
Status: ✅  Deploy successful!
Preview URL: https://9adb4b10.openwork.pages.dev
Branch Preview URL: https://feat-deployment-capability-c.openwork.pages.dev

View logs

@mintlify

mintlify Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
differentai 🟢 Ready View Preview Nov 28, 2026, 1:36 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@benjaminshafii benjaminshafii changed the title feat(managed-deployments): capability catalog, drift test and capability state feat(den): capability catalog, org config handoff and preview flags Nov 28, 2026
@benjaminshafii

benjaminshafii commented Nov 28, 2026 •

Copy link
Copy Markdown
Member Author

This PR now carries the whole stack, rebased onto dev at b5771ce. It consolidates:

Those six stay open, and their branches are untouched, until this merges. The previous head of this branch is ef11b99d1a.

Reconciled with what landed on dev since 24 November:

  • All 21 keys dev retired stay retired. The 14 flags dev added and the two this stack adds are definePreview entries, each checked field for field against its flag file. flags/ and all-flags.ts are gone.
  • The chart installs the runner and Workbot now, so the catalog records headlessRunner.enabled and workbot.enabled and drops three not_installed gaps. Cloud computers need no flag.
  • The five env parity recordings were written by dev's untouched env.ts and are byte-identical after the regrouping. env.helm is the only field added on top.

…ery installer

Workbot, the Slack assistant, Automations, the AI Gateway and cloud computers
are controlled in several places with different defaults per installer. The
catalog records, for managed AWS, managed Google Cloud, the Helm chart and the
AWS ECS and Cloud Run modules, whether each capability is supported and which
Terraform variables, Helm values and Den switches implement it.

A drift test reads the Terraform roots and modules, the chart and Den, and
fails when a control is missing or its default differs from the catalog.
Today's inconsistencies are recorded as gaps and pinned. A capability may not
depend on a rollout flag in the customer's deployment unless it is a recorded
gap. The configuration change planner now reads its fixed and editable rules
from the catalog. The test runs in pnpm check and the required quick check.

The Helm README example used retired feature keys and said cloud-only
features have no key; both are corrected and the example is now tested.
…tructure or unsupported

GET /v1/org adds deploymentCapabilities.capabilities, derived from settings
Den already has (configured services, its Automations and Slack switches, the
organization's features). No network call is made, and the aiGateway boolean
is unchanged.

GET /v1/managed-deployments/{deploymentId}/capabilities reports the same for a
managed deployment from its recorded target: runtime profile, assistant
settings and computer provider on AWS, unsupported on Google Cloud.
…s may use them

Settings › Capabilities lists Workbot, the Slack assistant, Automations, the
AI Gateway and cloud computers with two separate answers: whether the
deployment has it installed (deploymentCapabilities in GET /v1/org) and who in
the organization may use it, read from the setting that decides it. A
capability that is installed while no member may use it is named at the top.
A managed deployment's page lists what that deployment has installed.

Behind deploymentCapabilitiesView (cloud and self-hosted, off).
…tuning out

env.ts read 210 variables from one flat list. They are now four named groups
in env-schema.ts: 12 core settings a self-hosted install sets, optional
capabilities, OpenWork Cloud only, and legacy or internal names. Validators
and the cross-field rules are unchanged.

39 timings, batch sizes and timeouts of background work move to tuning.ts
with the same defaults. Each still reads its variable, so a value set on a
running service keeps working; they are no longer listed in .env.example,
which now opens with the core settings.

The env object den-api code reads keeps every field.
Five whole environments are parsed by a new den-api process each and
compared field for field with what was recorded before the settings were
regrouped: OpenWork Cloud (separate API origin, hosted database, variables
Render adds, tuning set by hand, variables left behind by removed code), the
managed AWS gateway and legacy profiles as their Terraform passes them, the
Helm chart 0.2.0 ConfigMap and Secret as helm template renders them, and a
self-hosted install that sets only its address, database, secrets and first
administrator.

The recorded files were produced by the env.ts this branch started from. The
same run on origin/dev differs only by documentsOffice, which dev has since
removed.

Runs in pnpm check and with the Den API tests in the quick check.
… dev

The recorded files are what the env.ts on dev makes of each environment,
written before the settings were regrouped: dev has since removed
documentsOffice and added artifactStorage and workspaceCreateLimit.
Den Web's server needed DEN_API_BASE to proxy requests, read the workspace
icon and check single sign-on. When it is unset the public API address is
now used: DEN_API_PUBLIC_URL, else api.<host> from DEN_BASE_URL. A
DEN_API_BASE that is set is used exactly as before.
…llation environments

pnpm --filter @openwork-ee/den-api smoke:env-boot starts dist/main.js twice
on a new local MySQL database, migrated the way a deployment migrates it:
once with the OpenWork Cloud environment and once with a self-hosted install
that sets its address, database, two secrets, first administrator and setup
code. It signs the first administrator in, reads /health, /ready, /v1/org and
/v1/org/diagnostics, and fails if any secret value appears in a response.

The Cloud environment keeps its shape but points at hosts that never resolve,
and the keys of services that would be called are left out.
… off

Gates the Configuration row in Settings › Diagnostics. Self-hosted only: on
OpenWork Cloud the installation is managed and has nothing to export.
…nistrators

GET /v1/org/diagnostics?include=config (and the check route) adds
installation.config for a self-hosted installation administrator: the running
version, the Helm chart and chart app versions the chart stamps in
OPENWORK_HELM_CHART_VERSION and OPENWORK_HELM_APP_VERSION, whether they
differ, each deployment capability's state and the features the deployment
locks on or off. A mismatch is also listed under what needs attention, as a
warning.

Only versions, fixed codes, feature keys and booleans have a field. A version
variable holding anything else is dropped. Other members, organization admins
and every caller on OpenWork Cloud get the same answer as before.

The field is added only when asked for: the installation section is a strict
object, so an older Den Web would reject an answer that always carried it.

The recorded installation environments gain env.helm, unset in all five.
…nd a version warning

Behind diagnosticsConfigExport. Installation administrators see the running
version beside the Helm chart's, an amber Version mismatch badge when they
differ, the features the deployment locks, and two actions that copy or
download the sanitized configuration as JSON. With the feature off Den Web
does not ask for the configuration and the page is unchanged.
Every active flag moves from one file each under flags/ to one export in
packages/features/src/previews.ts, declared with definePreview. Retired keys
move to retired.ts. pnpm features:check fails when a preview has no owner or
expiry date, has expired, sets one more than 183 days ahead, or is out of
alphabetical order, and when the capability catalog depends on a preview
without a recorded gap or names a retired one.

Wire names stay as they are: GET /v1/org features, DEN_FEATURE_* locks and
the settings.features config area. A config file may also name that area
settings.preview_flags. /admin calls the flags Preview flags and shows each
one's owner and expiry.
gatewayOpenCodeSetup, importOpencodeConnections, lowStorageWarning,
providerFilterSyncFix and questionMinimize have been on for everyone on
OpenWork Cloud since 18 November with no organization turning them off.
Their enabled behavior becomes standard on every deployment: the checks and
the off paths are removed, old operator locks and overrides are ignored, and
published clients keep receiving true for these keys.
… flag

Cloud computers work once a computer provider is configured on the runner:
Den reports Workbot's computer and browser views to every organization, and
the desktop offers a configured VM to anyone signed in to an organization
that Den has verified. Old operator locks and overrides are ignored, and
published clients keep receiving true for the key.

The key no longer hides the computer entry points where no provider is
installed: Workbot's Computer and Browser tabs and OpenWork Web's Cloud
computer button show there and report that the computer is unavailable.
…piry

Adds the internal doc for preview flags with a screenshot of the page.
…rride guardrails

headlessRunner and workbot are chart values now. The key walker leaves their
maps to openwork-ee.companions.validate, which names every supported key, and
the override test renders an install that sets all of them and refuses three
unknown ones.

denApi.env.DEN_BASE_URL is refused on every install by the chart-owned wiring
check, so the companion check keeps only DEN_API_PUBLIC_URL and the companion
test expects the chart-wide message.

The values audit counts the 278 leaves the chart has today.
…unner and Workbot, drop computer flags

The catalog's Helm target now records headlessRunner.enabled and
workbot.enabled, the values the chart installs each service with, and the
three not_installed gaps they closed are removed. What stays is that the
chart's runner is fixed to HEADLESS_COMPUTER=off.

remoteComputers, sandboxGateway and workbotProfileComputers are retired, so
cloud computers need no flag: the rollout_flag gap, the needs_rollout_flag and
rollout_flag_off reasons and the feature map Den passed to compute them are
gone. A running Den reports cloud computers on once a runner is configured,
and a managed AWS deployment once a provider is chosen.

Rollout-flag controls and hosted rollouts are checked against
packages/features/src/previews.ts.
questionMinimize is retired, so a question from another computer always
uses the collapsible panel: a single choice answers on click and the card
can be minimized.
…solidated tree

Cloud computers need no flag, so the Capabilities page reads them as installed
once a runner is configured and names them with the capabilities no member can
use yet. A member without Diagnostics now lands on the member Home. The
screenshots beside the three feature docs are the ones these runs took.

This branch was successfully deployed

4 active deployments
Preview – openwork-app — 7bcbea6b Deployed Nov 28, 2026 by vercel[bot]
Preview – openwork-landing — 7bcbea6b Deployed Nov 28, 2026 by vercel[bot]
Preview – openwork-den — 7bcbea6b Deployed Nov 28, 2026 by vercel[bot]
staging - packages/docs — 7bcbea6b Deployed Nov 28, 2026 by mintlify[bot]
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