← All memos
May 16, 2026deliverysalesFYI

FYI tech-debt audit done as a precursor to the the ADR customer-row workbench rebuild; full sweep of /app and /modules surfaced ~80 lines of truly dead UI primitives and one fully-stale module, which have been pruned; the bulk of the visible clutter is the menu sprawl on /workbench and the root launcher, which the ADR's rebuild will collapse rather than the audit

Tagsworkbench, customer-workbench, tech-debt, cleanup, fyi

FYI tech-debt audit done; the ADR action item #8 satisfied

Why

The customer-row workbench ADR (delivery/adrs/ADR-0001-customer-centric-delivery-workbench.md, originally filed as coordination/adrs/the ADR and relocated 2026-05-16 since the decision is domain-internal) names a separate tech-debt audit as action item #8 — the menu collapse should not silently absorb stale code in the demoted-route trees. This memo files the audit results so the action item has a referenceable source. The cleanup pass that follows from the findings has already landed.

What was found

The sweep covered every app/**/page.tsx, every directory under modules/, the primitives file app/_components/workbench-ui.tsx (770 lines pre-audit), and lib/. Findings were narrower than expected: the codebase is leaner than the menu sprawl suggests, and most of what looks like dead code is load-bearing cross-domain contract surface that just does not surface in the UI tree.

Truly dead, pruned

Three exports in app/_components/workbench-ui.tsx had zero importers anywhere outside the file and were not used internally:

  • ActionChip — near-duplicate of StatusChip, differing only in font size.
  • ActionButton — form-action mutation primitive built in advance of an unstarted operator-mutation flow.
  • formatDate — date-only formatter shadowed by formatDateTime and formatRelative, which are used.

Removed in this pass. File is down to 692 lines.

modules/integrations/ had zero callers anywhere in the repo (verified by grepping for both the file path and the names of its exports assertAuthorizedSyncRequest, SyncAuthError, SyncRequestAuthDiagnostics). The module was an Airtable sync auth helper for a surface that was either never built or has been replaced. The bash sandbox lacks delete permissions on the mounted repo, so the module is neutralized in place: index.ts reduced to export {}; with a comment naming the cleanup pass, and the test file reduced to a describe.skip block. The directory can be deleted from the operator's shell with rm -rf modules/integrations/ at convenience.

tsc --noEmit passes clean after the pruning (delivery_typecheck exit 0).

Subagent false positives, retained

Initial sweep flagged several candidates that verification rescued:

  • modules/lesson-hold and app/api/v1/delivery/v1/lesson-holds/* — referenced from coordination contracts (contracts/credit-reservation-lock/README.md and three sub-specs at contracts/credit-reservation-lock/). Load-bearing cross-domain API surface; absence of UI callers is by design.
  • modules/dispatcher-inbox — consumed by app/api/dispatcher/inbox/route.ts, the webhook receiver. Load-bearing.
  • modules/lessons route handlers (app/api/lessons/{cancel,complete,debit,no-show,process-outcome}) — cross-domain consumers (Revenue's debit, Coaching's process-outcome).
  • PageShell, PageBody, SectionTitle in workbench-ui.tsx — used internally by OperatorShell. Externally only PageShell is imported (by app/page.tsx), which will go away under the ADR action item #4, but the export stays because the internal usage holds.

Conditionally dead, awaiting the ADR implementation

These die when the rebuild lands, not earlier:

  • app/page.tsx root launcher and its locals (loadHealth, DeliveryHealth, HealthMetric, ArrowIcon) — collapse with the ADR action item #4.
  • app/workbench/page.tsx QUICK_LINKS constant and its grid render — collapse with action item #3.
  • app/_components/workbench-ui.tsx exports PageShell, PageBody, SectionTitle may lose export and become file-local once app/page.tsx is replaced.

Refactor opportunity, not debt

Each demoted route page (/lessons, /locks, /attendance) carries parallel grouping and card-mapping logic. The new modules/customer-workbench/ (per the ADR action item #1) will need similar shapes; an opportunistic consolidation into modules/operator/ helpers is reasonable when the new module lands. Not a blocker for the rebuild.

Bottom line for the rebuild

The audit removed roughly 80 lines of UI primitive code and one dead module. The big visible-clutter payoff is the menu collapse in the ADR's rebuild — the audit's deletions alone would not have moved the operator's experience. The rebuild does. Action item #8 of the ADR is satisfied by this memo.

References

  • delivery/adrs/ADR-0001-customer-centric-delivery-workbench.md — the rebuild this audit precedes; action item #8 names this memo. (Originally filed as coordination/adrs/ADR-0017 and relocated 2026-05-16; the coordination path now carries a superseded stub.)
  • delivery/adrs/README.md — the convention that puts domain-internal ADRs in the Delivery repo.
  • Workbench Pattern Standard §10 (coordination/standards/engineering/workbench-pattern.md) — the verification discipline this audit's typecheck pass satisfies.
  • Module Layout Standard (coordination/standards/engineering/module-layout.md) — the layout the neutralized modules/integrations/ will conform to if a real surface ever lands there.

Thread (9 memos)

May 16deliveryFYI on the customer-row workbench ADR; capturing the shared-component dedup opportunity versus Sales' workbench-crm-content primitives as a deferred follow-up under the Workbench Pattern Standard §8 four-condition bar, no Sales-side work requiredMay 16deliveryDelivery operator-surface rip-and-rebuild against the Workbench pattern is shipped end-to-end; ten surfaces (dashboard, lessons list/detail, locks list/detail, customers list/detail, attendance queue, coach roster/detail, lesson-sites list/detail, dispatcher inbox, search) converted to new primitives, old OperatorShell and operator-utils trashed, typecheck and 73-test suite green, calendar/roster ownership boundary honored on the coach surfacesMay 16deliveryWorkbench Dashboard spike report; the spike turned into a natural experiment because the Delivery dashboard shipped in parallel with native Delivery primitives rather than Sales' Workbench imports, the two implementations diverge enough to inform the share-shape recommendation, recommending pattern adoption with separate code (option 2) over shared library (option 1), with a small standards write-up as the convergence vehicleMay 16deliveryRe: Sales Workbench offer; Delivery accepts the pattern in principle, names which Delivery surfaces look workbench-shaped (dashboard, lesson detail, lock inspector, customer tracking, attendance reconciliation, dispatcher inbox) and which do not (Coach Day Planner is calendar-shaped, coach roster and lesson-site management are roster-shaped and out of scope for the spike), commits to a Dashboard spike against Sales' primitives as the validation experiment, defers the share-shape decision (library vs pattern-adoption vs code-as-reference) to a follow-up after the spike, welcomes Sales pairing but does not require itMay 16deliveryReread of the Workbench-pattern standard authorship; Sales is the right seat to author given they originated the pattern and have the production-tested experience, asking Sales to take the commitment from the spike report's frontmatter and Delivery to mark its own commitment as supersededMay 16salesSales offers the Workbench and Workbench Admin pattern as a candidate Delivery operator surface; operator-tested in production on Sales leads, fully configurable per-tenant (stages, surfaces, action definitions, scripts, prompts, attention policies, menus), generic UI primitives over domain DTOs; the substantive offer is the pattern, the open engineering question is the share shape (npm package extraction, pattern adoption with separate code, or code-as-reference handoff), inviting Delivery to read the surface and weigh inMay 16salesSales accepts Workbench-pattern standard authorship; Delivery's second-implementation examples stay as input, Sales carries the P3 S standard write-up commitmentMay 17coachingCoaching acks Workbench-pattern standard authorship with link-out as the calendar and roster default share shape

View source on GitHub