Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/plugins/conductor
Submodule conductor added at f06add
5 changes: 5 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[submodule ".agents/plugins/conductor"]
path = .agents/plugins/conductor
url = https://github.com/gemini-cli-extensions/conductor.git
branch = main

8 changes: 4 additions & 4 deletions converters/fixtures/src/pic_fixture_converters/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

from __future__ import annotations

from dataclasses import dataclass
from decimal import Decimal, InvalidOperation
import hashlib
import json
from pathlib import Path
import re
from dataclasses import dataclass
from decimal import Decimal, InvalidOperation
from pathlib import Path
from typing import Any, Literal

import yaml
Expand Down Expand Up @@ -275,7 +275,7 @@ def _expected_value(value: Any, *, source: str | None) -> dict[str, Any]:
return {"value": _pic_value(value), "valueState": "known", "epistemicStatus": "asserted"}


def _pic_value(value: bool | int | float | str) -> bool | int | str:
def _pic_value(value: bool | float | str) -> bool | int | str:
if isinstance(value, bool):
return value
if isinstance(value, int):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import argparse
import json
from pathlib import Path
import subprocess
import tempfile
from typing import Callable
from collections.abc import Callable
from pathlib import Path

from pic_fixture_converters import openfisca_to_pic, policyengine_to_pic

Expand Down
10 changes: 5 additions & 5 deletions harness/axiom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
from axiom.adapter import (
RULESPEC_NZ_ACC_EARNERS_LEVY_TARGET,
RULESPEC_NZ_GST_TARGET,
RULESPEC_NZ_KIWISAVER_CONTRIBUTIONS_TARGET,
RULESPEC_NZ_INDIVIDUAL_INCOME_TAX_TARGET,
RULESPEC_NZ_KIWISAVER_CONTRIBUTIONS_TARGET,
RULESPEC_NZ_NEW_ZEALAND_SUPERANNUATION_CORE_TARGET,
RULESPEC_NZ_NEW_ZEALAND_SUPERANNUATION_SPECIAL_RATES_TARGET,
AxiomRuleSpecAdapter,
RuleSpecTarget,
build_rulespec_nz_acc_earners_levy_adapter,
build_rulespec_nz_gst_adapter,
build_rulespec_nz_kiwisaver_contributions_adapter,
build_rulespec_nz_individual_income_tax_adapter,
build_rulespec_nz_kiwisaver_contributions_adapter,
build_rulespec_nz_new_zealand_superannuation_core_adapter,
build_rulespec_nz_new_zealand_superannuation_special_rates_adapter,
)
Expand All @@ -26,10 +26,10 @@
)

__all__ = [
"RULESPEC_NZ_GST_TARGET",
"RULESPEC_NZ_KIWISAVER_CONTRIBUTIONS_TARGET",
"RULESPEC_NZ_ACC_EARNERS_LEVY_TARGET",
"RULESPEC_NZ_GST_TARGET",
"RULESPEC_NZ_INDIVIDUAL_INCOME_TAX_TARGET",
"RULESPEC_NZ_KIWISAVER_CONTRIBUTIONS_TARGET",
"RULESPEC_NZ_NEW_ZEALAND_SUPERANNUATION_CORE_TARGET",
"RULESPEC_NZ_NEW_ZEALAND_SUPERANNUATION_SPECIAL_RATES_TARGET",
"AxiomCompiledArtifactExecutor",
Expand All @@ -39,8 +39,8 @@
"RuleSpecTarget",
"build_rulespec_nz_acc_earners_levy_adapter",
"build_rulespec_nz_gst_adapter",
"build_rulespec_nz_kiwisaver_contributions_adapter",
"build_rulespec_nz_individual_income_tax_adapter",
"build_rulespec_nz_kiwisaver_contributions_adapter",
"build_rulespec_nz_new_zealand_superannuation_core_adapter",
"build_rulespec_nz_new_zealand_superannuation_special_rates_adapter",
"generate_report",
Expand Down
3 changes: 1 addition & 2 deletions harness/axiom/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from axiom.adapter import AxiomRuleSpecAdapter


ExecutionCallback = Callable[[dict[str, Any]], dict[str, Any]]


Expand Down Expand Up @@ -41,7 +40,7 @@ def run_case(
try:
response = active_executor(request)
axiom = self.adapter.normalize_response(response)
except Exception as exc:
except Exception as exc: # noqa: BLE001 - adapters may raise arbitrary failures
return {
"caseId": pic_case["caseId"],
"status": "adapter_failure",
Expand Down
7 changes: 2 additions & 5 deletions harness/tests/test_axiom_harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,20 @@
from typing import Any

import pytest

from pic_contracts.schema_utils import validator_for

from axiom import (
AxiomRuleSpecAdapter,
RuleSpecTarget,
build_rulespec_nz_acc_earners_levy_adapter,
build_rulespec_nz_kiwisaver_contributions_adapter,
build_rulespec_nz_gst_adapter,
build_rulespec_nz_individual_income_tax_adapter,
build_rulespec_nz_kiwisaver_contributions_adapter,
build_rulespec_nz_new_zealand_superannuation_core_adapter,
build_rulespec_nz_new_zealand_superannuation_special_rates_adapter,
generate_report,
write_reports,
)
from axiom.runner import AxiomHarnessRunner

from pic_contracts.schema_utils import validator_for

GST_CASE = {
"caseId": "nz-gst/fixture.add_and_remove_gst",
Expand Down
1 change: 0 additions & 1 deletion harness/tests/test_policyengine_trace_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from policyengine_trace import project_flat_trace
from policyengine_trace.projection import parse_trace_key


SNAP_FLAT_TRACE = {
"snap<2024-01, (default)>": {
"dependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def build_policyengine_situation(case: dict[str, Any]) -> dict[str, Any]:
"is_tax_unit_dependent": {period_year: is_child},
"is_disabled": {period_year: has_elderly_disabled and index == 1},
"immigration_status_str": {period_year: "CITIZEN"},
"employment_income": {period_year: float(_annualize(earned_income if index == 0 else Decimal("0")))},
"employment_income": {period_year: float(_annualize(earned_income if index == 0 else Decimal(0)))},
"snap_allowable_medical_expenses": {
period_year: float(_annualize(medical if index == 0 else Decimal("0"))),
period_year: float(_annualize(medical if index == 0 else Decimal(0))),
},
}

Expand Down Expand Up @@ -251,7 +251,7 @@ def _marital_units(members: list[str], ages: list[int]) -> dict[str, Any]:


def _annualize(monthly: Decimal) -> Decimal:
return monthly * Decimal("12")
return monthly * Decimal(12)


def _scalar(value: Any) -> Any:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def run_prd_cases(
return [json.loads(line) for line in output_path.read_text().splitlines()]


def format_prd_result(case_id: str, period: str, *, annual_snap_value: float | int | str) -> dict[str, Any]:
def format_prd_result(case_id: str, period: str, *, annual_snap_value: float | str) -> dict[str, Any]:
annual = Decimal(str(annual_snap_value))
monthly = annual / Decimal("12")
monthly = annual / Decimal(12)
return {
"caseId": case_id,
"period": period,
Expand Down Expand Up @@ -149,7 +149,7 @@ def _parse_ages(value: Any) -> list[int]:


def _annualize(monthly: Decimal) -> Decimal:
return monthly * Decimal("12")
return monthly * Decimal(12)


def _decimal_string(value: Decimal) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,13 @@ def _expected_eligibility(fixture: dict[str, Any], assertions: list[SourceAssert
return False
gross_limit = _decimal(values.get("bbce_gross_limit_percent_fpl"))
if gross_limit is not None:
return gross_limit >= Decimal("165")
return gross_limit >= Decimal(165)
if fixture_class == "gross_130_above":
if values.get("bbce_status") is False:
return False
gross_limit = _decimal(values.get("bbce_gross_limit_percent_fpl"))
if gross_limit is not None:
return gross_limit > Decimal("130")
return gross_limit > Decimal(130)
if fixture_class == "gross_130_below":
return True
return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from decimal import Decimal

import pytest

from snap_divergence.policyengine_runner import (
PolicyEngineUnavailable,
build_policyengine_situation,
Expand Down
Loading