test(learning-harness): apply the group 1 review suggestions

A mechanism claimed by two families now fails as loudly as a weakness claimed
twice, with a named offender. Two behaviours that were correct but unasserted
are pinned: the obligations tool refuses a path outside the repository, and a
provider that refuses to build degrades to no endpoint instead of raising into
a scan. The TypeScript parse assertion is now exact rather than a quarter-of-
the-slice allowance, which surfaces one real corpus defect: a TSX excerpt
harvested as a truncated destructuring parameter list is not valid TypeScript
on its own, and belongs to the re-harvest rather than to the grammar.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
This commit is contained in:
Marius Ciepluch
2026-09-06 09:40:24 +02:00
co-authored by Claude Opus 5
parent d05c516a10
commit 17fc18c785
5 changed files with 29 additions and 1 deletions
+7
View File
@@ -99,6 +99,7 @@ def load_families(path: Path | None = None, *, require_all: bool = True) -> Fami
raise FamiliesError(f"{source}: version is required")
families: list[Family] = []
claimed: dict[str, str] = {}
claimed_mechanisms: dict[str, str] = {}
for entry in payload.get("family", []):
if not isinstance(entry, dict):
raise FamiliesError(f"{source}: every [[family]] entry must be a table")
@@ -109,6 +110,12 @@ def load_families(path: Path | None = None, *, require_all: bool = True) -> Fami
if cwe in claimed:
raise FamiliesError(f"{source}: {cwe} is claimed by both {claimed[cwe]!r} and {family.id!r}")
claimed[cwe] = family.id
for mechanism in sorted(family.mechanisms):
if mechanism in claimed_mechanisms:
raise FamiliesError(
f"{source}: mechanism {mechanism} is claimed by both {claimed_mechanisms[mechanism]!r} and {family.id!r}"
)
claimed_mechanisms[mechanism] = family.id
families.append(family)
_check_parents(source, families)
if require_all and tuple(family.id for family in families) != FAMILY_IDS: