Repository navigation
rebuild: cli: a sign-in step's message redacts every value of the block's environment from the provider's error - #1684
Merged
odgrim merged 1 commit intoDec 2, 2026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
odgrim
force-pushed
the
rebuild/p6-classb-fix-env-redact
branch
from
December 2, 2026 01:47
fc74cd6 to
8c33677
Compare
…ck's environment from the provider's error Review of #1665 (f6db26f). Change - packages/cli/src/testRun.ts: credentialFailure, the one place a credential error becomes step text (a Failed block's CredentialError in endedAs, a SignedOut block's lastError in noLogin's skip, and the refused-confirm fail of #1675), now runs it through redactSecrets with every value of the environment the block's run reads. A provider error that quotes a token it read from the environment printed it in text, json, junit and --output-file; it now shows [REDACTED]. - That environment is the test case's env on top of the one runbooks test started with. openInProcess merges it once, gives it to the engine, and returns it on CaseSession (`environment`). runCase puts it on Session, and every endedAs, readiness, credentialEnded and noLogin call passes it. The other two openers return theirs: baseline/step3Fixtures.test.ts the environment it starts runbooks mcp with, testRun.test.ts's stub {}. - credentialFailure's comment said the client "has taken out of it each secret it knows". It now says what the code does: the client scrubs only the secrets it was handed, and the runner redacts every value of the block's environment. - packages/core/src/domain/vcs/redact.ts: redactSecrets takes `values` besides the registered ones, each at least MIN_SECRET_LENGTH (8) long, and replaces the longest first. MIN_SECRET_LENGTH is exported, and plugin.ts's client reads it in place of its own MIN_SCANNED_SECRET, also 8, so the client and the runner share one threshold. - docs testing.mdx, Testing sign-in blocks: a step's message that quotes a sign-in block's error never prints a value 8 characters or longer from the test's environment, and shows [REDACTED] in its place. - testCommand.test.ts: a provider whose error quotes a value of the block's environment (the fake's `refuse`): SignedOut skip, Failed (toolMissing in Detecting), the refused-confirm fail, and a value only the process environment holds. Each runs text with --verbose, json, junit and junit to --output-file: every report holds [REDACTED] and not the value, stderr not the value, and the json message is exact. A boundary test: an 8-character value goes, a 7-character one stays, and a value another one starts with does not leave the longer one's tail. Decisions 1. Values of the process environment are redacted too, as the brief asks, so a credential error that quotes a path under HOME, PWD or TMPDIR, or SHELL, shows [REDACTED] there. Reverting it is the M4 line below. 2. The threshold is one constant: plugin.ts now imports MIN_SECRET_LENGTH from redact.ts instead of keeping MIN_SCANNED_SECRET, so "the same threshold the client uses" cannot drift. Same value, no behaviour change in the client. 3. Longest first is not in the brief. Without it, an 8-character value that starts a longer secret is replaced first and the secret's tail is printed (M5). It applies to redactSecrets' registered values as well. 4. Only credential error text is redacted, as the brief scopes it. A task's message, a step's log and assertion messages are not: a path in a Command's failure would lose its HOME prefix for no leak shown. 5. The docs sentence says "a step's message that quotes a sign-in block's error", not every step message, since that is what the code promises. Gaps 1. The words are redactSecrets' "[REDACTED]". testRun.ts writes "<redacted>" for a sensitive output and a secret a condition reads, so a report can hold both spellings. Index row at the next index commit. 2. The app window and runbooks mcp still show a provider's error as the client passes it. They are not CI logs; not in this brief. Index row at the next index commit. Evidence - Reproduction, red before the fix (the new tests, testRun.ts as at 48dfc94; fake values): Expected: "...accessDenied: The token [REDACTED] is not one the cloud knows." Received: "...accessDenied: The token fake-secret-0042 is not one the cloud knows." and the same for toolMissing, the refused-confirm "The key fake-key-0001 was revoked." and the boundary test: 5 fail (bun test -t environment; its sixth match, an existing env_prefix test, passed). After: they pass. - Mutants (bun test packages/cli/src/testCommand.test.ts packages/cli/src/testRun.test.ts; control 85 pass, 0 fail): M1 redaction removed (credentialFailure unredacted): 80 pass, 5 fail M2a MIN_SECRET_LENGTH 9: 84 pass, 1 fail M2b MIN_SECRET_LENGTH 7: 84 pass, 1 fail M3 test env not included (CaseSession environment: options.env): 81 pass, 4 fail M4 process env not included (CaseSession environment: env): 84 pass, 1 fail M5 not longest first (no sort): 84 pass, 1 fail - bun test packages/cli packages/core scripts baseline blocks: 4570 pass, 0 fail, no error line - RUNBOOKS_FAKE_CREDENTIALS=1 bun packages/cli/src/main.ts test blocks/{azure,aws,google,git}-auth/testdata/...: "Results: 30 passed, 0 failed, 0 skipped" - bun run lint: exit 0; bun run fmt:check: "All matched files use the correct format."; bun run knip: exit 0; bun check: "No type errors in 2,103 files across 23 projects" - cd docs && bunx --bun cspell@10.4.0 --no-progress src/content/docs/authoring/testing.mdx: "Files checked: 1, Issues found: 0 in 0 files."
odgrim
force-pushed
the
rebuild/p6-classb-fix-env-redact
branch
from
December 2, 2026 02:03
8c33677 to
85df722
Compare
odgrim
marked this pull request as ready for review
December 2, 2026 02:22
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack: rebuild phase 6, in GitHub stack #1632, rows class B skips, part 39 of 39: a sign-in step's message redacts every value of the block's environment from the provider's error (review of #1635 and #1665). Base: #1679. Map:
.more9s/rebuild.mdonrebuild/main.268 changed lines, 150 of them tests and test runbooks.
Change
Review of #1665 (f6db26f).
environment). runCase puts it on Session, and every endedAs, readiness, credentialEnded and noLogin call passes it. The other two openers return theirs: baseline/step3Fixtures.test.ts the environment it starts runbooks mcp with, testRun.test.ts's stub {}.valuesbesides the registered ones, each at least MIN_SECRET_LENGTH (8) long, and replaces the longest first. MIN_SECRET_LENGTH is exported, and plugin.ts's client reads it in place of its own MIN_SCANNED_SECRET, also 8, so the client and the runner share one threshold.refuse): SignedOut skip, Failed (toolMissing in Detecting), the refused-confirm fail, and a value only the process environment holds. Each runs text with --verbose, json, junit and junit to --output-file: every report holds [REDACTED] and not the value, stderr not the value, and the json message is exact. A boundary test: an 8-character value goes, a 7-character one stays, and a value another one starts with does not leave the longer one's tail.Decisions
Gaps
Evidence
Local, in a scratch worktree with a scratch HOME. CI's run on this head is the gate.