Repository navigation
Publish only the person entity as is_person - #765
Draft
vahid-ahmadi wants to merge 1 commit into
Draft
vahid-ahmadi wants to merge 1 commit into
vahid-ahmadi wants to merge 1 commit into
Conversation
policyengine-core flags any root population with no members as is_person.
policyengine-uk's new firm entity is one, so the model version published
two person entities (person and firm), which breaks the "exactly one person
entity" contract in the API catalog and misroutes firm inputs in the app.
Derive is_person by comparing each entity's key with the key of the first
is_person entity (core's own person_entity rule). Keys, not identity: a
cloned core system copies its person entity.
Tests: a fake-system regression test with a trailing firm entity, the
country-model check now uses the person_entity key rule, and the UK pin
accepts an optional trailing ("firm", "firms", False) row so the tests pass
on both the pinned policyengine-uk 2.177.7 and the firm release.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 23, 2026
Draft
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #764
policyengine-core flags any root population with no members as
is_person. policyengine-uk's newfirmentity (PolicyEngine/policyengine-uk#2940) is one, so the model version would publish two person entities. That failstest_model_entities.py, which blocks UK release certification. It also breaks the API catalog's "exactly one person entity" check and makes the app offer firm inputs as person variables._populate_entitiesnow setsis_persononly for the entity whose key matches the firstis_personentity, which is core'sperson_entityrule. It compares keys rather than identity because cloned systems copy the person entity. The tests add a fake-system regression and use the key rule for the country check. The UK pin accepts an optional trailing("firm", "firms", False)row, so they pass on both the pinned policyengine-uk 2.177.7 and the firm release.🤖 Generated with Claude Code