# Donor Capability Inventory — the durable census

**Audience: AI coding agents first.** Optimize reads for activation, not prose. Do not "prettify."
**Date:** 2026-06-16 · **Status:** Living FACT map (commit-anchored). Refresh per the protocol at the bottom.
**Purpose:** Stop re-spawning exploration agents. This is the answer to *"which donor already has capability X, at what maturity, in which file?"* — computed once against pinned commits. Read **the rollup matrix** to pick a port source; read the per-donor tables for file anchors.

> **This is a FACTS doc, not a JUDGMENT doc.** It records what each donor *contains* at a pinned SHA. Whether a capability becomes a `@platform-modules/*` module/subpath is decided by the gates in `docs/plans/module-plan-template.md` and recorded in `2026-06-12-module-registry.md` (the canonical index) — never here. Donor count is a floor signal, never the verdict (see registry §"2-donor disposition rule"). When this doc and the registry disagree on a capability's fate, **the registry wins**; fix this doc.

---

## Donor roster (pinned)

> **Catalogued in `docs/catalog/index.md`** — that index is the SoT for donor **identity** (name → repo root) and lists every census artifact. This table is the **repo-level** pin for *this* (capability-grain) census; the **path-scoped** UI census is `docs/catalog/2026-06-16-ui-donor-census.md`. Check freshness per `index.md §3` before reuse.

| Donor | SHA | Stack | Role | Census verdict |
|---|---|---|---|---|
| `multideal` | `cbad0e962` | Astro/React web+landing · CF Worker/DO · Drizzle/Neon · Stripe | **richest product donor** — commerce, money-path, AI, affiliate | primary for ai, affiliate, ledger, billing, uploads, notifications, helpdesk |
| `zync.is` | `e4d6689` | Vite React · Astro site · Hono CF APIs · Workers · Drizzle · package-split | **best package-hygiene donor** — clean seams, tested | primary for auth(api-keys/oauth/2fa), audit, invoicing, notifications, webhooks(generic) |
| `ForumZone` | `24f5dc4` | Astro/React · CF · realtime Worker · `packages/{auth,db,providers,shared,ui}` | **realtime + community + provider-adapter donor** | primary for realtime, mail(failover), ui-primitives, ledger(credit) |
| `trance-shop-israel` | `97e10590` | Astro/React · Workers/ticketing · Hono · Drizzle/Neon/PG | **commerce + ticketing donor (US-exclusive tax)** | primary for billing(Sumit), ledger(split), commerce, ticketing(domain) |
| `fewtok` | `e02aa17` | Bun CLI · dict/macro/sigil · learn/simulate | **tooling/leaf donor** (Bun-locked some) | primary for util(trie/sse/tokenizer), ai(token-counting/pricing/provider-adapter) |
| `vibeflare` | `32d83a3` | Astro/React UI · Hono Worker · CLI · shared package | **AI-gateway + api-keys donor** | 2nd donor for ai/usage, auth/api-keys, ai/workers-ai |
| `Press.zone` | `none` (snapshot 2026-06-16) | Vite React + Express backend + legacy CMS plugins | **legacy/content donor** — mostly non-portable | confirm-only: uploads(S3), ledger(idem-key), search(PG-native) |
| `CommentPressZone` | `none` (snapshot 2026-06-16) | — | **DEAD** — repo is a 4-byte `test.txt`, no source | drop from donor set |

**Maturity legend:** `H` hardened (tests + validation + security + edge-handling) · `W` working (functional, thin) · `P` prototype (sketch) · `—` absent.

---

## Rollup matrix — "who has X?" (the primary query surface)

Rows = platform module taxonomy. Cell = best maturity found in that donor. **Pick the highest-maturity donor as the port source**; cross-check the registry before porting (a high cell can still be WATCH if seams diverge).

