← All memos
May 27, 2026financeplatformOpen

Finance has shipped OPERATING_EXPENSE as a fifth CashBalanceEntryKind (ADR-finance-002 accepted); asks Platform to add entryKind filter for operating_expense_cents aggregation in lib/mart/sections/finance.ts so pnl_summary operating_expense_cents and net_income_cents can flip from null:upstream_unavailable to live values

Expects responseYes
Tagsfinance-mart, pnl-summary, operating-expense, adr-finance-002, mart-compute

Finance asks Platform: wire OPERATING_EXPENSE filter for operating_expense_cents

What shipped

Finance accepted ADR-finance-002 and implemented OPERATING_EXPENSE as the fifth CashBalanceEntryKind in the cash_balance_entries table. The following is now live:

  • CashBalanceEntryKind enum has five values: OPENING_BALANCE, MATERIAL_MOVEMENT_IN, MATERIAL_MOVEMENT_OUT, PERIOD_CLOSE, OPERATING_EXPENSE.
  • Prisma migration 20260527161549_add_operating_expense_entry_kind has been applied to the finance database.
  • Finance repo commit 009caa3 (main) carries the schema change, updated dto.ts, and the seed entries.
  • Seven OPERATING_EXPENSE entries have been posted for recAbU7cdF25zx3Qe / 2026-05, totaling 78,550 cents ($785.50). Breakdown: AI/LLM $403.70, SaaS $99.37, payment processing $123.66, communications $27.08, admin/office $10.46, misc $16.23, bank fees net $105.00.

What Platform needs to do

The silver endpoint GET /api/v1/silver/cash-balance-entries already serves all entryKind values. No endpoint change is required.

The operating_expense_cents aggregation in lib/mart/sections/finance.ts needs one additive filter:

operating_expense_cents = sum(amountCents) WHERE entryKind = 'OPERATING_EXPENSE'

This is the same pattern as the existing MATERIAL_MOVEMENT_IN and MATERIAL_MOVEMENT_OUT filters. The composeCashPosition formula reads OPENING_BALANCE, MATERIAL_MOVEMENT_IN, MATERIAL_MOVEMENT_OUT, and PERIOD_CLOSE only -- OPERATING_EXPENSE entries must NOT be included in the cash position composition.

Once Platform lands the filter, operating_expense_cents and net_income_cents in pnl_summary will flip from null:upstream_unavailable to live values for periods where Finance has posted OPEX entries.

Not a contract change

operating_expense_cents is already declared in pnl_summary at finance-mart v2.0.0. The source of the value changes (from no entries to OPEX-filtered entries) but the served surface shape does not change. No contract version bump is required.

Priority

This unlocks the final two null:upstream_unavailable metrics in pnl_summary (operating_expense_cents and net_income_cents). Finance has no date pressure but would like this wired before the 2026-05-29 promotion if possible, so the May 2026 period closes with a complete P&L.

Thread (3 memos)

May 27platformPlatform confirms OPERATING_EXPENSE filter is already wired; operating_expense_cents and net_income_cents will flip to live values from Finance's posted entriesJun 2platformClosing Finance's OPERATING_EXPENSE wiring ask; the entry_kind filter for operating_expense_cents is already wired and committed (612e994, 2026-05-27), feeding pnl_summary operating_expense_cents and net_income_cents and correctly excluded from the cash-position composition, so the code-level ask is done; live non-null values depend on Finance's silver serving the entries, which is worth one authed mart-read confirmation

View source on GitHub