Skip to content

Commit 44e3fe7

Browse files
committed
refactor(spec): one finding per situation in the container-coverage report (#4956)
A coordinate that is BOTH double-declared and gone was reporting twice — as a stale row and as a contradiction. The single fix is to delete the row(s), and a second heading about a coordinate that no longer exists obscures it. Same rule orphans.mts already follows for its one deliberately-silent case. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ehu85kbvMcrNTUJjwxvLJ9
1 parent a78d7da commit 44e3fe7

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/spec/scripts/liveness/drill.mts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,22 @@ export function reconcileContainerCoverage({
153153
const brokenDeferrals: string[] = [];
154154
let deferredChildKeys = 0;
155155
for (const { container, to } of deferred) {
156+
const here = seen.get(container);
157+
// Already reported as stale. Say nothing more about it — including the
158+
// both-lists contradiction below — because the single fix is to delete the
159+
// row(s), and a second heading about a coordinate that no longer exists
160+
// would obscure it (the `orphans.mts` rule, same reasoning).
161+
if (!here) continue;
156162
// Declared in BOTH lists — "classified nowhere" AND "classified at `to`"
157163
// cannot both be true, and whichever the gate silently preferred would
158-
// decide whether the keys count as a gap. Refuse instead of picking.
164+
// decide whether these keys count as a gap. Refuse instead of picking.
159165
if (recorded.has(container)) {
160166
brokenDeferrals.push(
161167
`${container} is declared in BOTH lists — 'containers' says its child keys are classified nowhere, ` +
162168
`'deferred' says they are classified at '${to}'. Delete whichever is wrong.`,
163169
);
164170
continue;
165171
}
166-
const here = seen.get(container);
167-
if (!here) continue; // already reported as stale
168172
const target = classifiedKeysAt(to);
169173
if (!target) {
170174
brokenDeferrals.push(

packages/spec/scripts/liveness/drill.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,18 @@ describe('reconcileContainerCoverage — deferrals are resolved, never believed'
200200
expect(r.deferredChildKeys).toBe(0);
201201
});
202202

203-
it('reports a stale coordinate once even when both lists name it', () => {
203+
it('reports a gone-and-double-declared coordinate ONLY as stale', () => {
204+
// Both rows are wrong, but the single fix is to delete them, and a second
205+
// heading about a coordinate that no longer exists would obscure that —
206+
// the same "do not report it twice" rule orphans.mts follows.
204207
const r = reconcileContainerCoverage({
205208
observed: [],
206209
baseline: ['object/fields'],
207210
deferred: [{ container: 'object/fields', to: 'field' }],
208211
classifiedKeysAt: resolver,
209212
});
210213
expect(r.stale).toEqual(['object/fields']);
214+
expect(r.brokenDeferrals).toEqual([]);
211215
});
212216

213217
it('reports a deferral for a container that no longer exists as STALE, not broken', () => {

0 commit comments

Comments
 (0)