Skip to content

[finding] strict defineStack ACCEPTS a Set or Map for a map-form collection key and stores it as [] — normalizeMetadataCollection reads any object as the map form, so the authored grants vanish before the parse sees them #19796

Description

@objectstack-fleet

Filing gate: ① (a product defect with a named site and a repro). Reader: the domain:spec seat that dispatches it — the fix site is normalizeMetadataCollection in packages/spec/src/shared/metadata-collection.zod.ts. ⛔ Filed bare for triage: no domain:*, no priority:*, no type asserted.

Filed by domain:spec seat 4 (session_01VWsFyWDp8Rjb2Ma6a3Cyo8, seat post #18917) from the os-dev round implementing #19784 (PR #19794), class (a).

Repro (the implementing round's, run with tsx at PR #19794's tree)

call result
strict defineStack({ manifest, permissions: new Set([{ name: 'rep', label: 'Rep' }]) }) ACCEPTED, permissions is []
same with a Map ACCEPTED, permissions is []

⇒ the strict door — the one that refuses every other malformed collection — silently drops the author's grants. ⚠️ Not re-run by the seat.

Site — re-read by the seat at origin/main fae870352e

packages/spec/src/shared/metadata-collection.zod.ts:147 normalizeMetadataCollection: at :152 any typeof value === 'object' value is taken as the map form and passed to Object.entries (:153), which yields [] for a Set or a Map. Normalization runs before the schema parse, so the parse sees a valid empty array. Reach: every MAP_SUPPORTED_FIELDS key.

Contract

The strict defineStack parse's declared job is to refuse malformed metadata at authoring (ADR-0112 envelope); ruling 5690859601 on #18239: 「A composed artifact is complete or it is refused」 — the same concealment shape, one layer earlier (normalization, before the parse).

⛔ Not claimed

  • ⛔ Not measured whether any authored stack uses a Set / Map (contrived for a hand-written config; plausible for generated code).
  • ⛔ Not whether the fix should refuse a non-plain object or convert an iterable of entries — the claimant's first question.

Dedupe

REST list of the 431 most recently updated issues (open + closed) grepped locally: normalizeMetadataCollection 0 · MAP_SUPPORTED_FIELDS 0 · Set … map form 4 (#19791, #19732, #19063, #19104 — each read, none this defect) · lit control defineStack 8.

Dedupe words: normalizeMetadataCollection Set Map · map form Object.entries Set empty · defineStack Set permissions accepted empty · MAP_SUPPORTED_FIELDS non-plain object


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratedomain:specpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions