Skip to content

plan(signal-store): name the right function, and note the guard it appeased#229

Merged
frapercan merged 1 commit into
mainfrom
fix/lafa-default-fields-name
Jul 10, 2026
Merged

plan(signal-store): name the right function, and note the guard it appeased#229
frapercan merged 1 commit into
mainfrom
fix/lafa-default-fields-name

Conversation

@frapercan

Copy link
Copy Markdown
Owner

Follow-up to #228, correcting two things I got wrong there. Both were caught by the subagent writing ADR-D45 and then verified against the code.

1. Wrong function name

#228 attributed the zero-fill to _leaf_record_builder._reranker_default_fields(). That method exists (line 34) but does something else. The six LAFA scalars are filled by _lafa_default_fields() (line 342).

2. The correction makes the argument stronger, not weaker

_reranker_default_fields() is precisely the method that gets it right:

"""KNN reranker-feature block for a non-KNN row (InterPro-only / classifier).

Distances / ranks are NaN (no KNN evidence). The two genuine zero-counts
stay 0: zero KNN neighbours voted, a true absence rather than a missing
measurement.
"""

So the codebase already draws the distinction that D45 needs, twenty lines above the method that violates it. Fixing D45 means applying the file's own convention to the LAFA families, not importing a new one.

And _lafa_default_fields() states its own purpose: the six are emitted unconditionally so that _assert_canonical_columns and the contracts producer-coverage guard never fail the dump. The guard whose job is to catch a missing producer was appeased with a constant. That is the seam, in one sentence.

Also noted

The D45 ADR was not missing, contrary to task #35 as I wrote it: docs/source/adr/D45-jsonb-blob-feature-governance.rst has existed since 2026-06-22, carrying a mis-stated value-skew framing. It is corrected in place by PROTEA #708, not duplicated.

…peased

The method that zero-fills the six LAFA scalars is _lafa_default_fields()
at line 342, not _reranker_default_fields() at line 34. The latter is a
different method, and it is the one that behaves correctly: it writes NaN
for a missing KNN measurement and 0 only for a true absence, and says so.
The right convention already lives twenty lines above the violation.

The zero-fill docstring also states its purpose: to keep
_assert_canonical_columns and the contracts producer-coverage guard from
failing the dump. The guard meant to catch a missing producer was
satisfied by a constant.
@frapercan frapercan merged commit fef5173 into main Jul 10, 2026
7 checks passed
@frapercan frapercan deleted the fix/lafa-default-fields-name branch July 10, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant