Skip to content

refactor: rename marketplace/mp identifiers to kb - #79

Merged
oto-macenauer-absa merged 4 commits into
masterfrom
chore/kb-identifier-rename
Sep 4, 2026
Merged

refactor: rename marketplace/mp identifiers to kb#79
oto-macenauer-absa merged 4 commits into
masterfrom
chore/kb-identifier-rename

Conversation

@oto-macenauer-absa

Copy link
Copy Markdown
Collaborator

Closes #77. First of the pre-production contract changes tracked in #73, done first and on its own so the behavioural work in #74 and #75 lands as a readable diff instead of drowning in rename churn.

What changed

Old New
data-mp-headless data-kb-headless
.mp-* / #mp-* (doc, masthead, card, tag, code, anchor, chrome, single-page) .kb-* / #kb-*
MP_HEADLESS KB_HEADLESS
src/styles/marketplace.css src/styles/knowledge-base.css
marketplaceCssHref kbCssHref
"marketplace" in prose "knowledge base"

Hard cut, no compatibility shim, as the issue specifies: nothing is in production, and the only producer of single-page HTML is this repo's own action.

A stale artifact is still diagnosable rather than silently mis-read. scripts/fetch-apps.js now distinguishes the two failure modes it used to collapse into one warning:

  • carries data-mp-headless → "produced against the pre-rename contract, republish with a current action"
  • carries neither → the existing "missing the marker, build with --headless"

Deliberately not renamed

marketplace.json and marketplaceVersion. Both are artifact wire format, and #74 replaces them with a differently shaped kb-docs.json (kbVersion + apps[]). Renaming them here would regenerate every fixture twice and leave the new name briefly meaning the old shape. So git grep -i marketplace is not empty yet — it returns only those two tokens (47 + 14 occurrences), and emptying it is a #74 done-criterion. Flagged on the issue.

The example repo's own identifiers inside the vendored tarball. Only data-mp-headless is rewritten in there, because that attribute is the contract between the artifact and this repo. Its class names and theme key belong to knowledge-base-docs-example and move in AbsaOSS/knowledge-base-docs-example#3.

Two things found on the way

A contract line documenting a variable that does not exist. HEADLESS_RULES.md told apps their sidebar offset would be reset to var(--mp-chrome-h) "via injected CSS". Nothing has defined or injected that variable since the fixed chrome bar was removed — it appears in no source file, only in that sentence. Renaming it would have invented a variable rather than documented one, so the row now says what actually happens: nothing is reserved above the content. The theme-toggle row lost a dangling reference to the same removed chrome.

The vendored fixture is not marked headless at all. Its HTML is plain <html lang="en">; the only occurrence of the marker in the whole tarball was an attribute selector in dist/docs/style.css. That selector is rewritten so the rule still fires against what Base.astro now emits. Worth knowing: no test covers the fetch-time marker check, because prebuilt artifacts never reach it. That gap closes in #75, which puts every source on one install path.

