03

Interact with a Stateful Preview and Managed App Data

Use the generated application, preserve state across revisions, and prove its data and validation boundaries before connecting enterprise systems.

The enterprise problem and today’s slice

Enterprise problem: Generated source is not a usable product, and a screenshot cannot show whether a customer can complete a workflow, keep state through a revision, isolate another app’s records, or recover from a bad schema change.

Whole-course context: The incoming artifacts are Day 02’s preview-ready rev-2, sandbox manifest, and immutable agent-run trace, all bound to the approved blueprint; this day advances from generation into preview interaction and managed app data.

Today’s slice: HelixWorks creates an isolated preview runtime with a revision-bound URL, per-app database and object storage, schema and migration controls, snapshots and reset, then layers independent validation around one stateful Workboard workflow.

End-of-day evidence: A customer can inspect the preview receipt, migration and reset records, browser trace, storage-isolation denials, and validation matrix for the exact revision and environment.

Still unsolved: Salesforce, Snowflake, private connectivity, human identity, sharing, production publication, and fleet operations are not granted or implied.

Customer outcome and implementation focus

The customer outcome is a reliable, reviewable implementation of 03 generated code validation. This day introduces the mechanism before policy detail and evidence review; it does not repeat the same customer stories in prose, tables, and diagrams.

Components in focus

Control-plane service owns desired state; runtime workers own execution; the policy/release boundary owns privileged effects. Compute: isolated service or sandbox tasks. Storage: PostgreSQL owns durable state, Redis is a bounded cache, object storage keeps artifacts/evidence, and queues are delivery buffers rather than authority.

Implement the mechanism

Implement the topic as an owned state transition with a named controller, durable record, bounded worker action, and observable terminal evidence. Verify a denied or failed path before calling the mechanism complete.

One Workboard system from lifecycle to evidence

A preview is not proved by a screenshot: the smallest useful claim is that one approved Workboard revision runs in an isolated environment, preserves only its own managed state, and leaves immutable evidence for success, denial, failure, and recovery. The diagrams below reveal that same system without changing its identifiers or authority model.

Locate today inside the full create-to-retire lifecycle

Optimizing only generation creates an attractive dead end if customers cannot safely publish, change, recover, export, or delete the result. this section therefore keeps the full product lifecycle visible even though today’s implementation and evidence stop at the stateful-preview gate.

Day 03 may produce a release candidate but cannot call it production-ready. Its exit condition is narrower: one source revision is bound immutably to one build, artifact, Software Bill of Materials (SBOM), provenance statement, IaC plan, preview environment, schema, migration lineage, and observed evidence bundle.

The full lifecycle prevents today’s preview evidence from being mistaken for connector, identity, publication, operations, or retirement evidence.

Accept a Day 03 result only as a stateful-preview result; keep every later lifecycle gate visibly open and unclaimed.

Reduce the slice to the smallest complete three-box model

Adding runtime internals before the reader can state the customer claim obscures what must be proved. At minimum, the creator acts through a governed preview control, Workboard changes tenant-scoped managed state, and an independent verifier compares the visible result with authoritative side effects.

This model covers every Day 03 use case without inventing another system: D03-UC-01 admits the revision, D03-UC-02 and D03-UC-03 exercise rows and objects, D03-UC-04 changes schema without losing accepted state, and D03-UC-05 restores or resets only the named environment.

One complete loop connects admission, customer interaction, authoritative state, and independent observation before provider detail appears.

If a proposed check cannot identify the admitted revision, the customer-visible outcome, and the authoritative state observation, it is not an end-to-end preview proof.

Expose trust boundaries and independent revocation

A sandbox product can isolate compute yet still leave application authentication, tenant authorization, data ownership, and evidence correlation to the platform using it, so provider features cannot be treated as compliance conclusions. Expand the three boxes into four independently governed boundaries: provider/control plane, hosted runtime, generated Workboard application, and the connector/source boundary that remains closed today. The provider-neutral control plane owns policy and evidence; a Daytona or Cloudflare adapter supplies only the demonstrated runtime observations it can produce.

BoundaryOwnsMust not implyProvider-neutral verification contract
Coding-agent control planeCustomer organization, prompt, blueprint, source revision, tools, approvals, policy, release decision, evidence indexRuntime isolation, app tenancy, or app-user access automatically passedEvery mutation returns actor, scope, policy, source revision, immutable operation ID, result, and timestamp
Runtime-provider adapterCreate, execute, limit, observe, export, stop, and destroy a sandbox/runtime using opaque provider referencesVendor logs or sandbox creation prove the app is secure or compliantcreate, exec, collect, revoke, and destroy are idempotent; denied egress and cleanup are independently probed
Hosted build/preview boundaryPinned build image, ephemeral workspace, workload identity, network policy, resource budgets, preview processA preview URL grants project or generated-app membershipOnly an admitted digest runs; workload, route, secret handle, expiry, and limits are observable without revealing secret bytes
Generated-application planeApp subjects, tenants, memberships, sessions, records, objects, row predicates, migrationsProvider organization membership or sandbox possession grants app authorizationPositive tenant workflow and same-ID cross-tenant denial both query the app’s authoritative stores
Connector/source boundaryFuture connector versions, source-native grants, private routes, minimized operations, and lineagePreview success grants enterprise-source accessEvery source request is denied today because no connector binding, credential grant, or route exists

Daytona’s current documentation describes organization audit records with actor, action, target, outcome, and time. Its secret substitution can restrict use to allowed hosts, but omitting the host list permits use with any host, so the adapter contract must require an explicit allowlist rather than relying on the default (Daytona audit logs, Daytona secrets). Cloudflare’s Sandbox documentation describes a separate virtual machine per sandbox and also states that application-level authentication remains necessary. Its documented outbound controls require internet access to be disabled and allowed destinations to be admitted through allowedHosts or request handlers; its proxy pattern keeps the real external credential in a Worker and gives the sandbox a short-lived token (Cloudflare Sandbox security model, Cloudflare network policies, Cloudflare proxy requests). These are different adapter capabilities, not parity, certification, or compliance claims.

Revocation is tested as paired controls: stopping the hosted runtime must not delete Workboard state; revoking synthetic Beta must not revoke Alpha or the provider reviewer; deleting a preview route must not create a connector grant; and the unopened source boundary must remain unreachable.

The three-box loop now shows four trust boundaries, their distinct owners, and the negative connector/source boundary that Day 03 must not cross.

Grant and revoke provider, runtime, app-subject, and source authority independently; any token, route, or membership that works across two planes is a boundary failure.

Assign SRP services, authoritative ownership, and one DRY IaC contract

When one service can rewrite source, change policy, build artifacts, provision data, and declare its own success, compromise or error becomes self-approving and evidence loses independence. Single Responsibility Principle (SRP) boundaries separate each decision, while Don’t Repeat Yourself (DRY) means every service consumes one canonical revision manifest rather than copying app, tenant, region, toolchain, and policy values into provider-specific scripts.

ServiceOne responsibilityInput contractOutput contractIndependent denial
Intent controllerBind approved prompt and blueprintSigned IntentRevisionImmutable source_revision requestReject changed prompt, missing approver, or unsupported capability
Source controllerMaterialize source, lockfile, tests, migrations, and IaCIntent digest and base revisionContent-addressed source treeReject path escape, generated secret, mutable dependency range, or unreviewed migration
Build runnerExecute one hermetic build recipeSource digest, lockfile, builder-image digest, command manifestBuild output plus complete step traceReject network access, undeclared input, timeout, or non-zero command
IaC validatorPlan infrastructure without applying itIaC module digest, typed environment parameters, policy bundleNormalized plan digest and policy decisionsReject public exposure, wildcard identity, unencrypted data, unapproved region, or unbounded resource
Artifact attestorPackage and identify accepted bytesBuild output, SBOM, test and policy resultsArtifact digest and signed provenance envelopeRefuse missing material, stale test, digest mismatch, or signer conflict
Preview controllerBind accepted artifact to an expiring environmentArtifact, plan, schema, workload, and audience referencesPreview receipt or unchanged active bindingReject wrong app/environment, expired grant, or unsupported artifact-schema pair
Data lifecycle controllerMigrate, snapshot, restore, reset, and delete scoped app dataEnvironment, migration graph, retention and confirmationAppend-only migration/recovery recordFreeze on checksum, lock, verification, scope, or restore-lineage failure
Evidence ledgerIndex immutable observations without deciding releaseRaw signed records from every ownerReconciled evidence bundle plus gapsReject mutable URI, missing clock, duplicate terminal state, or cross-revision evidence

