Skip to content

Phantom Service Bindings

Phantom Service Bindings Linter (PHANTOM_SERVICE_BINDINGS.md)

1. Objective & Architectural Intent

Implemented in packages/governance/src/cli/linters/phantom-service-bindings.ts, this linter audits Worker configuration files (wrangler.jsonc) across all client applications and services.

In a multi-worker edge topology (MULTI_WORKER_PLATFORM_SERVICES.md), client frontends connect to platform services (such as services/critique or services/inquiries) via Service Bindings. This linter detects “phantom” service bindings—bindings declared in application code or configuration that do not correspond to an actual registered, deployable service isolate in the monorepo—preventing runtime deploy failures on Cloudflare Workers.


2. Invariants Enforced

Rule ID Severity Invariant Enforced Remediation
arch/no-phantom-service-bindings Error Every declared Worker service binding in wrangler.jsonc must resolve to an existing workspace service in services/* or a recognized mock service. Ensure the target service exists or remove the stale binding definition.
arch/warn-unused-service-bindings Warn Detects configured service bindings that are never invoked in application source code. Clean up unnecessary bindings to reduce cold-start isolate configuration overhead.

Decisions Intentionally Deferred

  • Cross-zone external service binding validation (connecting to Workers in external Cloudflare accounts) is deferred.