SPB Git

spb/air Public MIT

AIR — The Language of Accounting.

Python 100%
11.4 KB

# Research: Accounting Standards as AIR Compilation Targets

Date of research: 2026-08-05 Method: 4 targeted web searches (revenue recognition, leases, foreign currency, ASPE) with follow-up on primary standard-setter sources. Purpose: Ground the design of AIR backend "target profiles". In AIR, each accounting framework (IFRS, US GAAP, ASPE) is treated as a compilation target: the same EconomicEvent compiles to different journal entries depending on the selected standard profile, exactly as LLVM IR compiles to different machine code per target triple.


# 1. Revenue recognition — IFRS 15 / ASC 606

IFRS 15 Revenue from Contracts with Customers (IASB) and ASC 606 (FASB) are converged standards built on the same five-step model:

  1. Identify the contract with a customer.
  2. Identify the performance obligations — promises to transfer distinct goods or services (distinct = capable of being sold separately, or distinct in the context of the contract).
  3. Determine the transaction price (including variable consideration, subject to constraint).
  4. Allocate the transaction price to the performance obligations (relative standalone selling prices).
  5. Recognize revenue when (or as) each performance obligation is satisfied — i.e., when control of the good or service transfers to the customer, not when payment is received.

# Why this matters for AIR

AIR's Sale event carries a delivery: {status: pending, expected: ...} field. Under IFRS 15/ASC 606, a sale that is paid but not delivered has not satisfied its performance obligation:

  • Cash received, delivery pending → the compiler must post a contract liability / deferred revenue (Dr Cash, Cr Deferred Revenue), not revenue.
  • On delivery (a later Delivery/Fulfillment event referencing the original event in the provenance graph) → Dr Deferred Revenue, Cr Revenue.
  • Delivered, not yet invoiced/paid → contract asset / unbilled receivable.

Design consequences:

  • The AIR schema must model performance obligations as first-class line-item state (satisfied / unsatisfied / partially satisfied over time), because revenue timing is a function of obligation satisfaction, not of the cash or invoice event.
  • Multi-element sales (e.g., hardware + support contract) require transaction-price allocation in the compiler's revenue pass — allocation ratios are policy/target-profile data, never LLM output.
  • Revenue timing rules belong to the target profile (IFRS vs ASPE differ; see §4), so the same Sale AIR event can legally compile to different entries per target.

Sources (consulted 2026-08-05):


# 2. Leases — IFRS 16 / ASC 842 (brief)

Both standards put leases on the balance sheet for lessees: at commencement the lessee recognizes a right-of-use (ROU) asset and a lease liability, both measured at the present value of future lease payments (discounted at the rate implicit in the lease, else the incremental borrowing rate).

Key divergences (they are not fully converged, unlike revenue):

Aspect IFRS 16 ASC 842
Lessee classification Single model — every lease → depreciation + interest (front-loaded) Dual model — finance vs operating; operating lease → single straight-line lease cost
Low-value asset exemption Yes (in addition to short-term) No (short-term only)
Index/rate-linked payment changes Remeasure the liability No remeasurement; variable lease cost in period
Restoration/dismantling costs Included in ROU asset Separate ARO under ASC 410-20

# Why this matters for AIR

A single AIR Lease event compiles to structurally different entries per target profile — this is the strongest argument that AIR targets are genuine "backends", not just chart-of-account mappings. Lease compilation also requires the compiler to do present-value math deterministically (fixed decimal, documented rounding). Depth of lease support can wait for a later phase; the target-profile abstraction must accommodate it from day one.

Sources (consulted 2026-08-05):


# 3. Foreign currency — IAS 21 (drives AIR's FX pass)

IAS 21 The Effects of Changes in Foreign Exchange Rates (US GAAP analogue: ASC 830) defines the rules the AIR FX pass must implement:

  1. Initial recognition: a foreign-currency transaction is recorded in the entity's functional currency using the spot rate at the transaction date (the date the transaction first qualifies for recognition).
  2. Subsequent measurement at each reporting date:
    • Monetary items (cash, receivables, payables, loans — fixed/determinable currency amounts) are remeasured at the closing rate; differences go to profit or loss (unrealized FX gain/loss).
    • Non-monetary items at historical cost keep the historical transaction-date rate — no retranslation.
  3. Settlement: exchange differences arising on settlement of monetary items (rate at settlement vs rate at initial recognition / last remeasurement) are recognized in profit or loss — the realized FX gain/loss.

# Why this matters for AIR

  • Every AIR Money value must carry its currency, and the FX pass attaches {rate, rate_source, rate_date} provenance nodes when converting to functional currency — the SSA-style provenance graph makes each converted amount traceable to a dated rate.
  • The compiler must distinguish three moments: transaction-date translation (booking), period-end remeasurement of open monetary balances (unrealized), and settlement (realized). These are three distinct pass behaviors producing distinct, reversible entries.
  • Realized vs unrealized gains post to separate accounts; period-end remeasurement entries are natural candidates for automatic reversal on the next period open (fits AIR's incremental compilation / contra-entry model).
  • The functional currency is a target/entity profile parameter, never inferred by the LLM.

See companion note fx-handling.md for rate sources (Bank of Canada Valet API) and CRA rules.

Sources (consulted 2026-08-05):


# 4. Canadian ASPE — Accounting Standards for Private Enterprises

What it is: ASPE is the Canadian GAAP framework for private enterprises, issued by the Accounting Standards Board (AcSB) and published in Part II of the CPA Canada Handbook – Accounting. Canadian publicly accountable enterprises must use IFRS (Part I); private enterprises may choose ASPE or IFRS. ASPE is recognized only in Canada.

Who uses it: the vast majority of Canadian private companies (SMBs and larger private firms not seeking public/foreign capital), because it is simpler and cheaper to apply than IFRS.

Key high-level differences vs IFRS:

  • Revenue: ASPE (Section 3400) is a simpler, more flexible model — no mandatory IFRS 15-style five-step framework, though deferral of unearned revenue still applies.
  • Leases: ASPE (Section 3065) retains the old capital/operating lease distinction — operating leases stay off balance sheet, unlike IFRS 16.
  • Goodwill: ASPE allows amortization / impairment-on-indication; IFRS requires annual impairment testing without amortization.
  • Financial instruments: ASPE permits cost-based measurement in many cases; IFRS leans on fair value.
  • PP&E: ASPE is cost model only; IFRS permits revaluation.
  • Disclosures: substantially lighter under ASPE.

# Why this matters for AIR

ASPE confirms the target-profile design: a Canadian SMB target (ASPE) and an IFRS target compile the same AIR events differently (leases and revenue timing being the clearest cases). Given AIR's initial CA-QC focus, the ASPE profile is a natural first "real" standards target alongside the generic CSV backend, with IFRS and US GAAP profiles layered on the same interface.

Sources (consulted 2026-08-05):


# 5. Decisions / follow-ups

  • D1: Model standards (IFRS / US GAAP / ASPE) as target profiles consumed by the posting pass; profile choice is entity configuration, never event data. → Feed into ADR on backend architecture.
  • D2: AIR Sale must separate cash/invoice events from performance-obligation satisfaction (delivery) to support deferred revenue under all profiles.
  • D3: FX pass implements IAS 21 semantics (spot at transaction date; monetary remeasurement at close; realized on settlement) with full rate provenance.
  • Follow-up: golden tests for (a) paid-but-undelivered sale → deferred revenue, (b) unpaid FX receivable across a period end → unrealized then realized gain/loss, (c) same lease under ASPE vs IFRS profiles.