Skip to content

fix(f1040): validate solo 401(k), SSTB QBI and safe-harbor inputs - #171

Merged
a7ul merged 1 commit into
filedcom:mainfrom
first2mars:codex/schedule-c-estimate-fixes
Oct 28, 2026
Merged

a7ul merged 1 commit into
filedcom:mainfrom
first2mars:codex/schedule-c-estimate-fixes

Conversation

@first2mars

@first2mars first2mars commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Self-employed estimates can deduct an excessive solo 401(k) contribution or stop when a valid, reviewed SSTB retirement deduction needs owner attribution. Missing prior-year AGI can also silently select the lower safe-harbor rate. This fixes those paths while retaining source-reconciliation and final-filing guards.

Closes #170.

Changes

  • Validate legacy solo 401(k) employee, earnings-based employer and annual-additions limits using the proprietor's adjusted earnings and same-person other-plan deferrals. Reject excess contributions instead of silently clamping them. Ordinary base-limit contributions remain permitted at older ages; actual unsupported catch-ups and ambiguous multiple legacy plans fail explicitly.
  • Add owner/business/amount/source attribution for a qualified retirement deduction in the retained single-SSTB review. Reduce AGI/QBI once, including replay of the actual retirement plan. Preserve the existing half-SE-only route and reject contradictory reviews.
  • Keep a single reviewed SSTB with retirement and complete dividends on the simplified QBI path below the threshold. Within the TY2026 phase-in range, compute the active-QBI minimum from eligible SSTB income without restoring a fully excluded business.
  • Require prior-year AGI only when 100% versus 110% can change the regular Form 2210 target; retain the explicit annual-payment override and public filing status for the MFS threshold.
  • Decode file URLs in the CLI verification harness so paths containing spaces work.

The new regression tests use independently chosen synthetic amounts and invalid test identifiers. They are under forms/f1040/nodes/..., so the standard forms CI gate discovers them. The source/contract note links the IRS worksheets and statutes. No benchmark expectations, tolerance, failure baseline, production network policy, IRS schema or filing-source guard is relaxed.

Verification

Tested commit: 488675e88736a11b1690455f6eb9bbfbc49e8d90, based on current main 3add1ba73e84897a7c1f5d955c83866836e2d7fc.

  • 190 focused tests across the QBI, retirement and underpayment files: 0 failures.
  • Full strict typecheck and module-graph preflight: passed (3,398 modules).
  • test:unit: 383 tests reported, 0 failures, one unavailable WSDL-schema prerequisite skipped; gate passed.
  • test:forms: 8,349 tests reported, 35 existing baselined private-asset failures, 264 prerequisite skips; zero unbaselined failures and gate passed. The failure baseline is unchanged.
  • check:structure, check:sandbox, check:cases, check:oracle, check:mef, check:ty2026, check:cli and check:irs: passed.
  • Golden-value audit: 137 cases, zero changes. CLI gate: 18 complete sample returns.
  • Implemented MeF rule gates: TY2025 374 assessed/373 clear; TY2026 374 assessed/231 clear; existing blocker baselines retained and zero gate problems.
  • Native macOS compiled-binary release smoke: passed, including 30 complete CLI scenarios with seven exact summary amounts each, local MeF export and the TY2026 draft PDF.
  • Changed-code lint and whitespace checks: passed.

The TY2025 legacy benchmark still has 22 passing and 87 failing cases. Compared with unchanged main, its counts and all 87 failed-case numerical differences/errors/unsupported keys are identical. The benchmark does not pass overall, and no goldens were edited to make it appear green. Upstream has no TY2026 benchmark case directory; explicit TY2026 regressions and the TY2026 sample gate cover these paths.

Local broad checks were run from an exact-commit clean checkout with canonical temporary paths, public IRS templates and the required PDF tools. This avoids existing macOS URL/temp-path and missing-tool failures without changing the tests.

Review boundaries

Positive legacy solo 401(k) inputs now require an explicit reconciled earnings basis. The employer worksheet uses the maximum 25% plan rate; a lower actual plan rate still needs review. Catch-up and multiple-plan arrangements outside the represented facts remain unsupported, rather than assumed valid.

The basic vehicle worksheet issue is already fixed upstream in #164, so mileage behavior is unchanged here. A separate local payment-planning command is not part of this contribution.

This is a draft calculation/source-validation contribution. Full private-evidence PDF/XSD/ATS coverage, source-document authenticity, IRS acceptance and TY2027 support are not claimed.

@a7ul
a7ul marked this pull request as ready for review October 28, 2026 01:37
@a7ul
a7ul merged commit 25884d9 into filedcom:main Oct 28, 2026
1 check passed
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.

Self-employed estimates: solo 401(k) limits, reviewed SSTB QBI, and safe-harbor inputs

2 participants