Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lyrashield/interface/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
get_global_report_state,
initial_run_record,
sanitize_attachments,
sanitize_local_sources,
sanitize_targets_info,
validate_run_record,
)
from lyrashield.artifacts.writer import (
Expand Down Expand Up @@ -1080,12 +1082,12 @@ def _persist_run_record(
run_record = initial_run_record(
args.run_name,
auth_mode=codex.auth_mode(load_settings().llm.model),
targets_info=args.targets_info,
targets_info=sanitize_targets_info(args.targets_info),
extra={
"scan_mode": args.scan_mode,
"instruction": args.instruction,
"non_interactive": args.non_interactive,
"local_sources": getattr(args, "local_sources", []),
"local_sources": sanitize_local_sources(getattr(args, "local_sources", [])),
"attachments": sanitize_attachments(getattr(args, "attachments", [])),
"diff_scope": getattr(args, "diff_scope", {"active": False}),
"scope_mode": args.scope_mode,
Expand Down
11 changes: 4 additions & 7 deletions lyrashield/interface/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,7 @@ def resolve_diff_scope_context(
raise

if not repo_scopes:
if scope_mode == "auto":
if scope_mode == "auto" and diff_head is None:
metadata: dict[str, Any] = {"active": False, "mode": scope_mode}
if skipped_non_git:
metadata["skipped_non_git_sources"] = skipped_non_git
Expand All @@ -1326,13 +1326,10 @@ def resolve_diff_scope_context(
instruction_block = build_diff_scope_instruction(repo_scopes)
total_analyzable = sum(len(scope.analyzable_files) for scope in repo_scopes)
total_deleted = sum(len(scope.deleted_files) for scope in repo_scopes)
# Each changed path counts once: modified already carries copied paths and
# low-similarity renames, so adding renamed+copied again double-counts.
total_changed = sum(
len(scope.added_files)
+ len(scope.modified_files)
+ len(scope.renamed_files)
+ len(scope.copied_files)
+ len(scope.deleted_files)
for scope in repo_scopes
len(scope.analyzable_files) + len(scope.deleted_files) for scope in repo_scopes
)
metadata = {
"active": True,
Expand Down