Skip to content

defineMapping artifacts are registered but never consumed — wire named mappings into REST import or de-scope from the stack #2611

Description

@os-zhuang

defineMapping / the stack mappings: collection is registered as metadata (engine metadataArrayKeys, packages/metadata/src/plugin.ts), but no runtime consumer resolves a named mapping: the REST import path (packages/rest/src/rest-server.ts, data-import handler) only accepts an inline per-request mapping body param — it never looks up a registered mapping artifact by name.

So a defineMapping entry in an app stack is inert: it parses, registers, and does nothing.

Found while upgrading the showcase to a registry-driven coverage manifest. Per Prime Directive #10 the showcase must not demo inert capabilities, so mappings is recorded as an explicit waiver in STACK_COLLECTION_COVERAGE (examples/app-showcase/src/coverage.ts) pointing at this issue. (app-crm does ship a defineMapping example — examples/app-crm/src/data/crm-mappings.ts — which today is declared-but-not-enforced.)

Resolution options:

  1. Wire it: let the REST import/export endpoints accept mappingName and resolve the registered artifact (contract-first: the artifact becomes the source of truth, inline stays as an escape hatch), or
  2. De-scope: drop mappings from the stack schema until there is a consumer, and migrate app-crm's example.

Once either lands, flip the showcase waiver to demonstrated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions