Skip to content

feat(den): store Cloud instances in a provider-neutral table and tell clients how endpoints behave - #4446

Merged
reachjalil merged 6 commits into
devfrom
feature/cloud-runtime-neutral-store
Sep 14, 2026
Merged

reachjalil merged 6 commits into
devfrom
feature/cloud-runtime-neutral-store

Conversation

@reachjalil

@reachjalil reachjalil commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Merge status

Merged into dev on September 14 as 1fdbccf9bba53e3d1911bba3bc5d9dea70034fb1, after #4445 landed as f2fb0c861140022d9c6d7ed928416b500e8e82f0. Warden approved the exact final head 847dbec246e133d0bb8b59009b64a694152823b8 with no findings; required, API, SDK and database checks passed. All review conversations were resolved. Full Cloud lifecycle/real-VM verification remains explicitly deferred, not passed.

Summary

Part 3 of the Cloud runtime provider stack, following merged #4445.

  • Add cloud_runtime_instance for provider identity, opaque references, storage, endpoint expiry and endpoint kind.
  • Read the neutral table and mirror Daytona writes/refreshes into the legacy table for rollback. Worker/organization deletion clears both.
  • Expose WorkerInstance.endpointKind; Den Web decides URL durability from it and preserves the fallback for older Dens.
  • Mark Den-managed heartbeats with DEN_RUNTIME_MANAGED, preserving legacy behavior.

September 14 restack

Head: 847dbec246e133d0bb8b59009b64a694152823b8.
Base: dev@f2fb0c861140022d9c6d7ed928416b500e8e82f0.

#4445 is now merged. This PR has been rebased onto that canonical merge and retargeted to dev, retaining only its six neutral-storage/endpoint commits. Range comparison confirms their patches are unchanged.

The general protected-0097 history repair is now parent-owned; duplicate child test patches were removed while preserving the original migration/backfill and neutral-store assertions. OpenAPI was regenerated from this child after restacking. Fresh current-head CI remains authoritative.

  • Retains the parent's credential-safe script transport, private legacy discovery and desktop availability fixes.
  • Regenerated the neutral migration as 0099_cloud_runtime_instance after upstream's occupied 0098. All upstream migration artifacts and 110 upstream tables are preserved. The complete neutral-table DDL/backfill is byte-identical to the prior child SQL; the snapshot follows the current chain rather than merely renaming stale metadata.
  • Adapted the existing protected-0097 history expectations to upstream 0098 plus child 0099. No old receipts are rewritten.
  • Preserved raw bootstrap security assertions alongside DEN_RUNTIME_MANAGED, neutral-row rollback assertions, current pagination/handoff/deletion behavior and generated endpoint semantics.
  • Published OpenAPI adds only WorkerInstance.endpointKind over the current upstream snapshot. No CI/review-policy changes. Commits are signed.

Verification

Verdict: Passed for the database replay/backfill checks; Incomplete for the deferred full Cloud lifecycle/actual Web/VM run. The local integration environment remains unavailable; that limitation is not hidden by the merge.

Passed on this head:

  • Den DB Check, pinned to this exact head: 72 passed, 0 failed, 0 skipped, including full migration replay and neutral-instance backfill preserving legacy rollback rows.
  • Cloud runtime package: 72 passed, 0 failed.
  • Daytona adapter package: 49 passed, 0 failed.
  • Evals typecheck: 449 source files, no errors.
  • Selected offline migration-readiness group: 26 passed; Gateway history/preflight: 5 passed; bootstrap renderer: 3 passed. Zero selected failures/skips; these tests do not claim database execution.
  • Cloud-runtime and den-db typechecks and diff whitespace checks passed.

Historical database proof:

  • The previous published head faaff0182 had 72/72 Den DB tests pass, including replay/backfill/rollback rows. That result is historical after this restack and migration renumbering. Fresh CI results must match the head above.

Deferred:

  • SQL-backed lifecycle, current-head database replay/backfill and actual Web/VM execution were not run locally. No database/Redis installation, further VM repair or paid canary was started.
  • The covering first-use journey retains the parent's new private transport assertions plus this layer's neutral-store checks; it remains unexecuted locally until its fixture services are available.
  • Current-head database/build validation and the merge are recorded above. These results do not establish a production deployment.

Stack and merge order

All three layers are merged into canonical dev. #4445 landed first; this PR was then rebased onto it, retargeted to dev, independently approved and merged. Its six neutral-storage/endpoint patches survived restacking unchanged. The deferred full lifecycle run is not represented as passing.

UI/UX impact

No new visual or interaction changes in this layer. Den Web uses endpoint behavior instead of provider names for URL durability while retaining current Daytona behavior, legacy fallback and refresh timing. The parent's restored desktop handoff availability is retained.

Risk and rollback

The migration is additive and leaves legacy rows intact. Keep daytona_sandbox during the rollback window. Legacy mirroring is sequential, not an atomic two-table transaction. Old Den can continue reading retained legacy rows; the neutral table may remain unused after rollback. The lifecycle proof gap remains explicit even if database CI passes.

@vercel

vercel Bot commented Sep 4, 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 Sep 14, 2026 8:08pm UTC
openwork-den Ready Ready Preview Sep 14, 2026 8:08pm UTC
openwork-diagnostics Ready Ready Preview Sep 14, 2026 8:08pm UTC
openwork-landing Ready Ready Preview, v0 Sep 14, 2026 8:08pm UTC

@benjaminshafii

Copy link
Copy Markdown
Member

@OmarMcAdam Please review the database backfill, dual-write rollback, endpoint behavior, and deployment order. Live database migration replay and Cloud lifecycle journey proof are explicitly incomplete. Depends on #4445.

Holding for your review under the current merge instructions.

@reachjalil
reachjalil force-pushed the feature/cloud-runtime-daytona-adapter branch from b4dde7f to 778acbd Compare September 5, 2026 23:11
@reachjalil
reachjalil force-pushed the feature/cloud-runtime-neutral-store branch from e517096 to 958382e Compare September 5, 2026 23:11
@vercel
vercel Bot temporarily deployed to Preview – openwork-den September 5, 2026 23:15 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-app September 5, 2026 23:15 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-landing September 5, 2026 23:15 Inactive
@vercel
vercel Bot temporarily deployed to Preview – openwork-diagnostics September 5, 2026 23:15 Inactive
@reachjalil
reachjalil force-pushed the feature/cloud-runtime-daytona-adapter branch from 778acbd to a79ef27 Compare September 6, 2026 00:03
@reachjalil
reachjalil force-pushed the feature/cloud-runtime-neutral-store branch from 1cc754d to f582b3c Compare September 6, 2026 00:03
@reachjalil
reachjalil force-pushed the feature/cloud-runtime-neutral-store branch from f582b3c to aec102f Compare September 6, 2026 00:51
@reachjalil
reachjalil force-pushed the feature/cloud-runtime-daytona-adapter branch from a79ef27 to 2e51daa Compare September 6, 2026 00:51
@reachjalil
reachjalil force-pushed the feature/cloud-runtime-daytona-adapter branch from 2e51daa to e93e332 Compare September 6, 2026 06:56
@reachjalil
reachjalil force-pushed the feature/cloud-runtime-neutral-store branch from aec102f to 52987a8 Compare September 6, 2026 06:56
@reachjalil

reachjalil commented Sep 6, 2026 •

Copy link
Copy Markdown
Member Author

Passed · 12/12 tests · 18/18 assertions · 8 images

Commit 847dbec246e133d0bb8b59009b64a694152823b8 · selected evidence

Open review report

… clients how endpoints behave

Add cloud_runtime_instance: provider id, opaque provider reference, storage
volumes, endpoint URL, endpoint expiry, and endpoint kind per worker. The
migration creates the table and backfills every daytona_sandbox row as a
Daytona record with a signed-expiring endpoint, keeping each record id's
suffix so the mapping stays traceable. Den reads the neutral table; Daytona
records are mirrored into daytona_sandbox until every deployment has moved,
so a rollback still sees the current instance and endpoint. The desktop
handoff origin check, organization deletion, and worker deletion use the
neutral table.

Worker instance responses gain endpointKind. Den Web decides URL durability
from it and falls back to the provider name only for Dens that predate the
field. The sandbox bootstrap sets DEN_RUNTIME_MANAGED=1 next to the provider
name, and the worker heartbeat accepts either, so a future host enables idle
tracking without the worker knowing its name.
@github-actions

Copy link
Copy Markdown
Contributor

Warden review summary — Clear

Native findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run

Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (121433 ms), confidentiality-review (177139 ms), spec-provenance-review (241473 ms), desktop-den-sync-review (286451 ms).

Blockers

  • None.

Advisories

  • None.

Needs recheck

  • None.

Observed review-thread metrics

  • Unique observed run attempts in retained window: 1
  • Distinct heads in retained window: 1
  • Current unresolved Warden threads: 0 of 0 observed
  • Observed resolved/unresolved transitions in retained snapshots: 0 / 0
  • First observed resolved/unresolved (state at first collection, not event time): 0 / 0
  • Precision: unavailable (no adjudications; no TP/FP values are inferred)
  • Observation window: 1/20 run attempts retained; truncated: false
  • Transition snapshot: 0/0 current attributed threads retained (limit 500); truncated: false

Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority.

@diff-warden diff-warden 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.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (847dbec246e133d0bb8b59009b64a694152823b8). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

This branch was successfully deployed

4 active deployments
Preview – openwork-landing — 847dbec2 Deployed Sep 14, 2026 by vercel[bot]
Preview – openwork-app — 847dbec2 Deployed Sep 14, 2026 by vercel[bot]
Preview – openwork-den — 847dbec2 Deployed Sep 14, 2026 by vercel[bot]
Preview – openwork-diagnostics — 847dbec2 Deployed Sep 14, 2026 by vercel[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.

2 participants