An access table whose denominators could hold fewer records than the file - #28
Merged
Merged
Conversation
ChelseaKR
changed the base branch from
fix/yearbuilt-zero-is-not-a-year
to
main
August 29, 2026 00:15
ChelseaKR
force-pushed
the
fix/by-access-accounts-for-every-record
branch
from
August 29, 2026 00:29
f4ffcde to
68f26ce
Compare
… the file
completeness_by_access reports each DINS field twice, over records with a damage
assessment and over records recorded as Inaccessible. Both populations are read
off DAMAGE, and access_field_coverages built its two denominators from the two
populations that answer, so a record whose DAMAGE is blank or holds a marker
answered neither question and left the table without appearing anywhere in it.
Measured against the pre-change code over four records, one assessed, one
inaccessible, one with a blank damage field and one holding a marker:
records handed to the access table: 4
assessed_total : 1
inaccessible_total : 1
sum of denominators: 2
records in no column: 2
Nothing published said which two were missing or that any were.
No record in the acquired file is in that state, which is why this held. access_split
has counted damage_not_recorded and damage_explicit_unknown since it was written,
precisely so a record like that would be reported rather than folded into the
assessed population, and both are 0 in the 2026-08-07 retrieval. Every denominator
happened to be complete. The table could not have said so and would not have said
otherwise, which is the same shape as the coverage exclusion in ADR-0004 and the
audit gate in ADR-0006: a measurement over a set that excluded part of what it
should have included, with the exclusion invisible and the check around it green
because the excluded part was empty on the day.
AccessFieldCoverage now carries a third population, derived by subtraction from
the records handed in rather than by a third predicate, so the three partition the
input by construction and a damage state nobody anticipated cannot fall between
them. counted_records is the sum, asserted equal to the record count in the code,
in the built artifact, and in the committed site/. The artifact publishes
undetermined_present, undetermined_total and undetermined_tenths_pct per field.
The page states what its two columns are counted over and what is in neither, in
both cases. On this retrieval it reads: "The two columns are counted over 131,931
assessed records and 591 recorded as Inaccessible, which between them is every
record in this file." Saying that in words is the part whose absence made this
invisible.
Measured on this tree. Against the pre-change source, all seven new tests fail,
including KeyError: 'undetermined_total' on the committed artifact, and the
existing access tests pass unchanged. After, make verify exits 0: 588 tests, 100%
branch coverage, determinism byte-identical.
See ADR-0007.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The rebase conflict in site/dins.html was resolved by taking one side, which is not a resolution for a generated file. This is make site's output from data/raw/, so the committed HTML now matches its source rather than a merge of two independently generated copies.
The rebase conflict in this function was resolved by keeping both sides, which is right for a changelog and wrong for code. Main's #29 wrapped the table in a focusable <section class="scroll tall" tabindex="0">; this branch still closed it with the older </div>. Emitting both left <main> unclosed and produced four stray end tags, which make htmlvalidate caught: the generated page was invalid in a way no diff of the template would show. Keeps main's </section> close, drops the orphaned </div> tail, and keeps this branch's {access_note}. site/dins.html regenerated from data/raw/ rather than hand-edited.
ChelseaKR
force-pushed
the
fix/by-access-accounts-for-every-record
branch
from
August 29, 2026 16:45
68f26ce to
ae68f48
Compare
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.
Adds ADR-0007. Stacked on #27; base is
fix/yearbuilt-zero-is-not-a-year.Not from an issue. Found while reading
coverage.pyfor #23, and it is the same defect shape as ADR-0004's coverage exclusion and #24's audit gate: a measurement computed over a set that excluded part of what it should have included, where the exclusion is invisible in the output and the check around it is green because the excluded part is empty on the day.What was wrong
completeness_by_accessreports each DINS field twice: over records with a damage assessment, and over records recorded asInaccessible. Both populations are read offDAMAGE, andaccess_field_coveragesbuilt its two denominators from the two populations that answer. A record whoseDAMAGEis blank or holds a marker answers neither, so it left the table without appearing anywhere in it.Measured against the pre-change code over four records, one assessed, one inaccessible, one with a blank damage field, one holding a marker:
Nothing published said which two records were missing, or that any were.
Why it was invisible
No record in the acquired file is in that state.
access_splithas counteddamage_not_recordedanddamage_explicit_unknownsince it was written, precisely so a record like that would be reported rather than folded into the assessed population, andtests/test_measurements.pyhas a test for each. Both are0in the 2026-08-07 retrieval.So every denominator happened to be complete. The table could not have said so, and would not have said otherwise.
The fix
AccessFieldCoveragecarries a third population, derived by subtraction from the records handed in rather than by a third predicate, so the three partition the input by construction and a damage state nobody anticipated cannot fall between them.counted_recordsis the sum, asserted equal to the record count in the code, in the built artifact, and in the committedsite/.The artifact publishes
undetermined_present,undetermined_totalandundetermined_tenths_pctper field. The page states what its two columns are counted over and what is in neither, in both cases. On this retrieval:Saying that in words is the part whose absence made this invisible. Two of three populations are shown rather than three: a permanently empty pair of columns reads worse than a sentence, and the counts are in the artifact either way.
Proof each new check can fail
All seven new tests, run against the pre-change source with the new tests in place:
with, on the committed artifact:
The sentence branch that names a non-empty third population is unreachable from any file this project has, so it is exercised directly with
dataclasses.replace, the waytest_the_damage_table_labels_the_two_non_value_statesalready does for the two damage states that never occur.Positive controls, passing identically before and after:
test_completeness_is_reported_separately_for_the_two_populations,test_inaccessible_is_a_recorded_value_kept_apart_from_assessed, andtest_damage_helpers_agree_with_the_split(3 passed in the pre-change run).Gate output
Exit code read from
$?.Scope, stated plainly
ADR-0007 says what this does not do.
field_coveragealready counts every record it is handed and is now asserted to (#26). The per-incident blocks partition the file, with records attributable to no incident counted separately; those were checked while writing this and were sound. But nothing here stops the next split from being written the way the first one was. The rule is in the record; there is no mechanism that applies it to a split nobody has written yet.🤖 Generated with Claude Code