Skip to content

test(security): builtin tool tests run on the edge fakes - #3855

Merged
dan-petty merged 4 commits into
mainfrom
test/1330-builtin-tool-tests-on-fakes
Nov 6, 2026
Merged

dan-petty merged 4 commits into
mainfrom
test/1330-builtin-tool-tests-on-fakes

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The builtin tool tests ran on patches and mocks. They now run on the process, HTTP and RAG fakes.

  • The process tools run on process_fake. The OSV, Shodan and Radar tools run on the web fixture. rag_search runs on the qdrant and embedder fixtures.
  • rag_search takes its client from resolve_qdrant_client and its embedder from create_embedder, so the fakes reach it. It builds no client and no engine itself.
  • The test file holds no patch, no mock, no private import and no time.sleep stub.

This keeps the test double at the process and network edge, as the tracker asks.

Closes #3761

Change: openspec/changes/archive/2026-11-06-3761-builtin-tool-tests-on-fakes/

…akes

rag_search takes its Qdrant client and embedder from the seam functions, so
the qdrant and embedder fixtures reach it. The builtin tool tests drop their
patches, mocks and private imports and use process_fake, web, qdrant and
embedder.
@dan-petty dan-petty added type/test Type test: a new or changed test scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault labels Nov 6, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Check results (local, before the last rebase onto main):

  • Full devops ci: 20084 passed. 2 failures, both known host failures that also fail on origin/main: test_mark_only_commands_under_global_dry_run and the popeye executor contract test for [direct].
  • Focused: tests/security/test_builtin_tools.py passes, with new rag_search cases for the rebuild, the language filter and the top_k limit (a review found that three rag_search mutants survived).

Review notes:

  • The is_symlink guard in _is_safe_workspace_path is dead code. Every caller resolves the path first. The old test that pinned it is gone. The new test shows the correct public behavior: a link to an inside file reads, a link out of the workspace is denied. The removal of the guard is filed as refactor(security): drop the dead symlink guard in workspace path check #3854.
  • The ConfigurationError reply in rag_search names qdrant.url. Only the unset URL raises it today. No action now.

@dan-petty
dan-petty marked this pull request as ready for review November 6, 2026 22:09
@dan-petty
dan-petty merged commit d1e6b44 into main Nov 6, 2026
24 checks passed
@dan-petty
dan-petty deleted the test/1330-builtin-tool-tests-on-fakes branch November 6, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/security Security linters (trivy, bandit, gitleaks, kubeconform) and Vault type/test Type test: a new or changed test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(ai): builtin tool tests run on the process, RAG and HTTP fakes

1 participant