Fixtures

  • tests/fixtures/single-page-bundle/ regenerated from scripts/setup-test-apps.mjs (it renders through the action's template.js, so the fixture cannot drift from real output).
  • tests/fixtures/docs-example.dist.tar.gz extracted, marker rewritten, repacked with --sort=name and a fixed mtime. Member list verified byte-for-byte identical to the original.

Verification

Suite Result
npm test (embedded web-fragment harness) 85 passed
playwright.config.ci.js (standalone fragment server) 22 passed
publish-single-page-docs self-test 18 passed
npm run build:headless 8 apps, 19 pages

Not run locally: test:container (needs Docker) — CI's image job covers it. nginx.conf and Dockerfile turned out to need no change; neither mentioned the old name.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PYtmxSeSXFg4wEXRcKCmAi

@oto-macenauer-absa

Copy link
Copy Markdown
Collaborator Author

CI status: every job passes except npm audit, which fails for reasons unrelated to this branch.

Four new advisories landed against fast-uri, a transitive dependency of ajv (knowledge-base@1.0.0 -> ajv@8.20.0 -> fast-uri@3.1.5). One is high, which trips the --audit-level=high gate. This commit changes no dependency: the only edit to package.json is the MP_HEADLESS to KB_HEADLESS rename in the script lines, and package-lock.json is untouched. Master last ran green on 2026-08-20, before these advisories were published, so it would fail the same way if re-run today.

npm audit fix resolves it as a lockfile-only bump. Kept out of this PR because a dependency bump is its own change with its own review, and the repo has handled these separately before (#26).

@oto-macenauer-absa

Copy link
Copy Markdown
Collaborator Author

Folded the audit fix into this PR (e23e36e), replacing my note above.

fast-uri 3.1.5 to 3.1.7. All four advisories are patched in 3.1.6, and ajv@8.20.0 asks for ^3.0.1, so the newest 3.x satisfies it without an overrides entry. The diff is three lines of package-lock.json: version, resolved, integrity. package.json is untouched.

npm audit --omit=dev --audit-level=high now reports 0 vulnerabilities and exits 0.

Three advisories remain against js-yaml, nanoid and qs. All three are dev-only, confirmed by both the lockfile dev flags and npm ls --omit=dev resolving none of them. They never reach a deployed image and sit outside the gate, which is production-only by design. Left alone rather than churning the toolchain lockfile in a rename PR.

Worth flagging separately: ajv is declared a production dependency but nothing in src/, scripts/, tests/ or actions/ imports it. Its only use is .github/workflows/validate-doc-app.yml, which installs it transiently with --no-save. So the dependency that pulled fast-uri into the production tree is itself unused there. Not touched here, because #76 deletes that workflow and gives schema validation a real home in the action, at which point ajv either moves to actions/ or goes.

oto-macenauer-absa and others added 3 commits September 4, 2026 15:33
The project was once "docs marketplace". The name was gone from the UI but
still prefixed every identifier in the contract and the codebase, where it
collided with unrelated projects.

  data-mp-headless        -> data-kb-headless
  .mp-* / #mp-*           -> .kb-* / #kb-*
  MP_HEADLESS             -> KB_HEADLESS
  src/styles/marketplace.css -> src/styles/knowledge-base.css
  "marketplace" in prose  -> "knowledge base"

Hard cut, no compatibility shim: nothing is in production, and the only
producer of single-page HTML is this repo's own action. A stale artifact is
still diagnosable — fetch-apps.js now distinguishes "carries the pre-rename
marker" from "not headless at all" and says which, so a publisher is sent to
the contract rather than to their build script.

Two things deliberately left alone:

  * marketplace.json and marketplaceVersion. Both are artifact wire format,
    and #74 replaces them with a differently shaped kb-docs.json. Renaming
    them here would mean regenerating every fixture twice and would leave the
    new name briefly meaning the old shape.
  * The example repo's own class names and theme key inside the vendored
    tarball. Only data-mp-headless is rewritten in there, because that
    attribute is the contract; the rest belongs to that repo and moves with
    its own migration.

Also corrects a contract line that told apps to expect a --mp-chrome-h offset
variable. Nothing has injected it since the fixed chrome bar was removed, so
renaming it would have invented a variable rather than documented one.

Fixtures regenerated: the single-page bundle from setup-test-apps.mjs, and
the docs-example tarball repacked with an identical member list.

Suites green: 85 embedded, 22 standalone, action self-test 18.

Closes #77

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PYtmxSeSXFg4wEXRcKCmAi
Four high-severity advisories landed against fast-uri, which reaches the
production tree as a transitive dependency of ajv:

  GHSA-5jgf-p345-68v8  host confusion via skipped IDN canonicalization
  GHSA-f65p-4m7j-42xc  SSRF via malformed IPv6 normalization
  GHSA-fph4-wmhf-6fwf  SSRF via repeated hostname percent-decoding
  GHSA-jqff-g426-hqxp  host confusion via percent-encoded scheme normalization

All four are patched in 3.1.6. ajv@8.20.0 asks for ^3.0.1, so the newest 3.x
satisfies it and this is a lockfile-only change — package.json is untouched
and no dependency is added, removed or re-ranged.

`npm audit --omit=dev --audit-level=high`, which is exactly what CI runs, now
reports 0 vulnerabilities and exits 0.

Three advisories remain against js-yaml, nanoid and qs. All three are
dev-only (`npm ls` with --omit=dev resolves none of them), so they never
reach a deployed image and are outside the gate, which is prod-only by
design. Left alone rather than churning the toolchain lockfile in a rename PR.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PYtmxSeSXFg4wEXRcKCmAi
The pull_request trigger filtered on `branches: [master, main]`, so a stacked
PR got no checks at all except the bottom layer. Every branch above it — the
contract, the registry refactor, the actions — merged into its parent without a
build, a test run or an image scan, and the first CI those changes saw was after
the whole stack had already landed.

Push still filters to master/main: that trigger exists to test the trunk, and a
push to a stack branch is already covered by its PR.

Part of #73.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PYtmxSeSXFg4wEXRcKCmAi
@oto-macenauer-absa
oto-macenauer-absa force-pushed the chore/kb-identifier-rename branch from e23e36e to 95b8ec9 Compare September 4, 2026 13:33
`allowed-target-branches: master` failed every layer of a stacked PR except the
bottom one: a stack layer targets the layer below it, which is by construction
not master. The check exists to stop a PR aimed at some unrelated branch, and it
can still do that — the base branch is now allowed as well, but only when it is
itself a convention-named branch matching the same pattern the branch-name check
enforces.

Also drops the base-branch filter from the trigger, to match ci.yml. GitHub runs
the workflow for every layer of a registered stack regardless, so the filter
described an intent the platform was not honouring.

Part of #73.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PYtmxSeSXFg4wEXRcKCmAi
@oto-macenauer-absa
oto-macenauer-absa merged commit 88a2f7d into master Sep 4, 2026
7 checks passed
@oto-macenauer-absa
oto-macenauer-absa deleted the chore/kb-identifier-rename branch September 4, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename marketplace / mp identifiers to kb everywhere (data-kb-headless, .kb-*, KB_HEADLESS, knowledge-base.css) — hard cut

1 participant