fix: avoid N12R process-list boundary false positive

This commit is contained in:
石头
2026-07-09 14:45:14 +08:00
parent 55c749b0ab
commit 19d05fe3c9
2 changed files with 13 additions and 0 deletions

View File

@@ -162,6 +162,16 @@ try {
Assert-Contains $result.Output "Decision: REJECT" "Expected reject decision in output."
}
Run-Test "accepts harmless process names that contain hook as a substring" {
$pkg = Join-Path $tempRoot "harmless-hook-substring"
$report = Join-Path $tempRoot "harmless-hook-substring-report.md"
New-GoodPackage $pkg
Write-Utf8Text (Join-Path $pkg "metadata\process-list.txt") "zfhookupdat 3240"
$result = Invoke-Validator -PackageRoot $pkg -ReportPath $report
Assert-True ($result.ExitCode -eq 0) "Expected validator success for harmless process-name substring, got exit $($result.ExitCode): $($result.Output)"
Assert-Contains $result.Output "Decision: ACCEPT" "Expected accept decision in output."
}
Run-Test "rejects report paths inside the evidence package" {
$pkg = Join-Path $tempRoot "report-inside-package"
New-GoodPackage $pkg

View File

@@ -318,6 +318,9 @@ try {
}
foreach ($relative in ($requiredFiles + $optionalFiles)) {
if ($relative -eq "metadata/process-list.txt") {
continue
}
$path = Join-PackagePath $packageFullPath $relative
if (Test-Path -LiteralPath $path -PathType Leaf) {
$text = if ($rawFiles.ContainsKey($relative)) { $rawFiles[$relative] } else { Read-TextFile $packageFullPath $relative }