Skip to main content
← Back to list
01Issue
FeatureOpenSwamp CLI
AssigneesNone

Relationships

#572 Quality rubric: scope "No slow types" for model extensions (consumed via model+CEL, not type imports)

Opened by stateless · 6/6/2026

Problem

The extension quality scorecard includes a "No slow types" factor (backed by deno doc --lint). It flags exported Zod schemas (z.object(...)) and z.infer<> types on a model extension's entrypoint as "slow types."

That rule is a JSR / type-library heuristic — it optimizes for downstream code importing your TypeScript types. swamp model extensions aren't consumed that way:

  • The runtime loads export const model.
  • Dependent extensions compose via CEL data references (data.latest("<model>", "<data>").attributes…), not by importing each other's TS types.

So the factor checks a consumption mode swamp doesn't use, and its incentive points the wrong way for foundational / composable extensions: to earn the point, authors must stop exporting their schemas/types from the entrypoint (relocate them to a sibling module, imported-not-re-exported). That nudges away from exposing reusable schemas — the opposite of what a composable primitive wants.

Concrete example

  • @stateless/inventory defines a DeviceSchema + Device type a consumer or test might reasonably want type-safely. Exporting them from the entrypoint fails "No slow types"; earning the point required moving them into a schemas.ts so the entrypoint exports only model.
  • @stateless/proxmox already follows this "hide schemas from the entrypoint" shape.

The workaround is benign and the factor is non-blocking (1 scorecard point) — but the rubric is rewarding a tooling artifact rather than a design improvement.

Proposed solution (any one)

  1. Make "No slow types" advisory (shown, not scored) for model extensions; or
  2. Scope the lint to the model export — require export const model to be fast-typed, but don't penalize co-located Zod schema / z.infer exports; or
  3. Exempt schema / z.infer exports from the factor for model files, since they aren't part of the type-import surface swamp consumes.

Why it matters

swamp's composition model is data/CEL-based, not TS-type-based. The rubric should reward exposing reusable schemas (better DX for consumers and tests), not nudge authors to bury them to chase a point that reflects a JSR concern rather than a swamp one. This is incentive alignment, not a broken gate — the factor is non-blocking today.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

6/6/2026, 3:43:07 AM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.