Repository navigation
Conversation
jflowers
left a comment
There was a problem hiding this comment.
Review Council Verdict: APPROVE WITH ADVISORIES
6 of 7 dispatched Divisor reviews completed successfully; 1 (divisor-gaze-testing) failed with a retryable infrastructure error (child_prompt_failed) and cast no vote — test-quality coverage was provided by the host-fallback divisor-testing reviewer (APPROVE). Among the completed reviews: 4 APPROVE WITH ADVISORIES, 2 APPROVE, 0 REQUEST CHANGES.
Consolidated findings: 0 CRITICAL / 0 HIGH / 2 MEDIUM / 3 LOW (5 unique after deduplicating 10 raw findings). All are documentation and process items — no code changes requested. Both MEDIUM findings concur with advisories already acknowledged in the PR description under "Known Issues".
Finding not on the diff
- [MEDIUM]
docs/architecture/extending.md:300-301— the "Key helpers available" contract bullets forrunSubprocess("stdout/stderr capture, output size limiting, and error formatting") andformatStderrSuffix("truncation at 512 bytes") still describe pre-redaction behavior. Extension authors reading this contract won't learn that surfaced stderr is now scrubbed of sensitive inherited env-var values (redactEnvValues,[REDACTED:<VAR>]markers) before truncation, on both surfacing paths. Recommend updating the two bullets to include env-value redaction. (Found by adversary, architect, curator, and guard; concurs with advisory (b) in the PR body.)
Inline findings
Four advisory findings are posted inline on the diff:
| Severity | Location | Summary |
|---|---|---|
| MEDIUM | openspec/changes/redact-env-values-from-adapter-stderr/design.md:40 |
Deliberate stdout-not-scrubbed exclusion unrecorded in Non-Goals |
| LOW | openspec/changes/redact-env-values-from-adapter-stderr/tasks.md:16 |
[P] marker on a compile-dependent task |
| LOW | .gitleaksignore:1 |
Gitleaks suppression rationale missing from proposal Impact list |
| LOW | .gitignore:41 |
Opportunistic housekeeping outside the change's scope |
This review was generated by /uf.review-pr (AI-assisted).
| - Document consumer-side masking mitigations in the CI integration | ||
| guide (second bare-key secret, single-line strict-JSON secret shape) | ||
|
|
||
| ### Non-Goals |
There was a problem hiding this comment.
[MEDIUM] Non-Goals: the stdout-not-scrubbed exclusion is unrecorded (adversary, architect, guard)
The Non-Goals section records the ollama HTTP-path exclusion but not the deliberate decision to leave child stdout unscrubbed. Stdout from runSubprocess flows into the AI report, and from there to CLI stdout and $GITHUB_STEP_SUMMARY — which sits outside GitHub's job-log secret masking.
Not scrubbing stdout is the right engineering call here (verbatim-value replacement would corrupt legitimate report content — workspace paths and long identifiers exceed the 32-byte threshold), but as written the exclusion is indistinguishable from an oversight, and the ci-integration.md known-limits text doesn't scope the scrub to stderr.
Recommendation: add a Non-Goal bullet recording the stdout exclusion with its rationale, plus one known-limits sentence in docs/guides/ci-integration.md noting the scrub covers the two stderr surfacing paths only. Concurs with advisory (a) in the PR body.
| (first name in environ order wins), and replacing longest values | ||
| first. Include the GoDoc note on the post-`Wait()` env-snapshot | ||
| assumption (design D4). | ||
| - [x] 1.2 [P] Add table-driven unit tests for `redactEnvValues` in |
There was a problem hiding this comment.
[LOW] Task 1.2 shouldn't carry the [P] marker (architect)
Task 1.2 (redact_test.go unit tests) compile-depends on task 1.1, which defines redactEnvValues and the threshold constants in redact.go. Per the [P] convention — parallel tasks must touch distinct files and share only already-completed prerequisites — a test task that compile-depends on a preceding implementation task can't actually run in parallel. It's also the only [P] task in phase 1, so the marker is vacuous; task 2.1 (line 44) is likewise a lone [P] in phase 2.
No operational impact (tasks completed sequentially). Recommendation: drop the marker from tasks of this shape in future specs.
| @@ -0,0 +1,2 @@ | |||
| 9c1b472b2bf79dc6c5ce8bae9ea81c2c8417696e:internal/aireport/subprocess_test.go:generic-api-key:107 | |||
There was a problem hiding this comment.
[LOW] Lint-gate change absent from the proposal's Impact list (guard)
The suppression itself checks out as legitimate: both fingerprints target deliberately fake test constants (test-secret-api-key-xyz123, test-secret-straddling-the-truncation-boundary-…) that must be secret-shaped to exercise the redaction paths, and the entries are maximally narrow — commit-pinned, file/rule/line-scoped. This is not a gate weakening.
However, it is a lint-gate behavior change (AGENTS.md Gatekeeping Value Protection, category 4) that doesn't appear in the proposal's Impact list, which states "no CLI, workflow, protocol, or CI configuration changes". Recommendation: document the suppression rationale in the PR description — one sentence: the fake fixtures trigger generic-api-key, suppressed via commit-pinned entries.
| .opencode/package-lock.json | ||
| .opencode/bun.lock | ||
| .opencode/.gitignore | ||
| .opencode/opencode.json |
There was a problem hiding this comment.
[LOW] Opportunistic housekeeping outside the change's scope (guard)
The three new entries — .opencode/opencode.json (line 41), .uf/review-matrix.override.yaml and .uf/progress/ (lines 45-46) — extend existing sections coherently but serve no requirement of this change and aren't in the proposal's Impact list. No functional concern. Recommendation: note them in the PR description or split into a separate chore commit.
…apter stderr Scrub inherited env-var values from every byte of child stderr gaze surfaces. runSubprocess passes the complete stderr buffer through redactEnvValues immediately after cmd.Wait() returns — the single redaction choke point (design D1) — so both the non-zero-exit error embed and the success-path returned bytes carry scrubbed content, and the scrub precedes the 512-byte truncation so a value straddling the boundary cannot survive. A value is redacted when its env-var name contains KEY, TOKEN, SECRET, or CONFIG_CONTENT (case-insensitive) or when its length reaches 32 regardless of name; values below 4 bytes are never replaced (garble guard). Replacements use [REDACTED:<VAR>] markers, dedupe identical values with first-name-wins, and run longest value first. Environ entries split at the first '=' only so values with embedded '=' are captured whole. Implements openspec/changes/redact-env-values-from-adapter-stderr tasks 1.1-1.4.
…ification - docs/guides/ci-integration.md: "Secret hygiene and stderr redaction" subsection (task 2.1) — scrub triggers, [REDACTED:<VAR>] marker format, known limits, second-secret platform masking pattern, single-line strict-JSON secret guidance - docs/guides/ai-reports.md: troubleshooting bullet notes stderr redaction for local adapter runs (task 3.3) - AGENTS.md: Recent Changes entry for the change (task 3.3); website documentation issue filed (unbound-force/website#346) - tasks.md: verification tasks 3.1-3.4 checked — openspec validate passes (expected originating_issue advisory only), full CI parity passes locally (build, -short suite w/ coverprofile, e2e TestRunSelfCheck, module-major validation, golangci-lint, gaze threshold 23/38, 6/6, 42/8), docs impact assessed, constitution alignment re-verified
eb39984 to
fa0dd78
Compare
…tch (issue unbound-force#301) Second retrospective batch (2026-10-30 22:01) from the code-review dispatch on the redact-env-values-from-adapter-stderr change: - content-pipeline: curator doc-gate verification loops (acknowledged advisories vs. formal findings; website-issue gate closure) - gatekeeping: gitleaksignore suppressions are gate modifications needing a paper trail in the proposal/PR - secret-redaction: record security-control scope decisions in spec artifacts, not just PR-body acknowledgments - structural-entropy: fork clones break divisor base resolution — verify the caller-provided base_sha instead of trusting local refs - test-quality: isolate independently-firing classifier rules in redaction unit tests
Second retrospective batch (2026-10-30 22:01) from the code-review dispatch on the redact-env-values-from-adapter-stderr change: - content-pipeline: curator doc-gate verification loops (acknowledged advisories vs. formal findings; website-issue gate closure) - gatekeeping: gitleaksignore suppressions are gate modifications needing a paper trail in the proposal/PR - secret-redaction: record security-control scope decisions in spec artifacts, not just PR-body acknowledgments - structural-entropy: fork clones break divisor base resolution — verify the caller-provided base_sha instead of trusting local refs - test-quality: isolate independently-firing classifier rules in redaction unit tests
Summary
Defense-in-depth secret redaction for AI-adapter stderr (issue #301, follow-up
from PR #300 review of the config-as-secret pattern).
runSubprocess— the single choke point shared by all three subprocess AIadapters (claude, gemini, opencode) — now scrubs surfaced child stderr against
sensitive inherited env-var values before embedding them in error messages:
KEY,TOKEN,SECRET,or
CONFIG_CONTENT(case-insensitive) or reaches 32 bytes regardless of namededupe first-name-wins
=so JSON/base64 values redact whole
[REDACTED:<VAR>]markers that name the variable,keeping errors diagnosable
straddling the boundary cannot leak a prefix
suffix) carry scrubbed content; the environment remains pure passthrough
New
internal/aireport/redact.go(pure helper) with table-driven unit tests(
redact_test.go) and subprocess integration tests (subprocess_test.go, viat.Setenv+ child echo, including the truncation-boundary straddle case).Docs: "Secret hygiene and stderr redaction" subsection in
docs/guides/ci-integration.md(second-secret masking pattern, single-linestrict-JSON secret guidance) plus a redaction note in the ai-reports
troubleshooting bullet.
Review gates (from /uf.unleash): spec review APPROVE WITH ADVISORIES
(5/5 reviewers); code review APPROVE WITH ADVISORIES (0 CRITICAL,
0 HIGH; 2 MEDIUM + 7 LOW advisory-grade findings — the 2 MEDIUM items are
carried in Known Issues below as non-blocking advisories).
Closes #301
How to Test
go test -race -count=1 -short ./internal/aireport/...— runs thetable-driven
redactEnvValuesunit tests and the three subprocessintegration tests:
TestRunSubprocess_NonZeroExitRedactsSensitiveEnvValue,TestRunSubprocess_EmptyStdoutSurfacesRedactedStderr, andTestRunSubprocess_RedactsSecretStraddlingTruncationBoundary(the scrub-before-truncation invariant).
go build ./...,golangci-lint run, fullgo test -race -count=1 -short -timeout 15m -coverprofile=coverage.out ./...,and
openspec validate redact-env-values-from-adapter-stderr(expected:only the
originating_issuemetadata advisory).*KEY*-named env var holding an obviouslyfake secret, run
gaze report --ai=opencodeagainst a failing orempty-output adapter invocation — the surfaced error contains
[REDACTED:<VAR>]markers instead of the value, while surroundingdiagnostic text survives.
docs/guides/ci-integration.md(Reusable Workflow section) for thesecond-secret masking pattern and single-line strict-JSON secret guidance.
How to Demo
The test suite in How to Test step 1 is the verifiable demo of the invariant.
Key Files Changed
internal/aireport/redact.go(new, +126),internal/aireport/adapter.go(+33)internal/aireport/redact_test.go(new, +211),internal/aireport/subprocess_test.go(+107)docs/guides/ci-integration.md(+55),docs/guides/ai-reports.md,AGENTS.mdopenspec/changes/redact-env-values-from-adapter-stderr/(proposal, design, spec, tasks,.openspec.yaml).uf/dewey/learnings/(14 learning files),.gitignore(+3)26 files changed, +1201 / −4.
Known Issues
Non-blocking advisories from code review (both documentation-precision
items, suited to this PR or a follow-up):
design.mdNon-Goals should record the deliberatestdout-not-scrubbed decision with rationale
docs/architecture/extending.mdhelper-contract bulletspredate the redaction behavior
Website docs tracked at unbound-force/website#346.
This PR was generated by /uf.finale (AI-assisted).