← Corpus / augment-it / plan
Augment from DB · Phase 2 — the org-workbench remote: flow registration, org search, org card
Autocomplete to a canonical org and work its card with a live ➕ on every list — plus the verb the spec missed, `organization.streams.add`.
- Path
- plans/Augment-From-DB-Phase-2-Org-Workbench-Remote.md
- Authors
- Michael Staton
- Augmented with
- Claude Code on Claude Fable 5
- Tags
- Plan · Augment-It · Augment-From-DB · Phase-2 · Org-Workbench · Microfrontend · Module-Federation
Augment from DB · Phase 2 — org-workbench remote
Spec reference
Implements Phase 2 of [[../specs/Augment-From-DB-Flow]] (Implementing). Scaffold template: apps/person-db-resolver (package.json, tsconfig, rsbuild config, mount contract, workspace.connect + workspace.active client-derivation idiom, augment-it:workspace-changed listener). Branch: rebuild/turbo-rsbuild.
One spec gap discovered and closed here: the spec’s Phase 2 assumed “existing add verbs” cover all three lists, but only organization.links.add / organization.corpus.add exist — there is no single-entry verb for media_streams[] (streams only ever arrived via resolver.apply’s batch path). This plan adds organization.streams.add (mirrors addOrgLink, reuses the module-private shapeStream → kind auto-inferred, party: 'first_party'), plus its handler, capability-map entry, and 30s timeout.
Steps
- Service verb —
addOrgStreaminservices/record-surrealdb-resolver/src/resolver.ts({org_slug, url, kind?, client}→{ok, org_id, stream}); handler block inhandlers.ts(organization.streams.add.requested);capabilities.tsmap + timeout entries. - Scaffold
apps/org-workbench/(:3014) — package.json (@augment-it/org-workbench), tsconfig, rsbuild config (federation nameorgWorkbench, exposes./mount, cors origin :3100, assetPrefix :3014),src/{index.ts, mount.ts (mountOrgWorkbench), css.d.ts, app.css (ow-* prefix)}. - Client lib —
src/lib/types.ts(OrgSuggestion,OrgDetail,SearchRequestDetailfor Phase 3);src/lib/org-client.ts— typed wrappers overworkspace.invokeforresolver.search,organization.detail,organization.links.add,organization.streams.add,organization.corpus.add. - Components —
OrgSearch.svelte(debounced ≥250ms autocomplete overresolver.search, keyboard-free v1: click to pick);AdditiveList.svelte(generic: entries with kind badge + host + added-date, inline ➕ form → caller-supplied add fn, busy/error localized per list);OrgCard.svelte(identity block: names, slug, aliases, domains; three AdditiveLists);App.svelte(header strip “SurrealDB · main/main · Organizations”, client badge, ws status; search → card; refetch onaugment-it:entity-updatedand on every successful add). - Shell registration —
AUGMENT_FROM_DB_ROTATION = ['orgWorkbench']+ REMOTES entry inremotes.ts;augmentFromDbFLOWS entry inflows.svelte.ts;orgWorkbench@http://localhost:3014/remoteEntry.jsinrsbuild.config.ts. - Verify (see below), changelog, commit + push as
attempt(augment-from-db, org-workbench, step2):.
Verification
pnpm installlinks the new workspace package;pnpm check(svelte-check) green inapps/org-workbench;pnpm buildgreen inapps/org-workbenchandshell;pnpm typecheckgreen in the two touched services.organization.streams.addproven over raw NATS (rebuildrecord-surrealdb-resolver+workspace-servicecontainers): add a stream URL to a known org →organization.detailre-read shows it with inferred kind +party: 'first_party'.- Dev-server smoke:
pnpm devin org-workbench,curl -sf localhost:3014/remoteEntry.jsreturns the federation manifest. - Browser walk-through (operator): Flows popdown → “Augment from DB” → search → card → ➕ on each list. Deferred to the operator; everything scriptable is scripted.
Out of scope
People reveal / add-person (Phase 4), the 🔍 search-launch buttons and search-and-add remote (Phase 3), stream scanning (Phase 5).