Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLI
Assigneesstack72

Relationships

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

Opened by stateless · 6/6/2026· Shipped 6/8/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+ 1 MOREASSIGNED+ 5 MOREFINDINGS+ 3 MOREPR_MERGED+ 1 MORECONTRIBUTOR_NOTIFIED

Shipped

6/8/2026, 6:39:47 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack726/8/2026, 4:12:31 PM
Editable. Press Enter to edit.

stack72 commented 6/8/2026, 6:39:56 PM

Thanks @stateless for reporting this! The fix has been merged and a release is on its way. We appreciate your contribution to swamp.

Sign in to post a ripple.