[#78] Exhaustive GAAP accounting audit: presentation + recognition fixes with regression tests #82

Merged
robertismo merged 1 commit from 78-gaap into master 2026-09-29 22:41:14 +00:00
Owner

[#78] Exhaustive GAAP accounting audit

Audits every line of the financial reports and the books against real-world presentation (docs/gaap-audit.md: findings, GAAP references, corrections).

Findings fixed:

  1. Bond discount timing (ASC 310-20/835-30): discount was recognized in one lump at take time with assets booked at face. Now the discount accrues over the bond's life — issuer interest income and borrower interest expense accrue each turn; assets carried at amortized cost, debts at face minus unamortized discount.
  2. Write-off timing (ASC 310-10-35): dead loans dripped the loss over the remaining term. Now the full impairment is charged off in the turn the loan dies via an allowance (loans net of allowance on the balance sheet); recoveries reverse the allowance as income.
  3. Cash-flow classification (ASC 942-230): deposit flows were in financing; for a bank they are operating. Moved; bond borrowings/repayments stay in financing.
  4. CF statement now closes with the beginning/end-of-turn cash reconciliation and bank-standard section labels.
  5. Income statement regrouped: interest income → interest expense → net interest income → credit losses (net of recoveries) → operating expense → bargain gain.
  6. Dead Report.Accrued field removed.
  7. money() fixed ("-0", negative grouping) and the parenthesized-negatives ruling applied via moneyParen on every report line: expenses and losses render "(1,941)".

Tests: 18 new regression tests (bond_amortization_test.go, writeoff_test.go, gaap_statement_test.go) pinning every correction, including a full seeded AI-game invariant test. All pre-existing tests (acquisition accounting, dead loans, reserve, bond units, award, bidall, iterlog, lisp, hook) pass unchanged.

Verification: go build + go vet + full go test green; spectate smoke (gate config) 0 [ai errors / 0 ACCT DIVERGENCE / 0 CF DIVERGENCE; quick bench 390 games, 0 divergences (empire 114 / mill 106 / vault 63 / adapt 88).

## [#78] Exhaustive GAAP accounting audit Audits every line of the financial reports and the books against real-world presentation (docs/gaap-audit.md: findings, GAAP references, corrections). **Findings fixed:** 1. **Bond discount timing** (ASC 310-20/835-30): discount was recognized in one lump at take time with assets booked at face. Now the discount accrues over the bond's life — issuer interest income and borrower interest expense accrue each turn; assets carried at amortized cost, debts at face minus unamortized discount. 2. **Write-off timing** (ASC 310-10-35): dead loans dripped the loss over the remaining term. Now the full impairment is charged off in the turn the loan dies via an allowance (loans net of allowance on the balance sheet); recoveries reverse the allowance as income. 3. **Cash-flow classification** (ASC 942-230): deposit flows were in financing; for a bank they are operating. Moved; bond borrowings/repayments stay in financing. 4. **CF statement** now closes with the beginning/end-of-turn cash reconciliation and bank-standard section labels. 5. **Income statement** regrouped: interest income → interest expense → net interest income → credit losses (net of recoveries) → operating expense → bargain gain. 6. Dead `Report.Accrued` field removed. 7. `money()` fixed ("-0", negative grouping) and the **parenthesized-negatives ruling** applied via `moneyParen` on every report line: expenses and losses render "(1,941)". **Tests:** 18 new regression tests (bond_amortization_test.go, writeoff_test.go, gaap_statement_test.go) pinning every correction, including a full seeded AI-game invariant test. All pre-existing tests (acquisition accounting, dead loans, reserve, bond units, award, bidall, iterlog, lisp, hook) pass unchanged. **Verification:** go build + go vet + full go test green; spectate smoke (gate config) 0 `[ai` errors / 0 ACCT DIVERGENCE / 0 CF DIVERGENCE; quick bench 390 games, 0 divergences (empire 114 / mill 106 / vault 63 / adapt 88).
- Bond discount accrues over the bond life (ASC 310-20/835-30): assets
  at amortized cost, debts at face minus unamortized discount, no
  income/expense recognized at take time
- Loan impairments charged off in full when incurred (ASC 310-10-35)
  via an allowance; recoveries reverse the allowance as income
- Deposits reclassified to operating cash flows (ASC 942-230); CF
  statement gains beginning/end-of-turn cash reconciliation
- Balance sheet grouped Assets/Liabilities/Equity with totals;
  income statement regrouped (interest income/expense, net interest
  income, credit losses net of recoveries); parenthesized negatives
  per Robert ruling (moneyParen)
- docs/gaap-audit.md: findings, GAAP references, corrections
- 18 new regression tests incl. a full seeded AI-game invariant test
- Verified: build/test/vet green, spectate smoke 0/0/0, bench 390
  games 0 divergences
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Winnie/bankwars!82
No description provided.