Skip to content

WP-O2b: origin derivation (no live tag touched) #2817

Description

@byteclimber

Part of the origin-dimension implementation plan: adobe/serenity-docs#46 (branch feat/origin_source).

Touches no tag tree, no live data. May share WP-O2a's PR or follow it.

  • handlers/prompts.js:384: generalize makeTypeInjector to strip+inject type and origin, with create/update asymmetry — create injects derived value, update re-injects the stored origin and never re-derives. Strip by resolved tag id beneath the root, never by name.
  • prompts-storage.js:792 upsertPrompts: write the origin derived from the request's principal — service principal: asserted body value, validated; user principal: always human, body ignored.
  • prompts-storage.js:1006-1007 updatePromptById: stop patching origin from the body.
  • prompts-storage.js:408 mapRowToPrompt: return row.origin directly, drop the || 'human' fallback (zero NULLs in prod, spec §2.3 — the fallback would now silently mislabel).
  • src/controllers/brands.js: createPromptsByBrand derives origin from principal. Origin query filter/sort key stay.
  • docs/openapi/schemas.yaml / prompts-v2-api.yaml: origin stays on V2PromptInput/V2Prompt, re-documented as service-principal-only; PATCH body no longer honours it.
  • No change needed in llmo-data-retrieval-service — its V2Prompt model pins origin: Literal["ai"] and POSTs as a service principal; that stays correct.

Exit: unit + it-postgres integration green. Spec gates 5,6,7,8 land here.

Blocked on the tag-vs-metadata product decision.

Jira: SITES-48002

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