| Module | md | zync | FZ | trance | fewtok | vibeflare | PZ | best port source |
|---|:--:|:--:|:--:|:--:|:--:|:--:|:--:|---|
| `util` | W | W | W | W | **H** | W | — | fewtok (trie/sse hardened) + zync (crypto/tokens) |
| `db` | **H** | **H** | **H** | **H** | — | W | W | already shipped; trance = neon-http spine |
| `jobs` | **H** | **H** | W | W | W | W | P | multideal (outbox) / zync (8 consumers) |
| `mail` | **H** | W | **H** | W | — | — | W | ForumZone (provider failover) |
| `auth` | **H** | **H** | **H** | **H** | — | W | W | zync (api-keys/oauth/2fa) + multideal (raw WebCrypto) |
| `tenancy` | — | **H** | **H** | — | — | — | W | zync (RBAC triad) / ForumZone (flat + domains) |
| `ledger` | **H** | — | **H** | **H** | — | — | W | multideal (vesting) / ForumZone (balance-after) |
| `tax` | W | W | — | W | — | — | — | shipped (rates-table); trance = US-exclusive ref |
| `notifications` | **H** | **H** | **H** | W | — | — | — | zync (email+webpush+telegram one seam) |
| `uploads` | **H** | W | W | **H** | — | W | W | multideal / trance (R2 presign) |
| `search` | **H** | W | W | — | W | — | W | multideal (federation + facets) |
| `seo` | W | W | W | W | — | — | — | multideal / ForumZone (6-file lib) |
| `ai` | **H** | W | **H** | W | **H** | W | — | multideal (runner+registry) + fewtok (tokenizer/sse) |
| `realtime` | W | W | **H** | — | — | — | — | ForumZone (hibernatable DO) + zync (types) |
| `billing` | **H** | W | **H** | **H** | — | — | W | multideal (Stripe+Connect) / trance (Sumit IL) |
| `marketing` | W | W | W | W | — | — | — | trance/ForumZone (self-managed ×2) |
| `invoicing` | W | **H** | — | W | — | — | — | zync (recurring + AR-aging) / multideal (IL adapters) |
| `helpdesk` | **H** | W | — | W | — | — | — | shipped; multideal = polymorphic generalization |
| `affiliate` | **H** | — | — | — | — | — | — | multideal only (×1 → WATCH) |
| `audit` | W | **H** | W | W | — | W | — | zync (partitioned + redact + queue-sink) |
| `i18n` | **H** | — | — | **H** | W | — | H* | shipped; trance + multideal = translation-job pipeline |
| `cache` | W | — | W | W | **H** | W | W | designed; fewtok content-cache + vibeflare KV |
| `ui-primitives` | — | W | W | — | — | W | — | ForumZone (full set) / vibeflare (Astro islands). **Disposition RUN 2026-06-16 → UMBRELLA killed; the flat `@platform-modules/ui-*` family (`ui-tokens`/`ui-util`/`ui-primitives`, `ui-primitives` adopting Radix internally) is the LIVE form, build-GATED. RECONCILED 2026-06-16. See delivery-stack §3.** |

`H*` = Press.zone i18n is hardened **but PHP/reference CMS** — reference only, not portable.

---

## Per-donor detail (file anchors)

### `multideal` @ `cbad0e962`

| module | capability/subpath | donor path(s) | maturity | note |
|---|---|---|---|---|
| db | Drizzle/Neon contract, PII write, predicates | `src/server/db/{client,crypto,pii-write,predicates}.ts` | H | reference impl; 100+ query files |
| jobs | CF Queues outbox producer/consumer, DLQ, cron-cursor | `src/server/queues/`, `cron/process-outbox.ts`, `web-do/src/queues/` | H | outbox is the backbone; cron-cursor = resumable sweep primitive |
| mail | Resend adapter, bulk-mailer, 40+ outbox email handlers | `src/server/email/`, `workflows/outbox/handlers/handle-*` | H | adapter+dispatcher clean; template content app-coupled |
| auth | session, CSRF, magic-link, access guards, Firebase token verify | `src/server/auth/{session,cookies,csrf,tokens,access,guard-outcome}.ts` | H | manual JWKS RS256 (no firebase-admin) = `otp-sms-firebase` source |
| ledger | vendor escrow/hold/release, settlement reconciler, referral credit/debit/clawback | `src/server/workflows/settlement-*.ts`, `domain/vendor-earnings/`, `referrals/ledger.ts` | H | money-path w/ reconciliation + hold-aging; entangled w/ deal+referral |
| tax | IL VAT queries, SHAAM withholding, IL business-days | `src/server/db/queries/{vat,tax-documents}.ts`, `calendar/il-business-days.ts` | W | IL-specific, exclusive VAT; fully domain-coupled |
| notifications | typed event-registry, per-user routing, push fallback, topics | `src/server/notifications/{event-registry,send,render,topics,push-fallback}.ts` | H | DB-backed prefs + push fallback; clean seam |
| uploads | 3-phase R2 (initiate/token/finalize), magic-byte, variants, dims, QR | `src/server/storage/{uploads,r2,imageDimensions,qr_png}.ts`, `lib/imageVariants.ts` | H | HMAC token; variant URL scheme = clean seam |
| search | PG FTS + ILIKE fallback, locale regconfig, facets, suggest, geo-near | `src/server/db/queries/deals-search*.ts`, `deals-facets.ts`, `deals-suggest.ts` | H | `buildDealTextPredicate` abstraction; faceted COUNT(); geo subpath |
| seo | SeoHead, JsonLd, canonical, OG, sitemap/robots | `src/components/ui/primitives/{SeoHead,JsonLd}/`, Astro heads | W | React+Astro; structured-data types domain-specific |
| ai | multi-provider registry (Anthropic/Gemini/OpenAI/mock/chained), runner+queue, pricing, creds, 4 agents | `src/server/ai/{providers,kinds,registry,runner,llm,pricing,credentials}`, `ai/agents/` | H | **most complete AI donor**; support agent = 12-tool registry; runner+registry = clean seam |
| realtime | TopicDO pub/sub fanout, UserSession/SupportCase/SupportTicket DOs | `web-do/src/do/TopicDO.ts`, `do/_base-ws.ts`, `web-do/src/lifecycle/` | W | hibernate WS base; TopicDO = clean primitive; lifecycle = app-domain |
| billing | Stripe (charges/intents/promo/idempotency/line-items), mock, Connect payout, refund | `src/server/payments/{stripe-provider,connect,refund,get-provider}.ts` | H | provider iface + mock = clean seam; Connect affiliate payout |
| marketing | lifecycle drip cron (buyer/vendor), audience-sync, marketing-token, back-in-stock | `src/server/cron/{marketing-lifecycle,audience-sync}.ts`, `email/marketing-token.ts` | W | drip app-coupled; unsubscribe token generic |
| invoicing | provider abstraction (iCount + Morning IL), mock, noop, registry, invoice-job | `src/server/invoicing/{provider,icount,morning,registry}.ts`, `workflows/invoice-job.ts` | W | clean `InvoicingProvider` iface; adapters IL-coupled |
| helpdesk | ticket+case state machines, AI agent (12 tools), KB search, threads, SLA, escalation | `src/server/support/{agent-runner,workflows,rules,decisions,adapters/knowledge}/` | H | most mature; rules+workflow seam extractable; = polymorphic generalization source |
| affiliate | attribution, commission, clawback, maturation, 12 fraud-signal adapters, graph-scan, security | `src/server/referrals/{attribution,commission,clawback,maturation,fraud,security,graph-scan,ledger}.ts` | H | **richest affiliate**; identity-ring graph-scan; deeply ledger+billing coupled |
| audit | admin audit-trail, admin-actions log, AI-interventions log | `src/server/admin/_shared/audit-trail.ts`, `db/queries/{admin-actions,ai-interventions}.ts` | W | thin per-action trail; admin-coupled |
| i18n | en/he namespaces, DB-backed config, LLM translation pipeline w/ memory/eviction | `src/lib/i18n/`, `server/i18n/`, `server/translation/{provider,jobs,memory,fields}.ts` | H | shipped; donor adds Gemini translation-job queue + dedup on top |

### `zync.is` @ `e4d6689`

