diff --git a/docs/ats/ty2025-check-expansion-2026-10-10.md b/docs/ats/ty2025-check-expansion-2026-10-10.md new file mode 100644 index 000000000..8b121176a --- /dev/null +++ b/docs/ats/ty2025-check-expansion-2026-10-10.md @@ -0,0 +1,45 @@ +# ATS Scenario 3 and 4 check expansion — October 10, 2026 + +The individual-check projection remains **about 75%, with a low-confidence judgment range of 50–85%**. The expanded selected calculation sample has **40/54 evaluated nonprovisional matches (74.1%)**. Five provisional matches and four unproduced amounts remain separate. This is not a measured percentage of all IRS checks; the complete applicable denominator remains open. + +This completes enumeration and replay of nine additional expectations already documented in the Scenario 3 and 4 source reconciliations. All 111 observations from the [earlier checkpoint](./ty2025-check-ledger-2026-10-10.md) are preserved byte-for-byte as JSON objects. No fixture, calculation runtime, prior target or deferred repair changed. + +| Evidence | Match/present | Different/missing | Unknown | +| --- | ---: | ---: | ---: | +| Selected calculations (63) | 45 | 14 | 4 unproduced | +| Nonprovisional subset (58) | 40 | 14 | 4 unproduced | +| Native copies (56) | 10 | 12 | 34 unevaluated | +| Known binary attachments (1) | 0 | 1 | Requirements uninventoried for 7 scenarios | + +There are now 120 observations, without a combined percentage across unlike categories. The broader calculation sample is 45/63 (71.4%) when provisional and unproduced checks share the denominator; the nonprovisional inventory including unproduced amounts is 40/58 (69.0%). These are different denominators, not alternative claims of IRS acceptance. + +## Added expectations + +| Scenario | Field | Expected | Actual | Result | Source | +| --- | --- | ---: | ---: | --- | --- | +| 1040-03 | `schedule_d.print_line7_st_total` | 1988 | 1988 | match | source-arithmetic: Schedule D p.9:14,222 proceeds less12,234 basis | +| 1040-03 | `schedule_d.print_line15_lt_total` | 9725 | 9725 | match | source-arithmetic: Schedule D p.9:14,211 proceeds less4,486 basis | +| 1040-03 | `f1040.line7_capital_gain` | 11713 | 11713 | match | source-arithmetic: Schedule D p.9:1,988 short-term plus9,725 long-term | +| 1040-03 | `schedule1.line5_schedule_e` | 11061 | 11061 | match | source-arithmetic: Form4835 p.17:17,035 income less5,974 expenses | +| 1040-03 | `schedule1.line1_state_refund` | 3110 | not produced | not-produced | printed-source: Cover sheet p.1 taxable state refund | +| 1040-03 | `f1040.line8_additional_income` | 17422 | 14312 | different | source-arithmetic: Cover/Sch F/Form4835:3,110 refund +3,251 farm +11,061 rental | +| 1040-03 | `f1040.line9_total_income` | 72235 | 69125 | different | source-arithmetic: 43,100 taxable pension +11,713 capital gain +17,422 additional income | +| 1040-04 | `f3800.f8835_credit_entries.0.credit_amount` | 13200 | not produced | not-produced | printed-source: Form3800 line1f; source eligibility and line placement unresolved | +| 1040-04 | `f3800.f8936_new_vehicle_credit.credit_amount` | 130 | not produced | not-produced | printed-source: Form3800 line1y; Form8936 business computation blank | + +Scenario 3 capital gains and farm rental income reconcile. Its partial fixture already documents the missing gross refund, issuer and prior-year recovery workpaper; the cover's taxable refund of $3,110 is not supplied to the public 1099-G route. Both income differences equal that missing amount, rather than two independent calculation defects. This checkpoint exposes the incomplete fixture without fabricating source facts or repairing it. + +Scenario 4's printed $13,200 solar and $130 vehicle amounts are credit-source deposits, not asserted allowed credits. The existing fixture remains wages-only. Solar ownership, transfer evidence and conflicting Form 3800 line placement remain unresolved; the vehicle business-use computation is blank. A printed target alone does not establish eligibility. Its transfer statement remains missing. + +These are previously recorded source gaps, not newly discovered production defects. The existing ATS matrix task remains open, as do all 52 main tasks; 149 deferred tasks remain untouched. No additional native or PDF verification is claimed. + +## Evidence and reproduction + +```sh +deno run -A forms/f1040/e2e/ats/ty2025-check-ledger.ts /tmp/ats-check-ledger.json +deno test -A forms/f1040/e2e/ats +``` + +The complete ATS directory passes 73 typed tests, zero failed or ignored. Assertions now retain the two income differences and three newly enumerated missing amounts, alongside the prior document/attachment guards. Private replay, log and hashes: `.state/research/ats-check-expansion-2026-10-10/`. Production runtime remains `d65263134ac90359d42487d85efb05febb13daf6`. + +Source facts are retained in the existing Scenario 3 and 4 input/reconciliation modules and their tests, transcribed from the [official Scenario 3 packet](https://www.irs.gov/pub/irs-efile/ty25-1040-mef-ats-scenario-3-10202025.pdf) and [official Scenario 4 packet](https://www.irs.gov/pub/irs-efile/ty25-1040-mef-ats-scenario-4-10212025.pdf). This expansion uses those reviewed transcriptions; it does not claim a new visual review. diff --git a/docs/ats/ty2025-check-ledger-2026-10-10.md b/docs/ats/ty2025-check-ledger-2026-10-10.md new file mode 100644 index 000000000..7f926861c --- /dev/null +++ b/docs/ats/ty2025-check-ledger-2026-10-10.md @@ -0,0 +1,205 @@ +# TY2025 individual-check evidence ledger — October 10, 2026 + +Historical 111-observation checkpoint; the [expanded 120-observation replay](./ty2025-check-expansion-2026-10-10.md) preserves every row and adds nine source expectations. + +**Provisional engineering estimate: about75% of individual ATS checks, with a +judgment range50–85%.** Confidence is low because the complete applicable IRS +check denominator has not been enumerated. This is a projection anchored to +selected calculations, not a measured IRS pass rate or a probability that all +eight scenarios pass. The range is not a statistical confidence interval. + +The current replay is unchanged:41 matching,12 different and one unproduced +calculation out of54. Five matches use a provisional Scenario8 interpretation. +Leaving those five conditional matches and the one unproduced amount separate +gives **36/48 evaluated nonprovisional comparisons matching (75%)**. Including +the unproduced amount in that inventory gives36/49 (73.5%); the broader selected +sample gives41/54 (75.9%). These denominators are explicit, not interchangeable. + +The previous60% estimate applied an undocumented discount for unresolved +requirements. This checkpoint removes that unsupported weighting; **it does not +claim a15-point software improvement**. Unverified requirements are not assigned +automatic failures or successes. The75% projection uses the selected calculation +anchor as a provisional proxy; identity, native/PDF, attachments and IRS-rule +coverage could materially change it when actually enumerated and evaluated. + +| Evidence category | Matching/present | Different/missing | Unknown | Scope | +| --- | ---: | ---: | ---: | --- | +| Selected calculations | 41 | 12 | 1 unproduced | Includes5 provisional matches | +| Nonprovisional calculation subset | 36 | 12 | 1 unproduced | Subset of the54, not additional checks | +| Required native copies | 10 | 12 | 34 not evaluated | Presence only; a blocked bundle is not proof of missing copies | +| Inventoried binary attachments | 0 | 1 | Other requirements not inventoried for7 scenarios | Scenario4 transfer statement absent | + +The ledger contains **111 distinct local observations**:54 calculations, +56 document copies and one known attachment. There is deliberately **no combined +111-row pass percentage**: a form's presence and a calculation equality are +different evidence, and this catalog is not the full IRS denominator. Unmapped +roots, absent amounts and uninventoried attachments remain explicit in the +machine report. Additional scopes are listed there without invented counts. + +| Calculation target basis | Match | Different | Unproduced | +| --- | ---: | ---: | ---: | +| Printed source | 23 | 12 | 1 | +| Independently derived source arithmetic | 13 | 0 | 0 | +| Provisional interpretation | 5 | 0 | 0 | + +This uneven mix is why the observed75% cannot be treated as a representative +measurement of all IRS checks. + +All12 calculation differences are against printed targets in Scenarios12/13. +They remain differences; some are documented current-law/printed-answer +conflicts, not established code defects. No expected value or tax runtime was +changed to improve this percentage. The original +[replay report](./ty2025-check-replay-2026-10-09.md) retains source explanations. + +## Reproduce + +```sh +deno run -A forms/f1040/e2e/ats/ty2025-check-ledger.ts /tmp/ats-check-ledger.json +deno test -A forms/f1040/e2e/ats +``` + +The CLI obtains a fresh public-entry replay, emits one uniquely identified row +per observation, preserves repeated document-copy ordinals and keeps blocked +copies unknown. Its calculation anchor excludes provisional comparisons and +returns no percentage for an empty evaluated set. The full ATS directory passes73 typed tests, zero failures or ignored cases. +The regression checks retain all original54 targets and assert the ledger's partition and duplicate-W2 +handling. Private evidence: `.state/research/ats-check-ledger-2026-10-10/`. + +## Calculation observations + +| Scenario | Field | Expected | Actual | Result | Basis / source location | +| --- | --- | ---: | ---: | --- | --- | +| 1040-01 | `f1040.line1a_wages` | 42470 | 42470 | match | source-arithmetic: Issued W-2 box 1, excluding statutory employee receipts | +| 1040-01 | `f1040.line25a_w2_withheld` | 2713 | 2713 | match | source-arithmetic: Sum of issued W-2 box 2 amounts | +| 1040-01 | `schedule2.line9_household_employment` | 474 | 474 | match | source-arithmetic: Schedule H: 3,100 × 12.4% rounded + 3,100 × 2.9% rounded | +| 1040-02 | `f1040.line1a_wages` | 8513 | 8513 | match | source-arithmetic: Issued W-2 box 1, excluding statutory employee receipts | +| 1040-02 | `f1040.line25a_w2_withheld` | 1164 | 1164 | match | source-arithmetic: Sum of issued W-2 box 2 amounts | +| 1040-02 | `schedule1.line3_schedule_c` | 26979 | 26979 | match | source-arithmetic: Schedule C: statutory receipts29,513 less expenses2,534 | +| 1040-03 | `f1040.line5a_pension_gross` | 53778 | 53778 | match | printed-source: 1099-R p.4 box1 | +| 1040-03 | `f1040.line5b_pension_taxable` | 43100 | 43100 | match | printed-source: 1099-R p.4 box2a | +| 1040-03 | `f1040.line25b_withheld_1099` | 3405 | 3405 | match | printed-source: 1099-R p.4 box4 | +| 1040-03 | `schedule1.line6_schedule_f` | 3251 | 3251 | match | source-arithmetic: Schedule F pp.13–14:8,111 less4,860 | +| 1040-03 | `schedule2.line4_se_tax` | 827 | 827 | match | source-arithmetic: Farm optional election: rounded2/3 ×8,111 earnings; filed SE component tax | +| 1040-03 | `schedule1.line15_se_deduction` | 414 | 414 | match | source-arithmetic: Half of filed827 SE tax, rounded | +| 1040-04 | `f1040.line1a_wages` | 36014 | 36014 | match | source-arithmetic: Issued W-2 box 1, excluding statutory employee receipts | +| 1040-04 | `f1040.line25a_w2_withheld` | 4581 | 4581 | match | source-arithmetic: Sum of issued W-2 box 2 amounts | +| 1040-05 | `f1040.line1a_wages` | 31232 | 31232 | match | source-arithmetic: Issued W-2 box 1, excluding statutory employee receipts | +| 1040-05 | `f1040.line25a_w2_withheld` | 1754 | 1754 | match | source-arithmetic: Sum of issued W-2 box 2 amounts | +| 1040-05 | `f1040.taxpayer_blind` | true | true | match | printed-source: Form1040 p.2 blindness mark | +| 1040-05 | `f1040.digital_assets` | false | false | match | printed-source: Form1040 p.2 digital-assets No | +| 1040-08 | `f1040.line5a_pension_gross` | 20300 | 20300 | match | printed-source: Code G 1099-R gross distribution | +| 1040-08 | `f1040.line5b_pension_taxable` | 10300 | 10300 | match | printed-source: Code G 1099-R taxable distribution | +| 1040-08 | `f1040.line5c_pension_rollover` | true | true | match | printed-source: Form1040 p.2 line5c | +| 1040-08 | `f1040.line6a_ss_gross` | 1000 | 1000 | match | printed-source: Cover sheet Social Security benefits | +| 1040-08 | `f1040.line7a_cap_gain_distrib` | 7500 | 7500 | match | printed-source: Cover sheet REIT capital-gain distribution | +| 1040-08 | `f1040.line9_total_income` | 17800 | 17800 | match | provisional-source-interpretation: Source-backed provisional interpretation; printed QCD unresolved | +| 1040-08 | `f1040.line12a_standard_deduction` | 17350 | 17350 | match | provisional-source-interpretation: MFS taxpayer age72; QCD/source questions unresolved | +| 1040-08 | `f1040.line15_taxable_income` | 450 | 450 | match | provisional-source-interpretation: 17,800 less17,350 under provisional interpretation | +| 1040-08 | `f1040.line24_total_tax` | 0 | 0 | match | provisional-source-interpretation: Provisional qualified-gain return; not printed acceptance target | +| 1040-08 | `f1040.line25b_withheld_1099` | 2555 | 2555 | match | printed-source: Code G 1099-R box4 | +| 1040-08 | `f1040.line35a_refund` | 2555 | 2555 | match | provisional-source-interpretation: Provisional zero-tax return; QCD unresolved | +| 1040-12 | `f1040.line1a_wages` | 100836 | 100836 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line8_additional_income` | 24328 | 24328 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line9_total_income` | 125164 | 125164 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line10_adjustments` | 2719 | 1719 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line11_agi` | 122445 | 123445 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line12a_standard_deduction` | 15000 | 15750 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line15_taxable_income` | 107445 | 103173.2 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line16_income_tax` | 18634 | 17612 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line23_other_taxes` | 3438 | 3438 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line24_total_tax` | 22072 | 21050 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line25a_w2_withheld` | 14444 | 14444 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `f1040.line37_amount_owed` | 7628 | 6606 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-12 | `schedule1.line15_se_deduction` | 1719 | 1719 | match | printed-source: Schedule SE p.10 line13 | +| 1040-12 | `schedule1.line17_se_health_insurance` | 1000 | unproduced | not-produced | printed-source: Form7206 printed deduction; eligibility/source records incomplete | +| 1040-13 | `f1040.line1a_wages` | 31620 | 31620 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `f1040.line11_agi` | 31620 | 31620 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `f1040.line12a_standard_deduction` | 30000 | 31500 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `f1040.line15_taxable_income` | 1620 | 120 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `f1040.line16_income_tax` | 162 | 11 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `f1040.line20_nonrefundable_credits` | 162 | 11 | different | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `f1040.line24_total_tax` | 0 | 0 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `f1040.line25a_w2_withheld` | 609 | 609 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `f1040.line34_overpayment` | 609 | 609 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `f1040.line35a_refund` | 609 | 609 | match | printed-source: Form 1040 pp. 2–3 | +| 1040-13 | `schedule3.line6j_alt_fuel_vehicle_refueling` | 162 | 11 | different | printed-source: Schedule3 line6j; printed stale tax limit remains unresolved | + +## Required native-copy observations + +Presence does not prove correct contents, ownership or filing acceptance. + +| Scenario | Required copy | Result | +| --- | --- | --- | +| 1040-01 | 1040:1 | not-evaluated | +| 1040-01 | W-2:1 | not-evaluated | +| 1040-01 | W-2:2 | not-evaluated | +| 1040-01 | Schedule 2:1 | not-evaluated | +| 1040-01 | Schedule 3:1 | not-evaluated | +| 1040-01 | Schedule H:1 | not-evaluated | +| 1040-01 | 5695:1 | not-evaluated | +| 1040-02 | 1040:1 | not-evaluated | +| 1040-02 | W-2:1 | not-evaluated | +| 1040-02 | W-2:2 | not-evaluated | +| 1040-02 | Schedule 1:1 | not-evaluated | +| 1040-02 | Schedule A:1 | not-evaluated | +| 1040-02 | Schedule C:1 | not-evaluated | +| 1040-02 | 8283:1 | not-evaluated | +| 1040-03 | 1040:1 | not-evaluated | +| 1040-03 | 1099-R:1 | not-evaluated | +| 1040-03 | Schedule 1:1 | not-evaluated | +| 1040-03 | Schedule 2:1 | not-evaluated | +| 1040-03 | Schedule D:1 | not-evaluated | +| 1040-03 | Schedule E:1 | not-evaluated | +| 1040-03 | Schedule F:1 | not-evaluated | +| 1040-03 | Schedule SE:1 | not-evaluated | +| 1040-03 | 4835:1 | not-evaluated | +| 1040-04 | 1040:1 | present | +| 1040-04 | W-2:1 | present | +| 1040-04 | Schedule 3:1 | missing | +| 1040-04 | 3800:1 | missing | +| 1040-04 | 8835:1 | missing | +| 1040-04 | 8936:1 | missing | +| 1040-04 | 8936 Schedule A:1 | missing | +| 1040-05 | 1040:1 | present | +| 1040-05 | W-2:1 | present | +| 1040-05 | Schedule 1:1 | missing | +| 1040-05 | Schedule 3:1 | missing | +| 1040-05 | 2441:1 | missing | +| 1040-05 | 8862:1 | missing | +| 1040-05 | 8863:1 | missing | +| 1040-05 | Schedule EIC:1 | missing | +| 1040-05 | Schedule 8812:1 | missing | +| 1040-08 | 1040:1 | not-evaluated | +| 1040-08 | 1099-R:1 | not-evaluated | +| 1040-08 | 1099-R:2 | not-evaluated | +| 1040-12 | 1040:1 | not-evaluated | +| 1040-12 | Schedule 1:1 | not-evaluated | +| 1040-12 | Schedule 2:1 | not-evaluated | +| 1040-12 | Schedule C:1 | not-evaluated | +| 1040-12 | Schedule SE:1 | not-evaluated | +| 1040-12 | 7206:1 | not-evaluated | +| 1040-12 | 7217:1 | not-evaluated | +| 1040-12 | W-2:1 | not-evaluated | +| 1040-13 | 1040:1 | present | +| 1040-13 | Schedule 3:1 | present | +| 1040-13 | 6251:1 | present | +| 1040-13 | 8911:1 | present | +| 1040-13 | 8911 Schedule A:1 | present | +| 1040-13 | W-2:1 | present | + +## Known attachment observations + +| Scenario | Requirement | Result | +| --- | --- | --- | +| 1040-04 | Transfer Election Statement | missing | + +## Source packets + +- [1040-01](https://www.irs.gov/pub/irs-efile/ty25-1040-mef-ats-scenario-1-12012025.pdf) +- [1040-02](https://www.irs.gov/pub/irs-efile/1040-mef-ats-scenario-2-12012025.pdf) +- [1040-03](https://www.irs.gov/pub/irs-efile/ty25-1040-mef-ats-scenario-3-10202025.pdf) +- [1040-04](https://www.irs.gov/pub/irs-efile/ty25-1040-mef-ats-scenario-4-10212025.pdf) +- [1040-05](https://www.irs.gov/pub/irs-efile/ty25-1040-mef-ats-scenario-5-10202025.pdf) +- [1040-08](https://www.irs.gov/pub/irs-efile/1040-mef-ats-scenario-8-10212025.pdf) +- [1040-12](https://www.irs.gov/pub/irs-efile/1040-mef-ats-scenario-12-10292025.pdf) +- [1040-13](https://www.irs.gov/pub/irs-efile/1040-mef-ats-scenario-13.pdf) diff --git a/docs/ats/ty2025-check-replay-2026-10-09.md b/docs/ats/ty2025-check-replay-2026-10-09.md index 1bdba6538..93d8fd75c 100644 --- a/docs/ats/ty2025-check-replay-2026-10-09.md +++ b/docs/ats/ty2025-check-replay-2026-10-09.md @@ -4,7 +4,7 @@ The eight retained partial Form 1040 fixtures were replayed through the public r **Selected observations: 41 match / 12 differ / 1 not produced, out of 54 (76% matching).** These are calculation checks chosen from retained printed amounts, source arithmetic and provisional interpretations. They are not an enumerated IRS business-rule set or a representative sample; matching values do not prove native/PDF output or accepted transmission. -**Updated engineering estimate: about 60% of individual ATS checks, uncertainty range45–75%.** This replaces75% after the public-entry and preparation replay exposed how much earlier evidence was component-only. The estimate is judgment across the broader required checks, not41/54 re-labeled as an IRS pass rate. Later deductions/credits are heavily represented here; most identity, attachment and IRS-rule checks are not. +**Historical engineering estimate (superseded by the [October10 check ledger](./ty2025-check-ledger-2026-10-10.md)): about 60% of individual ATS checks, uncertainty range45–75%.** This replaces75% after the public-entry and preparation replay exposed how much earlier evidence was component-only. The estimate is judgment across the broader required checks, not41/54 re-labeled as an IRS pass rate. Later deductions/credits are heavily represented here; most identity, attachment and IRS-rule checks are not. | Scenario | Match | Different | Not produced | Public/native preparation | Required source copies | | --- | ---: | ---: | ---: | --- | ---: | diff --git a/docs/development/pr-workflow.md b/docs/development/pr-workflow.md index 153d47b9e..5bcf78da8 100644 --- a/docs/development/pr-workflow.md +++ b/docs/development/pr-workflow.md @@ -8,7 +8,9 @@ After an authorized merge, fetch the latest `origin/main` and create one new ongoing branch and draft PR for subsequent work. Preserve local audit records, evidence, and uncommitted changes while updating the checkout. -The previous batch is merged in [PR #72](https://github.com/filedcom/opentax/pull/72). -Continue in [PR #73](https://github.com/filedcom/opentax/pull/73) on -`codex/mef-readiness-ongoing-2`, based on the latest `origin/main` -after that merge. Leave unrelated draft PRs outside this workflow. +The previous batch is merged in [PR #73](https://github.com/filedcom/opentax/pull/73). +Continue in [PR #74](https://github.com/filedcom/opentax/pull/74) on +`codex/mef-readiness-ongoing-3`, based on `origin/main` +commit `d65263134` after that merge. Use one ongoing draft PR for this branch +and keep pushing subsequent work to it until the next authorized merge. +Leave unrelated draft PRs outside this workflow. diff --git a/docs/mef/ty2025/domains/credits/business/form6478/ty2025-form6478-gap.md b/docs/mef/ty2025/domains/credits/business/form6478/ty2025-form6478-gap.md index c5e498eaf..592e0d0f0 100644 --- a/docs/mef/ty2025/domains/credits/business/form6478/ty2025-form6478-gap.md +++ b/docs/mef/ty2025/domains/credits/business/form6478/ty2025-form6478-gap.md @@ -1,8 +1,8 @@ # TY2025 Form 6478 source and filing boundary Status: the invalid production-gallons route is blocked in the Form 6478 input -node. Negative cases are written but unrun. No MeF, PDF, XSD, IRS business-rule -or ATS validation is claimed. +node. The October10 component and public checks below pass. No positive +Form6478 MeF, PDF, XSD, IRS business-rule or ATS validation is claimed. The [IRS TY2025 update](https://www.irs.gov/forms-pubs/completing-form-6478-for-tax-years-beginning-after-2024) @@ -49,3 +49,21 @@ entities. Build positive and negative source-level cases, including an ineligible calendar-year allocation, duplicate documents, passive credit, multiple sources, and tax limitation, before claiming this path supported. Keep it open; do not treat Form 6478 as an approved whole-root exclusion. + +## October 10 public intake and fuel-credit checkpoint + +Five Form6478 component tests and three public tests pass. Empty object and +empty fuel arrays preserve every baseline1040 field. All five legacy fuel +types, each tested at zero and1,000 gallons, produce an explicit ineligibility +diagnostic without a nonrefundable credit. An unmodeled line3 allocation also +produces a strict-schema diagnostic through public execution; the public API +returns diagnostics rather than throwing for these cases. Callers must honor +those diagnostics. This is input rejection evidence, not a positive allocation +route or an assertion about exporting diagnostic-bearing returns. + +The related Form8864 component and complete-return replay bring the grouped +fuel-credit result to21 passing tests, zero failures/ignored. Evidence: +`.state/research/fuel-credit-routes-2026-10-10/` (`components.log`, +`public6478.log`, `producer.log`). No production change or new deferred issue. +The fiscal-year pass-through source and Form3800 line4c route above remain +unimplemented; the broad named-form task stays open. diff --git a/docs/mef/ty2025/domains/credits/business/form8864/ty2025-form8864-gap.md b/docs/mef/ty2025/domains/credits/business/form8864/ty2025-form8864-gap.md index b4c36242e..a55819421 100644 --- a/docs/mef/ty2025/domains/credits/business/form8864/ty2025-form8864-gap.md +++ b/docs/mef/ty2025/domains/credits/business/form8864/ty2025-form8864-gap.md @@ -48,3 +48,26 @@ A source-backed full-return fixture exposed two assembly defects: `IRS8864` dema The `single-agri-biodiesel-producer-credit` review fixture executes $75,000 wages plus $10,000 producer sales and $500 credit income. The $500 allowed credit reaches Schedule 3 and Form 1040 line 20; Form 6251 line 3 subtracts $500 for AMT. The whole return validates against the local TY2025 v5.4 XSD. Its 23-page filled packet was rendered and visually inspected page by page, including all nine Form 3800 pages, owner identity, Schedule C income, SE deduction, QBI and refund totals. Form 8864 line 8 prints 2,500 gallons at $0.20 and $500 on lines 8/9/11. Native/PDF/source focused checks passed 27/27; additional wrong allocation and AMT negatives are included in the integrated check. Artifacts are ignored local evidence under `.state/research/ty2025-filled-pdf-review/2026-10-05-form8864-direct-producer/`. XML SHA256: `5d87e817e289b5881b6ef39c6d7e1f67018eecc75c1c219cee1289e042fa58c2`; PDF SHA256: `aaca5fc825a3c2d586d23620851a3a1d68131a6f9b445ec402da00c927f60a7a`. Page images are `/tmp/opentax-8864-review/page-01.png` through `page-23.png`. These synthetic facts and packet checks do not authenticate producer records, resolve first-half MeF business rules, or establish ATS acceptance. Wider routes remain open. + +## October 10 complete producer export replay + +The current fuel-credit group passes21 tests:17 source/native/PDF component +checks across Forms6478/8864, three public Form6478 checks and one complete +Form8864 producer replay. The latter recomputes the retained two-lot2,500-gallon +fixture, confirms500 source/allowed credit and negative500 AMT adjustment, +validates the full return against TY2025 v5.4 XSD and renders an actual23-page +PDF. This reruns the earlier packet route; it adds no newly reviewed visual +pages and does not remove earlier presentation qualifications. + +Eight changed pending returns reject both preparation/native assembly and +actual PDF building (16 assertions): five extra gallons (a1-dollar rounded +credit change), wrong producer EIN, credit deposit500.01, AMT deposit-500.01, +applied credit499, AMT deposit-499, wrong proprietor SSN, and ScheduleC income +inclusion499. The fractional deposits specifically verify that inconsistent +source deposits cannot be concealed by printed whole-dollar rounding. + +Evidence: `.state/research/fuel-credit-routes-2026-10-10/producer.log` and the +related component/public logs. No production code changed. The remaining +first-half rule conflict, producer variants, fiscal-year allocations, transfers +and source-byte authenticity remain open; this checkpoint does not claim +current IRS business-rule approval or ATS acceptance. diff --git a/docs/mef/ty2025/domains/credits/business/form8874/ty2025-form8874-pdf-gap.md b/docs/mef/ty2025/domains/credits/business/form8874/ty2025-form8874-pdf-gap.md index 923a3b57d..30b991071 100644 --- a/docs/mef/ty2025/domains/credits/business/form8874/ty2025-form8874-pdf-gap.md +++ b/docs/mef/ty2025/domains/credits/business/form8874/ty2025-form8874-pdf-gap.md @@ -1,5 +1,11 @@ # TY2025 Form 8874 PDF print route +Current status (October10): direct-QEI credit exports are blocked for missing +authenticated CDE status/history. Historical credit packets below predate that +gate. The latest checkpoint verifies reported-event recapture exports and the +current credit boundary; it supersedes older authored/unrun wording for the +checks it names. + The [IRS Form 8874 (Rev. November 2021)](https://www.irs.gov/pub/irs-pdf/f8874.pdf) is the current continuous-use New Markets Credit paper form. Its first page has @@ -217,3 +223,47 @@ open. The fixed-source `7318ed47` repository-wide run completed at 2026-09-29 15:04 UTC: 8,880/8,880 passed, zero failed, with no ignored tests reported, in 16m42s. Its log is `.state/research/ty2025-full-test-7318ed47.log`. + +## October 10 credit inventory and reported recapture checkpoint + +The ten existing input/evidence/native/PDF/child-source modules pass44 tests, +including issuance identity and deadlines, recapture and carryover arithmetic, +byte-bound no-event/notice helpers, staged Form8874 XSD, overflow and parent +credit checks. Four new public tests pass, for **48 passes, zero failures or +ignored tests**. The no-event helper remains separate from public direct-credit +export; consistency of synthetic reviewed bytes does not authenticate a CDE. + +Two historical direct-QEI fixtures still calculate correctly: two investments +produce1,100 credit and final tax23,967; seven produce3,500 and final tax21,567. +Both have150,000 wages and25,067 tax before the credit. Each now rejects both +complete preparation and actual PDF building with the authenticated CDE status +and recapture-history message (four assertions). These are verified current +blocks, not new positive filing or visual evidence. The older two/seven-row +packets must not be counted as currently exportable returns. + +One- and two-investment reported-recapture cases retain reviewed synthetic +Form8874-A/B pairs, CDE/investor identity, original QEI date, prior allowed-credit +recomputations and carryover vintages. Per investment, prior allowed credit +falls from9,000 to7,000; the source notice's25,000 is not the recapture tax. +The independent check uses2,000 of used credit and144 rounded interest: +`2000 * (1 + .07/365)^351 * (1 + .06/365)^14 - 2000`. +The [IRS quarterly rate table](https://www.irs.gov/payments/quarterly-interest-rates) +confirms the applicable7% through2026Q1 and6% for2026Q2. + +| Reported investments | Schedule2 line17a NMCR | Form1040 final tax | Actual PDF pages | +| --- | ---: | ---: | ---: | +| 1 | 2,144 | 10,099 | 4 | +| 2 | 4,288 | 12,243 | 4 | + +Both complete returns pass local TY2025 v5.4 Return1040 XSD and actual PDF +construction. Each rejects changed line17a and changed taxpayer identity at +preparation and PDF export (eight mutation assertions). These eight generated +pages have **not** received a new visual review; no reviewed-page total is +increased. The separate component-XSD test is not a third complete return. + +Logs and provenance: `.state/research/new-markets-routes-2026-10-10/`, on +production runtime `d65263134`. The public module is +`forms/f1040/2025/domains/credits/business/form8874/form8874_public.test.ts`. +No production code or deferred repair changed. Authenticated CDE/notice/prior +return records, wider recapture histories, passive credit use and direct-QEI +activation remain open; the broad Form8874 task is not complete. diff --git a/docs/mef/ty2025/domains/credits/individual/form8839/ty2025-form8839-gap.md b/docs/mef/ty2025/domains/credits/individual/form8839/ty2025-form8839-gap.md index 943598bac..a0cb54abd 100644 --- a/docs/mef/ty2025/domains/credits/individual/form8839/ty2025-form8839-gap.md +++ b/docs/mef/ty2025/domains/credits/individual/form8839/ty2025-form8839-gap.md @@ -681,3 +681,17 @@ Four public-source probes add2000 of W-2 code-D deferrals, with explicit nonstud At wages40000, above the single-filer saver-credit income cutoff, the return retains tax2675, zero saver credit, nonrefundable adoption2675, refundable adoption5000 and carry3325. Native and complete-PDF construction pass; changing either the Schedule3 saver-credit amount or carry amount rejects at both export boundaries. No new retained PDF visual review, XSD validation or IRS acceptance is claimed for this probe. The underlying attachment PDFs are synthetic identifiers, not authenticated decree or expense records. The revised regression records the three exact public-route rejections explicitly. Credit ordering remains open; passing rejection assertions are boundary coverage, not completed tax-return coverage. Private logs: `.state/research/form8839-saver-ordering-2026-10-09/`. + +## October 10 QEF current-year carryforward composition + +The [Election B checkpoint](../../../../../../../forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure_proof.md#october-10-current-year-adoption-carryforward-with-election-b) +now permits actual unused adoption credit on the verified QEF refigure route, +including the preceding education-credit stage. Actual records retain1,885/95; +hypothetical unused amounts do not become filed carryforwards. Two direct exports +pass fullXSD and20 packet pages were reviewed;20 altered-ledger export rejections +pass. Non-Election-B PFIC combinations retain their guard. + +Pending-JSON reload fails source replay in four retained exporter checks, newly +deferred150 without repair. Zero-tax display repeats76. This checkpoint does +not establish saved-return support, accepted carry records, next-year imports, +external authenticity or closure of the broad adoption task. diff --git a/docs/mef/ty2025/domains/general/return-assembly/form1040/ty2025-form1040-form-audit.md b/docs/mef/ty2025/domains/general/return-assembly/form1040/ty2025-form1040-form-audit.md index 84c695e57..e891ed759 100644 --- a/docs/mef/ty2025/domains/general/return-assembly/form1040/ty2025-form1040-form-audit.md +++ b/docs/mef/ty2025/domains/general/return-assembly/form1040/ty2025-form1040-form-audit.md @@ -253,7 +253,7 @@ rules and IRS acceptance remain open. | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | --- | ----- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | 461 | Reviewed C/F-only return-wide source; P | `f461.ts` R | Y | W | Current C/F-only graph/native/PDF reconciliation has22 passing results across4 named modules in the completed October8 full run. Wider business/passive scope, source limitations, complete artifact evidence and IRS gates remain open; see [gap](../../../income/business/form461/ty2025-form461-gap.md) and [current bundled audit](../../../../readiness/ty2025-bundled-form-audit-reconciliation-2026-10-08.md). | | 965-A | Section 965 history/payment facts; P | `f965a.ts` R | Y | W | Bounded registered PDF prints one unadjusted original 2017–2020 liability, eight installment payments, and the current Schedule 2 line 20 amount from native-prepared facts. Source/native/PDF fixtures are authored but unrun. Positive printable export remains closed until prior filed liability and payment records are verified; transfers and adjustments remain open. See [PDF gap](../../../taxes/foreign/form965/ty2025-form965a-pdf-gap.md). | -| 982 | Debt-discharge source and attributes; P | `f982.ts` R | Y | W | Open: qualified-principal-residence and attribute reduction (`GAP-982`). | +| 982 | Debt-discharge source and attributes; P | `f982.ts` R | Y | W | Open: QPRI public checkpoint90 pass/2 fail; seven full-XSD packets/29 reviewed pages include cap-ordering defect149. Non-QPRI exports remain guarded; authenticity and attribute reduction remain open (`GAP-982`). | | 1099-R | Issued distribution source, recipient and taxable/withheld amounts; P | `f1099r.ts` R | N | W | Bounded two-copy Scenario 8 native and recipient/source-rejection cases exist. This is a payer-issued source document, so a separate taxpayer-form PDF is not presumed; authenticate issued copies and reconcile every recipient, rollover, withholding and Form 1040 destination before a filing claim. | | 1116 | Passive/general FTC with reviewed 2021–24 carryovers; P | `f1116.ts` R | Y | W | October9 passive-country checkpoint: seven XSD-valid complete returns/56 reviewed pages reconcile parent and current-excess Schedule B; residence107/zero76 remain deferred. Six additional vintage packets/48 pages reconcile use and expiry; four pass XSD and two fail deferred108. Seven additional employer XMLs pass XSD; 56 packet/attachment pages plus three overflow pages verify the newly appended allocation statement. Six K-3 native-only XMLs pass XSD, but all public PDF-review inputs fail deferred109 and six changed-recipient native exports accept (deferred110); no complete K-3 PDF packet passes. Broader parent and Schedule B routes remain qualified. Schedule C has a sourced redetermination ledger but still blocks native export pending affected-year recomputation; other baskets, allocation, AMT, carryback, main-PDF breadth and validation remain open; see [Schedule C gap](../../../credits/foreign/form1116/ty2025-form1116-schedule-c-gap.md) and [main PDF gap](../../../credits/foreign/form1116/ty2025-form1116-main-pdf-gap.md). | | 1116 Schedule B | Reviewed 2021-2024 passive/general vintages; P | `f1116_schedule_b.ts` R | Y | W | October9 current-excess proof retains seven complete packets with all fourteen Schedule B pages reviewed and reconciled to parent/final credit; it does not verify authenticated prior-year vintages. The six-packet vintage checkpoint verifies oldest-first use/expiry with46 native/46 fresh-PDF rejections; four XMLs pass and two2015 XMLs fail deferred108. Carrybacks, multi-category and validation remain open (`GAP-1116`). | @@ -265,7 +265,7 @@ rules and IRS acceptance remain open. | 3800 | Identified business credits and tax limits; P | `f3800.ts` R | Y | W | Nine-page parent and PartV continuations now reconcile reviewed full/partial/zero K-1 and production-facility use, mixed credit classes and sourced bond reductions; linked checkpoints retain98 complete XSD-valid returns/1,824 reviewed pages with documented presentation qualifications. PartVI pagination separately retains37 component roots/17 pages and does not establish an authenticated carryover filing. Passive limits, other source combinations, transfers, accepted carry histories, source authenticity and ATS remain open; see [checkpoints](../../../credits/business/form3800/ty2025-form3800-pdf-gap.md). | | 4136 | Identified fuel uses, rates and claimant facts; P | `f4136.ts` R | Y | W | Open: remaining activities, attachments and render. | | 4137 | Employer/month tip and W-2 facts; P | `f4137.ts` R | Y | W | October10: joint tips and mixed-employment full returns pass XSD, final-tax and actual-PDF checks; four owner Form4137 pages reviewed within the three-return/26-page employment checkpoint. Wider RRTA/source records and authenticity remain open (`TIPS-01`). | -| 4255 | Credit-property recapture row facts; P | `f4255.ts` R | Y | W | Bounded five-page PDF maps one excessive-payment-only Part I row on line 1d and/or 2a, checked against typed prior-credit/IRS-determination facts and finalized Schedule 2 line 16. Native/PDF positive and tamper fixtures are authored but unrun. Both exports remain closed pending authenticated prior-return and determination bytes; other recapture classes and Parts II/III remain open. See [PDF gap](../../../taxes/credit-recapture/form4255/ty2025-form4255-pdf-gap.md). | +| 4255 | Credit-property recapture row facts; P | `f4255.ts` R | Y | W | Bounded PDF retains three PartI pages from the five-page template. October10 input/native/PDF10 tests and four public tax-route checks pass; both final exporters reject all four candidates. EP/penalty and net-EPE destinations reconcile through final1040 tax. Authenticated source bytes, PartsII/III and broader recapture remain open. See [PDF gap](../../../taxes/credit-recapture/form4255/ty2025-form4255-pdf-gap.md). | | 4562 | Section179 and complete bonus inventory with credit basis; P | `f4562.ts` R | Y | W | October9 inventory batch: 366 grouped passes; three complete XSD-valid returns/73 reviewed pages. One Form4562 per taxpayer-owned ScheduleC activity with exact deduction and property joins; ordinary assets without credits supported. General MACRS, spouse/other activities and source/IRS gates remain open. See [gap](../../../deductions/business/form4562/ty2025-form4562-gap.md). Profitable integration adds four complete XSD returns/151 reviewed pages, SE/QBI and six-business continuation checks; 82 focused tests pass. Construction-exception batch adds five XSD returns/133 reviewed pages and 37 focused passes; actual PWA remains guarded. Current-year inventory adds 40%/100% bonus, residual GDS with return-wide HY/MQ, six class rows and six complete XSD returns/170 reviewed pages; broader MACRS and source/IRS gates remain open. Reviewed class opt-outs and transitional 40% bonus now include native/printable election statements; five complete XSD returns/153 reviewed pages and 37 grouped passes. Reviewed class-wide 150 DB/S/L methods now join the same native/PDF rows, with five further XSD returns/145 reviewed pages and 41 grouped passes; ADS and later-year methods remain open. Reviewed fully allowed section 179 allocations now precede property credit, bonus and MACRS; multi-business SUMMARY and line-6 continuation join native/PDF packets. Six further XSD returns/159 reviewed pages; 57 grouped passes. Carryover/disallowed allocations remain guarded. Section179/one-plan health ordering adds four full XSD returns/110 reviewed pages and44 typed passes, including income-limited health, employer-excluded months and credit limits; zero-health primary-owner QBI rejection is future-only. | | 4562 bonus opt-out statement | Reviewed class-wide election on complete current-year inventory; P | `f4562_elections.ts` R | Y | W | Native `SpclDeprecAllwncElectOutStmt`; printed once after the first Form4562 copy. Exact owner/class/asset-choice joins; timing and consent remain reviewed assertions. Five full election packets include this route; IRS acceptance remains open. | | 4562 reduced-bonus statement | Reviewed 2025 40% election across eligible property; P | `f4562_elections.ts` R | Y | W | Native `GeneralDependencyMedium` carries SSN, line/statutory references and the full election; printed once by Form4562. Mixed choices reject. Combined opt-outs supported. Five full election packets include this route; IRS acceptance remains open. | @@ -317,7 +317,7 @@ rules and IRS acceptance remain open. | 8859 | DC first-time homebuyer credit facts; P | `f8859.ts` R | Y | W | Open: recapture and source/date audit. | | 8862 | Prior credit-disallowance and refiling facts; P | `f8862.ts` R | Y | W | Bounded native and three-page PDF detail are written. A one-child CTC reinstatement binds Form 8862 to the finalized Form 1040 dependent row, passes local TY2025 v5.4 full-return XSD, and was inspected across seven v62 PDF pages. A separate five-dependent return passes local XSD and prints an inspected Form 1040 overflow statement. CTC/ODC and AOTC claims now require separate reviewed prior-notice records matching the claim year, reference, and taxpayer; Current source/ODC/AOTC/combined/native/PDF guard review passed43/0; both exporters reject unauthenticated notice claims. Earlier positive packet descriptions are historical; current positive native/PDF admission remains unproved. Authenticating retained IRS notice bytes, other conditional variants, and IRS acceptance remain open; see [sparse-map audit](../../../../inventory/ty2025-sparse-form-static-audit.md). | | 8863 | Student/tuition and credit facts; P | `f8863.ts` R | Y | W | Owned school workpapers, continuations, prior-year1098-T box7 answers and domestic/foreign postal addresses reach native/PDF and final tax. Three school checkpoints retain24 XSD-valid returns/164 reviewed pages. Latest final validation:85 core tests plus8 foreign-school cases;96 native/152 full-PDF rejections. See [foreign-school checkpoint](../../../credits/individual/form8863/ty2025-form8863-pdf-gap.md#october-9-foreign-school-address-checkpoint). Multiple-business support adds six XSD-valid returns/104 reviewed pages,12 focused plus14 existing passes and60 native/60 PDF mutation rejections; [checkpoint](../../../credits/individual/form8863/ty2025-form8863-self-employed-support-review.md#october-9-multiple-personal-service-business-checkpoint). Six taxable-scholarship combinations remain blocked (deferred102). Service-grant/business combinations add six XSD-valid returns/86 reviewed pages, six initial passes plus corrected-child replay and14 existing passes,72 native/72 PDF rejections; [checkpoint](../../../credits/individual/form8863/ty2025-form8863-required-service-scholarship-review.md#october-9-service-grant-and-business-combination-checkpoint). Incorrect ACTC earned-income input accepted by native/PDF is deferred103. The [compensation-cent checkpoint](../../../credits/individual/form8863/ty2025-form8863-required-service-scholarship-review.md#october-9-compensation-cent-source-reconciliation) adds eight XSD-valid returns/112 reviewed pages, nine focused passes and32 native/32 PDF rejections; exact-cent source/support and school-ledger joins work on both reporting routes, with one-dollar derived-line rounding qualified by deferred104. Distinct school-owned awards across two to four institutions add six XSD-valid returns/88 reviewed pages, six typed passes and36 native/36 PDF rejections; mixed W-2/line8r reporting, support and AOC/LLC continuation caps reconcile. Source authenticity, wider eligibility/tax capacity, presentation76/86 and older domestic payment dates101 remain open. | -| 8874 | QEI/partner New Markets credit facts; P | `f8874.ts` R | Y | W | Bounded Form 8874 PDF and six-column investment statement registered. One-, two-, six-, seven-, and 24-investment nonpassive New Markets cases pass local native XSD and filled Form 8874/Form 3800 review; the seven- and 24-investment packets use the required last-row attachment total and one or two continuation pages. A mixed geothermal/New Markets return and one schema-valid long-CDE wrapped-statement return also pass; carryovers, passive cents, broader text and overflow combinations, and recapture remain open. | +| 8874 | QEI/partner New Markets credit and recapture facts; P | `f8874.ts` R | Y | W | October10 group48 passes: direct two/seven-investment credit calculations reconcile but both exports are blocked pending authenticated CDE status/history. Two reported-recapture returns pass fullXSD/actual PDF with eight mutation rejections; no new visual count. Older direct-credit packet evidence is historical. Wider histories, passive use and source authenticity remain open; see [checkpoint](../../../credits/business/form8874/ty2025-form8874-pdf-gap.md#october-10-credit-inventory-and-reported-recapture-checkpoint). | | 8880 | IRA/elective-deferral and eligibility facts; P | `f8880.ts` R | Y | W | Native MeF and PDF now share computed print lines; a positive credit needs a sourced tax-liability limit, while a reviewed zero-credit result omits the document. Final return tax capacity, age/dependency/student facts, distribution window, filled render, and validation remain open; see [gap audit](../../../credits/individual/form8880/ty2025-form8880-gap.md). | | 8888 | Two or three sourced refund-deposit accounts; P | `f8888.ts` R | Y | W | Native allocation and December 2025 PDF map reconcile to finalized Form 1040 line 35a and reject a competing direct account. Focused and synthetic full-return XSD and filled-PDF checks pass, including the Form 1040 attachment mark. Account ownership, bank instructions, final release batch, other business rules and ATS remain open; see [source-only audit](../../../../inventory/ty2025-source-only-and-sparse-map-gap.md). | | 8889 | Monthly owner-labeled HDHP/HSA sources and prior-transfer history; P | `f8889.ts` R | Y | W | Bounded single/paired-owner, code-1 distribution, and full-year paired family/self-only month routes, including mismatched owner arrays under the deemed-family rule, include owner-specific age-55 treatment and 2024 eligibility review for prior funding-transfer recapture. Bounded primary-owner age-65/disability ordering and one sourced rollover now reconcile dated code-1 before disability and code-3 afterward to Schedule 1/2, Form 1040, native/PDF; fixtures are authored but unrun. Ineligible/Medicare mixed months, wider last-month/excess combinations, external source authentication, filled render and validation remain open; see [paired gap](../../../adjustments/health/form8889/ty2025-form8889-paired-hsa-gap.md), [disability gap](../../../adjustments/health/form8889/ty2025-form8889-disability-exception-gap.md), and [prior-transfer gap](../../../adjustments/health/form8889/ty2025-form8889-prior-funding-eligibility.md). | @@ -360,7 +360,7 @@ evidence still govern positive export. | --- | --- | --- | --- | --- | --- | | 2106 | One–four owned qualified employee jobs; P | `f2106.ts` R | Y | W | Twenty-three prior XSD-valid returns/170 reviewed pages, plus six reservist returns/38 pages that fail XSD on deferred105 ratio precision; 134 tests, latest 60 native/60 PDF rejections. Fee-basis travel/mileage/reimbursements and itemized impairment expenses reconcile; Schedule A carries a sourced line-16 description/statement. Artist employer/expense/AGI/marital tests reconcile to owned W-2s and filed totals. Reservist trip caps produce a separate Schedule 1 contribution from full Form 2106 expenses. Wider travel/reimbursements/income, issued-source bytes, final batch, business rules, and ATS remain open; see [gap](../../../adjustments/employment/form2106/ty2025-form2106-gap.md). | | 8844 | One direct Schedule C employer credit; P | `f8844.ts` R | Y | W | Form 3800 Part III line 3 and final-credit joins are staged. Other employer and pass-through branches, source authentication, final batch, and ATS remain open; see [gap](../../../credits/business/form8844/ty2025-form8844-gap.md). | -| 8864 | One small agri-biodiesel producer route; P | `f8864.ts` R | Y | W | Form 3800 line 1l and AMT joins are bounded; expired or transferred credits and wider producers reject. Final XSD/PDF/business-rule/ATS evidence remains open; see [gap](../../../credits/business/form8864/ty2025-form8864-gap.md). | +| 8864 | One small agri-biodiesel producer route; P | `f8864.ts` R | Y | W | October10 complete two-lot producer replay passes fullXSD/actual23-page PDF; eight mutations reject preparation and PDF (16 assertions). Fuel group21 tests pass, no new visual count. First-half rules, broader sources, authenticity and ATS remain open; see [gap](../../../credits/business/form8864/ty2025-form8864-gap.md). | | 8881 | One direct Schedule C employer route; P | `f8881.ts` R | Y | W | Bounded startup/auto-enrollment credit joins Form 3800. Other plans, employer structures, source authentication, and final validation remain open; see [gap](../../../credits/business/form8881/ty2025-form8881-gap.md). | | 8882 | One direct Schedule C employer route; P | `f8882.ts` R | Y | W | Bounded employer childcare credit joins Form 3800 line 1k. Other costs, employers, source authentication, and final validation remain open; see [gap](../../../credits/business/form8882/ty2025-form8882-source-gap.md). | | 8886 | Authenticated prepared reportable-transaction disclosure packets; P | `mef-descriptors.ts` R | Y, prepared packet | Executed | Registered parent `IRS8886` requires retained prepared disclosure packets and final whole-return IDs; no independent aggregate fallback. Merged #66 retains 608 local passes and 137 CI core/harness passes. Separate initial-year OTSA handoff is not an IRS receipt or accepted filing. | diff --git a/docs/mef/ty2025/domains/income/business/form3115/ty2025-form3115-route-audit.md b/docs/mef/ty2025/domains/income/business/form3115/ty2025-form3115-route-audit.md new file mode 100644 index 000000000..abb282115 --- /dev/null +++ b/docs/mef/ty2025/domains/income/business/form3115/ty2025-form3115-route-audit.md @@ -0,0 +1,42 @@ +# TY2025 Form3115 public adjustment and export boundary + +## October 10 grouped source and recapture verification + +The existing Form3115 source-to-ScheduleC task is verified through public +return execution for six current-year cases. Each preserves a20,000 ScheduleC +business and75,000 of unrelated W2 wages. + +| Case | Source adjustment / change year | Current inclusion | ScheduleC profit | Total income | +| --- | ---: | ---: | ---: | ---: | +| first positive installment | 12,000 / 2025 | 3,000 | 23,000 | 98,000 | +| final installment remainder | 10,001 / 2022 | 2,501 | 22,501 | 97,501 | +| expired positive installment | 12,000 / 2021 | 0 | 20,000 | 95,000 | +| current negative adjustment | -6,000 / 2025 | -6,000 | 14,000 | 89,000 | +| prior negative adjustment | -6,000 / 2024 | 0 | 20,000 | 95,000 | +| declared one-year positive election | 49,999 / 2025 | 49,999 | 69,999 | 144,999 | + +All six calculations have no diagnostics. Both final exporters reject each +return because an entered Form3115 requires its native attachment, including +cases with no current inclusion. The twelve rejection assertions establish +that the public calculator does not silently convert these into supported +filings. The existing projection test additionally checks ScheduleC native +other-income/net-profit and PDF line6/31 for the3,000 inclusion. + +The grouped source/native/PDF tests for Forms3115,4255 and8611 pass **32/32**; +the new public module adds **10/10**, with zero failures or ignored cases. +The latter includes the six method-change cases and four Form4255 tax routes. +These are bounded calculation/projection and export-boundary checks. No new +full-return XSD, rendered-page, attachment, source-authenticity or IRS +acceptance count is claimed. Existing Form8611 issued-K1 packet evidence +remains separate and retains its presentation qualifications. + +Evidence: `.state/research/method-recapture-routes-2026-10-10/components.log` +and `public.log`, on production runtime `d65263134`. The public tests live in +`forms/f1040/2025/domains/general/return-assembly/method-recapture.test.ts`. +The component batch comprises Form3115 input and ScheduleC e2e, plus input, +native and PDF modules for each of Forms4255 and8611. + +The main Form3115 task remains open: entered method/election claims are not +an authenticated, signed application or consent record; the required +attachment and wider schedules/special periods remain unresolved. No new +exclusion approval or deferred repair is inferred from a passing rejection. diff --git a/docs/mef/ty2025/domains/income/foreign/form8621/ty2025-form8621-pdf-gap.md b/docs/mef/ty2025/domains/income/foreign/form8621/ty2025-form8621-pdf-gap.md index 90b30fa19..473f459db 100644 --- a/docs/mef/ty2025/domains/income/foreign/form8621/ty2025-form8621-pdf-gap.md +++ b/docs/mef/ty2025/domains/income/foreign/form8621/ty2025-form8621-pdf-gap.md @@ -1,8 +1,19 @@ # TY2025 Form 8621 printable-return gap -## Current verified parent packet checkpoint (October6) - -The source-bound parent PDF is registered. [Current proof](../../../../../../../forms/f1040/2025/domains/income/foreign/form8621/form8621_parent_source_proof.md) records main36/0+56/0 and five fullXSD packets/38 reviewed pages byte-identical to reviewed originals. QEF ElectionB, accepted-record contract for section1294 status/interest and seven-election overflow, multiple MTM dispositions and line14c Form8949 are verified within the stated source contract. Synthetic issuer/ACK bytes do not authenticate external records. Broader QEF AGI-sensitive refigure and IRS acceptance remain open. Historical staged sections below are superseded only for these proved routes. +## Current parent and counterfactual routes + +The source-bound parent PDF is registered. The [parent packet proof](../../../../../../../forms/f1040/2025/domains/income/foreign/form8621/form8621_parent_source_proof.md) +retains section1291, QEF, MTM and historical-election contracts. The later +[full-return refigure proof](../../../../../../../forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure_proof.md) +supersedes older claims that AGI-sensitive refigures, AMT, ScheduleJ, Form8615, +adoption or education are universally blocked. + +The October10 combined education/adoption route adds two full-XSD returns and +22 visually reviewed pages, with source-replayed credits and QEF deferrals +740/235. The subsequent Election B carryforward checkpoint verifies two direct exports/20 pages and actual carries1,885/95, while persisted-pending replay remains deferred150; zero-tax presentation +repeats deferred76. External source authentication, broader combinations and IRS +acceptance remain open. The historical stages below describe how these routes +were built; their unregistered/unrun statements are not current status. Static source, native, and blank-PDF review on 2026-09-28, followed by a Part V diff --git a/docs/mef/ty2025/domains/income/other/form982/ty2025-form982-qpri-pdf.md b/docs/mef/ty2025/domains/income/other/form982/ty2025-form982-qpri-pdf.md index 21c55168b..e885a4fd6 100644 --- a/docs/mef/ty2025/domains/income/other/form982/ty2025-form982-qpri-pdf.md +++ b/docs/mef/ty2025/domains/income/other/form982/ty2025-form982-qpri-pdf.md @@ -24,7 +24,8 @@ AcroForm names: The old Form 982 PDF mapping put line 2 in `f1_7[0]`, which is line 7, and omitted the QPRI checkbox and line 10b. The new shared QPRI projector recomputes the Form 982 deposit from one original excluded Form 1099-C, requires exact -deposited facts, applies the qualified-loan and filing-status cap logic, and +deposited facts, applies the current qualified-loan and filing-status cap logic (qualified by +the cap-ordering failure below), and feeds the same derived line 2 and line 10b values to native XML and PDF. Missing, multiple, or inconsistent original sources fail closed. The PDF route also requires the return filing status to match the QPRI @@ -32,11 +33,62 @@ married-filing-separately answer. A disposed residence leaves line 10b blank. If the Form 982 pending slot is empty while the original Form 1099-C would deposit a positive exclusion, both exports now reject the missing form. -The focused tests cover capped and mixed-use debt, retained/disposed residence, -zero basis, missing original source, source mismatch, filing-status mismatch, -non-QPRI rejection, a missing Form 982 deposit, and field names. They are **not -run** under the current build-first instruction. The later agreed batch still -needs typecheck, tests, IRS TY2025 XSD validation of native XML, and a -filled-PDF render with visual verification of the checkbox appearance and line -placement. Source-PDF inspection alone does not prove a filled widget's visual -appearance. +## October 10 public source and complete export checkpoint + +The existing 1099-C, Form982 calculation, native-contract and XSD modules now +run successfully: **84 passed, zero failed or ignored**. The new public export +module has **six passes and two failures**, for **90 passes and two failures** +across the grouped checks. The two failures remain active regression cases; +no production repair or ignored expectation was introduced. + +Seven retained-residence returns reach native XML and actual flattened PDF. +All seven pass the full TY2025 v5.4 Return1040 schema. All 29 packet pages were +visually reviewed (20 distinct RGB hashes), including Form982 checkbox1e, +line2 and line10b; zero retained basis prints an explicit zero. Independent +Python checks reconcile PDF text and native Form982 amounts to the actual +calculation, validate flattened fields, and independently recompute exclusion, +taxable cancellation and ordinary tax. That agreement does **not** make the +two cap returns correct. + +| Public case | Line2 actual / expected | Taxable COD actual / expected | Final tax actual / expected | Pages | +| --- | ---: | ---: | ---: | ---: | +| retained | 15,000 / 15,000 | 0 / 0 | 7,955 / 7,955 | 3 | +| mixed-loan-basis-limit | 50,000 / 50,000 | 50,000 / 50,000 | 19,067 / 19,067 | 5 | +| separate-cap | 375,000 / 175,000 | 25,000 / 225,000 | 13,455 / 69,035 | 5 | +| joint-cap | 750,000 / 550,000 | 50,000 / 250,000 | 10,746 / 56,134 | 5 | +| zero-basis | 15,000 / 15,000 | 0 / 0 | 7,955 / 7,955 | 3 | +| taxable-interest | 15,000 / 15,000 | 2,000 / 2,000 | 8,395 / 8,395 | 5 | +| deductible-interest | 15,000 / 15,000 | 0 / 0 | 7,955 / 7,955 | 3 | + +Each return has wages75,000 and withholding11,000. The single/MFS standard +deduction is15,750; MFJ is31,500. Expected exclusion applies the qualified-debt +cap before subtracting nonqualified debt from the canceled principal. This +follows the exclusion limit and ordering rule in +[2025 Publication4681](https://www.irs.gov/publications/p4681). +In `separate-cap`, acquisition-use debt600,000 and canceled principal400,000 +leave225,000 nonqualified debt after the375,000 cap; exclusion is175,000. +In `joint-cap`, debt1,000,000 and cancellation800,000 leave250,000 nonqualified +debt after the750,000 cap; exclusion is550,000. The current implementation +instead accepts an over-cap claimed qualified balance and caps the exclusion +only after ordering. Either reject that source claim or apply the cap before +ordering; this is **future_todo149**, outside the current repair queue. + +Seven native and seven actual-PDF mutations of the retained basis reject +against the original1099-C deposit before the amount assertions. Four other +exclusion types (bankruptcy, insolvency, farm debt, real-property business) +reject at both final exporters: native currently stops at its earlier QPRI +filing-status check because these sources lack a QPRI flag, while PDF reports +missing tax-attribute reduction details. These eight rejections establish an +export boundary, not implemented or approved exclusion coverage. + +Evidence is retained privately in +`.state/research/form982-qpri-2026-10-10/`: original inputs, pending deposits, +XML/PDF, component and final-public logs, page inventory, contact sheets, +independent verifier, packet-verification, visual-review and SHA256SUMS. +The earlier component XSD test is separate from these seven new public packets. +Run the public module with `deno test -A` and optional +`-- --evidence-dir=`; full XSD needs the local authorized schema +cache and `xmllint`, and PDFs need the template cache/network. +Synthetic lender/loan-use references do not authenticate real source documents. +Wider debt inventories, non-QPRI attribute reduction and IRS acceptance remain +open; the broad Form982 board task is not checked off. diff --git a/docs/mef/ty2025/domains/taxes/credit-recapture/form4255/ty2025-form4255-pdf-gap.md b/docs/mef/ty2025/domains/taxes/credit-recapture/form4255/ty2025-form4255-pdf-gap.md index 523c4fd99..2526f5d25 100644 --- a/docs/mef/ty2025/domains/taxes/credit-recapture/form4255/ty2025-form4255-pdf-gap.md +++ b/docs/mef/ty2025/domains/taxes/credit-recapture/form4255/ty2025-form4255-pdf-gap.md @@ -67,3 +67,29 @@ files. A staged EP-only PDF was rendered and all three retained Part I pages were visually inspected, including the line 1d/2a entries and line 3 totals. The native positive-export gate still rejects unauthenticated source bytes, so this direct descriptor review is not a filed full-return or XSD validation. + +## October 10 public calculation and final export boundary + +The grouped Forms3115/4255/8611 component batch passes32 tests; ten new public +checks also pass (42 distinct passes, zero failures/ignored). Form4255's own +input/native/PDF modules account for10 component tests. Four public Form4255 +cases retain75,000 W2 wages and baseline tax7,955: + +| Case | Schedule2 destination | Added tax | Final1040 tax | +| --- | --- | ---: | ---: | +| EP-only line2a | line1e300 + line1f60 | 360 | 8,315 | +| line2a recapture | line1d1,500 + line1e300 + line1f60 | 1,860 | 9,815 | +| line1d recapture | line19 1,500 + line1e300 + line1f60 | 1,860 | 9,815 | +| line1d EP, reasonable cause | line1e300; line1f0 | 300 | 8,255 | + +Both final exporters reject all four candidates with their respective missing +source-authentication errors (eight assertions). The source metadata is +synthetic; a consistent amount and SHA256-shaped string do not prove an IRS +notice or accepted prior return. The PDF projection test verifies three +retained PartI pages from the five-page template and rejects unsupported +recapture. There is no new rendered-page or full-return XSD claim. + +See the [grouped route checkpoint](../../../income/business/form3115/ty2025-form3115-route-audit.md) +and `.state/research/method-recapture-routes-2026-10-10/` logs. This supersedes +older authored/unrun inventory wording but leaves the source-authentication, +PartsII/III and broader recapture tasks open. No production code changed. diff --git a/docs/mef/ty2025/domains/taxes/credit-recapture/form8611/ty2025-form8611-pdf-gap.md b/docs/mef/ty2025/domains/taxes/credit-recapture/form8611/ty2025-form8611-pdf-gap.md index a1b4b4760..885bf3dc8 100644 --- a/docs/mef/ty2025/domains/taxes/credit-recapture/form8611/ty2025-form8611-pdf-gap.md +++ b/docs/mef/ty2025/domains/taxes/credit-recapture/form8611/ty2025-form8611-pdf-gap.md @@ -51,3 +51,14 @@ unnecessary; classify the recapture event and IRS exceptions separately. ## October6 issued section42(j)(5) K1 recipient proof The [issued-K1 review](./ty2025-form8611-issued-k1-review.md) supersedes the unrun statement for this specific issuer path. Actual issuer/recipient/building allocations now derive line8 and strict native/PDF source replay. Two complete packets/all12 pages,22 mutations,109 related checks and current held localXSD/source/catalog/template replay pass. The other historical, own-credit, unused-credit, bond and non-section42j5 variants remain open; no accepted prior filing or external authentication is inferred. + +## October 10 component replay + +The current input, native and PDF modules pass12 tests (6/3/3) as part of the +32-test Forms3115/4255/8611 batch. This supersedes the historical unrun wording +for these bounded source/projection checks. Native multi-building serialization, +Schedule2 reconciliation, duplicate-BIN rejection and PDF projections remain +covered; no new issued-K1 packet replay, XSD or visual count is claimed. +The earlier issued-K1 packets retain the later recorded joint-name qualification +in future_todo24. Wider source authenticity and filing branches remain open. +Evidence: `.state/research/method-recapture-routes-2026-10-10/components.log`. diff --git a/forms/f1040/2025/domains/credits/business/form6478/form6478_public.test.ts b/forms/f1040/2025/domains/credits/business/form6478/form6478_public.test.ts new file mode 100644 index 000000000..cf124dfe7 --- /dev/null +++ b/forms/f1040/2025/domains/credits/business/form6478/form6478_public.test.ts @@ -0,0 +1,38 @@ +import { assertEquals, assertStringIncludes } from "@std/assert"; +import { f1040_2025 } from "../../../../index.ts"; +import { pdfReviewFixtures } from "../../../../pdf/review-fixtures.ts"; +import { BiofuelType } from "../../../../../nodes/inputs/credits/business/f6478/index.ts"; + +const base = pdfReviewFixtures.find((f) => f.id === "single-w2-refund")!; +Deno.test("Form6478 public empty sources preserve the complete baseline1040", () => { + const baseline = f1040_2025.executeReturn(base.inputs); + assertEquals(baseline.diagnostics, []); + for (const f6478 of [{}, { fuel_entries: [] }]) { + const r = f1040_2025.executeReturn({ ...base.inputs, f6478 }); + assertEquals(r.diagnostics, []); + assertEquals(r.pending.f1040, baseline.pending.f1040); + } +}); +Deno.test("Form6478 public legacy gallons produce an explicit ineligible diagnostic", () => { + for (const fuel_type of Object.values(BiofuelType)) { + for (const gallons of [0, 1000]) { + const r = f1040_2025.executeReturn({ + ...base.inputs, + f6478: { fuel_entries: [{ fuel_type, gallons }] }, + }); + assertStringIncludes( + JSON.stringify(r.diagnostics), + "TY2025 Form 6478 production gallons are not eligible", + ); + assertEquals(r.pending.f1040?.line20_nonrefundable_credits ?? 0, 0); + } + } +}); +Deno.test("Form6478 public unmodeled pass-through allocation is rejected", () => { + const r = f1040_2025.executeReturn({ + ...base.inputs, + f6478: { line3_pass_through_credit: 2000 }, + }); + assertStringIncludes(JSON.stringify(r.diagnostics), "Unrecognized key"); + assertEquals(r.pending.f1040?.line20_nonrefundable_credits ?? 0, 0); +}); diff --git a/forms/f1040/2025/domains/credits/business/form8874/form8874_public.test.ts b/forms/f1040/2025/domains/credits/business/form8874/form8874_public.test.ts new file mode 100644 index 000000000..40bfa5d23 --- /dev/null +++ b/forms/f1040/2025/domains/credits/business/form8874/form8874_public.test.ts @@ -0,0 +1,127 @@ +import { assertEquals, assertRejects, assertStringIncludes } from "@std/assert"; +import { PDFDocument } from "pdf-lib"; +import { f1040_2025 } from "../../../../index.ts"; +import { buildPdfBytes } from "../../../../pdf/builder.ts"; +import { pdfReviewFixtures } from "../../../../pdf/review-fixtures.ts"; +import { withReviewedForm8874RecaptureEvidence } from "../../../../../nodes/inputs/credits/business/f8874/recapture_fixture.ts"; + +const schema = + ".state/research/docs/IMF_Series_2025v5.4/1040x_Schema_2025v5.4/2025v5.4/IndividualIncomeTax/Ind1040/Return1040.xsd"; +async function validate(xml: string) { + const p = new Deno.Command("xmllint", { + args: ["--noout", "--schema", schema, "-"], + stdin: "piped", + stderr: "piped", + stdout: "piped", + }).spawn(); + const w = p.stdin.getWriter(); + await w.write(new TextEncoder().encode(xml)); + await w.close(); + const r = await p.output(); + assertEquals(r.code, 0, new TextDecoder().decode(r.stderr)); +} +for ( + const c of [ + { id: "single-two-new-markets-investments", credit: 1100 }, + { id: "single-seven-new-markets-investments", credit: 3500 }, + ] +) { + Deno.test(`Form8874 public investment inventory retains source-authentication export block: ${c.id}`, async () => { + const fixture = pdfReviewFixtures.find((f) => f.id === c.id)!; + const r = f1040_2025.executeReturn(fixture.inputs); + assertEquals(r.diagnostics, []); + assertEquals(r.pending.schedule3.line6a_total, c.credit); + assertEquals(r.pending.f1040.line20_nonrefundable_credits, c.credit); + assertEquals(r.pending.f1040.line24_total_tax, 25067 - c.credit); + // Older rendered packets predate the current authenticated-status gate. + const reason = + "Form 8874 direct QEI needs authenticated CDE status and recapture history"; + await assertRejects( + () => f1040_2025.prepareReturn(r.pending, fixture.filer), + Error, + reason, + ); + await assertRejects( + () => buildPdfBytes(r.pending, fixture.filer), + Error, + reason, + ); + }); +} +const base = pdfReviewFixtures.find((f) => f.id === "single-w2-refund")!; +function recapture(id: number) { + return withReviewedForm8874RecaptureEvidence({ + notice_reference: `Synthetic CDE 2025 Form8874-B ${id}`, + investment_reference: `Synthetic 2022 QEI ${id}`, + cde_name: `Community Development Entity ${id}`, + cde_ein: id === 1 ? "123456789" : "234567890", + notice_taxpayer_tin: "111223333", + initial_investment_date: "2022-05-01", + qualified_equity_investment_amount: 100000, + notice_credit_amount: 25000, + recapture_event_date: "2025-06-01", + recapture_event: "cde_redeemed_investment" as const, + prior_years: [{ + tax_year: 2024, + original_return_due_date: "2025-04-15", + section38_credit_allowed_as_filed: 9000, + section38_credit_allowed_without_this_qei: 7000, + recomputation_reference: `Synthetic2024 recomputation ${id}`, + }], + carryover_ledger_reference: `Synthetic2024 QEI ledger ${id}`, + carryover_vintages: [{ + originating_tax_year: 2024, + credit_generated_as_filed: 5000, + credit_carried_to_2025_before_recapture: 3000, + source_document_reference: `Synthetic2024 carryover ${id}`, + historical_uses: [{ + tax_year: 2024, + credit_allowed: 2000, + return_reference: `Synthetic2024 Form3800 ${id}`, + }], + }], + }, "Alex Example"); +} +for (const count of [1, 2]) { + Deno.test(`Form8874 public reported recapture through final tax and exports: ${count} investments`, async () => { + const r = f1040_2025.executeReturn({ + ...base.inputs, + f8874_recapture: { + recaptures: Array.from({ length: count }, (_, i) => recapture(i + 1)), + }, + }); + assertEquals(r.diagnostics, []); + // Per source: 2000 previously used credit +144 independently compounded interest. + const tax = 2144 * count; + assertEquals(r.pending.schedule2.line17a_new_markets_credit_recapture, tax); + assertEquals(r.pending.f1040.line23_other_taxes, tax); + assertEquals(r.pending.f1040.line24_total_tax, 7955 + tax); + const prepared = await f1040_2025.prepareReturn(r.pending, base.filer); + assertStringIncludes(prepared.bundle.xml, "NMCR"); + await validate(prepared.bundle.xml); + const pdf = await prepared.renderPdf(); + console.log({ + recaptures: count, + pages: (await PDFDocument.load(pdf)).getPageCount(), + tax: 7955 + tax, + }); + for ( + const changed of [ + { + ...r.pending, + schedule2: { + ...r.pending.schedule2, + line17a_new_markets_credit_recapture: tax + 1, + }, + }, + { + ...r.pending, + f1040: { ...r.pending.f1040, taxpayer_ssn: "222334444" }, + }, + ] + ) { + await assertRejects(() => f1040_2025.prepareReturn(changed, base.filer)); + await assertRejects(() => buildPdfBytes(changed, base.filer)); + } + }); +} diff --git a/forms/f1040/2025/domains/credits/individual/form8839/form8839_two_pass.ts b/forms/f1040/2025/domains/credits/individual/form8839/form8839_two_pass.ts index dcc4705f9..e19060bb5 100644 --- a/forms/f1040/2025/domains/credits/individual/form8839/form8839_two_pass.ts +++ b/forms/f1040/2025/domains/credits/individual/form8839/form8839_two_pass.ts @@ -80,7 +80,16 @@ export function executeForm8839TwoPass( ); } const unused = settled.credit.line14 - settled.credit.line18; - if (!counterfactual && unused > 0 && inputs.f8621 !== undefined) { + // Election B replays this actual ledger with the complete source return; + // its hypothetical run below never creates a carryforward. + const qefRefigure = Array.isArray(inputs.f8621) && + inputs.f8621.some((item) => + item !== null && typeof item === "object" && + "qef_1294_election" in item && item.qef_1294_election !== undefined + ); + if ( + !counterfactual && unused > 0 && inputs.f8621 !== undefined && !qefRefigure + ) { throw new Error( "Form 8839 with Form 8621 carryforward filing is not supported", ); diff --git a/forms/f1040/2025/domains/general/return-assembly/method-recapture.test.ts b/forms/f1040/2025/domains/general/return-assembly/method-recapture.test.ts new file mode 100644 index 000000000..fb4208269 --- /dev/null +++ b/forms/f1040/2025/domains/general/return-assembly/method-recapture.test.ts @@ -0,0 +1,142 @@ +import { assertEquals, assertRejects, assertThrows } from "@std/assert"; +import { f1040_2025 } from "../../../index.ts"; +import { buildMefXml } from "../../../mef/builder.ts"; +import { buildPending } from "../../../mef/execution/pending.ts"; +import { buildPdfBytes } from "../../../pdf/builder.ts"; +import { pdfReviewFixtures } from "../../../pdf/review-fixtures.ts"; +import { form4255Row } from "../../taxes/credit-recapture/form4255/form4255.fixture.ts"; + +const base = pdfReviewFixtures.find((f) => f.id === "single-w2-refund")!; +for ( + const c of [ + { id: "first-positive", amount: 12000, year: 2025, expected: 3000 }, + { id: "last-remainder", amount: 10001, year: 2022, expected: 2501 }, + { id: "expired-positive", amount: 12000, year: 2021, expected: 0 }, + { id: "current-negative", amount: -6000, year: 2025, expected: -6000 }, + { id: "prior-negative", amount: -6000, year: 2024, expected: 0 }, + { + id: "one-year-election", + amount: 49999, + year: 2025, + expected: 49999, + election: true, + }, + ] +) { + Deno.test(`Form3115 public business adjustment and export boundary: ${c.id}`, async () => { + const r = f1040_2025.executeReturn({ + ...base.inputs, + schedule_c: [{ + business_reference: "DESIGN", + line_a_principal_business: "DESIGNER", + line_b_business_code: "541310", + line_f_accounting_method: "cash", + line_g_material_participation: true, + line_i_made_1099_payments: false, + line_1_gross_receipts: 20000, + }], + f3115: [{ + business_reference: "DESIGN", + designated_change_number: "222", + filing_type: "automatic", + reporting_schedule: "schedule_c", + year_of_change: c.year, + section_481_adjustment: c.amount, + ...(c.election ? { one_year_positive_election_verified: true } : {}), + }], + }); + assertEquals(r.diagnostics, []); + const p = buildPending(r.pending); + assertEquals(p.schedule1?.line3_schedule_c, 20000 + c.expected); + assertEquals(p.f1040?.line9_total_income, 95000 + c.expected); + assertThrows( + () => buildMefXml(p, base.filer), + Error, + "Form 3115 accounting-method change requires a native attachment", + ); + await assertRejects( + () => buildPdfBytes(p, base.filer), + Error, + "Form 3115 accounting-method change requires a native attachment", + ); + }); +} +for ( + const c of [ + { id: "ep-only-2a", creditLine: "2a", recapture: false, reasonable: false }, + { + id: "recapture-2a", + creditLine: "2a", + recapture: true, + reasonable: false, + }, + { + id: "recapture-1d", + creditLine: "1d", + recapture: true, + reasonable: false, + }, + { + id: "reasonable-cause", + creditLine: "1d", + recapture: false, + reasonable: true, + }, + ] +) { + Deno.test(`Form4255 public tax routing and export boundary: ${c.id}`, async () => { + const row = { + ...form4255Row, + credit_line: c.creditLine, + prior_credit_evidence: { + ...form4255Row.prior_credit_evidence, + original_form: c.creditLine === "1d" ? "3468_part_iv" : "8933", + }, + excessive_payment_notice: { + ...form4255Row.excessive_payment_notice, + reasonable_cause_accepted: c.reasonable, + }, + excessive_payment_20_percent: c.reasonable ? 0 : 60, + ...(!c.recapture + ? { + recaptured_total: 0, + recaptured_carryover: 0, + recaptured_net_epe: 0, + } + : {}), + }; + const r = f1040_2025.executeReturn({ + ...base.inputs, + f4255: { rows: [row] }, + }); + assertEquals(r.diagnostics, []); + const p = buildPending(r.pending); + assertEquals(p.schedule2?.line1e_form4255_excessive_payment, 300); + assertEquals( + p.schedule2?.line1f_form4255_20_percent_ep ?? 0, + c.reasonable ? 0 : 60, + ); + assertEquals( + p.schedule2?.line1d_form4255_net_epe ?? 0, + c.recapture && c.creditLine === "2a" ? 1500 : 0, + ); + assertEquals( + p.schedule2?.line19_form4255_net_epe ?? 0, + c.recapture && c.creditLine === "1d" ? 1500 : 0, + ); + assertEquals( + p.f1040?.line24_total_tax, + 7955 + 300 + (c.reasonable ? 0 : 60) + (c.recapture ? 1500 : 0), + ); + assertThrows( + () => buildMefXml(p, base.filer), + Error, + "authenticated prior-credit and IRS determination source bytes", + ); + await assertRejects( + () => buildPdfBytes(p, base.filer), + Error, + "Form 4255 PDF needs authenticated prior-return and IRS determination bytes", + ); + }); +} diff --git a/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_8863_refigure.test.ts b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_8863_refigure.test.ts index e55b674f5..17d90db9a 100644 --- a/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_8863_refigure.test.ts +++ b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_8863_refigure.test.ts @@ -165,11 +165,11 @@ Deno.test("QEF education source and stale worksheet conflicts are rejected", () const adoption = pdfReviewFixtures.find((row) => row.id === "single-reviewed-adoption-credit" )!; - const combined = { ...source(), form8839: adoption.inputs.form8839 }; + const combined = { ...stale, form8839: adoption.inputs.form8839 }; assertThrows( () => f1040_2025.executeReturn(combined), Error, - "combined counterfactual", + "filed MAGI", ); }); diff --git a/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_carryforward.test.ts b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_carryforward.test.ts new file mode 100644 index 000000000..bff8efbdf --- /dev/null +++ b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_carryforward.test.ts @@ -0,0 +1,153 @@ +import { assertEquals, assertMatch, assertRejects } from "@std/assert"; +import { f1040_2025 } from "../../../../index.ts"; +import { buildPending } from "../../../../mef/execution/pending.ts"; +import { extractFilerIdentity } from "../../../../../mef/filer.ts"; +import { buildPdfBytes } from "../../../../pdf/builder.ts"; +import { pdfReviewFixtures } from "../../../../pdf/review-fixtures.ts"; +import { executePreQefSourceReturn } from "../../../../return-processing/staged_source_return.ts"; +import education from "../../../../pdf/reviews/general/composed-returns/review-8863-scholarship-source.json" with { + type: "json", +}; +import { form8621QefSourceInputs } from "./form8621_qef.fixture.ts"; + +const adoption = pdfReviewFixtures.find((f) => + f.id === "single-reviewed-adoption-credit" +)!; +for ( + const row of [ + { + id: "adoption", + wages: 50000, + agi: 52000, + tax: 4115, + credit: 4115, + carry: 1885, + shadowCredit: 3875, + refund: 20000, + }, + { + id: "education-adoption", + wages: 64500, + agi: 72500, + tax: 7405, + credit: 5905, + carry: 95, + shadowCredit: 5465, + refund: 17000, + }, + ] +) { + Deno.test(`Election B retains only actual adoption carryforward: ${row.id}`, async () => { + const base = structuredClone( + row.id === "adoption" ? adoption.inputs : education.inputs, + ) as Record; + base.form8839 = structuredClone(adoption.inputs.form8839); + const wage = (base.w2 as Record[])[0]; + Object.assign(wage, { + box1_wages: row.wages, + box3_ss_wages: row.wages, + box4_ss_withheld: row.wages * 0.062, + box5_medicare_wages: row.wages, + box6_medicare_withheld: row.wages * 0.0145, + }); + if (row.id !== "adoption") { + (base.f8863 as Record[])[0].filer_magi = row.agi; + (base.f8863_credit_limit_worksheet as { + credit_limit_worksheet: Record; + }).credit_limit_worksheet.form1040_line18_tax = row.tax; + } + const input = form8621QefSourceInputs(base); + const result = f1040_2025.executeReturn(input); + assertEquals(result.diagnostics, []); + assertEquals(result.carryforwards.adoption_credit_2025, row.carry); + const pending = buildPending(result.pending); + const filed = pending.f1040!; + assertEquals(filed.line11_agi, row.agi); + assertEquals(filed.line18_total_tax_before_credits, row.tax); + assertEquals(pending.schedule3?.line6c_adoption_credit, row.credit); + assertEquals(filed.form8621_1294_deferred_tax, 0); + assertEquals(filed.line24_total_tax, 0); + assertEquals(filed.line30_refundable_adoption, 5000); + assertEquals(filed.line35a_refund, row.refund); + const ledger = result.pending.form8839_carryforward; + assertEquals(ledger, { + version: 1, + status: "computed_unfiled", + origin_tax_year: 2025, + first_carry_year: 2026, + last_carry_year: 2030, + taxpayer_ssn: "111223333", + child_ssn: "111223334", + decree_document_id: "decree-1", + expense_document_ids: ["invoice-1"], + nonrefundable_credit: 6000, + used_in_origin_year: row.credit, + carryforward_amount: row.carry, + }); + const withoutInput = structuredClone(input) as Record; + const holding = (withoutInput.f8621 as Record[])[0]; + holding.qef_ordinary_income = 0; + delete holding.qef_1294_election; + const without = executePreQefSourceReturn(withoutInput, true); + const shadow = buildPending(without.pending); + assertEquals(shadow.schedule3?.line6c_adoption_credit, row.shadowCredit); + assertEquals(without.pending.form8839_carryforward, undefined); + assertEquals(without.carryforwards.adoption_credit_2025, undefined); + const filer = extractFilerIdentity(filed)!; + const packet = await f1040_2025.prepareReturn( + pending, + filer, + adoption.attachments!, + ); + const pdf = await buildPdfBytes( + pending, + filer, + ".pdf-cache", + packet.bundle, + ); + // Newly observed persistence boundary is deferred, not repaired here. + const persisted = buildPending(JSON.parse(JSON.stringify(result.pending))); + await assertRejects( + () => f1040_2025.prepareReturn(persisted, filer, adoption.attachments!), + Error, + "differs from full source", + ); + await assertRejects( + () => buildPdfBytes(persisted, filer, ".pdf-cache"), + Error, + "differs from full source", + ); + const out = Deno.env.get("FORM8621_CARRY_EVIDENCE_DIR"); + if (out) { + const dir = `${out}/${row.id}`; + await Deno.mkdir(dir, { recursive: true }); + await Deno.writeTextFile( + `${dir}/source-pending.json`, + JSON.stringify({ input, pending, shadow }, null, 2), + ); + await Deno.writeTextFile(`${dir}/return.xml`, packet.bundle.xml); + await Deno.writeFile(`${dir}/return.pdf`, pdf); + } + for ( + const changed of [ + undefined, + { ...ledger, carryforward_amount: 6000 - row.shadowCredit }, + { ...ledger, used_in_origin_year: row.shadowCredit }, + { ...ledger, taxpayer_ssn: "999999999" }, + { ...ledger, status: "accepted" }, + ] + ) { + const altered = { ...pending, form8839_carryforward: changed }; + const nativeError = await assertRejects( + () => f1040_2025.prepareReturn(altered, filer, adoption.attachments!), + Error, + ); + const pdfError = await assertRejects( + () => buildPdfBytes(altered, filer, ".pdf-cache"), + Error, + ); + assertMatch(nativeError.message, /carryforward|full source/i); + assertMatch(pdfError.message, /carryforward|full source/i); + } + }); +} diff --git a/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_combined_credits.test.ts b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_combined_credits.test.ts new file mode 100644 index 000000000..4ce8ac72b --- /dev/null +++ b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_combined_credits.test.ts @@ -0,0 +1,160 @@ +import { assertEquals, assertRejects, assertThrows } from "@std/assert"; +import { executePreQefSourceReturn } from "../../../../return-processing/staged_source_return.ts"; +import { f1040_2025 } from "../../../../index.ts"; +import { buildPending } from "../../../../mef/execution/pending.ts"; +import { extractFilerIdentity } from "../../../../../mef/filer.ts"; +import { buildPdfBytes } from "../../../../pdf/builder.ts"; +import { pdfReviewFixtures } from "../../../../pdf/review-fixtures.ts"; +import education from "../../../../pdf/reviews/general/composed-returns/review-8863-scholarship-source.json" with { + type: "json", +}; +import { form8621QefSourceInputs } from "./form8621_qef.fixture.ts"; + +const adoption = pdfReviewFixtures.find((f) => + f.id === "single-reviewed-adoption-credit" +)!; + +function source(wages: number, magi: number, tax: number) { + const input = structuredClone(education.inputs); + input.w2[0].box1_wages = wages; + input.w2[0].box3_ss_wages = wages; + input.w2[0].box4_ss_withheld = wages * 0.062; + input.w2[0].box5_medicare_wages = wages; + input.w2[0].box6_medicare_withheld = wages * 0.0145; + input.f8863[0].filer_magi = magi; + input.f8863_credit_limit_worksheet.credit_limit_worksheet + .form1040_line18_tax = tax; + return form8621QefSourceInputs({ + ...input, + form8839: structuredClone(adoption.inputs.form8839), + }); +} + +for ( + const testCase of [ + { + id: "phaseout", + wages: 75000, + magi: 83000, + tax: 9715, + education: 1050, + refundable: 700, + before: 2665, + without: 1925, + deferred: 740, + }, + { + id: "shadow-limit", + wages: 66000, + magi: 74000, + tax: 7735, + education: 1500, + refundable: 1000, + before: 235, + without: 0, + deferred: 235, + }, + ] +) { + Deno.test(`QEF refigure settles education before adoption: ${testCase.id}`, async () => { + const input = source(testCase.wages, testCase.magi, testCase.tax); + const result = f1040_2025.executeReturn(input); + assertEquals(result.diagnostics, []); + const pending = buildPending(result.pending); + const filed = pending.f1040!; + assertEquals(filed.line11_agi, testCase.magi); + assertEquals(filed.line18_total_tax_before_credits, testCase.tax); + assertEquals(pending.schedule3?.line3_education_credit, testCase.education); + assertEquals(pending.schedule3?.line6c_adoption_credit, 6000); + assertEquals(filed.line29_refundable_aoc, testCase.refundable); + assertEquals(filed.line30_refundable_adoption, 5000); + assertEquals( + filed.form8621_1294_total_tax_before_deferral, + testCase.before, + ); + assertEquals( + filed.form8621_1294_counterfactual_total_tax, + testCase.without, + ); + assertEquals(filed.form8621_1294_deferred_tax, testCase.deferred); + assertEquals(filed.line24_total_tax, testCase.without); + assertEquals( + filed.line35a_refund, + 11000 + 5000 + testCase.refundable - testCase.without, + ); + const withoutInput = structuredClone(input) as Record; + const withoutHolding = (withoutInput.f8621 as Record[])[0]; + withoutHolding.qef_ordinary_income = 0; + delete withoutHolding.qef_1294_election; + const shadow = buildPending( + executePreQefSourceReturn(withoutInput, true).pending, + ); + assertEquals(shadow.f1040?.line11_agi, testCase.magi - 2000); + assertEquals( + shadow.f1040?.line18_total_tax_before_credits, + testCase.tax - 440, + ); + assertEquals( + shadow.schedule3?.line3_education_credit, + testCase.id === "phaseout" ? 1350 : 1500, + ); + assertEquals( + shadow.schedule3?.line6c_adoption_credit, + testCase.id === "phaseout" ? 6000 : 5795, + ); + assertEquals(shadow.f1040?.line24_total_tax, testCase.without); + assertEquals( + shadow.f1040?.line29_refundable_aoc, + testCase.id === "phaseout" ? 900 : 1000, + ); + const filer = extractFilerIdentity(filed)!; + const packet = await f1040_2025.prepareReturn( + pending, + filer, + adoption.attachments!, + ); + const pdf = await buildPdfBytes( + pending, + filer, + ".pdf-cache", + packet.bundle, + ); + const out = Deno.env.get("FORM8621_COMBINED_EVIDENCE_DIR"); + if (out) { + const dir = `${out}/${testCase.id}`; + await Deno.mkdir(dir, { recursive: true }); + await Deno.writeTextFile( + `${dir}/source-pending.json`, + JSON.stringify({ input, pending }, null, 2), + ); + await Deno.writeTextFile(`${dir}/return.xml`, packet.bundle.xml); + await Deno.writeFile(`${dir}/return.pdf`, pdf); + } + for (const field of ["line3_education_credit", "line6c_adoption_credit"]) { + const changed = structuredClone(pending); + changed.schedule3![field] = Number(changed.schedule3![field]) + 1; + await assertRejects( + () => f1040_2025.prepareReturn(changed, filer, adoption.attachments!), + Error, + "differs from full source", + ); + await assertRejects( + () => buildPdfBytes(changed, filer, ".pdf-cache"), + Error, + "differs from full source", + ); + } + const stale = source(testCase.wages, testCase.magi - 2000, testCase.tax); + assertThrows(() => f1040_2025.executeReturn(stale), Error, "filed MAGI"); + }); +} + +Deno.test("QEF without Election B retains the unverified carryforward combination guard", () => { + const input = source(64500, 72500, 7405); + delete (input.f8621[0] as Record).qef_1294_election; + assertThrows( + () => f1040_2025.executeReturn(input), + Error, + "Form 8839 with Form 8621 carryforward filing is not supported", + ); +}); diff --git a/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure.ts b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure.ts index 15d0c39b8..9bc631c3a 100644 --- a/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure.ts +++ b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure.ts @@ -28,11 +28,6 @@ export function applyForm8621QefRefigure( ): ExecuteResult { const elected = deferredHoldings(inputs); if (elected.length === 0) return full; - if (inputs.form8839 !== undefined && inputs.f8863 !== undefined) { - throw new Error( - "Form 8621 Election B needs a combined education and adoption counterfactual", - ); - } if (inputs.form8990 !== undefined) { throw new Error( "Form 8621 Election B needs a settled full-return counterfactual before Form 8990", diff --git a/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure_proof.md b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure_proof.md index 37188ada2..ca420051c 100644 --- a/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure_proof.md +++ b/forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure_proof.md @@ -316,3 +316,118 @@ Changing Schedule 3 line 6a by one dollar makes both native and PDF export reject the packet on independent full source replay. The eight focused education/business packet and conflict cases passed 8/0 in `/tmp/opentax-form8621-qef-business-final-oct6.log`. + +## October 10 combined education and adoption credit checkpoint + +The public Election B route now settles education first and adoption second in +both the actual and without-QEF graphs. Previously, the combination was rejected +before either graph could be reconciled. The existing runners still validate +actual education MAGI and the credit-limit worksheet, retained adoption sources +and required attachments; only the hypothetical graph recalculates the source +worksheet operands. Both exporters replay the complete retained sources. + +The [2025 Form 8839 line 17 worksheet](https://www.irs.gov/instructions/i8839) +subtracts Schedule 3 education credit before limiting adoption credit. The +[Form 8863 credit-limit worksheet](https://www.irs.gov/instructions/i8863) does +not subtract adoption credit. [Form 8621 lines 9a–9c](https://www.irs.gov/instructions/i8621) +require the corresponding full-return tax difference. These support composing +the two existing stages in that order, rather than subtracting QEF income from +an already settled taxable-income figure. + +Both synthetic sources combine an existing $6,000 taxable-scholarship/AOTC +packet, $11,000 reviewed adoption expenses and $2,000 undistributed ordinary +QEF earnings. The $11,000 expenses split into $5,000 refundable and $6,000 +nonrefundable adoption credit. Issuer, school and decree evidence remains +synthetic contract evidence, not external authentication. + +| Case | Wages | Actual / without QEF AGI | Actual / without QEF tax before credits | Education nonrefundable actual / without | Adoption nonrefundable actual / without | QEF 9a / 9b / 9c | Filed refund | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| AOTC phaseout | 75,000 | 83,000 / 81,000 | 9,715 / 9,275 | 1,050 / 1,350 | 6,000 / 6,000 | 2,665 / 1,925 / 740 | 14,775 | +| Hypothetical adoption limit | 66,000 | 74,000 / 72,000 | 7,735 / 7,295 | 1,500 / 1,500 | 6,000 / 5,795 | 235 / 0 / 235 | 17,000 | + +The single-filer tax values independently agree with the [2025 Tax Table](https://www.irs.gov/pub/irs-pdf/i1040tt.pdf) +rows beginning 67,250, 65,250, 58,250 and 56,250 (PDF pages 8–10). +The first AOTC phaseout fractions are 0.7 and 0.9, yielding refundable amounts +700 and 900; the second case retains 1,000. Only actual refundable credits enter +the filed refund, with 11,000 withholding and 5,000 refundable adoption credit. +The hypothetical unused adoption amount does not create a filed carryforward. + +Two new actual 11-page packets pass full local TY2025v5.4 Return1040 XSD. +All 22 pages were rendered and reviewed: Form1040 (2), Schedule1 and statement +(3), Schedule3 (1), Form8621 (2), Form8839 (1), Form8863 (2) per packet. +Amounts, identities, elections and ordering reconcile. The hypothetical-limit +packet leaves calculated/native-zero Form1040 line24 blank, repeating deferred76; +this qualification is preserved without repair. The flattened PDFs have no +remaining AcroForm fields or widgets. Required reviewed adoption attachments +are supplied to native preparation; these 22 pages count the generated tax +packet, not a new review of the synthetic evidence attachments. + +The grouped QEF/adoption/return-arithmetic gate passes 52/0. After adding the +actual-carryforward boundary assertion, the final focused gate passes 3/0, including assertions on both counterfactual +credit amounts and refund arithmetic, eight native/PDF altered-credit rejections, +two stale-MAGI public rejections and one actual-carryforward rejection. The +ordinary actual-return Form8839/Form8621 carryforward guard remains intact. +The existing stale-education test now checks the combined route's source guard +instead of expecting the removed blanket rejection. + +Private source/pending/XML/PDF snapshots, logs, XSD results and visual hashes: +`.state/research/form8621-combined-2026-10-10/`. No IRS transmission, business-rule +acceptance or externally authenticated source is claimed. Form8990 composition, +nonadditive multi-QEF allocation and other original parent boundaries remain +open; PartII D–H and other deferred scope remain untouched. + +## October 10 current-year adoption carryforward with Election B + +The existing current-year adoption ledger now composes with the source-replayed +Election B route. The actual return retains its unused nonrefundable credit; +the hypothetical without-QEF return neither emits a carryforward record nor +changes the actual one. Form8621 without Election B remains under its prior +combination guard. This supersedes the actual-carryforward rejection in the +preceding combined-credit checkpoint only for the Election B route. + +| Synthetic case | AGI | Tax before credits | Education credit | Adoption used | Actual unused | Hypothetical adoption used | Refund | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | +| Adoption + QEF | 52,000 | 4,115 | 0 | 4,115 | 1,885 | 3,875 | 20,000 | +| Education + adoption + QEF | 72,500 | 7,405 | 1,500 | 5,905 | 95 | 5,465 | 17,000 | + +Both returns contain 2,000 undistributed QEF ordinary earnings, 11,000 reviewed +adoption expenses and 5,000 refundable adoption credit. The second also has +6,000 taxable scholarship income and 1,000 refundable AOTC. Withholding is +15,000/11,000. Actual and hypothetical total tax are zero, so QEF lines9a–9c +are all zero; unused adoption credit is not a second tax deferral. +The [2025 single-filer Tax Table](https://www.irs.gov/pub/irs-pdf/i1040tt.pdf) +independently supplies 4,115 at taxable36,250 and 7,405 at56,750; the second +hypothetical tax is6,965 at54,750. Subtracting its1,500 education credit gives +5,465 adoption capacity, rather than the actual5,905. + +The existing ledger retains taxpayer/child SSNs, decree and expense references, +2025 origin, 2026–2030 carry years and status `computed_unfiled`. These are +current calculations, not accepted-filing evidence or a next-year import. +The [Form8839 carryforward instructions](https://www.irs.gov/instructions/i8839) +remain the source for unused nonrefundable credit; synthetic records do not +establish authentic decrees or expense payment. + +Both direct public-return exports pass full local TY2025v5.4 XSD. Their9/11-page +PDFs have no remaining AcroForm fields/widgets; all20 pages were rendered and +reviewed. Source, Form8839, Schedule3, QEF and refund totals agree. Both Form1040 +zero-tax fields are blank, repeating deferred76 without repair. Source evidence +attachments are supplied to preparation, but are not counted as newly reviewed +packet pages. + +The grouped QEF/adoption/return-arithmetic gate passes55 tests with zero failures +or ignored cases; the two focused tests also pass. Ten altered/missing carry ledgers reject at both +native and PDF boundaries (20 assertions): substituting the hypothetical +balance or use, changing the taxpayer, claiming accepted status, or removing +the record. Each hypothetical graph is separately checked for its smaller +used credit and absence of a carry record. + +A separate persistence probe serializes and reloads the pending graph, then +both exporters reject full source replay in both cases. The original failure +log and four explicit rejection assertions remain retained as new deferred150. +This is **direct in-memory export evidence**, not pending-JSON reload support; +no saved-return CLI behavior was tested or inferred. No normalization or replay +repair was made. The broad readiness and carryforward tasks stay open. + +Evidence: `.state/research/form8621-carry-2026-10-10/`, including synthetic source, +pending, hypothetical graph, XML, PDFs, original persistence failure, test logs, +XSD validation and visual hashes. diff --git a/forms/f1040/2025/index.ts b/forms/f1040/2025/index.ts index 8f2e536ed..b2f8d0d40 100644 --- a/forms/f1040/2025/index.ts +++ b/forms/f1040/2025/index.ts @@ -71,11 +71,6 @@ function executeReturn(inputs: Record): ExecuteResult { item !== null && typeof item === "object" && "qef_1294_election" in item && item.qef_1294_election !== undefined ); - if (elected && inputs.form8839 !== undefined && inputs.f8863 !== undefined) { - throw new Error( - "Form 8621 Election B with both adoption and education credits needs a settled combined counterfactual", - ); - } if ( inputs.form8990 !== undefined && elected ) { diff --git a/forms/f1040/2025/pdf/reviews/credits/business/form8864-direct-producer-route.test.ts b/forms/f1040/2025/pdf/reviews/credits/business/form8864-direct-producer-route.test.ts index a4c8c463a..910a869ed 100644 --- a/forms/f1040/2025/pdf/reviews/credits/business/form8864-direct-producer-route.test.ts +++ b/forms/f1040/2025/pdf/reviews/credits/business/form8864-direct-producer-route.test.ts @@ -6,10 +6,11 @@ import { } from "@std/assert"; import { buildPending } from "../../../../mef/execution/pending.ts"; import { PDFDocument } from "pdf-lib"; +import { buildPdfBytes } from "../../../builder.ts"; import { f1040_2025 } from "../../../../index.ts"; import { directAgriBiodieselPending, - directAgriBiodieselSource, + type directAgriBiodieselSource, } from "../../../../../nodes/inputs/credits/business/f8864/fixture.ts"; import { pdfReviewFixtures } from "../../../review-fixtures.ts"; import { form8864Pdf } from "../../../forms/credits/business/f8864.ts"; @@ -83,6 +84,44 @@ Deno.test("direct Form 8864 producer source reaches full return, AMT, native and for ( const changed of [ + { + ...result.pending, + f8864: { + ...source, + lots: source.lots.map((lot, index) => + index === 0 + ? { + ...lot, // Five gallons change the rounded credit by one dollar. + gallons_sold: lot.gallons_sold + 5, + } + : lot + ), + }, + }, + { + ...result.pending, + f8864: { ...source, producer_ein: "111111111" }, + }, + { + ...result.pending, + f3800: { + ...result.pending.f3800, + f8864_direct_producer_credit: { + ...(result.pending.f3800.f8864_direct_producer_credit as Record< + string, + unknown + >), + credit_amount: 500.01, + }, + }, + }, + { + ...result.pending, + form6251: { + ...result.pending.form6251, + line3_form8864_income_exclusion: -500.01, + }, + }, { ...result.pending, f3800: { ...result.pending.f3800, form8864_applied_credit: 499 }, @@ -107,5 +146,6 @@ Deno.test("direct Form 8864 producer source reaches full return, AMT, native and ] ) { await assertRejects(() => f1040_2025.prepareReturn(changed, base.filer)); + await assertRejects(() => buildPdfBytes(changed, base.filer)); } }); diff --git a/forms/f1040/2025/return-processing/staged_source_return.ts b/forms/f1040/2025/return-processing/staged_source_return.ts index dd058fc77..f3f9b687e 100644 --- a/forms/f1040/2025/return-processing/staged_source_return.ts +++ b/forms/f1040/2025/return-processing/staged_source_return.ts @@ -11,18 +11,20 @@ export function executePreQefSourceReturn( ): ExecuteResult { const scheduleJGraph = (source: Record) => executeScheduleJSourceReturn(source, executeGraph); - if (inputs.form8839 !== undefined) { - return executeForm8839TwoPass( - inputs, - counterfactual, - scheduleJGraph, - ); - } const elected = Array.isArray(inputs.f8621) && inputs.f8621.some((item) => item !== null && typeof item === "object" && "qef_1294_election" in item && item.qef_1294_election !== undefined ); + if (inputs.form8839 !== undefined) { + // Education precedes adoption in the Form 8839 credit-limit worksheet. + // The adoption runner removes its source before invoking this graph. + const preAdoptionGraph = (source: Record) => + source.f8863 !== undefined && (elected || counterfactual) + ? executeForm8863TwoPass(source, counterfactual, scheduleJGraph) + : scheduleJGraph(source); + return executeForm8839TwoPass(inputs, counterfactual, preAdoptionGraph); + } if ( inputs.f8863 !== undefined && (elected || inputs.schedule_j !== undefined || counterfactual) diff --git a/forms/f1040/e2e/ats/ty2025-check-ledger.ts b/forms/f1040/e2e/ats/ty2025-check-ledger.ts new file mode 100644 index 000000000..8a817f332 --- /dev/null +++ b/forms/f1040/e2e/ats/ty2025-check-ledger.ts @@ -0,0 +1,128 @@ +import type { replayAtsChecks } from "./ty2025-check-replay.ts"; + +type Replay = Awaited>; +export interface LedgerRow { + id: string; + scenario: string; + kind: "calculation" | "document-copy" | "binary-attachment"; + result: string; + basis: string; + sourceUrl: string; + expected: unknown; + actual: unknown; +} + +/** Keep calculation comparisons, copy presence and unknown requirements separate. + * A row is a local observation, never an IRS business-rule/acceptance assertion. + */ +export function buildAtsCheckLedger(report: Replay) { + const rows: LedgerRow[] = []; + for (const s of report.scenarios) { + const common = { scenario: s.id, sourceUrl: s.sourceUrl }; + for (const c of s.checks) { + rows.push({ + ...common, + id: `${s.id}:calculation:${c.path}`, + kind: "calculation", + result: c.result, + basis: `${c.basis}: ${c.sourceLocation}`, + expected: c.expected, + actual: c.actual ?? null, + }); + } + for (const d of s.documentCoverage.rows) { + for (let copy = 1; copy <= d.requiredCopies; copy++) { + rows.push({ + ...common, + id: `${s.id}:document:${d.sourceForm}:${copy}`, + kind: "document-copy", + result: !d.nativeRoot + ? "unmapped" + : d.observedCopies === null + ? "not-evaluated" + : copy <= d.observedCopies + ? "present" + : "missing", + basis: + `Required source inventory: ${d.sourceForm}, copy ${copy}; presence only`, + expected: d.nativeRoot, + actual: d.observedCopies === null + ? null + : copy <= d.observedCopies + ? d.nativeRoot + : null, + }); + } + } + for (const a of s.attachmentCoverage.rows ?? []) { + rows.push({ + ...common, + id: `${s.id}:attachment:${a.description}`, + kind: "binary-attachment", + result: a.result, + basis: "Known required attachment; description/bytes only", + expected: a.description, + actual: a.observed, + }); + } + } + if (new Set(rows.map((r) => r.id)).size !== rows.length) { + throw new Error("Duplicate ATS ledger check identity"); + } + const checks = report.scenarios.flatMap((s) => s.checks); + const nonprovisional = checks.filter((c) => + c.basis !== "provisional-source-interpretation" + ); + const evaluated = nonprovisional.filter((c) => c.result !== "not-produced"); + const matches = evaluated.filter((c) => c.result === "match").length; + const byKind = Object.fromEntries( + (["calculation", "document-copy", "binary-attachment"] as const).map( + (kind) => { + const selected = rows.filter((r) => r.kind === kind); + return [kind, { + count: selected.length, + counts: Object.fromEntries( + [...new Set(selected.map((r) => r.result))].sort().map(( + result, + ) => [ + result, + selected.filter((r) => r.result === result).length, + ]), + ), + }]; + }, + ), + ); + return { + scope: + "Enumerated local observations only; not the full IRS ATS denominator. No combined pass percentage across unlike kinds.", + count: rows.length, + byKind, + calculationAnchor: { + scope: + "Nonprovisional selected calculation comparisons only; printed differences may be answer-key conflicts, not established software defects", + matching: matches, + evaluated: evaluated.length, + notProduced: nonprovisional.length - evaluated.length, + provisional: checks.length - nonprovisional.length, + percent: evaluated.length ? 100 * matches / evaluated.length : null, + }, + attachmentRequirementsNotInventoried: report.scenarios.filter((s) => + !s.attachmentCoverage.requirementsInventoried + ).map((s) => s.id), + unenumeratedScopes: [ + "Remaining printed and independently derived scenario expectations", + "Native/PDF values, ownership and presentation", + "Complete attachment requirements and contents", + "Applicable IRS business rules and submission-package checks", + ], + rows, + }; +} +if (import.meta.main) { + const { replayAtsChecks } = await import("./ty2025-check-replay.ts"); + const ledger = buildAtsCheckLedger(await replayAtsChecks()); + const json = JSON.stringify(ledger, null, 2) + "\n"; + if (Deno.args[0]) await Deno.writeTextFile(Deno.args[0], json); + else console.log(json); +} diff --git a/forms/f1040/e2e/ats/ty2025-check-replay.test.ts b/forms/f1040/e2e/ats/ty2025-check-replay.test.ts index 5ff6a6cb3..9a968c73b 100644 --- a/forms/f1040/e2e/ats/ty2025-check-replay.test.ts +++ b/forms/f1040/e2e/ats/ty2025-check-replay.test.ts @@ -1,3 +1,4 @@ +import { buildAtsCheckLedger } from "./ty2025-check-ledger.ts"; import { assertEquals } from "@std/assert"; import { ATS_REPLAY_TARGETS, @@ -41,7 +42,34 @@ Deno.test("ATS public-entry matrix retains missing prerequisites and printed con for (const s of report.scenarios) { assertEquals(new Set(s.checks.map((c) => c.path)).size, s.checks.length); } - assertEquals(report.denominator, 54); + assertEquals(report.denominator, 63); + const ledger = buildAtsCheckLedger(report); + assertEquals(ledger.count, 120); + assertEquals(ledger.byKind, { + calculation: { + count: 63, + counts: { different: 14, match: 45, "not-produced": 4 }, + }, + "document-copy": { + count: 56, + counts: { missing: 12, "not-evaluated": 34, present: 10 }, + }, + "binary-attachment": { count: 1, counts: { missing: 1 } }, + }); + assertEquals(ledger.calculationAnchor.matching, 40); + assertEquals(ledger.calculationAnchor.evaluated, 54); + assertEquals(ledger.calculationAnchor.notProduced, 4); + assertEquals(ledger.calculationAnchor.provisional, 5); + assertEquals(ledger.calculationAnchor.percent, 100 * 40 / 54); + assertEquals(ledger.attachmentRequirementsNotInventoried.length, 7); + // Distinct W2 copy identities survive; blocked copies are not labeled missing. + assertEquals( + ledger.rows.filter((r) => r.id.startsWith("1040-01:document:W-2:")).map(( + r, + ) => r.result), + ["not-evaluated", "not-evaluated"], + ); + const transfer = report.scenarios.find((s) => s.id === "1040-04")!; assertEquals(transfer.preparation.attachments, []); assertEquals(transfer.attachmentCoverage.knownRequiredCount, 1); @@ -94,13 +122,34 @@ Deno.test("ATS public-entry matrix retains missing prerequisites and printed con for (const id of ["1040-02", "1040-03"]) { const scenario = report.scenarios.find((s) => s.id === id)!; assertEquals(scenario.diagnostics, []); - assertEquals( - scenario.checks.every((c) => c.result === CheckResult.Match), - true, - ); + if (id === "1040-02") { + assertEquals( + scenario.checks.every((c) => c.result === CheckResult.Match), + true, + ); + } assertEquals(scenario.preparation.result, PreparationResult.NativeBlocked); } - assertEquals(report.counts, { match: 41, different: 12, "not-produced": 1 }); + assertEquals(report.counts, { match: 45, different: 14, "not-produced": 4 }); + const farm = report.scenarios.find((s) => s.id === "1040-03")!; + assertEquals( + farm.checks.filter((c) => c.result !== CheckResult.Match).map( + (c) => [c.path, c.expected, c.actual, c.result], + ), + [ + ["schedule1.line1_state_refund", 3110, null, CheckResult.NotProduced], + ["f1040.line8_additional_income", 17422, 14312, CheckResult.Different], + ["f1040.line9_total_income", 72235, 69125, CheckResult.Different], + ], + ); + assertEquals( + transfer.checks.filter((c) => c.result === CheckResult.NotProduced) + .map((c) => [c.path, c.expected]), + [ + ["f3800.f8835_credit_entries.0.credit_amount", 13200], + ["f3800.f8936_new_vehicle_credit.credit_amount", 130], + ], + ); const deduction = report.scenarios.find((s) => s.id === "1040-12")!.checks .find((c) => c.path === "f1040.line12a_standard_deduction")!; assertEquals([deduction.expected, deduction.actual, deduction.result], [ diff --git a/forms/f1040/e2e/ats/ty2025-check-replay.ts b/forms/f1040/e2e/ats/ty2025-check-replay.ts index 2c46e6efb..f25e483fd 100644 --- a/forms/f1040/e2e/ats/ty2025-check-replay.ts +++ b/forms/f1040/e2e/ats/ty2025-check-replay.ts @@ -110,6 +110,48 @@ export const ATS_REPLAY_TARGETS = z.array(scenarioSchema).parse([ TargetBasis.Derived, "Schedule F pp.13–14:8,111 less4,860", ), + target( + "schedule_d.print_line7_st_total", + 1988, + TargetBasis.Derived, + "Schedule D p.9:14,222 proceeds less12,234 basis", + ), + target( + "schedule_d.print_line15_lt_total", + 9725, + TargetBasis.Derived, + "Schedule D p.9:14,211 proceeds less4,486 basis", + ), + target( + "f1040.line7_capital_gain", + 11713, + TargetBasis.Derived, + "Schedule D p.9:1,988 short-term plus9,725 long-term", + ), + target( + "schedule1.line5_schedule_e", + 11061, + TargetBasis.Derived, + "Form4835 p.17:17,035 income less5,974 expenses", + ), + target( + "schedule1.line1_state_refund", + 3110, + TargetBasis.Printed, + "Cover sheet p.1 taxable state refund", + ), + target( + "f1040.line8_additional_income", + 17422, + TargetBasis.Derived, + "Cover/Sch F/Form4835:3,110 refund +3,251 farm +11,061 rental", + ), + target( + "f1040.line9_total_income", + 72235, + TargetBasis.Derived, + "43,100 taxable pension +11,713 capital gain +17,422 additional income", + ), target( "schedule2.line4_se_tax", 827, @@ -124,7 +166,25 @@ export const ATS_REPLAY_TARGETS = z.array(scenarioSchema).parse([ ), ], }, - { id: "1040-04", targets: wage(36014, 4581) }, + { + id: "1040-04", + targets: [ + ...wage(36014, 4581), + // One printed solar source; this checks its deposit, not allowed credit. + target( + "f3800.f8835_credit_entries.0.credit_amount", + 13200, + TargetBasis.Printed, + "Form3800 line1f; source eligibility and line placement unresolved", + ), + target( + "f3800.f8936_new_vehicle_credit.credit_amount", + 130, + TargetBasis.Printed, + "Form3800 line1y; Form8936 business computation blank", + ), + ], + }, { id: "1040-05", targets: [ diff --git a/forms/f1040/e2e/income/other/form982/form982_public_export.test.ts b/forms/f1040/e2e/income/other/form982/form982_public_export.test.ts new file mode 100644 index 000000000..7307762a0 --- /dev/null +++ b/forms/f1040/e2e/income/other/form982/form982_public_export.test.ts @@ -0,0 +1,277 @@ +import { + assertEquals, + assertRejects, + assertStringIncludes, + assertThrows, +} from "@std/assert"; +import { f1040_2025 } from "../../../../2025/index.ts"; +import { buildMefXml } from "../../../../2025/mef/builder.ts"; +import { buildPending } from "../../../../2025/mef/execution/pending.ts"; +import { buildPdfBytes } from "../../../../2025/pdf/builder.ts"; +import { pdfReviewFixtures } from "../../../../2025/pdf/review-fixtures.ts"; +import { form982Pdf } from "../../../../2025/pdf/forms/income/other/f982.ts"; +import { FilingStatus } from "../../../../mef/header.ts"; + +// Deferred finding 149: the two cap cases deliberately retain normative +// expectations and currently fail; do not bless the over-excluded output. +const cases = [ + { + id: "retained", + status: "single", + principal: 15000, + balance: 200000, + qualified: 200000, + basis: 200000, + excluded: 15000, + taxable: 0, + tax: 7955, + interest: 0, + treatment: "taxable", + }, + { + id: "mixed-loan-basis-limit", + status: "single", + principal: 100000, + balance: 200000, + qualified: 150000, + basis: 30000, + excluded: 50000, + taxable: 50000, + tax: 19067, + interest: 0, + treatment: "taxable", + }, + { + id: "separate-cap", + status: "mfs", + principal: 400000, + balance: 600000, + qualified: 600000, + basis: 100000, + excluded: 175000, + taxable: 225000, + tax: 69035, + interest: 0, + treatment: "taxable", + }, + { + id: "joint-cap", + status: "mfj", + principal: 800000, + balance: 1000000, + qualified: 1000000, + basis: 200000, + excluded: 550000, + taxable: 250000, + tax: 56134, + interest: 0, + treatment: "taxable", + }, + { + id: "zero-basis", + status: "single", + principal: 15000, + balance: 200000, + qualified: 200000, + basis: 0, + excluded: 15000, + taxable: 0, + tax: 7955, + interest: 0, + treatment: "taxable", + }, + { + id: "taxable-interest", + status: "single", + principal: 15000, + balance: 200000, + qualified: 200000, + basis: 200000, + excluded: 15000, + taxable: 2000, + tax: 8395, + interest: 2000, + treatment: "taxable", + }, + { + id: "deductible-interest", + status: "single", + principal: 15000, + balance: 200000, + qualified: 200000, + basis: 200000, + excluded: 15000, + taxable: 0, + tax: 7955, + interest: 2000, + treatment: "cash_basis_deductible_if_paid", + }, +] as const; +// Tax-table amounts below $100,000 taxable income use IRS Publication 1040. +// https://www.irs.gov/publications/p1040 +const schema = + ".state/research/docs/IMF_Series_2025v5.4/1040x_Schema_2025v5.4/2025v5.4/IndividualIncomeTax/Ind1040/Return1040.xsd"; +const base = pdfReviewFixtures.find((item) => item.id === "single-w2-refund")!; +const evidenceDir = Deno.args.find((arg) => arg.startsWith("--evidence-dir=")) + ?.slice("--evidence-dir=".length); +for (const c of cases) { + Deno.test(`Form982 public QPRI native and PDF: ${c.id}`, async () => { + const general = { + ...base.inputs.general as Record, + filing_status: c.status, + ...(c.status !== "single" + ? { + spouse_first_name: "Sam", + spouse_last_name: "Example", + spouse_ssn: "222334444", + spouse_dob: "1986-02-01", + } + : {}), + }; + const filer = { + ...base.filer, + filingStatus: c.status === "mfj" + ? FilingStatus.MarriedFilingJointly + : c.status === "mfs" + ? FilingStatus.MarriedFilingSeparately + : FilingStatus.Single, + ...(c.status !== "single" + ? { + spouse: { + ssn: "222334444", + firstName: "Sam", + lastName: "Example", + nameControl: "EXAM", + }, + } + : {}), + ...(c.status === "mfj" ? { nameLine1: "ALEX & SAM EXAMPLE" } : {}), + }; + const debt = { + creditor_name: "Synthetic mortgage lender", + box1_date: "2025-06-15", + box2_cod_amount: c.principal + c.interest, + box3_interest: c.interest, + box3_interest_treatment: c.treatment, + box3_interest_treatment_source: + "Synthetic interest classification review", + box5_personally_liable: true, + property_disposition_status: "retained", + routing: "excluded", + exclusion_type: "qpri", + qpri_mfs: c.status === "mfs", + qpri_actual_discharge_date: "2025-06-15", + qpri_discharged_principal_amount: c.principal, + qpri_total_loan_balance_before_discharge: c.balance, + qpri_qualified_loan_balance_before_discharge: c.qualified, + qpri_main_home_security_confirmed: true, + qpri_discharge_reason: "financial_condition", + qpri_discharge_reason_source: + "Synthetic lender workout and loan-use review", + principal_residence_retained: true, + principal_residence_basis: c.basis, + }; + const inputs = { general, w2: base.inputs.w2, f1099c: [debt] }; + const result = f1040_2025.executeReturn(inputs); + assertEquals(result.diagnostics, []); + const pending = buildPending(result.pending); + const projected = form982Pdf.projectFields!( + pending.form982!, + result.pending, + ); + const xml = buildMefXml(pending, filer); + const validator = new Deno.Command("xmllint", { + args: ["--noout", "--schema", schema, "-"], + stdin: "piped", + stdout: "piped", + stderr: "piped", + }).spawn(); + const writer = validator.stdin.getWriter(); + await writer.write(new TextEncoder().encode(xml)); + await writer.close(); + const checked = await validator.output(); + assertEquals(checked.code, 0, new TextDecoder().decode(checked.stderr)); + const pdf = await buildPdfBytes(pending, filer); + if (evidenceDir) { + await Deno.mkdir(evidenceDir, { recursive: true }); + await Deno.writeTextFile( + `${evidenceDir}/${c.id}.json`, + JSON.stringify( + { inputs, filer, pending: result.pending, expected: c, projected }, + null, + 2, + ), + ); + await Deno.writeTextFile(`${evidenceDir}/${c.id}.xml`, xml); + await Deno.writeFile(`${evidenceDir}/${c.id}.pdf`, pdf); + } + const changed = { + ...pending, + form982: { ...pending.form982, principal_residence_basis: c.basis + 1 }, + }; + assertThrows( + () => buildMefXml(changed, filer), + Error, + "differs from its original 1099-C deposit", + ); + await assertRejects( + () => buildPdfBytes(changed, filer), + Error, + "differs from its original 1099-C deposit", + ); + assertEquals(pending.schedule1?.line8c_cod_income ?? 0, c.taxable); + assertEquals(pending.f1040?.line11_agi, 75000 + c.taxable); + assertEquals(pending.f1040?.line24_total_tax, c.tax); + assertEquals(projected.qpri_checkbox, true); + assertEquals(projected.line2_excluded_cod, c.excluded); + assertEquals( + projected.line10b_principal_residence_basis_reduction, + Math.min(c.basis, c.excluded), + ); + assertStringIncludes( + xml, + `${c.excluded}`, + ); + assertStringIncludes( + xml, + `${ + Math.min(c.basis, c.excluded) + }`, + ); + }); +} + +Deno.test("Form982 other exclusions remain guarded at both final exporters", async () => { + for ( + const exclusion_type of [ + "bankruptcy", + "insolvency", + "farm_debt", + "real_property_business", + ] + ) { + const result = f1040_2025.executeReturn({ + ...base.inputs, + f1099c: [{ + creditor_name: "Synthetic lender", + box2_cod_amount: 15000, + routing: "excluded", + exclusion_type, + insolvency_amount: 15000, + }], + }); + assertEquals(result.diagnostics, []); + const pending = buildPending(result.pending); + assertThrows( + () => buildMefXml(pending, base.filer), + Error, + // Native currently rejects earlier because non-QPRI has no QPRI flag. + "Form 982 QPRI filing-status cap conflicts with the return", + ); + await assertRejects( + () => buildPdfBytes(pending, base.filer), + Error, + "tax-attribute reduction details", + ); + } +}); diff --git a/product_board.md b/product_board.md index ab691a91d..01eca0a17 100644 --- a/product_board.md +++ b/product_board.md @@ -1,13 +1,13 @@ # TY2025 Form 1040 product board -> **Technical MeF pass estimate — October 10, 2026, 11:23 Stockholm: about 60% of individual ATS checks across the eight required Form 1040 scenarios would pass; rough uncertainty range 45–75%.** This is engineering judgment, not measured IRS acceptance or a whole-scenario pass count. The [public-entry replay](./docs/ats/ty2025-check-replay-2026-10-09.md) matches41 of54 selected calculation observations, with12 differences and1 unproduced value; this limited, uneven sample is not the IRS check denominator. It lowers the earlier75% estimate because component-level successes do not all reach complete return preparation. Missing source facts, guarded documents, attachments and unverified business rules remain material. Service availability is separate from this estimate; one failed required check can reject a scenario. +> **Technical MeF pass estimate — October 10, 2026: about 75% of individual ATS checks; low-confidence judgment range 50–85%.** The [expanded check ledger](./docs/ats/ty2025-check-expansion-2026-10-10.md) anchors this projection to 40/54 evaluated nonprovisional calculation matches (74.1%); five provisional matches and four unproduced amounts remain separate. The broader selected sample is 45/63 (71.4%). Native copies: 10 present, 12 missing, 34 unevaluated. The full IRS denominator remains incomplete; this is a judgment projection, not measured IRS acceptance. Enumeration changes do not indicate software improvements. ## Compacted learnings — October 10, 2026 -- **Queue:** 52 main TODOs remain open; 148 `future_todo` items stay deferred. Eight ATS scenarios remain partial, with none accepted. [Completed ledger](./docs/mef/ty2025/readiness/ty2025-product-board-completed-2026-10-01.md) records bounded work, not closure of these parent tasks. -- **Workflow:** #66–72 merged; main `ae7e93b78`. Continue in [base PR #73](https://github.com/filedcom/opentax/pull/73) on `codex/mef-readiness-ongoing-2`, pushing all subsequent work there. Preserve local evidence; snapshots do not prove filing. +- **Queue:** 52 main TODOs remain open; 150 `future_todo` items stay deferred. Eight ATS scenarios remain partial, with none accepted. [Completed ledger](./docs/mef/ty2025/readiness/ty2025-product-board-completed-2026-10-01.md) records bounded work, not closure of these parent tasks. +- **Workflow:** #66–73 merged; main `d65263134`. Continue in [base PR #74](https://github.com/filedcom/opentax/pull/74) on `codex/mef-readiness-ongoing-3`, pushing all subsequent work there until the next authorized merge. Preserve local evidence; snapshots do not prove filing. - **Business-credit/depreciation evidence:** [Merged PR #69](https://github.com/filedcom/opentax/pull/69) retains 44 XSD-valid business returns/1,243 observed pages and five personal returns/38 pages, covering depreciation elections, credit basis and final tax (46 regression passes). Broader depreciation, PWA/mixed use, authenticity and acceptance remain open; checkpoints retain presentation qualifications. -- **Regression/ATS:** [Frozen full gate](./docs/mef/ty2025/testing/ty2025-full-gate-2026-10-10.md), runtime `eed449e70`:13,669 pass/218 fail/zero ignored reported across1,394 modules; runtime unchanged. Failures comprise208 denied evidence-env reads and10 path/rejection contracts;65/66/139/140 remain deferred. It predates later statement/bonus/PWA/solar/transfer changes. [ATS replay](./docs/ats/ty2025-check-replay-2026-10-09.md):73 typed passes,41/54 selected calculation matches,12 differences/one missing, five native blocks and three partial packets. Required copies10/22,12 missing and34 unevaluated; Scenario4 lacks its transfer statement. Scenario13 has six XSD-valid roots/six qualified reviewed pages. Historical gates remain linked in the ledger; these observations do not measure IRS acceptance. +- **Regression/ATS:** [Frozen full gate](./docs/mef/ty2025/testing/ty2025-full-gate-2026-10-10.md), runtime `eed449e70`:13,669 pass/218 fail/zero ignored reported across1,394 modules; runtime unchanged. Failures comprise208 denied evidence-env reads and10 path/rejection contracts;65/66/139/140 remain deferred. It predates later statement/bonus/PWA/solar/transfer changes. [ATS replay](./docs/ats/ty2025-check-replay-2026-10-09.md):73 typed passes;[120 ledger observations](./docs/ats/ty2025-check-expansion-2026-10-10.md) across calculations/copies/known attachments;45/63 selected calculation matches,14 differences/four missing, five native blocks and three partial packets. Required copies10 present/12 missing/34 unevaluated; Scenario4 lacks its transfer statement. Scenario13 has six XSD-valid roots/six qualified reviewed pages. Linked historical gates and local observations do not establish IRS acceptance. - **SHOP geography:** [Nationwide premium limits](./docs/mef/ty2025/domains/credits/health/form8941/ty2025-form8941-rating-areas.md) cover 3,091 official rows (3,090 non-Hawaii calculator checks), 120 passing tests and eight XSD-valid returns/193 qualified reviewed pages, with period/farm/spouse ownership and independent final-tax checks. Deferred22/26/68/76/84, authenticity and broader readiness remain open. - **Inventory/layout:** 158 native/118 PDF descriptors (153/115 distinct keys), all211 root flags rechecked. [Canonical field inventory](./docs/mef/ty2025/testing/ty2025-pdf-field-inventory-2026-10-10.md):7,979 mappings/116 templates pass two-reader checks; builder/cache/registry gate866/0. Visual/owner/overflow semantics remain separate. Form8886/election registry audits agree. [Seven-section migration](./docs/architecture/repository-organization.md) preserves source/benchmark hashes; wider coverage decisions remain open. - **Household/disability credits:** Schedule H retains11 remarriage returns/55 reviewed pages and115 tests; Schedule R retains18 returns/76 pages with116 latest tests (308 prior ordering checks). Both cover source-to-tax joins, including care incapacity/recovery and seven resolved zero-tax blocks. Wider variants, source authenticity and deferred identity/presentation remain open. @@ -42,7 +42,12 @@ - **Partnership adjustments:** [Form8978 route audit](./docs/mef/ty2025/domains/taxes/passthrough/form8978/ty2025-form8978-pdf-gap.md#october-10-paired-reporting-year-and-registry-audit):37 typed checks and three reviewed full-XSD/PDF replays pass (3/3/9 attachments), including positive tax7955+1920=9875, negative credits and multi-year continuations. Historical finding14 does not reproduce; no runtime repair or new visual count. Authenticity, wider sources and IRS acceptance remain open. - **Community allocations:** [Form8958 boundary verification](./docs/mef/ty2025/domains/general/filing/form8958/ty2025-form8958-gap.md#october-10-allocation-and-export-boundary-verification):16 typed checks verify staged XSD, odd-dollar/zero-withholding conservation and both export guards; no complete filing or PDF review. Both-person source ingestion, authenticity and registered documents remain open. - **QOF annual statements:** [Form8997 route audit](./docs/mef/ty2025/domains/general/investments/form8997/ty2025-form8997-gap.md#october-10-grouped-route-and-holding-only-public-export-audit):31 typed checks verify ledger/source bytes, code-Z joins and continuations. Three holding ledgers preserve the complete baseline1040 and reject both exports (six checks). No new full-XSD or visual count; deferred34, authenticity and filing activation remain open. -- **Additional Medicare tax:** [SE/source replay](./docs/mef/ty2025/domains/taxes/employment/form8959/ty2025-form8959-native-contract.md#october-10-schedule-se-medicare-deposit-replay):119 typed checks pass; retained tips, reclassified wages and scalar/owned/optional-farm SE deposits reconcile before export. Four SE public returns pass fullXSD/actualPDF with four native/four PDF deposit rejections, adding no visual counts. Earlier ten wage/employment returns retain61 qualified reviewed pages and independent tax checks. Placement17/rounding33/zero76, broader source/payment authenticity and acceptance remain open. Joint-packet commitc92fbe8de passed CI38040918503. +- **Additional Medicare tax:** [SE/source replay](./docs/mef/ty2025/domains/taxes/employment/form8959/ty2025-form8959-native-contract.md#october-10-schedule-se-medicare-deposit-replay):119 typed checks pass; retained tips, reclassified wages and scalar/owned/optional-farm SE deposits reconcile before export. Four SE full-XSD/PDF replays reject four native/four PDF mutations; no new visual count. Ten earlier wage/employment returns retain61 qualified reviewed pages and independent tax checks. Placement17/rounding33/zero76, broader source/payment authenticity and acceptance remain open. Merged Medicare commit64b1d6db2 passed CI38041257306. +- **Debt cancellation:** [Form982 public checkpoint](./docs/mef/ty2025/domains/income/other/form982/ty2025-form982-qpri-pdf.md#october-10-public-source-and-complete-export-checkpoint):90 checks pass, two cap-ordering cases fail; seven full-XSD returns/29 reviewed pages (20 unique) include two incorrect returns. Source mutations reject7/7 native and7/7 PDF; four unsupported types reject both exports. Deferred149 retains the cap defect without repair; authenticity, wider debt/attribute routes and acceptance remain open. +- **Method changes/recapture:** [Grouped route checkpoint](./docs/mef/ty2025/domains/income/business/form3115/ty2025-form3115-route-audit.md):42 tests pass across Forms3115/4255/8611. Six method-change and four4255 public cases reconcile income/tax; all ten reject both exports (20 assertions); no new XSD/visual count. Attachments, authenticated prior records and broader branches remain open; no deferred repair. +- **Fuel credits:** [Form8864 current replay](./docs/mef/ty2025/domains/credits/business/form8864/ty2025-form8864-gap.md#october-10-complete-producer-export-replay):21 grouped tests pass. Two-lot producer replay passes fullXSD/actual23-page PDF and16 export rejections; no new visual count. Form6478 public empty inputs preserve1040; ten legacy-gallon probes and unmodeled allocation return diagnostics. Fiscal-year allocations, first-half rules, broader sources and authenticity/acceptance remain open. +- **New Markets credit/recapture:** [Current route audit](./docs/mef/ty2025/domains/credits/business/form8874/ty2025-form8874-pdf-gap.md#october-10-credit-inventory-and-reported-recapture-checkpoint):48 tests pass. Two credit inventories reconcile but both exports remain CDE-status/history-blocked; older packets do not prove current exportability. Two full-XSD/PDF recapture returns retain eight mutation rejections and final taxes10,099/12,243. No new visual count or deferred repair; wider histories, authenticity and activation remain open. +- **Combined QEF credits:** [Education/adoption checkpoint](./forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure_proof.md#october-10-combined-education-and-adoption-credit-checkpoint): Education precedes adoption in actual and without-QEF returns. Two full-XSD packets/22 reviewed pages reconcile deferrals740/235 and refunds14,775/17,000; grouped52/0 plus final focused3/0, eight export rejections and three public rejections. [Election B carryforward checkpoint](./forms/f1040/2025/domains/income/foreign/form8621/form8621_1294_refigure_proof.md#october-10-current-year-adoption-carryforward-with-election-b) adds55/0 grouped tests, two full-XSD packets/20 reviewed pages, actual carries1,885/95,20 ledger-tamper rejections and four persisted-pending rejections. Zero presentation76, JSON replay150, authenticity and broader combinations remain open. - **External gates:** ATS outage, authorized credentials/service package, source authentication, accepted carry/election records and IRS acknowledgments remain separate unresolved prerequisites. No accepted test or filing-ready release is claimed. ## Scope and completion rules @@ -274,7 +279,7 @@ current execution queue. - [ ] Reconcile Scenarios3/8 issued 1099-R recipient identity at the public/native boundary: the October9 unmodified source fixture produces its provisional numeric return but `prepareReturn` rejects `1099-R 1 positive issued copy needs recipient SSN`, before the previously recorded unidentified1099-DIV payer restriction. Verify the issued recipient TIN against the retained packet before extending the fixture; do not invent it from the return header. Scenario3 reaches the same recipient-SSN guard after the visually marked filing status is restored; retain its replay in `.state/research/ats-source-recheck-2026-10-09/`. Retain `.state/research/ats-check-replay-2026-10-09/report.json` and its native-preparation probe. Future planning only; do not implement in the current queue. -- [ ] Review zero-value PDF presentation in the Scenario13 current-law reconstruction: Form1040 page2 line24 is blank although pending/native total tax is0; Form8911 page5 line8 is blank although Form6251 line9 and native tentative minimum tax are0. The [Form8911 instructions](https://www.irs.gov/instructions/i8911) require entering TMT on line8. All six pages were observed and XML passes XSD, but numerical equality does not establish printed-field parity. Evidence: `.state/research/ats13-current-law-2026-10-09/`. The Schedule R credit-limit batch repeats blank Form 1040 line 24 when calculated/native total tax is zero; 40 pages were observed, with no zero-print repair. Evidence: `schedule-r-credit-limit-2026-10-09/render-review.json`. The joint PTC `zero` and `exempt-crossing` packets also leave Form1040 page2 line24 blank at zero native tax (`form8962-joint-benefits-2026-10-09/render-review.json`). The later single-disability 16,000-income return repeats blank line 24 despite zero native tax; its batch retains 25 observed pages (`schedule-r-benefit-returns-2026-10-09/render-review.json`). Future planning only; do not implement in the current queue. The joint APTC equal-credit and net-credit packets repeat blank zero Form1040 line24 on page2; Form8962 line26 correctly prints zero for equal credit (`form8962-joint-aptc-2026-10-09/render-review.json`). The later family batch repeats blank zero Form1040 line24 in both shared-child packets and the one-policy partial-family packet (`form8962-family-replay-2026-10-09/render-review.json`), with31 pages observed across all four returns. The nine dependent-threshold packets also leave Schedule8812 line10 blank despite its zero instruction, with72 pages observed; Form8962 zero dependent MAGI is blank too (`form8962-dependent-thresholds-2026-10-09/render-review.json`). October9 `prior-iso-gain` Form6251 PartIII page8 leaves calculated zero lines21/23/26 blank (`form6251-basis-pdf-2026-10-09/render-review.json`). The multiple-business education child packet repeats blank Schedule 8812 line10 zero on page8; reviewed104-page checkpoint remains qualified. Service-grant/business child packet repeats the exact reviewed Schedule8812 page8 blank line10 zero; full86-page observation remains qualified. October10 small-facility increase packets repeat blank Form8835 PartII line3 at zero across eleven facility copies; all122 packet pages were observed with this existing qualification. Evidence: `.state/research/form8835-increase-2026-10-10/packaged/visual-review.json`. No repair or clean parity approval is included. Early-construction checkpoint repeats Form8835 zero line3 across12 facility copies; all152 packet pages observed with this qualification. Evidence: `.state/research/form8835-early-2026-10-10/packaged/visual-review.json`. No deferred repair implemented. Domestic-content checkpoint repeats blank zero Form8835 line3 on five facility copies; all81 pages observed with this qualification (`form8835-domestic-2026-10-10/visual-review.json`). No deferred repair implemented. Annual community checkpoint repeats blank zero Form8835 line3 on nine facility copies; all139 pages observed with this qualification (`form8835-community-2026-10-10/visual-review.json`). No deferred repair implemented. The October10 passive-rental inventory packets repeat this qualification; all78 pages and native6251 field inventories are retained in `form8582cr-rentals-2026-10-10/`, with no deferred repair. October10 Form8826/Form3800 component zero-use rows again leave some zero cells blank; credit2675 remains unused and component line38 correctly shows0. Evidence: `.state/research/form8826-inventory-2026-10-10/visual-review.json`. October10 rented-home complete returns retain blank zero Form1040/ScheduleC/Form8829 fields, including zero-income Form8829 line36; carryover lines43/44 print, and line43=4100 is retained. Evidence: `.state/research/form8829-sources-2026-10-10/visual-review.json` (five returns/46 reviewed pages). October10 geographic period/farm/spouse packet review: Partial-year and spouse Form3800 zero TMT fields remain blank while Form6251 prints zero. Evidence: `form8941-geographic-routes-2026-10-10/visual-review.json` (122 observed pages); no deferred repair. October10 Form8959 packet review repeats blank calculated/native-zero lines6/7/18 on page3 in both joint-zero-tax-trigger and joint-spouse-only. Line6 explicitly instructs zero; withholding180 and final owed1118 reconcile. All35 batch pages observed; no repair. Evidence: `form8959-route-audit-2026-10-10/visual-review.json`. +- [ ] Review zero-value PDF presentation in the Scenario13 current-law reconstruction: Form1040 page2 line24 is blank although pending/native total tax is0; Form8911 page5 line8 is blank although Form6251 line9 and native tentative minimum tax are0. The [Form8911 instructions](https://www.irs.gov/instructions/i8911) require entering TMT on line8. All six pages were observed and XML passes XSD, but numerical equality does not establish printed-field parity. Evidence: `.state/research/ats13-current-law-2026-10-09/`. The Schedule R credit-limit batch repeats blank Form 1040 line 24 when calculated/native total tax is zero; 40 pages were observed, with no zero-print repair. Evidence: `schedule-r-credit-limit-2026-10-09/render-review.json`. The joint PTC `zero` and `exempt-crossing` packets also leave Form1040 page2 line24 blank at zero native tax (`form8962-joint-benefits-2026-10-09/render-review.json`). The later single-disability 16,000-income return repeats blank line 24 despite zero native tax; its batch retains 25 observed pages (`schedule-r-benefit-returns-2026-10-09/render-review.json`). Future planning only; do not implement in the current queue. The joint APTC equal-credit and net-credit packets repeat blank zero Form1040 line24 on page2; Form8962 line26 correctly prints zero for equal credit (`form8962-joint-aptc-2026-10-09/render-review.json`). The later family batch repeats blank zero Form1040 line24 in both shared-child packets and the one-policy partial-family packet (`form8962-family-replay-2026-10-09/render-review.json`), with31 pages observed across all four returns. The nine dependent-threshold packets also leave Schedule8812 line10 blank despite its zero instruction, with72 pages observed; Form8962 zero dependent MAGI is blank too (`form8962-dependent-thresholds-2026-10-09/render-review.json`). October9 `prior-iso-gain` Form6251 PartIII page8 leaves calculated zero lines21/23/26 blank (`form6251-basis-pdf-2026-10-09/render-review.json`). The multiple-business education child packet repeats blank Schedule 8812 line10 zero on page8; reviewed104-page checkpoint remains qualified. Service-grant/business child packet repeats the exact reviewed Schedule8812 page8 blank line10 zero; full86-page observation remains qualified. October10 small-facility increase packets repeat blank Form8835 PartII line3 at zero across eleven facility copies; all122 packet pages were observed with this existing qualification. Evidence: `.state/research/form8835-increase-2026-10-10/packaged/visual-review.json`. No repair or clean parity approval is included. Early-construction checkpoint repeats Form8835 zero line3 across12 facility copies; all152 packet pages observed with this qualification. Evidence: `.state/research/form8835-early-2026-10-10/packaged/visual-review.json`. No deferred repair implemented. Domestic-content checkpoint repeats blank zero Form8835 line3 on five facility copies; all81 pages observed with this qualification (`form8835-domestic-2026-10-10/visual-review.json`). No deferred repair implemented. Annual community checkpoint repeats blank zero Form8835 line3 on nine facility copies; all139 pages observed with this qualification (`form8835-community-2026-10-10/visual-review.json`). No deferred repair implemented. The October10 passive-rental inventory packets repeat this qualification; all78 pages and native6251 field inventories are retained in `form8582cr-rentals-2026-10-10/`, with no deferred repair. October10 Form8826/Form3800 component zero-use rows again leave some zero cells blank; credit2675 remains unused and component line38 correctly shows0. Evidence: `.state/research/form8826-inventory-2026-10-10/visual-review.json`. October10 rented-home complete returns retain blank zero Form1040/ScheduleC/Form8829 fields, including zero-income Form8829 line36; carryover lines43/44 print, and line43=4100 is retained. Evidence: `.state/research/form8829-sources-2026-10-10/visual-review.json` (five returns/46 reviewed pages). October10 geographic period/farm/spouse packet review: Partial-year and spouse Form3800 zero TMT fields remain blank while Form6251 prints zero. Evidence: `form8941-geographic-routes-2026-10-10/visual-review.json` (122 observed pages); no deferred repair. October10 Form8959 packet review repeats blank calculated/native-zero lines6/7/18 on page3 in both joint-zero-tax-trigger and joint-spouse-only. Line6 explicitly instructs zero; withholding180 and final owed1118 reconcile. All35 batch pages observed; no repair. Evidence: `form8959-route-audit-2026-10-10/visual-review.json`. October10 combined QEF/education/adoption `shadow-limit` repeats blank Form1040 line24 at calculated/native tax0; all22 pages across two packets were observed. Evidence: `.state/research/form8621-combined-2026-10-10/visual-review.json`. No deferred repair. The subsequent QEF carryforward pair repeats blank zero line24 in both packets;20 pages reviewed (`form8621-carry-2026-10-10/visual-review.json`), no repair. - [ ] Reject inconsistent year-end spouse and marital facts in Schedule H parent `dated_service_periods` exports. The October 9 six-case control audit confirms that quarterly reviews reject a Q4 spouse SSN different from the joint return and a divorced/not-remarried Q4 source paired with MFJ; dated reviews admit both through native Schedule H, the PDF descriptor and the full native bundle. Invalid dated packets retain Schedule H/1040 tax1,493 and1,302 and both pass local2025v5.4 XSD. The current guard checks only `quarterly_circumstances`. Reconcile every retained parent-review classification to year-end return identity/status; XSD success is not source validity. Evidence: `.state/research/scheduleh-parent-identity-audit-2026-10-09/`, with six inputs/results, four XML files, probe and hashes. No filled PDF was generated or reviewed for this audit. Future planning only; do not implement in the current queue. @@ -513,3 +518,7 @@ Additional evidence for deferred104: October10 `single-excluded-cents` Form7206 Additional evidence for deferred68/76/86: October10 single-plan Form7206 review observes71 pages and six correctly owned health copies. Form8995 names, blank required zeros and positive ScheduleC at-risk choices repeat; `single-excluded-cents` also retains104. All original source records remain intact. See `.state/research/form7206-single-policy-2026-10-10/visual-review.json`; no deferred repair. - [ ] Bind generated PDF statement contents to retained source facts when replaying prepared submission archives. October10 three complete Form5695 returns have distinct taxpayers and4/5/6 door QMIDs but the same `AdditionalQMIDStatement.pdf` filename. Replacing each prepared statement and its archived bytes with another return's PDF, then recomputing `attachmentSha256ByFileName`, is accepted by `buildMefTransmissionPackage` for all three returns while source/XML and their hashes remain unchanged. Ordinary unrehashed statement/XML/manifest/filer/bundle/residency substitutions reject18/18. Preserve `.state/research/submission-batch-isolation-2026-10-10/rehashed-probe.log`, the three changed ZIPs and digest records. This does not authenticate manufacturer evidence or demonstrate IRS acceptance. Future planning only; do not implement in the current queue. + +- [ ] Reconcile Form982 QPRI debt-cap validation and nonqualified-debt-first ordering. October10 public `separate-cap` accepts claimed qualified debt600,000, total debt600,000 and cancellation400,000, exporting exclusion375,000/taxable25,000 instead of175,000/225,000 after the375,000 qualified-debt cap. `joint-cap` accepts qualified/total debt1,000,000 and cancellation800,000, exporting750,000/50,000 instead of550,000/250,000 after the750,000 cap. Both XMLs pass fullXSD and both actual PDFs repeat the overexclusion. Reject over-cap source claims or cap qualified indebtedness before applying the ordering rule in [2025 Pub4681](https://www.irs.gov/publications/p4681). Preserve both failing normative tests and `.state/research/form982-qpri-2026-10-10/packet-verification.json`; no production repair in this queue. Future planning only; do not implement in the current queue. + +- [ ] Reconcile JSON-persisted QEF Election B pending returns with full source replay. October10 adoption-only and combined education/adoption carryforward cases calculate actual unused credits1,885/95, but JSON serialization/reload of the pending graph rejects both native and PDF export with “Form 8621 section 1294 filed return differs from full source and without-QEF refigure.” The same source graph must retain its semantic identity across persistence; inspect undefined-field normalization and replay equality without weakening tamper checks. Preserve `.state/research/form8621-carry-2026-10-10/json-roundtrip-original-failure.log` and the explicit persisted-return rejection cases. Direct in-memory export is a separate checkpoint, not proof of saved-return support. Future planning only; do not implement in the current queue.