adobe / adobe/spacecat-api-service
WP-O2a: tolerant resolver (origin/source) + root rename
- Dominant language
- JavaScript
- Stars
- 10
- Forks
- 15
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 150
Description
Part of the origin-dimension implementation plan: adobe/serenity-docs#46 (branch `feat/origin_source`). Parent WP2 shipped in #2788.
The tolerant resolver is the safety property the whole program rests on: any reader that doesn't find `origin` but finds `source` must reuse it, never mint a second root.
- `src/support/serenity/prompt-tags.js`: `DIMENSION.SOURCE`→`DIMENSION.ORIGIN` (`:43`), `DIMENSION_ROOT_NAMES` (`:51`), `SOURCE_VALUE`→`ORIGIN_VALUE` (`:56`), `CLOSED_DIMENSION_VALUES`/`CLOSED_DIMENSIONS` (`:101`,`:108`), `STANDARD_PROMPT_TAG_VALUES` (`:123`,`:133`).
- `src/support/serenity/tag-tree.js`: give the authorship root its own resolver — prefer root named `origin`; else root named `source` whose children ⊆ `{ai,human}`; create `origin` only if neither exists. Applies to `ensureDimensionRoots` (`:224`), `provisionDimensionTree` (`:442`), `ensureClosedValue` (`:475`).
- `src/support/serenity/handlers/tags.js`: `parseCreateTagBody` validates against `origin`, not `source`, from this PR onward.
- `markets-subworkspace.js:446`: new projects provisioned with `origin` from deploy onward.
- `brand-provisioning.js`, `src/controllers/serenity.js`: follow the constant.
- Fixtures/integration tests move to WP-O1's new ids. Spec gate 3 lands here.
- **`src/support/elements/**` deliberately excluded** — `topics.js:135` `transformOriginsToFilterDimensions()` still parses `source:` prefix. If Elements reads the AIO tag tree directly, its filters are already broken in prod on the 35 reshaped projects (spec gate 9) — that's triage, not part of this task.
Blocked on the tag-vs-metadata product decision.
Jira: SITES-48001
Contributor guide
Research direction
Resolve the blocked tag-vs-metadata product decision first, then read the resolver paths in src/support/serenity/tag-tree.js and the constants and handlers listed in src/support/serenity/prompt-tags.js and src/support/serenity/handlers/tags.js. Update provisioning callers and fixtures/integration tests for the origin ids, verify spec gate 3, and confirm readers reuse a source root rather than minting a second root; leave src/support/elements/** out of scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100