Skip to content

Pin the coverage map as single source, and the skip line in full (#1784 closers) - #1796

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/1784-single-source-and-skip-pins
Jul 28, 2026
Merged

erikdarlingdata merged 1 commit into
devfrom
feature/1784-single-source-and-skip-pins

Conversation

@erikdarlingdata

Copy link
Copy Markdown
Owner

Review closers on #1789 / #1793, carried forward after both merged. Tests only — no production behavior changes.

Items 1 and 2 of the closer list (the fixture-isolation leaks and the IsTieredDropSafeAsync membership pre-check) already landed in #1793 and are on dev; these are the two remaining.

1. The coverage map is pinned as the SINGLE SOURCE, not merely as equal

TimescaleSupport.RawTierCoverage is what makes the tiered retention POLICY and the catalog SWEEP unable to judge the same drop differently — that shared derivation is the whole mechanism #1793 relies on. Until now it was structural only.

Re-hardcoding the three rows beside the map produces an identical policy set and passes every behavioural test. It stays green right up until the map gains a fourth tier, or one of the three changes its covering aggregate — at which point the two paths silently disagree about the exact thing the map exists to keep aligned, which is the #1784 defect class reintroduced.

No behavioural test can catch that, because a duplicated list behaves identically. Only reading the construction can. So the guard asserts EnsureRetentionPoliciesAsync builds from RawTierCoverage and names none of the gated relations as literals — the enforce-it-don't-document-it shape, aimed at a green suite over a broken invariant.

The body is located by brace matching, and the test fails rather than passes when the signature is not found — a source guard that silently stops finding its target is a guard that silently stops guarding.

2. The coverage-skip line is pinned in FULL, like its sibling

Retention purge SKIPPED for query_stats: its rollup does not yet cover the oldest rows, so dropping would delete history no aggregate holds. Resumes by itself once a backfill extends coverage.

Its tail is the actionable half. "Resumes by itself once a backfill extends coverage" is what tells the client's operator this state is self-correcting rather than a fault to chase — and a prefix pin covers only the part that names the table.

That is not hypothetical. The prefix-pin class already let a wrong line ship earlier in this same work: every assertion passed while the message named a cause the guard never detected.

Mutations — both watched red against a green baseline

# Mutation Result
1 Re-hardcode the three raw tiers beside the map, exactly as a future edit would RED — Assert.Contains() Failure: Not found: "RawTierCoverage"
2 Delete only the skip line's tail RED — Assert.Contains() Failure: Not found: "Retention purge SKIPPED for query_stats: its rollu…"

Mutation 2 is the instructive one. Its failure output reads String: "Warning: Retention purge SKIPPED for query_stats: …" — the prefix is still fully intact. That is precisely the mutation the old prefix pin would have called green, which is the argument for full-string pinning stated as evidence rather than as principle.

Also fixed: two doc blocks my own inserts stranded

The repo's #1751 stacked-summary guard caught both, and per its own failure text they were fixed by moving the blocks back to their members, not deleting them (DeferralSignature and FindRepoRoot had each been left undocumented).

That is four occurrences across this file family tonight, all one mistake: inserting a new member immediately BEFORE an existing signature separates that member from its doc comment. The fix is to insert after the preceding member's closing brace. Recording it because the rate says it is a property of how these files are edited, not a one-off — and the guard caught every one, including one separated by a blank line that a naive adjacency check misses (the guard's regex allows intervening whitespace; mine initially did not).

Verification

  • -t:Rebuild -c Debug, 0 Warning(s) 0 Error(s) on Darling.Tests.
  • Full suite against live PostgreSQL 18.4 + TimescaleDB 2.28.1, run twice against the same database to prove no fixture residue: 3,666 passed / 0 failed / 8 skipped both times.
  • Diff is two test files plus the CHANGELOG.

Generated with Claude Code

…1784)

Two review closers, tests only.

1. The raw-tier retention policies are pinned as DERIVED from RawTierCoverage
rather than merely equal to it. The map is what keeps the tiered policy and the
catalog sweep from judging the same drop differently, and that derivation was
structural only: re-hardcoding the three rows beside the map yields an identical
policy set and stays green until the map gains a tier or changes a covering
aggregate, at which point the two paths disagree silently about the one thing
the map exists to align. A behavioural test cannot catch it -- a duplicated list
behaves identically -- so the guard reads the construction.

2. The coverage-skip line is pinned in FULL, like its dimension-GC sibling. Its
tail is the actionable half: 'resumes by itself once a backfill extends
coverage' is what tells an operator this is self-correcting rather than a fault
to chase. The prefix-pin class already let a wrong line ship in this work.

Both watched red. The skip mutation is the instructive one: deleting only the
tail leaves the prefix intact in the failure output, so the OLD pin would have
called that mutation green.

Also fixes two doc blocks my own inserts stranded. That is four occurrences in
this file family tonight, all one mistake: inserting a new member immediately
BEFORE an existing signature separates that member from its doc comment. Insert
after the preceding member's closing brace instead.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@erikdarlingdata
erikdarlingdata merged commit 0e101e3 into dev Jul 28, 2026
4 checks passed
@erikdarlingdata
erikdarlingdata deleted the feature/1784-single-source-and-skip-pins branch July 28, 2026 05:53
erikdarlingdata added a commit that referenced this pull request Jul 28, 2026
dev's #1796/8f3c950c touches CHANGELOG.md and two PayloadDimension test
files only -- zero production code, verified before resolving. Conflict was
CHANGELOG.md alone; resolved keep-both with dev's ordering untouched. Both
sides verified present: dev's #1796/#1784 entry and link-refs, and this
branch's #1779 entry, capped-rule sentence, and #1778/#1779 link-refs.
Branch scope against dev is unchanged at the same five files.
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