From 5a4844dd3427a57115bd7f43e213a29361fba9a3 Mon Sep 17 00:00:00 2001 From: Michel Tomas Date: Sun, 6 Sep 2026 02:08:25 +0200 Subject: [PATCH] docs(adapter-utils): state what the header scanner's fixpoint rests on The growth loop settles because the placeholder carries no byte that stops a scan: no quote, no backslash, no whitespace, no backtick, no metacharacter. Every caller passes `***REDACTED***`, so the assumption holds today, but it is an assumption about a parameter and it belongs next to the loop that depends on it. Claude-Session: https://claude.ai/code/session_01RYigf3eMFJjey9iKRApPGE --- packages/adapter-utils/src/command-redaction.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/adapter-utils/src/command-redaction.ts b/packages/adapter-utils/src/command-redaction.ts index 0ac15a43eb..f89850d5f7 100644 --- a/packages/adapter-utils/src/command-redaction.ts +++ b/packages/adapter-utils/src/command-redaction.ts @@ -700,6 +700,12 @@ function redactCommandSecretHeaders( // a scan would consume makes one pass settle, which the caller's chain // requires. Each round starts where the last stopped and the rounds cover // disjoint text, so the loop stays linear. + // + // This rests on `redactedValue` carrying no quote, backslash, whitespace, + // backtick or shell metacharacter, which is what makes a scan cross it + // rather than stop inside it. Every caller passes `***REDACTED***`. A + // placeholder holding any of those bytes would stop one reading and not + // another, and the rule's output could move on a second pass. for (;;) { let grown: number = best.end; const consider = (candidate: number) => {