Orchard Tax

Orchard Tax Architecture

How the docs app, web app, extraction layer, and tax engine fit together.

System map

Orchard Tax is split on purpose:

SurfaceJob
apps/docsThe wiki, runbooks, and product-facing knowledge base.
apps/webThe Prepare & Review workspace and operational UI.
packages/extractionDocument classification and field extraction.
packages/tax-engineDeterministic federal math, rule registry, and diagnostics.

Boundaries that matter

  • The engine owns tax math. It accepts verified, typed inputs and returns line values with sources and cites.
  • The extractor classifies and extracts documents; it does not decide tax treatment.
  • The docs app explains the system; it does not become a second source of truth for rules.
  • Production data, file storage, and auth belong in the hosted alpha runbook, not in the engine package.

Data flow

  1. A document enters apps/web through upload or seed data.
  2. Extraction produces candidate fields, or the preparer fills them manually.
  3. Verification promotes the fields to engine inputs.
  4. computeDraft returns line values, source refs, cites, and diagnostics.
  5. The review screen shows deltas, overrides, and a snapshot action.

Core contracts

ContractWhy it matters
Money is integer centsPrevents rounding drift inside calculators and database rows.
Every constant has { value, cite }Keeps tax-year changes auditable.
Every line carries sources and citesPowers click-to-source review.
Diagnostics are deterministicWarnings are repeatable and testable.
No hidden math in docs or UIKeeps tax logic centralized in packages/tax-engine.

On this page