| module | capability/subpath | donor path(s) | maturity | note |
|---|---|---|---|---|
| auth | session (JWT/cookies/trusted-devices), RBAC+permissions, 2FA(TOTP+backup), OAuth AS, **api-keys**, per-key rate-limit, password(Argon2-via-DO), contractor portal-sessions | `packages/auth/src/{session,rbac,two-factor,oauth,tokens,password,contractor-session}.ts`, `apps/zync-public-api/src/middleware/{auth,rate-limit}.ts` | H | **best auth donor**; api-key path KV-cached+scope-checked; Argon2 offloaded to PasswordHashDO |
| db | full Drizzle schema (60+ files, 55+ migrations, partitioned audit), typed query lib (30+), FTS tsquery builder | `packages/db/src/{schema,queries,search}/` | H | deepest query coverage; tested |
| tenancy | tenant+settings schema, tier enum, white-label (custom domain/brand), module-feature flags | `packages/db/src/schema/{tenants,tenant-modules,white-label}.ts` | H | RBAC triad superset; per-tenant settings |
| billing | tier-config, payment adapter (Morning), dunning, subscription, usage-metering | `packages/payments/src/{tiers-config,adapter,registry}.ts`, `packages/api-usage/src/` | W | adapter pattern; KV-backed usage write/read |
| notifications | multi-channel (email Resend+MJML, web-push VAPID, telegram), 8 MJML templates EN+HE, WS push | `packages/notifications/src/{deliver,adapters,templates,ws-push}.ts` | H | adapter-pattern deliver; reference impl |
| realtime | queue-backed publish, DO server stub, client types | `packages/realtime/src/{publish,server,types}.ts` | W | types-only client; DO server thin |
| uploads | R2 storage + per-tenant quota | `packages/storage/src/{index,quota}.ts` | W | thin reusable seam |
| ai | multi-provider adapter (Anthropic/OpenAI/Google), RAG (embed/retrieve/enqueue), chat assistant | `packages/ai/src/{adapter,adapters,rag,chat}/` | W | streaming; RAG enqueues to CF Queue; use-cases app-coupled |
| search | multi-entity PG FTS service | `packages/db/src/search/{search-service,entity-queries}.ts` | W | zync entity set |
| invoicing | recurring invoices, credit notes, payment matching, PDF queue, dunning, AR-aging | `packages/db/src/schema/recurring-invoices.ts`, `apps/zync-api/src/{invoices,lib/ar-aging-*}` | H | **best invoicing donor**; unmatched-payments reconcile |
| helpdesk | support + SLA schema | `packages/db/src/schema/{support,ticket-sla}.ts` | W | schema-only |
| audit | **partitioned audit_log + sensitive-field redact + action constants + queue consumer**, per-entity activity tables | `packages/db/src/schema/{audit-log,activities}.ts`, `constants/audit.ts`, `queues/audit-log-consumer.ts` | H | **best audit donor**; redact blocklist; FK-CASCADE activity timeline |
| marketing | lead capture + CRM scoring w/ cron refresh | `apps/zync-api/src/cron/lead-score-refresh.ts`, `queues/lead-score-recalc.ts` | W | app-coupled |
| jobs | 8+ CF Queue consumers (webhook/audit/ai-index/invoice/expense/realtime/comms), outbox pattern | `apps/zync-api/src/queues/` | H | outbox throughout; cron via scheduled() |
| ui-primitives | shared React UI lib | `packages/ui/src/` | W | zync design system; `packages/ui` pulls the full `@radix-ui/*` set + `cmdk` (shadcn signature) — built ON Radix, styled (not headless, not hand-rolled). Disposition 2026-06-16: KILLED→adopt Radix. |

### `ForumZone` @ `24f5dc4`

