Skip to content

Commit 5630520

Browse files
committed
fix(pm): declare the stale-finding sweep's empty path population
Wiring `check:pm-stale-finding` into package.json makes this tool a DECLARING family for `dispatch-gates`, and `check:declared-population-live` reds on it: the module-level run fixture's repo slug is the only path-shaped literal in the file, so the derivation read it as a declared population of one path that names no tracked file — the same output a gate with no literals produces. Both halves of the gate's own remedy: the `no-path-population` marker, which is true of this tool (its whole input is the GitHub API), and the fixture moved into the self-test body, where the module-body mask reaches it. Top-level VALUE declarations are deliberately never masked — being unreferenced at module scope is what a declared population IS — so the comment on the moved fixture says ⛔ do not hoist it. `check:declared-population-live`: 250 declaring families with 1 unreachable → 249, all reaching. The sweep's 91-case self-test is unchanged. Claude-Session: https://claude.ai/code/session_01DAcomhvR9kKizeYgg89Vo8 Co-authored-by: Claude <noreply@anthropic.com>
1 parent b1d9043 commit 5630520

1 file changed

Lines changed: 25 additions & 14 deletions

File tree

‎scripts/pm/sweep-stale-finding.mjs‎

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ import {
172172
staleFindingScreen,
173173
} from './check-half-states.mjs';
174174

175+
// dispatch-gates: no-path-population -- this tool reads no file in the tree at all; its whole input is the GitHub API (one label-scoped issue listing per board, plus the per-card label read-back each write verifies itself against), so no card's file surface can predict it and the honest derivation is a repo-wide undetermined one (#16904)
176+
175177
const SELF_PATH = fileURLToPath(import.meta.url);
176178
const API = 'https://api.github.com';
177179
const TOKEN = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN ?? '';
@@ -947,21 +949,30 @@ function fakeBoard({ cards, failOn = null, afterWrite = null }) {
947949
return { rest, calls, state };
948950
}
949951

950-
const OPTIONS = (over = {}) => ({
951-
repo: 'o/r',
952-
repoSource: '--repo',
953-
write: false,
954-
json: false,
955-
cursor: null,
956-
maxCards: DEFAULT_MAX_CARDS,
957-
batchSize: DEFAULT_BATCH_SIZE,
958-
batchPauseMs: 0,
959-
listCap: 25,
960-
provenance: '',
961-
...over,
962-
});
963-
964952
export async function selfTest() {
953+
// The run fixture's option bag. Declared HERE rather than at module level,
954+
// and that placement is load-bearing: `dispatch-gates`'s module-body mask
955+
// blanks self-test BODIES but deliberately never masks top-level VALUE
956+
// declarations — an unreferenced top-level const carrying path literals is
957+
// how a gate DECLARES its population for that scanner. So a fixture repo slug
958+
// spelled at module scope reads as this tool declaring a one-path population
959+
// that names no tracked file, which `check:declared-population-live` reds on
960+
// (measured, the moment `check:pm-stale-finding` made this a declaring
961+
// family). Inside the body it is a fixture again. ⛔ Do not hoist it.
962+
const OPTIONS = (over = {}) => ({
963+
repo: 'o/r',
964+
repoSource: '--repo',
965+
write: false,
966+
json: false,
967+
cursor: null,
968+
maxCards: DEFAULT_MAX_CARDS,
969+
batchSize: DEFAULT_BATCH_SIZE,
970+
batchPauseMs: 0,
971+
listCap: 25,
972+
provenance: '',
973+
...over,
974+
});
975+
965976
const batterySeen = new Map();
966977
let openBattery = null;
967978
const battery = (name) => { openBattery = name; };

0 commit comments

Comments
 (0)