Skip to content
Merged
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 changelog.d/be-post18-enrolment-bindings.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bind Brussels' and Flanders' post-18 education flags to `fact:person.education_enrollment` in the `axiom:be` concept mapping (PR 4a-2). `brussels_family_benefits_child_in_qualifying_education_training_or_stage` (ordinance article 25 §2(b)) and `flanders_family_benefits_child_is_pupil_student_intern_or_school_leaver` (Groeipakket decree article 8 §2 item 3) each gain a `person_role` predicate binding over the six enrolled ISCED bands, in the scheme's eligibility module and in the routing bridge, as Wallonia's and the German-speaking Community's flags already have. Belgium's input closure moves from 35 encoded and 242 defaulted `Child` roots to 39 and 238. Six defaulted flags, 12 roots counting each flag's scheme module and the routing bridge, keep their values and get new reasons. Flanders' month-turning-25 default now ends an enrolled child's window at the age the frame reports. Three exclusion flags now say whom the default overstates entitlement for: holders of a study, training, volunteer or au-pair stay, or children raised or taught abroad, whom no saving clause or exemption covers, under 18 and now also enrolled ones aged 18 to 24. Brussels' apprentice and thesis defaults now miss only apprentices and thesis writers aged 18 to 24 whom the enrolment fact doesn't count. A new test checks that all four regions' post-18 education flags read the same enrolment predicate. The concept-coverage report and the Belgian spec golden are regenerated, and `docs/concept-schema-transport-adr.md` now counts Belgium's 39 `person_role` bindings as executed rather than deferred. No node runs these modules yet.
18 changes: 9 additions & 9 deletions docs/concept-coverage/axiom-be.md

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions docs/concept-schema-transport-adr.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,14 @@ These hold for every input and are tested (Hypothesis properties unless noted):
Longer cycles and other inconsistent relationships still fail validation.
- The consuming builder supplies the destination frame declaration after
transport. New Zealand's group bindings now execute on benefit units built
from the concept pointers. Belgium's group bindings (46 of its 105 module
bindings), and the take-up and housing bindings on US and UK group entities,
still wait for a step that builds those engines' units from the pointers, so
they stay deferred. Transport also still needs a country pack with
geography, targets and an engine adapter. The schema was the one piece that
belongs in the core from the start.
from the concept pointers. Belgium's 39 `person_role` bindings on `Child`
need no units: `encode` runs them on the person table
(`ConceptMapping.is_executable`). Belgium's 11 other group bindings (of
its 109 module bindings), and the take-up and housing bindings on US and UK
group entities, still wait for a step that builds those engines' units from
the pointers, so they stay deferred. Transport also still needs a country
pack with geography, targets and an engine adapter. The schema was the one
piece that belongs in the core from the start.
- Open questions this does not settle: whether take-up propensities persist or
are chosen at simulation time (#360), and how the Belgian population-input
boundary treats `takes_up_*` names (#824). The Axiom concept-coverage
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
family-benefit modules whose programs run on the engine entity ``Child``, and
``build/be/axiom_input_closure.json`` decides how each of their 277 ``Child``
root inputs is fed: a ``person_role`` binding of the ``axiom:be`` concept
mapping encodes 35, and the other 242 take a default with a reason and a
mapping encodes 39, and the other 238 take a default with a reason and a
citation. No frame entity maps to ``Child``, so each binding declares a
binding-local view on it (``docs/transport-declared-units.md``).

Expand Down Expand Up @@ -32,8 +32,8 @@
)
from microcosm.frame.adapters.axiom import BE_SCHEMA, axiom_concept_mapping
from microcosm.frame.adapters.axiom_input_surface import load_axiom_input_surface
from microcosm.frame.concept_mapping import GroupRule
from microcosm.frame.concepts import ContentBasis
from microcosm.frame.concept_mapping import GroupRule, Predicate
from microcosm.frame.concepts import AlignmentRelation, ContentBasis
from microcosm.frame.input_closure import ClosureClass, EncodedBy, InputClosure
from test_support.paths import paths_for

Expand All @@ -48,22 +48,22 @@
LOGICAL_ENTITY = "Child"
MODULES = 12
ROOTS = 277
ENCODED = 35
DEFAULTED = 242
ENCODED = 39
DEFAULTED = 238
#: Roots, encoded and defaulted per module, in rulespec_path order.
PER_MODULE = {
"be-bru/statutes/family_benefits/basic_amounts.yaml": (3, 2, 1),
"be-bru/statutes/family_benefits/eligibility.yaml": (19, 4, 15),
"be-bru/statutes/family_benefits/eligibility.yaml": (19, 5, 14),
"be-bru/statutes/family_benefits/selected_amount.yaml": (8, 3, 5),
"be-bru/statutes/family_benefits/social_supplements.yaml": (5, 1, 4),
"be-dg/statutes/family_benefits/amounts.yaml": (12, 0, 12),
"be-dg/statutes/family_benefits/eligibility.yaml": (31, 2, 29),
"be-vlg/statutes/family_benefits/amounts.yaml": (7, 1, 6),
"be-vlg/statutes/family_benefits/eligibility.yaml": (23, 2, 21),
"be-vlg/statutes/family_benefits/eligibility.yaml": (23, 3, 20),
"be-wal/statutes/family_benefits/amounts.yaml": (11, 2, 9),
"be-wal/statutes/family_benefits/eligibility.yaml": (33, 4, 29),
"be/statutes/family_benefits/lgaf_amounts.yaml": (18, 2, 16),
"be/statutes/family_benefits/regional_routing.yaml": (107, 12, 95),
"be/statutes/family_benefits/regional_routing.yaml": (107, 14, 93),
}

#: Each binding's module, the selector column of its Child view, and the
Expand Down Expand Up @@ -395,6 +395,53 @@ def test_the_mapping_encodes_the_rest_by_person_role(self) -> None:
assert encoded == bound
assert len(encoded) == ENCODED

def test_the_post_18_education_flags_read_one_enrolment_predicate(self) -> None:
# Each scheme extends entitlement past 18 for a child in education
# (Brussels article 25, Flanders article 8 section 2 item 3, the
# German-speaking Community and Wallonia). Each flag is bound in its
# scheme's eligibility module and in the routing bridge, which imports
# that module, and every binding counts the same enrolled bands.
flags = {
"brussels_family_benefits_child_in_qualifying_education_training_or_stage": "be-bru",
"flanders_family_benefits_child_is_pupil_student_intern_or_school_leaver": "be-vlg",
"german_speaking_community_family_benefits_child_in_training": "be-dg",
"wallonia_family_benefits_child_in_qualifying_courses_or_stage": "be-wal",
}
enrolment = "fact:person.education_enrollment"
enrolled = (
"early_childhood",
"primary",
"lower_secondary",
"upper_secondary",
"post_secondary_non_tertiary",
"tertiary",
)
bindings = [
binding for binding in MAPPING.bindings if binding.engine_input in flags
]
assert sorted((b.engine_input, b.module) for b in bindings) == sorted(
(name, module)
for name, unit in flags.items()
for module in (
f"{unit}/statutes/family_benefits/eligibility.yaml",
"be/statutes/family_benefits/regional_routing.yaml",
)
)
for binding in bindings:
assert binding.engine_entity == LOGICAL_ENTITY
assert binding.group_rule is GroupRule.PERSON_ROLE
assert binding.relation is AlignmentRelation.APPROXIMATE
assert binding.concepts == (enrolment,)
assert isinstance(binding.transform, Predicate)
assert binding.transform.clauses == ((enrolment, enrolled),)
closure = InputClosure.from_dict(_closure_payload())
classes = {
(entry.input, entry.closure_class)
for entry in closure.entries
if entry.input in flags
}
assert classes == {(name, ClosureClass.ENCODED) for name in flags}

def test_a_name_keeps_one_default_across_modules(self) -> None:
# The routing module reads the four regional schemes' roots through
# its imports, so one name must not take two values.
Expand Down
4 changes: 2 additions & 2 deletions packages/microcosm-build/tests/golden/be_country_spec.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"country": "be",
"fingerprint": "b67b1c4e9e87184d28b81183af77fc73c2fd0360c40a9b502505dcc73901ac4b",
"fingerprint": "d35397e4071d5eb7b5e293ee17a0847eb18f79ef15cad708365d80416ea8d67b",
"gate_ids": [
"calibration_per_family_fit",
"national_and_nuts1_admin_aggregates",
Expand Down Expand Up @@ -29,7 +29,7 @@
"staging_repo": "policyengine/populace-be-staging"
},
"resource_hashes": {
"axiom_input_closure.json": "b6c507812fc5ed12bb4568b61b9fada6565cc1c6a21e7eb6093eedc6e427313c",
"axiom_input_closure.json": "ea29a2711e05a2699ed365bc3d0d086f8e5f521f232e0f690738be1d0fc2de2e",
"axiom_rules_bindings.json": "0d8c9670cc22761f90fba5df99c27bfea420708dad94926248da7dc1cea3a589",
"chronicle_feed.json": "71f3967cefa12d8ad6c4b955547bfc37e33183ee839b3edf3a43e0cb72559030",
"country_package.json": "204c8c06934160c856d86a9d6c5305d40e9b3a85713c11c3ab031bebb27fbe89",
Expand Down
Loading
Loading