Scope

2026-03-31 → 2026-04-01. Seven commits introduce the React kundkort frontend, the working Bolagsverket VärdefullaDatamängder API path, role normalisation, and the manual-enrichment UI affordances.

Commits

73d0aba — 2026-03-31 — feat: Kundkort frontend + BV VärdefullaDatamängder API + frontend build fix

Combined commit, three things land at once.

Frontend bug

  • Blank page caused by Bun.Transpiler re-transpiling pre-built dist/app.js, breaking CJS wrappers (“exports is not defined”).
  • Fix: only transpile .ts / .tsx; serve .js as-is.
  • Pre-build with bun build app.tsx --target browser --minify.
  • index.html now loads ./dist/app.js (bundled), not ./app.tsx.

Bolagsverket VärdefullaDatamängder (working gateway)

  • Discovered working endpoint: gw.api.bolagsverket.se/vardefulla-datamangder/v1.
  • Token endpoint: portal.api.bolagsverket.se/oauth2/token (scope vardefulla-datamangder:read).
  • Same credentials as the previously blocked Öppet API — different gateway, no IP whitelist.
  • fetchBolagsverketOrganisation() returns: name, SNI + descriptions, trade names, legal form text, address, is_active, business description, advertising block.
  • openApi.ts now has two token caches: getOppetToken() (blocked) and getVardefullToken() (working).

This is the Bolagsverket path noted in MEMORY.md and used by current production code.

Kundkort improvements

  • SNI codes now show Swedish descriptions (e.g. “81210 Lokalvård”).
  • Trade names / bifirmor shown in identity card.

72bb065 — 2026-03-31 — feat(kundkort): add manual enrich button and validation display

UI affordance — manual enrich trigger and validation display.

19ff8cc — 2026-03-31 — mulch: update expertise

Mulch (the ml agent expertise tool) sync. Not project code.

7624ab1 — 2026-03-31 — docs: update FRONTEND_TROUBLESHOOTING.md with root cause and fix

Docs update — the Bun.Transpiler issue from 73d0aba captured in docs/FRONTEND_TROUBLESHOOTING.md.

c3aa8f1 — 2026-03-31 — feat: implement role normalization with Övriga catch-all category

  • Added Grundare, Chef, Övrig mappings to ROLE_MAPPING in kundkort.ts.
  • Added Övriga category to contacts_by_role interface for unclassified contacts.
  • hideIfEmpty option in CONTACT_ROLE_ORDER for conditional display.
  • Added CTO, Grundare, Chef to RoleType enum in enrichment/types.ts.
  • Extended inferRoleType in nameUtils.ts to detect those roles.
  • Added Cheerio HTML fallback and Claude LLM fallback for contact extraction.

4d41b4e — 2026-04-01 — feat(kundkort): enhance enrichment with error tracking, role normalization, and usage display

Sparse body. Builds on c3aa8f1.

0a3cafc — 2026-04-01 — feat(kundkort): pass city to enrichV7 + log warning on empty contacts

City context now passed to enrichment. Warning log when contacts are empty (helps surface silent extraction failures).

1f1a0df — 2026-04-01 — fix(frontend): fix ErrorPanel — broken AuthContext import + d.errors → d.data

Two-line fix: import path and a property rename.

def2ae0 — 2026-04-01 — fix(pipeline): evict Redis domain cache when passed-in domain fails re-validation

When a caller passes a domain that fails re-validation (introduced in 1e71851 below), the cached entry is now evicted so the next enrichment run rediscovers from scratch.

1e71851 — 2026-04-01 — feat(enrichment): Phase 1 domain discovery enhancements

Despite the “Phase 1” label, this is a follow-up to the History Domain Discovery Era iteration:

  • extractBrandName() strips generic suffix words (Solutions, IT, Consulting) to expose the brand for tighter Serper queries.
  • findCompanyDomain() accepts trade_names param. Adds brand-variant + trade-name queries (up to 2 extra for brand, 1 per trade name).
  • EnrichmentInput.trade_names?: string[] field added.
  • pipeline.ts re-validates a passed-in domain before trusting it. If validation fails (score < 0.4) it discards and runs fresh discovery — the “v-solutions.se class of bug” referenced in the message.

29e46db — 2026-04-01 — seeds: sync 2026-04-01

Seeds (sd) sync — issue tracker housekeeping.

Significance

  • VärdefullaDatamängder is now the only working Bolagsverket path. Öppet API remains IP-blocked. See MEMORY.md and Bolagsverket Import for details.
  • The role-normalisation work in c3aa8f1 underpins the canonical kundkort field list (rebuilt earlier in b0122f3 — see History Domain Discovery Era).
  • Frontend transpilation fix is a cautionary tale: the dev server was double-bundling production output.

See also

Bolagsverket Import, Domain Discovery, EnrichV7, History Overview.

See also