Skip to content

Research: what a CRM-class patch needs beyond the SDK: built-ins, helpers and allowlist candidates #309

Closed

Description

@allisonmahmood

Part of #294.

Question

What does a CRM-class internal tool need that neither the SDK nor a Web-standard runtime provides, and which of those needs are answered by a pinned allowlist entry, an SDK helper, copied source, or deferral? Method: take three concrete tools (a contacts/companies/deals CRM with attachments and CSV import, an approvals workflow, a reporting dashboard over a company Postgres connection) and list what an agent would reach for from npm on the client and on the server. For each item: what the Web platform already gives (Intl, Temporal status, Web Crypto, structuredClone, URL, Streams), what an agent can write in under a hundred lines, what needs mature behaviour (accessible comboboxes, date pickers, grids, rich text, time-zone arithmetic, recurrence, phone parsing, PDF and spreadsheet generation), and what the SDK could ship once for everyone. Check which of the mature-behaviour packages would run on workerd and Deno without Node built-ins. Compare how Val Town, Windmill, Convex, Retool and Cloudflare Workers answer dependencies for their users' code.

Output: findings as the resolution comment on this ticket: a candidate first allowlist, a candidate helper floor, and a deferred list with the honest limitation each implies. Two models in parallel per the map's Notes.

Activity

  1. added
    wayfinder:research
    on Sep 19, 2026
  2. allisonmahmood commented on Sep 19, 2026

    @allisonmahmood
    OwnerAuthor

    Report A: Claude Opus 5 (full findings)

    R4 — What a CRM-class patch needs beyond the SDK

    Research for #309 (part of #294). Model: Claude Opus 5. All external claims are cited with the URL they were read from; the citations were re-opened in a verification pass at the end.

    Summary

    • The decided model (the patchy package plus a short per-release allowlist of exact versions) is closer to Retool's than to anyone else's: Retool preloads a fixed set (Lodash, Moment, uuid, Numbro, PapaParse, i18next) and makes everything else an explicit, admin-scoped addition (docs.retool.com/queries/reference/libraries/preloaded). Val Town, Windmill, Convex and Cloudflare all answer "any npm, pinned by a lockfile".
    • The single largest gap is not a package at all: tier 1 forbids in-frame downloads, so a CRM cannot export a CSV and a dashboard cannot hand over a report (packages/sdk/skills/patchy-loop/SKILL.md). A shell-mediated download helper is the highest-value thing the SDK can ship.
    • Formatting is solved by the platform. Intl is Baseline widely available since September 2017 (MDN), Intl.Segmenter since April 2024 (MDN), Intl.DurationFormat since March 2025 (MDN). No patch needs a formatting library.
    • Money survives without a decimal library on the display path: Intl.NumberFormat.prototype.format() accepts a string and uses its exact value rather than coercing through a double (MDN) — which matters because Patchy returns Postgres int8 and numeric as strings (packages/sdk/skills/patchy-postgres/SKILL.md). Arithmetic on those strings still needs something; that is an SDK helper, not an allowlist entry.
    • Temporal is not a 2026 answer for browser code: it reached Stage 4 and shipped in Firefox 139 and Chrome 144, but Safari has not shipped it, and MDN marks it "not Baseline" (MDN, caniuse). temporal-polyfill is ~1 MB unpacked (npm registry) against a 10 MiB bundle cap.
    • Accessible comboboxes are the clearest "do not hand-roll" case: the ARIA APG combobox pattern requires seven ARIA attributes and 44+ distinct keyboard behaviours across its popup types (W3C APG). An agent will write something that looks right and is unusable by keyboard.
    • [email protected] (Apache-2.0) buys combobox, date picker, calendar, listbox, menu, dialog and table from one vendor with one audit, and its direct dependencies are all Adobe-published plus client-only and @swc/helpers (npm registry).
    • @internationalized/[email protected] — already transitively present under React Aria, one dependency (@swc/helpers) — is the time-zone arithmetic answer until Temporal is Baseline (npm registry).
    • Spreadsheet generation splits cleanly on runtime fit: exceljs depends on archiver, unzipper, tmp and readable-stream and declares engines.node (npm registry), while write-excel-file depends only on fflate and ships ./browser and ./node subpaths (npm registry).
    • SheetJS is disqualified by distribution, not by quality: the vendor states the npm registry copy is stuck at 0.18.5 and that their own CDN is authoritative (docs.sheetjs.com). An allowlist of exact npm versions cannot express that.
    • pdf-lib is pure JavaScript (pako, tslib, two @pdf-lib/* packages) and would run on workerd and Deno (npm registry), but its last release was v1.17.1 on 2021-11-06 with the repo last pushed 2024-07-17 and 317 open issues (gh api repos/Hopding/pdf-lib). Adopting it is adopting maintenance.
    • Charting is where "one audited version" gets expensive: [email protected] pulls @reduxjs/toolkit, react-redux, immer, es-toolkit, victory-vendor and five more (npm registry). A dashboard that draws its own SVG is a defensible first release.
    • Server-side HTML sanitisation has no clean answer: DOMPurify needs a DOM and uses jsdom outside the browser (npm registry); neither workerd nor Deno gives you one. Sanitise in the frame or do not accept HTML.
    • Workerd and Deno both now cover the Node surface these packages want anyway — Workers enable Node APIs by default for compatibility dates from 2026-08-04 (Cloudflare) and Deno polyfills 22 Node modules fully (Deno) — so "no Node built-ins" is a portability preference for Patchy, not a hard runtime constraint on either candidate.
    • Recommendation: six client entries (react, react-dom, react-aria-components, @internationalized/date, @tanstack/react-table, @tanstack/react-virtual) plus papaparse and libphonenumber-js; an empty server list at first tier 2 release; and eight SDK helpers whose absence is what actually blocks the three tools.

    Method and the three tools

    I read the SDK surface in the checkout (docs/product.md §Patches and §Tier 1, the five packages/sdk/skills/*/SKILL.md, packages/patchy/src/config.ts, packages/patchy/src/initProject.ts), then went to primary sources for every external fact.

    What the SDK gives today, in one paragraph: typed owned tables with indexed, cursor-paged list, get/getMany, insert/insertMany, update, delete; file stores with put/get/list/delete/url; read-only shared tables; read-only company Postgres with relation reads and one shaped query. What it does not give: any UI, any outbound network, any client storage, any download, any worker, any background execution. The starter repo is Vite plus vite-plugin-singlefile with strict TypeScript and vanilla DOM — no React, no component library (packages/patchy/src/initProject.ts). The binding constraints for anything an agent adds are a 10 MiB single-file bundle, 300 calls per viewer per minute, 32 outstanding requests, 1,000-row / 8 MiB pages, 20 MiB files, and a 10-second Postgres statement timeout (patchy-loop, patchy-tables, patchy-files, patchy-postgres skills).

    Tool 1 — Contacts / companies / deals, with attachments and CSV import

    Client, in the order an agent hits them: a component runtime (react, react-dom); a router (the shell owns routes, so this is a thin bridge, not react-router); forms and validation; a combobox to attach a contact to a company and to pick a deal owner; a date picker for close dates; a grid over a few thousand contacts with sort, filter, column resize and virtualised rows; a kanban board for the pipeline; phone number parsing and formatting on paste; currency formatting; a CSV parser for the import file the user drops on the page; a file picker and preview for attachments; a rich-text or markdown field for notes; toasts.

    Server, once tier 2 exists: bulk CSV import with dedupe and per-row error reporting; quote or summary PDF generation; XLSX export; email normalisation. Everything outbound stays an integration, so no HTTP client and no vendor SDK belongs on the list.

    Tool 2 — Approvals workflow

    Client: the same grid and combobox; a status timeline; relative timestamps ("submitted 3 days ago") and absolute timestamps rendered in the viewer's zone; a comment thread; a diff view of what changed; a date/time picker with a time zone for a deadline. Server: policy evaluation over a small state machine; business-day and SLA arithmetic; recurrence for periodic re-approvals; idempotency keys; content hashing of the approved payload.

    Tool 3 — Reporting dashboard over company Postgres

    Client: a date-range picker; charts (line, bar, stacked bar, one donut someone will ask for); a pivot/group-by over a bounded page; number, percent and currency formatting; a virtualised results table; CSV/XLSX export. Server: mostly nothing — aggregation belongs in the SQL the query method already runs; the temptation is a caching layer, which is tier 3's problem, not tier 2's.

    Classification

    A. The Web platform already gives it

    Need API Availability workerd Deno
    Number, currency, percent, date, list, plural, relative-time formatting Intl.* Widely available since Sept 2017 (MDN) Documented as supported (CF) V8-backed (ICU scope unverified — see Open questions)
    Exact-value formatting of numeric/int8 strings Intl.NumberFormat.format(string) format() widely available; string argument is newer (MDN) via Intl via Intl
    Duration display ("2 hr 15 min") Intl.DurationFormat Baseline newly available, March 2025 (MDN) via Intl via Intl
    Word/grapheme counting, CJK-safe truncation Intl.Segmenter Baseline, April 2024 (MDN) via Intl via Intl
    Client-side ids crypto.randomUUID() Widely available since March 2022, secure context only (MDN) Web Crypto 🟢 (CF) yes
    Hashing, HMAC, signatures SubtleCrypto Web Crypto 🟢 yes
    Deep copy of form/draft state structuredClone() Widely available since March 2022 (MDN) — —
    Group rows for a dashboard Object.groupBy / Map.groupBy Widely available since March 2024 (MDN) — —
    gzip a payload CompressionStream Widely available since May 2023 (MDN) deflate/deflate-raw/gzip (CF) yes
    Popovers, menus, modals without a positioning library Popover API, <dialog> Baseline newly available, January 2025 (MDN) — —
    A plain date field <input type="date"> Widely available since April 2021, but browser-dependent UI, no ARIA role, value always yyyy-mm-dd (MDN) — —

    The honest reading of the last row: <input type="date"> is enough for a required close-date field and is not enough for a range picker with a time zone. That is the line between category A and category C here.

    B. An agent writes it in under a hundred lines

    CSV writing (quote/escape/CRLF/BOM); a debounce; slug and initials; integer-cents money math; a cursor loop over list; client-side sort and filter of a bounded page; tabs and accordions from <details>; a toast; an approvals state machine as a switch over statuses; business-day arithmetic against a company holiday list; a diff of two flat records; optimistic insert with rollback; a kanban board over HTML5 drag events (with the caveat that its keyboard story is nothing); an SVG bar or line chart with axis ticks from Intl.NumberFormat.

    Two things that look like this category and are not: CSV parsing of a file a human produced (quoted newlines, BOM, sep=, Excel's dialects) and anything with a listbox and a keyboard.

    C. Needs mature behaviour

    • Accessible combobox / autocomplete. Seven ARIA attributes, 44+ keyboard behaviours (W3C APG). [email protected], Apache-2.0, deps react-aria, react-stately, @react-types/shared, @internationalized/date, @internationalized/string, client-only, @swc/helpers (npm).
    • Date picker, calendar, range picker. Same package, same audit.
    • Time-zone and calendar arithmetic. @internationalized/[email protected], one dependency (npm). The alternative, [email protected], is ~1 MB unpacked with two dependencies (npm).
    • Data grid. @tanstack/[email protected] (MIT; deps @tanstack/table-core, @tanstack/react-store) plus @tanstack/[email protected] (MIT; one dep) (npm, npm). Headless: the agent still writes the markup, so the a11y is still the agent's.
    • Rich text. @tiptap/[email protected] is small itself but peer-depends on @tiptap/core and @tiptap/pm (ProseMirror) (npm). A real allowlist entry is three-plus packages.
    • Recurrence. [email protected], BSD-3-Clause, one dependency (tslib) (npm).
    • Phone parsing. [email protected], MIT, no runtime dependencies, with ./min, ./max and ./mobile metadata subpaths so the bundle cost is a choice (npm).
    • CSV parsing. [email protected], MIT, zero dependencies (npm).
    • PDF generation. [email protected] (see Summary for its maintenance state).
    • Spreadsheet generation. [email protected] (dep: fflate@^0.8.2, itself dependency-free, "8kB" (npm)) versus [email protected] (nine dependencies, Node-shaped).
    • Charts. [email protected]'s eleven dependencies (npm) are the argument against putting a chart library in the first allowlist.
    • HTML sanitisation. [email protected], no runtime dependencies, but DOM-only (npm).

    D. The SDK should ship it once for everyone

    Every item here is Patchy-specific: its shape is set by Patchy's bounds or its refusals, so a hundred agents would otherwise write a hundred slightly-wrong versions of it.

    1. Shell-mediated download. In-frame downloads are unsupported and "downloads belong to the shell" (patchy-loop). Without this, CSV export, PDF export and "save the attachment" are all impossible at tier 1 regardless of what is on the allowlist.
    2. listAll / async iterator over cursors. All four data skills describe the same cursor loop and the same "stop on null, not on a short page" rule.
    3. Batched insertMany with per-row errors. Bounds (1,000 items, 8 MiB, all-or-nothing per batch) are Patchy's, not the agent's. This is the backbone of CSV import.
    4. toCsv. Pairs with (1); ~40 lines that everyone gets subtly wrong.
    5. Decimal helpers for Postgres strings. int8 and numeric arrive as strings; compare, sum and round them without a float round-trip, then hand to Intl.NumberFormat.
    6. File-input helper. File → put with content-type, the 20 MiB guard, and url() lifecycle/close() handling.
    7. unknown_outcome reconcile helper. The skills forbid automatic replay and prescribe read-then-offer-retry; that is a typed helper, not prose.
    8. React bindings for the generated client (usePatchyList, usePatchyRow): loading, error, cursor and refetch state. The moment React is on the allowlist, every patch writes these by hand.

    Runtime fit on workerd and Deno without Node built-ins

    Assessed against the direct dependency graphs above. Note first that "without Node built-ins" is Patchy's choice: Workers enable Node APIs by default for compatibility dates of 2026-08-04 or later and behind nodejs_compat before that, with fs, stream, crypto, buffer and zlib all fully supported (Cloudflare); Deno fully supports 22 Node modules and partially supports 16 more (Deno).

    • Clean on both, no Node built-ins: libphonenumber-js, rrule, @internationalized/date, temporal-polyfill, zod, fflate, write-excel-file (via ./browser), pdf-lib (pure JS plus pako), @tanstack/table-core.
    • Clean with care: papaparse — the string-parsing core is portable, but its documented strengths are the browser ones (web workers, FileReader) and its Node paths want node:stream (npm). On a server, parse from a string or use the streaming API only if Node streams are allowed.
    • Not clean: exceljs (archiver, unzipper, tmp, readable-stream, engines.node >= 8.3.0) and dompurify (needs a DOM; jsdom outside the browser). Neither belongs on a Node-free server list.
    • Bundle budgets are not the constraint on either runtime. Cloudflare documents a 64 MiB uncompressed limit on both Free and Paid plans with no compressed limit, plus a 1-second startup CPU budget for top-level code (Cloudflare) — the startup budget, not the size, is what a font-parsing PDF library would test. Wrangler bundles npm dependencies with esbuild by default (Cloudflare).
    • The real budget is tier 1's 10 MiB single-file HTML bundle, where React plus React Aria plus a grid plus chart library plus libphonenumber-js/max metadata adds up fast. Pick metadata subpaths deliberately.

    How comparable platforms answer dependencies

    • Val Town — open, pinned after the fact. npm:, jsr: and bare HTTPS imports (esm.sh, deno.land) all work; the sandbox blocks filesystem access, and the docs' own advice for packages that break on that is "using esm.sh is often an effective workaround" (docs.val.town). Saving a val regenerates a deno.lock that pins versions and hashes; unpinned imports are re-pinned to whatever is current at save time (docs.val.town).
    • Windmill — inference, not declaration. It parses top-level imports and resolves them from npm with no manifest, pinning into a generated lockfile at deploy, and caches dependencies on workers (windmill.dev). No allowlist.
    • Convex — two runtimes, one bundler. The default runtime takes "most npm libraries that work in the browser, Deno, and Cloudflare workers"; anything Node-specific must go in an action with "use node" (docs.convex.dev). esbuild bundles the convex/ tree to a 32 MiB limit, the default runtime has no dynamic imports, and Node-runtime packages can be externalised up to 45 MB zipped (docs.convex.dev).
    • Retool — the curated one, and the closest analogue. A fixed preloaded set (Lodash, Moment, uuid, Numbro, PapaParse, i18next) is always there (docs.retool.com); anything else is an externally hosted UMD URL added per app or per organisation (docs.retool.com); and a custom component library is a locally built React/TypeScript bundle deployed as an immutable version via retool-ccl, where "almost any npm packages that support being run in the browser" are allowed because the customer, not Retool, bundles them (docs.retool.com).
    • Cloudflare Workers — bring your own, bundled at deploy, with Node built-ins gated by compatibility date (Cloudflare, Cloudflare).

    The pattern worth stealing is Retool's split: a short always-there set that covers the boring 80%, plus an escape hatch that is built and versioned outside the platform. Patchy already has that escape hatch and it is called copied source.

    Open questions

    • Whether Deno and workerd ship full ICU data (all locales) for Intl, or a trimmed set. Cloudflare's page documents Intl but says nothing about ICU scope; Deno's Node-API page does not cover it.
    • Whether the Cloudflare limits page's "no compressed size limit / 64 MiB uncompressed" applies to all account types, and how it interacts with the 1-second startup CPU budget for a library like pdf-lib.
    • Which runtime tier 2 will actually use. Every server-side fit above is conditional on that decision (Tier 2 map — hosted patches that run while someone has them open #294).
    • The measured gzipped cost of react + react-dom + react-aria-components + @tanstack/react-table inside a vite-plugin-singlefile bundle. Not measured here; it decides whether the recommended client list fits comfortably under 10 MiB or uncomfortably.
    • Whether React Aria's drag-and-drop covers a kanban board (column-to-column with keyboard), which would remove dnd-kit from consideration entirely.
    • Whether the shell's print affordance (product.md: the response CSP and the iframe both allow printing) is an acceptable substitute for generated PDFs for quotes and reports.
    • The mechanics of the allowlist itself: who audits, and whether entries carry integrity hashes the way the patchy tarball does through GET /api/release.
    • Attribution obligations for copied source under Apache-2.0 (React Aria) and MPL-2.0 (DOMPurify) — copying is legally fine, but the notice requirements differ from MIT and nobody has written down where those notices live in a patch repo.

    Recommendation

    Candidate first allowlist — client

    Package Version Why
    react / react-dom 19.x Already decided; everything below assumes it.
    react-aria-components 1.21.1 One audit covers combobox, date picker, calendar, listbox, menu, dialog and table — the whole set of things an agent cannot get right (44+ keyboard behaviours per APG). Apache-2.0, single-vendor dependency graph.
    @internationalized/date 3.12.4 Time-zone and calendar arithmetic without Temporal (Safari has not shipped it). Already in the tree under React Aria; listing it explicitly makes it usable directly.
    @tanstack/react-table 9.2.4 Sorting, filtering, column sizing and grouping for the contact/deal/report grids. MIT, two dependencies.
    @tanstack/react-virtual 3.14.13 Paired with the above; a 1,000-row page renders without virtualisation, ten pages do not.
    papaparse 5.7.0 CSV import of files humans made. Zero dependencies, and the one category-B lookalike that is genuinely not category B.
    libphonenumber-js 1.13.13 Phone parsing and formatting; use ./min metadata by default. No runtime dependencies.

    Deliberately excluded: a validator (zod/arktype) — the config already has the t column language, and a validator generated from t shapes is a better answer than a second schema vocabulary; a chart library; a rich-text editor; clsx/tailwind-merge (four lines each); any HTTP client, date-formatting or utility library.

    Candidate first allowlist — server

    Empty at the first tier 2 release, as decided. The first two candidates when it opens are [email protected] (portable, but adopt-the-maintenance) and [email protected] (portable; exceljs is not). [email protected] follows if approvals grow recurrence.

    Candidate helper floor

    The eight items in section D, in priority order: shell-mediated download; listAll cursor iterator; batched insertMany with per-row errors; toCsv; Postgres decimal helpers; file-input helper; unknown_outcome reconcile; React bindings for the generated client. Items 1 and 3 are the difference between "a CRM is possible" and "a CRM is possible except for import and export".

    Deferred, and what each deferral costs

    • Rich text — notes are plain text or a tiny markdown subset. Cost: no bold/links/lists in notes, and pasting from Word loses everything. Revisit when a real user complains, not before.
    • Charts — dashboards draw their own SVG. Cost: no tooltips, no legend interaction, no brush/zoom, and axis ticks an agent chose. This is the most likely first regret.
    • PDF generation — mitigated today by the shell allowing printing; the browser's print-to-PDF covers a quote or a report page. Cost: no pixel control, no headers/footers, no templated multi-page invoice.
    • XLSX — CSV only. Cost: no formatting, no multiple sheets, no formulas; Excel's CSV import dialogue is a papercut for non-technical users.
    • Temporal / temporal-polyfill — use @internationalized/date. Cost: a second date vocabulary to unlearn when Safari ships Temporal.
    • Server-side HTML sanitisation — do not accept HTML. Cost: no HTML email bodies or pasted markup stored in tables; DOMPurify needs a DOM neither candidate runtime has.
    • Drag-and-drop kanban — HTML5 drag events, or a status dropdown. Cost: keyboard users get the dropdown, which is the honest accessible path anyway.
    • A general utility library — none. Cost: nothing; Object.groupBy, Array.prototype.toSorted and structuredClone cover what Lodash was for.

    Verification pass

    Every URL cited above was re-opened after drafting. All resolved and all quoted facts matched. One correction folded into the text: MDN's Temporal page carries a "Limited availability — this feature is not Baseline because it does not work in some of the most widely-used browsers" banner and no version table, so the Chrome 144 / Firefox 139 / Safari-pending detail is carried from caniuse, which on re-check reports 71.34% global support, Chrome and Edge from 144, Firefox from 139, and Safari support only in Technology Preview (caniuse). Two URLs that appear in earlier drafts of this research returned 404 and were replaced by the canonical pages cited here: docs.val.town/reference/imports/ (→ /reference/import) and developers.cloudflare.com/workers/development-testing/bundling/ (→ /workers/wrangler/bundling/). npmjs.com/package/pdf-lib returns 403 to automated fetches; its maintenance facts come from the GitHub API instead.

  3. allisonmahmood commented on Sep 19, 2026

    @allisonmahmood
    OwnerAuthor

    Report B: astra via omp, with tools (full findings)

    CRM-class patch dependencies

    Research for #309, checked 2026-09-19. Repository context is commit ef3e790d5b924932fa4161000a4c395e6b84ae7b. Recommendations below are proposals, not shipped SDK features or an audited package release. Product source

    Summary

    • Keep the closed, release-pinned dependency policy. The settled design is handler-shaped code with broker-only effects, not an arbitrary Node application. Dependencies must not reopen filesystem, credential, database-driver or network access. Decisions
    • Recommend one client UI family beyond React: React Aria Components for searchable selections, date pickers and accessible tables. Do not maintain equivalent handwritten widgets or immediately add a second table library. ComboBox, DatePicker, Table
    • Use Web APIs before adding utility packages: Intl, Web Crypto, URL, encoding, structuredClone and Streams cover substantial formatting and data-handling needs. API availability does not authorize external access. Workers APIs, Web Crypto, Deno APIs, Patchy policy
    • Temporal is Stage 4, not merely a proposal awaiting standardization. That does not establish deployment availability. The local check found native Temporal in Deno but not workerd; use one pinned date library rather than assume it exists everywhere. TC39, runtime check
    • CSV deserves a shared SDK helper backed by Papa Parse. Quoted multiline fields, parse errors and spreadsheet-formula escaping are existing library behavior, not a good hundred-line replacement project. Papa Parse
    • Phone parsing and decimal arithmetic deserve small, explicit candidates: libphonenumber-js/min and decimal.js. Minimal phone metadata is not strict global number validation; decimal precision and rounding remain product choices. Phone metadata, Decimal API
    • Approvals need atomic server-side transition rules, not a workflow npm package. Unattended reminders and scheduled escalation remain tier 3, even if a recurrence library can calculate dates. Decisions, rrule
    • Reporting should aggregate through the existing company Postgres broker. It already accepts parameterized read-only queries and preserves numeric and int8 as strings. Do not add a patch-owned Postgres driver or another connection pool. Wire contract, prior database research
    • Eight computation packages passed focused checks in Deno and workerd without Node-module imports, with process and Buffer absent. This proves selected operations, not every export, production containment or acceptable memory use. runtime check
    • Retool's library catalog is useful precedent; Val Town and Windmill demonstrate version locking, and Convex and Workers demonstrate deployment bundling. Their broader dependency permissions are not Patchy's policy. Retool, Val Town, Windmill, Convex, Workers
    • Keep rich text, advanced grids, rich charts and document generation deferred with named limitations. A plain-text CRM with bounded lists, CSV exchange and modest charts is a concrete offer, not a promise of Excel or a document editor. Map scope, TanStack, Lexical, PDF limits, SheetJS formulas
    • Package needs do not justify changing hosting. Preserve the portable Azure-now/AWS-later direction and reuse the prior runtime and Daytona research. Credits do not turn the deferred whole-app model into the selected handler model. Map, runtime research, Daytona research

    Detail

    1. What the three concrete tools need

    This inventory is a proposed implementation of the ticket's three examples. It builds on the existing tables, files, shared reads and Postgres SDK, rather than counting those as missing npm functionality. Today's browser client already supplies files.put, get, download and url. The planned tier 2 client instead calls its server functions, with me and authorized file-byte handles as exceptions. Client source, decisions

    Tool What an agent would reach for on the client What an agent would reach for on the server Recommended allocation
    Contacts, companies and deals CRM, attachments, CSV import React; searchable company/contact pickers; date picker; table/grid; CSV parser; phone formatter; upload component; rich-text notes CSV parser; phone normalization; decimal calculations; validation; ORM; PDF/XLSX exports React Aria and pure computation candidates; SDK CSV and existing file operations; company-owned field mappings and deal rules; no ORM; plain-text notes and CSV exports initially. UI, CSV, phone, files
    Approvals workflow Form library; approver picker; due-date picker; inbox table; rich text State-machine library; date arithmetic; recurrence; queue/email SDK Native forms plus React Aria; a small transition table inside an atomic mutation; date library for zoned deadlines; defer autonomous escalation and mail unless a broker capability exists. Dates, handler kinds
    Dashboard over company Postgres Table/grid; chart library; date-range controls; number formatting; spreadsheet export Postgres driver; query builder; dataframe library; decimal library Brokered SQL aggregates; Intl display; decimal arithmetic only where needed; bounded result tables and simple charts; defer rich spreadsheet export. Wire contract, formatting, Decimal

    External Postgres reads belong in the planned action category, not automatically tracked queries over patch-owned data. A dashboard must not promise automatic invalidation when the external database changes. That follows from the settled handler split, not from choosing a chart package. Decisions

    The earlier research remains context, not a fresh hosting survey: #13 establishes the isolation questions; #24 evaluates Daytona's whole-app fit; #178 establishes database placement, pool budgeting and transaction constraints. This ticket adds dependency evidence without reopening those decisions. #13, #24, #178

    2. What the Web platform and short company-owned code cover

    Need Existing capability Boundary
    Locale formatting and ordering Intl formats dates and numbers; use explicit locale and time zone where reproducibility matters. Formatting is not business-calendar arithmetic. Web APIs, date ambiguity
    IDs and cryptographic operations crypto.randomUUID, getRandomValues, subtle.digest, signing and verification. No need for UUID/hash packages for these operations. Credentials still remain behind Patchy; query-safe clock/random behavior needs a runtime contract. Crypto, decisions
    Value copying structuredClone supports structured values, including cycles and typed data. Not a persistence format or a way to copy arbitrary executable behavior. Deno API inventory
    URLs and text/bytes URL, URLSearchParams, TextEncoder, TextDecoder. Constructing a URL does not grant permission to fetch it. Web APIs, product
    Incremental byte processing Readable, writable and transform streams provide composition and backpressure. Streams do not implement CSV/XLSX parsing or create a streaming broker protocol. Streams standard
    Simple forms and dates Native inputs supply required/min/max constraints and date values. A calendar date is not an instant with an IANA time zone. HTML standard, Temporal model

    Temporal's primary implementation list records Stage 4 and shipped Firefox and Chrome implementations, but does not record Safari as shipped. The safe conclusion is to declare a browser/runtime baseline, not to assert universal support or universal absence. @internationalized/date already supplies calendar and zoned types used by React Aria, so prefer it over adding both it and a Temporal polyfill. TC39, Adobe date

    [INFERENCE] An agent can reasonably write each of a bounded array filter, a status-label map, simple required-field checks, a finite approval transition guard, or a small labeled SVG bar display in under 100 lines. These are engineering estimates, not measured implementations. Keep those as company-owned source. The estimate does not cover a complete grid, arbitrary currency rules, CSV parser, rich-text editor, accessible combobox or daylight-saving calculations. The published keyboard/focus rules and date ambiguity cases explain why those replacements are materially larger contracts. ARIA combobox pattern, time-zone ambiguity

    Copied source is allowed by the map, but copying a component does not remove its imports or maintenance burden. shadcn explicitly distributes editable source layered over dependencies. Copy small compositions, preserve their license notices, and still resolve imports against Patchy's list. Do not describe vendoring a large library as eliminating supply-chain risk. Decisions, shadcn's model

    3. Which mature packages run without Node built-ins

    The distinction is browser UI versus computation, not npm versus non-npm. A browser component does not become a usable handler API because its JavaScript bundles successfully. React Aria components, Lexical editor model

    Candidate Node-free workerd and Deno assessment Proposed role
    Papa Parse 5.7.0 Executed string parsing and serialization in both. Remote download and worker modes were not exercised and are outside Patchy's policy. API SDK-internal CSV implementation.
    decimal.js 10.6.0 Executed decimal addition in both. API Allowlisted computation.
    libphonenumber-js/min 1.13.13 Executed US national-to-international parsing in both. API Allowlisted computation.
    @internationalized/date 3.12.4 Executed calendar-day addition across a DST change in both. API Shared client/server date library.
    @js-temporal/polyfill 0.5.1 Executed equivalent zoned arithmetic in both. Compatible alternative, not a second initial date library.
    rrule 2.8.1 Executed a bounded two-occurrence rule in both. TZID support uses Intl; its floating-time conventions require care. API Deferred recurrence calculation, not a scheduler.
    pdf-lib 1.17.1 Created, saved and reloaded a one-page PDF in both. Technically viable, product-deferred. Limits, scope
    SheetJS CE 0.20.3 Wrote and read an in-memory XLSX containing a numeric cell in both. Technically viable, product-deferred. Use the vendor distribution, not npm's stale xlsx entry. Distribution
    React Aria, charts, Tiptap/Lexical Their interactive UI requires a browser document or canvas, not a handler runtime. UI packages were not executed in this research. Chart.js's documented server recipe adds a canvas implementation. React Aria, Chart.js, Tiptap, Lexical Client-only candidates; no server UI imports.
    TanStack Table A headless table engine, not finished markup. Its server-side core was not executed here; do not infer complete runtime compatibility from “headless.” Overview Deferred until advanced table state is needed.

    Runtime check

    Original local observations, using published Deno 2.9.7 and workerd 1.20260919.1, not vendor performance claims. Eight packages above were bundled with esbuild 0.28.2 using --bundle --platform=browser --format=esm; its dependency graph had no external imports. The same bundle ran in both engines.

    Deno ran with --no-config --no-prompt --deny-net --deny-read --deny-write --deny-env --deny-run --deny-ffi; the runner deleted process and Buffer before importing the bundle. workerd used compatibility date 2026-09-19 and explicitly set no_nodejs_compat and no_nodejs_compat_v2. Both reported those globals as undefined.

    The negative flags matter. Current Workers documentation enables Node compatibility by default for dates on or after 2026-08-04. An earlier check merely omitted the positive flag; verification caught and corrected that insufficient condition. Current Node compatibility documentation

    Observed outputs included decimal 0.3, phone +12133734253, the next calendar day's noon in New York resolving to 2026-03-08T16:00:00Z, one reloaded PDF page, and XLSX round-trip {amount:123}. CSV preserved a BOM-prefixed header, quoted comma, embedded newline and escaped quote; formula escaping prefixed =1+1 with an apostrophe. Native Temporal was an object in Deno and undefined in workerd.

    These are selected-operation checks, not full package certification, hostile-input tests, browser accessibility checks or resource benchmarks. They make no claim about a production broker or sandbox. workerd itself explicitly requires additional containment for malicious code. Upstream warning

    4. What the SDK should ship once

    Proposed helper floor, to freeze after the reference CRM as the map requires. Dependency decision

    1. A typed CSV helper. Accept supplied text or bounded bytes, not URLs. Provide preview, explicit header/column mapping, row-numbered errors and export with escapeFormulae. Keep values as strings until schema conversion; do not accidentally turn phone numbers or identifiers into numbers. Treat renamed duplicate headers as a decision for the importer, not silent success. Papa supplies parsing; Patchy supplies the bounded, consistent contract. Papa options
    2. Bounded page and batch helpers. Reuse cursors and server limits, stop on cancellation, and distinguish confirmed batches from unknown outcomes. Today's insertMany cap is 1,000 rows and 8 MiB; files have a 20 MiB limit. A multi-batch import must not claim whole-file atomicity or silently retry an ambiguous mutation. Tier 2 batches must call server functions, not resurrect direct client table writes. Wire contract, product limits, decisions
    3. File-handle conveniences, not another upload stack. Preserve existing byte upload/download/preview behavior while adapting it to tier 2's authorized handles. Teach agents to use those APIs instead of file-saver, direct blob-storage SDKs or in-frame downloads. Route handling already belongs to the shell. Client, product, decisions
    4. One handler validation/error contract. Carry the chosen handler schemas into generated client types and useful field errors. Do not add Zod, Yup and a form framework merely to duplicate that contract. Keep approval eligibility, CSV field mapping and financial rounding in the patch, not a generic Patchy CRM framework. Atomicity belongs to the mutation runtime, not a helper's JavaScript control flow. Planned handler contract

    5. How the five platforms answer dependencies

    These are documented policies, not executed vendor integrations.

    Platform Dependency mechanism Useful precedent and mismatch
    Val Town Deno-style npm:, jsr:, URL and node: imports. Saving generates deno.lock with versions and hashes. Imports, locking Copy immutable resolution. Do not copy the open import policy.
    Windmill Resolves top-level imports, generates a per-script lockfile on UI deployment and reuses it at runtime. Offers Bun and Deno paths plus Node-oriented modes. Imports, runtimes Copy deploy-time locking. Worker dependency installation and broad runtime modes are unnecessary for Patchy's fixed catalog.
    Convex CLI esbuild-bundles functions and dependencies. The default runtime constrains queries/mutations to deterministic execution; "use node" is an action-only alternative. Node external packages may be installed server-side. Runtimes, bundling Copy the narrow default and immutable bundles, not the Node escape hatch or arbitrary packages.
    Retool classic apps Browser-sandboxed custom JS; preloads include Lodash, Moment, UUID, Numbro and Papa. Extra externally hosted libraries should be dependency-free UMD builds. Custom JS, preloads A small product-provided catalog is useful. CDN loading is not suitable for Patchy's self-contained frame.
    Retool Workflows Separate server library catalog with named versions, plus custom package.json dependencies. New workflows do not automatically inherit app preloads. Workflow libraries Copy explicit client/server separation. Its optional npm model and broad catalog are not a minimal allowlist.
    Retool new app builder Allows public npm packages, with version-age and license gates; private packages are unsupported. Package policy Do not mistake age/license filtering for audited release pinning.
    Cloudflare Workers Wrangler bundles npm dependencies from package.json. Current compatibility dates enable a Node API subset and compatibility shims by default. Bundling, Node compatibility Copy build-time bundling and pinned runtime behavior. Managed Workers and self-hosted workerd are distinct deployment choices; the latter is not a hardened sandbox by itself. workerd

    What each candidate cannot do

    Candidate or deferred facility Honest limitation
    React/React Aria Supplies UI building blocks, not CRM business rules or authorization. Table navigation, sorting and selection do not constitute an Excel replacement. Async picker loading must call Patchy, not fetch directly. Components, broker rule
    Native APIs and short copied helpers Do not replace mature accessibility, international phone metadata, recurring-calendar semantics or file-format implementations. Keep the handwritten scope narrow. ARIA, phone, rrule
    Papa-backed CSV Does not define deduplication, row validation or transactional import behavior. CSV exchange does not preserve workbook formulas, styles or multiple sheets. Papa contract, SheetJS model
    Minimal phone metadata Does not provide full digit validation and number-type detection. Parsing is not proof that a number is reachable or owned by a person. Do not reject a contact merely because old metadata considers it invalid. Metadata guidance, Google's validation boundary
    Decimal/date libraries Do not choose currency policy, business holidays or DST ambiguity policy for the app. Neither schedules work. Decimal settings, date model, tier boundary
    Deferred TanStack and rich charts Initial tools get bounded tables, KPIs and simple labeled charts, not a configurable analytical grid or rich chart interactions. TanStack itself still requires markup. Server Chart.js needs more than a Web-only handler. TanStack, Chart.js
    Deferred Tiptap/Lexical Notes remain plain text. Do not promise rich paste, mentions, document collaboration or arbitrary HTML rendering. An editor framework alone does not define Patchy's storage, rendering or collaboration contract. Tiptap, Lexical
    Deferred rrule Can calculate occurrences; cannot make reminders run after the last viewer leaves. rrule, tier boundary
    Deferred PDF/XLSX No hosted formatted-document promise. pdf-lib cannot render HTML/CSS and does not support encrypted documents. SheetJS CE reads/writes formulas but does not automatically calculate their results. PDF limits, SheetJS formulas
    workerd/Deno compatibility A successful package call does not establish multi-tenant containment, bounded execution or permission to use stock network APIs. workerd warning, Patchy execution rules

    Open questions

    • Can React Aria's chosen compositions operate correctly in Patchy's exact opaque-origin frame? Focus, overlays, keyboard navigation, screen readers and paste require an actual reference-CRM check. Documentation and this computation experiment do not establish that. Frame constraints
    • What are the release's exact transitive package graph, permitted subpaths and reviewed tarball hashes? Registry pins below identify candidates, not completed security audits. React Aria itself declares several dependencies, including version ranges. Manifest
    • What browser baseline and execution-service clock/random/locale contract will Patchy promise? TC39 status alone does not settle this, and the measured engines differed on native Temporal. TC39, runtime check
    • What CSV byte/row caps fit real CRM imports without freezing the viewer or exhausting a handler? What document sizes fit eventual PDF/XLSX execution? No representative performance or hostile-file workload was measured.
    • How much table/chart functionality does the fresh-agent reference CRM actually need? Do not approve an entire grid/editor ecosystem before that experiment. Map acceptance journey

    Recommendation for Patchy

    Adopt this candidate first list, subject to the reference CRM and release audit. Names and versions below come from the cited registry records, not floating install instructions.

    Public import Candidate exact pin Allowed location
    react, react-dom 19.3.0, 19.3.0 Client, with required JSX and client-rendering subpaths.
    react-aria-components 1.21.1 Client only.
    @internationalized/date 3.12.4 Client and handlers.
    decimal.js 10.6.0 Client and handlers.
    libphonenumber-js/min Package 1.13.13 Client and handlers; restrict the permitted subpath.

    Pin matching compile-time @types/react and @types/react-dom at 19.3.0. Keep Papa Parse 5.7.0 behind the typed SDK CSV helper rather than exposing its download/worker options as the default patch interface. Its code still belongs in the audited dependency graph; wrapping it does not make that obligation disappear.

    Bundle approved bytes at publish, pin the whole transitive graph, preserve license notices and reject unexpected external/runtime imports. Keep small UI compositions and business rules as company-owned source. Do not build a generic adapter for every vendor's package model. This follows the map's explicit resolver-policy distinction: copied code can contain library code, so the allowlist is not proof of source provenance. Dependency decision

    The trade-off is deliberate. Patchy maintains a small set of mature behavior instead of encouraging every agent to recreate accessibility, CSV and date handling. Users initially give up rich documents, spreadsheet-style interaction and autonomous workflows. That is compatible with the selected viewer-present CRM and avoids changing hosting merely to satisfy incidental npm dependencies. Map

    Verification pass completed against every cited external source. Reopened documentation was checked against the claims; exact-version registry records were checked against the initially retrieved versions and integrity values. Corrections included implicit Node compatibility, Temporal's actual status and runtime availability, existing file helpers, and stale npm SheetJS distribution. UI behavior, vendor services, containment and production performance remain untested as stated above.

  4. allisonmahmood commented on Sep 19, 2026

    @allisonmahmood
    OwnerAuthor

    Resolution

    Two reports ran in parallel (Opus and astra with tools, full text in the two comments above); this is the merge, with the charting session's own checks and opinion. Where the two disagree, the disagreement is named.

    Where both landed

    • The allowlist model has precedent, and it is Retool's. Retool preloads a fixed library set and gates additions by admins; Val Town, Windmill, Convex and Workers all answer "any npm, pinned by a lockfile". Our model is the Retool shape with the release as the audit unit.
    • The Web platform covers formatting outright. Intl (number, currency, date, relative time, list, plural, Segmenter, DurationFormat), Web Crypto including randomUUID, structuredClone, Object.groupBy, CompressionStream, <dialog> and the Popover API. No patch needs a formatting or utility library. Intl.NumberFormat.format accepts a string and keeps its exact value, which matters because the Postgres integration returns numeric and int8 as strings.
    • Temporal is not a 2026 answer. Stage 4, shipped in Firefox 139 and Chrome 144, absent from Safari; astra's runtime check found it native in Deno and absent in workerd. One pinned date library instead: @internationalized/date, allowed in both client and handlers.
    • Accessible widgets are the one thing an agent cannot hand-roll. The APG combobox pattern alone is seven ARIA attributes and 44+ keyboard behaviours. react-aria-components covers combobox, date picker, calendar, listbox, menu, dialog and table from one vendor with one audit (Apache-2.0, Adobe-only dependency graph). Both reports name it the entry that matters most after React.
    • CSV is a library job. Quoted multiline fields, error reporting and formula escaping are not a hundred-line replacement. PapaParse 5.7.0, zero dependencies.
    • Phone numbers: libphonenumber-js with the /min metadata subpath restricted; minimal metadata is formatting and shape, not strict global validation.
    • Server list empty at first release. Everything outbound is an integration; aggregation belongs in the SQL the Postgres integration already runs; approvals need atomic transition rules in a mutation, not a workflow package; recurrence and reminders are tier 3 regardless of what a library can calculate.
    • Deferred, each with its named limitation: rich text (plain text or a tiny markdown subset), charts (own SVG; the most likely first regret), PDF (the shell already allows printing, so print-to-PDF covers a quote or report; no templated multi-page documents), XLSX (CSV only), server-side HTML sanitisation (DOMPurify needs a DOM neither runtime has; do not accept HTML), drag-and-drop kanban (a status control is the accessible path anyway). SheetJS is disqualified by distribution (npm copy frozen at 0.18.5, vendor CDN authoritative), exceljs by Node dependencies, pdf-lib by maintenance (last release 2021).
    • "No Node built-ins" is our choice, not the runtime's. Workers enable nodejs_compat by default from compatibility date 2026-08-04 and Deno polyfills most of Node; the charting session confirmed the Cloudflare page. We disable it deliberately. Astra's runtime check: eight computation packages ran in both Deno and workerd without Node modules, with process and Buffer absent.

    Where they differ, and the call

    • Grid. Opus adds @tanstack/react-table and @tanstack/react-virtual; astra says one UI family, use React Aria's Table, and do not add a second table library until the CRM shows the wall. Astra's call, pending the CRM: pages are already bounded at 1,000 rows.
    • Decimal arithmetic. Astra adds decimal.js; Opus says arithmetic on Postgres numeric strings is an SDK helper, not an allowlist entry. Opus's call: a money helper in the SDK, backed by whatever the audit picks, so the API is Patchy's.
    • CSV exposure. Astra puts PapaParse behind a typed SDK csv helper rather than exposing the package; Opus lists the package. Astra's call: the package is audited in the graph either way, and the helper's download and worker options should not be the patch interface.

    Corrections from the charting session

    • Opus's headline gap ("tier 1 forbids downloads, so a CRM cannot export a CSV") is wrong as stated: the shipped client already exposes a shell-owned download(name) for a stored file, so export is put-then-download today. The real gap is smaller: downloading generated bytes without storing them first. It stays on the helper list at lower priority.
    • Bundle weight of React + React Aria + the rest under the 10 MiB single-file cap was not measured by either report. The init/dev prototype measures it.
    • Attribution notices for copied source under Apache-2.0 and MPL-2.0 differ from MIT; where those notices live in a patch repo is a line for the allowlist ticket.

    Candidate first allowlist (for the allowlist ticket to confirm after the CRM)

    Entry Where Note
    react, react-dom 19.3.0, with matching @types client decided
    react-aria-components 1.21.1 client the accessibility entry
    @internationalized/date 3.12.4 client and handlers dates and time zones until Temporal is everywhere
    libphonenumber-js 1.13.13, /min subpath only client and handlers
    papaparse 5.7.0 inside the SDK csv helper not a patch import

    Server list empty. Grid and decimal libraries wait for evidence.

    Candidate helper floor (for the same ticket)

    Handler-argument schemas through t; typed calls and subscriptions with React bindings for the generated client; csv parse and serialize; a listAll cursor iterator; insertMany with per-row errors; a money helper over numeric strings; download of generated bytes; unknown_outcome reconciliation guidance.

    What the reference CRM must settle

    Whether React Aria's Table and virtualisation carry a 1,000-row page; whether decimal arithmetic shows up in the client at all; the measured bundle size; where a fresh agent reached for a package that is not on the list and what it did instead.

    Merged by Claude Fable 5.1 via Claude Code, 2026-09-19.

  5. allisonmahmood commented on Sep 21, 2026

    @allisonmahmood
    OwnerAuthor

    Addendum, 2026-09-21: React Aria Components retracted

    The UI library is now Preact (see the destination addendum and the contract ticket). Two research lanes independently found that React Aria Components does not run under preact/compat: its collection components render through a synthetic document passed to createPortal, Preact's maintainer closed preact#4539 in July 2026 saying the remaining fix is Adobe's, and Adobe closed react-spectrum#781 as not planned. Every collection component (ComboBox, Select, Menu, ListBox, Table, Tabs) is affected; non-collection primitives are unverified.

    Replacement candidate: Zag.js, which ships a first-party @zag-js/preact adapter (1.44.0, peer preact >=10), framework-agnostic accessible state machines, paid per widget (a dialog is about 14 KB gzipped with shared dependencies; a combobox about 27 KB). Ark UI has no Preact package. The reference CRM proves or rejects Zag.js; keyboard, focus restoration and screen-reader checks must run inside the sandboxed frame.

    Unchanged: @internationalized/date 3.12.4, libphonenumber-js 1.13.13 and PapaParse 5.7.0 are confirmed framework-free with no React peer. The date library lives in Adobe's react-spectrum monorepo but has no React dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wayfinder:research

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions