Conversation
# Conflicts: # strix/agents/StrixAgent/strix_agent.py # strix/agents/StrixAgent/system_prompt.jinja
… sources and add related tests
Greptile SummaryThis PR is a substantial feature release that evolves Strix into a source-aware whitebox analysis platform. The changes introduce:
Two minor style observations noted; no blocking issues found. Confidence Score: 5/5Safe to merge — no P0 or P1 issues found; all remaining observations are P2 style/consistency suggestions. Core logic (diff resolution, wiki persistence, whitebox flag propagation) is correct and comprehensively tested. The two flagged items are minor code-quality observations that do not affect correctness or runtime behavior. strix/interface/utils.py — minor inconsistency in _classify_diff_entries (added_files deduplication) and implicit ordering dependency between build_diff_scope_instruction and scope.to_metadata(). Important Files Changed
Prompt To Fix All With AIThis is a comment left during a code review.
Path: strix/interface/utils.py
Line: 759-784
Comment:
**`added_files` list lacks deduplication**
`added_files` appends directly without a seen-set, while `modified_files` uses `_append_unique` + `modified_seen`. In theory `git diff --name-status -z` cannot emit the same path twice as `A`, but the inconsistency means `added_files_count` in `to_metadata()` could over-count in any edge case where a duplicate slips through the parser.
Consider introducing `added_seen: set[str] = set()` and switching the `A` branch to use `_append_unique(added_files, added_seen, path)` to match the pattern used for all other file categories.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: strix/interface/utils.py
Line: 1011-1025
Comment:
**Implicit side-effect ordering dependency between `build_diff_scope_instruction` and `scope.to_metadata()`**
`build_diff_scope_instruction` mutates `scope.truncated_sections` as a side effect. The caller in `resolve_diff_scope_context` relies on a specific ordering: `build_diff_scope_instruction` must be called before `scope.to_metadata()` so truncation state is populated. This is currently correct but invisible to future readers.
Consider documenting this with a comment:
```python
# NOTE: build_diff_scope_instruction populates scope.truncated_sections as a
# side effect; to_metadata() must be called after it.
instruction_block = build_diff_scope_instruction(repo_scopes)
```
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "whitebox follow up: better wiki" | Re-trigger Greptile |
|
|
||
| def _classify_diff_entries(entries: list[DiffEntry]) -> dict[str, Any]: | ||
| added_files: list[str] = [] | ||
| modified_files: list[str] = [] | ||
| deleted_files: list[str] = [] | ||
| renamed_files: list[dict[str, Any]] = [] | ||
| analyzable_files: list[str] = [] | ||
| analyzable_seen: set[str] = set() | ||
| modified_seen: set[str] = set() | ||
|
|
||
| for entry in entries: | ||
| path = entry.path | ||
| if not path: | ||
| continue | ||
|
|
||
| if entry.status == "D": | ||
| deleted_files.append(path) | ||
| continue | ||
|
|
||
| if entry.status == "A": | ||
| added_files.append(path) | ||
| _append_unique(analyzable_files, analyzable_seen, path) | ||
| continue | ||
|
|
||
| if entry.status == "M": | ||
| _append_unique(modified_files, modified_seen, path) |
There was a problem hiding this comment.
added_files list lacks deduplication
added_files appends directly without a seen-set, while modified_files uses _append_unique + modified_seen. In theory git diff --name-status -z cannot emit the same path twice as A, but the inconsistency means added_files_count in to_metadata() could over-count in any edge case where a duplicate slips through the parser.
Consider introducing added_seen: set[str] = set() and switching the A branch to use _append_unique(added_files, added_seen, path) to match the pattern used for all other file categories.
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/interface/utils.py
Line: 759-784
Comment:
**`added_files` list lacks deduplication**
`added_files` appends directly without a seen-set, while `modified_files` uses `_append_unique` + `modified_seen`. In theory `git diff --name-status -z` cannot emit the same path twice as `A`, but the inconsistency means `added_files_count` in `to_metadata()` could over-count in any edge case where a duplicate slips through the parser.
Consider introducing `added_seen: set[str] = set()` and switching the `A` branch to use `_append_unique(added_files, added_seen, path)` to match the pattern used for all other file categories.
How can I resolve this? If you propose a fix, please make it concise.| active=False, | ||
| mode=scope_mode, | ||
| metadata={"active": False, "mode": scope_mode}, | ||
| ) | ||
|
|
||
| if not local_sources: | ||
| raise ValueError("Diff-scope is active, but no local repository targets were provided.") | ||
|
|
||
| repo_scopes: list[RepoDiffScope] = [] | ||
| skipped_non_git: list[str] = [] | ||
| skipped_diff_scope: list[str] = [] | ||
| for source in local_sources: | ||
| source_path = source.get("source_path") | ||
| if not source_path: | ||
| continue |
There was a problem hiding this comment.
Implicit side-effect ordering dependency between
build_diff_scope_instruction and scope.to_metadata()
build_diff_scope_instruction mutates scope.truncated_sections as a side effect. The caller in resolve_diff_scope_context relies on a specific ordering: build_diff_scope_instruction must be called before scope.to_metadata() so truncation state is populated. This is currently correct but invisible to future readers.
Consider documenting this with a comment:
# NOTE: build_diff_scope_instruction populates scope.truncated_sections as a
# side effect; to_metadata() must be called after it.
instruction_block = build_diff_scope_instruction(repo_scopes)Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/interface/utils.py
Line: 1011-1025
Comment:
**Implicit side-effect ordering dependency between `build_diff_scope_instruction` and `scope.to_metadata()`**
`build_diff_scope_instruction` mutates `scope.truncated_sections` as a side effect. The caller in `resolve_diff_scope_context` relies on a specific ordering: `build_diff_scope_instruction` must be called before `scope.to_metadata()` so truncation state is populated. This is currently correct but invisible to future readers.
Consider documenting this with a comment:
```python
# NOTE: build_diff_scope_instruction populates scope.truncated_sections as a
# side effect; to_metadata() must be called after it.
instruction_block = build_diff_scope_instruction(repo_scopes)
```
How can I resolve this? If you propose a fix, please make it concise.
No description provided.