quality-rails: narrow the definition-digest audit claim + logic-change-without-version-bump guard (review 188 finding) #1309

Open
opened 2026-08-18 18:16:06 +00:00 by fargo · 0 comments
Collaborator

Digest claim narrower than the property — narrow the wording + add a logic-change/version-bump guard

From fred's review 188 on PR #1308 (RI-3-002), reproduced with a discriminating control:

  • Measured: a pure logic edit in a check definition (missing.length > 0> 99) leaves the definition digest UNCHANGED (cbec4d909bf9837e → cbec4d909bf9837e), while a spec edit (params file list) moves it (→ 24d1ec916db13b82). The tests catch the logic change (6 failed) — safety holds — but two runs recording the same digest did not necessarily run the same check, and version is hand-maintained so nothing forces it to move.
  • digest.ts:24-30 marks the exclusion deliberate — design choice, not defect.
  • The failing sentence: the current wording implies definition changes are observable via digest; only SPEC changes are.

Fix (fred's preferred shape, adopted)

  1. Narrow the audit wording: digest "identifies the declared definition content; does not cover the check implementation."
  2. Add a test that fails when a definition's logic changes without a version bump (guards the hand-maintained version field).
  3. Do NOT digest function source — source digests go noisy across formatters/transpilers; a clean property beats a flaky one.

Same family as the week's recurring finding: the measurement is right and the sentence it produces is wider than the measurement.

## Digest claim narrower than the property — narrow the wording + add a logic-change/version-bump guard From fred's review 188 on PR #1308 (RI-3-002), reproduced with a discriminating control: - **Measured:** a pure logic edit in a check definition (`missing.length > 0` → `> 99`) leaves the definition digest **UNCHANGED** (cbec4d909bf9837e → cbec4d909bf9837e), while a spec edit (params file list) moves it (→ 24d1ec916db13b82). The tests catch the logic change (6 failed) — safety holds — but two runs recording the same digest did not necessarily run the same check, and `version` is hand-maintained so nothing forces it to move. - `digest.ts:24-30` marks the exclusion deliberate — design choice, not defect. - **The failing sentence:** the current wording implies definition changes are observable via digest; only SPEC changes are. ### Fix (fred's preferred shape, adopted) 1. Narrow the audit wording: digest "identifies the declared definition content; does not cover the check implementation." 2. Add a test that fails when a definition's logic changes without a version bump (guards the hand-maintained `version` field). 3. Do NOT digest function source — source digests go noisy across formatters/transpilers; a clean property beats a flaky one. Same family as the week's recurring finding: the measurement is right and the sentence it produces is wider than the measurement.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#1309