Skip to content

feat(examples): Phase 2 schema — FX, allowance windows, filing timeline#360

Merged
buremba merged 1 commit into
mainfrom
feat/phase2-schema
Apr 26, 2026
Merged

feat(examples): Phase 2 schema — FX, allowance windows, filing timeline#360
buremba merged 1 commit into
mainfrom
feat/phase2-schema

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented Apr 25, 2026

Summary

Phase 2 of the world model. Accretive — doesn't break v1 SA100 flow, fills the gaps the agent had to work around.

New entities (4)

  • `allowance_window` — materialized accumulator per (tax_year, kind). Lets the agent answer "how much ISA budget left?" / "how much pension AA can I still use?" instantly. Covers ISA subscription, dividend allowance, PSA, CGT AEA, pension AA (with 3-year carry-forward), property/trading allowances, personal allowance (tapered).
  • `filing_obligation` — SA100/SA800/SA900/CT600/VAT101/P11D etc. with due_date + status. Drives proactive deadline surfacing.
  • `payment` — HMRC payments in either direction (balancing, POA1, POA2, corp_tax, vat, refund, penalty). Distinct from generic transactions because it ties to filing_obligation for reconciliation.
  • `tax_assessment` — computed tax position; source ∈ `agent_projection | hmrc_sa302 | hmrc_ct600_acknowledgement | manual` so HMRC's number is comparable to ours.

New relationship types (4)
`accumulates_in` (tx → allowance_window), `obligation_for` (filing_obligation → tax_year + subject), `assessment_for` (tax_assessment → tax_year + subject), `settles` (payment → filing_obligation).

Field additions

  • `transaction`: `native_amount`, `native_currency`, `fx_rate_to_gbp`, `fx_rate_source`.
  • `income_source`: `foreign_tax_paid`, `foreign_tax_currency`, `withholding_jurisdiction`, `treaty_rate_applied`.

SOUL.md teaches the FX rule (HMRC monthly average as default), allowance-window maintenance on every relevant write, and filing-obligation/payment/tax_assessment usage.

Stacked on

`feat/world-model-companies` (#358).

Test plan

  • All 40 model YAMLs validate against `@lobu/owletto-cli`'s `validateModel`.
  • Pre-commit Biome + tsc pass.
  • Once seeded, ask the agent "what's my remaining ISA allowance for 2025-26" and confirm it reads from allowance_window rather than recomputing.
  • Forward a USD-denominated dividend email; confirm `native_amount`, `native_currency`, `fx_rate_to_gbp`, `foreign_tax_paid` get populated.

Follow-up

ASSEMBLY.md will need a small SA106 section update to use the new foreign-tax fields. I'll amend that branch after this lands.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@buremba buremba force-pushed the feat/world-model-companies branch from 81adb4a to 865a027 Compare April 26, 2026 16:32
Base automatically changed from feat/world-model-companies to main April 26, 2026 16:33
Adds the accretive entities the long-term world model needs to support
foreign income, materialized allowance budgeting, and proactive filing
deadlines. None of these break the v1 SA100 flow; they simply fill in
gaps the agent had to work around.

New entities:
- allowance_window — materialized accumulator per (tax_year, kind):
  isa_subscription, dividend_allowance, personal_savings_allowance,
  cgt_annual_exempt, pension_annual_allowance (with 3-year carry-
  forward), property_income_allowance, trading_allowance,
  personal_allowance (tapered).
- filing_obligation — one per required submission (SA100 paper, online,
  balancing payment, POA1, POA2, CT600, VAT101, P11D). Carries due_date
  and status so the agent can surface deadlines proactively.
- payment — HMRC payments in either direction (balancing, POA1, POA2,
  corp_tax, vat, refund, penalty, interest). Distinct from generic
  transactions because it ties to filing_obligation for reconciliation.
- tax_assessment — the computed tax position for one (tax_year,
  subject) pair. source ∈ {agent_projection, hmrc_sa302,
  hmrc_ct600_acknowledgement, manual} so we can compare HMRC's number
  with our own.

New relationship types:
- accumulates_in (transaction|contribution → allowance_window)
- obligation_for (filing_obligation → tax_year, $member|company)
- assessment_for (tax_assessment → tax_year, $member|company)
- settles (payment → filing_obligation)

Field additions:
- transaction: native_amount + native_currency + fx_rate_to_gbp +
  fx_rate_source for non-GBP transactions. Keeps both numbers + the
  conversion source so HMRC-aligned auditing is possible.
- income_source: foreign_tax_paid + foreign_tax_currency +
  withholding_jurisdiction + treaty_rate_applied for SA106 Foreign Tax
  Credit Relief.

SOUL.md teaches:
- When and how to record FX (non-GBP transactions, which rate to use).
- How to maintain allowance_window accumulators on every relevant write.
- How to register filing_obligation + reconcile via tax_assessment
  + settle via payment.

40 model YAMLs total. All validate.
@buremba buremba force-pushed the feat/phase2-schema branch from ee35b5c to 85f9e29 Compare April 26, 2026 16:33
@buremba buremba merged commit 820af04 into main Apr 26, 2026
10 checks passed
@buremba buremba deleted the feat/phase2-schema branch April 26, 2026 16:33
@buremba buremba restored the feat/phase2-schema branch May 12, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant