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/inventorydefines aDeviceSchema+Devicetype 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 aschemas.tsso the entrypoint exports onlymodel.@stateless/proxmoxalready 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)
- Make "No slow types" advisory (shown, not scored) for model extensions; or
- Scope the lint to the
modelexport — requireexport const modelto be fast-typed, but don't penalize co-located Zod schema /z.inferexports; or - Exempt schema /
z.inferexports 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.
Shipped
Click a lifecycle step above to view its details.
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.