Repository navigation
Conversation
A `repository` target is cloned into the sandbox workspace and collected into `local_sources` exactly like a `local_code` target, but the two white-box checks only looked at `type == "local_code"`. Scanning a GitHub repo, alone or beside a domain, therefore ran with is_whitebox=False: the source-aware skills were not preloaded for the root agent (coordination/source_aware_whitebox is not loadable on demand) and telemetry recorded the scan as black-box. The docs describe this invocation as white-box testing. Regressed in 1e641e5, which replaced `bool(args.local_sources)` with the `local_code` check. Add one `is_whitebox_scan` in a dependency-free `strix.core.targets` (the interface layer imports it before the agents SDK may be imported, so it cannot live in core.inputs) and use it from both the runner and scan setup. A repository that was not cloned still does not count, as it has no source. Tests: unit cases for each target mix, and a runner-level case asserting the root agent is built with is_whitebox=True for a cloned repository (it fails on main for the repository cases and passes for the local_code and web controls). Fixes usestrix#884. Supersedes usestrix#885, which no longer applies to main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TavwVMH7PvrD68JTDfd6Hb
|
| def test_source_in_front_of_the_agent_makes_the_scan_whitebox( | ||
| targets: list[dict[str, Any]] | None, *, expected: bool | ||
| ) -> None: | ||
| assert is_whitebox_scan(targets) is expected |
There was a problem hiding this comment.
The new tests check what is_whitebox_scan returns and what the runner passes to the agent, but neither checks what telemetry_start reports after cloning a repository. Add a test for that reported value. Otherwise, a later change to scan setup could label cloned-repository scans as black-box while these tests still pass.
Knowledge Base Used: CLI launch and scan setup
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/test_scan_targets.py
Line: 43
Comment:
**Telemetry result lacks a test**
The new tests check what `is_whitebox_scan` returns and what the runner passes to the agent, but neither checks what `telemetry_start` reports after cloning a repository. Add a test for that reported value. Otherwise, a later change to scan setup could label cloned-repository scans as black-box while these tests still pass.
**Knowledge Base Used:** [CLI launch and scan setup](https://app.greptile.com/strix-org-3/-/custom-context/knowledge-base/usestrix/strix/-/docs/cli-launch-and-scan-setup.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Bump to 1.7.0+shvia.22 and add the FORK.md row plus the four contributions (usestrix#1469 dedupe lock, usestrix#1470 whitebox repository targets, usestrix#1471 test isolation from the real home, usestrix#1472 trust fields in the PDF report). CLAUDE.md now says the suite no longer writes the real ~/.strix, and that `import litellm` loads the current directory's .env unless LITELLM_MODE=PRODUCTION. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TavwVMH7PvrD68JTDfd6Hb
Review feedback on usestrix#1470: the tests covered is_whitebox_scan and the runner, but not what telemetry_start reports. Assert the is_whitebox label sent to both sinks for a cloned repository, one that was not cloned, and a web target. The cloned case fails with the old rule (type == local_code only). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TavwVMH7PvrD68JTDfd6Hb
Fixes #884. Supersedes #885, which no longer applies to
main.Problem
A
repositorytarget is cloned into the sandbox workspace and collected intolocal_sourcesexactly like alocal_codetarget (collect_local_sources), but the two white-box checks only looked attype == "local_code":runner.pydecidedis_whiteboxinline, so scanning a GitHub repo (alone or beside a domain) ran withis_whitebox=False:coordination/source_aware_whiteboxandcustom/source_aware_sastwere not preloaded for the root agent, and the first is internal so it cannot be loaded on demand;interface/utils.py:is_whitebox_scanfed telemetry, which recorded the scan as black-box.The docs describe this invocation as white-box testing. As the issue bisects, it regressed in 1e641e5, which replaced
bool(args.local_sources)with thelocal_codecheck.Fix
One
is_whitebox_scan(targets_info)that says "source is in front of the agent": alocal_codetarget, or arepositorytarget that was cloned (details["cloned_repo_path"]). The runner and scan setup both use it, and the second copy is removed. A repository that was not cloned still does not count.It lives in a new dependency-free
strix/core/targets.pyrather thancore/inputs.py:scan_setupimportscore.inputslazily inside a function on purpose (it pulls in the agents SDK), so importing the predicate from there at module level would change that.Tests
tests/test_scan_targets.py: each target mix (none, web only, local directory, cloned repository, repository that was not cloned, repository beside a domain in either order, missingdetails).tests/test_runner_root_prompt.py: through the realrun_strix_scan, the root agent is built withis_whitebox=Truefor a cloned repository and for a repository beside a domain.On
mainthe two repository cases of the runner test fail while thelocal_codeand web-only controls pass; with the change everything passes.ruff,mypyandbanditare clean on the touched files and the 617 neighbouring scan-setup/CLI/runner/target/resume tests pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01TavwVMH7PvrD68JTDfd6Hb