Selva Reorderly

Implementation status

What has actually been built

This report separates working code from earlier UI work, uncommitted local changes, open tickets, and work that has not yet been deployed to Cloudflare.

Checked 23 August 2026 · repository: selva-reorderly-dashboard · branch: main

Standardized model tickets

9 closed

All nine tickets for the shared SaaS data-model pass are closed in Beads.

Automated verification

105 passed

TypeScript test suite passed, plus 3 deployment tests.

Live production state

Not migrated

No live D1 migration or Cloudflare deployment was performed in this pass.

The core change

Grist is now treated as seed data, not the product model

The implementation defines a canonical Reorderly model first. Selva Grist data is transformed into that model through import and normalization code. The app is no longer supposed to copy every Grist table and column directly into D1.

SourceGrist, CSV, Xero, Zoho, or another connector.
AdapterMaps source columns into canonical fields and records unmapped fields.
Canonical modelShared products, customers, locations, snapshots, events, and planning records.
Tenant moduleOptional manufacturing/BOM capability and client-specific custom fields.

Working code

What was implemented

Canonical data shape

How the main tables are intended to relate

AreaCanonical roleWhat it is not
Items / productsOne item master with ID, SKU, description, type, and shared identity fields.Not a raw-material-only table and not a direct dump of one Grist table.
BOM linesA parent item points to a component item with a quantity. This supports multi-level parent-child structures.Not the ordering queue. It is only enabled for manufacturing tenants.
LocationsWarehouses and other stock locations are first-class records.Not a market label hidden inside a product name.
Inventory snapshotsA dated upload records the stock state for a location and SKU at that point in time.Not an accumulating transaction ledger.
Supply eventsIncoming commitments such as purchase orders or expected receipts.Not the same thing as the current stock snapshot.
Stock movementsTransactions that change stock, such as receipts, transfers, production consumption, and spoilage.Not a replacement for accounting documents. Accounting documents can be mapped into movements.
ReplenishmentA decision projection over the latest relevant inventory snapshot, demand rate, lead time, policy, and supply commitments.Not a second copy of the inventory table.
Customers and salesCanonical customer/account identities with sales lines linked through source mappings.Not a requirement to query Xero or Zoho one account at a time in the UI.

Tickets

Standardized SaaS-model pass

TicketDeliveredStatus
SRD-czk.19Cross-client canonical data contracts and Selva/Derwent validation fixtures.Closed
SRD-czk.20Adapter and upload mapping contract.Closed
SRD-czk.21Customer, supplier, sales, and accounting identity normalization.Closed
SRD-czk.22Locations, inventory snapshots, supply events, and stock movements.Closed
SRD-czk.23Replenishment policies and planning projection.Closed
SRD-czk.24Optional manufacturing and BOM capability.Closed
SRD-czk.25Selva Grist seed-data migration path.Closed
SRD-czk.26Derwent data mapping.Closed
SRD-czk.27Organization capability and onboarding model.Closed

History and UI

What was already present before this architecture pass

The repository already contains earlier UI work for shared filters, snapshot controls, attached table filters, data tables, burn-window controls, saved views, raw D1 browsing, and Products/BOM presentation. Earlier commits include ffc0162, b5ee5ac, and 9d36652.

The current worktree also contains further UI edits to the table, saved views, burn-window toggle, raw-data browser, Products/BOM table, dashboard, buttons, and global styles. Those edits are present locally but are not part of the architecture commits listed above and have not been committed in this pass.

That distinction matters: the canonical backend/data-model work is verified in commits; the latest visual/UI changes still need a focused review and should not be treated as finished just because files changed.

Verification

What was checked

The build still reports the project’s existing chunk-size and dynamic-API classification warnings. They did not fail verification.

Not done yet

Remaining work and limits

Open Beads work

The next backlog is not the same as the nine closed model tickets

TicketOpen work
SRD-0duStaff authentication for inventory writes.
SRD-czk.12Observability and data-quality operations.
SRD-czk.11Reorderly authentication and authorization.
SRD-czk.7CI and Cloudflare/VPS release topology.
SRD-82fMap accounting documents to stock movements and commitments.
SRD-kchUpload canonical raw artifacts to Selva R2.
SRD-czk.17Map the Derwent browser app to shared contracts without a fork.
SRD-czk.15Extract shared Reorderly UI primitives from proven patterns.

Bottom line

The foundation is implemented; the cutover is not

Selva now has a tested path from source-specific data into a reusable, capability-based SaaS model shared with Derwent. The important architectural decision is in place: connectors adapt into canonical records, while client-specific warehouse fields, upload formats, and manufacturing capability stay at the tenant or adapter layer.

The next real milestone is not another UI tweak. It is to finish the production boundary: authentication, live D1 migration, import/reconciliation controls, accounting-to-stock mapping, and a controlled Selva cutover. The UI worktree should then be reviewed and committed as a separate milestone.