Skip to content

fix(cli): default offline probing to passive - #1246

Closed
WilliamK112 wants to merge 6 commits into
squirrelscan:mainfrom
WilliamK112:codex/offline-passive-probe-1225
Closed

WilliamK112 wants to merge 6 commits into
squirrelscan:mainfrom
WilliamK112:codex/offline-passive-probe-1225

Conversation

@WilliamK112

Copy link
Copy Markdown
Contributor

Summary

  • make squirrel audit --offline resolve probing to passive at every audit level unless a probing flag explicitly opts in
  • preserve explicit --probe, --passive, --aggressive, and --pentest choices while keeping config-only probe settings read-only offline
  • show the resolved probe level in the run banner and custom-level metadata, and document the behavior in CLI help, completions, and the audit guide
  • add a real local-server regression proving an offline surface audit sends no GraphQL probe requests while --probe active does

Closes #1225.

Verification

  • bun test ./apps/cli/tests/commands/audit-level-wiring.test.ts ./apps/cli/tests/commands/audit-probe-wiring.test.ts ./apps/cli/tests/cli/audit-offline-probe.test.ts ./apps/cli/tests/squirrel-home-guard.test.ts (56 pass)
  • reverted the production default locally and confirmed audit-offline-probe.test.ts fails after observing two GraphQL probe requests; restored the fix and reran successfully
  • bun run format:check
  • bun run lint
  • bun run typecheck
  • bun run docs:check
  • bun run scripts/test-suites.ts --check
  • bun run scripts/test-suites.ts --run cli (3,196 pass, 1 skip; the unrelated request-deadline.test.ts stalled-body reachability case timed out locally and reproduced when run alone)
  • git diff --check

Checklist

  • I added or updated tests for behavioral changes.
  • I did not include secrets, customer data, or incompatible third-party material.
  • Every commit includes a DCO Signed-off-by line (git commit -s).

Docs: docs/cli/audit.mdx updated. Skill: none.

@nc9 nc9 added the bug Something isn't working label Oct 29, 2026 — with Claude

nc9 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Reviewed head: 67da7df

Thanks @WilliamK112. Verdict: pending maintainer review. The change matches the approach you proposed on #1225, and I found nothing blocking.

Checked

  • Correctness: offlineDefault is true only when --offline is set and none of --probe, --passive, --aggressive, --pentest was passed, so explicit flags still win. It also clears a config-only [security] probe, which is a behaviour decision worth a maintainer's eye (an offline run can no longer be made active through config alone).
  • Input safety: no new parsing, regexes or loops.
  • Conventions: DCO sign-off is on the commit, there is no new runtime dependency, the CHANGELOG bullet is under [Unreleased], and docs (docs/cli/audit.mdx), help text and shell completions are updated together.
  • Tests: the local-server test proves no GraphQL probe is sent offline and that --probe active still sends one.
  • CI on this head: green (format, lint, typecheck, CLI tests, docs, secret scan, sign-offs).

Low

  • audit-offline-probe.test.ts spawns the CLI with --level surface; a second case for --level full would lock in the "every audit level" claim in the PR title.

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I added the suggested --level full case while keeping the explicit active-probe assertion at surface level. The focused test now covers both offline default levels and still proves the fixture receives an explicit active GraphQL probe.\n\nValidated with:\n- bun test ./apps/cli/tests/cli/audit-offline-probe.test.ts (3 pass)\n- bun run --cwd apps/cli typecheck\n- oxfmt --check and oxlint for the changed test file

@nc9 nc9 added the cli label Oct 29, 2026

nc9 commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Reviewed head: f2b42c3

Thanks @WilliamK112. Verdict: pending maintainer review. No change to the earlier assessment, and nothing blocking.

Earlier review (67da7df), checked against this head:

  • The one low item (a --level full case in audit-offline-probe.test.ts) is addressed in f03764f3. The test is now parameterised over surface and full, and a separate case keeps the explicit --probe active assertion, so the "every audit level" claim is covered.
  • The earlier note stands for the maintainer: an offline run can no longer be made active through config alone, only through an explicit flag.

