Preserve source, binary, and runtime evidence boundaries while making precision and performance regressions reproducible. - decompose analysis orchestration into bounded modules - add differential, metamorphic, organic, and Yams change-time gates - fix detector, P-Code, fuzz sanitizer, and report identity precision
27 lines
801 B
Python
27 lines
801 B
Python
"""Small, testable classification primitives for differential comparator lanes."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
from typing import Pattern
|
|
|
|
|
|
def diagnostic_detected(output: str, pattern: Pattern[str]) -> bool:
|
|
return pattern.search(output) is not None
|
|
|
|
|
|
def vulnerable_runtime_detected(
|
|
returncode: int, output: str, pattern: Pattern[str]
|
|
) -> bool:
|
|
return returncode != 0 and diagnostic_detected(output, pattern)
|
|
|
|
|
|
def fixed_runtime_reported(returncode: int, output: str, pattern: Pattern[str]) -> bool:
|
|
"""Classify only explicit sanitizer evidence, not application exit status."""
|
|
|
|
del returncode
|
|
return diagnostic_detected(output, pattern)
|
|
|
|
|
|
def compile_diagnostic_pattern(expression: str) -> Pattern[str]:
|
|
return re.compile(expression, re.IGNORECASE)
|