TaxPilot

Search the docs

Search the Help centre, Developer docs and Legal centre.

Open TaxPilot

Versioned parameters

Read and edit a release's parameter file: entries, versions that apply by date, enactments, citations and what loadParams rejects.

Updated November 22, 2026

Every rate, limit, threshold and law-dependent date lives in a JSON file per release, packages/t2/src/rules/params/<id>.json, with its source and its statute citation. Each release file has 169 parameters. The code only declares which parameters exist and what kind each is. Changing a value is a data change; adding a parameter is a code change, because a form has to read it.

The file

ParamFile in src/rules/params.ts:

A plain entry

params/2026.1.json
"FED.sbd": {
  "kind": "rate",
  "value": "19/100",
  "label": "19%",
  "src": "t2",
  "cite": "T2 page 4, line 430: \"× 19%\".",
  "law": "ITA 125(1.1)(c)"
}
  • kind is one of rate, money, int, factor, date or moneyByYear, and must match SCHEMA.
  • A rate is "num/den" with a printed label. Money is a dollar string such as "500000" or "1234.56".
  • src is a key into sources. cite is where CRA prints the value.
  • law is the provision that sets it. Parts are separated by ; . Federal parts look like ITA 125(1.1)(c) or ITR 2900(4); provincial parts use a code from PROVINCIAL_STATUTES (ON TA, AB CTA, QC TA, …).
  • enacted (optional) records the Act that set a value that doesn't change inside any year of the release.

lawLinks(law) splits a citation into parts with the URL of each section on laws-lois (federal) or the statute (provincial). It throws on anything that isn't a recognisable citation.

A versioned entry

When the law changed a value, the entry has versions instead of value. The return's period picks one. Each ParamVersion has:

For example, FED.taxableCapitalDivisor has two versions: $11,250 for tax years beginning before 2022-04-07, and $90,000 from then (S.C. 2022, c. 19, s. 21, assent 2022-12-15). Use describeApplies(applies) to print a range in words, such as "tax years beginning on or after 2022-04-07".

Mid-year changes

Provincial rates and limits that change on a calendar date use on: "days" with prorate: "taxYearDays". A rate read through PROV.x is day-weighted over the year's actual days. A form that must compute each period separately reads paramSegments(group, key), as Schedule 5 and the Ontario OSBD lines do.

What loadParams rejects

loadParams(file) validates the whole file before anything is evaluated, and checkVersions validates each set of versions. A release won't load if:

  • a parameter is missing, extra or of the wrong kind, a value doesn't parse, a rate has no label, or a source key is unknown;
  • a citation is empty or lawLinks can't read it;
  • two versions overlap (unless one supersedes the other or is a proposal), or versions mix different on values;
  • a days-based version doesn't say prorate: "taxYearDays";
  • a version has no meta, or meta.approval lacks authority, by or at;
  • an enacted version has no enacted.by and url, or a proposed one has no proposal;
  • a testOnly version is in a shipping release.

How forms read parameters

Forms import the group views from src/rules/params.ts (FED, ON, PROV, SRED, MISC, CCA_RATES, …) and read FED.sbd as a plain property. The view resolves against the release being evaluated, because evaluate runs inside withParams(registry.params). Two releases can share form code with different values, and Evaluation.rules.params records which version each evaluation used.

Change a value

Terminal
pnpm --filter @workspace/t2 release new 2026.1 2026.2     # copies params/2026.1.json to params/2026.2.json
# edit values, cite and law in params/2026.2.json; register the release in src/repo.ts as the command prints
pnpm --filter @workspace/t2 release diff 2026.1 2026.2    # markdown: parameter changes + sample-return deltas
pnpm --filter @workspace/t2 test

Never edit a published release's file: its hash is frozen. While a release is still a draft you may edit it in place, but the same rules apply: write a change in law as a new version, and keep the old one, because returns for earlier periods still need it. The full reference is docs/rules-engine.md.