| module | capability/subpath | donor path(s) | maturity | note |
|---|---|---|---|---|
| auth | session, token exchange, permissions | `packages/auth/src/{client,server,permissions}.ts` | H | standalone pkg; consume/exchange-token routes; tested |
| db | drizzle client, schema, migrations, **tenant-resolver** | `packages/db/src/{client,schema,migrations,tenant-resolver}.ts` | H | tenant-resolver = key seam |
| tenancy | tenant lookup, domain resolution, multi-tenant middleware, custom-domain reconcile queue | `apps/web/src/{middleware/tenant,services/{tenant,tenant-lookup,domain}}.ts` | H | domain repo+factory; tested |
| mail | **multi-provider send + failover** (Brevo/Resend/Sendgrid) | `packages/providers/src/email/{brevo,resend,sendgrid,failover}.ts` | H | **best mail donor**; tested failover; `packages/providers` |
| notifications | in-app + queue dispatch + digest cron + unsubscribe/suppression | `apps/web/src/{queues/notifications,services/notification.service}.ts`, `apps/realtime/src/{consumers,cron/digest}.ts` | H | tested consumer; digest in realtime Worker |
| realtime | **DO hub + forum-room + conversation-room + hibernatable WS**, moderation/translation/notification consumers | `apps/realtime/src/{index,hub,forum-room,conversation-room,auth}.ts` | H | **best realtime donor**; separate Workers app; tested |
| ai | LLM complete multi-provider (Anthropic/OpenAI/Google) + failover + taxonomy classification | `packages/providers/src/{llm,llm-complete,taxonomy}.ts` | H | adapter+tests; moderation consumer uses taxonomy |
| billing | Stripe checkout/portal, subscription plans, credits/topup, per-tenant cost-config | `apps/web/src/{lib/stripe,services/{billing,credit,cost-config}}.ts`, `db/schema/billing.ts` | H | webhook tested; credits = internal balance |
| ledger | credit balance (earn/spend), reputation scoring | `apps/web/src/services/{credit.service,credit-port,reputation.service}.ts` | H | earn/spend events; not a package — web services |
| search | FTS + suggest + search_vector schema | `apps/web/src/{pages/api/v1/search,services/search.service}.ts`, `db/migrations/0005_phase6_search.sql` | W | D1 search_vector; no package |
| seo | canonical, jsonld, OG/excerpt, indexable, sitemap, IndexNow | `apps/web/src/lib/seo/{canonical,jsonld,excerpt,indexable,cache}.ts` | W | 6-file lib; no tests seen |
| uploads | R2 presign + image-process queue + ImageUpload UI | `apps/web/src/{lib/r2,pages/api/v1/uploads/presign}.ts`, `packages/ui/src/primitives/ImageUpload.tsx` | W | no upload-service abstraction |
| audit | audit log schema + admin read API | `packages/db/src/schema/audit.ts`, `apps/web/src/pages/api/v1/admin/audit.ts` | W | no service layer |
| ui-primitives | **headless primitives + forum sections + composites + domain + layout + admin** | `packages/ui/src/{primitives,sections,composites,domain,layout,admin}/` | W | strong ui pkg; sections domain-coupled (not headless); no Radix-family dep found (hand-rolled primitives — accessibility unverified). Disposition 2026-06-16: KILLED→adopt Radix; composites→template/host. |
| marketing | onboarding wizard + community setup | `apps/web/src/{services/onboarding,pages/api/v1/onboarding}` | W | tested; forum-specific but reusable pattern |
| jobs | CF Queue consumers (emails/image/account-deletion/export/domain-reconcile/migration) | `apps/web/src/pages/api/queue/`, `queues/{notifications,post-process,indexnow}.ts` | W | wired as API routes; no standalone pkg |

### `trance-shop-israel` @ `97e10590`

| module | capability/subpath | donor path(s) | maturity | note |
|---|---|---|---|---|
| db | neon-http drizzle client (= platform spine pattern), 44 migrations | `packages/core/src/db.ts`, `drizzle/schema/` | H | exact neon-http narrowing pattern |
| auth | stateless JWT (jose/HS256), password, CSRF double-submit, 2FA TOTP, email-OTP, role guard, middleware | `packages/core/src/{totp,email-otp,rate-limit}.ts`, `apps/web/src/lib/{auth,csrf,password,hasRole}.ts` | H | replaced NextAuth w/ CF-native JWT; TOTP uses Node crypto = **unsafe**, prefer zync |
| mail | transactional send, DB email-templates + i18n translation status | `packages/core/src/email.ts`, `apps/web/.../email-templates/` | W | provider behind abstraction |
| notifications | in-app bell + Web Push (VAPID) + new-release fanout | `packages/core/src/push.ts`, `apps/web/src/lib/{new-release-notifications,push-subscribe}.ts` | W | push primitive reusable; fanout trigger app-coupled |
| uploads | R2 presigned (audio/image/design), multipart progress, rehost scripts | `packages/core/src/r2.ts`, `apps/web/src/pages/api/upload/{audio,image,design}.ts` | H | 3 upload types; audio pipeline separate |
| billing | **Sumit PSP adapter** (tokenize/charge/refund), payment encryption, method storage | `packages/core/src/payment/providers/sumit/`, `payment/encryption.ts` | H | IL non-Stripe; provider-in-charge; US-exclusive tax at charge (Pattern C) |
| ledger | vendor balance, revenue-split calc, payout request+admin-approval, per-role earnings | `packages/core/src/{vendor-balance,payment/split}.ts`, `pages/api/dashboard/{artist,club,label}/balance.ts` | H | tested split; multi-role earners; e2e payout |
| tax | US-exclusive — folded into checkout pricing, **no standalone module** | `packages/core/src/checkout/pricing.ts` | W | Pattern C (exclusive = hides in billing) |
| jobs | DO alarm-loop scheduler (recs recompute), DB-polled translation jobs | `workers/ticketing/src/recs-scheduler-do.ts`, `pages/api/cron/process-translations.ts` | W | DO alarm pattern; no CF Queue usage |
| seo | head meta builder + OG + structured data + **astro-specific split** | `packages/core/src/{seo,seo-astro}.ts` | W | seo/seo-astro split = framework-neutral core signal |
| ai | content moderation (tested), Gemini translation, LLM-settings admin, recommendation engine | `apps/web/src/lib/ai/moderation.ts`, `lib/{gemini-translate,recommendations}/` | W | moderation tested; collab-filter recs |
| helpdesk | support ticket CRUD + threaded messages + admin triage | `apps/web/src/pages/api/admin/support/`, `migrations/0013_support_tickets.sql` | W | admin-only; no customer portal |
| audit | audit-log write on admin mutations + admin panel | `packages/core/src/audit.ts`, `components/dashboard/AuditAdminPanel.tsx` | W | write primitive in core; no read abstraction |
| i18n | next-intl (en/he/ru), locale detection, DB-content Gemini auto-translate | `packages/core/src/i18n/`, `apps/web/src/lib/{i18n,gemini-translate}.ts` | H | 3 locales; DB-content translation jobs |
| marketing | newsletter subscribe/unsubscribe + admin list | `apps/web/src/pages/api/newsletter/`, `components/storefront/NewsletterSubscribeBanner.tsx` | W | newsletter-only; no campaigns |

### `fewtok` @ `e02aa17`

| module | capability/subpath | donor path(s) | maturity | note |
|---|---|---|---|---|
| util | `trie`/`longest-match` (Aho-Corasick substitution) | `src/codec/{Trie,longestMatch}.ts` | H | typed, tested, zero coupling once dict types extracted |
| util | `sse-stream` (SSE parse + rewrite for LLM streaming) | `src/codec/{sseParser,sseStream,sseRewriteStream}.ts` | H | well-tested; generic pipeline |
| util | `atomic-write`/`secure-write`/`backup`/`read-optional` (fs leaves) | `src/install/blocks/{atomicWrite,secureWrite,backup}.ts` | W | generic fs; `util/fs` subpath candidate |
| util | `jaccard-dedup`, `content-chunker`, `parse-config` (TOML/YAML/JSON), `sigil`, `detect-language` | `src/kb/{jaccardDedup,KbChunker}.ts`, `src/install/blocks/parsers.ts`, `src/codec/sigil.ts` | W | pure algorithms; no deps |
| ai | `token-counting` (Claude3 + o200k/tiktoken + registry) | `src/codec/{Tokenizer,Claude3Tokenizer,O200kTokenizer,TokenizerRegistry}.ts` | H | multi-provider; peer `@anthropic-ai/tokenizer`+`tiktoken` |
| ai | `model-pricing` (per-model USD table + cost/savings calc) | `src/pricing/models.ts`, `src/stats/pricing.ts` | W | tested; reusable for cost-reporting |
| ai | `provider-adapter` (Anthropic+OpenAI canonical req/resp + TokenUsage) | `src/provider/{types,canonical,AnthropicAdapter,OpenAIResponsesAdapter,AdapterRegistry}.ts` | W | clean seam; proxy coupling extractable |
| jobs | `scheduler` (SQLite-backed time-gate), `worker-pool` (Bun parallel exec) | `src/learn/{scheduler,passB-worker}.ts`, `src/codec/codecWorker*.ts` | W | Bun-locked; generic patterns |
| cache | `read-cache` (content-addressed file cache, fingerprint, GC) | `src/cache/{ReadCache,schema,fingerprint}.ts` | H | content cache (not HTTP); util-grade dedup primitive |
| search | `kb-store` (SQLite FTS + chunk + Jaccard-dedup) | `src/kb/{KbStore,KbChunker,jaccardDedup}.ts` | W | `bun:sqlite` hard-dep; SQLite-path candidate for search |

