Skip to content

feat(taxes): 2026 federal and nj rules and the investment tax engine - #441

Merged
daggerok merged 1 commit into
mainfrom
feat/tax-engine
Dec 3, 2026
Merged

daggerok merged 1 commit into
mainfrom
feat/tax-engine

Conversation

@daggerok

@daggerok daggerok commented Dec 3, 2026

Copy link
Copy Markdown
Owner

What

  • src/shared/tax-rules-2026.ts: the 2026 rules, MFJ only, a source URL per block: federal standard deduction, seven ordinary brackets, 0/15/20 on qualified dividends and long-term gains by total taxable income, foreign tax credit without Form 1116, capital loss limit, NIIT; NJ Table B (joint) with its rates and subtractions, exemptions. TaxRules interface, RULES by year, rulesFor(year) falls back to the latest year and says so (fallback: true)
  • src/viewer/app/taxes.ts: pure engine, no UI yet
    • Household, DEFAULT_HOUSEHOLD
    • investmentIncome(ytds) sums the shown accounts' Tax Info YTD boxes by how they are taxed, the oldest asOf
    • bracketTax, nextBracket, federalTax (ordinary first, preferential stacked on top), njTax (Table B: income x rate - subtract), netCapital (short and long term net first, loss limited, carryover)
    • investmentTax(rules, household, income): federal and NJ tax added, rates, foreign credit, effective rate, the room before 22%, before qualified dividends leave 0%, before the next NJ rate, the rate of one more short-term dollar (bump zone included), notes form-1116 and niit

Why

Owner 2026-12-03: "I have a buffer about 1500$-1600$ approx. but this is exactly info what I want to see on line and constantly updating / calculation on my viewer". This is the calculation the Taxes page will draw; Settings -> Taxes and the page come in the next PRs

Notes

  • NJ Table B as published: the 3.5% row's subtraction (1,154.50) gives 0.50 more than the bracket sum; the engine uses the published formula, a test pins the difference so a typo in any other row fails
  • The foreign credit is also capped at the federal tax itself (nonrefundable)
  • Made-up households and incomes only, every expected value worked out by hand in the test comments

Checks

  • bun test (583 pass, 0 fail)
  • .claude/tools/etfs/tc/check.sh "$PWD" src/shared/tax-rules-2026.ts src/shared/tax-rules-2026.test.ts src/viewer/app/taxes.ts src/viewer/app/taxes.test.ts prints nothing
  • git diff --check

@daggerok
daggerok merged commit 24cabe7 into main Dec 3, 2026
1 check passed
@daggerok
daggerok deleted the feat/tax-engine branch December 3, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant