Skip to content

feat(us-tax): Form 2555 FEIE model + hard guard that FEIE does not exclude SE tax - #154

Merged
elasticdotventures merged 4 commits into
mainfrom
issue-147-feie
Aug 9, 2026
Merged

feat(us-tax): Form 2555 FEIE model + hard guard that FEIE does not exclude SE tax#154
elasticdotventures merged 4 commits into
mainfrom
issue-147-feie

Conversation

@elasticdotventures

Copy link
Copy Markdown
Member

Implements #147

  • FEIE computation with per-year indexed exclusion limits (2023: 20K, 2024: 26.5K, 2025: 30K)
  • Both bona fide residence and physical presence tests
  • Hard guard: income_subject_to_se_tax is NOT reduced by FEIE
  • Pro-rata for partial tax years

elasticdotventures pushed a commit that referenced this pull request Aug 9, 2026
…t, reject unrecognized chains, fix test fixtures

- remove ComputeFeie/ComputeDepreciation contract entries (belong to separate PRs #154/#156, not this fix)
- restore missing Lei import in ledgerr-mcp/src/crypto.rs (undeclared-type compile error)
- Chain::from_str no longer silently accepts any string via an Other(..) catch-all; unmatched input now correctly returns None, matching this PR's own unrecognized_chain_returns_error test
- crypto_contract.rs: gain_loss/au_taxable_gain are Decimal, which serializes as a JSON string — fix two assertions that compared against bare floats
- crypto_contract.rs: replace check-digit-invalid placeholder LEI with the known-valid LEI already used elsewhere in this codebase
elasticdotventures added a commit that referenced this pull request Aug 9, 2026
…to_cost_basis_check (#153)

* fix(crypto): cost basis method, chain, address are no longer hardcoded (#150)

* fix(crypto): trim out-of-scope FEIE/depreciation stubs, fix Lei import, reject unrecognized chains, fix test fixtures

- remove ComputeFeie/ComputeDepreciation contract entries (belong to separate PRs #154/#156, not this fix)
- restore missing Lei import in ledgerr-mcp/src/crypto.rs (undeclared-type compile error)
- Chain::from_str no longer silently accepts any string via an Other(..) catch-all; unmatched input now correctly returns None, matching this PR's own unrecognized_chain_returns_error test
- crypto_contract.rs: gain_loss/au_taxable_gain are Decimal, which serializes as a JSON string — fix two assertions that compared against bare floats
- crypto_contract.rs: replace check-digit-invalid placeholder LEI with the known-valid LEI already used elsewhere in this codebase

---------

Co-authored-by: brianh <brianh@promptexecution.com>
… custom_kind fields from rebase

- drop 'pub mod schedule_e;' declaration (belongs to a separate not-yet-merged PR, schedule_e.rs doesn't exist here)
- fix two OntologyEntityInput struct literals left with a duplicate custom_kind field by an earlier non-conflicting rebase merge
Comment on lines +160 to +171
pub fn handle_compute_feie(
tax_year: u16,
foreign_earned_income: &str,
days_qualified: u16,
housing_exclusion: Option<&str>,
test: &str,
test_start: &str,
test_end: Option<&str>,
qualifying_days: Option<u16>,
window_start: Option<&str>,
window_end: Option<&str>,
) -> Value {
Comment on lines +160 to +171
pub fn handle_compute_feie(
tax_year: u16,
foreign_earned_income: &str,
days_qualified: u16,
housing_exclusion: Option<&str>,
test: &str,
test_start: &str,
test_end: Option<&str>,
qualifying_days: Option<u16>,
window_start: Option<&str>,
window_end: Option<&str>,
) -> Value {
@@ -0,0 +1,65 @@
use ledgerr_mcp::{
feie::{compute_feie, FeieInput, ForeignResidenceTest},
FeieOutcome,
@elasticdotventures
elasticdotventures merged commit 0ab6dbe into main Aug 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants