Skip to content

fix: pr-bug-scan validated finding from #2141#2154

Open
buf0-bot[bot] wants to merge 1 commit into
mainfrom
bot/pr-bug-scan-2141-1779044533
Open

fix: pr-bug-scan validated finding from #2141#2154
buf0-bot[bot] wants to merge 1 commit into
mainfrom
bot/pr-bug-scan-2141-1779044533

Conversation

@buf0-bot
Copy link
Copy Markdown
Contributor

@buf0-bot buf0-bot Bot commented May 17, 2026

Automated fix-PR from pr-bug-scan for parent #2141.

Fixer status: FIXED_WITH_CODE_PROOF
Summary: Narrowed LINT_PATTERN to lint-tool names only (eslint/oxlint/lint-staged/lint), dropping the loose '\d+ errors' alternative that misclassified non-lint hook failures.
Blocked proof link: src/renderer/src/components/right-sidebar/commit-failure-summary.ts:15
Typecheck: skipped

Proof (from validator)

  • C1 — proof_type: code_analysis
    • trigger: A commit fails for a non-lint reason whose stderr contains a substring matching '\b\d+\s+errors?\b' (for example, a custom pre-commit hook that runs a typechecker and prints 'Found 5 errors', or a non-lint script that prints '2 errors').
    • observable: Inline alert under the commit textarea (and the screen-reader announcement) says 'Lint failed during commit.' even though the underlying failure was not from eslint/oxlint/lint-staged.
    • path:
      • src/renderer/src/components/right-sidebar/commit-failure-summary.ts:15 — LINT_PATTERN includes the alternative \b\d+\s+errors?\b, which matches any 'N error(s)' substring regardless of source
      • src/renderer/src/components/right-sidebar/commit-failure-summary.ts:46 — summarizeCommitFailure returns LINT_COMMIT_FAILURE_SUMMARY whenever any line matches LINT_PATTERN, before the HOOK_PATTERN branch is considered
      • src/renderer/src/components/right-sidebar/SourceControl.tsx:3203 — commitFailureSummary is computed via summarizeCommitFailure(commitError)
      • src/renderer/src/components/right-sidebar/SourceControl.tsx:3424 — the rendered in the role=alert/aria-live=polite container shows commitFailureSummary
  • C2 — proof_type: code_analysis
    • trigger: User opens the commit-failure Details dialog after a failed commit, then triggers another commit (or switches worktrees) that produces a different commitError string while the dialog is still open.
    • observable: The expanded Details dialog disappears the moment a new commit error arrives; the user must re-click the Details button on the new banner to read the latest output.
    • path:
      • src/renderer/src/components/right-sidebar/SourceControl.tsx:3213 — commitFailureIdentity = ${worktreeId ?? 'no-worktree'}:${commitError ?? ''} changes whenever commitError changes
      • src/renderer/src/components/right-sidebar/SourceControl.tsx:3228 — useEffect on [commitFailureIdentity] runs setCommitFailureDialogState((current) => current.identity === commitFailureIdentity ? current : { identity: , open: false })
      • src/renderer/src/components/right-sidebar/SourceControl.tsx:3218 — isCommitFailureDialogOpen = state.open && state.identity === commitFailureIdentity, so after the effect runs open=false
      • src/renderer/src/components/right-sidebar/SourceControl.tsx:3441 — <Dialog key={commitFailureIdentity} open={isCommitFailureDialogOpen} ...> also remounts on identity change, dropping any in-dialog UI state

Generated by pr-bug-scan (proof-machine architecture). Human approval required before merge.

Narrowed LINT_PATTERN to lint-tool names only (eslint/oxlint/lint-staged/lint), dropping the loose '\d+ errors' alternative that misclassified non-lint hook failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants