Skip to content
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dd79675
test(references): cover NVCARPS-154 acceptance cases
rng1995 Sep 15, 2026
a2d1f42
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 15, 2026
dbbdb59
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
f7f52e8
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
7d164fe
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
e1987db
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
0b4a148
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
70f0fa1
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
8e49150
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
c8446c5
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
8aa1ee7
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
31d815a
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
7fb9023
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
e227c8d
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
f5a2387
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
bdf1078
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
06b3075
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
d548d29
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
1659ea6
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
d9ee806
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
9403137
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
070e6a4
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 16, 2026
e3a7025
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 17, 2026
505c2a8
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 17, 2026
f58cc1b
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 17, 2026
337124c
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 17, 2026
5f0366b
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 18, 2026
3d76c8b
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 18, 2026
909e0ff
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 18, 2026
18554bf
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 18, 2026
56a0381
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 18, 2026
20a6255
Merge branch 'main' into naren/fix-NVCARPS-154-reference-regressions
github-actions[bot] Sep 18, 2026
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
63 changes: 61 additions & 2 deletions tests/nodes/test_security_remediation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import time
import tracemalloc
import zipfile
from collections import Counter
from pathlib import Path

import pytest
Expand Down Expand Up @@ -1375,9 +1376,18 @@ def test_static_only_graph_surfaces_sanitized_bypass_fixture(
)


def test_missing_primary_reference_blocks_complete_verdict(tmp_path: Path) -> None:
def test_reported_self_and_existing_file_references_remain_complete(tmp_path: Path) -> None:
references = tmp_path / "references"
references.mkdir()
(references / "windows-host-setup.md").write_text(
"# Windows host setup\n\nUse the documented lab defaults.\n",
encoding="utf-8",
)
(tmp_path / "SKILL.md").write_text(
"# Skill\n\nContinue with [the local guide](missing-guide.md).\n",
"# Skill\n\n"
"Keep `SKILL.md` concise.\n"
"Read [this skill](./SKILL.md) before updating it.\n"
"Follow `references/windows-host-setup.md` before setup.\n",
encoding="utf-8",
)

Expand All @@ -1389,6 +1399,55 @@ def test_missing_primary_reference_blocks_complete_verdict(tmp_path: Path) -> No
}
)

resolved_targets = [
reference["target_path"]
for reference in result["artifact_references"]
if reference["status"] == "resolved"
]
assert Counter(resolved_targets) == Counter(
{
"SKILL.md": 2,
"references/windows-host-setup.md": 1,
}
)
assert not any(finding.rule_id == "AE1" for finding in result["filtered_findings"])
assert not any(
row["reason_code"] == "reference_unresolved"
for row in result["analysis_completeness"]["ledger_exceptions"]
)
assert result["analysis_completeness"]["is_complete"] is True
assert result["risk_recommendation"] == "SAFE"


@pytest.mark.parametrize("case", ["missing", "ambiguous"])

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new ambiguous case produces reference_unresolved, but the shared assertion below always expects reference_missing, so this case fails. Please choose the expected reason from case: reference_missing for missing and reference_unresolved for ambiguous.

def test_unresolved_primary_reference_blocks_complete_verdict(tmp_path: Path, case: str) -> None:
reference = "references/windows-host-setup.md" if case == "missing" else "guide.md"
if case == "ambiguous":
for subdirectory in ("first", "second"):
target = tmp_path / "references" / subdirectory / reference
target.parent.mkdir(parents=True)
target.write_text("# Guide\n", encoding="utf-8")
(tmp_path / "SKILL.md").write_text(
f"# Skill\n\nContinue with [the local guide]({reference}).\n",
encoding="utf-8",
)

result = graph.invoke(
{
"input_path": str(tmp_path),
"output_format": "json",
"use_llm": False,
}
)

unresolved = [
reference
for reference in result["artifact_references"]
if reference["status"] in {"missing", "ambiguous"}
]
assert len(unresolved) == 1
assert unresolved[0]["status"] == case
assert unresolved[0]["target_path"] is None
assert not any(finding.rule_id == "AE1" for finding in result["filtered_findings"])
assert result["analysis_completeness"]["is_complete"] is False
assert any(
Expand Down