### `vibeflare` @ `32d83a3`

| module | capability/subpath | donor path(s) | maturity | note |
|---|---|---|---|---|
| auth | session(JWT cookie), **api-key** (hash lookup + last_used touch), passkey(WebAuthn), invites, github-oauth(device-flow), cf-access(JWKS), DO rate-limiter | `apps/worker/src/auth/{session,apikey,passkey,invites,github,access,ratelimit}.ts` | W | **2nd api-keys donor**; dual-auth (session OR key) pattern; DO sliding-window |
| db | raw D1 query helpers (35+ typed fns, migrations) | `apps/worker/src/db/queries.ts`, `db/migrations/` | W | no ORM; schema app-coupled; pattern portable |
| util | `id`/`api-key` gen (nanoid, `vf_<prefix>.<secret>`), `hash` (sha256 Web Crypto) | `apps/worker/src/util/{id,hash}.ts` | W | zero-dep; directly extractable |
| ai | `workers-ai` runner shim + task→OpenAI-endpoint map, **`openai-compat` full types** (chat/embed/image/audio/models), `usage` (neuron metering + daily rollup), `dispatch` (multi-modal handlers) | `apps/worker/src/ai/{dispatch,modalities,neurons}.ts`, `packages/shared/src/{workers-ai,openai}.ts`, `apps/worker/src/api/` | W (openai-compat = H) | **2nd ai/usage donor**; openai-compat types hardened; Workers-AI backend |
| uploads | `r2` (put/get/delete + publicUrl), authenticated `/files/:key` serve | `apps/worker/src/files/r2.ts`, `routes/v1.ts` | W | dual-auth serve |
| cache | D1 response cache (SHA-256 keyed) + prompt cache + `withCache` KV wrapper | `apps/worker/src/cache/{responses,prompts}.ts`, `lib/cache.ts` | W | dissolves per Gate 1; note for `ai` response-cache subpath |
| jobs | CF `scheduled()` cron (model sync + prune) | `apps/worker/src/crons/{sync_models,prune,probe_models}.ts` | W | `ctx.waitUntil`; prune pattern reusable |
| audit | per-request audit writer (D1 + CF Analytics Engine `writeDataPoint`) | `apps/worker/src/audit/log.ts` | W | dual sink; AE slice → `ai/usage` |
| ui-primitives | AppShell/Sidebar/TopBar (Astro+React), Avatar/Badge/Button/Card/Checkbox/Dialog/Input/Markdown/Progress, HydratedIsland | `apps/ui/src/components/{primitives,layouts}/` | W | Tailwind; Astro partial-hydration island pattern; uses `@radix-ui/*` (dialog/select/tabs/toast/checkbox/progress/tooltip). Disposition 2026-06-16: KILLED→adopt Radix; AppShell/Sidebar→template/host. |

### `Press.zone` @ snapshot 2026-06-16 (no git)

