Skip to content

Modernize Go code with go fix - #14278

Merged
BagToad merged 26 commits into
trunkfrom
bagtoad/go-fix-cleanup
Aug 27, 2026
Merged

Modernize Go code with go fix#14278
BagToad merged 26 commits into
trunkfrom
bagtoad/go-fix-cleanup

Conversation

@BagToad

@BagToad BagToad commented Aug 27, 2026

Copy link
Copy Markdown
Member

No related issue.

Description

The codebase had not applied the source migrations available from Go 1.26's go fix. This applies every relevant fixer and keeps each fix type in its own commit so reviewers can inspect the mechanical changes independently.

The lint workflow now runs go fix ./... through its existing clean-worktree assertion. Fixable code will fail CI unless the generated changes are checked in.

How did you test this change?

I ran the cli acceptance test suite and saw no notable failures, except eventual rate-limits 😢

Key points

  • Each fixer is isolated in its own commit. Follow-up fixes unlocked by earlier passes remain separate.
  • Cleanup commits remove helper declarations made unused by the inline and reflection fixes.
  • The lint job reuses its existing mutation guard so go fix failures show the same checked-in-diff guidance as go mod tidy.

Notes for reviewers

Honestly, review commit-by-commit if you're curious. Each fixer is in its own commit.

But, this is essentially just the output of go fix so there's not much to review.

You may wish to review the workflow changes in particular.

Authorship and follow-up

Who wrote this:

  • A human wrote it.
  • An agent wrote it under close human direction.
  • An agent wrote it independently, and no human has guided the implementation beyond the initial prompt.

Who answers review comments:

  • @BagToad will read and reply directly. Name the account.
  • An agent will draft replies and @username will read them before they are posted.
  • Nobody has explicitly committed to replying.

BagToad and others added 21 commits August 26, 2026 12:05
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 27, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Modernizes the Go codebase using Go 1.26 source migrations and adds CI enforcement.

Changes:

  • Replaces legacy idioms with any, iterators, standard helpers, and builders.
  • Removes obsolete helpers and ineffective JSON options.
  • Runs go fix ./... in the lint workflow.
Show a summary per file
File Description
utils/utils.go Uses any.
test/helpers.go Modernizes test interface.
pkg/surveyext/editor.go Uses any return types.
pkg/search/searcher.go Uses any; removes custom min.
pkg/search/query.go Uses reflect.TypeFor.
pkg/jsoncolor/jsoncolor.go Uses any.
pkg/iostreams/color.go Modernizes variadic arguments.
pkg/httpmock/stub.go Modernizes mock payload types.
pkg/httpmock/registry.go Modernizes testing interface.
pkg/cmdutil/json_flags.go Modernizes export and reflection types.
pkg/cmdutil/json_flags_test.go Updates exporter tests.
pkg/cmdutil/errors.go Modernizes variadic arguments.
pkg/cmd/workflow/shared/shared.go Uses slices and builders.
pkg/cmd/workflow/shared/shared_test.go Uses integer range.
pkg/cmd/workflow/run/run.go Modernizes dynamic values.
pkg/cmd/workflow/list/list_test.go Uses integer range.
pkg/cmd/variable/shared/shared.go Modernizes JSON export.
pkg/cmd/variable/set/set.go Uses maps.Copy.
pkg/cmd/variable/set/http.go Uses any payloads.
pkg/cmd/variable/get/get_test.go Modernizes test maps.
pkg/cmd/status/status.go Uses slices, ranges, and builders.
pkg/cmd/ssh-key/shared/user_keys.go Uses index range.
pkg/cmd/ssh-key/add/add_test.go Modernizes payload tests.
pkg/cmd/skills/search/search.go Applies concurrency and helper idioms.
pkg/cmd/skills/publish/publish.go Uses slices and any.
pkg/cmd/skills/preview/preview_test.go Modernizes test maps.
pkg/cmd/skills/list/list.go Uses slices and any.
pkg/cmd/skills/install/install.go Uses built-in max.
pkg/cmd/skills/install/install_test.go Modernizes test maps.
pkg/cmd/secret/set/http.go Uses any payloads.
pkg/cmd/secret/list/list.go Modernizes JSON export.
pkg/cmd/run/view/view.go Uses slices.Contains.
pkg/cmd/run/view/view_test.go Modernizes exporter callback.
pkg/cmd/run/shared/test.go Modernizes test exporter.
pkg/cmd/run/shared/shared.go Uses any and built-in min.
pkg/cmd/run/download/download.go Uses slices.Contains.
pkg/cmd/ruleset/shared/shared.go Modernizes dynamic maps.
pkg/cmd/ruleset/shared/http.go Removes custom min.
pkg/cmd/repo/view/view_test.go Modernizes test exporter.
pkg/cmd/repo/unarchive/http.go Modernizes GraphQL variables.
pkg/cmd/repo/sync/sync.go Uses strings.Cut.
pkg/cmd/repo/sync/http.go Modernizes payload maps.
pkg/cmd/repo/setdefault/setdefault_test.go Modernizes callback map.
pkg/cmd/repo/read-file/read_file_test.go Modernizes fixture maps.
pkg/cmd/repo/read-file/http.go Modernizes JSON export.
pkg/cmd/repo/read-dir/read_dir_test.go Modernizes callback maps.
pkg/cmd/repo/read-dir/http.go Modernizes export and variables.
pkg/cmd/repo/list/list_test.go Modernizes callback maps.
pkg/cmd/repo/list/http.go Uses built-in min and any.
pkg/cmd/repo/list/http_test.go Modernizes variables map.
pkg/cmd/repo/garden/http.go Uses any.
pkg/cmd/repo/garden/garden.go Uses strings.Builder.
pkg/cmd/repo/deploy-key/add/http.go Modernizes payload map.
pkg/cmd/repo/deploy-key/add/add_test.go Modernizes payload test.
pkg/cmd/repo/credits/credits.go Uses range and builder idioms.
pkg/cmd/repo/create/http.go Modernizes GraphQL variables.
pkg/cmd/repo/create/create_test.go Modernizes payload tests.
pkg/cmd/repo/autolink/shared/autolink.go Modernizes JSON export.
pkg/cmd/repo/autolink/create/http_test.go Modernizes payload assertions.
pkg/cmd/repo/archive/http.go Modernizes GraphQL variables.
pkg/cmd/release/shared/fetch.go Modernizes exports and variables.
pkg/cmd/release/list/list_test.go Modernizes callback maps.
pkg/cmd/release/list/http.go Uses built-in min.
pkg/cmd/release/edit/http.go Modernizes parameter maps.
pkg/cmd/release/edit/edit.go Modernizes parameter maps.
pkg/cmd/release/download/download.go Uses range iteration.
pkg/cmd/release/create/http.go Uses any and SplitSeq.
pkg/cmd/release/create/http_test.go Modernizes parameter maps.
pkg/cmd/release/create/create.go Uses any and SplitSeq.
pkg/cmd/project/shared/queries/resolve.go Modernizes GraphQL variables.
pkg/cmd/project/shared/queries/resolve_test.go Modernizes fixture maps.
pkg/cmd/project/mark-template/mark_template.go Modernizes mutation variables.
pkg/cmd/project/item-edit/item_edit.go Uses any and new(expr).
pkg/cmd/project/item-delete/item_delete.go Modernizes mutation maps.
pkg/cmd/project/item-create/item_create.go Uses any and new(expr).
pkg/cmd/project/item-archive/item_archive.go Modernizes mutation maps.
pkg/cmd/project/item-add/item_add.go Modernizes mutation maps.
pkg/cmd/project/field-delete/field_delete.go Modernizes mutation maps.
pkg/cmd/project/field-delete/field_delete_test.go Modernizes fixture maps.
pkg/cmd/project/field-create/field_create.go Modernizes mutation maps.
pkg/cmd/project/edit/edit.go Uses any and new(expr).
pkg/cmd/project/delete/delete.go Modernizes mutation maps.
pkg/cmd/project/create/create.go Modernizes mutation maps.
pkg/cmd/project/copy/copy.go Uses any and new(expr).
pkg/cmd/project/close/close.go Uses any and new(expr).
pkg/cmd/pr/update-branch/update_branch_test.go Modernizes callback maps.
pkg/cmd/pr/status/status.go Modernizes JSON data map.
pkg/cmd/pr/status/http.go Uses strings.Cut and any.
pkg/cmd/pr/shared/templates.go Modernizes GraphQL variables.
pkg/cmd/pr/shared/survey.go Uses slices.Contains.
pkg/cmd/pr/shared/params.go Modernizes parameter map.
pkg/cmd/pr/shared/lister.go Modernizes GraphQL variables.
pkg/cmd/pr/shared/finder.go Modernizes GraphQL variables.
pkg/cmd/pr/shared/finder_test.go Modernizes callback map.
pkg/cmd/pr/shared/editable.go Uses slices.Contains.
pkg/cmd/pr/shared/editable_http.go Modernizes mutation variables.
pkg/cmd/pr/shared/commentable_test.go Modernizes callback map.
pkg/cmd/pr/review/review_test.go Modernizes mutation tests.
pkg/cmd/pr/revert/revert.go Uses new(expr).
pkg/cmd/pr/revert/revert_test.go Modernizes callback maps.
pkg/cmd/pr/reopen/reopen_test.go Modernizes callback maps.
pkg/cmd/pr/ready/ready_test.go Modernizes callback maps.
pkg/cmd/pr/merge/merge.go Modernizes variadic arguments.
pkg/cmd/pr/merge/http.go Modernizes GraphQL variables.
pkg/cmd/pr/list/list_test.go Modernizes test values.
pkg/cmd/pr/list/http.go Uses any; removes custom min.
pkg/cmd/pr/list/http_test.go Modernizes callback maps.
pkg/cmd/pr/edit/edit_test.go Modernizes mutation tests.
pkg/cmd/pr/create/create.go Modernizes parameter maps.
pkg/cmd/pr/comment/comment_test.go Modernizes callback maps.
pkg/cmd/pr/close/close_test.go Modernizes callback maps.
pkg/cmd/pr/checks/checks.go Modernizes GraphQL variables.
pkg/cmd/pr/checks/aggregate.go Modernizes JSON export.
pkg/cmd/org/list/http.go Uses any; removes custom min.
pkg/cmd/org/list/http_test.go Modernizes callback maps.
pkg/cmd/label/shared.go Modernizes JSON export.
pkg/cmd/label/list_test.go Modernizes callback maps.
pkg/cmd/label/http.go Modernizes GraphQL variables.
pkg/cmd/label/clone.go Uses integer range.
pkg/cmd/label/clone_test.go Modernizes callback maps.
pkg/cmd/issue/view/view_test.go Modernizes decoded JSON types.
pkg/cmd/issue/view/http.go Modernizes GraphQL variables.
pkg/cmd/issue/unpin/unpin.go Modernizes mutation variables.
pkg/cmd/issue/unpin/unpin_test.go Modernizes callback map.
pkg/cmd/issue/transfer/transfer.go Modernizes mutation variables.
pkg/cmd/issue/transfer/transfer_test.go Modernizes callback map.
pkg/cmd/issue/status/status.go Modernizes JSON data map.
pkg/cmd/issue/shared/lookup.go Modernizes GraphQL variables.
pkg/cmd/issue/reopen/reopen.go Modernizes mutation variables.
pkg/cmd/issue/reopen/reopen_test.go Modernizes callback maps.
pkg/cmd/issue/pin/pin.go Modernizes mutation variables.
pkg/cmd/issue/pin/pin_test.go Modernizes callback map.
pkg/cmd/issue/lock/lock.go Modernizes mutation variables.
pkg/cmd/issue/list/list.go Modernizes GraphQL variables.
pkg/cmd/issue/list/http.go Uses any; removes custom min.
pkg/cmd/issue/list/http_test.go Modernizes test variables.
pkg/cmd/issue/delete/delete.go Modernizes mutation variables.
pkg/cmd/issue/delete/delete_test.go Modernizes callback maps.
pkg/cmd/issue/create/create.go Modernizes parameter map.
pkg/cmd/issue/comment/comment_test.go Modernizes callback maps.
pkg/cmd/issue/close/close.go Modernizes mutation variables.
pkg/cmd/issue/close/close_test.go Modernizes callback maps.
pkg/cmd/gpg-key/add/add_test.go Modernizes payload tests.
pkg/cmd/gist/shared/shared.go Uses built-in min and any.
pkg/cmd/gist/rename/rename_test.go Modernizes expected maps.
pkg/cmd/extension/manager_test.go Uses integer range.
pkg/cmd/extension/command_test.go Modernizes fixture maps.
pkg/cmd/extension/browse/browse.go Uses built-in max.
pkg/cmd/extension/browse/browse_test.go Modernizes fixture maps.
pkg/cmd/config/set/set.go Uses slices.Contains.
pkg/cmd/codespace/ssh.go Uses sequence and prefix helpers.
pkg/cmd/codespace/ssh_test.go Uses slices and builder idioms.
pkg/cmd/codespace/ports.go Modernizes JSON export.
pkg/cmd/codespace/ports_test.go Uses t.Context.
pkg/cmd/codespace/delete_test.go Uses strings.CutSuffix.
pkg/cmd/codespace/create.go Uses slices and index range.
pkg/cmd/codespace/create_test.go Uses new(expr) and any.
pkg/cmd/codespace/common.go Modernizes prompter interface.
pkg/cmd/cache/shared/shared.go Modernizes JSON export.
pkg/cmd/cache/list/list_test.go Uses fmt.Appendf.
pkg/cmd/auth/status/status.go Modernizes JSON export.
pkg/cmd/auth/shared/oauth_scopes.go Uses SplitSeq.
pkg/cmd/auth/shared/login_flow.go Modernizes request map.
pkg/cmd/auth/refresh/refresh.go Uses slices and SplitSeq.
pkg/cmd/attestation/verification/policy.go Uses strings.Builder.
pkg/cmd/attestation/io/handler.go Uses any and builders.
pkg/cmd/attestation/api/client.go Uses any and built-in min.
pkg/cmd/api/pagination.go Modernizes parameter map.
pkg/cmd/api/pagination_test.go Modernizes test map.
pkg/cmd/api/http.go Modernizes request value types.
pkg/cmd/api/fields.go Modernizes parsed field types.
pkg/cmd/api/fields_test.go Modernizes expected values.
pkg/cmd/api/api.go Uses any request body.
pkg/cmd/api/api_test.go Modernizes decoded variables.
pkg/cmd/agent-task/capi/sessions.go Modernizes tags, exports, and variables.
pkg/cmd/agent-task/capi/job.go Removes ineffective JSON options.
pkg/cmd/agent-task/capi/job_test.go Modernizes payload tests.
internal/skills/source/source.go Modernizes metadata map.
internal/skills/source/source_test.go Modernizes test maps.
internal/skills/installer/installer_test.go Modernizes fixture maps.
internal/skills/frontmatter/frontmatter.go Uses any and strings.Cut.
internal/skills/frontmatter/frontmatter_test.go Modernizes test maps.
internal/skills/discovery/discovery.go Uses sequence and slice helpers.
internal/run/stub.go Modernizes testing interface.
internal/prompter/prompter.go Modernizes prompt values.
internal/ghrepo/repo.go Modernizes variadic arguments.
internal/codespaces/ssh.go Uses strings.CutPrefix.
internal/codespaces/portforwarder/port_forwarder.go Uses slices.Contains.
internal/codespaces/api/api.go Modernizes JSON export.
internal/codespaces/api/api_test.go Modernizes expected maps.
internal/browser/stub.go Modernizes testing interface.
git/client.go Uses SplitSeq.
api/queries_repo.go Modernizes API variables.
api/queries_repo_test.go Modernizes callback map.
api/queries_projects_v2.go Modernizes project variables.
api/queries_projects_v2_test.go Modernizes callback maps.
api/queries_pr_test.go Uses reflection field iterator.
api/queries_pr_review.go Modernizes review variables.
api/queries_org.go Modernizes organization variables.
api/queries_issue.go Modernizes issue maps.
api/queries_comments.go Modernizes comment variables.
api/queries_branch_issue_reference.go Modernizes branch variables.
api/export_repo.go Modernizes repository export.
api/export_pr_test.go Uses any decoded values.
api/client.go Modernizes API signatures and iterators.
api/client_test.go Modernizes variables map.
.github/workflows/lint.yml Enforces clean go fix output.

Review details

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 252/252 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@BagToad
BagToad marked this pull request as ready for review August 27, 2026 19:40
@BagToad
BagToad requested review from a team as code owners August 27, 2026 19:40
@BagToad
BagToad requested a review from tidy-dev August 27, 2026 19:40

@babakks babakks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, @BagToad! 🙏

Just a couple of trivial changes, especially around simplifying/inline the remaining bits (as they seem awkward if we left them as is).

Also, there's a strange case of max usage (in skills) that I'd like your thoughts on.

Comment thread .github/workflows/lint.yml Outdated
Comment thread pkg/cmd/skills/search/search.go Outdated
Comment thread pkg/cmd/agent-task/capi/job.go
Comment thread pkg/cmd/agent-task/capi/sessions.go
Comment thread pkg/cmdutil/json_flags.go
Comment thread pkg/cmd/auth/refresh/refresh.go
Comment thread pkg/cmd/codespace/create.go Outdated
Comment thread pkg/cmd/pr/shared/editable.go
Comment thread pkg/cmd/pr/shared/editable.go Outdated
Comment thread .github/workflows/lint.yml Outdated
BagToad and others added 5 commits August 27, 2026 16:00
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@BagToad
BagToad merged commit 2ea4611 into trunk Aug 27, 2026
11 checks passed
@BagToad
BagToad deleted the bagtoad/go-fix-cleanup branch August 27, 2026 22:59
holistis added a commit to holistis/muraqib that referenced this pull request Aug 28, 2026
…paths (#4)

* feat: add a code-based auto-merge guard, independent of the prompt text

The "never auto-merge payment/auth/migration/secrets" rule has so far
only existed as text Claude reads in the fix prompt — useful, but a
model can misjudge it. This adds a second, mechanical line of defense:
.github/workflows/auto-merge-guard.yml runs on any PR that has
auto-merge enabled, diffs the actual changed files against a
customizable regex (MURAQIB_SENSITIVE_PATHS repo variable, sensible
default otherwise), and force-disables auto-merge + comments if it
matches — regardless of what the PR author decided.

The pattern-matching logic itself is unit tested
(scripts/sensitive-path-pattern.test.mjs, 3 cases including a documented
false-positive trade-off: a harmless file merely named after a sensitive
topic still gets flagged on purpose, since a few minutes of review costs
less than missing a real one). The webhook-triggered half (does GitHub
actually fire this on a real auto-merge-enabled PR, does gh pr merge
--disable-auto really take effect) can't be verified without a live PR
against this repo — not done as part of this commit, noted here so it
isn't mistaken for having been end-to-end tested.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: rebuild the auto-merge guard after adversarial review found it did not work

Ran the first version through a dedicated adversarial + edge-case review
before pushing anywhere. Both reviewers independently found it
fundamentally broken, not just rough around the edges:

1. Used `pull_request` instead of `pull_request_target` — meant a PR could
   weaken the guard (empty its pattern, disable the job) in the same diff
   as a sensitive-path change, and get checked against its own
   already-neutered copy. `pull_request_target` always reads the workflow
   from the base branch, which the PR can't alter.
2. The unit tests exercised a JS RegExp hand-duplicated from a separate
   `grep -E` (POSIX ERE) string actually used in the workflow — the two
   dialects can disagree, so green tests didn't guarantee the production
   bash behaved the same way.
3. An invalid custom MURAQIB_SENSITIVE_PATHS pattern failed OPEN (grep
   silently treated it as "no match") instead of blocking.
4. The pattern never actually included "auth" despite every doc claiming
   it covered auth changes.
5. No documentation of the real requirement: this only actually blocks a
   merge if configured as a required status check in branch protection,
   since the job itself runs async and can't stop native auto-merge from
   completing first.

Rebuilt: all matching logic now lives in one place
(scripts/check-sensitive-paths.mjs), imported by both the workflow (via a
plain `node` invocation, no more grep) and its own test suite
(check-sensitive-paths.test.mjs, 7 cases: default-pattern matches
including auth and the workflow file itself, unrelated files pass, empty
diff passes, invalid custom pattern fails closed, valid custom pattern
overrides the default, non-ASCII filenames match correctly, matching is
case-insensitive). Changed files are read via the GitHub API, never by
checking out the PR's own ref. README/SECURITY.md/LESSONS.md updated to
document the required-status-check requirement and the full history of
what was wrong with the first version.

The webhook-triggered half (does pull_request_target actually behave as
documented on a live PR, does the required-status-check race close in
practice) still can't be verified without a real test PR against this
repo — noted explicitly, not claimed as tested.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: pagination crash + two secondary gaps found in round-2 review

Both reviewers in the second review round independently found and
reproduced the same critical bug against real large PRs (nodejs/node#64199,
293 files; cli/cli#14278, 252 files): `gh api ... --paginate --jq
"[.[].filename]"` crashes on any response spanning more than one page,
because gh applies --jq per-page before merging, producing several
concatenated JSON array literals instead of one valid document. The
uncaught JSON.parse meant the guard crashed before it could evaluate
whether the PR even needed blocking — on precisely the large-refactor PRs
where an accidental sensitive-path touch is most likely.

Fixed by dropping --jq entirely from both --paginate calls (file list and
existing-comments lookup) and moving the parsing into two testable
functions: parsePaginatedArrayOutput (defensively flattens an
array-of-page-arrays, in case anything ever produces that shape again)
and extractCheckablePaths (also pulls previous_filename for renamed
files, closing a smaller round-2 finding: a rename with no content change
would otherwise evade the guard under its old, possibly-sensitive name).

Verified against real production data, not just reasoning: reproduced the
old crash and confirmed the fix against the actual nodejs/node#64199 PR
(293 files) before writing this commit.

Also fixed: secrets?[._-] required "secrets" to be followed immediately
by ".", "_" or "-" — a bare secrets/ directory (k8s/secrets/prod.yaml)
slid through undetected. Widened to secrets?(/|[._-]|$).

6 new test cases (13 total in this file): multi-page parsing, defensive
flatten, malformed-JSON still throws (not silently empty), rename
old-path inclusion, bare secrets/ directory, and one true end-to-end case
combining all of the above against a simulated 151-file PR.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: require a real path boundary before "secrets", not a bare substring

Round-3 review confirmed the pagination fix holds (re-verified against
the real 293-file PR, 18/18 tests green) and found one remaining gap:
secrets?(/|[._-]|$) fixed the right-hand boundary (a bare secrets/
directory now matches) but never required a boundary on the left, so
"notsecrets.txt" or "topsecretsauce.md" would also trip the guard.

Fails toward caution, not away from it (unnecessary manual review, not a
missed real secret), so this was assessed as low-severity — fixed anyway
since it was already found and the correction is a one-line, fully
verified change: (^|[/._-])secrets?(/|[._-]|$). New test covers both
directions (false positives removed, true positives retained).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.

3 participants