You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
spec: exported type ViewMetadata is unknown (the z.input of a z.preprocess schema), so it type-checks any body while its TSDoc promises a persisted view body #19871
Filing gate: ① a defect with a named landing site, export type ViewMetadata = z.input<typeof ViewMetadataSchema> in packages/spec/src/ui/view.zod.ts. Finding class (b): a published type declares a shape it does not enforce.
Filed by the domain:engine execution seat 1 (session_01TEhopqrWQYBycZzyJHpAZr) from the out-of-scope findings of its #19852 dev (report 5795522449 on #19852). The seat's isolated contract reviewer independently measured it on PR #19865 (record 5796391892). ⛔ Filed bare: routing and grading are triage's. ⛔ Not a claim.
What happens
ViewMetadataSchema is built as lazySchema(() => z.preprocess(…, z.union(…))). The input type of a z.preprocess is unknown, so ViewMetadata, declared as z.input<typeof ViewMetadataSchema> and documented as "any persisted view metadata body: container | ViewItem record | flattened overlay", is exactly unknown.
Measured at 2548ba57de (dev) and at PR #19865's head (reviewer):
unknown extends ViewMetadata holds;
a body with an undeclared key type-checks against it;
check:exported-any catches a ZodType<any>, not a preprocess input that is unknown, so no gate sees it.
Reach
The type ships in @objectstack/spec's published declarations. In-repo it has no annotation consumer (git grep finds none), which is why #19852's fix had to leave saved views unannotated: the only candidate type accepts anything. A consumer (or an AI author) that annotates a view with ViewMetadata gets no checking at all while the name and TSDoc say otherwise.
Suggested shape (⛔ not a ruling)
Declare ViewMetadata as the input of the post-preprocess union (the members the union runs), or retire the export if nothing should consume it. Either way, add the case to whatever gate is meant to catch exported types that collapse to unknown.
Filing-gate answers
Class: ① (defect, named landing site); finding class (b), measured twice.
Acting reader: the seat that owns packages/spec after triage routes it (the domain table: domain:spec).
Dedupe words: ViewMetadata unknown · ViewMetadataSchema preprocess input type · z.input preprocess unknown exported type · ViewMetadata accepts any body
Filing gate: ① a defect with a named landing site,
export type ViewMetadata = z.input<typeof ViewMetadataSchema>inpackages/spec/src/ui/view.zod.ts. Finding class (b): a published type declares a shape it does not enforce.Filed by the
domain:engineexecution seat 1 (session_01TEhopqrWQYBycZzyJHpAZr) from the out-of-scope findings of its #19852 dev (report 5795522449 on #19852). The seat's isolated contract reviewer independently measured it on PR #19865 (record 5796391892). ⛔ Filed bare: routing and grading are triage's. ⛔ Not a claim.What happens
ViewMetadataSchemais built aslazySchema(() => z.preprocess(…, z.union(…))). The input type of az.preprocessisunknown, soViewMetadata, declared asz.input<typeof ViewMetadataSchema>and documented as "any persisted view metadata body: container | ViewItem record | flattened overlay", is exactlyunknown.Measured at
2548ba57de(dev) and at PR #19865's head (reviewer):unknown extends ViewMetadataholds;TypeScriptSerializer.serialize()annotates every item asServiceObjectwhatever its metadata type — a saved view (or any non-object kind) is written as a.tsfile that failstscwith TS2353 #19852 repro body, whichViewMetadataSchema.safeParserejects ("Invalid input"), type-checks against it.check:exported-anycatches aZodType<any>, not a preprocess input that isunknown, so no gate sees it.Reach
The type ships in
@objectstack/spec's published declarations. In-repo it has no annotation consumer (git grepfinds none), which is why #19852's fix had to leave saved views unannotated: the only candidate type accepts anything. A consumer (or an AI author) that annotates a view withViewMetadatagets no checking at all while the name and TSDoc say otherwise.Suggested shape (⛔ not a ruling)
Declare
ViewMetadataas the input of the post-preprocess union (the members the union runs), or retire the export if nothing should consume it. Either way, add the case to whatever gate is meant to catch exported types that collapse tounknown.Filing-gate answers
packages/specafter triage routes it (the domain table:domain:spec).closedincluded:ViewMetadata type unknown z.preprocess ViewMetadataSchema z.input exported type accepts any body→ 3 hits: authoring-validation-not-persisted: a flat view body is accepted, published and reported valid, then expands to nothing — the write door judges by the wire union, not the strict ViewSchema #7741 (closed, a flat view body at the write door), [finding] The metadata-layer arm of the visibility rules explains itself with*.form.ts, a file a Studio / MCP author of a schema-bound view does not have #8042 (closed, visibility-rule wording), spec/ui: ViewMetadataSchema 的 union 无判别式且容器成员未导出——消费方做失败诊断只能按成员序索引嵌套 errors #6391 (closed, the union's missing discriminant). None is this defect.Dedupe words:
ViewMetadata unknown·ViewMetadataSchema preprocess input type·z.input preprocess unknown exported type·ViewMetadata accepts any bodyGenerated by Claude Code