| module | capability | donor path(s) | maturity | note |
|---|---|---|---|---|
| uploads | S3-compatible storage (`@aws-sdk/client-s3`), presigned get/put/delete, R2-targeted | `community-press-zone-backend/src/services/storage.ts` | W | **most portable** PZ capability; R2-aligned |
| ledger | wallet + `coin_ledger` virtual-currency, idempotency (caller-UUID + Redis replay), TOCTOU-safe debit | `src/routes/economy.ts`, `src/db/pool.ts` | W | confirms ledger idem-key = caller-defined opaque key |
| auth | JWT sign/verify, bcrypt, refresh rotation, rate-limit | `src/middleware/auth.ts`, `routes/auth.ts` | W | Express-coupled; no 2FA/OAuth/RBAC — shallower than multideal |
| search | forum FTS + ingest (PG-native) | `src/services/forum/{search,ingest}.ts` | W | confirms zero external search engines across census |
| i18n | reference CMS translation plugins (TranslateGemma AI, job-queue, state-machine) | `legacy-CMS plugins/{translate,international}-press-zone/` | H* | **PHP — not portable**; richest translation-job-lifecycle reference |
| — | legacy CMS plugins, matrix-stack (Matrix+LiveKit), archive/ | — | P | **skip** — PHP / infra-config / archived |

---

## New findings (not yet in the registry — for disposition)

1. **`auth/api-keys` stays ×2** (zync `H`, vibeflare `W`) — registry §auth already lists `candidate ×2 zync+vibeflare`. **Count unchanged**: Press.zone's only `api_key` strings are `BUNNY_API_KEY` *consumption* (CDN-key config in `src/config/index.ts` + `routes/media.ts`), **not** key *issuance* — different capability, does not count. Promote basis is **×2-convergence** (both = `Bearer <prefix>.<secret>` → hash-lookup → scope), not donor count, + cross-class forward need (every public-API surface). **Registry decision pending** (see contradiction ledger).
2. **`ai/usage` is now ×2** (vibeflare `W` confirms Botmaster) — registry §analytics already maps it as the reusable residue. Census confirms; no change needed beyond noting the 2nd donor.
3. **`webhooks` DISSOLVED but ×5 donors, with zync's generic HMAC-signed delivery package `hardened`** — registry dissolved it citing "direction-split mirage / outbound = 1-donor." Census finds outbound delivery present in zync (H, generic), multideal, ForumZone, trance, PZ. The *inbound* dissolution holds (per-provider). **Outbound-delivery may now have its 2nd genuine consumer — flag for re-disposition** (contradiction ledger).
4. **`integrations` — capability class absent from taxonomy.** zync ships slack/trello/asana/jira/monday/clickup task-sync + Zapier OAuth client + Make.com (`packages/{integrations,zapier,make}`). ×1 donor → **WATCH**, but it's a forward-need class for any SaaS. Not a module yet.
5. **`ticketing` (trance) — hardened domain module ×1.** CF Worker + DO + D1, HMAC ticket signing, scan-log, offline PWA validator (`workers/ticketing/`, `validator/`). Strong but single-donor → **WATCH**; composes auth/realtime/jobs/ledger when promoted.
6. **`commerce` (trance) — hardened ×1.** cart (reducer+server-sync+guest) + checkout (create-order/charge/fulfill/refund, tested) + coupons + Printful POD (`packages/core/src/{cart,checkout}/`). Maps across billing/ledger/invoicing — a *blueprint*, not a module. Feeds the marketplace/commerce blueprint, not a new package.
7. **`CommentPressZone` is DEAD** (empty repo). ✓ **Removed 2026-06-16** from `2026-06-12-module-discovery-census.md` + the `platform-orchestrator` census roster; `CLAUDE.md` header donor list already clean (never listed it). `catalog/index.md` records it under dead/excluded.

---

## Refresh protocol (keeps this "once and for all")

This doc is **stale-detectable, not auto-current.** Each donor row pins a SHA. To refresh:
1. `git -C <donor> rev-parse --short HEAD` — if it differs from the pinned SHA, that donor's rows are **suspect**.
2. Re-census **only the drifted donor** (one sonnet Explore agent, the prompt template lives in the orchestration run-sheet), not all eight.
3. Bump that donor's SHA + date here; reconcile new capabilities into the registry via the gates (never directly).
4. Non-git donors (`Press.zone`) pin a snapshot date — re-verify by content diff, lower priority.

**Do not** re-run a full 8-donor census to answer a single "who has X?" — read the rollup matrix. That re-spawn is the exact waste this doc exists to kill.