The canonical manifest is source controlled and typed. Provider adapters translate it but do not redefine it:

revision: rev-3
sourceDigest: sha256:source-example
builderImageDigest: sha256:builder-example
lockfileDigest: sha256:lock-example
iacModuleDigest: sha256:iac-example
policyBundleDigest: sha256:policy-example
schemaDigest: sha256:schema-v2-example
environment:
  class: preview
  region: test-eu
  networkPolicy: deny-by-default
  databaseBinding: db-preview-42
  objectBinding: obj-preview-42

The diagram now opens the three original boxes without changing the customer path. Each arrow carries the canonical revision, app, environment, policy, schema, and evidence identifiers; provider references remain opaque implementation details.

Authoritative ownership remains explicit: the control plane owns prompts, source revisions, artifacts, policies, environment bindings, migration/snapshot records, and evidence indexes; Workboard owns boards, todos, synthetic subjects, tenant memberships, and object metadata; the object service owns bytes inside the app/environment namespace. A preview runtime holds no durable authority merely because it can address those stores.

The boundaries now contain SRP services, named authoritative stores, and one declarative IaC/policy manifest reused by both provider adapters without duplicating security rules.

Put each mutable fact in one authoritative store and each control in one versioned contract; adapters may translate identifiers, never fork policy, ownership, or evidence semantics.

Close positive, denied, failure, and recovery paths with evidence

A digest on the final archive cannot show which source, dependencies, tests, and policies produced it, so the complete system closes every Day 03 path in an append-only, content-addressed chain from source through customer-visible evidence. Any changed byte creates a new node rather than updating a prior record.

Hermetic means the build reads only declared inputs in a clean worker, with a pinned operating-system/build image, toolchain, package manager, lockfile, locale, time zone, and command list. Network is disabled after approved dependency material is staged; caches are either empty or addressed by verified digests. Reproducibility is tested by building the same manifest twice in fresh workers, normalizing declared nondeterministic metadata such as archive timestamps, and comparing artifact and SBOM digests. A mismatch blocks promotion and preserves both outputs plus a diff; it is never averaged away or relabelled flaky.

IaC and policy gatePositive checkDenied or failure checkImmutable evidence
Module reuse and DRYPreview plan instantiates the reviewed app-environment module with typed parametersProvider adapter contains a second hand-written security group, database, or identity policyModule digest, parameter digest, normalized plan, duplicate-resource scan
State and change controlRemote state is encrypted, locked, versioned, and scoped to app/environmentConcurrent plan, unlocked mutation, manual drift, or cross-environment state referenceLock receipt, prior/current state digests, drift report, actor and approval
Identity and secretsWorkload receives expiring handles for exact operations and hostsPlaintext secret, wildcard principal, reusable human credential, or secret in plan/log/sourceSecret scan, policy denial, vault/proxy audit ID, no-secret side-effect probe
Network and exposureDefault-deny egress and an expiring authenticated preview route are explicitMetadata, loopback, arbitrary internet, public database, or unauthenticated sensitive routeResolved-destination probe, zero-byte denial, route and expiry receipt
Data and recoveryDedicated preview database/object bindings, encrypted storage, snapshot, migration lock, and deletion job are plannedShared unrestricted credential, destructive startup migration, missing backup test, or orphaned object namespacePlan/resource IDs, migration and restore runs, cross-environment inventory diff
Resource and region policyCPU, memory, disk, execution time, cost, data location, and retention are boundedMissing quota, unsupported region, infinite retention, or privileged runtimePolicy input/output digests and named blocking rule

The end-to-end (E2E) harness tests the product through its public controls and then inspects authoritative side effects. Every journey records actor, resource, scope, precondition, expected result, observed result, environment, trusted timestamp, and immutable source, trace, run, artifact, policy, and evidence IDs.

JourneyCustomer actionRequired observed pathSide-effect oracleRelease rule
PositiveAlpha launches preview-42, creates and completes a todo, uploads brief.txt, and refreshesBrowser and API return the accepted state under the exact artifact/schema labelAlpha rows and object metadata exist once with expected checksumsPass only if customer-visible and store observations reconcile
DeniedBeta requests Alpha’s same local todo and object identifiers; build worker also probes a forbidden destinationNeutral application denial and egress policy denial occur before sensitive workNo Beta-visible bytes, no row/object mutation, no external connectionPass only with denial plus zero-side-effect evidence
FailureCandidate rev-3-bad fails a test, policy rule, reproducibility comparison, or post-migration assertionCandidate never becomes the active preview bindingPrior artifact/schema remains active; candidate namespace is quarantinedBlock candidate and retain exact failing inputs and outputs
RecoveryOperator restores a validated snapshot into a replacement namespace, then confirms a preview-only resetRestored flow works before switch; reset affects only named previewRecord counts, tenant keys, checksums, object references, and unrelated inventories match expected statePass only if continuity and unaffected positive controls are observed

SandboxAdapter acceptance is intentionally portable: run the same contract corpus against Daytona and Cloudflare, normalize their opaque runtime/log references into the evidence schema, and compare customer-visible and side-effect outcomes. A provider-specific capability may strengthen one implementation, but it cannot waive a missing app-auth test, policy denial, reproducibility result, restore proof, or retention requirement.

The complete system now terminates every permitted, denied, failed, and recovered Workboard journey in independently observed, immutable evidence bound to one revision and environment.

Release the preview claim only when positive state, zero denied side effects, unchanged active state after failure, and scoped recovery all reconcile to the same immutable identifiers; otherwise block and preserve the gap.

Make preview an interactive product boundary

A static render can look correct while buttons, writes, refreshes, and revision changes fail, so customers need a real but non-production place to use the generated app. A preview is a control-plane registration that routes an expiring URL to one app environment and one source revision running in an isolated preview runtime.

The preview gateway validates the preview identifier, expiry, audience policy, and route before forwarding traffic. Possessing a preview URL does not grant project membership, source editing, generated-app membership, another preview, or production access. The companion authorization course configures human application identity; today’s lab uses synthetic preview principals issued only for this isolated environment.

The runtime executes a built artifact for rev-2 with explicit configuration, resource limits, network policy, app-scoped storage bindings, and a short-lived workload identity. It receives secret handles rather than secret values in source or browser code. The preview record names its application, revision, schema version, storage namespace, created time, expiry, owner, and reset policy.

Updating source does not mutate a running preview invisibly. HelixWorks builds a candidate, runs admission checks, records the new artifact digest, then atomically changes the preview binding from rev-2 to rev-3. Failed builds leave the previous preview usable and visible as the active revision.

Give every app and environment separate managed stores

A shared database credential or object prefix can let generated code from one app read another app’s state, turning a preview defect into cross-project exposure. Managed data is therefore provisioned per app and environment with explicit ownership, namespace, policy, quotas, and lifecycle.

The database stores structured domain records and enforces schema constraints and transactions. Object storage stores blobs such as attachments under opaque keys and metadata; generated apps never construct global bucket paths or receive a bucket-wide credential. A broker issues the preview runtime narrowly scoped access to app:workboard/environment:preview, and server-side application policy still decides which domain actor may access a particular record or object.

Data kindAuthority and ownershipPreview lifecycleForbidden shortcut
Project sourceHelixWorks control plane on the customer’s behalfRevisioned independently of app dataTreating source access as row access
Preview databaseGenerated app’s preview environmentMigrated, snapshotted, reset, and deleted by explicit policySharing one unrestricted schema or credential across apps
Preview objectsGenerated app’s preview environmentKey-scoped upload/read, malware scan, retention, resetPublic bucket or predictable cross-app key
Production app dataGenerated app’s future production environmentNot created or mutated todayCopying preview records into production implicitly
Source-system dataExternal authoritative systemNot connected todayCalling a cache or export the new source of truth

Database rows carry the app and domain scope required by the blueprint; object metadata carries app, environment, owning domain record, media type, size, checksum, and scan state. The object becomes visible only after validation and scan policy pass. Deleting a database row does not prove its object, snapshot, or exported copy is gone, so lifecycle jobs and evidence cover each store separately.

Network reachability to a database is not authorization. The runtime needs both an app/environment workload grant and server-side domain policy. Project administrators can reset preview data through the control plane, but that administrative operation does not make them generated-app users.

Treat schema, migrations, snapshots, and reset as different controls

Generated code can expect columns that do not exist or apply a destructive migration that makes an earlier artifact unusable, so data evolution must be ordered and recoverable. A schema defines permitted data shape; a migration is a versioned transition between schemas; a snapshot is a point-in-time recovery copy; reset deliberately returns a preview environment to a declared baseline.

The migration controller, not generated application startup, holds schema-change authority. It checks that the migration ID follows the recorded parent, obtains an environment-scoped lock, captures a pre-change snapshot, applies the migration once using an idempotency key, verifies constraints and representative data, then records the schema digest. Application traffic switches only after compatibility checks pass.

Prefer backward-compatible expansion before contraction: add nullable or defaulted fields, deploy code that understands both versions, backfill with checkpoints, then remove old fields in a later governed change. An artifact rollback and a database rollback are different operations. Restoring old code may not understand a new schema, while reversing a migration may lose accepted writes; the preview controller must state which artifact-schema pairs are compatible.

A snapshot is not a backup claim until restore is tested. Restore into a replacement namespace, verify record counts, checksums, constraints, object references, and isolation, then switch the preview binding. Reset is intentionally destructive to preview data and requires a confirmation showing the exact app, environment, target seed, snapshot policy, and consequence. It never touches production or source-system data.

Rebuild without hiding state or revision changes

An automatic rebuild can silently pair new code with old assumptions or erase customer-created fixtures, making failures impossible to reproduce. The preview loop keeps source revision, artifact digest, schema version, and data namespace visible as separate bindings.

When the customer requests a change, HelixWorks creates rev-3-draft in the project and runs the bounded Day 02 agent workflow. A successful build creates a candidate artifact; static and migration-plan gates run before any data change. If the change needs m002, the controller snapshots, migrates, verifies, then changes the preview binding. The customer sees a short maintenance state rather than requests split across incompatible versions.

Preserving state is a policy choice, not a default promise. A compatible revision reuses the current preview data namespace. A reset-required revision explains why and offers an export or snapshot according to policy. A fork creates a new namespace from an approved snapshot so experiments cannot mutate the original preview.

Each visible preview page should expose a non-secret build label such as preview-42 / rev-3 / schema-v2. A customer report can then name the exact state. Cache keys include preview, artifact, and schema compatibility identifiers so an old response cannot masquerade as the new revision.

Complete one stateful Workboard preview lab

Separate demonstrations of rendering, persistence, migration, and reset can all pass while their composition fails, so the primary lab crosses those seams in one customer workflow. It uses only synthetic Workboard principals and data; identity federation and production access remain out of scope.

  1. Create preview preview-42 from rev-2, verify its receipt binds Workboard, the preview environment, artifact digest, schema v1, database namespace, object namespace, expiry, and runtime policy.
  2. Open the URL as synthetic Alpha editor, create “Prepare launch notes,” attach brief.txt, mark the todo complete, refresh the browser, and verify record plus attachment persist.
  3. Open a synthetic Beta-scoped request for the Alpha todo and object key. Require a neutral denial, unchanged row and object state, and no existence leak.
  4. Request the blueprint-compatible change “add optional completion note.” Generate rev-3, inspect migration m002, capture a snapshot, migrate, and atomically update the preview.
  5. Verify the original completed todo and attachment remain visible; add a completion note; confirm schema-v2 and rev-3 are displayed.
  6. Inject a failing migration verification in a disposable fork. Require the original preview binding and data to remain intact and record the replacement-store restore result.
  7. Reset preview-42 to the approved seed after explicit confirmation. Verify user-created rows and objects are removed only from that preview and the schema remains at the declared baseline version.
Lab assertionExpected oracle
Stateful refreshIndependent database query plus browser-visible completed state
Attachment isolationObject broker denial, no bytes returned, unchanged metadata
Revision migrationMigration ledger, before/after data comparison, active binding receipt
Failed candidateOld revision remains served; replacement namespace quarantined
ResetDatabase and object inventories match seed; other app namespaces unchanged

The lab passes only when the customer can use the flow and an independent harness can verify data state. A browser screenshot without database, object, revision, and migration evidence fails.

Layer validation around the interactive workflow

A successful browser path can coexist with unsafe queries, inaccessible controls, visual breakage, or unacceptable latency, so one end-to-end test cannot carry the whole assurance claim. A validation matrix maps each blueprint criterion to independent gates whose different strengths cover static source, domain logic, real boundaries, user interaction, and quality budgets.

Run cheap deterministic gates first. Pin the package manager, lockfile, runtime image, commands, and clean-workspace requirement. Unit tests exercise state transitions, roles, idempotency, and property-generated sequences with recorded seeds and smallest failing inputs. Integration tests use the production-equivalent database engine, real migrations, object broker, transactions, and Alpha/Beta same-local-ID fixtures.

Browser tests select controls by accessible role and name, wait for named visible or network state rather than sleeps, and capture trace, console, failed requests, screenshot states, browser version, and accessibility tree. Hiding a button is not authorization, so direct API and object calls prove denial with no mutation. Visual baselines cover empty, populated, validation-error, narrow, and zoomed states under pinned rendering conditions.

Target Web Content Accessibility Guidelines (WCAG) 2.2 Level AA where applicable, combining automated rules with keyboard, focus, reflow, status-announcement, and assistive-technology checks. Performance evidence names dataset, request mix, concurrency, geography, database tier, cache state, warm-up, browser profile, percentiles, errors, throughput, and asset budgets. A skipped, stale, flaky, or wrong-revision gate is not-run or failed evidence, never an inferred pass.

CriterionStatic/unitIntegrationBrowser/qualityNegative proof
WB-TODO-001Title, transition, retry propertiesAPI, transaction, tenant keyCreate, complete, refresh, keyboard statusBeta same-ID denial and no mutation
WB-OBJ-001Type and size rulesObject key, checksum, scan stateUpload and download by accessible nameCross-app key and executable content denied
WB-MIG-002Migration graph and compatibilitySnapshot, apply-once, data comparisonRevision/schema label and preserved flowFailed candidate cannot switch binding
Preview resetConfirmation schemaApp/environment inventory comparisonVisible seed stateOther preview and production untouched

Challenge managed-data invariants across archetypes

Workboard alone may hide storage assumptions that fail for analytical reads or untrusted public writes, so bounded reference probes challenge the shared platform mechanisms. They are not additional full labs and do not claim every archetype is implemented.

ArchetypeDatabase needObject needSchema/reset falsifier
WorkboardTenant-scoped transactional todosBoard attachmentsMigration preserves tenant keys; reset affects one preview only
Revenue dashboardApp-owned cache, metric definitions, lineage pointersApproved export artifacts if enabledCache schema never becomes source authority; refresh/reset retains lineage
Public intakeAppend-only submissions and moderation stateUntrusted uploads quarantined until scanAnonymous write grants no list/read; reset deletes preview objects and records together

For the dashboard, Salesforce or Snowflake data is not connected until Day 04; fixtures stand in for source responses. For public intake, the runtime gets an upload operation restricted by app, environment, object prefix, media type, size, count, and expiry. Any cross-app read, public listing, or orphaned reset artifact falsifies the shared invariant.

Record evidence at the resource and environment scope

Preview evidence can become dangerous if a result for one revision, actor, or namespace is reused for another, so every material observation carries enough context to reject mismatches. Store immutable raw artifacts separately from the append-only index.

FieldExample
Actor / resource / scopesynthetic:alpha-editor / todo:alpha/launch-notes / app:workboard environment:preview tenant:alpha
Preconditionpreview-42 serves rev-3, schema v2, fixture set seed-7
ExpectedTodo and attachment persist; Beta receives neutral denial with no mutation
ObservedRefresh succeeded; database and object assertions passed; Beta denied
Immutable trace/run/artifact IDtrace://browser/p42-81, run://validation/val-203, artifact://db-check/sha256:example
Timestamp2026-07-28T14:09:12Z from trusted validation clock
Environmentpreview-42, runtime image and browser digests, region test-eu

Also bind the project, app, preview, source revision, artifact, schema, migration, snapshot, policy, gate, result, and gap status. Evidence about preview data does not become evidence about production or source-system data merely because identifiers resemble one another.

Further reading

Validation and data controls drift into folklore when teams cite generic best practices, so reviewable criteria should point to versioned primary standards. These official sources anchor security, accessibility, and secure-development claims while leaving application-specific threat analysis explicit.

Key takeaways

Managed preview architecture contains many moving parts, and customers need the few governing distinctions kept visible. Carry these rules forward before any enterprise source is connected.

  • A preview is a revision-bound non-production endpoint, while a runtime is the isolated compute that serves it.
  • Per-app, per-environment database and object grants prevent ambient cross-project data access.
  • Schema migration, artifact rollout, snapshot restore, and destructive reset are separate controlled operations.
  • One stateful Workboard lab proves interaction, persistence, revision, isolation, migration, and reset composition.
  • Layered gates make bounded claims; missing, stale, skipped, or flaky evidence cannot be called a pass.

Checklist

A preview can appear functional while its revision, data, or recovery boundary is wrong, so completion requires both customer interaction and independent state evidence. Every checked item should identify the exact preview environment.

  • [ ] The preview receipt binds app, revision, artifact, schema, stores, policy, owner, and expiry.
  • [ ] Preview-link, project, runtime, app, connector, and production authority remain distinct.
  • [ ] Database and object access are scoped per app and environment with no ambient credential.
  • [ ] The Workboard flow persists across refresh and a compatible revision.
  • [ ] Alpha/Beta and cross-app database and object denials prove no read, write, or existence leak.
  • [ ] Migration is locked, apply-once, snapshotted, verified, and compatibility-checked.
  • [ ] Failed candidate rollout leaves the active preview and original data intact.
  • [ ] Reset names its destructive scope and proves other environments are unchanged.
  • [ ] Validation spans static, unit/property, integration, browser, accessibility, visual, performance, and abuse evidence.
  • [ ] Evidence rows contain actor/resource/scope, precondition, expected, observed, immutable IDs, timestamp, and environment.

HelixWorks repository lab

Before adding a preview database, prove the smallest tenant-scoped storage rule in in-memory-blueprints.ts. Northstar's supplier-onboarding records must never be addressable through another organization's key.

public find(
  tenantId: TenantId,
  id: BlueprintId,
  version: number,
): Promise<ApprovedBlueprint | null> {
  return Promise.resolve(this.#records.get(`${tenantId}:${id}:${version}`) ?? null);
}

public async commit(blueprint: ApprovedBlueprint, event: BlueprintApprovedV1): Promise<void> {
  const key = `${blueprint.tenantId}:${blueprint.blueprintId}:${blueprint.version}`;
  if (this.#records.has(key)) {
    throw new BlueprintConflictError('Blueprint version is immutable');
  }
  await this.outbox.append({
    id: event.eventId,
    tenantId: event.tenantId,
    event,
    createdAt: blueprint.approvedAt,
    publishedAt: null,
    attempts: 0,
  });
  this.#records.set(key, blueprint);
}

The code declares two invariants: every lookup includes the tenant, and an approved version is insert-only. The repository adapter interprets those rules and changes its record map plus outbox. Locally that is RAM; a durable adapter must enforce equivalent composite keys and transactionality on database CPU, memory, disk, and network. A successful same-tenant read, a null cross-tenant read, and an immutable-version conflict are evidence.

SRP keeps storage mechanics out of the blueprint domain. DRY reuses tenant and blueprint ID types. IoC/DI lets the same application service receive an in-memory test adapter or PostgreSQL adapter. MVC prevents UI state from becoming authority. PubSub gets its event from the same unit of work; IaC supplies isolated environment databases and encryption. The rule is portable even when the mechanism changes.

pnpm vitest run services/control-plane/src/control-plane.test.ts
pnpm smoke:product

Attempt a read with a different tenant, commit the same version twice, and simulate an outbox failure. Passing evidence means no record crosses the tenant key, duplicates conflict, and a failed event append leaves no approved record. This is a foundational storage proof, not a claim that the current monorepo already supplies the preview runtime, migration engine, object scanner, or restore workflow described earlier in the lesson.