Repository navigation
Conversation
A scenario can now list the dated facts it relies on in metadata.facts: claim, value, valid_from, verified_at, review_by, source_url and source_quote. stale_facts(packs, as_of) returns the facts whose review_by is before as_of. It reads no clock, so the tests use fixed dates. review_by follows the rule's own rhythm: G-derived rates every 1 May, tax rates and the copayment cap every 1 January. A figure fixed in statute has review_by None and is never returned; a missing review_by key is an error, so a misspelt key cannot hide a fact from the check. Filled in for the yearly rates in nav_aap, skatteetaten, helfo and lanekassen, verified 2026-10-07. Like the rest of metadata, the field never reaches the models.
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.
#102 fixed a G value that had been wrong in nav_aap for five months. Nothing in a pack records when a figure was last checked or when it needs checking again, so nothing flagged it.
This adds an optional convention for that. A scenario can list the dated facts it relies on in
metadata.facts, each with its value, source URL and quote, when it was verified, and areview_bydate set by the rule's own rhythm: G every 1 May, tax rates and the copayment cap every 1 January.stale_facts(packs, as_of)returns the facts past theirreview_by.It is opt-in: packs without
factsare untouched. It reads no clock, and the tests use fixed dates, so CI won't turn red on a calendar date. I've filled it in only for our own packs, for the figures that change yearly.Run with
as_ofset to 2 May 2027, it returns the G-derived facts in nav_aap: the check that would have caught the 130 030 typo.Tests: 1368 passed, 17 skipped: the 1350 passed and 17 skipped of the base at
7a0877d, plus the 18 new ones.