Skip to content

Catalogue: deployed API-reference import, chained into the rebuild - #227

Merged
ib823 merged 1 commit into
mainfrom
claude/capability-catalogue-accuracy-183ha7
Aug 6, 2026
Merged

Catalogue: deployed API-reference import, chained into the rebuild#227
ib823 merged 1 commit into
mainfrom
claude/capability-catalogue-accuracy-183ha7

Conversation

@ib823

@ib823 ib823 commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Follow-up to #226, closing the one data gap it left visible on production: Discover's API tile shows 0 for private-cloud and SuccessFactors connections, because SapApiReference — the table the API slice projects from — was only ever writable by the local pnpm sap:catalog:import script, and production's copy predates product tags. The rebuild re-projects faithfully but had nothing multi-product to project from.

What this adds

  • Shared normalizer: the pure half of scripts/import-sap-api-catalog.ts (normalizeRow, parseJson, normalizeStatus, normalizeApiType) moves to src/lib/sap-public/api-reference-import.ts; the script re-exports it, so the laptop path and the deployed path write identical rows (the edition-tags extraction's precedent).
  • POST /api/sap/tdd/hub-content/api-reference-import: admin-gated, typed confirmation phrase, fetches the committed sap-references/api-hub-catalog.json from the repository at the pinned deployed commit (refused without a SHA — reusing hub-harvest-remote's source resolution), chunked and resumable (~4,600 rows), idempotent upserts by apiId, editions derived from product tags by the shared classifier, apiType preserved when the file declares none, append-only audited.
  • Catalogue Health gains an "Import API reference + rebuild" action that drives the chunk loop to completion and then chains the hub-content rebuild automatically — a refreshed reference without a re-projection would leave the screen unchanged.
  • The capabilities route's "no probeable services" note now points at the screen first, the local script second.

After merge, on production

Operations → Catalogue health → type the confirmation phrase → Import API reference + rebuild. The API tile then populates for private-cloud and SuccessFactors connections.

No schema changes. Full gate green: typecheck:strict, lint:strict, 317 files / 4,738 tests, next build via pre-push.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FEq89i8SZpWXPbDXoaRvX8


Generated by Claude Code

Discover's API tile projects from SapApiReference, and that table was only
ever writable by `pnpm sap:catalog:import` - a laptop holding the production
DATABASE_URL. A deployment whose reference predated product tags could never
surface private-edition or SuccessFactors APIs: the hub-content Rebuild
re-projects faithfully but had nothing multi-product to project FROM. Every
other content type gained a deployed import path; the one the API tile
depends on did not.

- The pure normalization (normalizeRow, parseJson, normalizeStatus,
  normalizeApiType, NormalizedApi) moves to
  src/lib/sap-public/api-reference-import.ts; the script re-exports from it,
  so the row a laptop writes and the row the route writes are the same row -
  the edition-tags extraction's precedent, for the same reason.

- POST /api/sap/tdd/hub-content/api-reference-import: admin-gated, typed
  confirmation phrase, fetched at request time from the repository at the
  PINNED DEPLOYED COMMIT (refused without a SHA - hub-harvest-remote's
  discipline, reused), chunked and resumable (~4,600 rows), idempotent
  upserts by apiId, editions derived from product tags by the shared
  classifier, apiType preserved when the file declares none, append-only
  audited.

- Catalogue Health gains "Import API reference + rebuild": drives the chunk
  loop to completion, then chains the hub-content rebuild automatically - a
  refreshed reference without a re-projection would leave the screen
  unchanged and the operator concluding the import did nothing.

- The capabilities route's "no probeable services" note now points at the
  screen first, the local script second.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEq89i8SZpWXPbDXoaRvX8
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
aptus Ready Ready Preview Aug 6, 2026 6:40am

@ib823
ib823 marked this pull request as ready for review August 6, 2026 06:36
@ib823
ib823 merged commit b90ab0c into main Aug 6, 2026
8 checks passed
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.

2 participants