feat(pre-push-safety-net): exclude the memory family explicitly and document the scope line

- advisory-scope.json names the taxonomy family memory as excluded, with
  the registry-grounded reason and what a run does not tell
- docs/scanning.md shows the Scope line exactly as the hook prints it
- the loaded-scope guard moves into a helper, so __post_init__ keeps its
  complexity of 14
This commit is contained in:
Marius Ciepluch
2026-11-23 13:45:27 +01:00
parent 364b4c0777
commit d9b7aaa6ac
4 changed files with 18 additions and 2 deletions
@@ -49,6 +49,12 @@
"label": "deserialization",
"reason": "Has not earned a place through evaluation.",
"not_told": "No defect is reported for deserialization, so a contributor is not told that a change deserializes untrusted data into objects the process then trusts, even when it does."
},
{
"family": "memory",
"label": "memory",
"reason": "No memory-safety capability has been evaluated: the only related declaration in the shipped capability registry (eligibility.json) is c/libpng/memory_safety, it is disabled with verdict NO-GO, and its family id memory_safety is not a taxonomy family.",
"not_told": "No defect is reported for memory, so a contributor is not told whether a memory-safety defect such as an out-of-bounds access exists in the change, even when it does."
}
]
}
+6 -2
View File
@@ -94,8 +94,12 @@ class PushReport:
type(value) not in (int, float) or not math.isfinite(value) or value < 0 for value in self.timings.values()
):
raise ValueError("report requires finite nonnegative timings including total_seconds")
if not isinstance(self.advisory_scope, AdvisoryScope):
raise ValueError("report requires a loaded advisory scope")
_require_loaded_scope(self.advisory_scope)
def _require_loaded_scope(scope: object) -> None:
if not isinstance(scope, AdvisoryScope):
raise ValueError("report requires a loaded advisory scope")
@dataclass(frozen=True)