Skip to content

W7-P delta: production gateway and strict Flue artifact boundary - #513

Merged
ZIJ merged 2 commits into
flue-nativefrom
delta/agent-worker-production-plane
Jul 13, 2026
Merged

W7-P delta: production gateway and strict Flue artifact boundary#513
ZIJ merged 2 commits into
flue-nativefrom
delta/agent-worker-production-plane

Conversation

@ZIJ

@ZIJ ZIJ commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review unit

This is the opencomputer W7-P delta against the existing flue-native evergreen. It owns the CLI artifact boundary and the permanent managed-model gateway.

The evergreen base has been advanced through the requested latest-main reconciliation. This PR contains the focused implementation commit 5c465a6 plus the round-2 review closure 7a284e4; its head is the exact code tested below.

No production resources, configuration, or secrets have been changed by this PR.

Why

The real Flue build emits a noisy Wrangler resolution object containing local paths and capabilities the platform neither needs nor wants to accept. At the same time, the W6 gateway still carried acceptance-rig naming and fallback configuration. This delta makes both boundaries explicit before the permanent production topology is provisioned.

What changed

  • Extracts a strict, canonical flue_wrangler descriptor instead of forwarding the raw build-generated Wrangler object.
  • Builds a module-only archive from regular relative .js/.mjs files; ignores only known Wrangler metadata, .vite/**, and source maps, while rejecting symlinks, special files, and every unexpected regular file instead of silently shipping a broken Worker. Legitimate .flue-vite modules remain included.
  • Adds a realistic noisy-build fixture proving absolute build paths, vars, migrations, routes, services, and unrelated Wrangler capabilities cannot enter the request or tarball.
  • Renames the shared gateway package/service to oc-agent-gateway and pins the explicit production Worker identity to oc-agent-gateway-prod; default deployment is non-production/fail-closed.
  • Uses fresh production Durable Object bindings/migrations and the exact production org-key endpoint.
  • Deletes TEST_OR_KEY from the gateway contract entirely, so tests and production both fail closed through the same org-scoped key seam; also removes budget-default behavior from production.
  • Enforces canonical bare lowercase UUID org claims and exact agt_[0-9a-f]{24} agent identity at the gateway boundary.
  • Adds a contract test for the gateway org-key request body expected by sessions-api.

Invariants to review closely

  • The CLI is only an early validator. sessions-api independently validates the descriptor and archive before upload.
  • Build-provided values cannot select script name, namespace, routes, bindings, migrations, vars/secrets, or compatibility behavior.
  • flue remains where it describes the runtime/adapter contract; it does not name the permanent gateway or platform topology.
  • Existing gateway token key setting names are retained; this is not a broad unrelated naming migration.
  • Production gateway identity is exact, and there is no single-key fallback in code.
  • Exact compatibility date/flags and FLUE_REGISTRYFlueRegistry remain intentional Flue ABI conformance gates. A real beta.9 build was checked under Node 22.19 and matches them; a runtime bump must update the reviewed profile rather than silently widening it.

Round-2 review closure

  • Accepted: remove the gateway test-key escape hatch and fail loudly on unexpected build artifacts.
  • Verified: the real pinned starter build emits only .js runtime modules plus the known ignored Wrangler/Vite/source-map metadata.
  • Intentionally retained: strict lowercase bare-UUID and canonical agt_* identity, and the exact Flue compatibility/registry ABI pins.
  • Not pulled into this PR: unrelated web mock-id cleanup and broader token/config renames.

Deliberately not added

  • No arbitrary Wrangler passthrough or wider runtime capability surface.
  • No second billing system; the gateway continues to use the existing managed OpenRouter/Autumn path.
  • No token scope matrix, per-session sandbox redesign, or automatic tenant-script rollback.
  • No custom domain in this slice; the initial production coordinate remains the exact Worker URL specified by W7-P.

Verification

  • Gateway suite: 36 tests green under Node 22.19.
  • Gateway TypeScript typecheck: green.
  • Go CLI command tests, including the noisy artifact fixture: green.
  • Production Wrangler dry-run under Node 22.19: green.

Cutover contract

This PR is one side of a coordinated maintenance cutover; it does not provide a mixed-version compatibility window. The old and new gateway/token/header contracts must not be deployed out of order. The runbook requires dark Worker provisioning, a frozen intake window, the sessions-api switch, and redeploy of every retained agent before traffic reopens. W6 Durable Object state is not migrated across namespaces; surviving session state aborts the cutover.

Cross-repo contract

Companion deltas: sessions-api #74 and oc-runtimes #8. The complete contract, review acknowledgements, rollout order, rollback coordinates, and acceptance matrix live in W7-P of working doc 022.

@2027-evals

2027-evals Bot commented Jul 13, 2026

Copy link
Copy Markdown

⚠️ Couldn't find a preview deployment for commit 7a284e4 after 10 minutes.

2027 auto-runs evals against preview deployments of your docs. To enable this, install one of:

  • Mintlify — if you use Mintlify docs
  • Vercel — for Next.js / static sites
  • Netlify — for most static docs

Once a preview is deployed, open a new PR and we'll run the eval automatically.


Evaluating agent experience using 2027.dev · View dashboard

@ZIJ
ZIJ merged commit f0b769f into flue-native Jul 13, 2026
3 checks passed
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