New commits since the last review: f03764f3 (test only, 16 added and 8 removed lines, DCO sign-off present) and a merge of main (f2b42c39, which brings in #1243). The production change is identical to the reviewed one.

Conventions: DCO is present, no new runtime dependency, docs and completions were already updated. CI on this head: all checks green.

@nc9

nc9 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Reviewed head: f2b42c3

Reviewed at f03764f. f2b42c3 adds only a merge of main, and the patch is identical.

Thanks @WilliamK112. The behaviour change is correct, narrow and tested.

  • --offline now resolves probing to passive at every level unless a probing flag opts in.
  • An explicit --probe, --passive, --aggressive or --pentest is never downgraded.
  • [security] probe from config stays read-only offline.
  • Online behaviour is unchanged.

All four acceptance criteria in #1225 are met.

One fix before merge:

  1. Docs placement (docs/cli/audit.mdx, "Fully offline audit"). The new "Probing defaults to passive…" paragraph sits between "Nothing goes to any other host:" and the bullet list that colon introduces, so the list is orphaned. Please move the paragraph above that sentence or below the list.

Optional, all low:

  1. When --offline overrides a probe level set in config, the banner shows passive without saying why. A one-line notice would help.
  2. Every offline surface or full run is now labelled custom (… + probe passive), with meta.auditLevel.changes: ["probe"]. That's intended and tested, but worth one line in the CHANGELOG entry for anyone reading the JSON.
  3. "No requests beyond the crawl" overstates it slightly: the soft-404 confirmation, cloaking, AI-agent-access and discovery probes still reach the audited site offline, as the docs say elsewhere. "No active security probes" is precise.
  4. The full-level offline test has no active control, so a crawl that silently did nothing would pass. The surface control covers the fixture, so this is minor.

Verdict: merge after the docs fix.

…ve-probe-1225

Signed-off-by: Ching-Wei Kang <[email protected]>

# Conflicts:
#	CHANGELOG.md
…' into codex/offline-passive-probe-1225

Signed-off-by: Ching-Wei Kang <[email protected]>
@WilliamK112
WilliamK112 force-pushed the codex/offline-passive-probe-1225 branch from ba68c20 to d0b10ba Compare October 29, 2026 18:05
@WilliamK112

Copy link
Copy Markdown
Contributor Author

Resolved the conflict with current main and moved this PR's changelog entry back under Unreleased so the released-section guard stays satisfied. Re-ran the focused offline probing and level/wiring suites on Bun 1.4.4: 56 passed, 0 failed.

@nc9

nc9 commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Reviewed head: d15a51a

The docs fix is in: the offline-probing paragraph now follows the bullet list it was splitting, and "no active security-probe requests" is the precise wording (optional item 4 too). The code is unchanged since the reviewed f03764f; the other new commits are merges of main. Good to merge once CI is green. Thanks @WilliamK112.

@WilliamK112

Copy link
Copy Markdown
Contributor Author

Moved the passive-probing paragraph below the list introduced by the preceding sentence and tightened the wording to active security-probe requests. This addresses the required docs-placement item.

@nc9

nc9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Thank you @WilliamK112, and sorry for the turnaround on this one. The change itself was solid: well tested, and nothing explicit was ever downgraded. But on reflection we want to keep two settings independent:

  • --offline / online is about network scope: whether the audit uses the cloud and third-party services.
  • --probe (passive, active, aggressive) is about how hard the scan probes the audited site.

Tying one to the other would make --offline quietly change scan intensity, which is the coupling we want to avoid. So #1225 becomes a docs and help-text fix that explains how the two interact, rather than a behaviour change. We're closing this PR on that basis, not because of anything in your work, and we'd be glad to have your eyes on that docs change if you're interested.

@nc9 nc9 closed this Oct 30, 2026
@nc9

nc9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Quick follow-up @WilliamK112: we already had the #1225 docs and help-text change in progress (#1313), so that part is covered and there's no need to pick it up. Sorry for the mixed message, and thanks again for all the work this week. Your fixes in v0.0.140 and v0.0.141, and #1277, have made a real difference.

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

Labels

bug Something isn't working cli

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--offline does not imply passive probing: -C surface --offline still sends GraphQL probe GETs

2 participants