fix(p1,p0): restore the pre-P1 range contract for two callers; docs link and maintainer paths

The full suite after the replay found regressions from 062a7b7 and 94e96c6:
- catalog_gen and candidates.labeled_spans still unpacked 3-tuples and expected None on a parser
  rejection; source.ranges returns FunctionRange (4 fields, module entry first) and raises ValueError.
- ranges_from_ir passed the language to declarator_name, so the repo-facts declaration table named a
  callback call (exec(..., function () {) as a function; the pre-P1 call had no language.
- the catalog_gen fail-loud test blocked the old module name.
- docs: a renumbered examples anchor, and two .kiro paths in the public threat model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Marius Ciepluch
2026-10-13 16:15:32 +02:00
co-authored by Claude Opus 5.5
parent a99579b547
commit 25ae4b489c
6 changed files with 11 additions and 10 deletions
+4 -3
View File
@@ -269,10 +269,11 @@ def _language(recipe: dict[str, object]) -> str:
def _ranges(path: Path, language: str) -> tuple[tuple[str, int, int], ...] | None:
ranges = source_ranges(str(path), path.read_text(errors="ignore"), language)
if ranges is None:
try:
ranges = source_ranges(str(path), path.read_text(errors="ignore"), language)
except ValueError:
return None # parser rejected the excerpt; a regex label would not scope
return tuple(r for r in ranges if r[0] != ANON_FUNCTION)
return tuple((r.name, r.start, r.end) for r in ranges if r.kind == "function" and r.name != ANON_FUNCTION)
def _innermost(ranges: tuple[tuple[str, int, int], ...], line: int) -> str | None: