Skip to content

--offline does not stop --pr from pushing a branch and calling gh #150

Done

Description

@TMHSDigital

Summary

--offline is described as refusing "any connection that would leave this machine", but spackle scan --offline --pr still runs git push origin and gh pr create. Nothing checks --offline before the pull request step, and docs/PRIVACY.md tells readers to use --offline for "a run with no outside traffic" without naming --pr as an exception.

Where

  • internal/cli/flags.go:89: --offline help, "refuse any connection that would leave this machine"
  • internal/engine/agentic.go:545: if r.cfg.Fix.PR && !st.interrupted { ... r.lab.openPR(ctx, branch, fixed) with no offline check
  • internal/gitx/pr.go:38: run(ctx, req.Dir, "push", "--set-upstream", "origin", req.Branch)
  • internal/config/config.go: validation has no rule for offline together with [fix] pr
  • docs/PRIVACY.md:98, docs/PRIVACY.md:105: the list of what offline mode does not start leaves out --pr

Details

Offline mode already refuses the other outbound steps it controls: a git URL target (internal/engine/run.go:158), the network scanners (run.go:276), and image pulls (prove.go:109). The pull request step is the one outbound action Spackle starts itself that is not covered.

Impact

Someone who combines --offline with --pr (or has pr = true in [fix] and passes --offline) gets a push to their remote and a call to GitHub despite asking for no outside traffic. It needs both options, so it is not common, but it contradicts the flag's own help.

Suggested fix

Refuse the combination with exit code 2, the way a git URL target is refused in offline mode ("--pr pushes a branch and calls gh, which would leave this machine; drop --offline or --pr"). Then add --pr to the PRIVACY.md list of things offline mode does not start.

Acceptance criteria

  • spackle scan <dir> --offline --pr exits 2 with a clear message and pushes nothing
  • Same when pr = true comes from config
  • A test covers both
  • docs/PRIVACY.md and the CHANGELOG mention it

Getting started

  • Relevant files: internal/config/config.go (validation) or internal/engine/run.go (the existing offline refusals), docs/PRIVACY.md
  • How to run tests: go test -short ./...

Filed by repo-audit/docs-audit at 82a8ded. Severity: medium. Effort: S. audit-key: bug|internal/engine/agentic.go|offline-pr

Activity

  1. added
    bug
    good first issue
    severity: medium
    on Nov 28, 2026
  2. TMHSDigital commented on Nov 28, 2026

    @TMHSDigital
    OwnerAuthor

    Fixed in 766949b: a scan with offline mode and [fix] pr (flag or config) is now refused with exit code 2 before anything runs; a run with fixes off is not refused. The MCP server is covered too. Verified with a new case in TestOfflineSkipsNetworkScannersAndRefusesClones that fails without the change, plus the short suite and lint. PRIVACY.md, config.md and the CHANGELOG list it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueseverity: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions