Skip to content

Commit cc7011a

Browse files
committed
fix(sc9): omit LLM coverage note in static scans
Signed-off-by: Efe Gökdemir <[email protected]>
1 parent bb15763 commit cc7011a

3 files changed

Lines changed: 23 additions & 11 deletions

File tree

‎docs/NESTED_ARTIFACT_INSPECTION.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ SC9 reports evidence and risk; it does not execute the member or prescribe an in
7474
At the scan root, visible source scripts beneath `.agents/skills/<name>/` and
7575
`.claude/skills/<name>/` are not treated as concealed when that skill directory
7676
contains a regular `SKILL.md` or `skill.md` manifest. These paths remain hidden
77-
and local-only: their contents are not sent to an external LLM. The inspection
78-
ledger records that LLM review was withheld, so the report does not imply that
79-
those scripts received semantic review. This narrow exception does not cover
77+
and local-only: their contents are not sent to an external LLM. When LLM
78+
analysis is enabled, the inspection ledger records that LLM review was
79+
withheld, so the report does not imply that those scripts received semantic
80+
review. This narrow exception does not cover
8081
hidden skill names, hidden descendants, mismatched shebangs, unsupported script
8182
types, or nested client directories.

‎src/skillspector/nodes/build_context.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3536,14 +3536,18 @@ def _mark_runtime_partial(affected_paths: list[str], first_limited_path: str) ->
35363536
{item["path"]: item for item in artifact_inventory},
35373537
raw_file_cache,
35383538
)
3539-
hidden_skill_llm_events = _note_hidden_skill_scripts_not_sent_to_llm(component_metadata)
3539+
use_llm = state.get("use_llm", True)
3540+
hidden_skill_llm_events = (
3541+
_note_hidden_skill_scripts_not_sent_to_llm(component_metadata)
3542+
if use_llm is not False
3543+
else []
3544+
)
35403545
has_executable_scripts = (
35413546
has_executable_scripts
35423547
or any(bool(metadata.get("executable")) for metadata in nested.metadata)
35433548
or any(bool(metadata.get("executable")) for metadata in excluded_component_metadata)
35443549
)
35453550

3546-
use_llm = state.get("use_llm", True)
35473551
model_config = build_model_config() if use_llm else {}
35483552
llm_provenance = (
35493553
capture_llm_provenance(model_config)

‎tests/nodes/test_build_context.py‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -647,15 +647,18 @@ def test_source_local_only_preserves_excluded_executable_coverage(
647647

648648

649649
@pytest.mark.parametrize("client_dir", [".agents", ".claude"])
650-
def test_conventional_skill_scripts_are_not_concealed(tmp_path: Path, client_dir: str) -> None:
650+
@pytest.mark.parametrize("use_llm", [True, False])
651+
def test_conventional_skill_scripts_are_not_concealed(
652+
tmp_path: Path, client_dir: str, use_llm: bool
653+
) -> None:
651654
skill_root = tmp_path / client_dir / "skills" / "hello"
652655
(skill_root / "scripts").mkdir(parents=True)
653656
(skill_root / "SKILL.md").write_text("# Hello\n", encoding="utf-8")
654657
(skill_root / "scripts" / "hello.py").write_text('print("hello")\n', encoding="utf-8")
655658
hidden_script = skill_root / "scripts" / ".hidden.py"
656659
hidden_script.write_text('print("hidden")\n', encoding="utf-8")
657660

658-
result = build_context({"skill_path": str(tmp_path)})
661+
result = build_context({"skill_path": str(tmp_path), "use_llm": use_llm})
659662

660663
metadata = {item["path"]: item for item in result["component_metadata"]}
661664
visible_path = f"{client_dir}/skills/hello/scripts/hello.py"
@@ -666,14 +669,18 @@ def test_conventional_skill_scripts_are_not_concealed(tmp_path: Path, client_dir
666669
findings = _analyze_concealed_executables(result["component_metadata"])
667670
assert visible_path not in {finding.file for finding in findings}
668671
assert hidden_path in {finding.file for finding in findings}
669-
coverage = next(
672+
coverage = [
670673
event
671674
for event in result["inspection_ledger"]
672675
if event["path"] == visible_path
673676
and event.get("reason_code") == LedgerReason.HIDDEN_SKILL_EXECUTABLE_LOCAL_ONLY
674-
)
675-
assert coverage["outcome"] == LedgerOutcome.SKIPPED
676-
assert "not sent to an external LLM" in coverage["message"]
677+
]
678+
if use_llm:
679+
assert len(coverage) == 1
680+
assert coverage[0]["outcome"] == LedgerOutcome.SKIPPED
681+
assert "not sent to an external LLM" in coverage[0]["message"]
682+
else:
683+
assert coverage == []
677684

678685

679686
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)