diff --git a/scripts/check/check-public-creds.mjs b/scripts/check/check-public-creds.mjs index 7e065705d0..62549001bb 100644 --- a/scripts/check/check-public-creds.mjs +++ b/scripts/check/check-public-creds.mjs @@ -90,14 +90,18 @@ const ENV_KEY_RE = /(clientId|clientSecret|apiKey)Env\s*:/; // The MiniMax family was extracted from services/usage.ts into services/usage/minimax.ts // (god-file decomposition), so the FP moved with the getMiniMaxUsage signature. // -// open-sse/executors/zcodeProtocol.ts L302: `clientId: \`omniroute-${process.pid}\`` +// open-sse/executors/zcodeProtocol.ts L313: `clientId: \`omniroute-${process.pid}\`` // is the per-process identifier in the local ZCode app-server handshake. It is // generated from the process PID, is not an upstream OAuth/client credential, and // must remain visible in the wire contract. Frozen by file:line:value key. +// NOTE: the key includes the LINE, so any edit that shifts this statement breaks +// the gate twice over — a stale-entry error plus a "new violation" for the same +// literal. That is what happened here (L302 -> L313). Re-point the line; do not +// remove the entry. export const KNOWN_LITERAL_CREDS = new Set([ "open-sse/services/usage/minimax.ts:213:minimax", // TODO(6A.8): pre-existing FP — TS fn-param type, not a credential (getMiniMaxUsage signature) "open-sse/services/usage/minimax.ts:213:minimax-cn", // TODO(6A.8): pre-existing FP — TS fn-param type, not a credential (getMiniMaxUsage signature) - "open-sse/executors/zcodeProtocol.ts:302:omniroute-${process.pid}", // local per-process ZCode handshake ID, not an upstream credential + "open-sse/executors/zcodeProtocol.ts:313:omniroute-${process.pid}", // local per-process ZCode handshake ID, not an upstream credential ]); /** diff --git a/tests/unit/check-public-creds.test.ts b/tests/unit/check-public-creds.test.ts index 5531c5d336..b726218495 100644 --- a/tests/unit/check-public-creds.test.ts +++ b/tests/unit/check-public-creds.test.ts @@ -68,7 +68,10 @@ test("allowlist freezes a literal by file:line:value key", () => { }); test("allowlist preserves the local ZCode handshake client ID without weakening credential detection", () => { - const src = `${"\n".repeat(301)}clientId: \`omniroute-\${process.pid}\`,`; + // 312 newlines puts the statement on line 313, which is where it lives in + // zcodeProtocol.ts today. The allowlist key carries the line number, so this + // literal has to be kept in step with the source (it moved 302 -> 313). + const src = `${"\n".repeat(312)}clientId: \`omniroute-\${process.pid}\`,`; assert.deepEqual( findLiteralCreds(src, KNOWN_LITERAL_CREDS, "open-sse/executors/zcodeProtocol.ts"), []