test(frozen-pin): an added or removed file, and listing order, pinned by tests; drift named apart from missing
K5 survived a full run (a mutant ignoring an extra or removed file left the suite green) and K4 (sort removed) was caught only by corpus data. Now pinned with no corpus: the add arm, the remove arm, and a shuffled directory listing digesting the same. The gate says "pin-drift" for a drifted copy instead of "artefakter mangler"; the unread "store" key is gone from frozen_bundles.json; the forbidden-path scan covers md/yaml/yml/toml and proves a known positive per suffix. Five mutants killed in a scratch clone (drop-last-entry 8 failed, no-sort, no-names, drift-as-missing, scan-suffixes-narrowed 1 failed each). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
a13b905b0c
commit
68079469c3
3 changed files with 108 additions and 17 deletions
|
|
@ -1114,6 +1114,9 @@ class StressMeasure:
|
|||
commissioned: int = 0
|
||||
where: str = ""
|
||||
missing: str = ""
|
||||
#: The pinned copy is on disk but is NOT the pinned copy. Kept apart from ``missing``: absent
|
||||
#: artefacts and a measurement of the wrong corpus are different states with different fixes.
|
||||
drift: str = ""
|
||||
#: Declarations with no ``approach_id`` — written before the rule; the row cannot be measured.
|
||||
unaddressed: int = 0
|
||||
#: Of ``validated``, how many were the runs' own proposals (M-3).
|
||||
|
|
@ -1170,8 +1173,9 @@ def measure_stress(
|
|||
return StressMeasure(where=str(stress_root), missing=f"{context}: base ikke entydig")
|
||||
try:
|
||||
# The frozen copy this repository pins, unless the operator named a live mount.
|
||||
# Drift is a ValueError and absence an OSError: both land in ``missing`` below, so a
|
||||
# corpus that moved is IKKE MÅLT with the reason said, never a silently wrong number.
|
||||
# Drift is a ValueError and absence an OSError: drift lands in ``drift`` and absence
|
||||
# in ``missing``, so a corpus that moved is IKKE MÅLT with its own reason said, never
|
||||
# a silently wrong number and never "artefakter mangler".
|
||||
base = frozen_bundles.bundle_dir(chosen[0]["name"], override=bundle_root)
|
||||
verdicts.append(
|
||||
stress.score_context_set(
|
||||
|
|
@ -1182,6 +1186,8 @@ def measure_stress(
|
|||
bundle_id=chosen[0]["bundle_id"] if len(declared) > 1 else None,
|
||||
)
|
||||
)
|
||||
except frozen_bundles.FrozenBundleDrift as exc:
|
||||
return StressMeasure(where=str(stress_root), drift=f"{run_spec['run_id']}: {exc}")
|
||||
except (stress.EmptyMeasurement, OSError, ValueError) as exc:
|
||||
return StressMeasure(where=str(stress_root), missing=f"{run_spec['run_id']}: {exc}")
|
||||
contexts.add(run_spec["context"])
|
||||
|
|
@ -1227,7 +1233,9 @@ def score_undeclared(
|
|||
k: int | None = None
|
||||
n: int | None = None
|
||||
diagnostics: tuple[str, ...] = ()
|
||||
if m.missing:
|
||||
if m.drift:
|
||||
reason = f"{probe_state}; {label}: ikke målt, pin-drift ({m.drift})"
|
||||
elif m.missing:
|
||||
reason = f"{probe_state}; {label}: ikke målt, artefakter mangler ({m.missing})"
|
||||
elif m.unaddressed:
|
||||
reason = (
|
||||
|
|
@ -1281,14 +1289,16 @@ STRESS_DEPENDENCY = (
|
|||
|
||||
def score_named(m: StressMeasure, label: str) -> Row:
|
||||
title = "7 named (diagnose, ingen terskel)"
|
||||
if m.missing:
|
||||
if m.drift or m.missing:
|
||||
return Row(
|
||||
"named",
|
||||
title,
|
||||
None,
|
||||
None,
|
||||
NOT_MEASURED,
|
||||
f"{label}: ikke målt, artefakter mangler ({m.missing})",
|
||||
f"{label}: ikke målt, pin-drift ({m.drift})"
|
||||
if m.drift
|
||||
else f"{label}: ikke målt, artefakter mangler ({m.missing})",
|
||||
failing=False,
|
||||
diagnostics=(NAMED_WARNING,),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"store": "~/corpora/po-frosne-bundles",
|
||||
"source": "vegnormal-okf build/ferdig, READ-ONLY copy taken 2026-09-18",
|
||||
"renewal": "Ny kopi + ny pin i SAMME commit - se README, 'Frosne kunnskapsbaser'.",
|
||||
"bundles": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue