You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
internal/sandbox/sandbox.go:793 still uses fmt.Fscanln for the Extract confirmation prompt (D14 violation) #822
internal/sandbox/sandbox.go:793 (the Extract patch-apply confirmation prompt) still calls fmt.Fscanln(opts.Stdin, ...) — the last known remaining violation of the stdin-reading pattern (D14).
fmt.Fscanln blocks indefinitely when input ends with a bare CR (0x0D), which it never recognizes. The mandated pattern is bufio.Scanner with scanner.Scan() / scanner.Text() — see the exemplar at cmd/unbound-force/sandbox.go:276-285 (D14), which accepts any line ending.
Fix shape
Replace the fmt.Fscanln call at internal/sandbox/sandbox.go:793 with a bufio.Scanner read, matching the D14 exemplar.
Provenance
Identified during the 2026-10-25 knowledge-base audit (PR #820); recorded in the validated go-patterns compiled article as "KNOWN REMAINING VIOLATION."
Classification: VALID — bug (objective). Four Divisor personas (adversary, architect, curator, guard) independently assessed this issue; all four reached the same conclusion.
Verification
The call site exists as described.internal/sandbox/sandbox.go:793 reads fmt.Fscanln(opts.Stdin, &response) inside the Extract patch-apply confirmation prompt ("Apply this patch to the host repository? [y/N]", guarded by !opts.Yes).
The "last known remaining violation" claim holds. A repo-wide grep for Fscanln finds exactly one live production call site — this one. The only other match is an explanatory comment at cmd/unbound-force/sandbox.go:277 inside the already-fixed D14 exemplar.
The failure mode is functional, not stylistic.fmt.Fscanln uses whitespace-delimited token scanning and never recognizes a bare CR (0x0D), so the interactive confirmation blocks indefinitely on terminal configurations that emit bare CR (documented on macOS/iTerm2). The --yes flag bypasses the prompt; interactive users hit the hang. The existing err != nil guard covers piped EOF, so the defect is a hang rather than a confirmation bypass.
Replace the fmt.Fscanln call at internal/sandbox/sandbox.go:793 with a bufio.Scanner read matching the D14 exemplar at cmd/unbound-force/sandbox.go:276-291.
Preserve the safe-default semantics — scan failure or any non-yes response routes to "Patch not applied." This also improves the spec 028 FR-012 decline contract, since Scan() returning false on EOF yields a clean cancellation.
Add a regression test that drives the injected opts.Stdin reader (strings.NewReader) across line endings (\n, \r\n, bare \r).
No duplicate candidates were found in either the primary or the fallback search, and no split is recommended — the issue is well-scoped to a single call site with a fully determined fix shape.
This triage was performed by the Divisor review panel.
Activity
jflowers commentedon Nov 2, 2026
Triage Assessment
Classification: VALID — bug (objective). Four Divisor personas (adversary, architect, curator, guard) independently assessed this issue; all four reached the same conclusion.
Verification
internal/sandbox/sandbox.go:793readsfmt.Fscanln(opts.Stdin, &response)inside theExtractpatch-apply confirmation prompt ("Apply this patch to the host repository? [y/N]", guarded by!opts.Yes).Fscanlnfinds exactly one live production call site — this one. The only other match is an explanatory comment atcmd/unbound-force/sandbox.go:277inside the already-fixed D14 exemplar.fmt.Fscanlnuses whitespace-delimited token scanning and never recognizes a bare CR (0x0D), so the interactive confirmation blocks indefinitely on terminal configurations that emit bare CR (documented on macOS/iTerm2). The--yesflag bypasses the prompt; interactive users hit the hang. The existingerr != nilguard covers piped EOF, so the defect is a hang rather than a confirmation bypass.go-patternscompiled article records the identical "KNOWN REMAINING VIOLATION" marker for this call site, matching the cited 2026-10-25 knowledge-base audit (PR chore(dewey): knowledge refresh — audit, prune, recompile into 38 validated articles #820).Recommended next steps
fmt.Fscanlncall atinternal/sandbox/sandbox.go:793with abufio.Scannerread matching the D14 exemplar atcmd/unbound-force/sandbox.go:276-291.Scan()returning false on EOF yields a clean cancellation.opts.Stdinreader (strings.NewReader) across line endings (\n,\r\n, bare\r).No duplicate candidates were found in either the primary or the fallback search, and no split is recommended — the issue is well-scoped to a single call site with a fully determined fix shape.
This triage was performed by the Divisor review panel.