diff --git a/build_tools/check_rulings.py b/build_tools/check_rulings.py new file mode 100644 index 000000000..32f59eab1 --- /dev/null +++ b/build_tools/check_rulings.py @@ -0,0 +1,935 @@ +#!/usr/bin/env python3 +"""Gate: the ruling records, the law table and the charter agree with each other. + +An owner ruling used to be one row of prose in a charter table. The 2026-11-21 audit +(docs/audits/ruling-audit-2026-11-21.md) found what prose could not hold: rulings that name no +law, rows replaced without a mark, an exception whose law was never changed, two verdicts for one +case. This script makes each of those a failed check. It reads + + docs/process/rulings/rulings.yaml one record per ruling + docs/process/rulings/laws.yaml the written laws and the audit's draft principles + docs/process/rulings/axes.yaml the closed lists a case is named from + docs/process/rulings/policy.yaml which decisions an agent may take alone + docs/process/rulings/known-findings.yaml findings that wait for the owner, each with a reference + docs/process/rounds/*-batching.md the charters (section 4 rows) + +and runs nothing: evidence is re-run by `ruling_evidence.py recheck`. + +Two kinds of record. A record with `seed:` was written by the audit from a charter row: its labels +are a model's reading, kept under `audit:`, and it is held only to the structural checks. Any +other record is *strict*: it is what a new ruling must provide. + +Checks (the name is what a finding and a known-findings row carry): + + schema a record, law, family, policy or known-findings row is malformed. A strict + ruling needs: date, issue, kind, rule, options (one chosen, one recommended), + basis, and laws unless the basis is `choice`; a `language` or `library` one + also needs at least one case with measured evidence. + charter-totality a charter row has no record, or a seed record has no charter row. + law-anchor a written law's `anchor` text is not in its `source` file, or is there more + than once. + reference a law id, ruling id, family, axis or value that does not exist. + supersession `supersedes`/`amends` on one record without `superseded_by`/`amended_by` + on the other, or the reverse. + charter-mark a wholly superseded ruling whose charter row is not struck (or a struck row + whose record names no successor), or an amended ruling whose charter row + does not name the ruling that amended it. + exception-in-law a ruling with `exception_to: L` that L does not name: for a written law, the + law's own section of its source (from its anchor to the next law), not the + whole file; for a draft, the `against` list of its entry. + collision two live cases with the same family and coordinates and different outcomes, + where neither owner supersedes, amends or declares an exception to the other. + invariance a law says an axis does not matter, and two live cases that differ only + along it have different outcomes, without `differs_because` naming the law. + door a strict ruling whose `door`, `breaks_running` or `undo_breaks` is not what + ruling_evidence.derive_door computes from its cases' evidence. + considered a strict ruling that does not answer, in `considered`, every live ruling + and law with a case in the same family. This is how "I looked and nothing + decides it" becomes a list that can be checked for completeness. + owner-required a strict ruling an agent decided (`decided_by: agent`) whose derived door is + not one policy.yaml lets an agent take alone. + +The ratchet: every finding must be absent or listed in known-findings.yaml, and every row there +must still fire. A new finding fails; so does a row whose finding is gone (delete the row). Only +the findings that wait for the owner or for a text can be listed (PARKABLE); a row names its +finding exactly (check, subjects and, for a collision or an invariance, the case in `where`), so +one row never covers two findings. A malformed record is fixed, never listed. + +What this cannot see: whether a label is *right*. A `basis: follows` naming a law that does not +decide the case passes. The case coordinates are the narrow part that is checked for truth: the +coordinates decide which rulings collide, and evidence is measured, not asserted. + +Exit status: 0 clean, 1 findings, 2 the inputs could not be read. +""" + +from __future__ import annotations + +import argparse +import itertools +import re +import sys +from pathlib import Path +from typing import Dict, Iterable, List, NamedTuple, Optional, Set, Tuple + +import yaml + +try: # the package form (tests, `python -m`) and the script form both work + from build_tools import ruling_evidence +except ImportError: # pragma: no cover - exercised only when run as a bare script + import ruling_evidence # type: ignore[no-redef] + +REPO = Path(__file__).resolve().parents[1] +RULINGS_DIR = Path("docs/process/rulings") +ROUNDS_DIR = Path("docs/process/rounds") +ROW_RE = re.compile(r"^\| *(~~)?(R-[A-Z]{1,3})(~~)? *\|(.*)$") +ID_RE = re.compile(r"^R-[A-Z]{1,3}$") + +KINDS = ( + "language", + "library", + "diagnostic", + "implementation", + "cli-lsp", + "test-instrument", + "process", +) +SEMANTIC_KINDS = ("language", "library") +BASES = ("follows", "precedent", "exception", "new-law", "choice") +VERDICTS = ("run", "refuse", "open") +LAW_STATUS = ("written", "draft") +LINKS = (("supersedes", "superseded_by"), ("amends", "amended_by")) +# The checks whose findings may wait in known-findings.yaml: they need the owner, or a text brought +# into line. Each of their findings has a key no other finding shares, so a row covers exactly one. +# Everything else is a defect in a record and is fixed, not parked. +PARKABLE = ("charter-mark", "exception-in-law", "collision", "invariance") + + +class Finding(NamedTuple): + check: str + subjects: Tuple[str, ...] + message: str + where: str = "" # tells two findings of one check about the same subjects apart + + @property + def key(self) -> Tuple[str, Tuple[str, ...], str]: + return self.check, tuple(sorted(self.subjects)), self.where + + +class Case(NamedTuple): + owner: str # a ruling id or a law id + index: int + family: str + coords: Tuple[Tuple[str, str], ...] + outcome: Tuple[str, Optional[str]] # (verdict, answer) + raw: dict + + +class Inputs(NamedTuple): + rulings: List[dict] + laws: List[dict] + families: Dict[str, dict] + policy: dict + known: List[dict] + charter: Dict[str, Tuple[bool, str]] # id -> (struck, row text) + root: Path + charter_duplicates: Tuple[str, ...] = () + + +class InputError(Exception): + pass + + +def _load(path: Path, key: str, kind: type, required: bool = True) -> object: + if not path.is_file(): + if required: + raise InputError(f"missing {path}") + return kind() + try: + data = yaml.safe_load(path.read_text(encoding="utf-8")) or {} + except yaml.YAMLError as exc: + raise InputError(f"{path}: {exc}") from exc + if not isinstance(data, dict) or not isinstance(data.get(key, kind()), kind): + raise InputError(f"{path}: expected a mapping whose `{key}` is a {kind.__name__}") + return data.get(key, kind()) + + +def read_charter(root: Path) -> Tuple[Dict[str, Tuple[bool, str]], Tuple[str, ...]]: + """The ruling rows of every charter's section 4, and the ids that have more than one row.""" + rows: Dict[str, Tuple[bool, str]] = {} + duplicates: List[str] = [] + for path in sorted((root / ROUNDS_DIR).glob("*-batching.md")): + in_rulings = False + for line in path.read_text(encoding="utf-8").splitlines(): + if line.startswith("## "): + in_rulings = line.startswith("## 4.") + continue + match = ROW_RE.match(line) if in_rulings else None + if match: + if match.group(2) in rows: + duplicates.append(match.group(2)) + rows[match.group(2)] = (bool(match.group(1) and match.group(3)), match.group(4)) + return rows, tuple(duplicates) + + +def read_inputs(root: Path) -> Inputs: + base = root / RULINGS_DIR + charter, duplicates = read_charter(root) + return Inputs( + rulings=_load(base / "rulings.yaml", "rulings", list), # type: ignore[arg-type] + laws=_load(base / "laws.yaml", "laws", list), # type: ignore[arg-type] + families=_load(base / "axes.yaml", "families", dict), # type: ignore[arg-type] + policy=_load(base / "policy.yaml", "agent_may_decide", dict, required=False), # type: ignore[arg-type] + known=_load(base / "known-findings.yaml", "findings", list, required=False), # type: ignore[arg-type] + charter=charter, + root=root, + charter_duplicates=duplicates, + ) + + +def sanitized(inputs: Inputs) -> Inputs: + """The inputs without the entries `schema` has already reported as not even the right shape. + + Every other check reads through this, so a string where a record belongs is one schema finding + and never a traceback (which would exit 1 and read as findings). + """ + seen: Set[str] = set() + rulings: List[dict] = [] + for record in inputs.rulings: + if not (isinstance(record, dict) and isinstance(record.get("id"), str) and ID_RE.match(record["id"])): + continue + if record["id"] in seen: + continue + seen.add(record["id"]) + rulings.append(dict(record, cases=_well_formed_cases(record.get("cases")))) + laws: List[dict] = [] + for law in inputs.laws: + if isinstance(law, dict) and isinstance(law.get("id"), str) and law["id"] not in {x["id"] for x in laws}: + invariants = [ + i + for i in (law.get("invariants") if isinstance(law.get("invariants"), list) else []) + if isinstance(i, dict) and isinstance(i.get("family"), str) + ] + laws.append(dict(law, cases=_well_formed_cases(law.get("cases")), invariants=invariants)) + families = { + name: family + for name, family in inputs.families.items() + if isinstance(family, dict) + and isinstance(family.get("axes"), dict) + and all(isinstance(values, list) for values in family["axes"].values()) + } + known = [row for row in inputs.known if isinstance(row, dict)] + return inputs._replace(rulings=rulings, laws=laws, families=families, known=known) + + +def _well_formed_cases(cases: object) -> List[dict]: + if not isinstance(cases, list): + return [] + return [ + case + for case in cases + if isinstance(case, dict) and isinstance(case.get("coords"), dict) and isinstance(case.get("family"), str) + ] + + +def _ids(value: object) -> List[str]: + return [str(v) for v in value] if isinstance(value, list) else [] + + +def is_live(record: dict) -> bool: + return not _ids(record.get("superseded_by")) + + +# --- schema --------------------------------------------------------------------------------------- + + +def _case_problems(owner: str, index: int, case: object, strict: bool) -> Iterable[str]: + where = f"case {index + 1}" + if not isinstance(case, dict): + yield f"{where}: not a mapping" + return + if not isinstance(case.get("family"), str): + yield f"{where}: `family` is required" + if not isinstance(case.get("coords"), dict) or not case["coords"]: + yield f"{where}: `coords` is required" + if case.get("verdict") not in VERDICTS: + yield f"{where}: `verdict` must be one of {', '.join(VERDICTS)}" + if "differs_because" in case and not ( + isinstance(case["differs_because"], str) and case.get("exception_to") + ): + yield f"{where}: `differs_because` needs text and an `exception_to` law" + evidence = case.get("evidence") + if evidence is None: + if strict: + yield f"{where}: a new ruling's case needs measured `evidence` (ruling_evidence.py measure)" + return + if not isinstance(evidence, dict) or not isinstance(evidence.get("program"), str): + yield f"{where}: evidence needs a `program`" + return + for field, kinds in (("sharpy", ruling_evidence.SHARPY_KINDS), ("python", ruling_evidence.PYTHON_KINDS)): + if not ruling_evidence.is_observation(evidence.get(field), kinds): + yield f"{where}: evidence `{field}` is not an observation of kind {', '.join(kinds)}: {evidence.get(field)!r}" + if ("twin" in evidence) == (evidence.get("python") == "no-twin"): + yield f"{where}: evidence has a `twin` exactly when `python` is not `no-twin`" + if strict and not ruling_evidence.is_observation(evidence.get("after"), ruling_evidence.DECIDED_KINDS): + yield f"{where}: a new ruling's evidence needs `after`, the observation the ruling decides ({', '.join(ruling_evidence.DECIDED_KINDS)})" + + +def _ruling_problems(record: dict) -> Iterable[str]: + strict = "seed" not in record + if record.get("kind") not in KINDS: + yield f"`kind` must be one of {', '.join(KINDS)}" + if not isinstance(record.get("rule"), str) or not record["rule"].strip(): + yield "`rule` (the decision in one sentence) is required" + for field in ("supersedes", "superseded_by", "amends", "amended_by"): + if field in record and not isinstance(record[field], list): + yield f"`{field}` must be a list of ruling ids" + cases = record.get("cases") or [] + if not isinstance(cases, list): + yield "`cases` must be a list" + cases = [] + for index, case in enumerate(cases): + yield from _case_problems(str(record.get("id")), index, case, strict) + if not strict: + return + for field in ("date", "issue"): + if not record.get(field): + yield f"a new ruling needs `{field}`" + options = record.get("options") + if ( + not isinstance(options, list) + or len(options) < 2 + or not all(isinstance(o, dict) and o.get("text") for o in options) + ): + yield "a new ruling needs `options`: at least two, each with `text`" + else: + for flag in ("chosen", "recommended"): + if sum(1 for o in options if o.get(flag) is True) != 1: + yield f"exactly one option must be `{flag}: true`" + if record.get("basis") not in BASES: + yield f"`basis` must be one of {', '.join(BASES)}" + elif record["basis"] != "choice" and not _ids(record.get("laws")): + yield f"basis `{record['basis']}` needs `laws`: the law or ruling it rests on" + if record.get("basis") == "exception" and not record.get("exception_to"): + yield "basis `exception` needs `exception_to`: the law it departs from" + if record.get("decided_by") not in ("owner", "agent"): + yield "`decided_by` must be `owner` or `agent`" + if record.get("kind") in SEMANTIC_KINDS and not cases: + yield "a new language or library ruling needs at least one case" + + +def check_schema(inputs: Inputs) -> Iterable[Finding]: + seen: Set[str] = set() + for record in inputs.rulings: + rid = record.get("id") if isinstance(record, dict) else None + if not isinstance(rid, str) or not ID_RE.match(rid): + yield Finding("schema", (str(rid),), "a ruling needs an `id` like R-AB") + continue + if rid in seen: + yield Finding("schema", (rid,), "duplicate id") + seen.add(rid) + for problem in _ruling_problems(record): + yield Finding("schema", (rid,), problem) + seen_laws: Set[str] = set() + for law in inputs.laws: + lid = law.get("id") if isinstance(law, dict) else None + if not isinstance(lid, str) or lid in seen_laws: + yield Finding("schema", (str(lid),), "a law needs a unique `id`") + continue + seen_laws.add(lid) + if law.get("status") not in LAW_STATUS: + yield Finding( + "schema", (lid,), f"`status` must be one of {', '.join(LAW_STATUS)}" + ) + for field in ("statement", "source", "anchor"): + if not isinstance(law.get(field), str) or not law[field].strip(): + yield Finding("schema", (lid,), f"`{field}` is required") + for index, case in enumerate(law.get("cases") or []): + for problem in _case_problems(lid, index, case, strict=False): + yield Finding("schema", (lid,), problem) + for invariant in law.get("invariants") or []: + if not ( + isinstance(invariant, dict) + and isinstance(invariant.get("family"), str) + and _ids(invariant.get("along")) + ): + yield Finding( + "schema", + (lid,), + "an invariant needs `family` and `along`: a list of axes", + ) + for name, family in inputs.families.items(): + axes = family.get("axes") if isinstance(family, dict) else None + if not isinstance(axes, dict) or not all( + isinstance(v, list) and v for v in axes.values() + ): + yield Finding( + "schema", + (name,), + "a family needs `axes`: each a non-empty list of values", + ) + for combo, allowed in inputs.policy.items(): + if combo not in POLICY_KEYS or not isinstance(allowed, bool): + yield Finding( + "schema", + (str(combo),), + f"policy keys are {', '.join(POLICY_KEYS)}, each true or false", + ) + for rid in inputs.charter_duplicates: + yield Finding("schema", (rid,), "the charters hold more than one section-4 row for this ruling") + rows_seen: Set[Tuple[str, Tuple[str, ...], str]] = set() + for row in inputs.known: + if not (isinstance(row, dict) and isinstance(row.get("check"), str) and _ids(row.get("subjects")) and row.get("ref")): + yield Finding("schema", ("known-findings",), f"a row needs `check`, `subjects` and `ref`: {row!r}") + continue + if row["check"] not in PARKABLE: + yield Finding( + "schema", + ("known-findings",), + f"a `{row['check']}` finding cannot wait in known-findings.yaml (only {', '.join(PARKABLE)} can); fix it", + ) + key = known_key(row) + if key in rows_seen: + yield Finding("schema", ("known-findings",), f"two rows for {row['check']}: {' '.join(_ids(row['subjects']))}") + rows_seen.add(key) + + +def known_key(row: dict) -> Tuple[str, Tuple[str, ...], str]: + return str(row.get("check")), tuple(sorted(_ids(row.get("subjects")))), str(row.get("where") or "") + + +# --- cross-reference ------------------------------------------------------------------------------ + + +def check_charter_totality(inputs: Inputs) -> Iterable[Finding]: + records = {r["id"]: r for r in inputs.rulings if isinstance(r.get("id"), str)} + for rid in inputs.charter: + if rid not in records: + yield Finding( + "charter-totality", + (rid,), + "the charter has this ruling and rulings.yaml has no record", + ) + for rid, record in records.items(): + if "seed" in record and rid not in inputs.charter: + yield Finding( + "charter-totality", (rid,), "a seed record with no charter row" + ) + + +def check_law_anchor(inputs: Inputs) -> Iterable[Finding]: + for law in inputs.laws: + if law.get("status") != "written" or not isinstance(law.get("source"), str): + continue + path = inputs.root / law["source"] + if not path.is_file(): + yield Finding("law-anchor", (law["id"],), f"source file {law['source']} does not exist") + continue + count = path.read_text(encoding="utf-8").count(str(law.get("anchor"))) + if count == 0: + yield Finding("law-anchor", (law["id"],), f"anchor text not found in {law['source']}: {law.get('anchor')!r}") + elif count > 1: + # The law's section is read from the anchor (exception-in-law); a second occurrence + # would let an earlier mention of the law stand for its text. + yield Finding("law-anchor", (law["id"],), f"anchor text occurs {count} times in {law['source']}; it must pick out one place: {law.get('anchor')!r}") + + +def _case_refs( + owner: str, case: dict, inputs: Inputs, law_ids: Set[str] +) -> Iterable[Finding]: + family = inputs.families.get(str(case.get("family"))) + if family is None: + yield Finding("reference", (owner,), f"unknown family {case.get('family')!r}") + return + axes = family["axes"] + coords = case.get("coords") or {} + for axis in axes: + if axis not in coords: + yield Finding( + "reference", + (owner,), + f"family {case['family']}: coordinate `{axis}` is missing", + ) + for axis, value in coords.items(): + if axis not in axes: + yield Finding( + "reference", (owner,), f"family {case['family']} has no axis `{axis}`" + ) + elif value not in axes[axis]: + yield Finding( + "reference", + (owner,), + f"axis `{axis}` has no value {value!r} (add it to axes.yaml first)", + ) + answers = family.get("answers") + if answers and case.get("verdict") != "open" and case.get("answer") not in answers: + yield Finding( + "reference", + (owner,), + f"family {case['family']}: `answer` must be one of {', '.join(answers)}", + ) + if case.get("exception_to") and case["exception_to"] not in law_ids: + yield Finding( + "reference", + (owner,), + f"exception_to names no law: {case['exception_to']!r}", + ) + + +def check_reference(inputs: Inputs) -> Iterable[Finding]: + ruling_ids = {r["id"] for r in inputs.rulings if isinstance(r.get("id"), str)} + law_ids = {law["id"] for law in inputs.laws if isinstance(law.get("id"), str)} + for record in inputs.rulings: + rid = str(record.get("id")) + for field in ("supersedes", "superseded_by", "amends", "amended_by"): + for other in _ids(record.get(field)): + if other not in ruling_ids: + yield Finding( + "reference", (rid,), f"`{field}` names no ruling: {other}" + ) + if "seed" not in record: + for law in _ids(record.get("laws")): + if law not in law_ids and law not in ruling_ids: + yield Finding( + "reference", + (rid,), + f"`laws` names neither a law nor a ruling: {law}", + ) + if record.get("exception_to") and record["exception_to"] not in law_ids: + yield Finding( + "reference", + (rid,), + f"exception_to names no law: {record['exception_to']!r}", + ) + for case in record.get("cases") or []: + if isinstance(case, dict): + yield from _case_refs(rid, case, inputs, law_ids) + for law in inputs.laws: + for case in law.get("cases") or []: + if isinstance(case, dict): + yield from _case_refs(str(law.get("id")), case, inputs, law_ids) + for invariant in law.get("invariants") or []: + family = ( + inputs.families.get(str(invariant.get("family"))) + if isinstance(invariant, dict) + else None + ) + if family is None: + yield Finding( + "reference", + (str(law.get("id")),), + f"invariant names no family: {invariant!r}", + ) + continue + for axis in _ids(invariant.get("along")): + if axis not in family["axes"]: + yield Finding( + "reference", + (str(law.get("id")),), + f"invariant axis `{axis}` is not in family {invariant['family']}", + ) + + +def check_supersession(inputs: Inputs) -> Iterable[Finding]: + records = {r["id"]: r for r in inputs.rulings if isinstance(r.get("id"), str)} + for record in records.values(): + for forward, back in LINKS: + for other in _ids(record.get(forward)): + if other in records and record["id"] not in _ids( + records[other].get(back) + ): + yield Finding( + "supersession", + (record["id"], other), + f"{record['id']} `{forward}` {other}, but {other} has no `{back}: [{record['id']}]`", + ) + for other in _ids(record.get(back)): + if other in records and record["id"] not in _ids( + records[other].get(forward) + ): + yield Finding( + "supersession", + (other, record["id"]), + f"{record['id']} is `{back}` {other}, but {other} has no `{forward}: [{record['id']}]`", + ) + + +def check_charter_mark(inputs: Inputs) -> Iterable[Finding]: + for record in inputs.rulings: + rid = record.get("id") + if rid not in inputs.charter: + continue + struck, text = inputs.charter[rid] + successors = _ids(record.get("superseded_by")) + if successors and not struck: + yield Finding( + "charter-mark", + (rid,), + f"superseded by {', '.join(successors)}, but its charter row is not struck through", + ) + if struck and not successors: + yield Finding( + "charter-mark", + (rid,), + "its charter row is struck through, but the record names no `superseded_by`", + ) + for amender in _ids(record.get("amended_by")): + if not re.search(rf"(? Iterable[Tuple[str, str]]: + for record in inputs.rulings: + if not is_live(record): + continue + if record.get("exception_to"): + yield record["id"], record["exception_to"] + for case in record.get("cases") or []: + if isinstance(case, dict) and case.get("exception_to"): + yield record["id"], case["exception_to"] + + +def law_section(text: str, anchor: str) -> Optional[str]: + """The part of a law's source that is that law: from its anchor to where the next one starts. + + A heading anchor runs to the next heading of its level or above. Any other anchor (a bold + paragraph, a list item, a table row) is its own line and the indented lines that continue it: + the first line that is blank or not indented ends it, so a neighbouring paragraph, list item + or table row is never read as part of the law. + """ + start = text.find(anchor) + if start < 0: + return None + line_start = text.rfind("\n", 0, start) + 1 + heading = re.match(r"(#{1,6}) ", text[line_start:]) + if heading: + end = re.compile(rf"^#{{1,{len(heading.group(1))}}} ", re.M).search(text, start + len(anchor)) + return text[line_start : end.start() if end else len(text)] + lines = text[line_start:].split("\n") + kept = [lines[0]] + for line in lines[1:]: + if not line.strip() or not line[0].isspace(): + break + kept.append(line) + return "\n".join(kept) + "\n" + + +def check_exception_in_law(inputs: Inputs) -> Iterable[Finding]: + laws = {law["id"]: law for law in inputs.laws} + for rid, lid in sorted(set(_exceptions(inputs))): + law = laws.get(lid) + if law is None: + continue + if law.get("status") == "draft": + # A draft has no law text to amend; its own entry lists the rulings that go against it. + if rid not in _ids(law.get("against")): + yield Finding("exception-in-law", (rid, lid), f"{rid} is an exception to the draft {lid}, which does not list it under `against`") + continue + path = inputs.root / str(law.get("source")) + section = law_section(path.read_text(encoding="utf-8"), str(law.get("anchor"))) if path.is_file() else None + if section is None: + continue # `law-anchor` reports a missing source or anchor + if not re.search(rf"(? List[Case]: + cases: List[Case] = [] + owners = [(r, is_live(r)) for r in inputs.rulings] + [ + (law, True) for law in inputs.laws + ] + for owner, live in owners: + if not live or not isinstance(owner.get("id"), str): + continue + for index, raw in enumerate(owner.get("cases") or []): + if ( + not isinstance(raw, dict) + or not isinstance(raw.get("coords"), dict) + or raw.get("family") not in inputs.families + ): + continue + coords = tuple(sorted((str(k), str(v)) for k, v in raw["coords"].items())) + cases.append( + Case( + owner["id"], + index, + raw["family"], + coords, + (str(raw.get("verdict")), raw.get("answer")), + raw, + ) + ) + return cases + + +def _related(inputs: Inputs) -> Dict[str, Set[str]]: + """For each ruling: the rulings and laws it supersedes, amends or is declared an exception to.""" + related: Dict[str, Set[str]] = {} + for record in inputs.rulings: + if isinstance(record.get("id"), str): + links = set( + itertools.chain.from_iterable( + _ids(record.get(f)) + for f in ("supersedes", "amends", "superseded_by", "amended_by") + ) + ) + related[record["id"]] = links + for rid, lid in _exceptions(inputs): + related.setdefault(rid, set()).add(lid) + return related + + +def _where(family: str, coords: Iterable[Tuple[str, str]]) -> str: + return (family + " " + ",".join(f"{axis}={value}" for axis, value in coords)).strip() + + +def check_collision(inputs: Inputs) -> Iterable[Finding]: + related = _related(inputs) + cases = live_cases(inputs) + for a, b in itertools.combinations(cases, 2): + if (a.family, a.coords) != (b.family, b.coords) or a.outcome == b.outcome: + continue + # One owner giving one case two verdicts is a collision too; only a recorded relation + # between two owners (supersedes, amends, a declared exception) explains a difference. + if a.owner != b.owner and (b.owner in related.get(a.owner, ()) or a.owner in related.get(b.owner, ())): + continue + yield Finding( + "collision", + (a.owner, b.owner), + f"{a.family} {dict(a.coords)}: {a.owner} says {_show(a)}, {b.owner} says {_show(b)}", + _where(a.family, a.coords), + ) + + +def _show(case: Case) -> str: + verdict, answer = case.outcome + return f"{verdict} ({answer})" if answer else verdict + + +def check_invariance(inputs: Inputs) -> Iterable[Finding]: + cases = live_cases(inputs) + for law in inputs.laws: + for invariant in law.get("invariants") or []: + if not isinstance(invariant, dict): + continue + along = set(_ids(invariant.get("along"))) + compare_answer = bool( + inputs.families.get(str(invariant.get("family")), {}).get("answers") + ) + groups: Dict[Tuple[Tuple[str, str], ...], List[Case]] = {} + for case in cases: + if case.family == invariant.get("family") and case.outcome[0] != "open": + if case.raw.get("exception_to") == law.get("id") and case.raw.get( + "differs_because" + ): + continue + fixed = tuple(pair for pair in case.coords if pair[0] not in along) + groups.setdefault(fixed, []).append(case) + for fixed, members in sorted(groups.items()): + outcome = ( + (lambda c: c.outcome[1]) + if compare_answer + else (lambda c: c.outcome[0]) + ) + if len({outcome(c) for c in members}) > 1: + owners = tuple(sorted({c.owner for c in members})) + detail = "; ".join( + f"{c.owner} {dict(p for p in c.coords if p[0] in along)} -> {_show(c)}" + for c in members + ) + yield Finding( + "invariance", + owners + (law["id"],), + f"{law['id']} says {', '.join(sorted(along))} must not matter in {invariant['family']} {dict(fixed)}: {detail}", + _where(str(invariant["family"]), fixed), + ) + + +# --- strict rulings ------------------------------------------------------------------------------- + +POLICY_KEYS = ( + "no_change", + "reversible_refusal", + "breaking_refusal", + "admission_or_value_change", + "kept_divergence", +) + + +def doors_of(record: dict) -> List[Dict[str, object]]: + """The derived door of each case that has complete evidence.""" + doors: List[Dict[str, object]] = [] + for case in record.get("cases") or []: + evidence = case.get("evidence") if isinstance(case, dict) else None + if not isinstance(evidence, dict) or not all( + ruling_evidence.is_observation(evidence.get(field), kinds) + for field, kinds in ( + ("sharpy", ruling_evidence.SHARPY_KINDS), + ("after", ruling_evidence.DECIDED_KINDS), + ("python", ruling_evidence.PYTHON_KINDS), + ) + ): + continue + door = ruling_evidence.derive_door(evidence["sharpy"], evidence["after"], evidence["python"]) + door["class"] = policy_class(evidence["sharpy"], evidence["after"], door) + doors.append(door) + return doors + + +def door_of(record: dict) -> Optional[Dict[str, object]]: + """The widest door over a ruling's cases, or None when no case has complete evidence. + + Cases that tie agree on both facts, so which one is returned does not change `door`, + `breaks_running` or `undo_breaks`; the policy class is judged per case (check_owner_required). + """ + doors = doors_of(record) + return max(doors, key=lambda d: (d["undo_breaks"], d["breaks_running"])) if doors else None + + +def policy_class(before: str, after: str, door: Dict[str, object]) -> str: + if before == after: + return "kept_divergence" if door["undo_breaks"] else "no_change" + if ruling_evidence.kind_of(after) == "refused": + return "breaking_refusal" if door["breaks_running"] else "reversible_refusal" + return "admission_or_value_change" + + +def check_door(inputs: Inputs) -> Iterable[Finding]: + for record in inputs.rulings: + if "seed" in record or not isinstance(record.get("id"), str): + continue + door = door_of(record) + if door is None: + continue + for field in ("door", "breaks_running", "undo_breaks"): + if record.get(field) != door[field]: + yield Finding( + "door", + (record["id"],), + f"`{field}` is {record.get(field)!r}; the evidence gives {door[field]!r} ({door['why']})", + ) + + +def check_owner_required(inputs: Inputs) -> Iterable[Finding]: + for record in inputs.rulings: + if "seed" in record or record.get("decided_by") != "agent": + continue + doors = doors_of(record) + if not doors: + if record.get("kind") in SEMANTIC_KINDS: + yield Finding("owner-required", (record["id"],), "an agent decided it and no case has measured evidence to derive the door from") + continue + # Every case is judged: one reserved case reserves the ruling, whichever case is "widest". + reserved = sorted({str(d["class"]) for d in doors if inputs.policy.get(d["class"]) is not True}) + if reserved: + why = "; ".join(sorted({str(d["why"]) for d in doors if d["class"] in reserved})) + yield Finding("owner-required", (record["id"],), f"an agent decided a `{', '.join(reserved)}` decision; policy.yaml reserves it for the owner ({why})") + + +def check_considered(inputs: Inputs) -> Iterable[Finding]: + cases = live_cases(inputs) + for record in inputs.rulings: + if "seed" in record or not isinstance(record.get("id"), str): + continue + families = {c.family for c in cases if c.owner == record["id"]} + neighbours = { + c.owner for c in cases if c.family in families and c.owner != record["id"] + } + answered = { + str(item.get("id")) + for item in record.get("considered") or [] + if isinstance(item, dict) and item.get("why") + } + linked = ( + set(_ids(record.get("laws"))) + | set(_ids(record.get("supersedes"))) + | set(_ids(record.get("amends"))) + ) + for missing in sorted(neighbours - answered - linked): + yield Finding( + "considered", + (record["id"], missing), + f"{missing} has a case in the same family; say in `considered` why it does not decide this one (or name it in `laws`)", + ) + + +CHECKS = { + "schema": check_schema, + "charter-totality": check_charter_totality, + "law-anchor": check_law_anchor, + "reference": check_reference, + "supersession": check_supersession, + "charter-mark": check_charter_mark, + "exception-in-law": check_exception_in_law, + "collision": check_collision, + "invariance": check_invariance, + "door": check_door, + "considered": check_considered, + "owner-required": check_owner_required, +} + + +def run_checks(inputs: Inputs) -> List[Finding]: + findings: List[Finding] = list(check_schema(inputs)) + clean = sanitized(inputs) + for name, check in CHECKS.items(): + if name != "schema": + findings.extend(check(clean)) + return findings + + +def judge(inputs: Inputs) -> Tuple[List[Finding], List[Finding], List[dict]]: + """Split the findings into (new, known) and list the known-findings rows that no longer fire.""" + findings = run_checks(inputs) + rows = {known_key(row): row for row in inputs.known if isinstance(row, dict) and row.get("check") in PARKABLE} + fired = {f.key for f in findings} + new = [f for f in findings if f.key not in rows] + known = [f for f in findings if f.key in rows] + stale = [row for key, row in rows.items() if key not in fired] + return new, known, stale + + +def _at(finding: Finding) -> str: + return f" [where: {finding.where}]" if finding.where else "" + + +def main(argv: Optional[List[str]] = None) -> int: + parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0]) + parser.add_argument("--root", type=Path, default=REPO) + parser.add_argument( + "--list-known", + action="store_true", + help="also print the findings that known-findings.yaml covers", + ) + args = parser.parse_args(argv) + try: + inputs = read_inputs(args.root) + except InputError as exc: + print(f"check_rulings: {exc}", file=sys.stderr) + return 2 + new, known, stale = judge(inputs) + for finding in new: + print(f"NEW {finding.check}: {' '.join(finding.subjects)}{_at(finding)}: {finding.message}") + for row in stale: + print( + f"STALE {row.get('check')}: {' '.join(_ids(row.get('subjects')))}: listed in known-findings.yaml and no longer fires; delete the row" + ) + if args.list_known: + for finding in known: + print( + f"known {finding.check}: {' '.join(finding.subjects)}: {finding.message}" + ) + print( + f"check_rulings: {len(inputs.rulings)} rulings, {len(inputs.laws)} laws, {len(live_cases(sanitized(inputs)))} live cases; {len(new)} new, {len(stale)} stale, {len(known)} known findings" + ) + return 1 if new or stale else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/build_tools/ruling_evidence.py b/build_tools/ruling_evidence.py new file mode 100644 index 000000000..e27b20ca3 --- /dev/null +++ b/build_tools/ruling_evidence.py @@ -0,0 +1,409 @@ +#!/usr/bin/env python3 +"""Measured evidence for a ruling: what a program does, and what kind of door a decision is. + +A ruling record (docs/process/rulings/rulings.yaml) carries *cases*, and a case carries +*evidence*: a Sharpy program, optionally its python twin, and what each did when it was run. +This module is the one place that runs them, so a record holds a measurement and never a claim. + +Three uses: + + python3 build_tools/ruling_evidence.py measure prog.spy [--python twin.py] + Run the program (and the twin) and print the evidence block to paste into a case. + + python3 build_tools/ruling_evidence.py door --before --after [--python ] + Print the door a decision is, from the three observations (see derive_door). + + python3 build_tools/ruling_evidence.py recheck + Re-run every evidence program in rulings.yaml and laws.yaml against the built compiler and + the python oracle; exit 1 when one no longer does what its record says. + +An *observation* is one of: + runs: the program compiled and exited 0; is its exact standard output + refused: it did not compile; is the first SPYnnnn error in the diagnostics + (for python: `refused:SyntaxError`, from compiling the file, before any + statement ran; a SyntaxError raised while running is a `raises:`) + crashes: (Sharpy only) the compiler reported an internal error: a code in the Infra + range SPY0900-0999, such as SPY0908 "generated C# failed to compile", or + one of the emitter's own failures in the CodeGen range (CODEGEN_INTERNAL). + It is a defect and never a ruled refusal, so a ruling cannot decide it + (`after`). + raises: it compiled and ended on an uncaught exception of that type; whatever it + printed first follows on the next line (`raises:IndexError\nbefore\n`) + no-twin (python only) python3 has no program that means the same thing + +The door (derive_door). Two facts are computed, and neither is asked of the author: + + breaks_running the decision changes what a program that runs today does: it ran and is now + refused, or it ran and now prints or raises something else. + undo_breaks taking the decision back later would break programs written under it: the + decision lets a program run (it was refused, or it ran differently), or it + keeps a result that python's twin does not give, which users come to rely on. + +`door` is `one-way` when undo_breaks, else `two-way`: the sense of `.claude/skills/batch-issues` +("a refusal can always be relaxed later; ... a runtime-value change is one-way"). The rows of the +charter use the word in two senses, which is why both facts are reported: of the 61 admissions the +2026-11-21 audit classified, 13 are called "additive", 10 "two-way" and 9 "one-way" (keyword +count). Who may decide which combination is docs/process/rulings/policy.yaml, not this module. +""" + +from __future__ import annotations + +import argparse +import os +import re +import subprocess +import sys +import tempfile +from pathlib import Path +from typing import Dict, List, Optional, Tuple + +REPO = Path(__file__).resolve().parents[1] +DEFAULT_SHARPYC = REPO / "src" / "Sharpy.Cli" / "bin" / "Debug" / "net10.0" / "sharpyc" +OBSERVATION_RE = re.compile( + r"^(runs:.*|refused:[A-Za-z0-9_.]+|crashes:SPY\d{4}|raises:[A-Za-z0-9_.]+(\n.*)?|no-twin)$", + re.S, +) +# Which kinds each field of an evidence block may hold. `after` is what a ruling decides. +SHARPY_KINDS = ("runs", "refused", "crashes", "raises") +PYTHON_KINDS = ("runs", "refused", "raises", "no-twin") +DECIDED_KINDS = ("runs", "refused", "raises") +# `sharpyc run` prints the compile banner, a blank line, this line, a blank line, then the program's output. +RUN_BANNER = "=== Running Program ===\n" +SPY_ERROR_RE = re.compile(r"error\[(SPY\d{4})\]") +NET_EXCEPTION_RE = re.compile(r"Unhandled exception\.\s+([\w.]+)") +# The CodeGen range (SPY0500-0599) mixes ruled refusals with the emitter's own failures, so it is +# classified code by code from src/Sharpy.Compiler/Diagnostics/DiagnosticCodes.cs and its +# explanations. A code in neither set is an error, never a guess; test_ruling_evidence.py holds +# the two sets to the Active CodeGen codes of that file. +CODEGEN_INTERNAL = frozenset( + { + "SPY0500", # EmitError: "typically an internal compiler error" + "SPY0501", # UnsupportedFeature: valid Sharpy the generator cannot compile yet + "SPY0508", # PositionalPatternFallback: "an internal compiler warning" + "SPY0510", # UnrecognizedStatementType + "SPY0518", # UnsupportedExpressionType + "SPY0519", # UnsupportedOperator + "SPY0524", # EmittedTreePrecedenceInversion + "SPY0599", # InternalGeneratedCSharpParseError + } +) +CODEGEN_REFUSAL = frozenset( + { + "SPY0522", # MemberNameCollision + "SPY0523", # FunctionModuleClassCollision + "SPY0525", # MemberEnclosingTypeCollision + "SPY0526", # PackageModuleNameCollision + "SPY0550", # GeneratorExecutionError: the user's source generator failed + "SPY0551", # GeneratorTimeout + "SPY0552", # GeneratorInvalidSource + "SPY0553", # GeneratorCycleDetected + "SPY0554", # GeneratorEmptyOutput + "SPY0555", # GeneratorUnsupportedShape + } +) +TIMEOUT_S = 120 + +# Runs the python twin and reports how it ended through a side file, never through stderr text: +# a message, a note or a line printed to stderr can spell any exception name. `compile` first, so +# only a SyntaxError of the file itself is a refusal; one raised while running (eval, an import) +# is an exception like any other. The twin runs as the real `__main__` module, in +# `sys.modules`, as `python main.py` would run it: dataclasses, typing, pickle and +# `import __main__` all look the running module up there. +PY_RUNNER = r""" +import builtins +import sys +import types + +path, result = sys.argv[1], sys.argv[2] +sys.argv = [path] +_open = open # the twin may replace builtins.open + + +def done(text): + try: + sys.stdout.flush() + except Exception: + pass # the twin closed or replaced stdout; what it wrote before is already out + with _open(result, "w", encoding="utf-8") as handle: + handle.write(text) + + +with _open(path, encoding="utf-8") as handle: + source = handle.read() +try: + code = compile(source, path, "exec") +except SyntaxError as exc: + done("refused:" + type(exc).__name__) + raise SystemExit(0) +main = types.ModuleType("__main__") +main.__file__ = path +main.__builtins__ = builtins # a module, as in a script; exec would insert the dict +sys.modules["__main__"] = main +try: + exec(code, main.__dict__) +except SystemExit as exc: + done("runs" if exc.code in (None, 0) else "raises:SystemExit") +except BaseException as exc: + done("raises:" + type(exc).__name__) +else: + done("runs") +""" + + +class EvidenceError(Exception): + """A program could not be measured at all (no compiler, a timeout, unreadable output).""" + + +def is_observation(text: object, kinds: Optional[Tuple[str, ...]] = None) -> bool: + """True when `text` is an observation, of one of `kinds` when given.""" + if not isinstance(text, str) or OBSERVATION_RE.match(text) is None: + return False + return kinds is None or kind_of(text) in kinds + + +def kind_of(observation: str) -> str: + return observation.split(":", 1)[0] + + +def is_internal(code: str) -> bool: + """True when the code means the compiler failed, not that it refused the program.""" + number = int(code[3:]) + if 900 <= number <= 999: + return True + if 500 <= number <= 599: + if code in CODEGEN_INTERNAL: + return True + if code in CODEGEN_REFUSAL: + return False + raise EvidenceError( + f"{code} is a CodeGen code that ruling_evidence.py has not classified; " + "add it to CODEGEN_INTERNAL or CODEGEN_REFUSAL" + ) + return False + + +def _raised(name: str, printed: str) -> str: + return "raises:" + name + ("\n" + printed if printed else "") + + +def sharpyc_path() -> Path: + path = Path(os.environ.get("SHARPYC") or DEFAULT_SHARPYC) + if not path.is_file(): + raise EvidenceError( + f"no built compiler at {path}; build the solution or set SHARPYC" + ) + return path + + +def _run(argv: List[str], cwd: Path) -> Tuple[int, str, str]: + try: + done = subprocess.run( + argv, cwd=cwd, capture_output=True, text=True, timeout=TIMEOUT_S + ) + except subprocess.TimeoutExpired as exc: + raise EvidenceError(f"timed out after {TIMEOUT_S}s: {' '.join(argv)}") from exc + return done.returncode, done.stdout, done.stderr + + +def measure_sharpy(program: str, sharpyc: Optional[Path] = None) -> str: + """Compile and run `program` (it needs a `main()`) with the built compiler; return its observation.""" + sharpyc = sharpyc or sharpyc_path() + with tempfile.TemporaryDirectory(prefix="ruling-evidence-") as tmp: + source = Path(tmp) / "main.spy" + source.write_text(program, encoding="utf-8") + code, out, err = _run([str(sharpyc), "run", str(source)], Path(tmp)) + if RUN_BANNER not in out: + error = SPY_ERROR_RE.search(out + "\n" + err) + if error: + return ("crashes:" if is_internal(error.group(1)) else "refused:") + error.group(1) + raise EvidenceError( + f"sharpyc exited {code} with neither a run banner nor an error code:\n{(out + err).strip()[:800]}" + ) + printed = out.split(RUN_BANNER, 1)[1] + printed = printed[1:] if printed.startswith("\n") else printed + if code == 0: + return "runs:" + printed + net = NET_EXCEPTION_RE.search(err) + if net: + return _raised(net.group(1).rsplit(".", 1)[-1], printed) + raise EvidenceError( + f"the program exited {code} without an unhandled-exception report:\n{err.strip()[:800]}" + ) + + +def measure_python(program: str, python: Optional[str] = None) -> str: + """Run `program` under the python oracle in isolated mode; return its observation.""" + python = python or sys.executable + with tempfile.TemporaryDirectory(prefix="ruling-evidence-") as tmp: + source, runner, result = (Path(tmp) / n for n in ("main.py", "runner.py", "result.txt")) + source.write_text(program, encoding="utf-8") + runner.write_text(PY_RUNNER, encoding="utf-8") + code, out, err = _run([python, "-I", str(runner), str(source), str(result)], Path(tmp)) + ended = result.read_text(encoding="utf-8") if result.is_file() else None + if ended is None: + raise EvidenceError( + f"python exited {code} without reporting how the program ended:\n{err.strip()[:800]}" + ) + if ended == "runs": + return "runs:" + out + if ended.startswith("refused:"): + return ended + return _raised(ended.split(":", 1)[1], out) + + +def derive_door(before: str, after: str, python: str = "no-twin") -> Dict[str, object]: + """The door a decision is, from what the program did before, does after, and does in python.""" + for name, value, kinds in ( + ("before", before, SHARPY_KINDS), + ("after", after, DECIDED_KINDS), + ("python", python, PYTHON_KINDS), + ): + if not is_observation(value, kinds): + raise ValueError( + f"{name}: not an observation of kind {', '.join(kinds)}: {value!r}" + ) + ran_before = kind_of(before) in ("runs", "raises") + runs_after = kind_of(after) in ("runs", "raises") + changed = before != after + breaks_running = ran_before and changed + if not runs_after: + undo_breaks, why = False, "a refusal can be relaxed later" + elif not ran_before: + undo_breaks, why = ( + True, + "it lets a program run that did not compile; programs will be written that need it", + ) + elif changed: + undo_breaks, why = True, "it changes what a running program prints or raises" + elif python != "no-twin" and python != after: + undo_breaks, why = ( + True, + "it keeps a result python's twin does not give; users come to rely on it", + ) + else: + undo_breaks, why = False, "nothing a program can observe changes" + return { + "breaks_running": breaks_running, + "undo_breaks": undo_breaks, + "door": "one-way" if undo_breaks else "two-way", + "why": why, + } + + +def evidence_block( + program: str, twin: Optional[str], sharpyc: Optional[Path], python: Optional[str] +) -> Dict[str, object]: + block: Dict[str, object] = { + "program": program, + "sharpy": measure_sharpy(program, sharpyc), + } + if twin is None: + block["python"] = "no-twin" + else: + block["twin"] = twin + block["python"] = measure_python(twin, python) + return block + + +def recheck( + records: List[Tuple[str, Dict[str, object]]], + sharpyc: Optional[Path], + python: Optional[str], +) -> List[str]: + """Re-run each (owner, evidence) pair; return one line per program that drifted from its record.""" + drift: List[str] = [] + for owner, evidence in records: + seen = measure_sharpy(str(evidence["program"]), sharpyc) + if seen != evidence.get("sharpy"): + drift.append( + f"{owner}: sharpy recorded {evidence.get('sharpy')!r}, now {seen!r}" + ) + if "twin" in evidence: + seen = measure_python(str(evidence["twin"]), python) + if seen != evidence.get("python"): + drift.append( + f"{owner}: python recorded {evidence.get('python')!r}, now {seen!r}" + ) + return drift + + +def _all_evidence(root: Path) -> List[Tuple[str, Dict[str, object]]]: + import yaml + + found: List[Tuple[str, Dict[str, object]]] = [] + base = root / "docs" / "process" / "rulings" + for file, key in (("rulings.yaml", "rulings"), ("laws.yaml", "laws")): + for owner in ( + yaml.safe_load((base / file).read_text(encoding="utf-8")) or {} + ).get(key) or []: + for index, case in enumerate(owner.get("cases") or []): + if isinstance(case.get("evidence"), dict): + found.append( + (f"{owner.get('id')} case {index + 1}", case["evidence"]) + ) + return found + + +def main(argv: Optional[List[str]] = None) -> int: + parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0]) + sub = parser.add_subparsers(dest="command", required=True) + measure = sub.add_parser( + "measure", help="run a program and print its evidence block" + ) + measure.add_argument("program", type=Path) + measure.add_argument( + "--python", dest="twin", type=Path, help="the python twin of the program" + ) + door = sub.add_parser("door", help="print the door for three observations") + door.add_argument("--before", required=True) + door.add_argument("--after", required=True) + door.add_argument("--python", default="no-twin") + again = sub.add_parser("recheck", help="re-run every recorded evidence program") + again.add_argument("--root", type=Path, default=REPO) + for command in (measure, again): + command.add_argument("--sharpyc", type=Path, default=None) + command.add_argument( + "--python-exe", + default=None, + help="the python oracle (default: this interpreter)", + ) + args = parser.parse_args(argv) + + try: + if args.command == "measure": + import yaml + + twin = args.twin.read_text(encoding="utf-8") if args.twin else None + block = evidence_block( + args.program.read_text(encoding="utf-8"), + twin, + args.sharpyc, + args.python_exe, + ) + print( + yaml.safe_dump( + {"evidence": block}, + sort_keys=False, + allow_unicode=True, + default_style=None, + ), + end="", + ) + return 0 + if args.command == "door": + for key, value in derive_door(args.before, args.after, args.python).items(): + print(f"{key}: {value}") + return 0 + records = _all_evidence(args.root) + drift = recheck(records, args.sharpyc, args.python_exe) + for line in drift: + print(line) + print(f"ruling evidence: {len(records)} programs re-run, {len(drift)} drifted") + return 1 if drift else 0 + except (EvidenceError, ValueError) as exc: + print(f"ruling evidence: {exc}", file=sys.stderr) + return 2 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/build_tools/tests/test_check_rulings.py b/build_tools/tests/test_check_rulings.py new file mode 100644 index 000000000..85ba1e281 --- /dev/null +++ b/build_tools/tests/test_check_rulings.py @@ -0,0 +1,983 @@ +"""Tests for build_tools/check_rulings.py: the ruling records, the law table and the charter agree. + +Every check is exercised on a scratch tree that starts clean: one edit makes exactly the named +finding appear, so each test is a mutation of the data with its control (`test_base_is_clean`). +The real tree is then judged as it stands, with positive controls: the conflicts the 2026-11-21 +audit verified by reading the rows must be the ones the checks report. +""" + +from __future__ import annotations + +import copy +import os +import sys +from pathlib import Path +from typing import Callable, Dict, List, Optional, Set, Tuple + +import pytest +import yaml + +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) + +import check_rulings as mod +import ruling_evidence + +REPO = Path(__file__).resolve().parents[2] + +LAW_TEXT = ( + "# Laws\n\n### L1. Sites agree\n\nOne verdict at every site. Exception: R-C.\n" +) +CHARTER = ( + "## 4. Rulings\n\n| Ruling | Issue | Content |\n|---|---|---|\n" + "| R-A | #1 | first; amended by R-C |\n" + "| ~~R-B~~ | #2 | second; superseded by R-C |\n" + "| R-C | #3 | third |\n" +) +RAN = "runs:1\n" +REFUSED = "refused:SPY0402" + + +def seed(rid: str, **extra: object) -> dict: + record = { + "id": rid, + "seed": "audit", + "kind": "language", + "rule": f"what {rid} decided", + } + record.update(extra) + return record + + +def case(site: str, verdict: str, **extra: object) -> dict: + data = { + "family": "eq", + "coords": {"site": site, "operand": "ref"}, + "verdict": verdict, + } + data.update(extra) + return data + + +def evidence(before: str, after: str, python: str = "no-twin") -> dict: + block = { + "program": "def main() -> None:\n pass\n", + "sharpy": before, + "after": after, + "python": python, + } + if python != "no-twin": + block["twin"] = "pass\n" + return block + + +def strict(rid: str = "R-D", **extra: object) -> dict: + """A new ruling that meets the strict schema: an agent keeps a refusal that is already there.""" + record = { + "id": rid, + "date": "2026-11-22", + "issue": "#9", + "kind": "language", + "rule": "a refused program stays refused", + "options": [ + {"text": "keep the refusal", "chosen": True, "recommended": True}, + {"text": "admit it"}, + ], + "basis": "follows", + "laws": ["L1"], + "decided_by": "agent", + "door": "two-way", + "breaks_running": False, + "undo_breaks": False, + "cases": [case("slice", "refuse", evidence=evidence(REFUSED, REFUSED))], + "considered": [{"id": "R-A", "why": "R-A is the operator site; this is a slice"}], + } + record.update(extra) + return record + + +def base() -> Dict[str, object]: + return { + "rulings": [ + seed("R-A", amended_by=["R-C"], cases=[case("operator", "refuse")]), + seed("R-B", superseded_by=["R-C"], cases=[case("operator", "run")]), + seed("R-C", supersedes=["R-B"], amends=["R-A"]), + ], + "laws": [ + { + "id": "L1", + "status": "written", + "source": "docs/laws.md", + "anchor": "### L1. Sites agree", + "statement": "one verdict per site", + } + ], + "families": { + "eq": { + "axes": { + "site": ["operator", "search", "slice"], + "operand": ["ref", "value"], + } + } + }, + "policy": { + "no_change": True, + "reversible_refusal": True, + "breaking_refusal": False, + "admission_or_value_change": False, + "kept_divergence": False, + }, + "known": [], + "charter": CHARTER, + "law_text": LAW_TEXT, + } + + +def write(root: Path, data: Dict[str, object]) -> Path: + rulings = root / mod.RULINGS_DIR + rulings.mkdir(parents=True, exist_ok=True) + (root / mod.ROUNDS_DIR).mkdir(parents=True, exist_ok=True) + (root / mod.ROUNDS_DIR / "round-x-batching.md").write_text( + str(data["charter"]), encoding="utf-8" + ) + (root / "docs" / "laws.md").write_text(str(data["law_text"]), encoding="utf-8") + for name, key, value in ( + ("rulings.yaml", "rulings", data["rulings"]), + ("laws.yaml", "laws", data["laws"]), + ("axes.yaml", "families", data["families"]), + ("policy.yaml", "agent_may_decide", data["policy"]), + ("known-findings.yaml", "findings", data["known"]), + ): + (rulings / name).write_text( + yaml.safe_dump({key: value}, sort_keys=False), encoding="utf-8" + ) + return root + + +def findings( + tmp_path: Path, edit: Optional[Callable[[Dict[str, object]], None]] = None +) -> List[mod.Finding]: + data = base() + if edit: + edit(data) + return mod.run_checks(mod.read_inputs(write(tmp_path, data))) + + +def names(found: List[mod.Finding]) -> Set[str]: + return {f.check for f in found} + + +def keys(found: List[mod.Finding]) -> Set[Tuple[str, Tuple[str, ...]]]: + return {f.key[:2] for f in found} + + +def rulings(data: Dict[str, object]) -> List[dict]: + return data["rulings"] # type: ignore[return-value] + + +# --- the control ---------------------------------------------------------------------------------- + + +def test_base_is_clean(tmp_path): + assert findings(tmp_path) == [] + + +def test_a_strict_ruling_that_meets_the_schema_is_clean(tmp_path): + assert findings(tmp_path, lambda d: rulings(d).append(strict())) == [] + + +# --- schema --------------------------------------------------------------------------------------- + + +@pytest.mark.parametrize( + "drop, message", + [ + ("date", "needs `date`"), + ("issue", "needs `issue`"), + ("options", "needs `options`"), + ("basis", "`basis` must be one of"), + ("laws", "needs `laws`"), + ("decided_by", "`decided_by` must be"), + ("cases", "needs at least one case"), + ("rule", "`rule`"), + ], +) +def test_a_strict_ruling_missing_a_field_is_refused(tmp_path, drop, message): + def edit(data): + record = strict() + del record[drop] + rulings(data).append(record) + + found = [f for f in findings(tmp_path, edit) if f.check == "schema"] + assert any(message in f.message for f in found), found + + +def test_a_seed_record_is_not_held_to_the_strict_fields(tmp_path): + # R-A in the base has no date, options, basis or evidence and is clean: the audit's records are + # grandfathered, a new ruling is not. + assert "schema" not in names(findings(tmp_path)) + + +def test_exactly_one_option_is_chosen_and_one_recommended(tmp_path): + def edit(data): + record = strict() + record["options"][1]["recommended"] = True + rulings(data).append(record) + + found = findings(tmp_path, edit) + assert any( + "exactly one option must be `recommended: true`" in f.message for f in found + ) + + +def test_a_strict_case_needs_measured_evidence_and_the_decided_observation(tmp_path): + def no_evidence(data): + rulings(data).append(strict(cases=[case("slice", "refuse")])) + + assert any( + "needs measured `evidence`" in f.message + for f in findings(tmp_path, no_evidence) + ) + + def no_after(data): + block = evidence(REFUSED, REFUSED) + del block["after"] + rulings(data).append(strict(cases=[case("slice", "refuse", evidence=block)])) + + assert any("needs `after`" in f.message for f in findings(tmp_path, no_after)) + + +def test_an_observation_must_be_one_of_the_four_shapes(tmp_path): + def edit(data): + rulings(data).append( + strict( + cases=[case("slice", "refuse", evidence=evidence("prints 1", REFUSED))] + ) + ) + + assert any("not an observation" in f.message for f in findings(tmp_path, edit)) + + +def test_duplicate_ids_and_bad_enums_are_schema_findings(tmp_path): + def edit(data): + rulings(data).append(seed("R-A")) + rulings(data).append(seed("R-E", kind="vibes")) + data["policy"]["anything"] = True + + messages = [f.message for f in findings(tmp_path, edit) if f.check == "schema"] + assert any("duplicate id" in m for m in messages) + assert any("`kind` must be one of" in m for m in messages) + assert any("policy keys are" in m for m in messages) + + +# --- charter and law text ------------------------------------------------------------------------- + + +def test_a_charter_row_without_a_record_fails(tmp_path): + def edit(data): + data["charter"] += "| R-Z | #4 | a ruling nobody recorded |\n" + + assert ("charter-totality", ("R-Z",)) in keys(findings(tmp_path, edit)) + + +def test_a_seed_record_without_a_charter_row_fails_and_a_strict_one_does_not(tmp_path): + assert ("charter-totality", ("R-E",)) in keys( + findings(tmp_path, lambda d: rulings(d).append(seed("R-E"))) + ) + assert "charter-totality" not in names( + findings(tmp_path, lambda d: rulings(d).append(strict())) + ) + + +def test_a_written_law_whose_anchor_is_gone_fails(tmp_path): + def edit(data): + data["law_text"] = LAW_TEXT.replace("### L1. Sites agree", "### L1. Renamed") + + assert ("law-anchor", ("L1",)) in keys(findings(tmp_path, edit)) + + +def test_a_draft_law_is_not_held_to_an_anchor(tmp_path): + def edit(data): + data["laws"].append( + { + "id": "P-x", + "status": "draft", + "source": "docs/nowhere.md", + "anchor": "x", + "statement": "s", + } + ) + + assert "law-anchor" not in names(findings(tmp_path, edit)) + + +# --- references ----------------------------------------------------------------------------------- + + +def test_unknown_family_axis_value_and_law_are_reference_findings(tmp_path): + def edit(data): + rulings(data).append( + seed( + "R-E", + cases=[{"family": "nope", "coords": {"a": "b"}, "verdict": "run"}], + ) + ) + rulings(data)[0]["cases"].append( + { + "family": "eq", + "coords": {"site": "operator", "operand": "martian"}, + "verdict": "run", + } + ) + rulings(data)[0]["cases"].append( + {"family": "eq", "coords": {"site": "operator"}, "verdict": "run"} + ) + rulings(data).append(strict(laws=["L99"])) + + messages = [f.message for f in findings(tmp_path, edit) if f.check == "reference"] + assert any("unknown family 'nope'" in m for m in messages) + assert any("no value 'martian'" in m for m in messages) + assert any("coordinate `operand` is missing" in m for m in messages) + assert any("names neither a law nor a ruling: L99" in m for m in messages) + + +def test_a_strict_ruling_may_rest_on_an_earlier_ruling(tmp_path): + assert "reference" not in names( + findings( + tmp_path, + lambda d: rulings(d).append(strict(basis="precedent", laws=["R-A"])), + ) + ) + + +# --- supersession --------------------------------------------------------------------------------- + + +def test_one_sided_supersession_fails_in_both_directions(tmp_path): + def forward_only(data): + del rulings(data)[1]["superseded_by"] + + found = findings(tmp_path, forward_only) + assert ("supersession", ("R-B", "R-C")) in keys(found) + + def back_only(data): + del rulings(data)[2]["amends"] + + assert ("supersession", ("R-A", "R-C")) in keys(findings(tmp_path, back_only)) + + +def test_a_superseded_ruling_needs_a_struck_charter_row(tmp_path): + def edit(data): + data["charter"] = CHARTER.replace("~~R-B~~", "R-B") + + assert ("charter-mark", ("R-B",)) in keys(findings(tmp_path, edit)) + + +def test_a_struck_charter_row_needs_a_successor_in_the_record(tmp_path): + def edit(data): + data["charter"] = CHARTER.replace("| R-C |", "| ~~R-C~~ |") + + assert ("charter-mark", ("R-C",)) in keys(findings(tmp_path, edit)) + + +def test_an_amended_rulings_row_must_name_the_amending_ruling(tmp_path): + def edit(data): + data["charter"] = CHARTER.replace("first; amended by R-C", "first") + + assert ("charter-mark", ("R-A", "R-C")) in keys(findings(tmp_path, edit)) + + +def test_naming_a_longer_id_is_not_naming_the_ruling(tmp_path): + # R-CA is another ruling; the row must name R-C itself. + def edit(data): + data["charter"] = CHARTER.replace("first; amended by R-C", "first; see R-CA") + + assert ("charter-mark", ("R-A", "R-C")) in keys(findings(tmp_path, edit)) + + +# --- exceptions ----------------------------------------------------------------------------------- + + +def test_an_exception_the_law_text_does_not_name_fails(tmp_path): + def edit(data): + rulings(data)[2]["cases"] = [ + case( + "search", + "run", + exception_to="L1", + differs_because="python documents it", + ) + ] + data["law_text"] = LAW_TEXT.replace(" Exception: R-C.", "") + + assert ("exception-in-law", ("L1", "R-C")) in keys(findings(tmp_path, edit)) + + +def test_an_exception_the_law_text_names_is_clean(tmp_path): + def edit(data): + rulings(data)[2]["cases"] = [ + case( + "search", + "run", + exception_to="L1", + differs_because="python documents it", + ) + ] + + assert "exception-in-law" not in names(findings(tmp_path, edit)) + + +# --- collision ------------------------------------------------------------------------------------ + + +def test_two_live_rulings_with_one_case_and_two_verdicts_collide(tmp_path): + def edit(data): + rulings(data)[2]["cases"] = [case("operator", "run")] + del rulings(data)[2]["amends"], rulings(data)[0]["amended_by"] + data["charter"] = CHARTER.replace("first; amended by R-C", "first") + + assert keys(findings(tmp_path, edit)) == {("collision", ("R-A", "R-C"))} + + +def test_a_superseded_ruling_does_not_collide(tmp_path): + # R-B (superseded) says run where R-A says refuse, in the base: no finding. + assert "collision" not in names(findings(tmp_path)) + + +def test_a_ruling_that_amends_the_other_does_not_collide(tmp_path): + def edit(data): + rulings(data)[2]["cases"] = [case("operator", "run")] + + assert "collision" not in names(findings(tmp_path, edit)) + + +def test_an_open_verdict_collides_with_a_decided_one(tmp_path): + def edit(data): + rulings(data).append(seed("R-E", cases=[case("operator", "open")])) + data["charter"] += "| R-E | #5 | parks it |\n" + + assert ("collision", ("R-A", "R-E")) in keys(findings(tmp_path, edit)) + + +def test_a_laws_own_case_collides_with_a_ruling(tmp_path): + def edit(data): + data["laws"][0]["cases"] = [case("operator", "run")] + + assert ("collision", ("L1", "R-A")) in keys(findings(tmp_path, edit)) + + +# --- invariance ----------------------------------------------------------------------------------- + + +def invariant(data): + data["laws"][0]["invariants"] = [{"family": "eq", "along": ["site"]}] + + +def test_an_invariant_axis_with_two_verdicts_fails(tmp_path): + def edit(data): + invariant(data) + rulings(data)[2]["cases"] = [case("search", "run")] + + assert ("invariance", ("L1", "R-A", "R-C")) in keys(findings(tmp_path, edit)) + + +def test_the_same_two_cases_without_the_invariant_are_clean(tmp_path): + def edit(data): + rulings(data)[2]["cases"] = [case("search", "run")] + + assert findings(tmp_path, edit) == [] + + +def test_a_stated_exception_to_the_invariant_is_clean(tmp_path): + def edit(data): + invariant(data) + rulings(data)[2]["cases"] = [ + case( + "search", + "run", + exception_to="L1", + differs_because="python documents it", + ) + ] + + assert findings(tmp_path, edit) == [] + + +def test_cases_that_differ_on_another_axis_are_not_compared(tmp_path): + def edit(data): + invariant(data) + rulings(data)[2]["cases"] = [ + { + "family": "eq", + "coords": {"site": "search", "operand": "value"}, + "verdict": "run", + } + ] + + assert findings(tmp_path, edit) == [] + + +def test_a_family_with_answers_is_compared_by_answer(tmp_path): + def edit(data): + invariant(data) + data["families"]["eq"]["answers"] = ["identity", "value"] + rulings(data)[0]["cases"] = [case("operator", "run", answer="identity")] + rulings(data)[1]["cases"] = [case("operator", "run", answer="identity")] + rulings(data)[2]["cases"] = [case("search", "run", answer="value")] + + assert ("invariance", ("L1", "R-A", "R-C")) in keys(findings(tmp_path, edit)) + + +# --- the door, and who may decide ----------------------------------------------------------------- + + +def test_a_door_that_is_not_what_the_evidence_gives_fails(tmp_path): + def edit(data): + rulings(data).append(strict(door="one-way")) + + found = [f for f in findings(tmp_path, edit) if f.check == "door"] + assert len(found) == 1 and "the evidence gives 'two-way'" in found[0].message + + +def test_an_admission_is_one_way_and_reserved_for_the_owner(tmp_path): + admit = dict( + door="one-way", + breaks_running=False, + undo_breaks=True, + cases=[case("slice", "run", evidence=evidence(REFUSED, RAN))], + ) + assert ("owner-required", ("R-D",)) in keys( + findings(tmp_path, lambda d: rulings(d).append(strict(**admit))) + ) + assert ( + findings( + tmp_path, lambda d: rulings(d).append(strict(decided_by="owner", **admit)) + ) + == [] + ) + + +def test_the_policy_file_decides_what_an_agent_may_take(tmp_path): + admit = dict( + door="one-way", + breaks_running=False, + undo_breaks=True, + cases=[case("slice", "run", evidence=evidence(REFUSED, RAN))], + ) + + def edit(data): + data["policy"]["admission_or_value_change"] = True + rulings(data).append(strict(**admit)) + + assert findings(tmp_path, edit) == [] + + +def test_refusing_a_running_program_is_reserved_for_the_owner(tmp_path): + breaking = dict( + door="two-way", + breaks_running=True, + undo_breaks=False, + cases=[case("slice", "refuse", evidence=evidence(RAN, REFUSED))], + ) + found = findings(tmp_path, lambda d: rulings(d).append(strict(**breaking))) + assert ( + keys(found) == {("owner-required", ("R-D",))} + and "breaking_refusal" in found[0].message + ) + + +def test_keeping_a_result_python_does_not_give_is_one_way(tmp_path): + kept = dict( + decided_by="owner", + door="two-way", + cases=[ + case("slice", "run", evidence=evidence(RAN, RAN, "refused:SyntaxError")) + ], + ) + found = [ + f + for f in findings(tmp_path, lambda d: rulings(d).append(strict(**kept))) + if f.check == "door" + ] + assert any( + "`door` is 'two-way'; the evidence gives 'one-way'" in f.message for f in found + ) + + +# --- considered ----------------------------------------------------------------------------------- + + +def test_a_new_ruling_must_answer_every_ruling_in_its_family(tmp_path): + def edit(data): + rulings(data).append(strict(laws=["R-C"], basis="precedent", considered=[])) + + assert ("considered", ("R-A", "R-D")) in keys(findings(tmp_path, edit)) + + +def test_answering_in_considered_or_resting_on_it_in_laws_is_clean(tmp_path): + def answered(data): + rulings(data).append( + strict( + laws=["R-C"], + basis="precedent", + considered=[ + {"id": "R-A", "why": "R-A is the operator site; this is a slice"} + ], + ) + ) + + assert findings(tmp_path, answered) == [] + assert ( + findings( + tmp_path, + lambda d: rulings(d).append(strict(laws=["R-A"], basis="precedent", considered=[])), + ) + == [] + ) + + +def test_an_empty_why_is_not_an_answer(tmp_path): + def edit(data): + rulings(data).append( + strict( + laws=["R-C"], basis="precedent", considered=[{"id": "R-A", "why": ""}] + ) + ) + + assert ("considered", ("R-A", "R-D")) in keys(findings(tmp_path, edit)) + + +# --- the ratchet ---------------------------------------------------------------------------------- + + +def judged(tmp_path: Path, edit: Callable[[Dict[str, object]], None]): + data = base() + edit(data) + return mod.judge(mod.read_inputs(write(tmp_path, data))) + + +def collide(data): + """R-C gives the operator site a second verdict, with no relation to R-A recorded.""" + rulings(data)[2]["cases"] = [case("operator", "run")] + del rulings(data)[2]["amends"], rulings(data)[0]["amended_by"] + data["charter"] = CHARTER.replace("first; amended by R-C", "first") + + +WHERE = "eq operand=ref,site=operator" + + +def test_a_listed_finding_is_known_and_an_unlisted_one_is_new(tmp_path): + def edit(data): + collide(data) + data["charter"] += "| R-Z | #4 | unrecorded |\n" + data["known"].append({"check": "collision", "subjects": ["R-A", "R-C"], "where": WHERE, "ref": "audit 6.1"}) + + new, known, stale = judged(tmp_path, edit) + assert [f.key for f in new] == [("charter-totality", ("R-Z",), "")] + assert [f.key for f in known] == [("collision", ("R-A", "R-C"), WHERE)] + assert stale == [] + + +def test_a_row_whose_finding_is_gone_is_stale(tmp_path): + def edit(data): + data["known"].append({"check": "collision", "subjects": ["R-A", "R-C"], "where": WHERE, "ref": "audit 6.1"}) + + new, known, stale = judged(tmp_path, edit) + assert new == [] and known == [] and len(stale) == 1 + + +def test_a_row_covers_one_case_and_not_another_between_the_same_rulings(tmp_path): + # Two collisions between R-A and R-C, one row: the second collision is new, not hidden. + def edit(data): + collide(data) + rulings(data)[0]["cases"].append(case("search", "refuse")) + rulings(data)[2]["cases"].append(case("search", "run")) + data["known"].append({"check": "collision", "subjects": ["R-A", "R-C"], "where": WHERE, "ref": "audit 6.1"}) + + new, known, stale = judged(tmp_path, edit) + assert [f.key for f in new] == [("collision", ("R-A", "R-C"), "eq operand=ref,site=search")] + assert len(known) == 1 and stale == [] + + +def test_a_row_without_the_case_does_not_cover_a_collision(tmp_path): + def edit(data): + collide(data) + data["known"].append({"check": "collision", "subjects": ["R-A", "R-C"], "ref": "audit 6.1"}) + + new, known, stale = judged(tmp_path, edit) + assert [f.check for f in new] == ["collision"] and known == [] and len(stale) == 1 + + +@pytest.mark.parametrize("check", ["schema", "reference", "door", "considered", "owner-required", "charter-totality", "vibes"]) +def test_only_findings_that_wait_for_the_owner_can_be_listed(tmp_path, check): + # A malformed record is fixed, not parked: a `schema: [R-D]` row would hide every later schema + # finding about R-D behind one key. + def edit(data): + record = strict() + del record["issue"], record["basis"] + rulings(data).append(record) + data["known"].append({"check": check, "subjects": ["R-D"], "ref": "x"}) + + new, known, _ = judged(tmp_path, edit) + assert known == [] + assert any(f.check == "schema" and "cannot wait in known-findings.yaml" in f.message for f in new) + assert sum(1 for f in new if f.check == "schema" and f.subjects == ("R-D",)) >= 2 + + +def test_two_identical_known_rows_are_refused(tmp_path): + def edit(data): + collide(data) + row = {"check": "collision", "subjects": ["R-A", "R-C"], "where": WHERE, "ref": "audit 6.1"} + data["known"] += [row, dict(row, subjects=["R-C", "R-A"])] + + new, _, _ = judged(tmp_path, edit) + assert any(f.check == "schema" and "two rows for collision" in f.message for f in new) + + +def test_main_exit_codes(tmp_path, capsys): + write(tmp_path, base()) + assert mod.main(["--root", str(tmp_path)]) == 0 + data = base() + data["charter"] += "| R-Z | #4 | unrecorded |\n" + write(tmp_path, data) + assert mod.main(["--root", str(tmp_path)]) == 1 + assert "NEW charter-totality: R-Z" in capsys.readouterr().out + (tmp_path / mod.RULINGS_DIR / "rulings.yaml").unlink() + assert mod.main(["--root", str(tmp_path)]) == 2 + + +# --- findings of the independent review @ 993681ab3 -------------------------------------------- + + +def test_an_exception_named_only_under_another_laws_heading_fails(tmp_path): + # The source names R-C, but in L2's section; L1's own text does not. + def edit(data): + rulings(data)[2]["cases"] = [case("search", "run", exception_to="L1", differs_because="python documents it")] + data["law_text"] = "# Laws\n\n### L1. Sites agree\n\nOne verdict.\n\n### L2. Other\n\nException: R-C.\n" + + assert ("exception-in-law", ("L1", "R-C")) in keys(findings(tmp_path, edit)) + + +def test_law_section_stops_at_the_next_law(): + text = "intro R-A\n\n### L1. One\n\nbody R-B\n\n#### detail\n\nR-C\n\n### L2. Two\n\nR-D\n\n## Higher\n" + section = mod.law_section(text, "### L1. One") + assert "R-B" in section and "R-C" in section and "R-A" not in section and "R-D" not in section + assert mod.law_section(text, "absent") is None + + +def test_a_law_that_is_not_a_heading_is_its_line_and_the_indented_lines_after_it(): + # A neighbour is never read as part of the law: the next list item, an adjacent bold + # paragraph with no blank line between, the next table row (second review @ 87da77896). + items = "1. **First.** R-A\n wrapped R-B\n2. **Second.** R-C\n" + assert mod.law_section(items, "1. **First.**") == "1. **First.** R-A\n wrapped R-B\n" + bold = "**L1:** R-A\n**L2:** R-B\n" + assert mod.law_section(bold, "**L1:**") == "**L1:** R-A\n" + table = "| L1 | text R-A |\n| L2 | text R-B |\n" + assert mod.law_section(table, "| L1 |") == "| L1 | text R-A |\n" + bullets = "- **Wrap** R-A\n\n not this R-B\n" + assert mod.law_section(bullets, "**Wrap**") == "- **Wrap** R-A\n" + + +def test_an_anchor_that_occurs_twice_fails(tmp_path): + # exception-in-law reads the law from its anchor; an earlier mention must not stand for it. + def edit(data): + data["law_text"] = "See ### L1. Sites agree, and R-C.\n\n" + LAW_TEXT + + found = [f for f in findings(tmp_path, edit) if f.check == "law-anchor"] + assert len(found) == 1 and "occurs 2 times" in found[0].message + + +def test_an_exception_to_a_draft_law_must_be_in_its_against_list(tmp_path): + def edit(listed): + def apply(data): + draft = {"id": "P-x", "status": "draft", "source": "docs/laws.md", "anchor": "x", "statement": "s"} + if listed: + draft["against"] = ["R-C"] + data["laws"].append(draft) + # docs/laws.md names R-C, as the audit document names nearly every ruling: not enough. + rulings(data)[2]["cases"] = [case("search", "run", exception_to="P-x", differs_because="why")] + + return apply + + assert ("exception-in-law", ("P-x", "R-C")) in keys(findings(tmp_path, edit(False))) + assert "exception-in-law" not in names(findings(tmp_path, edit(True))) + + +@pytest.mark.parametrize( + "bad", + [ + "a string where a record belongs", + {"id": ["R-Q"], "seed": "x", "kind": "language", "rule": "r"}, + {"id": 7, "seed": "x", "kind": "language", "rule": "r"}, + {"id": "R-Q", "seed": "x", "kind": "language", "rule": "r", "cases": "none"}, + {"id": "R-Q", "seed": "x", "kind": "language", "rule": "r", "cases": ["text", {"family": "eq", "coords": "x", "verdict": "run"}]}, + {"id": "R-Q", "seed": "x", "kind": "language", "rule": "r", "superseded_by": "R-C"}, + ], +) +def test_a_malformed_record_is_a_schema_finding_and_never_a_traceback(tmp_path, bad): + def edit(data): + rulings(data).append(bad) + data["charter"] += "| R-Q | #7 | q |\n" + + found = findings(tmp_path, edit) + assert "schema" in names(found) + + +def test_malformed_laws_families_and_known_rows_do_not_crash(tmp_path, capsys): + def edit(data): + data["laws"] += ["a string", {"id": "L3", "status": "written", "source": "docs/laws.md", "anchor": "# Laws", "statement": "s", "cases": "x", "invariants": "y"}] + data["families"]["broken"] = {"axes": "not a mapping"} + data["families"]["text"] = "not a mapping" + data["known"].append("a string") + + data = base() + edit(data) + write(tmp_path, data) + assert mod.main(["--root", str(tmp_path)]) == 1 + out = capsys.readouterr().out + assert "Traceback" not in out and out.count("NEW schema") >= 4 + + +def test_one_ruling_giving_one_case_two_verdicts_collides_with_itself(tmp_path): + def edit(data): + rulings(data)[0]["cases"] = [case("search", "run"), case("search", "refuse")] + + assert ("collision", ("R-A", "R-A")) in keys(findings(tmp_path, edit)) + + +def test_every_case_is_judged_against_the_policy_not_only_the_widest(tmp_path): + # Two cases that tie on both facts: nothing changes, and a refusal with another code. With + # refusals reserved, the ruling is reserved whichever case comes first. + for order in (0, 1): + cases = [case("slice", "refuse", evidence=evidence(REFUSED, REFUSED)), case("search", "refuse", evidence=evidence(REFUSED, "refused:SPY0611"))] + + def edit(data, cases=cases[::-1] if order else cases): + data["policy"]["reversible_refusal"] = False + rulings(data).append(strict(cases=cases)) + + found = findings(tmp_path / str(order), edit) + assert keys(found) == {("owner-required", ("R-D",))}, order + assert "`reversible_refusal`" in found[0].message + + +def test_the_same_refusal_is_no_change_and_another_code_is_a_reversible_refusal(): + same = ruling_evidence.derive_door(REFUSED, REFUSED) + other = ruling_evidence.derive_door(REFUSED, "refused:SPY0611") + assert mod.policy_class(REFUSED, REFUSED, same) == "no_change" + assert mod.policy_class(REFUSED, "refused:SPY0611", other) == "reversible_refusal" + assert mod.policy_class(RAN, REFUSED, ruling_evidence.derive_door(RAN, REFUSED)) == "breaking_refusal" + + +def test_only_section_4_rows_are_rulings_and_a_second_row_for_one_id_fails(tmp_path): + def outside(data): + data["charter"] = "## 1. Order\n\n| R-Z | not a ruling row |\n\n" + CHARTER + "\n## 5. Notes\n\n| R-Y | #9 | nor this |\n" + + assert findings(tmp_path / "a", outside) == [] + + def twice(data): + data["charter"] += "| R-A | #1 | first, again; amended by R-C |\n" + + found = findings(tmp_path / "b", twice) + assert any(f.check == "schema" and f.subjects == ("R-A",) and "more than one section-4 row" in f.message for f in found) + + +def test_an_internal_compiler_error_is_evidence_but_never_a_decision(tmp_path): + crash = "crashes:SPY0908" + + def measured(data): + rulings(data).append(strict(cases=[case("slice", "refuse", evidence=evidence(crash, REFUSED))])) + + # The program does not compile today and is ruled refused: nothing running breaks. + assert findings(tmp_path / "a", measured) == [] + + def decided(data): + rulings(data).append(strict(cases=[case("slice", "refuse", evidence=evidence(REFUSED, crash))])) + + assert any("needs `after`" in f.message for f in findings(tmp_path / "b", decided)) + + +# --- the real tree -------------------------------------------------------------------------------- + + +@pytest.fixture(scope="module") +def real(): + return mod.read_inputs(REPO) + + +def test_the_real_tree_has_no_new_and_no_stale_finding(real): + new, _, stale = mod.judge(real) + assert [f"{f.check}: {' '.join(f.subjects)}: {f.message}" for f in new] == [] + assert stale == [] + + +def test_every_charter_ruling_has_a_record(real): + assert len(real.charter) >= 460 and set(real.charter) == { + r["id"] for r in real.rulings if "seed" in r + } + + +def test_the_written_laws_are_all_anchored_in_their_sources(real): + written = [law for law in real.laws if law["status"] == "written"] + assert len(written) >= 20 + assert list(mod.check_law_anchor(real)) == [] + + +# Positive controls: what the audit verified by reading the rows is what the checks report. If a +# check stopped firing, the ratchet's stale row would say so; these name the expectation outright. +AUDITED = [ + ("collision", ("R-GV", "R-LR")), # C1: `:=` onto a `let`: an error, or unruled + ("collision", ("R-HH", "R-HT")), # C2: a silent spec read two ways + ("invariance", ("P-backed-enum-flavour", "R-ON", "R-OW")), # U1: int-backed enums + ( + "invariance", + ("P-backed-enum-flavour", "R-PK", "R-QG"), + ), # U1: string-backed enums + ( + "invariance", + ("P-uniform-verdict-across-forms", "R-PI", "R-PL"), + ), # U2: `==` refused, `in` answers + ( + "invariance", + ("P-uniform-verdict-across-forms", "R-CH", "R-IM"), + ), # U3: str of Optional and of Result + ( + "exception-in-law", + ("N5", "R-MH"), + ), # L1: the ruling overrode N5 and N5 was not changed + ("charter-mark", ("R-BK", "R-GV")), # 6.5: amended, the earlier row does not say so + ("charter-mark", ("R-BL", "R-GV")), +] + + +@pytest.mark.parametrize("key", AUDITED, ids=lambda k: f"{k[0]}:{'+'.join(k[1])}") +def test_the_audited_conflicts_are_what_the_checks_report(real, key): + assert key in keys(mod.run_checks(real)) + + +def test_properly_marked_amendments_are_not_reported(real): + # R-ON's row says "Amended at call 46 by R-QG"; R-MJ's is narrowed by R-MH and says so. + found = keys(mod.run_checks(real)) + assert ("charter-mark", ("R-ON", "R-QG")) not in found + assert ("charter-mark", ("R-MH", "R-MJ")) not in found + records = {r["id"]: r for r in real.rulings} + assert records["R-ON"]["amended_by"] == ["R-QG"] and records["R-MJ"][ + "amended_by" + ] == ["R-MH"] + + +def test_every_known_row_points_at_a_file_that_exists(real): + for row in real.known: + assert (REPO / str(row["ref"]).split(" ")[0]).is_file(), row + + +def test_the_readme_template_passes_the_checks_it_documents(real): + # The template in docs/process/rulings/README.md, added to the real records. R-LR gets the + # matching `amended_by`, as the template's `amends` requires; nothing else is adjusted. + text = (REPO / mod.RULINGS_DIR / "README.md").read_text(encoding="utf-8") + block = text.split("```yaml\n", 1)[1].split("```", 1)[0] + (template,) = yaml.safe_load(block) + assert "seed" not in template + rulings_ = copy.deepcopy(real.rulings) + next(r for r in rulings_ if r["id"] == "R-LR")["amended_by"] = [template["id"]] + new, _, _ = mod.judge(real._replace(rulings=rulings_ + [template])) + # The one thing the template cannot have is a charter row naming it on R-LR. + assert [f.key[:2] for f in new] == [("charter-mark", ("R-LR", template["id"]))] diff --git a/build_tools/tests/test_ruling_evidence.py b/build_tools/tests/test_ruling_evidence.py new file mode 100644 index 000000000..2d0ca261f --- /dev/null +++ b/build_tools/tests/test_ruling_evidence.py @@ -0,0 +1,361 @@ +"""Tests for build_tools/ruling_evidence.py: a ruling's evidence is measured, and its door derived. + +The door table is checked as a pure function. The two measuring functions are checked against the +real python interpreter and, where one is built, the real compiler: nothing about what a program +does is faked. `recheck` is then run over every evidence program recorded in the tree. +""" + +from __future__ import annotations + +import os +import re +import sys +from pathlib import Path + +import pytest + +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) + +import ruling_evidence as mod + +REPO = Path(__file__).resolve().parents[2] +RAN = "runs:1\n" +OTHER = "runs:2\n" +REFUSED = "refused:SPY0402" + +# python-build-tools.yml builds sharpyc and sets SHARPYC, so these run (never skip) in CI. +needs_compiler = pytest.mark.skipif( + not os.environ.get("SHARPYC") and not mod.DEFAULT_SHARPYC.exists(), + reason="needs a built sharpyc", +) + + +# --- the door ------------------------------------------------------------------------------------- + + +@pytest.mark.parametrize( + "before, after, python, door, breaks_running, undo_breaks", + [ + # A program that is refused stays refused: nothing to take back. + (REFUSED, "refused:SPY0611", "no-twin", "two-way", False, False), + # A refused program is admitted: programs will be written that need it. + (REFUSED, RAN, "no-twin", "one-way", False, True), + # A running program is refused: it breaks today, and the refusal can be relaxed later. + (RAN, REFUSED, "no-twin", "two-way", True, False), + # A running program prints something else: breaks today, and cannot be taken back. + (RAN, OTHER, "no-twin", "one-way", True, True), + # Same output, python agrees or has no twin: nothing observable changes. + (RAN, RAN, RAN, "two-way", False, False), + (RAN, RAN, "no-twin", "two-way", False, False), + # Today's result is kept although python refuses the program (R-HT's `01`), or prints + # something else: users come to rely on the difference. + (RAN, RAN, "refused:SyntaxError", "one-way", False, True), + (RAN, RAN, OTHER, "one-way", False, True), + # A run-time error is a result too: from raising to printing is a value change. + ("raises:TypeError", RAN, RAN, "one-way", True, True), + ], +) +def test_derive_door(before, after, python, door, breaks_running, undo_breaks): + got = mod.derive_door(before, after, python) + assert (got["door"], got["breaks_running"], got["undo_breaks"]) == ( + door, + breaks_running, + undo_breaks, + ) + assert got["why"] + + +def test_derive_door_refuses_what_is_not_an_observation(): + with pytest.raises(ValueError, match="before: not an observation of kind"): + mod.derive_door("it prints 1", RAN) + + +@pytest.mark.parametrize( + "text, ok", + [ + ("runs:", True), + ("runs:a\nb\n", True), + ("refused:SPY0402", True), + ("refused:SyntaxError", True), + ("crashes:SPY0908", True), + ("raises:IndexError", True), + ("raises:IndexError\nprinted first\n", True), + ("no-twin", True), + ("refused:", False), + ("crashes:TypeError", False), + ("prints 1", False), + ("refused:SPY0402 and more", False), + ("raises:IndexError and more", False), + (None, False), + ], +) +def test_is_observation(text, ok): + assert mod.is_observation(text) is ok + + +def test_is_observation_can_be_limited_to_the_kinds_a_field_may_hold(): + assert mod.is_observation("crashes:SPY0908", mod.SHARPY_KINDS) + assert not mod.is_observation("crashes:SPY0908", mod.DECIDED_KINDS) + assert not mod.is_observation("crashes:SPY0908", mod.PYTHON_KINDS) + assert not mod.is_observation("no-twin", mod.SHARPY_KINDS) + + +def test_a_ruling_cannot_decide_a_crash_and_python_cannot_crash(): + with pytest.raises(ValueError, match="after: not an observation of kind"): + mod.derive_door(REFUSED, "crashes:SPY0908") + with pytest.raises(ValueError, match="python: not an observation of kind"): + mod.derive_door(REFUSED, RAN, "crashes:SPY0908") + + +def test_a_program_that_crashes_the_compiler_today_does_not_run_today(): + # Ruling it refused breaks nothing; ruling that it runs is an admission. + refused = mod.derive_door("crashes:SPY0908", REFUSED) + assert (refused["door"], refused["breaks_running"]) == ("two-way", False) + admitted = mod.derive_door("crashes:SPY0908", RAN) + assert (admitted["door"], admitted["breaks_running"]) == ("one-way", False) + + +def test_what_a_program_printed_before_it_raised_is_part_of_the_observation(): + # Printing `a` then raising, and printing `b` then raising, are two results. + got = mod.derive_door("raises:TypeError\na\n", "raises:TypeError\nb\n") + assert (got["breaks_running"], got["undo_breaks"]) == (True, True) + + +# --- python --------------------------------------------------------------------------------------- + + +def test_python_runs(): + assert mod.measure_python("print(1)\nprint('x')\n") == "runs:1\nx\n" + assert mod.measure_python("import sys\nprint('x')\nsys.exit(0)\n") == "runs:x\n" + + +def test_python_syntax_error_of_the_file_is_a_refusal(): + # CPython refuses the whole file before any statement runs: nothing is printed. + assert mod.measure_python("print('before')\nprint(01)\n") == "refused:SyntaxError" + assert mod.measure_python("if True:\nprint(1)\n") == "refused:IndentationError" + + +@pytest.mark.parametrize( + "program", + [ + "print('ran')\neval('1 +')\n", + "print('ran')\nraise SyntaxError('x')\n", + "print('ran')\nexec('print(01)')\n", + ], +) +def test_a_syntax_error_raised_while_running_is_not_a_refusal(program): + # The program ran and printed; python did not refuse it. (Independent review @ 993681ab3.) + assert mod.measure_python(program) == "raises:SyntaxError\nran\n" + + +def test_python_uncaught_exception_is_raises_with_the_type_and_what_came_first(): + assert mod.measure_python("print('before')\nprint(1 // 0)\n") == "raises:ZeroDivisionError\nbefore\n" + assert mod.measure_python("class P:\n pass\nP() < P()\n") == "raises:TypeError" + + +@pytest.mark.parametrize( + "program, name", + [ + # Text on stderr can spell any exception name; the type is read from the exception. + ("raise ValueError('a\\nTypeError: b')\n", "ValueError"), + ("e = KeyError('k')\ne.add_note('TypeError: hint')\nraise e\n", "KeyError"), + ("import sys\nprint('KeyError: lookup', file=sys.stderr)\nclass Boom(Exception):\n pass\nraise Boom()\n", "Boom"), + ("raise ExceptionGroup('g', [ValueError()])\n", "ExceptionGroup"), + ("import sys\nsys.exit('ValueError: bad')\n", "SystemExit"), + ("import sys\nsys.exit(3)\n", "SystemExit"), + ("raise KeyboardInterrupt()\n", "KeyboardInterrupt"), + ], +) +def test_the_python_exception_type_is_not_parsed_from_stderr(program, name): + assert mod.measure_python(program) == "raises:" + name + + +CLASSVAR = """from __future__ import annotations +from dataclasses import dataclass, fields +from typing import ClassVar + + +@dataclass +class C: + a: int + b: ClassVar[int] = 0 + + +print(len(fields(C))) +""" + + +@pytest.mark.parametrize( + "program, printed", + [ + # dataclasses resolves the string annotation `ClassVar[int]` through sys.modules: under a + # runner that is not `__main__` it counted `b` as a field and printed 2, silently + # (second review @ 87da77896). + (CLASSVAR, "1\n"), + ("x = 5\nimport __main__\nprint(getattr(__main__, 'x', 'missing'))\n", "5\n"), + ("import pickle\nclass P:\n pass\nprint(type(pickle.loads(pickle.dumps(P()))).__name__)\n", "P\n"), + ("from __future__ import annotations\nimport typing\nclass N:\n nxt: N\nprint(typing.get_type_hints(N)['nxt'].__name__)\n", "N\n"), + ("import sys\nprint(__name__, sys.argv[0] == __file__, sys.modules['__main__'].__name__)\n", "__main__ True __main__\n"), + ("print(type(__builtins__).__name__, __spec__, __package__, __doc__)\n", "module None None None\n"), + # A twin may close stdout or replace open; how it ended is still reported. + ("import sys\nprint('a')\nsys.stdout.close()\n", "a\n"), + ("import builtins\nprint('a')\nbuiltins.open = None\n", "a\n"), + ], +) +def test_the_twin_runs_as_the_real_main_module(program, printed): + assert mod.measure_python(program) == "runs:" + printed + # The control: the same file under the interpreter directly. + import subprocess + import tempfile + + with tempfile.TemporaryDirectory() as tmp: + path = Path(tmp) / "main.py" + path.write_text(program, encoding="utf-8") + plain = subprocess.run([sys.executable, "-I", str(path)], capture_output=True, text=True, cwd=tmp) + assert plain.returncode == 0 and plain.stdout == printed + + +def test_a_twin_that_kills_the_interpreter_is_an_error_not_a_verdict(): + with pytest.raises(mod.EvidenceError, match="without reporting how the program ended"): + mod.measure_python("import os\nos._exit(3)\n") + + +# --- the compiler --------------------------------------------------------------------------------- + + +def fake_sharpyc(tmp_path: Path, stdout: str, stderr: str = "", code: int = 1) -> Path: + """A stand-in compiler that prints fixed text: for the outputs a real program cannot be relied on to give.""" + path = tmp_path / "sharpyc" + path.write_text( + "#!/bin/sh\ncat <<'OUT'\n" + stdout + "\nOUT\ncat >&2 <<'ERR'\n" + stderr + "\nERR\nexit " + str(code) + "\n", + encoding="utf-8", + ) + path.chmod(0o755) + return path + + +def test_an_internal_compiler_error_is_a_crash_not_a_refusal(tmp_path): + # SPY0908 is "generated C# failed to compile": a compiler defect. Recording it as `refused:` + # made a leak look like a ruled refusal (independent review @ 993681ab3, R-PK's evidence). + text = "Compilation failed:\n\nerror[SPY0908]: internal error: generated C# failed to compile (CS0019)" + assert mod.measure_sharpy("x", fake_sharpyc(tmp_path, text)) == "crashes:SPY0908" + + +@pytest.mark.parametrize( + "code, kind", + [ + ("SPY0222", "refused"), + ("SPY0899", "refused"), + ("SPY0900", "crashes"), + ("SPY0913", "crashes"), + ("SPY0999", "crashes"), + ("SPY1000", "refused"), + # The CodeGen range holds both: a name collision is a ruled refusal (R-AW), an emit + # failure is the emitter's own (second review @ 87da77896). + ("SPY0523", "refused"), + ("SPY0526", "refused"), + ("SPY0550", "refused"), + ("SPY0500", "crashes"), + ("SPY0519", "crashes"), + ("SPY0599", "crashes"), + ], +) +def test_which_codes_are_a_crash(tmp_path, code, kind): + text = f"Compilation failed:\n\nerror[{code}]: something" + assert mod.measure_sharpy("x", fake_sharpyc(tmp_path, text)) == f"{kind}:{code}" + + +def test_an_unclassified_codegen_code_is_an_error_not_a_guess(tmp_path): + text = "Compilation failed:\n\nerror[SPY0530]: a code reserved today" + with pytest.raises(mod.EvidenceError, match="SPY0530 is a CodeGen code that ruling_evidence.py has not classified"): + mod.measure_sharpy("x", fake_sharpyc(tmp_path, text)) + + +def test_every_active_codegen_code_is_classified_exactly_once(): + # The roster is DiagnosticCodes.cs: a CodeGen code made Active there must be put in one of the + # two sets here, or this fails (and measuring a program that hits it raises). Every SPY05nn + # constant counts unless its line says Retired or Reserved, so a new code is seen however its + # comment is written (third review @ 7e9f191e6). + source = (REPO / "src/Sharpy.Compiler/Diagnostics/DiagnosticCodes.cs").read_text(encoding="utf-8") + constants = re.findall(r'^.*const string \w+\s*=\s*"(SPY05\d\d)".*$', source, re.M) + lines = {code: line for line in source.splitlines() for code in re.findall(r'"(SPY05\d\d)"', line) if "const string" in line} + assert len(constants) == len(lines) == 26, sorted(lines) # no code declared twice + active = {code for code, line in lines.items() if not re.search(r"//\s*(Retired|Reserved)", line)} + assert len(active) == 18, sorted(active) # the count the file's own header states + assert not (mod.CODEGEN_INTERNAL & mod.CODEGEN_REFUSAL) + assert mod.CODEGEN_INTERNAL | mod.CODEGEN_REFUSAL == active + + +def test_the_first_error_decides_and_a_warning_does_not(tmp_path): + text = "warning[SPY0908]: not an error\nerror[SPY0222]: first\nerror[SPY0908]: second" + assert mod.measure_sharpy("x", fake_sharpyc(tmp_path, text)) == "refused:SPY0222" + + +def test_compiler_output_with_no_banner_and_no_error_is_an_error_not_a_verdict(tmp_path): + with pytest.raises(mod.EvidenceError, match="neither a run banner nor an error code"): + mod.measure_sharpy("x", fake_sharpyc(tmp_path, "something unexpected")) + + +def test_a_program_that_exits_non_zero_without_an_exception_is_an_error_not_a_verdict(tmp_path): + ran = "Successfully compiled to: x.exe\n\n=== Running Program ===\n\nUnhandled exception. Sharpy.KeyError: printed by the program" + with pytest.raises(mod.EvidenceError, match="without an unhandled-exception report"): + mod.measure_sharpy("x", fake_sharpyc(tmp_path, ran, code=3)) + + +@needs_compiler +def test_sharpy_runs_and_the_banner_is_not_output(): + assert mod.measure_sharpy("def main() -> None:\n print(1)\n print('x')\n") == "runs:1\nx\n" + + +@needs_compiler +def test_sharpy_refusal_carries_the_first_error_code(): + assert mod.measure_sharpy('def main() -> None:\n x: int = 1\n print(x + "a")\n') == "refused:SPY0222" + + +@needs_compiler +def test_sharpy_uncaught_exception_is_raises_with_the_type_and_what_came_first(): + program = "def main() -> None:\n xs: list[int] = [1]\n print('before')\n print(xs[5])\n" + assert mod.measure_sharpy(program) == "raises:IndexError\nbefore\n" + + +def test_a_missing_compiler_is_an_error_not_a_verdict(tmp_path, monkeypatch): + monkeypatch.setenv("SHARPYC", str(tmp_path / "absent")) + with pytest.raises(mod.EvidenceError, match="no built compiler"): + mod.measure_sharpy("def main() -> None:\n pass\n") + + +# --- recheck -------------------------------------------------------------------------------------- + + +def test_the_tree_records_evidence(): + # A positive control for the recheck below: there is something to re-run. + records = mod._all_evidence(REPO) + assert len(records) >= 12 + assert any(owner.startswith("R-HT") for owner, _ in records) + + +@needs_compiler +def test_every_recorded_program_still_does_what_its_record_says(): + assert mod.recheck(mod._all_evidence(REPO), None, None) == [] + + +@needs_compiler +def test_recheck_reports_a_record_that_no_longer_matches(): + program = "def main() -> None:\n print(1)\n" + stale = { + "program": program, + "sharpy": "refused:SPY0402", + "twin": "print(1)\n", + "python": "runs:2\n", + } + drift = mod.recheck([("R-X case 1", stale)], None, None) + assert drift == [ + "R-X case 1: sharpy recorded 'refused:SPY0402', now 'runs:1\\n'", + "R-X case 1: python recorded 'runs:2\\n', now 'runs:1\\n'", + ] + + +def test_door_command_prints_the_derivation(capsys): + assert mod.main(["door", "--before", REFUSED, "--after", RAN]) == 0 + assert "door: one-way" in capsys.readouterr().out + assert mod.main(["door", "--before", "nonsense", "--after", RAN]) == 2 diff --git a/docs/audits/ruling-audit-2026-11-21.md b/docs/audits/ruling-audit-2026-11-21.md new file mode 100644 index 000000000..637372db1 --- /dev/null +++ b/docs/audits/ruling-audit-2026-11-21.md @@ -0,0 +1,494 @@ +# Ruling Audit — What 460 Design Decisions Say About the Written Rules + +> **Date:** 2026-11-21 · **Commit:** `bfbeeee6a` (dev) · **Read-only:** nothing was built or run. +> **Reader:** someone who knows compilers, Python and C#, and does not know this project's +> vocabulary. Section 2 defines every project term used here. +> **Data:** [`ruling-audit-2026-11-21/`](ruling-audit-2026-11-21/) holds one record per decision +> and the checked lists of conflicts and principles. + +--- + +## 1. The short version + +Sharpy's language design is decided in two places. There is a small set of written rules (three +axioms, some tie-breaks, a naming and scoping rule set). And there is a much larger pile of +individual decisions the owner made when an agent got stuck and asked. This audit read all 460 of +those decisions and asked three questions. + +**Did the written rules already answer the question?** For about three in ten language questions, +yes: a rule that existed at the time picks the answer the owner gave. In most of those cases the +decision never mentions the rule. The rule was there and nobody looked it up. + +**When the rules did not answer, was the owner deciding at random?** No. About four in ten +language questions were real judgement calls, and the same 32 lines of reasoning come up again +and again. They cover 245 of the 460 decisions. None of the 32 is fully written down. The most +common one, "pick the option you can undo later", is used in about 70 decisions and appears in no +rule. + +**Do the decisions contradict each other?** In a few places, and they cluster. There are 4 direct +contradictions, 9 pairs of similar cases decided differently with no stated reason, and 9 +decisions that go against a written rule. The walrus operator, enums with values, and "what if +the spec says nothing" hold most of them. Section 6 shows each one with code. + +The practical reading: the written rules are too short to steer by, the real rules live in the +owner's head and in a table nobody queries, and the fix is to write the 32 principles down and +make the paperwork machine-checked (section 8). + +## 2. Vocabulary + +| Term | Meaning | +|---|---| +| **Ruling** | One design decision by the owner, numbered R-A, R-B, … R-QR in the order made. Each records the question, the options, the one chosen and the ones rejected. Think of a court judgment. | +| **Charter** | The Markdown file holding the rulings table and the work queue. Two exist, one per planning round. | +| **Law** | Shorthand in this report for any written, general rule: an axiom, a tie-break, an N-rule, and so on. Think of a statute. The table below lists them. | +| **Supersede** | A later ruling replaces an earlier one. The earlier row is supposed to be struck through. | +| **Twin** | The Python program that is spelled the same and means the same as a Sharpy program. Python's behaviour counts as evidence only when a twin exists. `struct` and `out` parameters have none. | +| **Compared / deviation** | A behaviour is *compared* if Sharpy must match Python and a mismatch is a bug. It is a *deviation* if a mismatch is accepted and listed in `docs/deviations.yaml`. | +| **Door** | Whether a decision can be undone. *Two-way:* it can, cheaply. *One-way:* undoing it breaks programs people have written. Refusing a program is usually two-way (you can allow it later). Accepting one is usually one-way. | +| **Refuse / admit** | The compiler rejects a program with an error, or accepts it. | + +The written laws, with the short names used below: + +| Name | What it says | Where | +|---|---|---| +| Axiom 1 | Sharpy runs on .NET and inherits its runtime behaviour | `language_specification/introduction.md` | +| Axiom 2 | Sharpy uses Python's syntax; Python's behaviour is evidence where a twin exists | same | +| Axiom 3 | Every type is known at compile time; `None` needs `T?` | same | +| Resolution rule | When Axioms 1 and 2 conflict, .NET wins, unless the compiler can bridge the gap at zero cost | same | +| T1–T4 (tie-breaks) | In order: never a silently wrong value; a compile error beats a run-time error; a correct program keeps its value; one rule for every host | same | +| N1–N7 | Name lookup, shadowing and initialization order | `design/name-resolution.md` | +| Fidelity table | Which behaviours are compared with Python | `design/python-fidelity-scope.md` | +| Critical Rules, anti-patterns | Project rules, for example Rule 7: "change the implementation, never the spec" | `CLAUDE.md` | + +## 3. How the audit was done + +1. **Classify.** Ten agents each read 46 rulings and wrote a record per ruling: what it is about, + the decision restated in one sentence, and which of four things decided it (a written law, an + earlier ruling, the owner's choice, or a choice against a law). +2. **Check conflicts.** Two agents took every suspected conflict (137 in total) and read the + original text of both sides. They threw out 42 as not real. +3. **Find the patterns.** One agent took the rulings no law decided and grouped them by the + reasoning behind the owner's pick. +4. **Verify.** The lead dated each law from git history, and read the original rows behind every + conflict in section 6 marked *read*. + +What to keep in mind about the numbers: + +- **They are judgements by a language model, not measurements.** The classifiers marked 62% of + their own labels "medium confidence". +- **"A law already answered it" is strict about timing.** A ruling counts only if every law it + rests on existed when the question was asked. +- **Nothing was compiled or run.** A finding here means two documents disagree. It says nothing + about what the compiler does today. + +## 4. What the rulings are, and what decided them + +Fewer than half the rulings are about the language itself: + +| About | Rulings | +|---|---| +| What a Sharpy program means or whether it compiles | 210 | +| Project process: which work goes first, how much review it gets | 124 | +| Standard-library behaviour | 51 | +| Tests and test tooling | 26 | +| The command-line tool and editor support | 21 | +| Compiler internals a user cannot observe | 14 | +| The wording of an error message | 14 | + +For the 275 rulings about the language, the library or error messages: + +| What decided it | Rulings | Share | +|---|---|---| +| The owner chose; no written law picks an answer | 102 | 37% | +| A law that existed at the time picks the answer | 79 | 29% | +| Partly a law that existed, partly one written later | 38 | 14% | +| An earlier ruling | 34 | 12% | +| Only a law written after the ruling | 14 | 5% | +| The ruling goes against a written law | 8 | 3% | + +Three things stand out. + +**The laws came after the decisions.** This table shows when each law was first written, and how +many rulings already existed: + +| Law | First written | Rulings already made | +|---|---|---| +| Axioms 1–3, resolution rule (original wording) | 2025-12-20 | 0 | +| Fidelity table | 2026-09-27 | about 86 | +| N1–N7 | 2026-11-01 | about 290 | +| Tie-breaks T1–T4 | 2026-11-16 | 430 | + +The tie-breaks fit the earlier rulings well: 35 follow them and 2 do not. That makes them a good +summary of how the owner decides. It also means they guided almost nothing, because they did not +exist yet. + +**A law being written does not mean it gets used.** Of the 131 rulings that a current law +decides, 88 never name that law. + +**The owner usually agrees with the first option.** Where a ruling records which option was +picked, it was the first one listed in 294 of 348 cases (84%). Among language rulings that were +both a real choice and undoable, it was 27 of 31. And only 62 rulings are marked as one-way. + +## 5. The rules nobody wrote down + +These are the ten most-used principles about the language and library. "Against" counts rulings +where the principle applied and the owner went the other way; a principle with exceptions needs +its limits written before it can serve as a law. All 32, with proposed limits, are in Appendix A. + +| # | Principle, in plain words | Used | Against | +|---|---|---|---| +| 1 | **Pick the undoable option.** If a form is not accepted yet, refuse it; if it is already accepted, keep accepting it. | 43 | 10 | +| 2 | **Sugar gets its expansion's verdict.** `a < b < c` behaves as `a < b and b < c` does; `x += 1` as `x = x + 1` does. No special cases per spelling. | 25 | 4 | +| 3 | **One implementation per fact.** If the compiler checks a format string, it calls the same function the runtime uses. | 18 | 0 | +| 4 | **Do not fake what C# cannot do.** Refuse it with a named Sharpy error that says what a C# programmer would write instead. | 17 | 3 | +| 5 | **The compiler never invents a type or a conversion.** If two branches disagree on type, ask for an annotation. | 14 | 3 | +| 6 | **One error code, one mistake, one fix.** | 13 | 0 | +| 7 | **Two things claiming one name is an error** that names both. Nothing wins silently by order. | 11 | 2 | +| 8 | **Editor tooling keeps the user's text** unless it can prove its change is legal. | 11 | 1 | +| 9 | **Match Python by whole family**, where .NET can reproduce the behaviour exactly. | 10 | 1 | +| 10 | **A documented feature gets implemented**, not removed from the docs. | 9 | 3 | + +Principle 1 is the important one. It is the owner's most common argument, it would have settled +about 30 questions without asking, and it appears in no law. Its ten exceptions share a shape: +the owner drops it when the undoable option would leave Sharpy printing something different from +Python without telling anyone. + +## 6. Where the decisions disagree + +Each item shows the two texts and the question that settles them. *Read* means the lead read the +original rows. *Agent* means only the checking agent did. + +### 6.1 Direct contradictions + +**C1. Walrus onto a `let` variable** (read) + +```python +let x = 1 +if (x := 2) > 0: + print(x) +``` + +- R-GV: "`:=` on an existing `let` is an error, never a silent shadow … never re-asked". +- R-LR, about a month later: the case "is decided in P21b's plan … until then the harness pins the + cells `Unruled`". It rejects "refuse now". +- R-BK, the original: `:=` is "declare-if-new, rebind-if-existing". Never marked as changed. + +One ruling says error, one says undecided, one says rebind. *Question:* which? + +**C2. The spec says nothing about whether a program is legal** (read) + +```python +from GREETER import hello # the file is greeter.spy +print(01) # a leading zero +``` + +Python rejects both lines. The spec mentions neither case. + +- R-HH, for the import: "the spec is silent … so the surface is COMPARED". Sharpy now rejects it. +- R-HT, for the literal: "the spec … is silent (… DEVIATION until promoted)". Sharpy accepts it. + +Both rulings start from "the spec is silent" and read the fidelity table in opposite ways. +*Question:* when the spec is silent, does Python decide, or does the current behaviour stand? + +**C3. Printing a `defaultdict`** (read) + +- R-BN: it prints as `defaultdict(, {...})`, an accepted difference from Python. +- R-CJ and the fidelity table, a week later: the `repr` of every standard-library type, with + `defaultdict` named, must match Python. + +R-BN is not struck, and the table still cites it. *Question:* is the placeholder still allowed? + +**C4. `== None` on a non-nullable .NET object** (agent, low confidence) + +R-EH refuses "a None test on a declared non-null reference". R-ES allows `== None` "on every .NET +reference type". *Question:* is `== None` a None test, or just an operator call? + +### 6.2 Similar cases, different answers, no stated reason + +**U1. What is an enum with values?** (read) + +```python +enum Color: # int-backed + RED = 1 +enum Level: # int-backed + LOW = 1 +enum Verb: # string-backed + GET = "GET" +enum Word: # string-backed + GET = "GET" +``` + +| | `Color.RED == Level.LOW` (two types, same value) | `<` within one type | +|---|---|---| +| int-backed | `False` (R-ON) | allowed, .NET order (R-OW) | +| string-backed | `True` (R-QG) | compile error (R-PK) | + +Python has three enum classes. A plain `Enum` gives `False` and no ordering. `IntEnum` and +`StrEnum` give `True` and ordering. So Sharpy's int-backed enum is a plain `Enum` for `==` and an +`IntEnum` for `<`, and its string-backed enum is the reverse. Each ruling made sense alone. +Together they leave no answer to "what will the next operator do?". *Question:* what is the model? + +**U2. Comparing objects that define no equality** (read) + +```python +class P: + pass + +a = P() +b = P() +a == b # R-PI: compile error, "for every spelling, wrapper and site" +a in [b] # R-PL: allowed; compares by identity, as Python documents +``` + +*Question:* is `in` one of the "sites" R-PI covers? + +**U3. Printing a wrapped value** (read) + +```python +print(Some(1)) # 1 (R-CH) +print(Ok(1)) # Ok(1) (R-IM) +``` + +Both are built-in wrapper types. R-CH's reason was that `1` was already the output and changing +it would break programs, which explains the history and not the difference. *Question:* one rule? + +**U4. Accepting something Python rejects on purpose** (R-HT read, R-FA agent) + +- R-FA: `hmac.new(key)` with no digest is refused, because accepting it is the choice that cannot + be undone once people rely on it. +- R-HT: `print(01)` is accepted, described as "the one-way choice, taken knowingly". + +*Question:* what makes the second acceptable and the first not? + +**U5. Assigning a plain value to an optional variable** (agent) + +```python +x: int? = Some(1) +x = 5 # R-G: error; write Some(5). "T? converts implicitly in NO direction" +if x is not None: + x = 5 # R-T: allowed; wrapped for you +``` + +**U6. A default value C# cannot store as a constant** (agent) + +```python +@dataclass +class Bag: + items: list[int] = [] # R-A: allowed; a fresh list per instance + +def add(x: int, to: list[int] = []) -> None: # R-R: compile error + ... +``` + +There is a good reason (Python shares one list across calls, so a fresh one per call would change +behaviour). Neither ruling states it. + +**U7. Which exception `None in network` raises** (agent, low confidence). R-NX says +`AttributeError`, as Python does for those three library types. R-OS and R-OP say the general rule +is `TypeError`. + +### 6.3 A ruling says one thing, the law still says another + +**L1. Walrus inside a comprehension** (read) + +```python +def f(xs: list[int]) -> int: + last: int = 0 + ys = [last := x for x in xs] + return last # Python returns the final x +``` + +- N5, `comprehensions.md` and `walrus_operator.md` all say the walrus variable is local to the + comprehension, "nothing leaks", and a program like this is a compile error. +- R-MH, made after N5: it "writes through as python does", so this returns the final `x`. + +The ruling knowingly overrode the law, and the three documents were never updated. An agent +reading the spec implements the opposite of what was decided. + +**L2. "Module-level variables must be `const`"** (read). R-BL makes a non-`const` module variable +an error. Since then R-GV says the const-only rule "is superseded", N1 lists module variables as +normal declarations, and N6's own example mutates one. R-BL carries no mark. + +**L3. A conditional used as a statement** (agent). R-IW keeps a refusal "because Axiom 1". The +resolution rule says Axiom 1 gives way when a zero-cost rewrite exists, and rewriting to an +`if`/`else` is one. The ruling does not say why that rewrite does not count. + +**L4. Run-time checks where the tie-break wants a compile error** (agent). R-BW and R-CD were +made before tie-break T2 existed and now go against it, unmarked. + +### 6.4 Principles that pull against each other + +- **Refuse, or imitate Python at run time?** Principles 1 and 4 say refuse. Three rulings (R-AI, + R-QL, R-OP) chose to imitate Python at run time instead, and tie-break T2 has no exception for + them. +- **Which choice is the one-way door?** R-FH says refusing a call Python accepts is one-way. R-HU + and R-IA say accepting Python's value is. The rows suggest the difference is whether the value + is known at compile time. No row says so. +- **Is the C# API stable before version 1.0?** R-GW and R-KM break it freely ("no users yet"). + R-AD and R-EW protect it. +- **What goes first in the queue?** "Silently wrong results first" in 13 rulings; "user-visible + features first" in R-PM and R-GX. + +### 6.5 Stale rows + +Eleven rulings, in ten chains, were replaced or narrowed by a later one and never marked: R-DX, R-DW, R-FR, R-PY, +R-LK, R-BI, R-CN, R-BK, R-BL, R-Z, R-NY. The charter tells agents not to re-ask a settled ruling, +so an agent that finds only the old row will follow it. + +## 7. Where the written laws run out + +In 42 cases a ruling looked like it broke a law, and on reading both, the law simply did not say. +Appendix B lists all 42 with the sentence each law would need. + +| Law | Cases | What it does not say | +|---|---|---| +| Axiom 2 | 9 | If Python runs a program, must Sharpy accept it, or only never give a different result? And which Python enum class is the twin of a Sharpy enum? | +| Critical Rule 7 | 8 | "Never change the spec" has no exception, but the owner changes the spec by ruling. It needs: the owner may, an agent may not. | +| Tie-break T2 | 5 | Does a compile-time check still win if it would also reject some correct programs? | +| N5 | 4 | Its "closed list" of differences from Python is missing three block-scope cases, and it collides with N6 on loop targets under `global`. | +| Resolution rule | 3 | "Zero-cost" is not defined. Does a rewrite that complicates .NET interop count? | +| Anti-patterns | 3 | "One way to do a thing" does not cover a second spelling that existing programs already use. | + +## 8. What to do about it + +1. **Decide section 6 in one sitting.** It is sixteen questions: C1–C4, U1–U7, L3 and the four in + 6.4. L1, L2 and 6.5 need no decision; the documents just need to match the rulings. +2. **Write the principles down, with their limits.** Appendix A is a first draft. +3. **Let agents take the undoable option without asking.** They record what they picked; the + owner reviews a batch and reverses any. The 84% first-option rate says most reviews will be + quick. One-way decisions still wait for the owner. +4. **Make every ruling declare what it is:** it follows law X, or it is an exception to law X + because of Y, or it is a new law. The last two must change the law's text in the same commit. +5. **Record replacement on the old row,** not only the new one. +6. **Build the two tables already filed** (#2486 for bindings, #2733 for sugar and its expansion). + C1, L1 and L2 are exactly the cases they would catch. + +### Which of this can a script enforce? + +Fourteen kinds of slip showed up in this audit. A required, validated record per ruling would +close most of them: + +| Slip found | Size | Enforceable by | +|---|---|---| +| Ruling names no law | 88 of 131 | Schema: a required `basis` and `laws` field | +| Door type not stated | 166 | Schema: a required enum | +| Recommended option not recorded | most rows | Schema: a required field | +| Law not linked to the rulings it came from | several laws | Schema: `source_rulings` on each law | +| Old row not marked as replaced | 10 | Cross-reference: `supersedes` must have a matching mark | +| Exception ruling, law text unchanged | 5 | Cross-reference: an `exception` must appear in the law's own entry | +| Spec changed by ruling, with no stated route | 8 | Cross-reference: a spec diff must cite a ruling | +| Two verdicts for one case | 4 | Cross-reference, once each ruling names its case from a fixed list | +| Similar cases, different verdicts, no reason | 9 | Cross-reference, same condition, plus a required `differs_because` | +| New law contradicts an old ruling | 4 | Cross-reference, same condition | +| Process question a table could answer | part of 124 | Partly: review level can be computed; queue order cannot | +| Question asked though a law answers it | 79 | Partly: a script can list the related laws and rulings and require a reply to each; it cannot judge the reply | +| Law too vague to decide | 42 | No: this is judgement | +| Two principles clash | 4 | No: this is judgement | + +Ten of fourteen can be fully checked, two partly, two not at all. Three of the ten depend on every +ruling naming its case from a fixed list of language features, which is the work #2486 and #2733 +describe. A script can prove a step was done and recorded consistently. It cannot prove the +judgement inside the record was right. + +**Built on 2026-11-22.** The records, the law table and the checks are in +[`docs/process/rulings/`](../process/rulings/README.md), checked by `build_tools/check_rulings.py` +and `build_tools/ruling_evidence.py`. The checks reproduce this audit's verified conflicts from the +data alone; those wait in `known-findings.yaml` for the rulings of section 6. + +## Appendix A. The 32 principles + +"Rulings" counts the rows the grouping agent judged to turn on the principle; it read at least +three per group and every counter-example. "Against" counts rulings where the principle applied +and the owner went the other way. The statements and boundaries are the agent's wording, kept +compact so they can be copied into a law table; they are drafts. + +| Principle | Scope | Rulings | Against | Nearest written law | Statement | Boundary the rulings suggest | +|---|---|---|---|---|---|---| +| `reversible-door` | language | 43 | 10 | — | Among open options pick the one from which the others stay additive: refuse a form not yet admitted rather than admit it, and keep admitting a form already admitted rather than restrict it. | Yields when the reversible option leaves a silent difference from Python on a COMPARED surface, a silently wrong or order-dependent value (T1), or withdraws a documented surface; then the one-way fix is taken and recorded by direction. | +| `uniform-verdict-across-forms` | language | 25 | 4 | N7 | A desugared form, an alternative spelling, another host, or another member of an operator or declaration family gets exactly its primitive's verdict, value and diagnostic code; no form-specific refusal or exemption. | Uniformity is judged by Sharpy's own type and conversion rules and by the mechanism (what gates, what converts), not by Python's family lines; a second spelling may survive to keep a correct program running (T3). | +| `one-authority-per-fact` | language | 18 | 0 | CR2 | Each fact or behaviour has one implementation every consumer calls: a compile-time check calls the runtime's pure function, an operator and its library function share one engine, and one authority spells each name or identity. | — | +| `csharp-limit-named-refusal` | language | 17 | 3 | RR | When C# cannot express a construct, refuse it before Roslyn with a named Sharpy code and the steer a C# programmer would write; do not emulate it with a lowering users could depend on. | Emulation is taken when the lowering is unobservable from Sharpy (R-AV) or when refusing would leave ordinary Python programs either refused en masse or printing a different value (R-QL, R-AI). | +| `no-invented-type-or-conversion` | language | 14 | 3 | A3 | The compiler never invents a type or conversion: a common type is the slot's or an operand's own; anything beyond value-preserving widening is spelled by the user; disagreeing candidates are refused, asking for an annotation. | Compile-time constants that fit the target, stores into a narrowed Optional, and nullability-oblivious foreign values convert implicitly; everything else is spelled. | +| `diagnostic-code-per-cure` | diagnostics | 13 | 0 | CR10 | A diagnostic code means one failure with one cure: reuse it, naming the kind in the message, for the same mistake; mint a new code when the cure differs; never filter a code by route. | — | +| `silent-wrong-first` | process | 13 | 3 | batch-issues SKILL step 3 (not a listed law) | A group that removes a silently wrong value is queued ahead of groups fixing refusals, crashes or tooling; tooling and tests-only residues wait behind user-facing silent-wrong work, regressions excepted. | Order applies within a band; across arcs the owner weighs user-facing value, and a silent-wrong cell waits when its class fix is already scheduled. | +| `group-by-class-and-seam` | process | 12 | 1 | VC10 | Cells join the open tracker and group whose contract owns their class; defects on one seam form one group with one generator, built by the group that consumes it. | A new group is formed when the cure reuses facts a just-landed group built (R-JY); otherwise cells go to existing trackers (R-JW). | +| `collision-is-error` | language | 11 | 2 | N2 | When two declarations, imports or source files claim one name in one scope, refuse and name both; neither order, kind nor star-ness picks a silent winner, and no deterministic rename is applied. | When the other party is an open-ended external set (CLR namespaces, references), whose growth would newly refuse existing code, the local name wins with a default-on warning naming the escape. | +| `tooling-keeps-user-bytes` | diagnostics | 11 | 1 | — | An editor, formatter or refactoring route keeps the user's written spelling and bytes unless it can prove the change legal and meaning-preserving; it re-spells only when forced, and otherwise is not offered. | A formatter run the user asked for may canonicalize within a stated bound (R-ET); repair routes acting on an unparseable document may not. | +| `promote-fidelity-where-exact` | library | 10 | 1 | FS | Promote a Python surface to COMPARED by whole type or message family, covering what .NET reproduces exactly or Core alone can cure; the remainder becomes one family deviation row. | Where an exact reproduction would rewrite genuine values (R-NS, R-FL's 128+N), the inexact part stays a deviation even inside a promoted family. | +| `measure-before-mechanism` | process | 10 | 1 | VC5 | Add a mechanism, optimisation, CI leg or runtime-target move only after a measurement shows the need; record an unmeasured hazard. Performance is reported for the owner to judge, not gated automatically. | Correctness checks on every platform the product ships for are not optional. | +| `documented-surface-implemented` | language | 9 | 3 | CR7 | A documented feature that can be typed and lowered is implemented rather than documented away; the spec is rewritten only where the feature has no CLR carrier or admitting it would be the one-way door. | The spec yields when it promises something with no CLR carrier (R-BR) or when a later principle (Python fidelity, R-OB) supersedes its text by ruling. | +| `loose-none-fails-like-python` | language | 8 | 2 | T2 | A possibly-None `T \| None` operand in an operation Python accepts stays legal, warns, and fails as CPython does; a literal None where the type cannot hold None is a compile error. | Applies to the loose `T \| None` spelling only; Sharpy's strict `T?` is refused until narrowed. It overrides T2 for that spelling. | +| `untypeable-api-is-deviation` | library | 8 | 2 | FS | A Python library surface that cannot be typed statically, or whose Python value occurs only in misuse, becomes one recorded deviation row with a steer, not dynamic invocation, generated factories or a widened nullable type. | A typeable surface with no other route is implemented; only untypeable, misuse-only, or alternative-covered surfaces deviate. | +| `land-semantics-before-instruments` | process | 8 | 1 | VC11 | Do not build an instrument, generator or stopgap on semantics a ruled change will flip; land the semantic change first, and move an existing structure intact before redesigning it. | An instrument that hides missing refusals goes first, since the band it audits depends on it. | +| `coverage-over-ci-capacity` | process | 8 | 0 | VC2 | Coverage a contract requires is kept and CI capacity raised to carry it; every known failure is a counted, cited row, and a missing precondition reports Skipped, never a vacuous pass. | — | +| `clr-values-keep-clr-shape` | language | 7 | 2 | CV | A CLR value keeps its CLR identity and nullability-oblivious shape; Sharpy may add capabilities but never subtracts what the CLR shape shows, and converts it only explicitly or with a check at a declared boundary. | Builtin types that are Sharpy types over a CLR backing follow Sharpy rules; the principle covers foreign values only. | +| `repr-is-construction-spelling` | library | 7 | 1 | FS | A value's str/repr is its source construction spelling with payload reprs; where the runtime lacks the source information, print a fixed documented placeholder, never CLR text or compiler-injected names. | A placeholder is a deviation only until a cheap mechanism carries the information (R-DG); then the name is kept. | +| `one-mechanical-name-rule` | language | 7 | 2 | AP | Name mangling is one mechanical rule for every name; exceptions are spelled with the backtick escape and collisions it creates are refused, never handled by tables, per-name renames or silent fallbacks. | A special case already visible to C# consumers is not reopened (R-AD). | +| `host-invariant-output` | library | 6 | 1 | T4 | A program's verdict and output never depend on the machine: locale, filesystem case, or assemblies a process happened to load; an OS that cannot reproduce a behaviour gets its own deviation row. | Where an OS lacks the data (Windows time-zone names), the difference is confined to that OS and recorded. | +| `sentinel-defaults-not-magic` | library | 6 | 1 | AP | A Python default or calling convention C# cannot express is modelled by overloads, a nullable parameter with a body coalesce, or a lambda steer; never an in-band magic value or dynamic invocation. | Overloads are synthesized only at rung 1 in library source; user-written defaults are refused with a steer. | +| `identity-never-runs-user-code` | language | 6 | 1 | — | `is` is identity only and never runs user code or a type test; `==` always runs the type's declared equality and is refused when none is declared; enum members count as identities. | Container search follows CPython's documented identity-first semantics (R-PL); value-type operands of `is` answer False with a warning. | +| `contained-fix-ships-now` | process | 6 | 3 | CR13 | A contained fix to a false refusal or crash on an ordinary program, with a closed matrix and no seam an in-flight group owns, ships now as a chore, not with its distant group. | Not when a scheduled ruled fix would rewrite the interim change, or when the fix carves a seam out of another group's contract. | +| `pre-1.0-break-early` | process | 6 | 2 | — | Before 1.0 there is no compatibility promise: breaking respellings land early, unconsumed public APIs that cannot be made correct are deleted, stale hand models are dropped, and ruled designs ship without a feature flag. | Rows disagree on whether the C# consumer surface is protected before 1.0; R-GW and R-KM say no users exist, R-AD and R-EW protect it. | +| `process-extensions-are-one-off` | process | 5 | 1 | VC12 | An extension of a process limit (an extra verify pass, a raised ratchet pin) is granted once on the owner's quoted word and is never precedent. | None stated; recurrence suggests the cap itself needs a written extension clause. | +| `clr-limit-saturates-not-refuses` | library | 4 | 2 | A1 | A run-time argument Python accepts but a CLR limit cannot hold saturates, or raises CPython's nearest exception, recorded as one family deviation row; the call is not refused. | Values in source text, known at compile time, are refused (T2); only run-time values saturate. R-FH calls refusing Python-accepted calls the one-way option, R-HU calls admitting Python's value the one-way option: the door reading flips with compile-time knowability. | +| `bug-dependent-program-not-correct` | language | 4 | 1 | T3 | Under T3, a program whose current value comes from a defect, or whose verdict differs from its primitive twin's, is not a correct program; changing it needs a direction record, not a deviation row. | Status-quo behaviour that is consistent and documented (R-OW) is kept as a deviation, not treated as a bug. | +| `tier-below-letters-at-charter` | process | 4 | 0 | VC12 | A group's tier may be set below its derived letter at charter time when full-tier dimensions have no subject (tests-only, mechanical respellings); once planning begins tiers only rise. | — | +| `static-check-only-definite` | language | 3 | 1 | T2 | A static check refuses only a definite mismatch; where the operand kind, format spec or target symbol is not statically known, it stays silent and the run-time check answers. | Holds where the missing fact is unknowable at compile time; T2 governs wherever the fact is known. | +| `users-first-release` | process | 3 | 0 | — | A defect that breaks the documented install on a supported host is fixed at once as its own chore and released as a patch, and a known workaround is posted on the issue immediately. | — | +| `backed-enum-flavour` | language | 2 | 2 | — | A backed enum behaves as the Python enum flavour of its backing (IntEnum, StrEnum) for every operator. | No consistent boundary: string-backed enums are StrEnum for == and Enum for ordering, int-backed the reverse. R-PK's reason ('no .NET order to keep') suggests 'keep .NET behaviour where it exists, else refuse', which R-ON does not fit. | + +## Appendix B. The 42 cases a law did not decide + +| Law | Ruling | What the law would need to say | +|---|---|---| +| A1 | R-H | A1 fixes the meaning of what compiles; it does not oblige Sharpy to accept every C#-legal shape, and a narrower acceptance names its reason. | +| A1 | R-JP | A1 covers compile-time binding (overload resolution, lookup) as well as run-time behaviour; a departure names its defect and cost. | +| A2 | R-BU | A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated. | +| A2 | R-CW | A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated. | +| A2 | R-EA | A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated. | +| A2 | R-OA | A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated. | +| A2 | R-ON | Each Sharpy enum's python twin is named: int-backed is IntEnum or Enum, string-backed is StrEnum or Enum, for every operator. | +| A2 | R-OW | Each Sharpy enum's python twin is named: int-backed is IntEnum or Enum, string-backed is StrEnum or Enum, for every operator. | +| A2 | R-PI | A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated. | +| A2 | R-PK | Each Sharpy enum's python twin is named: int-backed is IntEnum or Enum, string-backed is StrEnum or Enum, for every operator. | +| A2 | R-QG | Each Sharpy enum's python twin is named: int-backed is IntEnum or Enum, string-backed is StrEnum or Enum, for every operator. | +| A3 | R-DW | A nullable-oblivious CLR type has unknown nullability: writes of None are allowed, reads into T are checked at the boundary. | +| A3 | R-OP | None requires explicit opt-in, spelled T? (strict) or T \| None (loose); a plain T never holds None. | +| AP | R-AG | A Python surface is added when [stated test, e.g. corpus use, a twin with no .NET cost]; otherwise it is a 'not provided' ledger row. | +| AP | R-IR | A Python surface is added when [stated test, e.g. corpus use, a twin with no .NET cost]; otherwise it is a 'not provided' ledger row. | +| AP | R-ND | A Python surface is added when [stated test, e.g. corpus use, a twin with no .NET cost]; otherwise it is a 'not provided' ledger row. | +| CR7 | R-AG | An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'. | +| CR7 | R-BR | An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'. | +| CR7 | R-DQ | An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'. | +| CR7 | R-IW | An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'. | +| CR7 | R-MD | An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'. | +| CR7 | R-MW | An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'. | +| CR7 | R-NW | An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'. | +| CR7 | R-OB | An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'. | +| FS | R-HH | A spec silent on whether a program compiles is [deferring to python3 / unlisted, DEVIATION until promoted]; FS states which. | +| FS | R-HT | A spec silent on whether a program compiles is [deferring to python3 / unlisted, DEVIATION until promoted]; FS states which. | +| N5 | R-LB | Block scope is a designed deviation: a binding made in a block body, loop bodies included per iteration, ends with the block; a later read reaching an outer binding is refused. | +| N5 | R-LE | A local is not visible inside its own initializer, lambda bodies included; a recursive local is a nested def. | +| N5 | R-LF | Block scope is a designed deviation: a binding made in a block body, loop bodies included per iteration, ends with the block; a later read reaching an outer binding is refused. | +| N5 | R-LG | Block scope is a designed deviation: a binding made in a block body, loop bodies included per iteration, ends with the block; a later read reaching an outer binding is refused. | +| N6 | R-LS | A for, with or except target naming a global- or nonlocal-declared name is refused, with a steer to assign inside the body. | +| N6 | R-MI | A for, with or except target naming a global- or nonlocal-declared name is refused, with a steer to assign inside the body. | +| RR | R-HJ | Zero-cost means no run-time cost, no new public C# surface and no second rule for one surface; where such a bridge exists Sharpy takes Python's meaning. | +| RR | R-HU | Zero-cost means no run-time cost, no new public C# surface and no second rule for one surface; where such a bridge exists Sharpy takes Python's meaning. | +| RR | R-HW | Zero-cost means no run-time cost, no new public C# surface and no second rule for one surface; where such a bridge exists Sharpy takes Python's meaning. | +| T1 | R-FH | T1 covers every run-time value, not only initializers; a ledger row does not make a silently different value acceptable unless the ruling names T1. | +| T2 | R-AI | T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead. | +| T2 | R-EH | T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead. | +| T2 | R-OC | T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead. | +| T2 | R-OP | T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead. | +| T2 | R-OU | T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead. | +| T4 | R-PY | A1's run-time default outranks T4; T4 chooses only among options A1 and N3 leave open. | + +## Appendix C. Data files + +| File | Content | +|---|---| +| `records.tsv` | One row per ruling: kind, axis, basis, law, door, option, units, the rule restated, the principle, tensions seen by the first pass | +| `principles.json` | The 32 principles with members, checked rows, counter-examples, boundary and gap | +| `conflicts-rulings.json` | 48 ruling-against-ruling candidates with their class and quoted rows, including the 8 that are not conflicts | +| `conflicts-laws.json` | 89 ruling-against-law candidates with their class and quotes, and a per-law summary | diff --git a/docs/audits/ruling-audit-2026-11-21/conflicts-laws.json b/docs/audits/ruling-audit-2026-11-21/conflicts-laws.json new file mode 100644 index 000000000..5eeadfc26 --- /dev/null +++ b/docs/audits/ruling-audit-2026-11-21/conflicts-laws.json @@ -0,0 +1,957 @@ +[ + { + "id": "R-AI", + "law": "T2", + "class": "law-too-coarse", + "ruling_says": "Suppression-capable `with` DA = option C (python at runtime), reversing the applied default A: a bare-declared local assigned inside the body and read after is runtime-checked", + "law_says": "A compile-time error over a run-time error. Either is better than a silently wrong value.", + "why": "The rejected compile-time option refuses every program whose manager might suppress, including ones python3 runs correctly; T2 ranks error kinds for a failing program but does not say whether a conservative refusal of correct programs counts as 'a compile-time error'.", + "law_fix": "T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead.", + "confidence": "medium" + }, + { + "id": "R-BW", + "law": "T2", + "class": "law-written-later-and-contradicts", + "ruling_says": "Runtime-only; close as completed", + "law_says": "A compile-time error over a run-time error. Either is better than a silently wrong value.", + "why": "Option (a) (carry the origin symbol's facts) would add a compile error that refuses only bad specs, which T2 (written 2026-11-16) prefers; the row defers it as 'two-way, can land later' and is not marked superseded.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-CD", + "law": "T2", + "class": "law-written-later-and-contradicts", + "ruling_says": "Stop the static walk at a nested-spec field and at a non-empty spec on an Unknown-kind operand (2026-09-24, D5 option a): the pinned `after_nested` cell demotes to the same field's runtime ValueError.", + "law_says": "A compile-time error over a run-time error. Either is better than a silently wrong value.", + "why": "A cell that was a compile error is demoted to a run-time ValueError although option (b) decides it statically without refusing correct programs; T2, written later, prefers the compile error and the row is not superseded.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-EH", + "law": "T2", + "class": "law-too-coarse", + "ruling_says": "stored into a slot declared `T` it is null-checked at that line", + "law_says": "A compile-time error over a run-time error. Either is better than a silently wrong value.", + "why": "The rejected strict reading (b) gives compile errors but makes 'every hand-off to a Sharpy T slot need narrowing', refusing correct programs; T2 does not say whether that kind of compile error is still preferred.", + "law_fix": "T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead.", + "confidence": "medium" + }, + { + "id": "R-OC", + "law": "T2", + "class": "law-too-coarse", + "ruling_says": "container-side operations stay allowed and a `None` raises python's `TypeError`.", + "law_says": "A compile-time error over a run-time error. Either is better than a silently wrong value.", + "why": "Refusing container operations on a nullable operand (rejected option a) would refuse programs that never hold None; T2 does not separate a precise compile error from a conservative one.", + "law_fix": "T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead.", + "confidence": "medium" + }, + { + "id": "R-OP", + "law": "T2", + "class": "law-too-coarse", + "ruling_says": "T \\| None` is LOOSE: it behaves as `T`, with a warning wherever `None` would fail, and fails as CPython does", + "law_says": "A compile-time error over a run-time error. Either is better than a silently wrong value.", + "why": "The loose family chooses warning plus run-time TypeError over refusal because refusal would reject correct programs; T2 (written four days later) is silent on that distinction, so it neither forbids nor predicts the ruling.", + "law_fix": "T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead.", + "confidence": "high" + }, + { + "id": "R-OU", + "law": "T2", + "class": "law-too-coarse", + "ruling_says": "the checker stays LOOSE on those operands: the three programs that run today", + "law_says": "A compile-time error over a run-time error. Either is better than a silently wrong value.", + "why": "Rejects the plan's compile-time refusals so running programs keep running and raise TypeError on None; T2 gives no rule for when a compile error would also refuse correct programs (T3's ground).", + "law_fix": "T2 applies where the compile-time check refuses only programs that would fail; a check that also refuses correct programs is weighed under T3 instead.", + "confidence": "medium" + }, + { + "id": "R-FH", + "law": "T1", + "class": "law-too-coarse", + "ruling_says": "A timeout between 24.8 days (`int.MaxValue` ms) and `TIMEOUT_MAX` saturates at 24.8 days and is ONE family row in `docs/deviations.yaml`", + "law_says": "No silently wrong value. Never a CLR default standing in for an initializer that has not run, an initializer that is skipped, or a value that depends on which initializer happened to run first.", + "why": "The program silently waits less than it asked, which T1's headline 'No silently wrong value' seems to forbid, but T1's body lists only initializer cases; the law does not say whether a ledgered library value counts.", + "law_fix": "T1 covers every run-time value, not only initializers; a ledger row does not make a silently different value acceptable unless the ruling names T1.", + "confidence": "low" + }, + { + "id": "R-JP", + "law": "T3", + "class": "not-a-conflict", + "ruling_says": "`len(s.upper())` `3` → SPY0343 (the one running program refused; C#-legal)", + "law_says": "A correct program keeps its value. Where a program's result is right today, changing it is a recorded decision, not a consequence of another change.", + "why": "T3 allows changing a correct program's result as a recorded decision; the row records the one working-to-refused program by name.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-OY", + "law": "T3", + "class": "not-a-conflict", + "ruling_says": "`a == c == a` over a class without `__eq__` is SPY0402 wherever `a == c` is (working-to-refused, by direction)", + "law_says": "A correct program keeps its value. Where a program's result is right today, changing it is a recorded decision, not a consequence of another change.", + "why": "The change to running chains is recorded with its direction and door ('One-way direction for the chains that ran'), which is what T3 asks.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-PV", + "law": "T3", + "class": "not-a-conflict", + "ruling_says": "The four programs the temporary changes (a callee reading its own store by name; a callee that raises) are accepted residue, named in `parameter_modifiers.md`.", + "law_says": "A correct program keeps its value. Where a program's result is right today, changing it is a recorded decision, not a consequence of another change.", + "why": "T3 is met: the changed outputs are a recorded decision, named in the spec.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-QA", + "law": "T3", + "class": "not-a-conflict", + "ruling_says": "Two classes whose initializers read each other's values raise `NameError` whichever is touched first, including the touch order that prints correct values today.", + "law_says": "A correct program keeps its value. Where a program's result is right today, changing it is a recorded decision, not a consequence of another change.", + "why": "T1 ('a value that depends on which initializer happened to run first') outranks T3, and the row names the departure, so the ordered tie-breaks decide it.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-QB", + "law": "T3", + "class": "not-a-conflict", + "ruling_says": "a ring kept alive only by a store from another module is refused at compile time (a false refusal in a rare shape, recorded residue)", + "law_says": "A correct program keeps its value. Where a program's result is right today, changing it is a recorded decision, not a consequence of another change.", + "why": "The false refusal is recorded residue, a recorded decision under T3, and T2 favours the compile-time error for the rest of the class.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-CR", + "law": "T4", + "class": "not-a-conflict", + "ruling_says": "every function emits its mangled name (`main` → `Main`) in every module kind", + "law_says": "One rule for every host (module, class, generic class) over a special case.", + "why": "One emission rule for all functions; T4 is about module/class/generic hosts, and this ruling only fits its spirit.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-DB", + "law": "T4", + "class": "not-a-conflict", + "ruling_says": "`%Z` via libc `strftime`/`tzname` on Unix; display name + deviation row on Windows", + "law_says": "One rule for every host (module, class, generic class) over a special case.", + "why": "T4's 'host' is defined as module, class, generic class; an operating-system split is outside its text.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-PW", + "law": "T4", + "class": "not-a-conflict", + "ruling_says": "a store to a module or `@static` value before its initializer is kept and visible, and the initializer still runs at its declared position and replaces it", + "law_says": "One rule for every host (module, class, generic class) over a special case.", + "why": "The ruling gives one rule to module and @static values alike; the host split is R-PY's, not this row's.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-PY", + "law": "T4", + "class": "law-too-coarse", + "ruling_says": "Every class, generic or not, sweeps as a unit — all its `@static` values in declaration order — the first time it is touched, or when the module's sweep reaches its position, whichever comes first; module-level values keep the declaration-order sweep with on-demand forward reads.", + "law_says": "One rule for every host (module, class, generic class) over a special case.", + "why": "Classes and modules get different sweep rules, the special case T4's parenthesis names, but A1 says C#'s 'when a type initializes' is inherited; the texts do not say whether A1's run-time default outranks T4.", + "law_fix": "A1's run-time default outranks T4; T4 chooses only among options A1 and N3 leave open.", + "confidence": "medium" + }, + { + "id": "R-PX", + "law": "T4", + "class": "not-a-conflict", + "ruling_says": "A closed generic type runs all its initializers in declaration order on its first use, wherever that use is.", + "law_says": "One rule for every host (module, class, generic class) over a special case.", + "why": "Each closed generic type is its own CLR host and N3's emission section ('Each closed generic type is its own host and sweeps on its first use') states this rule, so the special case is written law.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-H", + "law": "A1", + "class": "law-too-coarse", + "ruling_says": "Refuse ALL same-generic-interface-at-two-distinct-instantiations in the supertype closure", + "law_says": "Memory model, type system, inheritance, and runtime semantics follow .NET. That includes run-time behaviour the CLR or C# already defines", + "why": "C# accepts the shape and the row gives no .NET reason; A1 says the type system follows .NET but not whether Sharpy may accept less than C# does.", + "law_fix": "A1 fixes the meaning of what compiles; it does not oblige Sharpy to accept every C#-legal shape, and a narrower acceptance names its reason.", + "confidence": "medium" + }, + { + "id": "R-JP", + "law": "A1", + "class": "law-too-coarse", + "ruling_says": "Rejected: (a) C#'s per-candidate body binding with betterness (one-way once relied on; needs held-back trial diagnostics — the sentinel class)", + "law_says": "Memory model, type system, inheritance, and runtime semantics follow .NET. That includes run-time behaviour the CLR or C# already defines", + "why": "R-AF took overload resolution from C# under A1, here C#'s rule is declined for cost and refuses a C#-legal program; A1's text ('runtime semantics', 'run-time behaviour') does not say whether compile-time binding rules are inherited.", + "law_fix": "A1 covers compile-time binding (overload resolution, lookup) as well as run-time behaviour; a departure names its defect and cost.", + "confidence": "medium" + }, + { + "id": "R-IA", + "law": "A1", + "class": "not-a-conflict", + "ruling_says": "A non-zero `decimal` literal whose value becomes zero is REFUSED on BOTH spellings", + "law_says": "Memory model, type system, inheritance, and runtime semantics follow .NET. That includes run-time behaviour the CLR or C# already defines", + "why": "C# silently gives 0m; refusing it is T1's no-silently-wrong-value and T2's compile-time error, and A1 does not require accepting every literal C# accepts.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-IG", + "law": "A1", + "class": "not-a-conflict", + "ruling_says": "the target — and a subclass's `run` — executes under a wrapper that writes `Exception in thread :`", + "law_says": "Memory model, type system, inheritance, and runtime semantics follow .NET. That includes run-time behaviour the CLR or C# already defines", + "why": "This is Stdlib library behaviour, where CV ('Wrap .NET, expose Python') and FS's exception/control-flow rows decide, and the row names the defect (exit 134) and the door.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-MD", + "law": "A1", + "class": "not-a-conflict", + "ruling_says": "Re-root the OSError family on Core: one Core `OSError : System.IO.IOException`", + "law_says": "Memory model, type system, inheritance, and runtime semantics follow .NET. That includes run-time behaviour the CLR or C# already defines", + "why": "The exception hierarchy is a COMPARED surface in FS and Core exposes Python exceptions under CV; the row names the cost for .NET catch sites ('One-way for .NET catch sites').", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-OM", + "law": "A1", + "class": "not-a-conflict", + "ruling_says": "`is` / `is not` with an operand statically typed as an enum compare by member, as CPython's singletons do", + "law_says": "Memory model, type system, inheritance, and runtime semantics follow .NET. That includes run-time behaviour the CLR or C# already defines", + "why": "Comparing enum members by value is a zero-cost lowering that reconciles A1 and A2 under RR; boxed reference identity is not a semantics a program relies on.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-EJ", + "law": "A1", + "class": "not-a-conflict", + "ruling_says": "`is None` / `is not None` are a reference null check for every reference type, and the operator synthesized from `__eq__` is null-safe", + "law_says": "Memory model, type system, inheritance, and runtime semantics follow .NET. That includes run-time behaviour the CLR or C# already defines", + "why": "C#'s own `x is null` never runs an overloaded `==`, so the ruling matches C#; it reverses only an earlier spec sentence.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-QL", + "law": "A1", + "class": "not-a-conflict", + "ruling_says": "A store evaluates its value before its target's subexpressions, as CPython; generated in P93b's stage 0; the value is hoisted only where the target has effects.", + "law_says": "Any other departure is a decision, never a side effect: it names the defect it removes and the cost it accepts.", + "why": "A departure from C#'s evaluation order made by ruling, naming its cost ('One-way for output where both sides have effects') and its defect only by implication ('as CPython'); RR's zero-cost hoist covers it.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-BU", + "law": "A2", + "class": "law-too-coarse", + "ruling_says": "`str.format(...)`/`str.upper(...)` are refused as instance-via-type-name", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "python3 runs `str.upper('a')` with the same meaning, and the row's reasons are cost and consistency, not .NET; A2 says what a twin is evidence for, not whether a twin program must be admitted.", + "law_fix": "A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated.", + "confidence": "medium" + }, + { + "id": "R-CW", + "law": "A2", + "class": "law-too-coarse", + "ruling_says": "SPY0283 on both `from lib import __w` and `lib.__w`", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "python3 runs `from lib import _w`; the ruling refuses for 'two rules for one convention', and A2 does not say whether a twin obliges admission.", + "law_fix": "A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated.", + "confidence": "medium" + }, + { + "id": "R-EA", + "law": "A2", + "class": "law-too-coarse", + "ruling_says": "A bare `_` store target is a discard; only `` `_` `` is an identifier", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "In python3 `_` is an ordinary readable name; Sharpy refuses a later bare read instead of giving a different value, which A2 neither requires nor forbids.", + "law_fix": "A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated.", + "confidence": "low" + }, + { + "id": "R-OA", + "law": "A2", + "class": "law-too-coarse", + "ruling_says": "A class with only `__len__` + `__getitem__` stays refused for `in` (SPY0320)", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "R-NZ admitted the sibling __iter__ fallback citing the python twin, while this refuses the __getitem__ fallback python also runs; A2 does not say which twins oblige admission.", + "law_fix": "A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated.", + "confidence": "high" + }, + { + "id": "R-PI", + "law": "A2", + "class": "law-too-coarse", + "ruling_says": "`==` / `!=` on a type that declares no `__eq__` stays REFUSED, with one rule and one code for every spelling, wrapper and site", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "python3 compares such objects by identity and C# class `==` is reference equality too, so for reference types both A1 and A2 point to running; the refusal rests on one-rule-for-structs-and-classes, which no law ranks against a twin.", + "law_fix": "A twin forbids Sharpy giving a different value; whether it also obliges Sharpy to accept the program, or a ruling may refuse it with a steer, is stated.", + "confidence": "medium" + }, + { + "id": "R-ON", + "law": "A2", + "class": "law-too-coarse", + "ruling_says": "`==` between two different int-backed enum types answers `False` and `!=` answers `True`", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "False is plain Enum's answer, yet R-OW orders the same enums as IntEnum; A2 does not say which python class is a backed Sharpy enum's twin, so each operator picked one.", + "law_fix": "Each Sharpy enum's python twin is named: int-backed is IntEnum or Enum, string-backed is StrEnum or Enum, for every operator.", + "confidence": "high" + }, + { + "id": "R-OW", + "law": "A2", + "class": "law-too-coarse", + "ruling_says": "Ordering on ONE int-backed enum type keeps .NET order, as `IntEnum`", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "Python's plain Enum refuses ordering, IntEnum allows it; the ruling picks IntEnum for ordering while R-ON picks Enum for ==, and A2 has no twin definition to decide.", + "law_fix": "Each Sharpy enum's python twin is named: int-backed is IntEnum or Enum, string-backed is StrEnum or Enum, for every operator.", + "confidence": "high" + }, + { + "id": "R-PK", + "law": "A2", + "class": "law-too-coarse", + "ruling_says": "Ordering on ONE string-backed enum is refused in Semantic, as CPython's plain `Enum` does.", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "Twin chosen as plain Enum for ordering, while R-QG chooses StrEnum for == on the same enums; A2 is silent on which python class is the twin.", + "law_fix": "Each Sharpy enum's python twin is named: int-backed is IntEnum or Enum, string-backed is StrEnum or Enum, for every operator.", + "confidence": "high" + }, + { + "id": "R-QG", + "law": "A2", + "class": "law-too-coarse", + "ruling_says": "`==` between two different STRING-backed enum types compares by value, as `StrEnum`", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "Twin chosen as StrEnum for ==, contradicting R-PK's plain-Enum twin for ordering; the law gives no way to fix the twin once per type.", + "law_fix": "Each Sharpy enum's python twin is named: int-backed is IntEnum or Enum, string-backed is StrEnum or Enum, for every operator.", + "confidence": "high" + }, + { + "id": "R-FM", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "`Never` draws SPY0202 with a \"use `NoReturn`\" steer", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "Both spellings are valid Python; keeping one is AP 'multiple ways to do the same thing', and the row rejects '(c) both names'.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-IZ", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "`import_statements.md:57` gains the sentence; python3 is last-wins in all three (verified at call 31) — the spec rules", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "FS puts which programs run vs. are refused under the spec, and the spec already contradicted last-wins.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-D", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "bare sequence pattern on an open scrutinee refused with a steer to `case list[int]([1, 2])`", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "A refusal with an A1/A3 reason (erasure: the element type is not known statically); A2 yields under RR.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-N", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "`yield` inside a suppressing `with` → refuse by name (validator)", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "C# cannot yield inside a try with a catch clause, an A1 constraint; under RR A1 wins with no zero-cost bridge.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-W", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "One element/branch type rule = C#'s best-common-type", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "Typed displays are A1/A3; the row names C#'s rule and the user annotation as the steer.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-AL", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "`and`/`or` keep returning `bool` per `logical_operators.md` §Return Type", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "The spec states the answer and static typing (A3) motivates it; python's operand-returning behaviour is refused, not given a different value.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-AU", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "A fixed-arity tuple is not truth-testable by the spec's own rule", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "Decided by the spec's truth-testing rule; a refusal, not a different value.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-AR", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "`@property`/`@p.setter`/`@p.getter`/`@p.deleter` become a named parser refusal steering to `property get p(self) -> T:`", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "AP 'multiple ways to do the same thing' decides it.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-G", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "`Some(v)`/`None()` sole constructors; `maybe` the one bridge", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "A3 static null-safety and CV's Optional convention decide; bare None remains the loose T | None spelling, so python's absence still has a spelling.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-IE", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "Core collection types are sealed; extend by composition or implement the sequence/mapping protocols", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "A1: the Core types are sealed CLR classes, and unsealing has a public-API and devirtualization cost, so RR has no zero-cost bridge.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-IF", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "the MULTI-PASS half is RECORDED — ledger row `generator-multi-pass`", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "A value difference from python recorded as A1's IEnumerable consequence; the single-pass wrapper costs an allocation and an interop type change, so RR does not mandate it.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-IO", + "law": "A2", + "class": "not-a-conflict", + "ruling_says": "Basis: the anti-pattern table (\"multiple ways to do the same thing\")", + "law_says": "Python is evidence for what a construct does only where python3 runs the same program and the construct means the same thing there (its twin).", + "why": "The row cites AP as its reason; A2 does not require admitting a twin spelling AP excludes.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-OP", + "law": "A3", + "class": "law-too-coarse", + "ruling_says": "`T` never holds `None`", + "law_says": "None requires explicit opt-in via T?.", + "why": "A3 names only T? as the opt-in to None, but the ruling (and the spec's older loose family) has two opt-ins, strict T? and loose T | None; A3 was written before the split and does not cover the loose one.", + "law_fix": "None requires explicit opt-in, spelled T? (strict) or T | None (loose); a plain T never holds None.", + "confidence": "high" + }, + { + "id": "R-DW", + "law": "A3", + "class": "law-too-coarse", + "ruling_says": "Oblivious CLR members and parameters accept `None` on write and read as `T`", + "law_says": "None requires explicit opt-in via T?.", + "why": "The read half is superseded by R-EH; the live write half lets None into a CLR slot whose nullability .NET does not declare, a case A3's 'every type is statically known' does not address.", + "law_fix": "A nullable-oblivious CLR type has unknown nullability: writes of None are allowed, reads into T are checked at the boundary.", + "confidence": "medium" + }, + { + "id": "R-FE", + "law": "A3", + "class": "not-a-conflict", + "ruling_says": "`ident` before `start()` is a ledger row", + "law_says": "None requires explicit opt-in via T?.", + "why": "A3's default clause is about declared values whose initializer has not run; ident is a library property whose value the row marks NOT COMPARED, as FS does for CPython implementation details.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-HU", + "law": "RR", + "class": "law-too-coarse", + "ruling_says": "REFUSE every numeric literal outside the range of its own resolved type at ONE semantic seam", + "law_says": "When Axiom 1 and Axiom 2 conflict, Axiom 1 wins, unless the compiler can reconcile them via zero-cost abstractions (naming transformations, thin wrappers, or polymorphic dispatch).", + "why": "double.PositiveInfinity bridges python's `inf` at no run-time cost, but the row rejects it as 'two rules for one surface' and a silent infinity, citing 'Type Safety > Python syntax'; RR does not say whether such costs stop a bridge counting as zero-cost.", + "law_fix": "Zero-cost means no run-time cost, no new public C# surface and no second rule for one surface; where such a bridge exists Sharpy takes Python's meaning.", + "confidence": "medium" + }, + { + "id": "R-HJ", + "law": "RR", + "class": "law-too-coarse", + "ruling_says": "A second `def f` in the SAME block of a function scope is refused", + "law_says": "When Axiom 1 and Axiom 2 conflict, Axiom 1 wins, unless the compiler can reconcile them via zero-cost abstractions (naming transformations, thin wrappers, or polymorphic dispatch).", + "why": "Renaming each local def would reconcile C#'s CS0128 with python's rebinding; the row rejects it on the bindings rulings and a one-way spelling, and RR does not say whether the bridge is mandatory.", + "law_fix": "Zero-cost means no run-time cost, no new public C# surface and no second rule for one surface; where such a bridge exists Sharpy takes Python's meaning.", + "confidence": "medium" + }, + { + "id": "R-HW", + "law": "RR", + "class": "law-too-coarse", + "ruling_says": "Rejected: (b) promote — accept and mangle to a C#-legal name (a new mangling is an interop surface C# consumers can depend on; one-way; a spelling nobody writes).", + "law_says": "When Axiom 1 and Axiom 2 conflict, Axiom 1 wins, unless the compiler can reconcile them via zero-cost abstractions (naming transformations, thin wrappers, or polymorphic dispatch).", + "why": "RR names naming transformations as zero-cost bridges, yet the row declines one for its interop surface; whether a new public spelling counts as a cost is not in RR.", + "law_fix": "Zero-cost means no run-time cost, no new public C# surface and no second rule for one surface; where such a bridge exists Sharpy takes Python's meaning.", + "confidence": "high" + }, + { + "id": "R-IW", + "law": "RR", + "class": "law-broken-unacknowledged", + "ruling_says": "Rejected: (b) lower the void conditional to `if/else` at the `StatementLoweringKind` seam (fidelity for the ternary; a→b stacks later)", + "law_says": "When Axiom 1 and Axiom 2 conflict, Axiom 1 wins, unless the compiler can reconcile them via zero-cost abstractions (naming transformations, thin wrappers, or polymorphic dispatch).", + "why": "Lowering a None-typed conditional statement to if/else is a zero-cost, surface-free bridge, so under RR A1 should not win; the row ends 'Axiom 1 reason stands' without addressing the bridge.", + "law_fix": "Where a zero-cost lowering exists, a refusal keeping A1 names the cost that makes the bridge unacceptable.", + "confidence": "medium" + }, + { + "id": "R-PI", + "law": "RR", + "class": "not-a-conflict", + "ruling_says": "Rejected: (b) reference types compare identity, as Python, with structs still refused", + "law_says": "When Axiom 1 and Axiom 2 conflict, Axiom 1 wins, unless the compiler can reconcile them via zero-cost abstractions (naming transformations, thin wrappers, or polymorphic dispatch).", + "why": "For reference types A1 (C# reference equality) and A2 agree, so RR is not engaged; the conflict is with A2's twin (see the A2 entry).", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-Y", + "law": "N6", + "class": "not-a-conflict", + "ruling_says": "a bare STORE (plain/augmented/walrus/tuple-element) to a name declared in the enclosing class/struct body is refused by name", + "law_says": "= (and every augmented, tuple, star and walrus store) assigns a binding of the same function. ... A bare store that would cross a function boundary is refused with the steer \"let x = … for a new local, or global x / nonlocal x to write the outer binding\".", + "why": "N6 does not make a bare store a fresh local: it assigns 'a binding of the same function' and steers to `let` for a new one, and class-body names are not function bindings, so a refusal follows.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-AA", + "law": "N6", + "class": "not-a-conflict", + "ruling_says": "a bare STORE to any name that resolves to a member of the enclosing class/struct — declared in its body OR inherited, field OR property — is refused by name (SPY0606", + "law_says": "= (and every augmented, tuple, star and walrus store) assigns a binding of the same function. ... A bare store that would cross a function boundary is refused with the steer \"let x = … for a new local, or global x / nonlocal x to write the outer binding\".", + "why": "Same as R-Y: N6 gives a bare store only a same-function binding and steers to `let` for a new local, so refusing a store to a member name agrees with it.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-BL", + "law": "N1", + "class": "law-written-later-and-contradicts", + "ruling_says": "module-scope non-const bindings (`x: T = e` without keyword, `let x`) are SPY0340 with the steer \"module-scope bindings are `const`\"", + "law_says": "Every module-level and class-level declaration — def, class, const, let, var, module variable, property, @static member — is visible throughout its scope, above and below its declaration.", + "why": "N1 (2026-11-01) lists let, var and module variables as module-level declarations and N6's example writes a mutable module `count` under `global`; R-BL is not struck, though the spec marks its refusal pending removal (B9, amended 2026-10-13).", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-JJ", + "law": "N1", + "class": "resolved", + "ruling_says": "SUPERSEDED as the governing rule 2026-11-01 by the name-resolution principle (N1–N4", + "law_says": "Every module-level and class-level declaration — def, class, const, let, var, module variable, property, @static member — is visible throughout its scope, above and below its declaration.", + "why": "The row itself records that N1–N4 replace it; only SPY0401's const-only parameter-default restriction stands, as a separate class.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-JV", + "law": "N1", + "class": "resolved", + "ruling_says": "SUPERSEDED 2026-11-01 (N1; R-KF, R-KG): a lambda is a body — class-body names stay invisible bare inside it", + "law_says": "Every module-level and class-level declaration — def, class, const, let, var, module variable, property, @static member — is visible throughout its scope, above and below its declaration.", + "why": "Struck and replaced by N1's rule.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-JT", + "law": "N3", + "class": "resolved", + "ruling_says": "SECOND HALF SUPERSEDED 2026-11-01 (N3, #2422, P77 — R-KD): the forward static read is not refused, it RUNS with the initialized value", + "law_says": "A forward read initializes its target first, as in Swift.", + "why": "The refusing half is superseded; the surviving source-order emission is N3's sweep order.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-LB", + "law": "N5", + "class": "law-too-coarse", + "ruling_says": "deviation rows for the four bodies + an `N5-block-scope` must-run arm", + "law_says": "Designed deviations from Python (the closed list): 1. A loop variable is fresh per iteration ... 2. A for / except / with target does not overwrite an outer binding ... 3. Forward reads that Python rejects with NameError run", + "why": "N5's first bullet makes a local end with its block, but its 'closed list' of deviations from Python omits block scope, so the law both implies these rows and forbids new ones.", + "law_fix": "Block scope is a designed deviation: a binding made in a block body, loop bodies included per iteration, ends with the block; a later read reaching an outer binding is refused.", + "confidence": "medium" + }, + { + "id": "R-LF", + "law": "N5", + "class": "law-too-coarse", + "ruling_says": "the block-scope deviation row widens to every binder {annotated, const, def, lambda-typed} × every block body {if, for, while, match, with}", + "law_says": "Designed deviations from Python (the closed list): 1. A loop variable is fresh per iteration ... 2. A for / except / with target does not overwrite an outer binding ... 3. Forward reads that Python rejects with NameError run", + "why": "Widens a deviation that follows from N5's block rule but is missing from N5's closed list; the same-block closure cells (13 vs python 2) show the list does not cover what the rule produces.", + "law_fix": "Block scope is a designed deviation: a binding made in a block body, loop bodies included per iteration, ends with the block; a later read reaching an outer binding is refused.", + "confidence": "medium" + }, + { + "id": "R-LG", + "law": "N5", + "class": "law-too-coarse", + "ruling_says": "widen `loop-variable-fresh-per-iteration` to every binding made in a loop body", + "law_says": "Designed deviations from Python (the closed list): 1. A loop variable is fresh per iteration ... 2. A for / except / with target does not overwrite an outer binding ... 3. Forward reads that Python rejects with NameError run", + "why": "N5's closed list names only the loop variable as fresh per iteration; widening to every body binding follows from block scope but goes beyond the item's text.", + "law_fix": "Block scope is a designed deviation: a binding made in a block body, loop bodies included per iteration, ends with the block; a later read reaching an outer binding is refused.", + "confidence": "medium" + }, + { + "id": "R-MH", + "law": "N5", + "class": "law-broken-acknowledged", + "ruling_says": "a comprehension's walrus over a binding of the SAME function — a local or a parameter — writes through as python does", + "law_says": "A walrus inside a comprehension is the same shape: its binding is local to the comprehension, so where a visible outer name is read after it, the program is refused (owner ruling 2026-11-06).", + "why": "N5 says a comprehension walrus binding is local to the comprehension and a later outer read is refused; R-MH (after N5) writes through instead and names the departure ('Rejected: (a) refuse as the sentence said (costs a working program that agrees with python)'), but N5's text was not updated.", + "law_fix": "Add to N5: a comprehension walrus over a same-function local or parameter writes through, as python; over a module or enclosing binding read later it is refused.", + "confidence": "high" + }, + { + "id": "R-LE", + "law": "N5", + "class": "law-too-coarse", + "ruling_says": "keep the refusal, steer \"write a nested def\"; message only", + "law_says": "A local is visible from its let / var (or first assignment) to the end of its block.", + "why": "python3 runs a lambda-typed local that calls itself because the body runs after the binding; N5's 'visible from its let' does not say whether the binding's own initializer, or a lambda inside it, is in range.", + "law_fix": "A local is not visible inside its own initializer, lambda bodies included; a recursive local is a nested def.", + "confidence": "medium" + }, + { + "id": "R-MI", + "law": "N6", + "class": "law-too-coarse", + "ruling_says": "refuse `for`, `with` and `except` targets under `global x`", + "law_says": "= (and every augmented, tuple, star and walrus store) assigns a binding of the same function. ... A bare store that would cross a function boundary is refused with the steer \"let x = … for a new local, or global x / nonlocal x to write the outer binding\".", + "why": "N6 says every store under `global x` writes the module binding (python's rule) while N5 makes construct targets fresh block bindings; the laws collide on this shape and neither decides it.", + "law_fix": "A for, with or except target naming a global- or nonlocal-declared name is refused, with a steer to assign inside the body.", + "confidence": "high" + }, + { + "id": "R-LS", + "law": "N6", + "class": "law-too-coarse", + "ruling_says": "`nonlocal x` over a construct target gets the same refusal as `global` (R-MI)", + "law_says": "= (and every augmented, tuple, star and walrus store) assigns a binding of the same function. ... A bare store that would cross a function boundary is refused with the steer \"let x = … for a new local, or global x / nonlocal x to write the outer binding\".", + "why": "Same N5/N6 collision for `nonlocal`; python stores through for for/with targets, N6 calls itself python's rule, N5 makes the target fresh.", + "law_fix": "A for, with or except target naming a global- or nonlocal-declared name is refused, with a steer to assign inside the body.", + "confidence": "high" + }, + { + "id": "R-NH", + "law": "FS", + "class": "resolved", + "ruling_says": "decimal `0m / 0m` raising `ZeroDivisionError` is a deviation row", + "law_says": "Demotion never happens silently: a COMPARED surface the team decides not to match is a ruling too, with the deviations.yaml entry it creates.", + "why": "Exception TYPE is COMPARED, but FS's own demotion clause lets a ruling decline to match a compared surface with a deviations.yaml entry, which this row does.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-HT", + "law": "FS", + "class": "law-too-coarse", + "ruling_says": "the spec has no grammar block and is silent (fidelity-scope D5: DEVIATION until promoted)", + "law_says": "Which programs run vs. are refused | COMPARED against the spec; python3 is the oracle only where the spec defers to Python", + "why": "R-HT reads a spec silent on a run-vs-refuse question as an unlisted surface (keep Sharpy's acceptance), while R-HH reads the same silence as the spec deferring to python3 (COMPARED); FS's two rows support both readings.", + "law_fix": "A spec silent on whether a program compiles is [deferring to python3 / unlisted, DEVIATION until promoted]; FS states which.", + "confidence": "high" + }, + { + "id": "R-HH", + "law": "FS", + "class": "law-too-coarse", + "ruling_says": "the spec is silent on case (grep-only @ 3f16f261e), so the surface is COMPARED (programs run vs refused, spec deferring to Python)", + "law_says": "Which programs run vs. are refused | COMPARED against the spec; python3 is the oracle only where the spec defers to Python", + "why": "Treats spec silence as deference to python3, the opposite of R-HT's reading of the same FS text; FS does not say whether silence defers or leaves the surface unlisted.", + "law_fix": "A spec silent on whether a program compiles is [deferring to python3 / unlisted, DEVIATION until promoted]; FS states which.", + "confidence": "high" + }, + { + "id": "R-BN", + "law": "FS", + "class": "law-written-later-and-contradicts", + "ruling_says": "str`/`repr` renders `defaultdict(, {...})`, documented as a deviation in the collections spec", + "law_says": "str/repr of EVERY Stdlib type (Path, HTTPStatus, ipaddress, defaultdict, iterators, Timedelta, …) | COMPARED (D2 b) | ... python3 is the oracle", + "why": "FS (2026-09-27, after R-BN) lists defaultdict by name among Stdlib reprs COMPARED with python3 (`defaultdict(, {})`), yet R-BN is not struck and FS's Core row still cites R-BN as a ruling that stands.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-CE", + "law": "FS", + "class": "not-a-conflict", + "ruling_says": "runtime keyword text becomes python's `KeyError: 'name'`", + "law_says": "Exception MESSAGE text beyond the type name ... DEVIATION by default (D1 a)", + "why": "DEVIATION by default does not forbid matching a message, and R-CE predates FS.", + "law_fix": null, + "confidence": "high" + }, + { + "id": "R-QL", + "law": "FS", + "class": "not-a-conflict", + "ruling_says": "Rejected: (b) a deviation row for C#'s order.", + "law_says": "a surface this table does not name is DEVIATION until promoted — the aperture opens only by a ruling", + "why": "Evaluation order is unlisted (DEVIATION until promoted), and an owner ruling is FS's promotion route; FS's table has not yet gained the row.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-DI", + "law": "AP", + "class": "law-broken-acknowledged", + "ruling_says": "exempting `IEnumerable`/`IComparable`/`IEquatable`/`IFormattable`/`IDisposable` by a commented list; phase 2 (#2172) removes the `IEnumerable` exemption once a Sharpy `Iterable[T]` spelling exists", + "law_says": "Avoid ... raw .NET collections in public APIs", + "why": "A raw .NET interface stays in public APIs, which AP forbids; the row names the exemption and its reason (no Sharpy Iterable spelling yet; 223 signatures).", + "law_fix": "Until a Sharpy Iterable[T] exists, IEnumerable is the allowed public iteration type.", + "confidence": "high" + }, + { + "id": "R-DZ", + "law": "AP", + "class": "law-broken-acknowledged", + "ruling_says": "CLR enum members and constants resolve by their caps spelling (`DayOfWeek.MONDAY`), the verbatim name keeps working", + "law_says": "Avoid ... multiple ways to do the same thing", + "why": "Two accepted spellings for one member is what AP forbids; the row names the second spelling and keeps it because caps-only 'breaks running programs and the interop spec's example' (a T3 reason).", + "law_fix": "Where removing a spelling breaks running programs, AP yields to T3 until a ruled migration; the extra spelling is named as such.", + "confidence": "medium" + }, + { + "id": "R-OP", + "law": "AP", + "class": "not-a-conflict", + "ruling_says": "`T?` is STRICT: built only with `Some(...)` / `None()`, no implicit conversion", + "law_says": "Avoid ... multiple ways to do the same thing", + "why": "Loose T | None and strict T? have different semantics, so they are two things, not two ways of doing one thing.", + "law_fix": null, + "confidence": "medium" + }, + { + "id": "R-AG", + "law": "AP", + "class": "law-too-coarse", + "ruling_says": "Add the generator-expression construct", + "law_says": "Avoid \"add X because Python has it\"", + "why": "A2 lists comprehensions as Python surface Sharpy takes, while AP warns against adding X because Python has it; neither text says which additions pass, and the row gives no AP reason.", + "law_fix": "A Python surface is added when [stated test, e.g. corpus use, a twin with no .NET cost]; otherwise it is a 'not provided' ledger row.", + "confidence": "medium" + }, + { + "id": "R-IR", + "law": "AP", + "class": "law-too-coarse", + "ruling_says": "The surface was unlisted — a feature add the owner approved (the anti-pattern check \"add X because Python has it\" was the question).", + "law_says": "Avoid \"add X because Python has it\"", + "why": "The row names the anti-pattern as the question but the law gives no test to answer it, so it went to the owner.", + "law_fix": "A Python surface is added when [stated test, e.g. corpus use, a twin with no .NET cost]; otherwise it is a 'not provided' ledger row.", + "confidence": "high" + }, + { + "id": "R-ND", + "law": "AP", + "class": "law-too-coarse", + "ruling_says": "`open` and the archive openers accept every mode python accepts", + "law_says": "Avoid \"add X because Python has it\"", + "why": "Taking every python mode is the 'because Python has it' shape; AP gives no criterion for when a full Python surface is warranted, and the row gives none.", + "law_fix": "A Python surface is added when [stated test, e.g. corpus use, a twin with no .NET cost]; otherwise it is a 'not provided' ledger row.", + "confidence": "medium" + }, + { + "id": "R-AG", + "law": "CR7", + "class": "law-too-coarse", + "ruling_says": "Option (B) (named refusal, keep the spec) rejected.", + "law_says": "The spec is authoritative: read docs/language_specification/ first; change the implementation, never the spec.", + "why": "The spec said the construct does not exist; the owner chose to rewrite it. CR7 does not distinguish an agent conforming the code from the owner amending the spec.", + "law_fix": "An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'.", + "confidence": "medium" + }, + { + "id": "R-BR", + "law": "CR7", + "class": "law-too-coarse", + "ruling_says": "Delete the spec section, keep SPY0104", + "law_says": "The spec is authoritative: read docs/language_specification/ first; change the implementation, never the spec.", + "why": "The implementation stays and the spec is deleted, the reverse of CR7's literal text; it was an owner ruling, which CR7 does not address.", + "law_fix": "An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'.", + "confidence": "medium" + }, + { + "id": "R-DQ", + "law": "CR7", + "class": "law-too-coarse", + "ruling_says": "Rejected: (b) every cycle is SPY0302 (the current normative text)", + "law_says": "The spec is authoritative: read docs/language_specification/ first; change the implementation, never the spec.", + "why": "The owner replaced normative spec text with the implemented rule; CR7 is silent on owner amendments.", + "law_fix": "An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'.", + "confidence": "medium" + }, + { + "id": "R-IW", + "law": "CR7", + "class": "law-too-coarse", + "ruling_says": "`statements.md` §Expression Statement states the rule and the code", + "law_says": "The spec is authoritative: read docs/language_specification/ first; change the implementation, never the spec.", + "why": "The spec's 'any expression can be a statement' is narrowed to fit the refusal by ruling; CR7 does not say rulings may do this.", + "law_fix": "An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'.", + "confidence": "medium" + }, + { + "id": "R-MW", + "law": "CR7", + "class": "law-too-coarse", + "ruling_says": "the `pipe_operator.md:163` Limitation goes", + "law_says": "The spec is authoritative: read docs/language_specification/ first; change the implementation, never the spec.", + "why": "A spec limitation removed by ruling to admit a construct; CR7's 'never the spec' does not distinguish owner rulings.", + "law_fix": "An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'.", + "confidence": "medium" + }, + { + "id": "R-NW", + "law": "CR7", + "class": "law-too-coarse", + "ruling_says": "the spec row is amended", + "law_says": "The spec is authoritative: read docs/language_specification/ first; change the implementation, never the spec.", + "why": "Spec amended by owner ruling; CR7 is silent on that route.", + "law_fix": "An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'.", + "confidence": "medium" + }, + { + "id": "R-OB", + "law": "CR7", + "class": "law-too-coarse", + "ruling_says": "Rejected: (b) the spec's null check", + "law_says": "The spec is authoritative: read docs/language_specification/ first; change the implementation, never the spec.", + "why": "The spec's null-check rule for truthiness is replaced by python's rule by ruling; CR7 does not provide for it.", + "law_fix": "An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'.", + "confidence": "medium" + }, + { + "id": "R-MD", + "law": "CR7", + "class": "law-too-coarse", + "ruling_says": "Rejected: keep the spec's per-class .NET bridge", + "law_says": "The spec is authoritative: read docs/language_specification/ first; change the implementation, never the spec.", + "why": "The spec's per-class bridge is dropped and the spec rewritten by ruling; CR7 is silent on owner amendments.", + "law_fix": "An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'.", + "confidence": "medium" + }, + { + "id": "R-QR", + "law": "CR7", + "class": "law-broken-acknowledged", + "ruling_says": "A spec edit by ruling (rule 7).", + "law_says": "The spec is authoritative: read docs/language_specification/ first; change the implementation, never the spec.", + "why": "The row names the departure from CR7 and its route (an owner ruling); the reason is R-PZ's principle ('as in a plain def').", + "law_fix": "An owner ruling may amend the spec; agents never do, and the ruling row says 'spec edit by ruling (rule 7)'.", + "confidence": "high" + }, + { + "summary_by_law": { + "A1": { + "law-too-coarse": 2, + "not-a-conflict": 6 + }, + "A2": { + "law-too-coarse": 9, + "not-a-conflict": 12 + }, + "A3": { + "law-too-coarse": 2, + "not-a-conflict": 1 + }, + "AP": { + "law-broken-acknowledged": 2, + "not-a-conflict": 1, + "law-too-coarse": 3 + }, + "CR7": { + "law-too-coarse": 8, + "law-broken-acknowledged": 1 + }, + "FS": { + "resolved": 1, + "law-too-coarse": 2, + "law-written-later-and-contradicts": 1, + "not-a-conflict": 2 + }, + "N1": { + "law-written-later-and-contradicts": 1, + "resolved": 2 + }, + "N3": { + "resolved": 1 + }, + "N5": { + "law-too-coarse": 4, + "law-broken-acknowledged": 1 + }, + "N6": { + "not-a-conflict": 2, + "law-too-coarse": 2 + }, + "RR": { + "law-too-coarse": 3, + "law-broken-unacknowledged": 1, + "not-a-conflict": 1 + }, + "T1": { + "law-too-coarse": 1 + }, + "T2": { + "law-too-coarse": 5, + "law-written-later-and-contradicts": 2 + }, + "T3": { + "not-a-conflict": 5 + }, + "T4": { + "not-a-conflict": 4, + "law-too-coarse": 1 + } + } + } +] \ No newline at end of file diff --git a/docs/audits/ruling-audit-2026-11-21/conflicts-rulings.json b/docs/audits/ruling-audit-2026-11-21/conflicts-rulings.json new file mode 100644 index 000000000..536462bd3 --- /dev/null +++ b/docs/audits/ruling-audit-2026-11-21/conflicts-rulings.json @@ -0,0 +1,637 @@ +[ + { + "ids": [ + "R-ER", + "R-EU" + ], + "class": "explained-asymmetry", + "situation": "How the two match-guard positions (whole-arm guard and per-alternative guard) treat their condition.", + "a": "R-ER: \"A per-alternative guard uses truthiness, like the arm guard\".", + "b": "R-EU: \"An arm guard narrows the arm body; a per-alternative guard never narrows ... one rule: a guard that gates the WHOLE arm narrows (C#'s flow analysis honours `when x is not null` the same way)\".", + "why": "The positions agree on the condition's type (truthiness) and differ only on narrowing, and R-EU states why: only a guard that gates the whole arm establishes a fact for the arm body. Candidate law: a fact narrows exactly the code it gates.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-DX", + "R-EJ", + "R-ES" + ], + "class": "superseded-chain", + "situation": "Whether `== None` / `!= None` on a CLR reference type is refused.", + "a": "R-DX: \"Part 1: refuse `== None` / `!= None` on a CLR reference type with the `is None` steer\".", + "b": "R-EJ: \"R-DX part 1's refusal stands with a reworded steer\"; then R-ES: \"`== None` / `!= None` are allowed on every .NET reference type and run the type's `==` ... ~~R-DX part 1~~ is lifted for CLR types\".", + "why": "R-ES lifts R-DX part 1 (after R-EJ had kept it with a new steer), but the R-DX row itself is neither struck nor annotated; only R-ES records the supersession. Bookkeeping finding: R-DX needs a 'part 1 superseded by R-ES' mark (part 2 on truthiness stands).", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-DW", + "R-EH" + ], + "class": "superseded-chain", + "situation": "How a nullable-oblivious CLR member or parameter is typed when read.", + "a": "R-DW: \"Oblivious CLR members and parameters accept `None` on write and read as `T`\".", + "b": "R-EH: \"An unannotated CLR reference has UNKNOWN nullability ... stored into a slot declared `T` it is null-checked at that line ... **Supersedes the READ half of R-DW** (write half unchanged)\".", + "why": "R-EH replaces the read half explicitly; the R-DW row carries no mark of it. Bookkeeping finding (R-EH is also recorded as UNPLACED, so the superseded half may still be what the compiler does).", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-EH", + "R-ES" + ], + "class": "contradiction", + "situation": "A None test written as `x == None` on a CLR reference held in a slot declared non-null `T`.", + "a": "R-EH: \"a None test on a declared non-null reference `T` is refused\".", + "b": "R-ES: \"`== None` / `!= None` are allowed on every .NET reference type and run the type's `==` ... R-EH's wider point stays in #2230\".", + "why": "R-ES admits `== None` on every .NET reference type with no exception for a declared-non-null slot, and it defers R-EH's point without saying whether `== None` counts as the 'None test' R-EH refuses. R-EJ's 'is never runs user code; == runs __eq__' could make it an operator call, not a None test, but no row says so.", + "missing_rule": "On a declared non-null reference, say once whether `== None` is a refused None test or an admitted operator call.", + "confidence": "low" + }, + { + "ids": [ + "R-EW", + "R-ES" + ], + "class": "not-a-conflict", + "situation": "What `s == None` does on a Core type (frozenset) versus a foreign .NET reference type.", + "a": "R-EW: \"user programs lower `s == None` to `s is null` (#2238 @ 4fb77ebae)\".", + "b": "R-ES (#2238): \"`== None` / `!= None` are allowed on every .NET reference type and run the type's `==`\".", + "why": "Both cite #2238; read with R-EJ (\"the operator synthesized from `__eq__` is null-safe\") a Sharpy/Core type's `== None` is a null test and a foreign CLR type's runs its own operator, so they cover different receivers. Low confidence because R-ES says 'every .NET reference type' and Core's frozenset is one.", + "missing_rule": null, + "confidence": "low" + }, + { + "ids": [ + "R-FR", + "R-FV" + ], + "class": "superseded-chain", + "situation": "Which dropped span on the close line triggers the formatter's re-pair fact.", + "a": "R-FR: \"Arm (b) of the re-pair fact keys on a dropped span holding a quote character on the close line\".", + "b": "R-FV: \"Narrow R-FR (b): a quote in the given-up span counts only if a literal is still open at the line's END\".", + "why": "R-FV narrows R-FR's arm (b); the R-FR row is not struck or annotated. Bookkeeping finding (tooling, not language).", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-FK", + "R-FP", + "R-FU" + ], + "class": "not-a-conflict", + "situation": "The formatter/indent-map recovery facts after a lexer error.", + "a": "R-FK: \"a lex that dropped a line holding a quote character ... marks the literal map unknown\"; R-FP: \"the lex that feeds the map continues past the error budget without reporting\".", + "b": "R-FU: \"no edits below the opener's line while the bracket is open; lines above keep their repairs\".", + "why": "Each later row builds on the earlier one and names the rejected direction of the earlier ruling ((c) of R-FP is 'the direction R-FK rejected'); they cover different lexer facts and do not pull against each other.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-PK", + "R-QG" + ], + "class": "unexplained-asymmetry", + "situation": "Which Python enum model a string-backed enum follows, for ordering versus for `==`.", + "a": "R-PK: \"Ordering on ONE string-backed enum is refused in Semantic, as CPython's plain `Enum` does.\"", + "b": "R-QG: \"`==` between two different STRING-backed enum types compares by value, as `StrEnum` (`True` for equal values)\".", + "why": "The same string-backed enum is a plain Enum for `<` but a StrEnum for `==`; a StrEnum in CPython orders by value, a plain Enum compares by identity, so neither model gives both answers. Neither row says why the model changes with the operator.", + "missing_rule": "Each backing kind maps to ONE Python model (Enum, IntEnum or StrEnum) for every operator; a departure for one operator names its .NET reason.", + "confidence": "high" + }, + { + "ids": [ + "R-ON", + "R-QG" + ], + "class": "unexplained-asymmetry", + "situation": "`==` between members of two different enum types, int-backed versus string-backed.", + "a": "R-ON: \"`==` between two different int-backed enum types answers `False` ... Amended at call 46 by R-QG for string-backed enums (by value, as `StrEnum`); stands for int-backed enums.\"", + "b": "R-QG: \"`==` between two different STRING-backed enum types compares by value, as `StrEnum` ... Amends R-ON, which stands for int-backed enums\".", + "why": "The amendment is recorded on both rows, but no row says why int-backed enums follow plain Enum (`False`) while string-backed follow StrEnum (by value); CPython's IntEnum would also compare by value. The two backing kinds get opposite cross-type answers with no stated principle.", + "missing_rule": "Cross-type `==` on enums follows one model for both backing kinds (identity-False, or by-value for every backed enum).", + "confidence": "high" + }, + { + "ids": [ + "R-ON", + "R-OW" + ], + "class": "unexplained-asymmetry", + "situation": "Which Python model an int-backed enum follows, for `==` versus ordering.", + "a": "R-ON: \"`==` between two different int-backed enum types answers `False`\" (plain Enum behaviour; IntEnum would compare values).", + "b": "R-OW: \"Ordering on ONE int-backed enum type keeps .NET order, as `IntEnum` ... ordering across two enum types is refused in Semantic.\"", + "why": "Int-backed enums are IntEnum for `<` within a type but plain Enum for cross-type `==`. R-OW's reason (keep the status quo .NET order) covers ordering only; R-ON gives no reason for not following IntEnum. Mirror image of the R-PK/R-QG split for string-backed enums.", + "missing_rule": "Each backing kind maps to ONE Python model for every operator; a departure for one operator names its .NET reason.", + "confidence": "medium" + }, + { + "ids": [ + "R-OW", + "R-PK" + ], + "class": "explained-asymmetry", + "situation": "Ordering on members of one enum type, int-backed versus string-backed.", + "a": "R-OW: \"Ordering on ONE int-backed enum type keeps .NET order, as `IntEnum` ... (a) records the status quo.\"", + "b": "R-PK: \"Ordering on ONE string-backed enum is refused ... Rejected: (b) order by value as `StrEnum`, mirroring R-OW (one-way; there is no .NET order to keep). R-OW stands for int-backed enums.\"", + "why": "R-PK states the reason: an int-backed enum has a .NET order already in use, a string-backed one has none. Candidate law: keep an existing .NET behaviour where one exists; otherwise follow CPython's plain model.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-OM", + "R-OX" + ], + "class": "explained-asymmetry", + "situation": "Whether `is` on value-type operands can answer True.", + "a": "R-OM: \"`is` / `is not` with an operand statically typed as an enum compare by member, as CPython's singletons do\".", + "b": "R-OX: \"`is` / `is not` are identity only ... value types: each operand is boxed, so the answer is always `False`, with warning SPY0465; ... an enum operand compares by member (R-OM) — the one ruled exception, CONFIRMED by the owner ...: 'enum values are singletons basically'\".", + "why": "R-OX records the enum exception and the owner's reason (enum members are singletons). Explained.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-PI", + "R-PL" + ], + "class": "unexplained-asymmetry", + "situation": "Equality of two values of a type that declares no `__eq__`, asked by `==` versus by a container search or container equality.", + "a": "R-PI: \"`==` / `!=` on a type that declares no `__eq__` stays REFUSED, with one rule and one code for every spelling, wrapper and site\".", + "b": "R-PL: \"a container search or container equality checks identity before `__eq__` for reference-type elements ... value types keep `Equals`\".", + "why": "R-PI promises one rule for 'every spelling, wrapper and site', yet `x in [y]` or `[x] == [y]` over such a type answers by identity (reference types) or .NET `Equals` (structs) where `x == y` is refused; neither row mentions the other. Rejected option (b) of R-PI was exactly 'reference types compare identity'.", + "missing_rule": "An equality question about a type with no `__eq__` gets one verdict at every site: refused everywhere, or identity everywhere (with `in`/container `==` counted as sites).", + "confidence": "medium" + }, + { + "ids": [ + "R-OY", + "R-PI" + ], + "class": "not-a-conflict", + "situation": "A comparison chain over a class without `__eq__`.", + "a": "R-OY: \"A chain link is its binary twin in every outcome ... `a == c == a` over a class without `__eq__` is SPY0402 wherever `a == c` is\".", + "b": "R-PI: \"`==` / `!=` on a type that declares no `__eq__` stays REFUSED\".", + "why": "R-OY applies R-PI's refusal to chains; the two agree.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-PW", + "R-PY" + ], + "class": "explained-asymmetry", + "situation": "When module values and class `@static` values are initialized relative to each other.", + "a": "R-PW: \"Declaration order, never dropped: a store to a module or `@static` value before its initializer is kept ... the initializer still runs at its declared position ... Across classes R-PY decides.\"", + "b": "R-PY (owner: \"go with option 1, C# order\"): \"Every class ... sweeps as a unit ... the first time it is touched, or when the module's sweep reaches its position ... module-level values keep the declaration-order sweep\".", + "why": "R-PW defers the cross-class case to R-PY, and R-PY's stated basis is C#'s per-class type initialization (A1); module values have no such per-type unit. Explained, though by pointer rather than a written principle.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-PY", + "R-QA" + ], + "class": "superseded-chain", + "situation": "Two classes whose static initializers read each other's values.", + "a": "R-PY: \"Across classes today's values hold (`5 5`; `out B.q`: `1 42`).\"", + "b": "R-QA: \"Two classes whose initializers read each other's values raise `NameError` whichever is touched first, including the touch order that prints correct values today. Named departure from C#\".", + "why": "R-QA carves the mutual-read case out of R-PY's C# order and names the departure (T1: no touch-order-dependent silent value). R-PY's row is not annotated with the narrowing.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-PS", + "R-QA", + "R-QB" + ], + "class": "not-a-conflict", + "situation": "Whether an initialization cycle between values is a compile error or a run-time NameError.", + "a": "R-PS: \"SPY0278's 'visible cycle' is decided by a map ... Rejected: SPY0278 for const cycles only, every non-const cycle a run-time `NameError`.\"; R-QB: \"A ring of non-const values is a compile error unless a same-module store names one of its values\".", + "b": "R-QA: \"Two classes whose initializers read each other's values raise `NameError` whichever is touched first\".", + "why": "R-QA rules the run-time behaviour where the cycle reaches run time; R-PS/R-QB (and R-PZ: \"SPY0278 where the compiler can see it\") put the visible ones at compile time. Read together they are layered, though R-QA's row does not say its NameError is only for cycles the compiler cannot see.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-HH", + "R-HT" + ], + "class": "contradiction", + "situation": "How a spec-silent surface where Sharpy runs a program and python3 refuses it is classified under the fidelity table.", + "a": "R-HH: \"the spec is silent on case ..., so the surface is COMPARED (programs run vs refused, spec deferring to Python)\" — Python's refusal adopted.", + "b": "R-HT: \"the spec has no grammar block and is silent (fidelity-scope D5: DEVIATION until promoted)\" — Sharpy keeps accepting `01`, recorded as a deviation.", + "why": "Both are 'which programs run vs are refused' with a silent spec, and the rows read spec silence in opposite ways (silence = defers to Python vs silence = unlisted, DEVIATION). R-HH also had a host-dependence reason (T4) that could have carried it alone, but the classification premise it states contradicts R-HT's.", + "missing_rule": "A silent spec on whether a program runs is either 'defers to python3' (COMPARED) or 'unlisted' (DEVIATION) — one reading for every such surface.", + "confidence": "medium" + }, + { + "ids": [ + "R-FA", + "R-HT" + ], + "class": "unexplained-asymmetry", + "situation": "Sharpy accepts something CPython refuses, and users may come to depend on the acceptance.", + "a": "R-FA: \"`hmac.new` without `digestmod` is refused ... (an implicit digest is the acceptance users come to depend on, and CPython removed it on purpose) ... a kept acceptance is the one-way direction.\"", + "b": "R-HT: \"(a) RECORD: a `docs/deviations.yaml` row (`leading-zero-decimal-integer` ...) ... (a) accepts a spelling users may come to depend on — a → b later breaks programs — so this is the one-way choice, taken knowingly\".", + "why": "R-FA's test refuses an acceptance users would depend on; R-HT keeps exactly such an acceptance (CPython also refuses `01` on purpose) and says it is knowingly one-way, without saying why R-FA's test does not apply. The surfaces differ (stdlib call vs literal syntax), but no row states that the distinction matters.", + "missing_rule": "When Sharpy accepts what CPython refuses: record a deviation only if no valid CPython program changes meaning and the acceptance is harmless; otherwise refuse — for syntax and library alike.", + "confidence": "medium" + }, + { + "ids": [ + "R-EV", + "R-FA" + ], + "class": "explained-asymmetry", + "situation": "A stdlib signature whose `None` default diverges from CPython.", + "a": "R-EV: \"A CPython sentinel default becomes an overload WITHOUT that parameter ... Rejected: (a) deviation row (a silent divergence on a COMPARED surface)\".", + "b": "R-FA: \"`endpos: int | None = None` stays as ONE `docs/deviations.yaml` row (the stdlib `T | None = None` convention; no valid CPython program changes meaning)\".", + "why": "Different verdicts, and the rows give the reason: R-EV's divergence changes what a valid CPython call means, R-FA's only accepts a call CPython refuses. Candidate law: a divergence that changes a valid program's meaning is fixed; a pure widening may be a deviation row.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-NZ", + "R-OA" + ], + "class": "explained-asymmetry", + "situation": "CPython's fallbacks for `in` on a class without `__contains__`.", + "a": "R-NZ: \"A user class with `__iter__` and no `__contains__` answers `in` / `not in` by iteration\".", + "b": "R-OA: \"A class with only `__len__` + `__getitem__` stays refused for `in` (SPY0320); a deviation row carries the owner's reason (the index need not be an integer; an integer index need not be dense).\"", + "why": "R-OA states why the second fallback differs: `__getitem__` does not imply an integer, dense sequence protocol, while `__iter__` is exactly iteration.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-NV", + "R-NX" + ], + "class": "explained-asymmetry", + "situation": "A `None` needle in a membership test: built-in containers versus some Stdlib types.", + "a": "R-NV: \"A `T | None` needle is accepted (`None` → `False`)\".", + "b": "R-NX: \"A `None`-valued needle in `IPv4Network`, `IPv6Network`, `EmailMessage` raises `AttributeError` (rejected: answer `False` with a deviation)\".", + "why": "Neither row states the reason, but R-OS later supplies it: \"only the equality scans answer `False`\", a receiver with its own `__contains__` raises. Explained by a later row, not by either of these.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-NX", + "R-OS" + ], + "class": "unexplained-asymmetry", + "situation": "Which exception a `None` needle raises when the receiver's `__contains__` cannot take `None`.", + "a": "R-NX: \"A `None`-valued needle in `IPv4Network`, `IPv6Network`, `EmailMessage` raises `AttributeError`\".", + "b": "R-OS: \"a `None` needle into an opaque receiver whose `__contains__` / `Contains` parameter is a plain value type `T` is the principle's 'a `T | None` passed into a plain `T` raises `TypeError` at that point'\".", + "why": "R-NX follows CPython's AttributeError; R-OS (and R-OP: \"a `T | None` stored or passed into it ... raises `TypeError` there\") makes the boundary raise TypeError. R-OS says #2635 'lands as built', which keeps R-NX, but no row says when the Stdlib receiver's CPython exception beats the boundary TypeError.", + "missing_rule": "A None reaching a plain-T `__contains__` parameter raises one exception type: CPython's where the receiver is a COMPARED Stdlib type, TypeError otherwise — stated once.", + "confidence": "low" + }, + { + "ids": [ + "R-G", + "R-T" + ], + "class": "unexplained-asymmetry", + "situation": "Storing a plain `T` value into a name declared `T?`.", + "a": "R-G: \"implicit `T → T?` retired ... `Some(v)`/`None()` sole constructors ... `T?` converts implicitly in NO direction.\"", + "b": "R-T: \"inside a narrowing, a store to the narrowed `T?` name takes the PAYLOAD type as its slot and re-wraps\".", + "why": "Outside a narrowing `x = 5` into an `int?` needs `Some(5)`; inside one the same store is implicitly wrapped. R-T is a payload-slot rule and does not cite R-G; no row says why the narrowed position may convert when R-G says no position does.", + "missing_rule": "A narrowed `T?` name's slot type is its payload for reads and stores alike, stated as the one exception to strict construction.", + "confidence": "medium" + }, + { + "ids": [ + "R-A", + "R-R" + ], + "class": "unexplained-asymmetry", + "situation": "A non-constant (collection, tuple, Some) default value: dataclass field versus function/lambda parameter.", + "a": "R-A: \"Dataclass collection-literal field defaults lower to per-instance initialization; never a C# default-parameter value; SPY0400 stays for function params\".", + "b": "R-R: \"ONE emittable-constant-default predicate consumed by all three sites; `Some(...)` and tuple literals → SPY0401 with the `= None()` + `x ??= Some(v)` steer ... Option C (forward-overload synthesis) recorded future\".", + "why": "A field default C# cannot hold is lowered; a parameter default C# cannot hold is refused. Neither row gives the reason (plausibly: Python evaluates parameter defaults once and shares them, so per-call evaluation would change meaning), so the split is unstated.", + "missing_rule": "A default C# cannot emit as a constant is evaluated per use where Python also evaluates per use (fields), and refused where Python shares one evaluated value (parameters).", + "confidence": "medium" + }, + { + "ids": [ + "R-BN", + "R-CJ" + ], + "class": "contradiction", + "situation": "The str/repr of `defaultdict`.", + "a": "R-BN: \"`str`/`repr` renders `defaultdict(, {...})`, documented as a deviation in the collections spec.\"", + "b": "R-CJ: \"`str`/`repr` of EVERY Stdlib type is COMPARED, one tracker per type family: every Stdlib type with a constructor-spelled python repr implements `IRepr`\".", + "why": "R-CJ is later and says EVERY Stdlib type is compared, with no carve-out for R-BN's documented placeholder; R-BN is not marked superseded. R-BN's reason (python's `` needs rung-4 name-keyed magic) still applies, so R-CJ probably means to keep it, but no row says so.", + "missing_rule": "Stdlib reprs are COMPARED except for a part naming a runtime value with no source spelling (a factory, a function), which prints a fixed placeholder.", + "confidence": "medium" + }, + { + "ids": [ + "R-CE", + "R-CI" + ], + "class": "not-a-conflict", + "situation": "Whether run-time exception message text must match CPython.", + "a": "R-CE: \"runtime keyword text becomes python's `KeyError: 'name'`\".", + "b": "R-CI: \"Exception message text beyond the type name is DEVIATION by default ... Rejected: match every message text (unbounded ...). Relaxable later.\"", + "why": "R-CI sets a default (not compared) and does not forbid matching; R-CE chose to match one text (and a KeyError's text is its key). They do not pull against each other.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-LK", + "R-LV", + "R-MB" + ], + "class": "superseded-chain", + "situation": "The E2 emitter-port plan P82: its sequencing and the `MergeFrom` disjointness rule.", + "a": "R-LK: \"sequenced after P80 ... `MergeFrom` asserts disjointness\".", + "b": "R-LV: \"P82's first tranche ran ahead of its charter slot after P80 ... (R-LK's 'after P80' superseded)\"; R-MB: \"`MergeFrom` is equal-value tolerant ... the issue title's and row 0's 'disjoint' wording is REWORDED here.\"", + "why": "Two later rulings replace two parts of R-LK; the R-LK row carries neither mark. Bookkeeping finding (process).", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-BI", + "R-CN", + "R-GV" + ], + "class": "superseded-chain", + "situation": "The ordering of the P21 (let/bindings) sub-plans.", + "a": "R-BI: \"P21 last, three sub-phases ... P21 follows P20\".", + "b": "R-CN: \"P21d → P21e → P21b → P21c NEXT, before P15 ... Supersedes R-BI's sequencing only\"; R-GV: \"R-CN's ordering is superseded (its premise is now internal to the bindings plan)\".", + "why": "A two-step chain; neither R-BI nor R-CN is struck or annotated, although R-BI is entirely about sequencing. Bookkeeping finding (process).", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-BK", + "R-GV", + "R-LR" + ], + "class": "contradiction", + "situation": "A walrus `:=` whose target is an existing `let` binding.", + "a": "R-GV: \"B5 amends R-BK (`:=` on an existing `let` is an error, never a silent shadow) ... B1–B12 ... are recorded by pointer ... and never re-asked\".", + "b": "R-LR (later): \"a walrus over a `let` is decided in P21b's plan with `let`'s own semantics; until then the harness pins the cells `Unruled` and the docs keep the open-question sentence ... Rejected: ... (c) refuse now (restricts two shapes that run and agree with python)\".", + "why": "R-GV records the case as already decided (an error), and R-LR treats it as open and rejects refusing it now; R-LR does not cite R-GV/B5. R-BK (\"declare-if-new, rebind-if-existing\") is also not marked as amended by B5.", + "missing_rule": "Whether `:=` onto an existing `let` is an error, a write-through, or open must be stated once; R-GV's B5 and R-LR cannot both stand.", + "confidence": "medium" + }, + { + "ids": [ + "R-BL", + "R-GV", + "R-QI" + ], + "class": "superseded-chain", + "situation": "Whether a module-scope non-const binding (`x: T = e`, `let x`) is legal.", + "a": "R-BL: \"module-scope non-const bindings (`x: T = e` without keyword, `let x`) are SPY0340 with the steer 'module-scope bindings are `const`'\" (R-CY likewise reasons 'dies under const-only module scope').", + "b": "R-GV: \"ruling A (module `const`-only) and the 2026-09-21 'no mutability axis' are superseded\"; R-QI: \"A module-level or `@static` declaration with no initializer is REFUSED ..., with a steer to `x: int = 0`\" (a mutable module value, as R-PW's stores to module values also assume).", + "why": "Later rulings treat non-const module values as legal and R-GV says the const-only rule is superseded, but R-BL's refusal and steer are not marked, and R-CY's stated rationale rests on the dropped premise. Medium because R-GV names 'ruling A', not R-BL, and the link is inferred.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-MH", + "R-MJ" + ], + "class": "superseded-chain", + "situation": "A comprehension's walrus over an outer name that is read afterwards.", + "a": "R-MJ: \"A comprehension's walrus over a visible outer name read after it is REFUSED ... narrowed by R-MH for same-function bindings.\"", + "b": "R-MH: \"a comprehension's walrus over a binding of the SAME function — a local or a parameter — writes through as python does ... this narrows plan-3eba57 D9 (R-MJ), which stays in force for a module or enclosing outer.\"", + "why": "Both rows record the narrowing. The remaining split (same-function writes through, module/enclosing refused) matches N6's same-function store rule, so it is explained by law, though the N5 text in name-resolution.md still says 'ruling open on #2427'.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-NU", + "R-NW" + ], + "class": "explained-asymmetry", + "situation": "Membership in `bytes` with an `int` needle versus a `bool` needle (an int in Python).", + "a": "R-NU: \"`bool` and `decimal` needles into `range` and `bytes` stay refused (SPY0222); the stated reason is the implicit-conversion rule\".", + "b": "R-NW: \"A `bytes` container takes a `bytes` needle (subsequence) and an `int` needle (one byte)\".", + "why": "R-NU gives the reason: Sharpy has no implicit `bool` → `int` conversion, so a bool needle does not fit the int slot.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-AU", + "R-OB" + ], + "class": "explained-asymmetry", + "situation": "Truth-testing a fixed-arity tuple versus a `tuple | None`.", + "a": "R-AU: \"A fixed-arity tuple is not truth-testable by the spec's own rule (no falsy case ...) ... `tuple | None` keeps the null test\".", + "b": "R-OB: \"The truth value of a `T | None` is python's — `None` or a falsy payload is false — in every truth-testing position\".", + "why": "R-AU's reason (a type with no falsy value is not truth-testable) explains why `tuple | None` (falsy when None) is testable and `tuple` is not; R-OB's rule gives the same answer for a non-empty fixed-arity payload. Candidate law: a type is truth-testable only if it has a falsy value.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-Z", + "R-OV" + ], + "class": "superseded-chain", + "situation": "A warning on using a `T | None` without narrowing it.", + "a": "R-Z: \"Closed by design (loose family per spec + #882) ... opt-in unnarrowed-deref warning filed as parked #1793.\"", + "b": "R-OV: \"Two warning codes: one for an operation on a `T | None` that fails on `None` (member, index, iteration, `len`, arithmetic, ordering) ... default-on\".", + "why": "R-OV turns the parked opt-in warning of R-Z into a default-on one; R-Z (loose access accepted) otherwise stands under R-OP. R-Z's row is not annotated.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-OC", + "R-OP" + ], + "class": "superseded-chain", + "situation": "Ordering on a `T | None` operand.", + "a": "R-OC: \"~~Ordering on a `T | None` is refused at compile time;~~ (the ordering half now reads as R-OP states: allowed with a warning, `TypeError` on `None`)\".", + "b": "R-OP: \"Supersedes the ordering half of R-OC\".", + "why": "Properly marked on both rows.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-B", + "R-L", + "R-W" + ], + "class": "superseded-chain", + "situation": "The type of a conditional or display whose branches/elements differ.", + "a": "R-B: \"~~Ternary with incompatible branches types as the nearest common ancestor~~ SUPERSEDED by R-W\"; R-L: \"Join half SUPERSEDED by R-W\".", + "b": "R-W: \"One element/branch type rule = C#'s best-common-type ... Supersedes R-B and R-L's join half ... the compiler never invents an ancestor.\"", + "why": "Marked on all three rows.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-JJ", + "R-JT", + "R-KD" + ], + "class": "superseded-chain", + "situation": "Bare class-body reads outside methods and forward static reads.", + "a": "R-JJ: \"C#'s rule PER POSITION ... SUPERSEDED as the governing rule 2026-11-01 by the name-resolution principle\"; R-JT: \"a FORWARD static read ... is refused ... SECOND HALF SUPERSEDED 2026-11-01 (N3 ...)\".", + "b": "R-KD places the N1–N7 plans that carry the replacing rules.", + "why": "Both earlier rows carry their supersession notes in-row. Properly marked.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-JV", + "R-KF", + "R-KG" + ], + "class": "superseded-chain", + "situation": "A bare class-body name read inside a lambda in a class-body initializer, and inside a nested type.", + "a": "R-JV: \"a lambda in an initializer reads what its ENCLOSING initializer may read ... SUPERSEDED 2026-11-01 (N1; R-KF, R-KG): a lambda is a body — class-body names stay invisible bare inside it\".", + "b": "R-KG: \"(a) REFUSED with a steer naming the position ... N1's list of bodies where class-body names are invisible bare gains 'nested type bodies' beside methods, nested functions, lambdas\".", + "why": "R-JV is struck and annotated; R-KG and R-KF are consistent with the replacing N1 rule.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-II", + "R-IZ" + ], + "class": "not-a-conflict", + "situation": "Collisions of an import binding with another module binding.", + "a": "R-II: \"An import alias is checked like every other module binding: a same-module class/def/alias collision is SPY0204\".", + "b": "R-IZ: \"an explicit import of a different source COLLIDES with a star-exported name in both orders — SPY0204 at the explicit import ... python3 is last-wins ... the spec rules (R-II's precedent).\"", + "why": "R-IZ extends R-II's collide-by-rule principle to star imports; they agree.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-NY", + "R-OO", + "R-OQ" + ], + "class": "superseded-chain", + "situation": "Where the value-ness work (enums and struct-like types as value types) is planned.", + "a": "R-NY: \"Enums are value types across the compiler ... a third `/verify-plan` pass on plan-4e2867 is allowed.\"", + "b": "R-OQ: \"Supersedes the placement of R-NY and of R-OO only; the work itself is not dropped — R-OU rules it.\"", + "why": "R-OO records the move in-row; R-NY does not. Bookkeeping finding (placement, not semantics).", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-HU", + "R-IA" + ], + "class": "explained-asymmetry", + "situation": "A numeric literal that its type cannot represent: overflow versus underflow, float versus decimal.", + "a": "R-HU: \"REFUSE every numeric literal outside the range of its own resolved type ... CPython: `1e400` is `inf`. Rejected: (b) float64 unsuffixed → `inf` ... `x: float = 1e400` then carries infinity into arithmetic silently\".", + "b": "R-IA: \"A non-zero `decimal` literal whose value becomes zero is REFUSED ...; float32 and float64 keep IEEE underflow to zero (C#'s and CPython's value) ... Rejected: (c) refuse non-zero→zero for every float type (refuses `print(1e-400)`, which CPython runs printing `0.0`)\".", + "why": "The rows give the reasons: float underflow keeps the value C# and CPython agree on; float overflow (C# refuses, CPython gives inf) and decimal underflow (C# silently 0m) are refused. Candidate law: an unrepresentable literal is refused unless C# and CPython give the same value.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-KU", + "R-LQ" + ], + "class": "explained-asymmetry", + "situation": "A class-level (static) member reached through `self`: store versus read.", + "a": "R-KU: \"(a) REFUSE with the steer 'write `H.x = …`' — python's meaning (an instance / subclass attribute: `2 5`) cannot be matched\".", + "b": "R-LQ: \"`self.N()` on a nested type is ADMITTED, lowered type-qualified `C.N()` — one rule for class attributes read through `self`\".", + "why": "R-KU says why the store differs: in Python a store through `self` creates an instance attribute, which Sharpy cannot match, while a read through `self` has the same meaning as the qualified read. Candidate law: admit a spelling only where its Python meaning is kept.", + "missing_rule": null, + "confidence": "high" + }, + { + "ids": [ + "R-CH", + "R-IM" + ], + "class": "unexplained-asymmetry", + "situation": "`str()` of a value of a built-in union type: Optional versus Result.", + "a": "R-CH: \"`str` transparent, `repr` = constructor spelling on both variants ...: `print/str/f\\\"{o}\\\"/format(o)` print `1`/`None` ... Rejected: (b) `Some(1)` for `str` (one-way output change on a common form).\"", + "b": "R-IM: \"`str` and `repr` of a user-declared `union` value are both the constructor spelling ... `Result` follows the same rule (`Ok(1)` / `Err('e')`)\".", + "why": "`str(Some(1))` prints `1` but `str(Ok(1))` prints `Ok(1)`; R-IM cites R-CH for `None()`'s shape but not for why Result's `str` is not transparent like Optional's. R-CH's reason (an output change on an already-common form) is about existing output, not a principle that separates the two types.", + "missing_rule": "`str` of a built-in wrapper either shows its payload (Optional and Result alike) or its constructor spelling; one rule for both.", + "confidence": "medium" + }, + { + "ids": [ + "R-DV", + "R-DZ" + ], + "class": "explained-asymmetry", + "situation": "A second spelling for a CLR name.", + "a": "R-DV: \"Refuse every dotted CLR name that no import binds ... Rejected: (b) accept the fully qualified spelling from referenced assemblies (a second way to name a type).\"", + "b": "R-DZ: \"CLR enum members and constants resolve by their caps spelling (`DayOfWeek.MONDAY`), the verbatim name keeps working ... Rejected: ... (c) caps only, verbatim needs backticks (breaks running programs and the interop spec's example).\"", + "why": "R-DZ keeps two spellings and gives the reason (the verbatim one already runs and is in the spec); R-DV refuses a second spelling that was not already relied on. Candidate law: a new second spelling is refused; an existing one is kept only to avoid breaking running programs.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-AI", + "R-M" + ], + "class": "explained-asymmetry", + "situation": "Flow facts after a `with` whose manager may suppress exceptions: an unassigned local versus a missing return.", + "a": "R-AI: \"a bare-declared local assigned inside the body and read after is runtime-checked ... `UnboundLocalError` on an unset read (python3 verified both arms)\".", + "b": "R-M: \"successor reachable under a suppressing manager → SPY0266 by direction with a steer for non-None functions\".", + "why": "One case is a run-time error, the other a compile error. R-AI gives its reason (python3 raises the same error at run time; a static rule would refuse nearly every statement); R-M's case has no run-time twin (Python would return None into a non-None slot, a silently wrong value under T1). Low confidence because R-M's row is terse and states no reason itself.", + "missing_rule": null, + "confidence": "low" + }, + { + "ids": [ + "R-AM", + "R-BP" + ], + "class": "not-a-conflict", + "situation": "The steer for a bare `tuple` annotation versus the refusal of `tuple[T, ...]`.", + "a": "R-AM: \"`tuple[T, ...]` refused by name now ... support ... parked as #1870\".", + "b": "R-BP: \"Bare `tuple` annotation is refused ...: steer to `()`/`tuple[()]` for the empty tuple or `tuple[T, …]`; the any-arity tuple stays #1870 (parked).\"", + "why": "R-BP's `tuple[T, …]` (Unicode ellipsis) reads as a fixed-arity element list, not the refused `...` form, since it keeps #1870 parked. Medium because the steer text could be read as pointing at the refused spelling.", + "missing_rule": null, + "confidence": "medium" + }, + { + "ids": [ + "R-BF", + "R-FW" + ], + "class": "not-a-conflict", + "situation": "Using a function or method as a value.", + "a": "R-BF: \"a bound method / CLR-identity method group in value position is a TYPED delegate ...; no refusal.\"", + "b": "R-FW: \"A function with a `*args` tail is not a value without a lambda ... the same footing as R-BR (function types carry no names, defaults or tails).\"", + "why": "R-FW's refusal is limited to callables whose shape a function type cannot carry, and gives that reason; R-BF covers ordinary signatures. No pull.", + "missing_rule": null, + "confidence": "medium" + } +] \ No newline at end of file diff --git a/docs/audits/ruling-audit-2026-11-21/principles.json b/docs/audits/ruling-audit-2026-11-21/principles.json new file mode 100644 index 000000000..76a2c55ea --- /dev/null +++ b/docs/audits/ruling-audit-2026-11-21/principles.json @@ -0,0 +1,1271 @@ +[ + { + "name": "reversible-door", + "statement": "Among open options pick the one from which the others stay additive: refuse a form not yet admitted rather than admit it, and keep admitting a form already admitted rather than restrict it.", + "scope": "language", + "members": [ + "R-H", + "R-AM", + "R-EQ", + "R-FA", + "R-JZ", + "R-IZ", + "R-PK", + "R-PI", + "R-QM", + "R-DR", + "R-LR", + "R-AO", + "R-BF", + "R-CS", + "R-LE", + "R-KT", + "R-HW", + "R-AW", + "R-HH", + "R-EW", + "R-DW", + "R-CW", + "R-CX", + "R-FM", + "R-FC", + "R-DJ", + "R-BR", + "R-ML", + "R-JG", + "R-KW", + "R-HJ", + "R-DH", + "R-GD", + "R-DL", + "R-FH", + "R-IA", + "R-OA", + "R-NU", + "R-HT", + "R-DZ", + "R-AX", + "R-FW", + "R-OW" + ], + "checked": [ + "R-H", + "R-AM", + "R-EQ", + "R-FA", + "R-JZ", + "R-IZ", + "R-PK", + "R-PI", + "R-QM", + "R-DR", + "R-LR", + "R-AO", + "R-BF", + "R-CS", + "R-LE", + "R-KT", + "R-HW", + "R-AW", + "R-HH", + "R-EW", + "R-DW", + "R-CW", + "R-CX", + "R-FM", + "R-FC", + "R-DJ", + "R-BR", + "R-ML", + "R-JG", + "R-KW", + "R-HJ", + "R-DH", + "R-GD", + "R-DL", + "R-FH", + "R-IA", + "R-OA", + "R-NU", + "R-HT", + "R-DZ", + "R-AX", + "R-FW", + "R-OW" + ], + "counter_examples": [ + { + "id": "R-OY", + "why": "Refuses comparison chains that ran, the one-way tightening of an admitted form, because their verdict differed from the binary twin." + }, + { + "id": "R-QA", + "why": "Makes programs that print correct values today raise NameError, restricting admitted behaviour to remove an order-dependent value (T1)." + }, + { + "id": "R-EU", + "why": "Picks (a), stated as one-way in practice, over (b) from which (a) was additive, to keep one narrowing rule." + }, + { + "id": "R-QL", + "why": "Chooses a one-way output change (Python's evaluation order) over the reversible deviation row." + }, + { + "id": "R-PL", + "why": "Promotes identity-before-__eq__ in containers, one-way for output, over recording a deviation." + }, + { + "id": "R-OB", + "why": "Adopts Python truthiness for T | None, one-way for output, over refusing or the spec's null check." + }, + { + "id": "R-ND", + "why": "Ships a new public Core type for every open mode (stated one-way) rather than the deviation subset." + }, + { + "id": "R-MT", + "why": "Implements dataclass copy(), one-way once called, rather than rewriting the docs that promise it." + }, + { + "id": "R-AI", + "why": "Emulates Python's run-time UnboundLocalError instead of the compile-time refusal the applied default had." + }, + { + "id": "R-HU", + "why": "Refuses 1e400 (Python's inf) although python3 runs it; the door argument is used against the Python value, not for admission." + } + ], + "boundary": "Yields when the reversible option leaves a silent difference from Python on a COMPARED surface, a silently wrong or order-dependent value (T1), or withdraws a documented surface; then the one-way fix is taken and recorded by direction.", + "nearest_written_law": null, + "gap": "No written law says which door to prefer; FS only says the fidelity aperture opens by ruling. The 'a refusal can be relaxed later' reasoning appears in about 70 rows but in no law.", + "would_have_decided": 32, + "confidence": "high" + }, + { + "name": "uniform-verdict-across-forms", + "statement": "A desugared form, an alternative spelling, another host, or another member of an operator or declaration family gets exactly its primitive's verdict, value and diagnostic code; no form-specific refusal or exemption.", + "scope": "language", + "members": [ + "R-OY", + "R-PD", + "R-PE", + "R-PF", + "R-IA", + "R-OH", + "R-PI", + "R-MI", + "R-LS", + "R-CW", + "R-BU", + "R-MW", + "R-EI", + "R-ER", + "R-LH", + "R-KY", + "R-PT", + "R-R", + "R-II", + "R-AA", + "R-EE", + "R-CR", + "R-DP", + "R-IP", + "R-HH" + ], + "checked": [ + "R-OY", + "R-IA", + "R-OH", + "R-MI", + "R-CW", + "R-BU", + "R-MW", + "R-ER", + "R-EU", + "R-NU", + "R-NW", + "R-DZ", + "R-PI", + "R-CR", + "R-IP" + ], + "counter_examples": [ + { + "id": "R-EU", + "why": "After R-ER made the two match-guard positions alike for truthiness, R-EU makes them differ for narrowing; uniformity is by mechanism (what gates the whole arm), not by syntactic position." + }, + { + "id": "R-DZ", + "why": "Accepts two spellings (caps and verbatim) for one CLR enum member, to keep running programs." + }, + { + "id": "R-NU", + "why": "A bool needle is refused for bytes while R-NW admits an int needle, though Python's bool is an int; the family is drawn by Sharpy's conversion rules, not Python's." + }, + { + "id": "R-ON", + "why": "Int-backed enums follow plain Enum for == but IntEnum for ordering (R-OW): one type, two flavours across one operator family." + } + ], + "boundary": "Uniformity is judged by Sharpy's own type and conversion rules and by the mechanism (what gates, what converts), not by Python's family lines; a second spelling may survive to keep a correct program running (T3).", + "nearest_written_law": "N7", + "gap": "N7 covers reads of one name by spelling and T4 covers module/class/generic hosts; neither extends to desugared forms (chains, augmented operators, pipes), builtin versus user types, or declaration kinds sharing a convention.", + "would_have_decided": 20, + "confidence": "high" + }, + { + "name": "one-authority-per-fact", + "statement": "Each fact or behaviour has one implementation every consumer calls: a compile-time check calls the runtime's pure function, an operator and its library function share one engine, and one authority spells each name or identity.", + "scope": "language", + "members": [ + "R-BX", + "R-CG", + "R-IP", + "R-AN", + "R-CF", + "R-DE", + "R-NG", + "R-LP", + "R-CO", + "R-HD", + "R-IB", + "R-IL", + "R-DH", + "R-CW", + "R-DD", + "R-JC", + "R-R", + "R-AQ" + ], + "checked": [ + "R-BX", + "R-IP", + "R-AN", + "R-NG", + "R-CO", + "R-DH" + ], + "counter_examples": [], + "boundary": null, + "nearest_written_law": "CR2", + "gap": "CR2 and VC11 make the emitter pure and facts materialized once, but say nothing about runtime/compile-time twins or shared engines; mirrors were twice built and retired (R-BX, R-CG).", + "would_have_decided": 15, + "confidence": "high" + }, + { + "name": "csharp-limit-named-refusal", + "statement": "When C# cannot express a construct, refuse it before Roslyn with a named Sharpy code and the steer a C# programmer would write; do not emulate it with a lowering users could depend on.", + "scope": "language", + "members": [ + "R-N", + "R-JG", + "R-KT", + "R-ML", + "R-IW", + "R-CS", + "R-QK", + "R-PT", + "R-HJ", + "R-LE", + "R-KW", + "R-HW", + "R-FO", + "R-JL", + "R-AW", + "R-HU", + "R-FW" + ], + "checked": [ + "R-N", + "R-JG", + "R-KT", + "R-ML", + "R-IW", + "R-CS", + "R-QK", + "R-HJ", + "R-LE", + "R-KW", + "R-HW", + "R-HU", + "R-FW" + ], + "counter_examples": [ + { + "id": "R-QL", + "why": "Emulates CPython's value-before-target evaluation order with a hoist instead of inheriting C#'s order." + }, + { + "id": "R-AI", + "why": "Emulates Python's UnboundLocalError with a compiler-emitted assigned flag instead of refusing." + }, + { + "id": "R-AV", + "why": "Emulates a mutable dataclass default through a nullable constructor parameter plus ??, a sentinel C# consumers see." + } + ], + "boundary": "Emulation is taken when the lowering is unobservable from Sharpy (R-AV) or when refusing would leave ordinary Python programs either refused en masse or printing a different value (R-QL, R-AI).", + "nearest_written_law": "RR", + "gap": "A1, T2 and RR imply refusal over a raw C# error, but none requires a named code with a C#-idiomatic steer, and RR's 'zero-cost bridge' does not say that a costly or depended-on emulation is the one-way door to avoid.", + "would_have_decided": 14, + "confidence": "high" + }, + { + "name": "no-invented-type-or-conversion", + "statement": "The compiler never invents a type or conversion: a common type is the slot's or an operand's own; anything beyond value-preserving widening is spelled by the user; disagreeing candidates are refused, asking for an annotation.", + "scope": "language", + "members": [ + "R-G", + "R-W", + "R-AB", + "R-AE", + "R-BH", + "R-BO", + "R-PJ", + "R-JP", + "R-FN", + "R-KW", + "R-F", + "R-U", + "R-IC", + "R-AJ" + ], + "checked": [ + "R-G", + "R-W", + "R-B", + "R-BH", + "R-PJ", + "R-JP", + "R-T", + "R-U", + "R-KW", + "R-FN" + ], + "counter_examples": [ + { + "id": "R-T", + "why": "Inside a narrowing a store of the payload type is implicitly re-wrapped into T?, though R-G says T? converts implicitly in no direction." + }, + { + "id": "R-EH", + "why": "A nullability-oblivious CLR reference is used directly as T with an inserted boundary check, an implicit conversion by design (platform types)." + }, + { + "id": "R-OP", + "why": "A loose T | None flows into a plain T with a compiler-inserted check and a warning rather than a required spelled conversion." + } + ], + "boundary": "Compile-time constants that fit the target, stores into a narrowed Optional, and nullability-oblivious foreign values convert implicitly; everything else is spelled.", + "nearest_written_law": "A3", + "gap": "A3 and AP ('no magic') say types are static and None is opted into, but not that inference may only pick a stated type or that narrowing conversions must be spelled.", + "would_have_decided": 11, + "confidence": "high" + }, + { + "name": "diagnostic-code-per-cure", + "statement": "A diagnostic code means one failure with one cure: reuse it, naming the kind in the message, for the same mistake; mint a new code when the cure differs; never filter a code by route.", + "scope": "diagnostics", + "members": [ + "R-BL", + "R-IK", + "R-GL", + "R-OV", + "R-OX", + "R-HI", + "R-JI", + "R-LI", + "R-AT", + "R-AZ", + "R-JO", + "R-ED", + "R-FN" + ], + "checked": [ + "R-BL", + "R-IK", + "R-GL", + "R-OV", + "R-AZ" + ], + "counter_examples": [], + "boundary": null, + "nearest_written_law": "CR10", + "gap": "CR10 requires an explanation for every code but does not say when to mint versus reuse a code, nor 'one mistake, one diagnostic'.", + "would_have_decided": 11, + "confidence": "high" + }, + { + "name": "silent-wrong-first", + "statement": "A group that removes a silently wrong value is queued ahead of groups fixing refusals, crashes or tooling; tooling and tests-only residues wait behind user-facing silent-wrong work, regressions excepted.", + "scope": "process", + "members": [ + "R-JU", + "R-KI", + "R-CN", + "R-GF", + "R-GO", + "R-GU", + "R-HC", + "R-HQ", + "R-IX", + "R-JF", + "R-HY", + "R-IJ", + "R-JA" + ], + "checked": [ + "R-JU", + "R-KI", + "R-HQ", + "R-GF" + ], + "counter_examples": [ + { + "id": "R-PM", + "why": "The owner moved user-facing language features ahead of deeper correctness work, saying recent plans were not user facing." + }, + { + "id": "R-GX", + "why": "A user-facing feature group was pulled forward ('we should not hold it off') over the preferred order." + }, + { + "id": "R-NB", + "why": "Three silent-wrong rows were left allowlisted to wait for their class fix." + } + ], + "boundary": "Order applies within a band; across arcs the owner weighs user-facing value, and a silent-wrong cell waits when its class fix is already scheduled.", + "nearest_written_law": "batch-issues SKILL step 3 (not a listed law)", + "gap": "The skill gives the band order but not the residue cap (R-GF) nor when user-facing features outrank it (R-PM).", + "would_have_decided": 10, + "confidence": "medium" + }, + { + "name": "group-by-class-and-seam", + "statement": "Cells join the open tracker and group whose contract owns their class; defects on one seam form one group with one generator, built by the group that consumes it.", + "scope": "process", + "members": [ + "R-GZ", + "R-HB", + "R-KL", + "R-JW", + "R-JB", + "R-GR", + "R-JY", + "R-LO", + "R-KV", + "R-MF", + "R-LR", + "R-JQ" + ], + "checked": [ + "R-KL", + "R-GZ", + "R-JW", + "R-JY" + ], + "counter_examples": [ + { + "id": "R-JY", + "why": "Forms a new residue group instead of distributing to trackers, unlike R-JW." + } + ], + "boundary": "A new group is formed when the cure reuses facts a just-landed group built (R-JY); otherwise cells go to existing trackers (R-JW).", + "nearest_written_law": "VC10", + "gap": "VC1, VC10, VC11 and CR13 nearly state it; missing is the new-group-versus-existing-tracker test.", + "would_have_decided": 10, + "confidence": "high" + }, + { + "name": "collision-is-error", + "statement": "When two declarations, imports or source files claim one name in one scope, refuse and name both; neither order, kind nor star-ness picks a silent winner, and no deterministic rename is applied.", + "scope": "language", + "members": [ + "R-IZ", + "R-JZ", + "R-DH", + "R-AX", + "R-HJ", + "R-LD", + "R-CY", + "R-II", + "R-JO", + "R-AW", + "R-JI" + ], + "checked": [ + "R-IZ", + "R-JZ", + "R-DH", + "R-AX", + "R-HJ", + "R-BA", + "R-CV" + ], + "counter_examples": [ + { + "id": "R-BA", + "why": "A user module shadows a same-named CLR namespace with a warning, not an error." + }, + { + "id": "R-CV", + "why": "A local module shadows stdlib, referenced libraries and CLR namespaces with a warning, as Python's sys.path order." + } + ], + "boundary": "When the other party is an open-ended external set (CLR namespaces, references), whose growth would newly refuse existing code, the local name wins with a default-on warning naming the escape.", + "nearest_written_law": "N2", + "gap": "N2 refuses a read whose meaning differs by reading order; it does not cover declaration, import or file collisions, nor the open-external-set exception.", + "would_have_decided": 9, + "confidence": "high" + }, + { + "name": "tooling-keeps-user-bytes", + "statement": "An editor, formatter or refactoring route keeps the user's written spelling and bytes unless it can prove the change legal and meaning-preserving; it re-spells only when forced, and otherwise is not offered.", + "scope": "diagnostics", + "members": [ + "R-DL", + "R-GD", + "R-GQ", + "R-GS", + "R-FK", + "R-FU", + "R-FQ", + "R-FR", + "R-FV", + "R-FP", + "R-ET" + ], + "checked": [ + "R-DL", + "R-GD", + "R-GQ", + "R-GS", + "R-ET", + "R-FK" + ], + "counter_examples": [ + { + "id": "R-ET", + "why": "The formatter collapses runs of blank lines to one rather than preserving the layout as written." + } + ], + "boundary": "A formatter run the user asked for may canonicalize within a stated bound (R-ET); repair routes acting on an unparseable document may not.", + "nearest_written_law": null, + "gap": "No written law covers tooling output; this is new.", + "would_have_decided": 8, + "confidence": "medium" + }, + { + "name": "promote-fidelity-where-exact", + "statement": "Promote a Python surface to COMPARED by whole type or message family, covering what .NET reproduces exactly or Core alone can cure; the remainder becomes one family deviation row.", + "scope": "library", + "members": [ + "R-CJ", + "R-NR", + "R-KS", + "R-NF", + "R-CK", + "R-IQ", + "R-IM", + "R-PL", + "R-FL", + "R-NS" + ], + "checked": [ + "R-CJ", + "R-NR", + "R-KS", + "R-NF", + "R-CK", + "R-FL", + "R-NS" + ], + "counter_examples": [ + { + "id": "R-BN", + "why": "The defaultdict factory keeps a fixed placeholder as a deviation, while R-CJ later compares every Stdlib repr with Python." + } + ], + "boundary": "Where an exact reproduction would rewrite genuine values (R-NS, R-FL's 128+N), the inexact part stays a deviation even inside a promoted family.", + "nearest_written_law": "FS", + "gap": "FS says promotion is by owner ruling naming a family, but gives no criterion; the rows apply 'exact on .NET or Core-only cure' every time.", + "would_have_decided": 7, + "confidence": "medium" + }, + { + "name": "measure-before-mechanism", + "statement": "Add a mechanism, optimisation, CI leg or runtime-target move only after a measurement shows the need; record an unmeasured hazard. Performance is reported for the owner to judge, not gated automatically.", + "scope": "process", + "members": [ + "R-AS", + "R-KR", + "R-KN", + "R-KA", + "R-NI", + "R-GH", + "R-HA", + "R-PU", + "R-LW", + "R-MY" + ], + "checked": [ + "R-AS", + "R-KN", + "R-NI", + "R-GH", + "R-PU" + ], + "counter_examples": [ + { + "id": "R-GM", + "why": "Adds a per-OS CI leg without a measured failure, because one platform is not a control for another." + } + ], + "boundary": "Correctness checks on every platform the product ships for are not optional.", + "nearest_written_law": "VC5", + "gap": "VC5 makes measurements carry a sha; no law says to measure before building a mechanism.", + "would_have_decided": 8, + "confidence": "medium" + }, + { + "name": "documented-surface-implemented", + "statement": "A documented feature that can be typed and lowered is implemented rather than documented away; the spec is rewritten only where the feature has no CLR carrier or admitting it would be the one-way door.", + "scope": "language", + "members": [ + "R-MT", + "R-DJ", + "R-ND", + "R-JS", + "R-MR", + "R-MV", + "R-AC", + "R-MW", + "R-AG" + ], + "checked": [ + "R-MT", + "R-DJ", + "R-ND", + "R-BR", + "R-OB", + "R-MW", + "R-AG" + ], + "counter_examples": [ + { + "id": "R-BR", + "why": "Deletes the spec section on named parameters in function types instead of implementing it." + }, + { + "id": "R-OB", + "why": "Replaces the spec's null-check truthiness rule with Python's, rewriting the spec to the ruling." + }, + { + "id": "R-MD", + "why": "Rejects the spec's per-class .NET exception bridge and rewrites the spec." + } + ], + "boundary": "The spec yields when it promises something with no CLR carrier (R-BR) or when a later principle (Python fidelity, R-OB) supersedes its text by ruling.", + "nearest_written_law": "CR7", + "gap": "CR7 says change the implementation, never the spec, with no exception; the owner amends the spec by ruling in several rows, so CR7 needs its exception path stated.", + "would_have_decided": 7, + "confidence": "medium" + }, + { + "name": "loose-none-fails-like-python", + "statement": "A possibly-None `T | None` operand in an operation Python accepts stays legal, warns, and fails as CPython does; a literal None where the type cannot hold None is a compile error.", + "scope": "language", + "members": [ + "R-OP", + "R-OC", + "R-NV", + "R-OS", + "R-OU", + "R-OB", + "R-Z", + "R-OV" + ], + "checked": [ + "R-OP", + "R-OC", + "R-NV", + "R-OB" + ], + "counter_examples": [ + { + "id": "R-OC", + "why": "Its first form refused ordering on T | None at compile time; the later principle allowed it with a warning, so the same case was decided both ways." + }, + { + "id": "R-DX", + "why": "Refused == None on a CLR reference with an `is None` steer; lifted later by R-ES." + } + ], + "boundary": "Applies to the loose `T | None` spelling only; Sharpy's strict `T?` is refused until narrowed. It overrides T2 for that spelling.", + "nearest_written_law": "T2", + "gap": "T2 prefers a compile error over a run-time error with no carve-out; the loose-None rule chooses the run-time TypeError plus a warning, and T2 does not say so.", + "would_have_decided": 6, + "confidence": "high" + }, + { + "name": "untypeable-api-is-deviation", + "statement": "A Python library surface that cannot be typed statically, or whose Python value occurs only in misuse, becomes one recorded deviation row with a steer, not dynamic invocation, generated factories or a widened nullable type.", + "scope": "library", + "members": [ + "R-FC", + "R-FE", + "R-NH", + "R-NN", + "R-DC", + "R-DY", + "R-IE", + "R-FW" + ], + "checked": [ + "R-FC", + "R-FE", + "R-NH", + "R-NN" + ], + "counter_examples": [ + { + "id": "R-ND", + "why": "open accepts every Python mode with a new Core type rather than a deviation for the binary/update subset." + }, + { + "id": "R-IR", + "why": "int byte/bit methods are added because a 'not provided' row is sound only with an alternative route." + } + ], + "boundary": "A typeable surface with no other route is implemented; only untypeable, misuse-only, or alternative-covered surfaces deviate.", + "nearest_written_law": "FS", + "gap": "FS says where a divergence is recorded, not which surfaces may diverge; AP forbids 'because Python has it' without the typeable/alternative test.", + "would_have_decided": 6, + "confidence": "medium" + }, + { + "name": "land-semantics-before-instruments", + "statement": "Do not build an instrument, generator or stopgap on semantics a ruled change will flip; land the semantic change first, and move an existing structure intact before redesigning it.", + "scope": "process", + "members": [ + "R-GV", + "R-LO", + "R-EC", + "R-HA", + "R-NP", + "R-FF", + "R-JN", + "R-MF" + ], + "checked": [ + "R-GV", + "R-EC", + "R-HA", + "R-JN" + ], + "counter_examples": [ + { + "id": "R-HQ", + "why": "An instrument blind spot is drained before the silent-wrong band it audits." + } + ], + "boundary": "An instrument that hides missing refusals goes first, since the band it audits depends on it.", + "nearest_written_law": "VC11", + "gap": "VC11 orders generators before hand matrices but not semantics before instruments.", + "would_have_decided": 6, + "confidence": "medium" + }, + { + "name": "coverage-over-ci-capacity", + "statement": "Coverage a contract requires is kept and CI capacity raised to carry it; every known failure is a counted, cited row, and a missing precondition reports Skipped, never a vacuous pass.", + "scope": "process", + "members": [ + "R-PC", + "R-QH", + "R-HZ", + "R-OZ", + "R-MC", + "R-ID", + "R-KK", + "R-JE" + ], + "checked": [ + "R-PC", + "R-HZ", + "R-OZ", + "R-MC" + ], + "counter_examples": [], + "boundary": null, + "nearest_written_law": "VC2", + "gap": "VC2 and the gap-discovery contracts cover cited allowlist rows; the rule that CI capacity grows rather than coverage shrinks is unwritten.", + "would_have_decided": 7, + "confidence": "high" + }, + { + "name": "clr-values-keep-clr-shape", + "statement": "A CLR value keeps its CLR identity and nullability-oblivious shape; Sharpy may add capabilities but never subtracts what the CLR shape shows, and converts it only explicitly or with a check at a declared boundary.", + "scope": "language", + "members": [ + "R-BH", + "R-BO", + "R-AN", + "R-EH", + "R-DW", + "R-BT", + "R-EG" + ], + "checked": [ + "R-BH", + "R-AN", + "R-EH", + "R-DW" + ], + "counter_examples": [ + { + "id": "R-AP", + "why": "PascalCase CLR member spellings on a Sharpy builtin receiver are refused, subtracting a CLR capability." + }, + { + "id": "R-BU", + "why": "str.upper(...) through the CLR-backed builtin type name is refused like a user class." + } + ], + "boundary": "Builtin types that are Sharpy types over a CLR backing follow Sharpy rules; the principle covers foreign values only.", + "nearest_written_law": "CV", + "gap": "CV ('wrap .NET, expose Python') governs Core/Stdlib APIs; it is silent on foreign CLR values flowing into Sharpy code.", + "would_have_decided": 5, + "confidence": "medium" + }, + { + "name": "repr-is-construction-spelling", + "statement": "A value's str/repr is its source construction spelling with payload reprs; where the runtime lacks the source information, print a fixed documented placeholder, never CLR text or compiler-injected names.", + "scope": "library", + "members": [ + "R-IM", + "R-CH", + "R-BN", + "R-DG", + "R-IF", + "R-CF", + "R-HO" + ], + "checked": [ + "R-IM", + "R-BN", + "R-CJ", + "R-DG" + ], + "counter_examples": [ + { + "id": "R-CJ", + "why": "Every Stdlib repr is COMPARED with Python, which a defaultdict placeholder (R-BN) does not meet." + } + ], + "boundary": "A placeholder is a deviation only until a cheap mechanism carries the information (R-DG); then the name is kept.", + "nearest_written_law": "FS", + "gap": "FS's str/repr row says 'COMPARED as ruled' and lists rulings, without the rule they share.", + "would_have_decided": 5, + "confidence": "medium" + }, + { + "name": "one-mechanical-name-rule", + "statement": "Name mangling is one mechanical rule for every name; exceptions are spelled with the backtick escape and collisions it creates are refused, never handled by tables, per-name renames or silent fallbacks.", + "scope": "language", + "members": [ + "R-CR", + "R-EB", + "R-AW", + "R-ED", + "R-CZ", + "R-DD", + "R-DP" + ], + "checked": [ + "R-CR", + "R-EB", + "R-AW", + "R-AD", + "R-DZ" + ], + "counter_examples": [ + { + "id": "R-AD", + "why": "The module-class merge special case (a class named like its file) is kept because it is a closed one-way door for C# consumers." + }, + { + "id": "R-DZ", + "why": "CLR enum members resolve by caps and by verbatim spelling." + } + ], + "boundary": "A special case already visible to C# consumers is not reopened (R-AD).", + "nearest_written_law": "AP", + "gap": "AP's 'no magic' and the name_mangling spec do not state the escape-over-table rule or collision refusal.", + "would_have_decided": 5, + "confidence": "medium" + }, + { + "name": "host-invariant-output", + "statement": "A program's verdict and output never depend on the machine: locale, filesystem case, or assemblies a process happened to load; an OS that cannot reproduce a behaviour gets its own deviation row.", + "scope": "library", + "members": [ + "R-CL", + "R-HH", + "R-CV", + "R-DB", + "R-FL", + "R-GM" + ], + "checked": [ + "R-CL", + "R-HH", + "R-CV", + "R-DB", + "R-GM", + "R-FL" + ], + "counter_examples": [ + { + "id": "R-DB", + "why": "strftime %Z uses the libc name on Unix and the .NET display name on Windows, a per-OS split." + } + ], + "boundary": "Where an OS lacks the data (Windows time-zone names), the difference is confined to that OS and recorded.", + "nearest_written_law": "T4", + "gap": "T4's 'host' means module, class or generic class, not operating system or machine; FS covers culture only.", + "would_have_decided": 5, + "confidence": "medium" + }, + { + "name": "sentinel-defaults-not-magic", + "statement": "A Python default or calling convention C# cannot express is modelled by overloads, a nullable parameter with a body coalesce, or a lambda steer; never an in-band magic value or dynamic invocation.", + "scope": "library", + "members": [ + "R-EV", + "R-R", + "R-AV", + "R-A", + "R-FC", + "R-FW" + ], + "checked": [ + "R-EV", + "R-R", + "R-AV", + "R-A", + "R-FC", + "R-FW" + ], + "counter_examples": [ + { + "id": "R-R", + "why": "User def defaults that C# cannot hold are refused with a steer, while R-EV gives library functions overloads; forward overloads are recorded as future for user code." + } + ], + "boundary": "Overloads are synthesized only at rung 1 in library source; user-written defaults are refused with a steer.", + "nearest_written_law": "AP", + "gap": "AP forbids magic but does not name the replacement mechanisms or where each applies.", + "would_have_decided": 5, + "confidence": "medium" + }, + { + "name": "identity-never-runs-user-code", + "statement": "`is` is identity only and never runs user code or a type test; `==` always runs the type's declared equality and is refused when none is declared; enum members count as identities.", + "scope": "language", + "members": [ + "R-EJ", + "R-ES", + "R-OX", + "R-QG", + "R-OM", + "R-PI" + ], + "checked": [ + "R-EJ", + "R-ES", + "R-OX", + "R-QG", + "R-OM", + "R-PI" + ], + "counter_examples": [ + { + "id": "R-PL", + "why": "Containers check identity before __eq__ for reference elements, so `in` and container == can skip the declared equality." + } + ], + "boundary": "Container search follows CPython's documented identity-first semantics (R-PL); value-type operands of `is` answer False with a warning.", + "nearest_written_law": null, + "gap": "No written law; the rule lives in rulings and the spec.", + "would_have_decided": 4, + "confidence": "medium" + }, + { + "name": "contained-fix-ships-now", + "statement": "A contained fix to a false refusal or crash on an ordinary program, with a closed matrix and no seam an in-flight group owns, ships now as a chore, not with its distant group.", + "scope": "process", + "members": [ + "R-JD", + "R-JM", + "R-JX", + "R-KB", + "R-QN", + "R-GG" + ], + "checked": [ + "R-JD", + "R-JM", + "R-QN", + "R-JN", + "R-EC", + "R-KL", + "R-NB" + ], + "counter_examples": [ + { + "id": "R-JN", + "why": "A rare crash waits for its scheduled group because the ruled lowering there would rewrite any stopgap." + }, + { + "id": "R-EC", + "why": "A refusal is not relaxed now because a scheduled change would re-tighten it." + }, + { + "id": "R-KL", + "why": "Cells join their class group rather than carving seams out of its contract to land sooner." + } + ], + "boundary": "Not when a scheduled ruled fix would rewrite the interim change, or when the fix carves a seam out of another group's contract.", + "nearest_written_law": "CR13", + "gap": "CLAUDE.md allows no-plan PRs for contained band bugs and CR13 limits chores to seam-free work, but neither says when to pull a fix forward.", + "would_have_decided": 6, + "confidence": "medium" + }, + { + "name": "pre-1.0-break-early", + "statement": "Before 1.0 there is no compatibility promise: breaking respellings land early, unconsumed public APIs that cannot be made correct are deleted, stale hand models are dropped, and ruled designs ship without a feature flag.", + "scope": "process", + "members": [ + "R-GW", + "R-KM", + "R-BJ", + "R-FX", + "R-JC", + "R-DG" + ], + "checked": [ + "R-GW", + "R-KM", + "R-DG", + "R-AD", + "R-EW" + ], + "counter_examples": [ + { + "id": "R-AD", + "why": "A naming design visible to C# consumers is treated as a closed one-way door and not reopened." + }, + { + "id": "R-EW", + "why": "A deviation is kept to avoid making the C# consumer surface ambiguous, treating it as a one-way change." + } + ], + "boundary": "Rows disagree on whether the C# consumer surface is protected before 1.0; R-GW and R-KM say no users exist, R-AD and R-EW protect it.", + "nearest_written_law": null, + "gap": "No written stability policy; the clash over the C# consumer surface needs a ruling.", + "would_have_decided": 4, + "confidence": "medium" + }, + { + "name": "process-extensions-are-one-off", + "statement": "An extension of a process limit (an extra verify pass, a raised ratchet pin) is granted once on the owner's quoted word and is never precedent.", + "scope": "process", + "members": [ + "R-QC", + "R-QF", + "R-OR", + "R-NY", + "R-OO" + ], + "checked": [ + "R-QC", + "R-QF", + "R-OR" + ], + "counter_examples": [ + { + "id": "R-OO", + "why": "A fifth verify pass is allowed on another plan; with R-NY, R-OR and R-QC, extensions recur, so the two-pass cap is routinely exceeded by request." + } + ], + "boundary": "None stated; recurrence suggests the cap itself needs a written extension clause.", + "nearest_written_law": "VC12", + "gap": "VC12's convergence rule and R-LW's two-pass cap have no extension clause, so every extension is asked.", + "would_have_decided": 0, + "confidence": "medium" + }, + { + "name": "clr-limit-saturates-not-refuses", + "statement": "A run-time argument Python accepts but a CLR limit cannot hold saturates, or raises CPython's nearest exception, recorded as one family deviation row; the call is not refused.", + "scope": "library", + "members": [ + "R-DA", + "R-FH", + "R-IR", + "R-IS" + ], + "checked": [ + "R-DA", + "R-FH", + "R-IR", + "R-IS" + ], + "counter_examples": [ + { + "id": "R-HU", + "why": "A numeric literal out of its type's range is refused at compile time, not saturated to inf as Python would give." + }, + { + "id": "R-IA", + "why": "A non-zero decimal literal that underflows to zero is refused rather than saturating to zero." + } + ], + "boundary": "Values in source text, known at compile time, are refused (T2); only run-time values saturate. R-FH calls refusing Python-accepted calls the one-way option, R-HU calls admitting Python's value the one-way option: the door reading flips with compile-time knowability.", + "nearest_written_law": "A1", + "gap": "A1 inherits numeric width and FS routes divergences to the ledger, but neither says to saturate rather than raise or refuse.", + "would_have_decided": 4, + "confidence": "medium" + }, + { + "name": "bug-dependent-program-not-correct", + "statement": "Under T3, a program whose current value comes from a defect, or whose verdict differs from its primitive twin's, is not a correct program; changing it needs a direction record, not a deviation row.", + "scope": "language", + "members": [ + "R-LP", + "R-OY", + "R-JZ", + "R-QA" + ], + "checked": [ + "R-LP", + "R-OY", + "R-JZ", + "R-QA" + ], + "counter_examples": [ + { + "id": "R-OW", + "why": "Int-backed enum ordering keeps .NET order as the status quo, a recorded deviation, rather than refusing as Python's Enum." + } + ], + "boundary": "Status-quo behaviour that is consistent and documented (R-OW) is kept as a deviation, not treated as a bug.", + "nearest_written_law": "T3", + "gap": "T3 does not define 'correct'; rows treat bug-dependent and twin-divergent programs as not correct.", + "would_have_decided": 3, + "confidence": "medium" + }, + { + "name": "tier-below-letters-at-charter", + "statement": "A group's tier may be set below its derived letter at charter time when full-tier dimensions have no subject (tests-only, mechanical respellings); once planning begins tiers only rise.", + "scope": "process", + "members": [ + "R-JR", + "R-KE", + "R-KQ", + "R-QP" + ], + "checked": [ + "R-JR", + "R-KE", + "R-QP" + ], + "counter_examples": [], + "boundary": null, + "nearest_written_law": "VC12", + "gap": "VC12 lists when a group is full and forbids lowering after implementation begins, but gives no criterion for overriding a derived full letter to light.", + "would_have_decided": 3, + "confidence": "high" + }, + { + "name": "static-check-only-definite", + "statement": "A static check refuses only a definite mismatch; where the operand kind, format spec or target symbol is not statically known, it stays silent and the run-time check answers.", + "scope": "language", + "members": [ + "R-U", + "R-CD", + "R-BW" + ], + "checked": [ + "R-U", + "R-CD", + "R-BW", + "R-AT" + ], + "counter_examples": [ + { + "id": "R-AT", + "why": "Deletes a lossy-CLR-mapping decline so every CLR overload refusal is explained; possibly the opposite of R-U's 'oblivious where the bridge cannot map' (not confirmed beyond the row text)." + } + ], + "boundary": "Holds where the missing fact is unknowable at compile time; T2 governs wherever the fact is known.", + "nearest_written_law": "T2", + "gap": "T2 prefers compile errors but does not say the checker must not guess when facts are missing.", + "would_have_decided": 3, + "confidence": "medium" + }, + { + "name": "users-first-release", + "statement": "A defect that breaks the documented install on a supported host is fixed at once as its own chore and released as a patch, and a known workaround is posted on the issue immediately.", + "scope": "process", + "members": [ + "R-GG", + "R-GI", + "R-GJ" + ], + "checked": [ + "R-GG", + "R-GI", + "R-GJ" + ], + "counter_examples": [], + "boundary": null, + "nearest_written_law": null, + "gap": "New.", + "would_have_decided": 3, + "confidence": "high" + }, + { + "name": "backed-enum-flavour", + "statement": "A backed enum behaves as the Python enum flavour of its backing (IntEnum, StrEnum) for every operator.", + "scope": "language", + "members": [ + "R-OW", + "R-QG" + ], + "checked": [ + "R-OW", + "R-QG", + "R-ON", + "R-PK" + ], + "counter_examples": [ + { + "id": "R-ON", + "why": "Cross-type == on int-backed enums answers False (plain Enum), not by value as IntEnum would." + }, + { + "id": "R-PK", + "why": "Ordering on a string-backed enum is refused (plain Enum), while R-QG compares string-backed == by value (StrEnum)." + } + ], + "boundary": "No consistent boundary: string-backed enums are StrEnum for == and Enum for ordering, int-backed the reverse. R-PK's reason ('no .NET order to keep') suggests 'keep .NET behaviour where it exists, else refuse', which R-ON does not fit.", + "nearest_written_law": null, + "gap": "No law picks an enum flavour; this is a clash for the owner to rule, not a principle ready to write.", + "would_have_decided": 0, + "confidence": "low" + }, + { + "ungrouped_count": 107, + "notes": "Ungrouped rows are mostly one-off scheduling placements (group order, lane order) and single-case cli/process choices with no reusable principle. Scope has no tooling value; editor/formatter principles are filed as 'diagnostics'. Main clashes: reversible-door vs csharp-limit-named-refusal/loose-none on whether to refuse or emulate when Python runs the program (R-AI, R-QL, R-OP); clr-limit-saturates (R-FH: refusing is the one-way door) vs reversible-door (R-HU, R-IA: admitting is the one-way door), split by compile-time knowability; silent-wrong-first vs R-PM/R-GX user-facing-first; pre-1.0-break-early vs R-AD/R-EW protecting the C# surface; backed-enum-flavour has no consistent principle (R-ON, R-OW, R-PK, R-QG); documented-surface-implemented vs CR7's no-exception wording; R-HH vs R-HT treat a spec-silent 'runs vs refused' surface as COMPARED and DEVIATION respectively. R-U vs R-AT is flagged from row text only and is unconfirmed. Members are 'confirmed or plausible'; only ids in 'checked' were read in all-rows.md." + } +] \ No newline at end of file diff --git a/docs/audits/ruling-audit-2026-11-21/records.tsv b/docs/audits/ruling-audit-2026-11-21/records.tsv new file mode 100644 index 000000000..11ef7f159 --- /dev/null +++ b/docs/audits/ruling-audit-2026-11-21/records.tsv @@ -0,0 +1,461 @@ +id superseded kind axis basis law law_cited python door option outcome confidence units rule principle tension note +R-A language initialization choice False deviates unstated admit medium dataclass,field-default,list A dataclass field whose default is a collection literal is initialized freshly per instance, never emitted as a C# default-parameter value; function-parameter collection defaults stay refused (SPY0400). A default that C# cannot hold as a constant is evaluated per instance where a constructor body exists, refused where only a parameter default exists. R-R: Function/lambda parameter non-constant defaults are refused (SPY0401) while dataclass field defaults are lowered; two treatments for similar defaults. Python rejects a mutable dataclass default (ValueError) unless default_factory; Sharpy admits it with default_factory semantics. Also schedules landing with #1685. +R-B R-W language typing-conversion choice False no-twin unstated admit medium ternary,common-type A conditional expression whose branches have incompatible types takes their nearest common ancestor type, falling back to object. The compiler may infer an unwritten common ancestor type for differing branches. R-W: Superseded: R-W forbids the compiler inventing an ancestor and refuses instead. +R-C language nullability-narrowing choice False deviates unstated admit medium isinstance,generics,narrowing isinstance checks against a constructed generic type such as list[int] are supported with full reified narrowing, not parked. Where the CLR keeps generic type arguments at run time, Sharpy exposes reified checks Python cannot do. Mostly a scheduling decision (unpark, ship in a batch); classified by the user-visible admission. Python raises TypeError for parameterized generics in isinstance. +R-D language patterns precedent False deviates unstated refuse medium match,sequence-pattern,generics A bare sequence pattern against an open (non-closed) scrutinee is refused with a steer to a typed class pattern like case list[int]([1, 2]); closed scrutinees still match. Type tests on erased generic shapes must name the full type argument; never match on an erased shape. A2: Python matches a bare sequence pattern against any sequence. Extends an unnumbered earlier 'erasure-retired' ruling, so law is empty; related to R-C's reified isinstance. +R-E language typing-conversion derivable T2,A1 False no-twin unstated refuse medium cast,as-optional,as-force A coercion that is statically impossible is refused at semantic time with a steer, uniformly for as? and as!, and never lowered to a constant None. T2 picks compile error over runtime/constant result; C# also rejects impossible 'as' conversions (CS0039). +R-F language nullability-narrowing choice False no-twin unstated n/a medium cast,as-optional,optional The safe cast as? yields the strict Optional[T]; strict T? versus loose T | None remains a type-level distinction, and as? T? stays refused (SPY0334). Safe operations that may produce absence return the strict Optional, not a loose nullable. Status quo kept; the reported disagreement was a display bug. +R-G language nullability-narrowing derivable CV,AP False deviates unstated refuse medium optional,none,some,maybe Optional construction is fully strict: no implicit T to T? conversion, bare None is not a T? value, Some(v)/None() are the only constructors, and maybe is the sole bridge from T | None. An Optional converts implicitly in no direction; every wrap and unwrap is spelled. R-T: R-T re-wraps a payload store into a narrowed T? implicitly, an implicit T-to-T? conversion in one position.; A2: Python spells absence with bare None everywhere; callers of T? = None() parameters must write Some(v). CV today states bare None is null and None() is the Optional variant; AP one-way/no-magic covers sole constructors. Law may postdate the ruling. +R-H language generics choice False no-twin unstated refuse medium interface,generics,inheritance A type whose supertype closure contains the same generic interface at two different instantiations is refused when a Sharpy declaration introduces the second, naming both paths; duplicates entirely inside a CLR type are exempt. Refuse a construct that would make Sharpy's own dispatch ambiguous, even if C# permits it; park the relaxation. A1: C# permits implementing one generic interface at two non-unifying instantiations; the refusal is stricter than .NET. +R-I language classes-members derivable A1,T4 False no-twin unstated admit medium union,delegate,type-alias,nested-type Union, delegate and type-alias declarations nested inside a class body are supported. C# allows nested types; one rule for every host. No rejected options listed. +R-J language patterns derivable A2 False matches unstated A admit high list-target,tuple-unpacking,assignment A list-shaped assignment target like [a, b] = xs is accepted by normalizing it to the tuple-target form in the parser; an augmented assignment to a list target stays refused. Python accepts both spellings and rejects the augmented form; no .NET conflict. +R-K implementation derivable CR2 True n/a unstated emission high The common type of a conditional's branches is recorded as a node-keyed semantic fact merged by MergeFrom; value positions cast one branch to it and truthiness tests distribute per branch; the emitter never casts on its own. R-W: R-W later replaces how the join type is computed (best-common-type instead of ancestor join). Row cites 'Rule 2'. +R-L partial:R-W language typing-conversion choice False no-twin unstated n/a medium protocol,interface,inheritance Synthesized protocol interfaces count as ancestors of a type, with their synthesis hoisted into declaration resolution; the join use is superseded and the hoist survives only for the duplicate-instantiation closure check. Compiler-synthesized interfaces are part of a type's supertype closure for conformance checks. R-W: Join half superseded by best-common-type.; R-H: The surviving hoist exists to feed R-H's closure check. +R-M language exceptions derivable A3,T2 False no-twin unstated refuse medium with,context-manager,reachability,return Code after a with whose manager may suppress exceptions is reachable, so a non-None function that can fall off there is refused (SPY0266) with a steer; -> None functions are clean. Also excludes a 4-parameter __exit__ refinement and co-lands three issues. +R-N language exceptions derivable A1 False deviates unstated refuse medium yield,with,context-manager,generator A yield inside a with whose manager can suppress exceptions is refused by name; a ? early-return there is accepted under R-M's reachability rule. A C# hard constraint (no yield inside try with catch) surfaces as a named Sharpy refusal. A2: Python permits yield inside any with block. Second half is precedent R-M. Basis inferred from C#'s CS1626; the row gives no reason. +R-O process choice False n/a unstated n/a medium Strict-Optional enforcement lands in the first batch of its group at the seam that batch builds, the group splits into two plans, and the guard is a Roslyn semantic-model scan of snapshots for implicit Optional conversions. Guard choice is a test-instrument element. +R-P language typing-conversion choice False no-twin unstated admit medium literal-string,str,f-string Literal-derived strings (PEP 675) are tracked as one node-keyed fact while the expression type stays str, consumed by the store seam in every position, with forms extended later. A refinement of a type is a recorded fact on the expression, not a new expression type. Python's LiteralString is checker-only; Sharpy follows PEP 675 forms. +R-Q process derivable VC8 False n/a unstated n/a medium A reopened issue is placed in a named batch with acceptance defined as its allowlist rows draining; re-citing the rows to a fresh issue number is rejected. Gap-discovery allowlist rows are deleted on fix, not re-pointed. +R-R language initialization choice False deviates unstated refuse medium parameter-default,lambda,optional,tuple One predicate decides which parameter defaults C# can emit as constants across all three hosts; Some(...) and tuple defaults are refused (SPY0401) steering to = None() plus x ??= Some(v); lambdas share def's emission. A parameter default C# cannot hold as a constant is refused with a steer, never lowered through a sentinel; forward overloads may come later. R-A: Dataclass collection defaults are lowered per instance while parameter defaults are refused. Rejected nullable sentinel (B); forward-overload synthesis (C) recorded as future. One predicate for three hosts follows T4. +R-S language interop-naming-emission derivable AP False no-twin unstated spelling high some,none,ok,err,union Bare Some, None(), Ok and Err are the only spellings of the Optional and Result constructors; qualified forms are refused by name and the names reserved, while user unions keep Union.Case(...). AP: one way to do the same thing. +R-T language nullability-narrowing choice False no-twin unstated admit medium optional,narrowing,assignment Inside a narrowing, a store to the narrowed T? name accepts the payload type and is re-wrapped, the narrowing survives, and a narrowed read into a slot of the declared T? type passes the Optional through. A narrowed Optional behaves as its payload for stores and reads, with wrapping inserted at the declared slot. R-G: Re-wrapping a payload store is an implicit T-to-T? conversion that R-G otherwise retires. Tuple-element arm deferred. +R-U language typing-conversion choice False no-twin unstated refuse low in-operator,clr-constructor,overload in/not in follow the promotion rule (a constant needle converts, a variable needle is refused by name), and CLR constructor calls are checked against bridged parameter types, refusing only on definite mismatch. The checker refuses only a definite mismatch; where the bridge cannot map a CLR type, it stays silent rather than guess. Bundles two routes under one call-route seam. +R-V language typing-conversion choice False matches unstated runtime-value medium walrus A walrus expression's type is what its target reads as immediately after the store, after seam conversion and rebinding narrowing. An assignment expression evaluates to what the target holds afterwards, not to the raw right-hand side. +R-W language typing-conversion derivable A1 False deviates two-way refuse medium ternary,list-literal,dict-literal,set-literal,tuple Several expressions' common type follows C#'s best-common-type: the slot directs it when one exists; otherwise one operand's type must accept all others; otherwise refuse with an annotate steer. Tuples iterate; count/index are refused. The compiler never invents a type: the common type is stated by the slot or is one of the operands' own types. R-B: Supersedes R-B's nearest-common-ancestor rule.; R-L: Supersedes R-L's join half.; A2: Python allows heterogeneous displays without annotation. Cites C# spec section, not an axiom ID. Bundles tuple-iteration decisions, which are choices. +R-X language operators derivable A1 False no-twin unstated B runtime-error low dict,null-coalescing-assign d[k] ??= v requires the key to exist and raises KeyError when it is missing (setdefault handles absence); ??= is statement-only; whether the store is skipped when present is left to the plan. C# Dictionary indexer getter throws on a missing key, so ??= on it raises; option A (hand-rolled lowering) recorded as future. +R-Y language scope-binding choice False deviates unstated c refuse medium method,class-member,assignment In a method, a bare store to a name declared in the enclosing class or struct body is refused by name with two steers; a bare read is unresolved (SPY0200) with a self. steer. A store Python would silently make a new local, when it likely meant a member, is refused with a steer. N6: N6 says a bare store assigns a binding of the same function, i.e. a fresh local as in Python.; A2: Python accepts the store as a new local. Replaces an ICE. Relaxation to Python's fresh local is parked (#1804). +R-Z language nullability-narrowing derivable SPEC:tagged_unions_optional.md True matches unstated n/a medium optional,union-none Dereferencing a loose T | None value without narrowing is accepted by design, per the spec's loose family; an opt-in warning for unnarrowed dereference is parked. Spec file inferred; row says 'per spec + #882'. Also files a sibling issue on index/slice. +R-AB language typing-conversion precedent R-W True deviates two-way i refuse high none,list-literal,ternary A bare None has no type in best-common-type, so a slot-less literal or conditional containing one is refused with the annotate steer; None alone stays SPY0227. Widening to T | None parked as additive future. +R-AC language classes-members derivable A1 False no-twin unstated admit high const,interface A const declared in an interface is legal and emitted as a C# const; the spec is expanded accordingly, never a refusal or property. Row reasons from C# 8 permitting it; spec expanded to match. +R-AD language interop-naming-emission choice False no-twin one-way emission medium module,class,module-class A class named like its file stays merged into the module class (other kinds refused); qualification bugs are fixed through universal global:: qualification instead. A closed one-way design visible to C# consumers is not reopened to fix an implementation bug; fix the helper. Keeps a prior design; door refers to the naming design. +R-AA language scope-binding precedent R-Y True deviates unstated refuse high method,class-member,property,inheritance In a method, a bare store to any name resolving to a member of the enclosing class or struct, own or inherited, field or property, is refused (SPY0606) with the same steers. N6: N6 makes a bare store a fresh local of the function.; A2: Python accepts these stores as locals. Also T4/T1: one membership rule, no silent local. +R-AE language typing-conversion precedent R-W False matches two-way b admit medium walrus,none,optional A walrus binding of None directly under a store slot takes the slot's type, as g(None) does; in any other position it is refused like x = None (SPY0227), and a void-call walrus is refused everywhere. Slot-directed typing extends R-W arm 1 and R-AB; strict slots still refuse through the seam. +R-AF language typing-conversion derivable A1 False no-twin unstated runtime-value high overload,keyword-argument,generics,constructor Overload resolution follows C#'s ordering: keyword arguments count for applicability and betterness, inference failure makes a candidate inapplicable, and constructor ambiguity is refused (SPY0353) rather than left to Roslyn. Cites C# spec section. Also schedules a new group. +R-AH language generics derivable A1,A3 False no-twin unstated refuse high list,set,dict,variance list, set and dict are invariant in their type arguments; read-only interfaces keep their declared out T, and a widened write slot is refused at the slot with a read-only steer. Row: same syntax and restriction as C#. +R-AI language initialization exception T2 False matches unstated C runtime-error medium with,definite-assignment,local A local assigned inside a suppression-capable with body and read after is checked at run time with an assigned flag, raising UnboundLocalError on an unset read. When a flow-sensitive refusal would reject valid Python programs, Sharpy matches Python's run-time error instead. T2: Picks a run-time error over the previously applied compile-time default. Row does not acknowledge T2; rationale is Python parity (python3 verified). +R-AJ language numeric precedent R-W True deviates unstated deviation-row high list-literal,int,float Numeric literal widening in a slot-less display (int widened to float) is a documented deviation from Python, with a permanent differential-test row. +R-AK language other derivable A2 False matches unstated admit high call,parentheses A parenthesized callee such as (f)(x) is treated exactly as the callee. Also drains allowlist rows. +R-AL language operators derivable SPEC:logical_operators.md True deviates one-way refuse high and,or,bool and/or keep returning bool as the spec states; the issue becomes a steer from the type error toward ??; do not re-propose. A2: Python's and/or return an operand value. Door refers to changing it later. +R-AM language typing-conversion choice False deviates unstated refuse medium tuple,variadic-tuple,callable tuple[T, ...] (and ... in type arguments such as Callable[..., T]) is refused by name in the parser with a list[T]/Sequence[T] steer; support is parked. An unsupported Python form is refused by name now, keeping later support additive. Row says refuse-to-support is additive but names no door type. +R-AN language typing-conversion choice False no-twin unstated admit medium protocol,clr-type The registry's protocol table can only add protocol memberships; absent a positive registry answer, membership falls through to the CLR checks. A registry overlay may add capabilities but never subtract what the CLR shape shows; one authority per answer. Could be read as implementation; classified language because protocol membership widens accepted programs. +R-AO library nullability-narrowing derivable RR,T3 False matches unstated runtime-value medium dict,none Sharpy's Dict supports None keys through an internal null-key slot beside the wrapped .NET Dictionary, with the user surface unchanged. Restricting an already admitted type is a one-way door; prefer run-time support. Thin-wrapper bridge reconciles .NET's null-key ban with Python; compile-time refusal rejected. +R-AP language interop-naming-emission derivable AP,CV False no-twin unstated refuse high builtin,clr-member,naming PascalCase CLR member spellings on a Sharpy builtin receiver are refused by name (SPY0203) with the Sharpy spelling as steer; the backtick escape remains. Rejected option was a dual API. +R-AQ language interop-naming-emission derivable T4 False no-twin unstated emission low clr-type,qualification Every non-Sharpy CLR type symbol, generic or not, is emitted through the single qualification authority; no per-namespace using list. Mostly implementation; user sees fixed name collisions. +R-AR language classes-members derivable AP False deviates unstated refuse medium property,decorator @property and its setter/getter/deleter decorators are a named parser refusal steering to property get p(self) -> T:, and an executing spec-block sweep is built now. A2: Python's @property is the idiomatic spelling. Bundles doc fixes and a test-instrument (spec-block sweep). +R-AS test-instrument choice False n/a unstated n/a medium The dotnet serialization lock publishes log, cwd and start time, waiters say to report rather than kill, and no heartbeat is added until a quiet holder is measured; guarded by a stub-holder test. Add a mechanism only after its need is measured. Agent tooling rather than a Sharpy harness. +R-AT diagnostic typing-conversion choice False n/a unstated n/a low overload,clr-method The lossy-CLR-mapping decline is deleted and SPY0354's CLR candidate-list arm retired, so every CLR overload refusal is explained. Every refusal explains itself; no silent decline path. Acceptance effect unclear from the row. +R-AU language operators derivable SPEC:logical_operators.md True deviates unstated refuse high tuple,truthiness,optional A fixed-arity tuple is not truth-testable and stays refused with the reason named in the message; tuple | None keeps its null test, and no always-true lowering is added. A2: Python tests tuples for truthiness. Row cites the spec's own rule and python3. +R-AV language initialization precedent R-A,R-R True deviates one-way admit medium dataclass,struct,mutable-default,constructor A mutable-collection default on a non-nullable dataclass or struct field lowers to a nullable constructor parameter assigned with ?? before PostInit; nullable fields and tuple/Some/call defaults keep their existing refusals. A default C# cannot express lowers to a nullable C# parameter plus a body null-coalesce, not to synthesized overloads. Python dataclasses reject list defaults outright. Door split: .NET signature one-way, Sharpy side two-way. Adds a sibling refusal (frozen + __post_init__ assignment, CS8852). +R-AG language iteration choice False matches unstated A admit medium generator-expression,comprehension,iterator Generator expressions are added: parenthesized anywhere, bare only as a sole call argument (else a named parse refusal), typed Iterator[T], lowered to a lazy LINQ chain; async clauses stay refused. A widely used Python expression form with a clean typed, zero-cost lowering is added rather than refused, and the spec is rewritten to match. CR7: The spec said the construct did not exist; the ruling rewrites the spec instead of conforming to it.; AP: Adding a construct largely because Python has it is the listed anti-pattern. Rejected option kept the spec with a named refusal. +R-AW language interop-naming-emission choice False deviates two-way refuse medium member-name,name-mangling,class A member whose PascalCase-mangled name equals its enclosing type's name is refused with a new named code, steering to rename or backtick-escape. A collision created by name mangling is refused by name with an escape steer, never silently renamed on the public C# surface. Row argues by door asymmetry (refuse->fallback non-breaking, reverse breaking) rather than by a law. Python allows such members. +R-AX language imports-modules choice False deviates unstated a refuse medium package,module,namespace In project mode a directory named the same as a module file in it is refused with a rename steer now; later, package directories emit as C# namespaces. Adding a file must never rename the emitted names of unrelated siblings; a layout collision is refused until a structural emission exists. Two phases ruled (a now, c next); option field holds the immediate phase. +R-AY language typing-conversion derivable T1 False no-twin unstated c runtime-value medium as-cast,enum,optional as? lowers per conversion-verdict kind with a runtime test: enum to backing always Some, backing to enum Some only if defined, explicit-conversion throw becomes None; a totality guard covers every kind. T1 rules out unconditional Some (silently wrong for undefined enum values); rejecting the refuse-total-kinds option is not decided by a law. +R-AZ diagnostic other choice False n/a unstated n/a medium error-type,diagnostic-cascade Every refusal site returns a dedicated error type that every check accepts without reporting, distinct from the permissive Unknown type, so one mistake does not cascade into further diagnostics. One mistake yields one diagnostic: refused expressions carry a poison type later checks accept silently, without suppressing distinct errors. Partly implementation. CR11 disposes of the per-pair-reordering option (cell fix); the first-error-per-span option was rejected on merit. +R-BA language imports-modules choice False matches unstated admit medium module,clr-namespace,import,backtick-escape A user module on the search path resolves before a same-named CLR namespace; the namespace stays reachable via backtick spelling, and a default-on warning at the definition names the shadow and the escape. Local user code shadows external names with a warning naming the escape; a refusal must not depend on an open-ended external set. Rejected refusal because adding a NuGet reference would newly break existing modules (close to T3, not cited). +R-BB diagnostic classes-members choice False no-twin unstated refuse high iter,dunder,generator A non-producer __iter__/__reversed__ declaration is refused by the dunder signature validator under its existing code; a body returning a non-producer under a producer annotation is SPY0260 at the return slot. A diagnostic is reported at the seam where the mismatch exists, worded against the user-visible type, one code per contract. +R-BC cli-lsp choice False n/a unstated n/a high stdlib-docs,type-name Stdlib documentation renders a module-defined type by its bare name on its own module's page and module-qualified on other pages. Documentation qualifies a name with its module only when referenced from outside that module. Docs rendering; no law applies. +R-BD test-instrument choice False n/a unstated n/a medium spec-blocks,allowlist The spec-block sweep drains in order: a per-file prelude first, then fragment markers for genuine partial residue, then one tracking issue per remaining first-error bucket; the gate glob widens now. Drain a residue first by the step that lets the most entries pass; mark entries permanently exempt only after that. +R-BE language strings-formatting derivable CV,AP True deviates two-way a refuse medium str-format,keyword-argument str.format keyword fields stay refused with SPY0234, now with a steer to use an f-string or format_map. The rejected option was a rung-4 name-keyed lowering (layer ladder, last resort) and magic; also follows SRP-0002. law_cited rests on the row naming 'rung-4', the CV ladder. +R-BF language typing-conversion choice False matches unstated a admit medium bound-method,method-group,delegate A bound method or CLR method group used as a value is a typed delegate and is not refused; a spec sentence with an executed example documents it. Refuse only where a type hazard exists; a fully typed common idiom is not refused by position. Ruled 'as designed'; no behaviour change. +R-BG process choice False n/a unstated a n/a high Spec-block residue gets a dedicated last work group plus a standing rule to drain entries whenever a change touches them. A residue gets a scheduled drain group plus drain-on-touch; a tracker alone never drains and blind mass-marking hides bugs. +R-BH language typing-conversion derivable AP,T1 False no-twin one-way d refuse medium clr-collection,list,dict,set,conversion CLR interface sequence and mapping types keep CLR identity; list(x), dict(x) or set(x) is the only conversion, and implicit slot materialization is replaced by a type mismatch with a steer. A CLR-typed value keeps its CLR identity; conversion to a Sharpy collection is always explicit, never implicit at a slot. AP 'no magic' (owner quote) rules out the implicit options; T1 rules out copy-everywhere (silently lost mutation); AP wrapper types rules out the view adapter. +R-BI partial:R-CN process choice False n/a unstated a n/a high The let-declaration work runs last after P20 in three sub-phases (stage 1, codemod and migration, stage 2), each its own plan and measured gate. R-CN: R-CN reverses this sequencing once its premise was gone. +R-BJ language scope-binding choice False no-twin two-way a admit medium let,feature-flag let lands as an unconditional keyword with no experimental feature flag, because the design is ruled and the large migration cannot run behind a gate. A ruled design lands ungated; feature flags are for designs still under evaluation. Departs from the default-off experimental-feature convention (CLAUDE.md, not in the law table); the row gives its reason. +R-BK language scope-binding derivable A2,T3 False matches unstated a runtime-value high walrus := keeps declare-if-new, rebind-if-existing semantics and remains the only expression-position introducer after let's stage 2. python3 runs the same program with the same meaning (A2 twin); current behaviour already correct (T3). +R-BL diagnostic scope-binding choice False no-twin unstated a refuse medium let,assignment,module-variable,const Assignment to an undeclared name gets one new code steering to let; module-scope non-const bindings reuse SPY0340 with the steer that module-scope bindings are const. A new code only where the cure differs; reuse an existing code when its steer fits. N1: N1 lists let, var and module variables as module-level declarations, while this row refuses non-const module-scope bindings. Code choice is diagnostic; the module-scope const restriction it states is a language fact ruled elsewhere. +R-BM language scope-binding precedent R-BL False no-twin two-way b spelling medium out-parameter,let out let x introduces a new binding and out x writes through to an existing one, mirroring C# out var x and out x. Every introduction site is spelled with let; no position declares-if-new except walrus. Precedent is the let binding law (assignment never declares) of the same design; mirrors C# where Python has no twin. +R-BN library repr-display choice False deviates two-way b deviation-row medium defaultdict,repr str/repr of defaultdict render the factory as a fixed placeholder, defaultdict(, {...}), documented as a deviation. When Python's output needs source information the runtime lacks, print a fixed documented placeholder, never CLR text or compiler-injected names. R-CJ: R-CJ makes str/repr of every Stdlib type COMPARED, while this row keeps a documented deviation for defaultdict. CV ladder rules out the name-keyed option; leaking the CLR delegate spelling was rejected on merit. FS lists this as ruled. +R-BO language typing-conversion precedent R-BH True no-twin two-way a″ refuse high clr-interface,overload-resolution,conversion Non-generic CLR interfaces keep CLR identity with no object fallback; unmapped types are refusal-only for pointers/by-ref, interface satisfaction is proven by reflection, and the checker picks Roslyn's overload. CR11 also rejects the per-formal cell fix. +R-BP language typing-conversion derivable A1,RR True deviates two-way a refuse medium tuple,annotation A bare tuple annotation is refused with a steer to () or tuple[()] for the empty tuple or tuple[T, ...]; any-arity tuples stay parked. Python's meaning (any arity) has no CLR representation, so A1 wins; giving it the empty meaning was rejected as surprising (A2 evidence). +R-BQ language generics derivable CR7 True deviates unstated a spelling high tuple,type-argument,shorthand A parenthesized (A, B) in expression-position type arguments is one tuple[A, B] argument, matching the annotation shorthand, not Python's flattening to two arguments. 'Rule 7' read as CR7 (the spec is authoritative). +R-BR language typing-conversion exception CR7 False no-twin two-way b refuse medium function-type,named-parameter,annotation Named parameters in function type annotations stay refused (SPY0104) and the spec section describing them is deleted. CR7: The ruling changes the spec to match the implementation, the reverse of CR7. Owner acknowledges deleting the spec; reason is A1 (no CLR delegate carries parameter names). +R-BS library repr-display derivable FS,A2 False matches unstated a runtime-value medium template,interpolation,repr repr of PEP 750 Interpolation and Template uses CPython 3.14's constructor spelling, reachable through user-facing repr(). FS row cites this very ruling (codified after the fact). +R-BT language typing-conversion precedent R-BH True no-twin unstated a admit high clr-collection,len,truthiness A BCL collection exposing Count has __len__ for len, bool and truth testing via one shared reflective predicate. Rejected refusal would turn running programs into refusals (T3). +R-BU language classes-members choice False deviates unstated b refuse medium str,unbound-method,static-member,backtick-escape Calling an instance method via a CLR-backed builtin type name (str.upper(...)) is refused with SPY0290, as for user classes; a same-named CLR static is steered to the backtick escape. Builtin types follow the same member-access rules as user classes; no Python behaviour is added for builtins alone. A2: Python runs str.upper('a') with the same meaning, so A2 offers a twin that the ruling declines without naming an A1 conflict. Python unbound-method semantics rejected as one-way and builtin-only. +R-BV language typing-conversion derivable A3 True deviates unstated a refuse high void-call,none Using a call that returns no value as a value is a new compile error in every value position and for every callee kind; statement position stays valid. Row: 'Type Safety over Python syntax'; Python would yield None. +R-BW language strings-formatting exception T2 False matches unstated b runtime-error low format,method-group,delegate,format-spec A bad spec passed through a format method-group delegate is a runtime ValueError only; no compile-time check follows the delegate. Static checks bind to symbols; a value invoked as a delegate gets only the runtime check until symbol facts flow through conversions. T2: A compile error was available (carry the origin symbol's facts) but deferred. Row does not acknowledge T2; it calls the class cure two-way and able to land later. +R-BX implementation choice False n/a unstated a n/a medium format-spec Core exposes one pure format-spec validator used by both the runtime formatter and the compiler's static check, retiring the duplicated mirror. One behaviour has one implementation; a compile-time check calls the runtime's pure function instead of mirroring it. Later cited as 'the R-BX shape' by R-CG. +R-BY language strings-formatting derivable A2,FS,T2 False matches unstated refuse medium format-spec,f-string,user-class A non-empty format spec on an operand type without __format__ (list, dict, set, tuple, plain user class) is a runtime TypeError, and SPY0609 when the spec is a literal, on every route. Programs that previously ran padded now refuse (verified by direction). +R-BZ process derivable CR13,VC11 False n/a one-way a n/a medium Emitting user types beside the module class is its own plan right after the package-namespace plan, which first settles the module-as-namespace layout. Folding in was rejected because the earlier plan's byte-identical acceptance would become uncheckable (layout changes land alone). Door is about module-function FQNs moving. +R-CA language interop-naming-emission derivable A1,RR False deviates two-way a refuse medium interface,private-member,backtick-escape An interface member named _m or __m is refused with a new code steering to drop the underscore; a backtick-escaped spelling emits verbatim as a public member. Interface members are public in .NET; emitting public silently would claim a protection the runtime lacks. +R-CB language strings-formatting derivable CV,RR False matches unstated a admit low format,dunder,iformattable A user def __format__ synthesizes an IFormattable implementation whose ToString(format, provider) calls __format__. Dunder-to-CLR-interface synthesis is the zero-cost bridge; rejected option was a name-keyed suppression (CV rung 4). +R-CC library strings-formatting derivable A2,FS False matches unstated a runtime-value high format,f-string,iformattable Formatting with an empty spec follows Python: IFormattable values use ToString("", invariant), everything else uses str; a plain f-string hole calls Format only for Formattable/Unknown kinds. Output moves only for types that opted into IFormattable. +R-CD language strings-formatting choice False matches unstated a runtime-error medium format-spec,str-format The static format-spec walk stops at a nested-spec field and at a non-empty spec on an Unknown-kind operand, leaving those to the runtime ValueError. Static checking stops where operand kind or spec is not statically known; the runtime check answers there. T2: A compile error is given up for a runtime error where a partial static decision was possible. +R-CE language strings-formatting derivable T2 False deviates unstated a refuse medium str-format,format-field A literal format template with an out-of-range index or unmatched keyword field is a new compile error, and the runtime keyword error text becomes Python's KeyError: 'name'. T2 rules out runtime-only; new code vs reusing SPY0609 is a choice (one contract, one explanation). +R-CF library repr-display derivable A2,FS False matches one-way a runtime-value medium type-name,enum,repr,str One Python-name authority spells runtime type names: Python names for Core/Stdlib/CLR kinds, source names for user types; enum str prints Color.RED and repr . Runtime-visible names use one Python-spelling authority; a user type prints its source name, never its CLR name. FS rows cite this ruling (codified after it). +R-CG implementation precedent R-BX True n/a unstated a n/a high name-mangling The member-name mangling rule moves into Core and the compiler delegates to it; runtime attribute lookup tries the mangled name then verbatim. +R-CH library repr-display derivable A1,T3 False no-twin unstated a runtime-value medium optional,repr,str str of an Optional is transparent (1 or None), while repr uses the constructor spelling Some(1) or None() on both variants. No Python twin; Nullable.ToString precedent (A1); str output on four routes is kept (T3). repr(None()) changes. +R-CI library exceptions derivable FS False deviates two-way a deviation-row medium exception-message Exception message text beyond the type name is a deviation by default, recorded as a ledger row; a message quoted in the spec stays compared. R-CE: R-CE makes runtime KeyError text match Python although message text is deviation by default. FS row codifies this very ruling; judged against today's text per brief. +R-CJ library repr-display derivable FS False matches one-way b runtime-value medium repr,str,stdlib str/repr of every Stdlib type is compared with Python, one tracker per type family, each type implementing IRepr with a constructor-spelled repr. A fidelity channel is promoted whole for a type family, never per type. R-BN: R-BN keeps defaultdict's repr as a documented deviation. FS row codifies this ruling. +R-CK library other derivable A1,FS True deviates unstated b deviation-row medium sorted,sort-key,min,max Which operand a sort refusal names stays a deviation (inherited .NET algorithm), but key= is called exactly once per element, as in Python. Algorithm-internal order inherited from .NET may differ; a side-effect count a user can observe must match Python. Split ruling: one half deviation, one half compared. +R-CL library strings-formatting derivable FS,A2 False matches one-way b runtime-value medium culture,format,datetime Every Core and Stdlib text path uses the invariant culture, matching CPython's C locale; current-culture output is a bug. Program output never depends on the host's locale or culture. FS row codifies this ruling. +R-CM process derivable FS False n/a unstated a n/a medium A surface not listed in the Python-fidelity table is a deviation until an owner ruling promotes it; the next long-tail cell is a ledger row, not an issue. Python-fidelity obligations open only by explicit ruling, never by an auditor's python3 diff. FS's default clause is this ruling's text. +R-CN process choice False n/a unstated a n/a high The remaining let-declaration sub-phases run next, before P15, with silent-wrong binding fixes ahead of the codemod; this replaces R-BI's sequencing only. When a ruling's stated premise is gone, its sequencing is revisited; silent-wrong fixes precede work built on the same facts. R-BI: Supersedes R-BI's order (P21 after P20). Cites R-BI explicitly as the ruling it revises. +R-CO language strings-formatting choice False matches unstated a admit medium string-literal,f-string,t-string,raw-string,lexer All Python string-literal prefixes (rf, fr, rb, br, tr, rt) are accepted in any order and case; doubled braces, backslash escapes and line continuations in format specs work; one lexer table drives the editor grammar. A Python lexical surface is taken whole from one table rather than admitted piecemeal with per-case refusals. A2 favours it but does not decide; rejected options were rejected on complexity grounds. Row says 'Additive'. +R-CP language repr-display derivable FS False matches unstated a runtime-value high repr,str,dunder,class A user __repr__ implements the repr channel separately from __str__ (which stays ToString); a class defining only __str__ reprs as , as in Python. FS lists repr of user classes as COMPARED; row cites precedent R-CF. +R-CQ library repr-display precedent R-CF False no-twin unstated a admit medium enum,clr-interop,name-value .name and .value work on CLR interop enums as on Sharpy enums: .name gives the member name, .value the underlying integer. Cites the '#2007 all System.Enum' ruling; #2007 is in R-CF's class. Row says 'Additive'. +R-CR language interop-naming-emission choice False no-twin one-way c′ emission medium entry-point,function,name-mangling,module Every function, including main, emits its ordinary mangled name (main becomes Main) in every module kind; the executable entry point is chosen by a compilation option instead of a MainFunc rename. A name follows one mangling rule everywhere; special cases are moved to compiler options, never to per-name renames. T4: Supports it by analogy (one rule over a special case), though T4 names hosts, not names. Option is an owner-coined c-prime. Reason given: two spelling rules for one name. +R-CS language scope-binding choice False deviates two-way a refuse medium local-class,local-import,function Class, struct, enum, union and interface declarations and imports inside a function are refused with one new validation code steering to module or class level. A Python construct the CLR lacks, whose emulation would change other semantics for no type-system payoff, is refused with a steer rather than emulated. Today it silently compiles unbound (T1 argues for some fix, not for refuse over support). A1 noted (C# has no local types) but hoisting was possible. +R-CT language imports-modules derivable A2 False matches unstated a refuse medium stdlib,module,import,clr-interop A Stdlib module's type is reachable only through its module; a bare type name not imported is SPY0202 with an import steer, except an explicit spec-cited Core interop roster. Python raises NameError on the same program (twin exists). Row says 'Relaxable'. +R-CU language typing-conversion derivable T2,CR4 True matches unstated a refuse high hash,list,dict,set,tuple Mutable containers and tuples or records containing them are unhashable: a compile-time refusal at hash(), dict-key and set-element positions plus a runtime TypeError twin. Row cites 'spec promises a refusal' and 'Type Safety over Python syntax' (axiom precedence). +R-CV language imports-modules derivable A2 False matches two-way a runtime-value medium module,import,stdlib,clr-namespace,shadowing A local module binds before stdlib, referenced libraries and CLR namespaces, as Python's sys.path order; only referenced assemblies count; a default-on warning names the shadow. What a process happened to load at run time never decides a binding; only declared references do. Rejected refusal would refuse Python-legal layouts; A2 twin decides. The loaded-assembly principle is new. +R-CW language imports-modules choice False deviates unstated a refuse medium module-variable,private-name,import Underscore-prefixed module variables are module-private like underscore module functions: importing or qualifying them from another module is SPY0283, decided by one access authority. A naming convention carries the same meaning for every kind of declaration it applies to. A2: Python lets `from lib import _w` run; Sharpy refuses a program with a twin. Row says 'Refusal, relaxable'. Builds on the existing private-function rule (not cited by R-id). +R-CX language imports-modules choice False matches unstated a admit medium from-import,package,submodule,namespace-package `from pkg import sub` binds a child submodule when __init__ does not export the name; a directory without __init__.spy stays refused with a steer to add one. A Python import form is admitted where it has a definite anchor file; layouts making every directory importable are refused with a steer. Python matches for submodule binding, deviates for namespace packages. Row: (a) to (b) later is additive. +R-CY language scope-binding derivable T1 False deviates unstated a refuse medium module-variable,const,redeclaration Redeclaring an annotated module-level name is refused with SPY0204, as a repeated const already is, instead of silently keeping the first value. Today prints the first value silently; Python rebinds (rejected because module scope is const-only after P21c). +R-CZ language interop-naming-emission precedent plan-0ca7b7 ruling 3 True no-twin unstated a admit high backtick-identifier,member,name-mangling A member's declaration fixes its emitted name and every reference uses it, for class members as for enum members; a member declared with backticks is reachable by its plain spelling. Precedent is a plan ruling, not an R-id. Re-pins the #478 test. +R-DA library numeric choice False matches unstated a admit medium lru-cache,functools,decorator lru_cache honours maxsize (None means unbounded, values above the CLR int range saturate with a deviation row), and `from functools import lru_cache` binds the builtin decorator. A Python stdlib import path naming an existing builtin binds to it; out-of-CLR-range arguments saturate with a recorded deviation rather than refuse. Row says 'Additive'. +R-DB library io-os derivable FS False matches unstated a runtime-value medium datetime,strftime,timezone strftime %Z uses the C library time-zone name on Unix; on Windows it uses the .NET display name with a deviation row. T4: Gives a per-OS split, though T4 speaks of program hosts, not operating systems. FS lists strftime/platform text as COMPARED; row cites R-CL. Windows half deviates. +R-DC library numeric derivable FS False deviates unstated a deviation-row high int,float,complex,real-imag .real and .imag on int and float are not added; their absence is a recorded deviation row, while complex keeps both. FS: unlisted surface is DEVIATION until promoted (R-CM, cited). Row says 'Relaxable'. +R-DD library interop-naming-emission choice False n/a one-way c emission medium stdlib,namespace,package,module All Stdlib modules, spy-sourced and hand-written, move under a stdlib package with __init__.spy, namespaced Sharpy.Stdlib., with one prefix-strip rule replacing the python-name map. The standard library is laid out as ordinary modules under one rule, with no magic stems or name maps. Mostly a layout/implementation change, but renames the public Stdlib C# surface once. AP (no magic, one way) aligns but does not strictly decide among options. +R-DE library interop-naming-emission precedent R-CF True no-twin unstated b runtime-value high json,yaml,toml,serialization,member Members whose mangled name differs carry a [SharpyName] attribute, read by one naming policy shared by json, yaml and toml, so field names round-trip losslessly. Record a source name rather than infer it with a lossy inverse transform. +R-DF language repr-display precedent R-DG True matches unstated b admit high dunder-name,class,function __name__ on both class and function references compiles: classes via the Python type-name helper, functions via the [SharpyName] attribute on the method; nothing is refused. Row text is the version revised by R-DG; uses layer-ladder rung 3 (CV). +R-DG language repr-display choice False matches unstated b runtime-value medium function,lambda,repr,name-mangling Methods whose emitted name differs from the source get a [SharpyName] attribute, so function objects print , lambdas >; nameless closures get one deviation row. Snapshot churn is no reason to reject a warranted change; keep information once a cheap mechanism exists. Promotes an unlisted FS surface by ruling; addresses omitted as NOT COMPARED. +R-DH language imports-modules choice False no-twin two-way a refuse medium module,module-identity,source-root Two source files mapping to the same dotted module name (derived from the source root by one authority) are refused with a new validation code naming both files. Module identity comes from one authority; a collision is refused naming both parties, never silently renamed. Rejected rename partly because it is one-way; preference for two-way doors. +R-DI library interop-naming-emission derivable AP,CV False n/a one-way a emission high list,dict,set,clr-collection,public-api Public Core and Stdlib signatures may not use raw .NET container types (KeyValuePair becomes tuple); a commented list exempts IEnumerable and a few interfaces until a Sharpy Iterable spelling exists. AP: The IEnumerable exemption keeps a raw .NET interface in public APIs for now. Phasing is the owner's choice; the rule itself is the written anti-pattern. One-way per signature for C# consumers. +R-DJ library classes-members choice False matches unstated a admit medium lru-cache,functools,decorator,function cache_info() and cache_clear() are members of any function memoized by the cache decorator, recognised from one materialized fact; CacheInfo's str is compared with Python. A documented surface is implemented rather than withdrawn; prefer the option from which the alternative stays additive. str comparison follows R-CJ. +R-DK cli-lsp choice False n/a two-way a n/a high lsp,formatter LSP range formatting returns only the minimal line-diff hunks of the whole-document format that intersect the range, re-checked on the applied text at one formatter seam. +R-DL cli-lsp choice False n/a unstated a n/a high formatter,parser,underscore,tuple,decorator The parser records how the placeholder, empty tuple and empty parentheses were written, and the unparser writes that spelling back unchanged. Tools preserve the user's written spelling; canonicalization is an opt-in mode, never the default. +R-DM process choice False n/a two-way a n/a high Work group P41 runs first after the chores. +R-DN implementation choice False n/a two-way a n/a high reflection,clr-interop,assembly CLR reflection skips unloadable types and unresolvable assemblies with a warning naming them and follows type forwards; metadata-only loading is deferred. Warning is user-visible, but row calls both options internal. +R-DO language interop-naming-emission derivable A1,CR5 False no-twin unstated a emission medium emitter,netstandard,csharp-version C# the emitter synthesizes stays within the netstandard2.1 surface, guarded by compiling the emitted corpus against netstandard2.1 references; no target-framework switch. A1 states generated code targets C# 9.0 for netstandard2.1 compatibility. +R-DP language interop-naming-emission choice False no-twin one-way a emission medium namespace,module,compilation-route Without -n, every module's C# namespace is SharpyApp., on every compilation route. One emitted-namespace rule for every compilation route. +R-DQ language imports-modules choice False deviates unstated a admit medium import-cycle,annotation,module An import cycle compiles only when every symbol imported on every edge is used only in annotations, regardless of entry or file names; otherwise the diagnostic names the offending import use. A cycle is admitted only when no edge needs a value at load time, judged independently of file names. CR7: Rewrites the spec's normative 'every cycle is SPY0302' instead of fixing the implementation to it. Compatible with N3 (initialization cycles refused) but N3 does not choose among the options. +R-DR language exceptions choice False no-twin unstated a admit high raise,match-expression `raise` is accepted as the body of a match-expression arm only, lowering to a C# throw expression; it is not a general expression. Admit the narrowest form of a construct whose general form would be hard to take back. Row says 'Additive'. +R-DS language imports-modules derivable A2 False matches unstated a admit medium from-import,parentheses Parenthesized `from m import (a, b)` is accepted, and the formatter keeps the written form. Only alternative was parking it. +R-DT language patterns choice False no-twin unstated a refuse high match-expression,brackets,lexer A match expression written directly inside brackets stays refused, with a steer to bind it to a local first. A lexer invariant (no significant newlines inside brackets) outranks a syntactic convenience. Row says 'Relaxable later'. +R-DU implementation choice False n/a unstated a emission medium range,for-loop A for loop over range lowers to a C# for loop and nothing more; direct array indexing is not added. An emission optimisation must not change any value without a proof rule. T3: Aligns: rejected option would change negative-index behaviour. T3 rules out (b) but not parking. +R-DV language interop-naming-emission derivable AP False no-twin unstated a refuse medium clr-namespace,qualified-name,import A dotted CLR type name not bound by an import is refused with the import steer; fully qualified names from referenced assemblies are not a second spelling. AP 'multiple ways to do the same thing'. Consistent with R-CT. Row says 'Relaxable to (b)'. +R-DW partial:R-EH language nullability-narrowing exception A3 False no-twin unstated a admit medium clr-interop,oblivious-nullability,none Members and parameters of nullable-oblivious CLR types accept None when written to and read as non-null T. R-EH: R-EH supersedes the read half with unknown nullability and a boundary null check.; A3: Reading a possibly-null CLR value as plain T admits null into a non-null slot unchecked. Row acknowledges (b) as the sound option. Read half superseded by R-EH. +R-DX language nullability-narrowing derivable AP False deviates unstated a+c refuse medium none,equality,clr-interop,truthiness Comparing a CLR reference with == None or != None is refused with an `is None` steer; a CLR implicit conversion to bool joins the single truthiness predicate. R-EH: R-EH says `T | None == None` on a CLR reference stays admitted; boundary of the refusal needs checking. Part 1 rests on 'two spellings' (AP); part 2 is a choice. Part 1 relaxable, part 2 additive. +R-DY language typing-conversion choice False deviates unstated a admit medium type,typeof,clr-interop `type(X)` where X names a type means the CLR typeof(X) in every expression position; Python's `type(int) is type` differs and is recorded as a deviation row. Reuse an existing Python spelling for the CLR concept rather than add a builtin; record the mismatch as a deviation. Rejecting (c) follows AP; choosing (a) over (b) does not. +R-DZ language interop-naming-emission derivable SPEC:name_mangling.md,T3 True no-twin unstated b admit medium enum,clr-interop,name-mangling,constant CLR enum members and constants resolve by their screaming-caps spelling, the verbatim CLR name keeps working, and an unknown member is SPY0203 with a did-you-mean. AP: Two accepted spellings for one member is 'multiple ways to do the same thing'. Rejected (a) ignores the spec convention; (c) breaks running programs. +R-EA language scope-binding choice False deviates unstated a spelling medium underscore,discard,assignment,backtick-identifier A bare `_` as an assignment target is a discard; only the backticked `_` is an ordinary identifier. A Python idiom's dominant meaning wins over its literal semantics when keeping both needs a second spelling. A2: Python binds `_` as a normal variable readable afterwards. Reverses plan-be89c1 D1 (a) for the bare spelling. +R-EB language interop-naming-emission choice False no-twin unstated a n/a medium name-mangling,reflection,backtick-identifier Names dispatched by reflection must use the backtick spelling; this is by design, recorded in one spec sentence, with no acronym table or near-miss warning. The name mangler stays one mechanical rule; exceptions are written with the backtick escape, not encoded in tables. +R-EC process choice False n/a unstated a n/a high An issue about SPY0606 is folded into an existing tracker rather than relaxing SPY0606 to a warning now. Do not relax a refusal that an already-scheduled change would re-tighten. +R-ED diagnostic other choice False deviates unstated a refuse medium keyword,type,backtick-identifier `type` stays a hard keyword; using it as a name gives a diagnostic naming the keyword and the backtick escape. A keyword collision is answered by naming the backtick escape in the diagnostic, not by softening the keyword. Soft keyword rejected 'for now'. +R-EE language interop-naming-emission choice False no-twin unstated b emission medium assert,membership,test-host In emitted test files, `assert x in c` lowers to Assert.True over the ordinary membership lowering for every container, and the files disable the related xUnit analyzer warnings. An operator has one lowering everywhere; host-specific analyzer noise is silenced in the emitted file, not in project config. Could be read as implementation; users' test projects observe it. +R-EF process choice False n/a unstated a n/a medium The CI matrix is written on a branch and verified by a PR run whose counts are compared with the sequential control before merging. A change to the gate instrument is proven against the existing control before it replaces it. VC6 concerns the gate but does not decide this. +R-EG language classes-members derivable A1,CV False no-twin one-way a admit medium system-object,class,clr-interop System.Object members bind on Sharpy class instances, landing with the inherited-member-name group; until then the refusal stands. A1: Sharpy classes are CLR objects; CV layer ladder rejects the name-keyed option. Scheduling half is process. +R-EH language nullability-narrowing choice False no-twin unstated runtime-error medium clr-interop,oblivious-nullability,none,maybe Unannotated CLR references have unknown nullability: usable as T, testable with `is None`, maybe-wrappable, null-checked when stored into a non-null slot; a None test on declared non-null T is refused. Nullability-oblivious foreign values are platform types: usable directly, checked at the boundary into a declared non-null slot. R-DW: Supersedes its read half.; T2: The boundary check is a run-time error where a strict T | None reading would give a compile error. Option labelled c+ (owner-coined). Unplaced; lands alone. +R-EI library other choice False matches unstated a runtime-value medium unittest,assert-marker,in-operator The unittest assert_in and assert_not_in marker calls are type-checked like the expression `x in c` and lowered to an assertion on that ordinary lowering, rather than being retired or kept on a contains-assertion. A member of a library family is not retired piecemeal; the whole family keeps one consistent treatment. Argument is family consistency; no written law names it. Python twin is assertIn, which also uses `in`. +R-EJ language nullability-narrowing derivable A2,T4,T1 False matches one-way d+b runtime-value medium is-none,operator-eq,clr-type,reference-type `is None` and `is not None` are a pure reference null check on every reference type and never run user code; the `==` operator synthesized from `__eq__` is null-safe. `is` never runs user code; `==` always runs the type's equality. Operator meaning never depends on where the operator was declared. R-DX: Rewords R-DX part 1's steer and supersedes the dotnet_interop.md sentence that `is None` honours an overloaded `==`.; A1: Changes behaviour of CLR types with overloaded `==` (Unity destroyed objects now compare non-None). Owner framed it as least cognitive load; Python's `is` identity twin and one-rule (T4) decide it, rejected (c) leaves a NullReferenceException (T1/T2). +R-EK cli-lsp choice False n/a one-way a admit medium spyproj,assembly-reference A `.spyproj` Reference item honours HintPath as the assembly path with Include as the name; without HintPath, Include is the path; an unresolved reference is a diagnostic. Project files honour the established MSBuild metadata conventions instead of inventing or ignoring them. Arguably A1 (follow .NET conventions), but A1 is about runtime semantics, so classed choice. +R-EL process choice False n/a two-way c n/a high Making module search paths reach import resolution is filed as a standalone chore now rather than cured inside the namespaces group or kept in its current group. Ordering only. +R-EM process choice False n/a unstated a n/a high LSP code-action shape preservation becomes its own work group scheduled directly after the preceding LSP group, not folded into it. +R-EN process choice False n/a unstated a n/a high A new work group runs directly after a named predecessor group and absorbs one of that group's issues as its first phase. Ordering only. +R-EO process derivable VC1,VC11 False n/a unstated a n/a high One work group covers the whole unittest assert marker family, generated against the plain-assert twin, instead of fixing only assert_in and assert_not_in. R-EI: Widens R-EI's two-marker fix to the whole family. Class before cell and generator-first decide (b). +R-EP process choice False n/a unstated n/a high Accepts the proposed ordering of four work groups and puts the `is None` chore first among chores. +R-EQ language imports-modules choice False no-twin two-way a refuse medium import,spyproj,module In project mode, an import that resolves to a `.spy` file outside the project's declared source set is refused with a diagnostic, rather than silently compiling the import closure. When a design question is open, refuse now: a refusal can be relaxed later, an acceptance cannot be withdrawn. The reversible-refusal preference recurs (R-FA, R-FH) but is not a written law. +R-ER language patterns derivable T3,T4 False no-twin unstated a admit medium match,guard,truthiness A per-alternative guard in a match arm tests truthiness, the same as the whole-arm guard, instead of requiring bool in either or both positions. R-EU: R-EU makes the two guard positions differ for narrowing, after this ruling made them alike for truthiness. (b) breaks running arm guards (T3); (c) keeps two rules (T4). Owner asked what C# does (bool-only `when`) and departed from it. +R-ES language operators precedent R-EJ True no-twin unstated a admit high operator-eq,none,clr-type,reference-type `== None` and `!= None` compile on every .NET reference type and run that type's own `==` operator; the earlier refusal is lifted for CLR types. R-DX: Lifts R-DX part 1's refusal for CLR types. Row says 'follows from R-EJ'. +R-ET cli-lsp choice False n/a one-way b n/a high formatter,blank-line The formatter keeps up to one user-written blank line between statements, rather than fully canonical layout or layout preserved exactly as written. Tools keep a bounded amount of user layout intent rather than either erasing it or preserving it verbatim. +R-EU language nullability-narrowing derivable A1,T4 False no-twin one-way a admit medium match,guard,narrowing A guard that gates a whole match arm narrows types in the arm body; a per-alternative guard never narrows, even as the sole alternative. Narrowing follows exactly what gates the whole region, as C# flow analysis does; no special cases. R-ER: R-ER aligned the two guard positions on truthiness; this ruling splits them on narrowing. Row argues one rule and C#'s flow analysis; (b) rejected for forcing an if-twin, not by a law. +R-EV library other derivable FS,AP,CV True matches unstated b runtime-value high default-parameter,overload,socket,stdlib Where a CPython stdlib function uses a sentinel default, the Sharpy source offers an overload without that parameter (applying the real default) and one with it, explicit None meaning the Python value. A Python sentinel default is modelled by overloads, never by a magic in-band default value. Rejected (a) a deviation on a COMPARED surface (FS); (c) magic default (AP); rung 1 is the layer ladder (CV). +R-EW library operators choice False deviates two-way a deviation-row medium frozenset,operator-eq,none,deviation The frozenset `== null` deviation is kept with its stated reason corrected: user programs lower `== None` to a null test; only Core's C# and C# consumers bear the residual cost. Do not promote a deviation when doing so makes the C# consumer surface ambiguous; keep the reversible option. Door inferred from '(a)->(b) is additive later' stated in the row. +R-EX process derivable VC11 False n/a unstated a n/a high Concurrency defects become their own work group whose first step is a thread-concurrency harness over a compile/load/stdlib by thread-count matrix with an allowlist ratchet, before fixing the seams. A 3x3 matrix requires a generator first (contract section 11). +R-EY process choice False n/a unstated a n/a medium A set of small issues ship as ordered chores, measurement chores carrying their table in the commit body, rather than one plan with a gate. A day of work does not get a plan and verify round; it goes as chores. +R-EZ process choice False n/a unstated n/a high Accepts a batch of reorderings, moves an earlier group forward so a dependent group does not land short, and folds, posts or closes several issues. +R-FA library other choice False matches unstated c refuse medium re,hmac,default-parameter,deviation When a stdlib callable accepts a call CPython rejects, a harmless widening (re endpos=None) is a deviation row, while one users would come to depend on (hmac without digestmod) is refused. An extra acceptance is recorded only if no valid program changes meaning; otherwise refuse, because a refusal can be relaxed but a kept acceptance cannot. Split ruling: hmac part matches Python (refuse); endpos part deviates. +R-FB process derivable VC11 True n/a unstated a n/a high A stdlib default-parameter audit becomes its own group with the widened audit (spy-sourced and hand-written C#, a hand table, each candidate confirmed by a run) first. Row cites contract section 11. +R-FC library other choice False deviates two-way a deviation-row medium threading,thread,lambda,varargs threading.Thread's args and kwargs parameters are not supported; this is a recorded deviation whose steer is to pass a lambda as target. An untypeable Python variadic API becomes a deviation with a lambda steer, not a family of typed factories or dynamic invocation. (c) is excluded by AP/A3 (runtime type checking), but (b) is left open by the laws. +R-FD library repr-display precedent R-CJ True matches one-way a runtime-value medium threading,thread,thread-name A Thread's default name is `Thread-N` (the main thread `MainThread`) and name is a non-null str; the Python target suffix is deferred. repr(Thread) COMPARED under R-CJ and FS rules out (c); (b) rejected on schedule. +R-FE library nullability-narrowing choice False deviates unstated a deviation-row medium threading,thread,optional Thread.ident before start() is a recorded deviation rather than typing ident as `int | None`. A property is not widened to nullable just to mirror a Python None in a misuse-only state; the gap is recorded. A3: Python's None-before-start is replaced by a non-null value, close to the kind of default A3 distrusts. Row says the id value is NOT COMPARED, but the None-before-start state is not an id value, so FS does not decide it. +R-FF process choice False n/a unstated b n/a medium An issue is split at the process-wide-state boundary: stateless cells now, state-adding cells after the concurrency harness group; a related issue is a chore and a group is placed. Work that adds process-wide state waits for the harness that can measure it; stateless work proceeds now. Rejected (c) cites the shape R-EY rejected (precedent R-EY for that option). +R-FG process derivable VC1 False n/a two-way a n/a high The timeout-conversion tracker is widened to every stdlib seconds parameter across modules, as one stdlib-wide conversion. 'Both fix one arm of a mirrored structure' is VC1 wording. +R-FH library numeric choice False deviates unstated a deviation-row medium timeout,threading,deviation A timeout above the CLR's int.MaxValue milliseconds but at or below TIMEOUT_MAX saturates at about 24.8 days, recorded as one family deviation row. A CLR limit below Python's accepted range saturates as a recorded deviation rather than refusing calls Python accepts. Follows existing rows (socket timeout, time.sleep clamp) that are not numbered rulings. +R-FI process precedent R-FF False n/a unstated n/a medium The timeout chore runs first, before an LSP group, since it adds no process-wide state. Applies R-FF's state-boundary principle. +R-FJ process choice False n/a two-way a n/a high Three design issues are scheduled at proposed positions rather than parked; one remains a parked card. +R-FK cli-lsp choice False n/a two-way a n/a medium formatter,lexer,string-literal,indent-repair The literal-loss fact widens: a lex that dropped a line holding a quote, re-paired a triple quote, or stopped at its error budget marks the literal map unknown; a generator comes first. A repair route refuses only where it detectably lost information, and the detection covers the class, not a list of cells. VC1 (cited as contract section 1) excludes (c) only; (b) rejected on usefulness, so not fully derivable. +R-FL library io-os derivable A2,FS,T1 False matches one-way a runtime-value medium subprocess,signal,returncode Sharpy's subprocess kill, terminate and send_signal deliver the real Unix signal and report negative returncodes like Python; externally signalled children keep 128+N as one deviation row. Python twin exists and the value is COMPARED; (b) misreports a genuine exit 137 (T1). +R-FM language other choice False matches two-way a spelling medium noreturn,return-annotation,attribute `-> NoReturn` is the spelling for a non-returning function, lowering to void with DoesNotReturn honoured on every callee; `Never` is refused with a steer; raise-only bodies are not inferred. Where Python offers several spellings, Sharpy takes one, the one that shadows no user name, and steers the others. A2: `-> Never` is valid Python (3.11+) yet is refused. One-way-to-do-it (AP) excludes (c) only. +R-FN language scope-binding choice False no-twin two-way a admit medium implicit-member,enum,static-member,const The leading-dot implicit member covers enum members, constants, static fields and properties only, excludes static methods and constructors, and gets a new refusal code with a qualify fix-it. A context-typed expression takes its type only from a resolved target; anything needing return-type overload resolution waits. Row also says the new diagnostic code is permanent. +R-FO language other derivable T1,T2 False no-twin two-way a refuse low ref,list,span,array A ref to a Sharpy list element is refused with a steer to arrays or spans; ref is allowed for arrays, struct fields, spans, ref/out parameters and locals. (b) brings an aliasing hazard under append that cannot be refused statically; (b) is also a net10-only Core surface, which CR5 permits. +R-FP cli-lsp precedent R-FK True n/a two-way a n/a medium formatter,lexer,indent-repair The lex that feeds the indent map continues past its error budget without reporting, so the unread tail gets real tokens and existing repairs are kept. Rejected (c) is 'the direction R-FK rejected'; (b) loses repairs for the same reason R-FK rejected its (b). +R-FQ test-instrument choice False n/a two-way a n/a medium formatter,lexer,allowlist A stray triple quote that leaves the lexer signature of a correct document is a permanent documented limit; its rows leave the allowlist and become a census floor. A case indistinguishable at the available signal is a documented permanent limit measured by a census, not guessed with content heuristics. Sits uneasily with the gap-sweep convention that each allowlist row cites an open issue closed on fix; resolved by a permanent tracker. +R-FR cli-lsp precedent R-FK True n/a two-way b n/a medium formatter,lexer,string-literal The re-pair arm keys on a dropped span holding a quote on the close line, rather than any lexer error there or a growing list of codes. R-FV: R-FV later narrows this arm to quotes leaving a literal open at line end. Rejected (c) also follows VC1 (the arm recurs at the sixth code). +R-FS process choice False n/a unstated a n/a medium A stdlib docs generator with a guard twin is a chore in the next slot; an unreachable documented member is filed as a stdlib cell by class at close. Rejecting (b) reuses R-FF's 'adds no process-wide state' reasoning. +R-FT process choice False n/a unstated a n/a high An LSP sweep group moves to directly before another so its allowlist drains while the sweep and driver are warm. +R-FU cli-lsp precedent R-FQ,R-FP True n/a two-way a n/a medium formatter,lexer,bracket,indent-repair A lexer fact records a bracket open at end of file and the recovery line; indent-only routes make no edits below the opener while it is open, keeping repairs above. Indent repair never acts on a token-level guess whose misses are wrong edits. Rejected (c) is 'the content-heuristic shape R-FQ rejected'. +R-FV cli-lsp precedent R-FR True n/a two-way a n/a low formatter,lexer,string-literal The re-pair arm narrows: a quote in the given-up span counts only if a literal is still open at the line's end, with each new tail paired with a positive control. R-FR: Narrows R-FR's chosen arm (b). Rejected (c) widens to the option R-FR rejected; (b) rejected for blindness of the generator, not by law. +R-FW language typing-conversion precedent R-BR True deviates unstated a refuse high function-type,varargs,lambda,function-value A function with a *args tail cannot be used as a function value without a lambda; it is refused in the existing family with a wrap-it-in-a-lambda steer. Rejected (b) is also magic (AP); function types carry no names, defaults or tails per R-BR. +R-FX process choice False n/a two-way a n/a medium The stale hand-written grammar file is deleted now; an executable grammar derived from the parser is written late in its own group. An unread hand model is deleted rather than maintained; the replacement is derived from the implementation. Refers to a 2026-07-02 ruling for the predicted measurement. +R-FY test-instrument choice False n/a two-way a n/a medium spec-block,output-marker The spec output-marker mechanism (running blocks, reporting mismatches, seeding prose that states results) is a chore now; converting blocks rides the existing review rule and any plan touching a spec file. Conversions ride R-BG (cited); the timing choice itself is open. +R-FZ process choice False n/a unstated a n/a high The exact-diagnostic-code oracle fix in the error injector is a chore now; the per-construct census roster and new injections become a group after the concurrency group. Ordering only; test-instrument content. +R-GA process choice False n/a unstated a n/a medium Four owner-filed sub-issues form one plan in phases under their parent, scheduled after a named group and before two others. Row notes this is an owner structure, not the contract section 10 default. +R-GB process choice False n/a two-way a n/a high A mutation-testing pilot runs as a background chore in a lock-idle slot, Lexer first, with a report carrying the command and measured score; survivors become test-gap issues by class. +R-GC process choice False n/a unstated a n/a high The round's group order is fixed as proposed, with the stdlib ICE group and the per-module ledger group kept in their proposed late slots rather than pulled forward. Ordering only. +R-GD cli-lsp choice False n/a two-way a n/a high formatter,comment,indentation Every indent-only formatting route leaves a comment-only line byte-identical, including its leading whitespace, rather than re-indenting it by column or by the following line. An editing route that cannot know the structure keeps the user's bytes rather than guessing a repair. +R-GE process choice False n/a unstated a n/a medium The indent-only formatter residue becomes its own small group directly before the editor block, with its generator extended first and a verify round. R-GF: The cap ruled next stops this warm-harness slotting from being used again. Generator-first is VC11; the slot itself is the choice. Rejected fold cites R-EM. +R-GF process choice False n/a two-way n/a high The formatter/indent residue family is capped: further residues become cells on an open tracker and queue behind waiting user-facing groups, unless they are regressions against the last pushed sha. A tooling residue family may not keep jumping the queue; later residues wait behind user-facing silent-wrong work, regressions excepted. R-GC: R-GC used the warm-harness argument this ruling now caps.; R-GE: R-GE used the same argument once more. Owner-initiated, no option letter. +R-GG cli-lsp choice False n/a two-way a n/a medium pdb,windows The one PDB-emitting site emits an explicit portable PDB, guarded by a signature check with a mutation record, as a chore before other work. A host-breaking release defect is fixed at once as its own chore, not folded into a distant group of a different class. Guard with mutation record is CR12/VC2; the placement and the class judgement are the choice. +R-GH test-instrument choice False n/a unstated b n/a high ci,release,windows Release publishing runs a per-RID smoke of the published artifact, and every push builds and smoke-tests the CLI on a Windows leg; the full Windows test matrix waits for evidence. Additive. +R-GI process choice False n/a unstated a n/a high A patch release is cut as soon as the Windows-install fix's gate is green, rather than waiting for the next minor. A defect that breaks the documented install on a supported host gets an immediate patch release. +R-GJ process choice False n/a unstated a n/a high The investigation comment with the workaround is posted on the issue immediately, before the placement comment, rather than waiting for the application turn. Users get a known workaround as soon as it exists, ahead of scheduling. +R-GK cli-lsp choice False n/a two-way b n/a high cli,dotnet-host,run All three dotnet-launching CLI sites share one preflight that refuses before compiling, naming runtime versus SDK and the install link; an in-process run is parked as a roadmap design. Check host prerequisites before doing work and refuse with a coded diagnostic, rather than crash after a wasted compile. (b) then (a) stacks; (a) one-way in practice. +R-GL diagnostic other choice False n/a unstated a n/a medium cli,dotnet-host A missing dotnet host tool is a new coded diagnostic shared by all launching sites, with an explanation entry; the restore site's uncoded message migrates to it. Each diagnostic code has one meaning: a new failure axis gets its own code, never a near neighbour's or uncoded stderr text. CR10 forces the explanation entry, not the new-code-vs-reuse choice. Additive. +R-GM test-instrument choice False n/a unstated a n/a medium ci,dotnet-host A per-RID CI job runs the archive with dotnet scrubbed from the path and asserts the new code and exit code, plus a table-driven child-process theory with a path-intact positive control. An OS-dependent behaviour is checked on every OS it ships for; one platform is not a control for another. Positive control is CR12/VC2; per-RID coverage over one leg is the choice. Additive. +R-GN process derivable VC1,VC11 False n/a two-way a n/a medium Two issues sharing one mechanism (node end positions read from the wrong token) are one class and one group with one generator and one shared end-of-token helper. Also fixes an internal design (one helper at all 213 sites). +R-GO process precedent R-GF True n/a two-way b n/a high Three editor-refactoring groups queue behind the waiting Core silent-wrong groups, applying the residue cap's reasoning to a second family. Ordering only. +R-GP cli-lsp derivable VC3 True n/a two-way a n/a high refactoring,extract,wrap Wrap/Extract on a selection holding a declaration referenced after the region is not offered, restoring the prior verdict now as a chore with a direction record. Row cites contract §3: a regression by direction is remediated, not queued. +R-GQ cli-lsp choice False n/a two-way a n/a high refactoring,match,literal,raw-string Convert-forms writes header literals as the source token verbatim when legal in the target form, re-spells as the cooked equivalent only when not, and otherwise is not offered. A refactoring keeps the user's source spelling wherever it is legal in the target; it re-spells only when forced, else is not offered. Supersedes an earlier lead plan decision (P47 D6), not an R-ruling. +R-GR process choice False n/a two-way a n/a medium The seven mutation-survivor test-gap classes go on one class tracker with seven rows, drained by one tests-only group, rather than seven issues or a cell table on the pilot's tracker. Tests-only gaps found by one instrument share one tracker and one draining group, keeping the open-issue count down. R-GB: R-GB ruled survivors become test-gap issues by class, which read literally gives seven issues.; VC10: VC10 files one issue per class; here seven classes share one. Filing and ordering only. +R-GS cli-lsp choice False n/a two-way a n/a medium refactoring,try-except,wrap,local Wrap in try/except is not offered when a name declared in the selected region is read after it; it is offered when nothing escapes. A refactoring is offered only when its output compiles with the same meaning; the LSP never invents language rules to make one work. Rejected (c) needs uninitialized locals, a spec question (CR7). +R-GT process choice False n/a two-way a n/a medium Two informational formatter cells stay recorded on the closed issue's close comment, pointed at from the ledger, rather than opening a new class issue. Informational headroom cells may rest on a closed issue; only defects need an open tracker. R-HE: R-HE refuses to leave cells on a closed issue, distinguishing defects from informational cells. +R-GU process precedent R-GF True n/a two-way a n/a high The editor residues of the definition/navigation family form one residue group, generator first, placed late in the editor residue band behind Core work. Ordering only. +R-GV process choice False n/a two-way a n/a medium The bindings work is regrouped into two plans matching the owner's scope list, with two smaller residue groups after them; the bindings design rulings are recorded by pointer and never re-asked. Do not build an instrument on semantics a ruled change will flip; land the semantic change first. R-BK: B5 amends it: := on an existing let becomes an error, never a silent shadow.; R-CN: Its ordering is superseded. Also records language rulings B1-B12 (e.g. module const-only superseded) by pointer; classified by the regrouping. +R-GW process choice False n/a two-way a n/a high The variance and prop respelling groups go directly after the instrument group, early, to stop corpus drift before the grammar generator. Before 1.0 there are no users and no stability promise; breaking respellings land early, before drift grows. Owner's 'no users before 1.0' is reused later (R-HC, R-HL). +R-GX process choice False n/a two-way b n/a medium The expression-position error-type feature joins the type-resolution group as its acceptance gate, a cell is folded onto its tracker, and both groups move ahead of the group previously preferred first. A sequencing preference that is not a data dependency yields when it would hold a user-facing feature back. Ordering plus fold. +R-GY language imports-modules precedent R-DQ True no-twin unstated a refuse medium generic,import-cycle,constructor,type-argument A constructor call through a type-argued generic reference, or any expression-position type argument naming a deferred circular-import symbol, is runtime use and refused like a bare constructor call. The RFC's written clauses, normative under R-DQ, decide. Relaxable by spec edit. +R-GZ process choice False n/a two-way a n/a medium Identity-request resolution and reference recording form one group with one resolver entry point and a request x spelling x position x target matrix, placed after the editor residue group. Defects on one seam form one group with one generator, never two groups on the same code. Same unwritten principle as R-GN, R-HB. +R-HA process choice False n/a two-way a n/a high A parked design for fresh locals on bare store stays parked and is closed only after the bindings change that moots it is measured. A design is closed as mooted only after the behaviour that moots it is measured, never on 'probably'. +R-HB process choice False n/a two-way a n/a medium REPL echo and repeated-warning defects form one snippet-totality group with one transcript generator compared against the interactive python twin. Defects on one seam form one group with one generator, never two groups on the same code. The echo verdict is a semantic fact (CR2). +R-HC process precedent R-GF,R-GO,R-GU True n/a two-way a n/a high The REPL group is placed after the resolver group, keeping tooling behind the Core silent-wrong groups. Ordering only. +R-HD diagnostic other choice False n/a two-way a n/a medium error-cap,parser,cli The maximum-errors cap is enforced at one seam at the parser's counting site, so no recovery diagnostic follows the Nth error; catch-site copies are removed. A cross-cutting count is owned by one seam; scattered copies at catch sites are removed. Placement as a seam-free chore riding another gate is VC11. +R-HE process derivable VC10 True n/a two-way a n/a high Defect cells left by a closed round get one new successor tracker, placed as its own group with generator first, instead of staying on or reopening the closed issue. R-GT: R-GT left cells on a closed issue; this row distinguishes defects from informational cells. +R-HF cli-lsp choice False n/a one-way c n/a medium cli,build,deployment The build and project commands deploy referenced assemblies and runtime dependencies beside the output, like compile and run; a --no-deps flag gives assembly-only output on every producing command. CLI verbs mean what the same verb means in the .NET toolchain; a produced program runs in place by default. Owner checked dotnet build's behaviour first; A1 flavour but A1 governs runtime semantics, not CLI vocabulary. Door one-way in practice. +R-HG cli-lsp choice False n/a two-way a n/a high cli,metrics,emit The metrics options of emit diagnostics stay rostered as ignored on both branches, as landed, with the open question recorded as a tracker cell. +R-HH language imports-modules derivable FS,T4 False matches unstated a refuse medium module,import,filesystem Module file names match by exact case on every OS, so a case-mismatched import is refused on case-insensitive filesystems as on Linux; the module resolution spec gains the sentence. R-HT: There a spec-silent surface stayed DEVIATION by default; here a spec-silent surface was treated as COMPARED with python3 as oracle. Row says 'the surface is COMPARED' (fidelity table) without naming an ID; T4 read with the OS as host. +R-HI diagnostic imports-modules choice False n/a two-way a refuse medium reference,assembly The unloadable-reference code keeps one meaning, every registry route reports it unfiltered, and the long-lived-process duplicate-load case is removed at source rather than coded. One diagnostic code per failure axis, never filtered on some routes; a case the code would mask is fixed at its source. Also orders one group before another. +R-HJ language scope-binding choice False deviates unstated a refuse low def,local-function,redefinition A second def of the same name in the same block of a function is a compile error; sibling blocks bind fresh, and nested-block shadowing follows the bindings rules. A name has one binding per block; redefinition there is an error, never an overload nor a silent rebinding. RR: Python has a twin (it rebinds), and a renaming bridge might reconcile it; the row rejects rebinding on the bindings rulings B3/B4 instead. Today the program ICEs, so no running program is refused (VC3/T3). (a) relaxable to overloads later. +R-HK process choice False n/a two-way a n/a medium The declaration-position totality group is re-scoped and moved ahead of the bindings plans and the variance group, with its own matrix test extended first. A slot whose premise has moved elsewhere is reclaimed; a group no longer depending on later work moves forward. R-GV: R-GV placed this group after the bindings plans; this moves it ahead. Rejected (c) cites contract §1. +R-HL library interop-naming-emission derivable CV True matches one-way a spelling high random,stdlib-naming random.random() is spelled as CPython spells it and the .NET-style name is deleted; the module's other missing names stay on the per-module ledger. Row names the CLAUDE.md convention. Rest of the module's name set is an unlisted FS surface ruled per module later. +R-HM implementation derivable CR2 True n/a two-way a n/a high emitter,codegeninfo,generic The emitter's last reflection site becomes a symbol-keyed fact computed in semantic analysis and frozen on the imported type's CodeGenInfo, as a chore now. Fixes a reach where a package in a System namespace was invisible to the emitter; placement now vs later is the choice. +R-HN process choice False n/a two-way a n/a medium A host-dependency reference defect joins the reference-target group as its second tracker, acceptance being one resolution set for loading and for C# metadata references. Cure is a refusal on compile-then-die cells; rejected pull-forward cites R-HI. +R-HO library repr-display derivable FS,R-CF True matches unstated a runtime-value high str,repr,user-class,iter A Sharpy-compiled class is never formatted as a plain CLR sequence by str or repr; the Sharpy-instance check precedes the sequence check, giving Python's default object display. Surface already COMPARED by R-CF; T3 satisfied since prior value was ruled wrong. Placement as a chore is the choice. +R-HP implementation choice False n/a two-way a n/a medium unparser,conditional-expression The pretty-printer gives a conditional's test position the same precedence context as its branches, and the pin and hardening item for it are deleted. No output change on parsed source; placement chore after an instrument close-out. +R-HQ process choice False n/a two-way a n/a medium The typed-generator injection-reach residue is a new group placed after the declaration totality group with a mutation generator first, ahead of tooling residues. An instrument blind spot that hides missing refusals is drained before the silent-wrong band it would audit. R-GC: Departs from the instrument-band slot precedent R-GC/R-GR used.; R-GO: Not queued behind P13b with the other tooling residues. Ordering only. +R-HR process choice False n/a two-way a n/a medium The entry-point shape issue stays open as a tracker in the module-kind group, and its access-decorator cells move to the access tracker. Refusal must fire only for the entry file's main (R-CR). +R-HS language classes-members derivable AP,A1,SPEC:decorators.md True no-twin unstated a refuse high decorator,access-modifier,top-level-type @private or @protected on a top-level type is refused with the steer that module-level privacy is spelled _Name; nested types keep the member access table. Row cites the spec access table and the multiple-ways anti-pattern; C# allows only public/internal at namespace level. +R-HT language numeric derivable FS,A1 True deviates one-way a deviation-row medium int-literal,leading-zero Decimal integer literals with leading zeros are accepted as digits, C#'s rule, recorded as a deviation row and a spec sentence; no compiler change. R-HH: There a spec-silent surface was compared with python3 and Python's refusal adopted; here the spec-silent default kept Sharpy accepting.; FS: FS's 'which programs run vs refused' row is COMPARED; the row treats literal spelling as an unlisted surface instead. Row cites fidelity-scope D5. Owner chose against the analysis's recommendation (promote and refuse). +R-HU language numeric derivable A3,T1,T2 True deviates unstated a refuse medium float-literal,decimal,numeric-literal Every numeric literal outside the range of its own resolved type is a compile error at one semantic seam; float64 literals never become infinity. RR: Python's value inf has a zero-cost CLR twin, so the resolution rule's bridge clause pulls the other way.; A2: python3 runs print(1e400) giving inf, a twin Sharpy refuses. Row cites 'Type Safety > Python syntax'; infinity is not a CLR default, so T1 applies by analogy. Deviation not stated as a deviations.yaml row. +R-HV process derivable VC1,VC11 True n/a two-way a n/a medium The literal-range fix is a seam-free chore in the current band riding the declaration group's gate, with a closed type x spelling x magnitude theory and mutation record. Cites contract §1 meta-class; rejected fold into a slot-directed group gives it a foreign axis. +R-HW language interop-naming-emission derivable A1,FS True deviates unstated a deviation-row medium identifier,unicode Identifier letters are limited to the Basic Multilingual Plane, C#'s identifier alphabet; a supplementary-plane letter stays refused and is recorded as a deviation row plus a spec sentence. RR: Mangling to a C#-legal name is a naming transformation RR names as a zero-cost bridge; the row rejects it as a new interop surface instead. Row names Axiom 1; FS's unlisted-surface default also favours recording. Row calls (b) one-way and (a) relaxable, but states no door for (a). +R-HX process derivable VC11,VC1 True n/a two-way a n/a high Three lexer issues are placed by class: the f-string dedent arm into the prefix-table group, the token-position defect into the position-contract group, and the numeric-suffix defect as a separate chore landing first. Rejected (b) is the three-contracts-in-one-plan shape §11 forbids. +R-HY process choice False n/a two-way a n/a high The f-string prefix/escape table group moves up to run directly after the current tests-only group, after the numeric-suffix chore and before the keyword codemods that rewrite the same lexer. A compiler group with program-reach silent-wrong cells is not queued behind unrelated groups; groups rewriting one reader land in dependency order. Distinguishes R-GF/R-GO's editor-residue reasoning rather than overriding it. +R-HZ test-instrument choice False n/a two-way a n/a medium Python-twin tests skip through one helper that reports a counted skip when no python oracle is present; a required mode fails instead in CI; a census guard keeps ad hoc 'SKIP:' returns at zero. A test whose external precondition is missing reports Skipped and is counted; it never passes vacuously, and CI can require the precondition. VC2 (falsifiable guards) motivates fixing the vacuous pass but does not choose skip-with-count over fail-always. +R-IA language numeric choice False no-twin unstated a refuse medium decimal,numeric-literal A non-zero decimal literal whose value underflows to zero is refused on both the suffixed and the annotated spelling; float32 and float64 keep IEEE underflow to zero. A literal that silently loses its written value is refused unless Python defines the same result; both spellings of one literal get one verdict. A1: C# accepts 1e-30m as 0m; refusing departs from C#'s compile-time behaviour. T1/T4 support the pick but do not exclude C#'s accept-zero option outright. Row says (a) is relaxable to (b); no door word. +R-IB process derivable VC1 True n/a two-way a n/a high Three literal-typing defects form one chore under a widened contract: a numeric literal's type, value and admissibility are decided once at one seam every consumer reads, with a consumer axis added to the range matrix. A numeric literal's type, value and admissibility are decided once, at one seam that every consumer reads. Row cites contract §1's parallel-site meta-class. +R-IC language typing-conversion derivable A1,SPEC:integer_literals.md True no-twin one-way a admit high numeric-literal,sized-int,unsigned An unsuffixed integer constant whose value fits an unsigned type converts to it at every site (annotated slot, operand, argument, return, const); a constant that does not fit keeps its own type. Row says it is C#'s rule and the spec's own value rule; the uint64 arm already behaved so. +R-ID test-instrument choice False n/a two-way a n/a high The isolation sweep samples a fixture when a deterministic hash of its stem is divisible by 16, so inserting a fixture moves only itself; stale allowlist rows are reported, never dropped silently. A sampled instrument's membership is stable under corpus growth, and its known-red rows can only drain by a fix or a reported staleness. +R-IE language classes-members derivable FS,A1 True deviates unstated a deviation-row medium class,inheritance,list,dict,set Subclassing a Core collection type is refused because those types are sealed; a deviation row and spec sentence record it, and the diagnostic is replaced by a sealed-base refusal steering to composition or protocols. A2: Python allows subclassing list and dict; the row records the deviation. Row cites R-CM, FS's unlisted-surface default; unsealing is rejected as a one-way public API change. Also replaces a wrong-reason diagnostic. +R-IF language repr-display precedent R-HO,R-CF,R-CM True matches unstated a runtime-value medium generator,str-repr,iteration A generator's str/repr is '' without enumerating it; that generators re-run their body on each iteration (IEnumerable) is recorded as a deviation row and spec sentence. A2: Multi-pass re-execution differs from Python's single-pass generator; recorded as deviation, not fixed. Two halves: formatting follows R-HO/R-CF (python matches); multi-pass is an A1 consequence recorded under R-CM (python deviates). +R-IG library exceptions derivable CV False matches two-way a runtime-error medium threading,thread,exception An exception escaping a thread's target or run method is printed to stderr as CPython's thread excepthook does and the process continues; exit code and continuation are compared with Python, message text beyond the type is not. A1: The CLR's own behaviour is to end the process on an unhandled thread exception; this departs from it. Most of the row argues placement (chore vs P33 vs own group); the behaviour follows 'wrap .NET, expose Python'. Door said two-way 'in practice'. +R-IH test-instrument derivable VC10,VC2 True n/a two-way a n/a high The no-vacuous-pass tracker is reopened; precondition skips report Skipped through a general helper, swallowed compile failures become hard failures, and the skip census widens to 'skipping' strings. Rejected (b) cites contract §10 (tooling cells never get a new issue). +R-II language scope-binding precedent R-HJ,R-CY True deviates two-way a refuse high import-alias,module,builtin-shadowing An import alias is checked like every other module binding: a same-module collision is SPY0204, a builtin type name is SPY0212, and a builtin function name gets the same shadowing verdict as a def of that name. T4 (one rule for every binding kind) also supports it. +R-IJ process choice True n/a unstated a n/a medium A new declaration-rule residue group of three issues is placed directly after the current tests-only group and before the lexer group, extending its existing generator first. Silent-drop and crash residues on a warm seam with an existing generator are scheduled next, ahead of unrelated bands. §11 makes the generator mandatory but does not decide the placement; R-HK's reasoning cited. Row says 'Order only'. +R-IK diagnostic classes-members choice False no-twin two-way a n/a high property,event,def,declaration-position A property, event or accessor declared inside a def reuses SPY0708 (declaration kind not allowed at this position) with the kind named in the message, rather than a new code. One rule gets one diagnostic code; a new value on an existing axis reuses the code with the kind named in the message. +R-IL process derivable VC3,VC11,CR2 True n/a two-way a n/a medium Same-named nested defs in different match arms are fixed in the local-naming group as one symbol-keyed versioned name read at declaration and every call site, never by a lowering fallback. A fix lives at the naming seam as one symbol-keyed fact read by every consumer, never as a lowering-shape fallback. Rejected (b) is a §3 regression-in-kind; (c) a two-seam group §11 forbids. User-visible effect (programs compile) is a bug fix. +R-IM language repr-display choice False no-twin one-way a runtime-value medium union,str-repr,result,optional str and repr of a user union value are its constructor spelling with payload reprs, unit cases parenthesized ('Shape.Empty()'); Result follows; a user __str__/__repr__ wins; the surface becomes compared. A value's str/repr is its source construction spelling with payload reprs, uniform across Optional, Result and unions. FS promotion is by owner ruling, and FS today cites this ruling, so FS cannot derive it. Door: one-way once a fixture pins it. +R-IN language patterns derivable FS,CR7 False matches two-way a admit medium match,case-literal A match arm duplicating an earlier literal case compiles with an unreachable-case warning, and the first arm wins under every lowering, decided at one seam. An unreachable arm runs first-wins with a warning rather than being refused, decided once for every lowering. FS compares run-vs-refuse against the spec, which refuses only irrefutable-not-last; the warning (vs silent) is the owner's pick. +R-IO language other derivable AP,FS True deviates two-way a deviation-row high semicolon,statement Semicolons do not separate statements; every separator position draws a dedicated parse diagnostic with a steer, recorded as a deviation row and a spec sentence. A2: Python accepts semicolon-separated simple statements. Row names the anti-pattern 'multiple ways to do the same thing' and R-CM's unlisted default. +R-IP language operators derivable A2,T2 True matches two-way a admit medium tuple,comparison,sorted Ordering operators on tuples work with Python's lexicographic semantics through the one comparer engine sorted uses; an unorderable element pair is refused statically naming its position. An operator and the library function that uses it share one engine, so they can never disagree. Semantics follow the Python twin (A2) with T2 for the static refusal; the group placement is a separate owner choice. +R-IQ library numeric choice False matches unstated a runtime-value medium math Stdlib math values must match python3 within a stated per-function ulp bound; this becomes a compared surface, with a differential numerics corpus built first in a new Stdlib group. Stdlib numeric functions match python3 within a stated accuracy bound; a precision-losing naive formula is a bug. FS promotion is the owner's call; FS now cites R-IQ. Rejected (b) departs from R-HL and §11. +R-IR library numeric choice False matches unstated a admit medium int,sized-int,sys int and every sized int gain to_bytes, from_bytes, bit_length and bit_count through one size-keyed helper, plus sys.byteorder; non-fitting values raise OverflowError, recorded as deviation rows. A Python library method is provided when no equivalent stdlib route exists; a 'not provided' row is sound only with an alternative. AP: 'Add X because Python has it' is listed as an anti-pattern; the row says that check was the question. Row: 'Additive; the C# spelling is one-way' — no single door for the choice. +R-IS library exceptions choice False deviates two-way a runtime-error medium int,parse A well-formed integer string that does not fit the target sized int raises OverflowError, recorded as a deviation; each sized int parses its own range; PEP 515 underscores are accepted at one shared parser. An out-of-range value raises a different exception type from malformed input, using CPython's type for the nearest analogous failure. Underscore half is compared and needed no ruling. FS row 3 explains why the type matters but not which type. +R-IT library strings-formatting derivable CV False matches unstated c admit medium str,char center, ljust and rjust take a str fill character validated to length one with CPython's TypeError, dropping the char overload; the CLR char-route parity cell is filed on its class tracker. Row: Python's parameter type is str and declaring char was the CLR-ism; R-GW (no C# consumers before 1.0) also relied on. Plus a primitive_types.md sentence. +R-IU language patterns derivable A2 False matches two-way a refuse high match,capture A name captured twice in any pattern spelling is refused with SPY0372, generalised, as python3 refuses it. Python twin refuses all nine spellings; accepting with an equality meaning would be a language extension. +R-IV language exceptions precedent R-IN True matches two-way a admit high try-except,except-handler A dead typed except handler draws a warning and is omitted so the program runs first-wins; a non-final bare except is refused; the unreachable-arm fact is shared with match arms. +R-IW language other choice True deviates two-way a refuse medium expression-statement,conditional-expression,lambda A None-typed non-call expression statement (a conditional of calls, a bare lambda, a module reference) stays refused with SPY0603; the spec states the rule and a deviation row records it. An expression statement C# cannot discard is refused with a steer rather than lowered into statement form. RR: Lowering a void conditional to if/else is a zero-cost bridge RR would prefer over refusing.; CR7: The spec said any expression can be a statement; the spec is changed to match the refusal. Row says 'Axiom 1 reason stands', but A1 does not exclude the lowering option. +R-IX process choice False n/a two-way a n/a medium The per-sample cost cut is a chore riding the next gate; the injection-instrument residue becomes a new tests-only group placed after the syntax and silent-wrong bands. Tests-only groups do not queue ahead of program-reach bands once their blind-spot reason is met. Rejection references R-HQ's blind-spot reason. +R-IY cli-lsp precedent R-CS True n/a two-way a admit high repl,import,class In a mixed REPL submission, imports and type definitions register at module level while defs, aliases, declarations and statements stay in the synthesized main in order; both commit only on success. Confirms a lead ruling. +R-IZ language imports-modules choice False deviates two-way b refuse medium import-star,import,import-alias An explicit import of a different source collides with a star-imported name in either order, reported as SPY0204 at the explicit import. An explicit import never loses or wins silently against a star import; a collision is an error whatever the order. R-II: The row invokes R-II's precedent for letting the spec rule over Python's last-wins.; A2: python3 is last-wins in all three orders. Spec :57 excludes (c) only; (a) vs (b) is the owner's 'explicit over silent' preference. Rejected (a) was P21f's star-vs-declaration takeover rule. +R-JA process precedent R-IJ True n/a two-way a n/a high A second declaration-rule residue group is placed directly after the first, before the lexer group, extending its generator first. §11 also cited for generator-first. +R-JB process choice False n/a two-way a n/a medium The reopened issue stays the class tracker under a broader title; the duplicate issue's table is posted there and it is closed. One open tracker per class; a later duplicate folds into the existing tracker. Consistent with VC10's one-tracker rule but VC10 does not pick which issue. +R-JC implementation choice True n/a two-way a n/a medium The dead single-file import route is deleted, its one test re-homed on the project pipeline, and a census guard pins one caller of the import-binding function. A dead duplicate route is deleted, not revived or left; one route per job, pinned by a census guard. Rejecting (c) cites contract §2 (vacuous instrument), which does not exclude (b). +R-JD language classes-members choice False matches unstated a admit low property,setter A set-only property is typed by its setter's parameter, and a setter's return annotation must be None or absent; the class homes go to the property group, with this arm landing now as a chore. A false refusal or crash on a common typed-Python shape lands as a chore now, not behind a far-off group. Mostly placement; the semantic rule is stated without argument. +R-JE test-instrument precedent R-AZ True n/a two-way a n/a high A known cascade in the property-test error injector is pinned by shape, reported, and fails once the shape stops cascading; it drains with the planned sentinel rather than a local fix. +R-JF process choice False n/a two-way a n/a medium Six residue issues form two groups, type bodies and module bindings, placed back-to-back before the lexer group with generators extended first. Crashes on ordinary programs are scheduled ahead of far class rows; each contract gets its own group. VC11 argues against (b) one group of six but does not exclude (c). +R-JG language classes-members derivable A1,T2 False no-twin two-way a refuse high interface,property,accessor In an interface, an abstract property half beside a bodied half is refused at the later half with one dedicated code, in both orders; both-abstract and both-bodied pairs keep running. A C# hard constraint surfaces as a named Sharpy refusal, never a raw C# error. C# requires interface accessors to be all abstract or all bodied. +R-JH language scope-binding derivable A1 False no-twin one-way a admit high interface,explicit-interface,member An explicit-interface member does not claim the bare name, so 'area' and 'IShape.area' coexist as in C#; collision is keyed on name plus interface. Rejected option is 'a Sharpy-only restriction with no .NET reason'. +R-JI diagnostic classes-members precedent P21g-D3 True n/a two-way a n/a medium union,member Union-case name collisions go through the general member-declaration seam, and SPY0365 is retired into SPY0204 with a retirement note. One contract has one diagnostic code; overlapping codes retire into it. Precedent is plan-cbdf79's design decision D3 (SPY0405/0406/0421/0422 retired into SPY0204), not an R-ruling. +R-JJ partial:R-KD language scope-binding exception N1 True deviates unstated c refuse medium class-body,field-initializer,parameter-default A bare class-body name read outside a method resolves only what C# resolves at that position (const/static siblings in field initializers, const in parameter defaults); other siblings are SPY0200 with a steer. Where Python and C# disagree on name visibility, follow C#'s per-position rule and refuse the rest. N1: N1 makes every class-level declaration visible throughout its scope, so the per-position C# rule no longer decides.; R-KD: Supersedes this ruling as the governing rule. Row acknowledges supersession by N1–N4 (R-KD/R-KF/R-KG); SPY0401's const-only parameter-default restriction stands. When made, A1-derivable. +R-JK language imports-modules derivable SPEC:import_statements.md,SPEC:module_system.md True matches two-way b admit medium re-export,import,module A re-export resolves to its defining module and symbol before import identities are compared, so importing one symbol via a package re-export and directly is not a collision. Rejected (a) needed rewording the spec, which already calls the twice-import harmless and documents the __init__ idiom. +R-JL language classes-members derivable A1,AP True no-twin one-way a admit medium interface,property,default-interface-member A defaulted get-only interface property is a C# default interface member; a settable defaulted one is refused with a steer, since an interface has no storage. Rejected (b) is called 'magic behaviour' (AP). The spec sentence is rewritten, so CR7 is not the basis. +R-JM process choice False n/a two-way a n/a high Static-overload calls through a type name are fixed now as a semantic-only chore with a receiver × kind × overload-count guard, not queued behind the overload sentinel group. A false refusal of a spec-legal program with a closed matrix is fixed now as a chore, not queued behind a sentinel. +R-JN process choice False n/a unstated a n/a medium No stopgap refusal for defaulted interface properties; the crash waits for the property group where the ruled lowering lands. No interim stopgap for a rare crash whose real fix is ruled and scheduled. R-JM: R-JM fixes a false refusal now as a chore, while this leaves a crash waiting about 46 rows. +R-JO diagnostic classes-members choice False n/a two-way a n/a high property,accessor Colliding declarations produce one SPY0204 per colliding declaration group; later halves of the same property are silent. One diagnostic per colliding declaration, not per statement. +R-JP language generics choice False no-twin two-way b refuse medium lambda,overload,type-inference For an unannotated lambda passed to an overload set, arity and other arguments narrow candidates first; agreeing survivors type the lambda; disagreeing survivors draw SPY0343 asking to annotate; the body never picks an overload. Overload resolution never guesses from a lambda body; when candidates disagree on a lambda's parameter types, refuse and ask for annotations. A1: C# binds the lambda body per candidate with betterness; the rejected option (a) is C#'s rule.; T3: One running program (len(s.upper()) printing 3) becomes refused; the row records it. Some cells move to admit (SPY0354/SPY0908 -> runs). Spec files named are to be updated. +R-JQ process choice False n/a two-way a n/a medium Typing a lambda argument by the overload its call resolves to gets its own full-tier group with a generator built first, placed right after the group it builds on, not folded into a distant tracker or a band chore. A newly found class gets its own group next to the work whose facts it reuses, not parked in a distant tracker. Tier full (b, c) and generator-first follow from VC11/VC12; the placement against the P17-member option is the owner's pick. +R-JR process exception VC12 True n/a unstated b n/a medium Charter tiers are the contract-derived letters, except four groups (two keyword codemods, two tests-only instruments) overridden down to light; tiers may only move upward once planning begins. A tier letter that holds only mechanically (a validator spelling touch, a tests-only plan) may be overridden to light before planning starts. VC12: VC12 makes a group full when any letter holds and lets the owner's (e) only raise a tier; here (e) lowers derived-full groups. The row frames the overrides as (e) and does not acknowledge a departure from VC12's 'full when any one holds'. +R-JS language classes-members derivable CR7 True no-twin two-way a admit high property,auto-property,setter A lone auto-property setter is admitted: the compiler synthesizes a private backing field named as function-style accessors already read it, keeping the spec rows that allow it. Rule 7 (spec authoritative) decides against shrinking the spec. Also schedules a band chore. +R-JT partial:R-KD language initialization choice False matches two-way a emission medium static-member,class,field,initializer-order A type's members are emitted in source order so C#'s textual initialization order equals the Sharpy source and Python's class-body order; the forward static-read refusal (later superseded: it now runs) was part of the ruling. Emit declarations in source order so the inherited C# order coincides with Python's, rather than adding a second initialization path. N3: The superseded half refused forward static reads that N3 now runs with the initialized value.; R-KD: R-KD's N3 block supersedes the forward-read refusal. Judged on the standing half; A1 inherits C# order but does not pick source-order layout over a static-constructor lowering. +R-JU process choice False n/a two-way a n/a medium Static-initializer source order gets its own full, alone group with a generator first, scheduled directly after the group it depends on so the silent wrong value does not wait two plans. A group that removes a silently wrong value is scheduled ahead of groups that fix refusals or crashes. 'Alone' and full tier follow from VC11/VC12; the ordering rationale is silent-wrong first (cf. T1, which is a language not a scheduling law). +R-JV R-KF language scope-binding exception N1,CR7 False deviates two-way b admit medium lambda,class-body,initializer,static-member A lambda in a class-body initializer may read whatever its enclosing initializer may read, in source order; instance siblings stay refused with a steer naming the lambda. If C# admits a construct and the footgun it opens is closed, Sharpy may admit it even over the spec's refusal. R-KG: R-KG keeps class-body names invisible bare in nested bodies, the opposite reading.; N1: N1 lists lambdas among bodies where class-body names are invisible bare.; CR7: The owner overruled the Rule 7 recommendation that the spec stands. Row acknowledges overruling the spec-stands analysis; superseded by R-KF/R-KG under N1. +R-JW partial:R-KF process choice False n/a two-way a n/a medium The class-body residue is distributed by class: one issue to a new class-body-read group, others to existing trackers for modifiers and type-reference positions, one to the band, an enum cell to its tracker. Residue cells go to the existing class trackers that own their axis rather than to a wide new residue group. R-KF: R-KF dissolves the new group created here into P78. Rejected options cite R-JF's rejected width; distribution by class echoes VC10 but does not pick this split. +R-JX process precedent R-JM True n/a two-way a n/a high A false refusal where two codes count an explicit-interface member by its bare name is fixed now as a band chore with a closed-axis guard, riding a gate whose group shares no seam. User-visible effect: a spec-legal program stops being refused; the decision itself is scheduling. +R-JY process choice False n/a two-way a n/a medium The residue of one-name-one-meaning consumer crashes forms a new full group with a generator first, placed right after the preceding residue group, instead of being scattered to distant trackers. Residue whose cure reuses facts a just-landed group built is grouped and scheduled right after it, not scattered to distant trackers. Full (b,c,d) is VC12; R-CZ is cited as binding one issue's semantics. +R-JZ language imports-modules choice False deviates two-way a refuse medium import,import-star,module-variable An explicit import keeps its name whatever the order relative to a star import, so a module variable colliding with it is a same-scope re-declaration error even when the star came first. An explicit import never loses to a star import; where refusing or admitting are both open, refuse, because admitting is the one-way door. Close to N1 (order never changes meaning) but N1 does not decide star-vs-explicit precedence. Five previously running cells become refusals. +R-KA implementation choice False n/a two-way a n/a medium list,indexing,core Core element access gets a new light group: a throw-helper fast path at every accessor first, and direct backing-storage indexing only if the kernel stays over 1.3x the BCL list. A performance cure is staged cheapest-first, with the costlier step gated on a measured threshold against the BCL. Also a placement ruling (new light group P76); no observable output changes. +R-KB process precedent R-JM True n/a two-way a n/a medium The backing-field collision check gains the module host as a band chore now, turning a crash into a refusal, rather than waiting for the modifier group far down the queue. User-visible effect: an ICE becomes a refusal on modules. R-JM's test is stated for false refusals; applied here to an ICE. +R-KC language imports-modules derivable T1,T3,FS False deviates two-way a refuse medium import,re-export,package,assignment Assigning through an import binding (a package forwarder or re-export) is a compile error with a steer to assign through the declaring module; reads stay live and a deviation row records it. Write-through gives a compared surface a silent different value (T1); copy semantics changes existing programs' values (T3). The name-resolution principle 'where it cannot match Python, it refuses' also decides. +R-KD process derivable VC11 True n/a two-way a n/a high The name-resolution principle is implemented as one block of five plans in fixed order: harness, then N3 alone, then N1/N2/N4/N7, then N6, then S2. Supersedes R-JT's forward-read refusal in effect. +R-KE process exception VC12 False n/a unstated a n/a medium The tests-only name-resolution harness group is light tier, since the full-tier reading dimensions have nothing to grade in a tests-only plan; tiers never lower once set. A tests-only plan is light whatever tier letters match, because full-tier dimensions have no subject in it. VC12: Letter (b) holds (rejected option names it) yet the group is set light via (e), which VC12 grants only upward. Row cites precedent R-JR, not the departure; could be read as precedent R-JR. +R-KF process derivable VC11 True n/a two-way a n/a high The class-body read residue group dissolves into the N1/N2 plan, its scope-by-host matrix becoming that plan's hand control beside the harness generator. R-JV: Supersedes R-JV's admission.; R-JW: Supersedes R-JW's new-group part. +R-KG language scope-binding derivable N1,A2,T4 True matches two-way a refuse high nested-class,class-body,name-lookup A nested type body reading the enclosing type's members by bare name is refused with a steer to qualify them, as class scopes do not nest in Python. R-JV: R-JV admitted bare class-body reads inside a lambda in an initializer. Extends N1's list of bodies to nested types; Python NameError here is a scope error, not order-only, so A2 evidence counts. +R-KH process choice False n/a two-way a n/a medium The type-member declaration-order group moves up to directly after the name-resolution block, and its required generator becomes an extension of the block's existing harness. A group that completes a rule's open half is scheduled right after the plans that write the rule. +R-KI process precedent R-JU True n/a two-way a n/a high The name-resolution block is scheduled directly after the Core accessor group and before other pending groups, because it cures silent wrong values, common false refusals and a temporary refusal. Silent-wrong cells and the cure for a temporary refusal outrank light or crash-only groups in the queue. +R-KJ process derivable VC10 False n/a two-way a n/a medium Two closure issues are folded into the N3 tracker and closed, a third closed as resolved by N2's refusal, and one kept open because allowlist rows cite it. Also records that N2 refuses the closed issue's cell (language content). +R-KK test-instrument precedent R-JE True n/a two-way a n/a high The nightly red from a None-literal receiver is pinned by a self-failing known-red draw filter keyed on that shape and citing its issue, rather than left red or spot-fixed outside its class. Rejected spot fix also cites Rule 11 (CR11). +R-KL process choice False n/a two-way a n/a medium Two integer-construction and primitive-method issues join the existing call-resolution group by class rather than forming a new earlier group. A cell joins the group whose contract already covers its class rather than carving seams out of that contract to land sooner. CR11/CR13 are cited only against a chore, not against the rejected new group. +R-KM library interop-naming-emission choice False no-twin one-way b n/a medium index,slice,range,core Three public C#-only from-end index and range conversions in Core are deleted; the list's Index and Range indexers remain the C# route. A pre-1.0 public API with no consumer that cannot be made correct is deleted rather than fixed. R-GW (no stability claim before 1.0) licenses the one-way door; AP 'one way to do a thing' is compatible. +R-KN process choice False n/a two-way b n/a medium Six Stdlib accessor cells of the inlining class are recorded on the closed tracker only; the throw-helper shape is applied to a Stdlib accessor when a benchmark shows it hot. A performance cure is applied only where a benchmark names the code hot; an unmeasured hazard is recorded, not cured. +R-KO process derivable VC11 True n/a two-way a n/a high The name-resolution harness residue gets a new tests-only group immediately after the harness group and before the N3 plan, rather than being folded into each rule plan. +R-KP test-instrument derivable VC11 False n/a two-way a n/a medium The name-resolution harness cell budget rises to about 7,400 and every pruned outer kind and builtin is restored, re-ratcheting the resulting reds. Rejected option is a hand re-probe, which VC11's generators-before-hand-matrices forbids. +R-KQ process exception VC12 False n/a unstated a n/a medium The harness-residue group is light tier although a full-tier residue criterion matches literally, overridden as for the harness group. A tests-only plan is light whatever tier letters match, because full-tier dimensions have no subject in it. VC12: VC12 makes a group full when letter (d) holds; the owner overrides it down. Row acknowledges the literal match and cites R-KE as precedent. +R-KR test-instrument choice False n/a two-way a n/a medium Sweep tests mute their compile output and a per-result stdout ceiling guards the class, fixing an out-of-memory in result sending; no memory sampler is added yet. Fix an instrument's class with the minimal falsifiable guard now; add measurement only when the next failure asks for it. +R-KS library other choice False matches one-way a runtime-value medium slice,range,list,core Indexing by a slice value, negative range indexing and slicing, and slice repr are promoted to match Python in Core; slice assignment is recorded as a deviation. Promote a Python behaviour whose cure is Core-only at a low rung; record as a deviation one that needs a new compiler feature. FS makes promotion an owner ruling; CV's layer ladder shapes the cure. Also creates group P81. +R-KT language scope-binding derivable A1,T1,T2 True no-twin unstated a refuse high struct,closure,self Capturing self in a closure inside a struct method is a compile error with a named code and a steer to copy self to a local. A C# hard constraint surfaces as a named Sharpy refusal with a steer, never as a raw C# error. Lowering via a copy would silently write the copy (T1). +R-KU language classes-members derivable N2,A2 False deviates unstated a refuse medium static-member,self,inheritance,assignment Storing to a static field or property through self or a derived type is a compile error steering to write through the declaring type, since Python's per-instance meaning cannot be matched. Decided by name-resolution.md's principle ('never a different meaning; where it cannot match Python, refuse'), cited as 'the principle'; N2 is the nearest numbered rule. +R-KV process choice False n/a two-way a n/a medium The constant-position validator is placed in the N1/N2/N4/N7 plan under N4, not in the modifier group whose member table it reads. A validator lives with the rule plan that defines its legality, not with the plan whose table it merely reads. +R-KW language typing-conversion choice False no-twin two-way b refuse medium lambda,none,callable A lambda whose body yields a value is refused in a slot expecting a None return, with the same type-mismatch error a wrong-typed body gets elsewhere. A lambda's body is its return value; a value-bodied lambda never silently discards its value to fit a None-returning slot. Owner overruled the analysis's admit recommendation; A3 and A2 reasoning are compatible but neither forbids admission. +R-KX language scope-binding derivable N1,N5 True matches unstated a refuse medium local,shadowing,declaration-order Reading a name above its same-scope declaration while an outer binding exists is a compile error saying the name is declared later in this scope. N1 (one meaning in scope) plus N5 (locals ordered); Python's UnboundLocalError agrees. Today these cells silently print the outer value. +R-KY language scope-binding derivable N6,N7 True deviates unstated a refuse high function,class,assignment,global A store to a function, class, struct, enum, union, interface or alias name is refused in every store form with one code and a steer to declare a new local. Confirms an existing rule row; Python would make a new local. +R-KZ language scope-binding derivable S2,N5,T4 True deviates unstated a refuse high match,capture,as Match and as captures are fresh per arm: without an outer binding a later read stays undefined; with one, a later read is refused as for a loop target. Extends S2 to captures; Python leaks captures, even under failed guards. +R-LA language scope-binding derivable S2,T4 True matches unstated a refuse high builtin,for,shadowing A builtin counts as a visible outer binding for the construct-target rule, so reusing a builtin's name as a loop target and calling it afterwards is refused. Python raises TypeError at run time; Sharpy refuses at compile time (T2). +R-LB language scope-binding derivable CR14,FS False deviates unstated a deviation-row medium let,for,while,match,block-scope A let in a for body, loop else body or match case is block-scoped, recorded as deviation rows, with a must-run harness arm. N5: N5 calls its list of designed deviations closed; block-scoped let is not on it. +R-LC language scope-binding precedent R-KX True deviates unstated a refuse high nested-function,closure,declaration-order A nested function reading an enclosing local declared below it is refused as declared later, with or without an outer binding. Cited as 'D10's rule' (R-KX). Python resolves at call time and runs. +R-LD language scope-binding precedent R-HJ True deviates unstated a refuse high redeclaration,parameter,nested-function Re-declaring a name in the same scope, including a nested def over a parameter, is refused as a same-scope re-declaration rather than silently keeping the first value. Today these print the first value silently (T1 also supports). +R-LE diagnostic scope-binding choice False deviates unstated a refuse medium lambda,recursion,local A lambda-typed local reading itself stays refused, with the message steering to write a nested def instead. A Python idiom whose lowering costs complexity stays refused with a steer to the idiomatic Sharpy form until it earns the cost. C# also refuses the shape (A1-compatible); AP 'not because Python has it' also supports. +R-LF language scope-binding precedent R-LB False deviates unstated a deviation-row medium block-scope,let,def,lambda,closure The block-scope deviation row widens to every binder in every block body; two same-block closure re-declaration cells go to the shadowing tracker. N5: N5's closed list of designed deviations does not name block scoping. Rejected option would reverse the shadowing issue #1974 that N5 adopts. +R-LG language scope-binding derivable N5,T4 False deviates unstated a deviation-row medium for,closure,loop-variable,with,except Every binding made inside a loop body is fresh per iteration, so a closure created in the loop captures that iteration's value; the deviation row widens accordingly. Widens N5's first designed deviation from loop variables to all body bindings. +R-LH language classes-members derivable N7,CR7,T4 True deviates unstated a refuse high method,assignment,class-body A bare assignment over a method's name is refused with the same code as for fields and a steer to declare a new local, one verdict per member kind. +R-LI diagnostic scope-binding precedent R-KX True n/a unstated a refuse high lambda,local,declaration-order The rule against calling a local def before its definition stays def-only; a lambda-typed local read early is cited under the declared-later rule instead, with the same verdict. Each binder kind has one rule to cite. Only the cited rule changes, not the verdict. +R-LJ language scope-binding derivable N2 True deviates unstated a refuse medium module-variable,builtin,import,initializer A module-level initializer that reads a builtin or imported name at or before its own same-named declaration is refused as ambiguous. Python reads the builtin here; N2's ambiguity test decides. The row writes this sentence into N2 itself. +R-LK partial:R-LV implementation choice False n/a one-way a emission medium The emitter port to a lowering IR resumes as one full group: the IR becomes the emitter's only input, SemanticInfo freezes after validation, node-keyed tables may only fall, and new lowering facts are IR node properties. Architectural debt whose cost grows with every addition is paid down now as one group rather than drained cell by cell. CR2: CR2 still describes node-keyed SemanticInfo tables joined to MergeFrom as the sanctioned design that this ruling retires.; R-MB: R-LK says MergeFrom asserts disjointness; R-MB rewords it to equal-value tolerant. Also partly superseded by R-MB (disjointness wording). Includes sequencing (process) content. +R-LL process choice False n/a two-way a n/a high Constructor-body lowering gets a new full-tier group placed directly after the IR port's row and ahead of the Core band, rather than joining a later tranche or the host-variance group. +R-LM library nullability-narrowing derivable CV,AP,CR7 True deviates unstated a n/a medium optional,dict,nullable Sharpy's V? is Optional, so dict.get returns Optional; no code changes, and the anti-pattern against Optional returns is scoped to Stdlib C# APIs consumed from .NET. The spec is what the code does when they agree; a wording conflict is resolved by narrowing the wording, not by changing behaviour. CV and AP today cite R-LM itself, so derivability is partly circular; the row names the CLAUDE.md anti-pattern and 'the spec wins'. +R-LN test-instrument choice False n/a two-way a n/a high Most cells of the issue become a new tests-only light group; one cell is posted to the bindings group's tracker and two become a band chore. +R-LO process choice False n/a two-way a n/a medium Each executable rule table is built as the generator row of the group that consumes it, with one tracker across them, rather than one tooling group building all tables ahead of their consumers. A generator is built by the group that consumes it, not ahead of any consumer against rules about to change. Compatible with VC11 (generators first) but VC11 does not pick between the two placements. +R-LP library strings-formatting choice False matches unstated a runtime-value medium codec,encode,decode,open,chr One shared codec table (name to encoding plus BOM policy) serves encode, decode and open; error handlers form a closed enumeration with a totality test; open gains errors=; chr returns a lone surrogate. A program relying on output that is a bug is not a correct program; fixing it needs no deviation record. The rejected options are group placements only; the behaviour itself follows FS (values compared). +R-LQ language classes-members derivable N1,A2 False matches one-way a admit medium nested-class,self,static-member Calling a nested type through self, self.N(), compiles and is lowered to the type-qualified C.N(), the same rule as other class attributes read through self. N1 names self.x as a permitted spelling for class-body names in methods; python prints 3. +R-LR language scope-binding choice False n/a unstated a n/a high walrus,let A walrus assignment targeting a let binding is decided in the let/var plan with let's own semantics; until then the cells stay pinned Unruled and docs keep the open question. An open semantic question is pinned Unruled and decided by the feature that owns it, not by a provisional verdict that may become one-way. +R-LS language scope-binding precedent R-MI True deviates two-way a refuse high nonlocal,for-target,with-target,except-target nonlocal x over a for, with or except target gets the same refusal and steer as global x does. A2: Python stores through for for/with targets under nonlocal, a working twin that is refused. +R-LT process choice True n/a two-way a n/a high Work runs in two lanes: the IR port's second tranche on its own PR series while the Core band runs, then the name-resolution block, one group per plan per lane. Work that touches no shared seam runs in a parallel lane rather than waiting behind unrelated work. Row cites contract §11 but it does not choose serial vs parallel. +R-LU process choice False n/a two-way n/a high The Core band groups run ahead of the codemod groups. +R-LV language nullability-narrowing derivable T1,FS False matches one-way B runtime-value medium walrus,tuple,optional A walrus inside a tuple prints the plain value, not Some(value), fixed in the IR port's first tranche; the walrus site carries an explicit own-site Optional wrap so the strict-Optional guard stays unrelaxed. A failing guard is satisfied by making the emitted shape explicit, never by relaxing the guard. R-LK: Supersedes R-LK's sequencing of the first tranche after P80. Mostly process (tranche ran early); classified by the user-visible tuple-print fix. Options S1/S2 are a guard choice, not law-decided. +R-LW process choice True n/a two-way n/a high Plan bodies are capped at 20 KB excluding verification summaries, at most two verify passes run before an open finding goes to the owner, and light plans keep their adequacy pass. A process cap is set from what real instances meet, not from an aspiration none met. Row cites contract §12 only for the kept summaries. +R-LX test-instrument derivable VC10 False n/a two-way n/a medium Every allowlist row carries a structured issue cite, each generator has one ledger, and every cited issue must be a class issue with a cell table, replacing the per-issue row cap. VC10 (file by class) decides the class-issue requirement; the ledger format is choice. +R-LY process choice False n/a two-way n/a high Keep the dev branch and protect it to require pull requests, keep the nightly mainline soak, and enforce the 72-character commit-subject check. +R-LZ test-instrument exception CR6 False n/a two-way n/a medium One pinned CPython minor in a single file serves every workflow; the pin is the newest minor whose first bugfix release has shipped, bumped at a batching call (3.14 at the time). The Python oracle tracks the newest minor only after its first bugfix release. CR6: CR6 now says the oracle is 3.15 and never an older minor by choice; this rule deliberately chose an older minor. CR6 postdates the ruling; row does not acknowledge it. R-MZ applied this rule to move to 3.15. +R-MA process choice False n/a two-way n/a high Items already filed are closed by default; one tooling issue is placed as a band row, and three unfiled chores are left for the owner to file or drop. +R-MB implementation choice False n/a one-way n/a high MergeFrom accepts a key present in both operands when the values are equal and throws on a conflicting value, replacing the earlier disjoint wording. A merge invariant guards against conflicting facts, not against redundant agreeing ones. R-LK: R-LK said MergeFrom asserts disjointness. +R-MC test-instrument choice False n/a two-way n/a medium Permanent bug-guard rows in the stdlib CLR-throw allowlist cite one standing tracker that stays open while the file has rows and whose count may only fall. Every allowlist row cites an open issue; permanent guards cite a standing tracker rather than an uncited marker. Consistent with the gap-discovery allowlist convention in CLAUDE.md Testing, which is not one of the listed law IDs. +R-MD library exceptions derivable FS False matches one-way 2 runtime-error medium oserror,ioerror,exception-hierarchy Core defines one OSError deriving from IOException, with FileNotFoundError, FileExistsError, IsADirectoryError and PermissionError deriving from it, and IOError an alias of OSError. A1: Sharpy exceptions no longer bridge to the matching .NET exception types, so .NET catch sites stop seeing them.; CR7: The spec's per-class .NET bridge was rejected and the spec rewritten rather than the implementation conforming. FS compares exception hierarchy (except OSError must catch subclasses). +R-ME process choice False n/a two-way 3 n/a high The whole-build up-to-date check lands first, then the module-discovery cost cuts as their own group. +R-MF process choice False n/a unstated n/a medium The walrus's role in Sharpy is reconsidered alongside the let/var and global/nonlocal binding work, not in the IR port; it is not a verdict on any cell. A construct's semantics are reconsidered with the feature family that owns them, not in an unrelated refactor. Also notes let is a keyword and var is not, framed as an open design question. +R-MG language scope-binding derivable N1,T2 True matches two-way a refuse high nested-class,class-body,closure,comprehension A nested type's bare name denotes the type wherever class-body names are visible; in methods, nested functions, lambdas or comprehension elements a bare read is refused unless an outer binding exists; spell it C.N(). Python raises NameError at run time where Sharpy refuses at compile time. +R-MH language scope-binding derivable A2 False matches one-way b admit medium walrus,comprehension,parameter,local A comprehension's walrus over a local or parameter of the same function writes through to that binding as Python does. R-MJ: Narrows R-MJ's refusal, which stays for module and enclosing outers. Rejected refusal cost a working program agreeing with python; A2 twin evidence decides. +R-MI language scope-binding choice False deviates two-way b refuse medium global,for-target,with-target,except-target Under global x, for, with and except targets naming x are refused with the steer to assign inside the loop body instead. When one member of a construct family cannot match Python, the whole family is refused with one steer rather than given split verdicts. A2: Python stores through for for/with targets under global, a working twin that is refused. +R-MJ partial:R-MH language scope-binding derivable S2 True deviates two-way A refuse medium walrus,comprehension,module A comprehension's walrus over a visible outer name that is read after it is refused by the S2 rule. R-MH: R-MH admits the same-function case this rule refused. Row's door text: A can be lifted later; B/D change printed values. +R-MK process choice False n/a two-way a n/a high The live charter is extended in place for the new call rather than starting a new round charter. +R-ML language classes-members derivable A1,T2 False deviates two-way a refuse medium constructor,super,init A statement ahead of self.__init__(...) or super().__init__() in a constructor is refused with one diagnostic steering the user to move the call first. A C# hard constraint surfaces as a named Sharpy refusal with a steer, not as an emulating lowering. C# constructor initializers must precede the body; Python allows statements first. +R-MM process precedent R-LL False n/a two-way a n/a medium Constructor-initializer totality becomes a new full-tier compiler-lane group after the IR port's third tranche, ahead of name resolution. Row cites 'the P85 precedent' (R-LL) without the ruling ID. +R-MN language numeric precedent R-HV,R-IB True matches unstated a admit high float-literal,unary-minus The real-literal fit check unwraps a unary sign as the integer check does, so a signed float literal that was refused now compiles. +R-MO library numeric derivable CR7,FS False matches unstated a runtime-error high true-division,power,zero-division True division and a zero base raised to a negative power raise ZeroDivisionError with Python's messages, routed through Builtins helpers as floor division is. Rejected option was placement only; spec states raise. +R-MP process choice False n/a two-way a n/a medium A new light group makes the parser accept what the spec states, with a parse-verdict roster, absorbing a related issue as a cell. Behavioural content (parser follows spec) is CR7; the ruled choice is placement. +R-MQ language patterns derivable SPEC:match_statement.md,CR7 True no-twin two-way a spelling high match,guard,or-pattern A per-alternative guard in an or-pattern must be parenthesised as (p if g); the contradicting example is rewritten and the parser is unchanged. Door inferred from 'additive later'. +R-MR language patterns derivable CR7 True no-twin one-way a admit medium named-tuple,tuple-pattern,match Named-field tuple patterns like case (x=0.0, y=0.0): are implemented, binding by field name and lowered to positional ValueTuple matching. Owner called the rejected 'mark planned' option legitimate, so CR7 may not strictly decide. +R-MS language other derivable AP,A3 True deviates two-way a spelling high partial-application,functools functools.partial is not provided; docs mark it superseded by _ partial application. +R-MT language classes-members choice False no-twin one-way a admit medium dataclass,copy Dataclasses get a synthesized copy(**changes) member with one keyword-only optional parameter per field. A documented feature is implemented rather than having the documents that describe it rewritten away. Python's twin is dataclasses.replace, a different spelling. +R-MU language classes-members precedent B6 True deviates unstated a refuse medium field,let,var,class-body Keywordless inferred class fields stay unsupported; the spec sentence gets a pending marker and is rewritten to let/var/const spellings by the bindings plan. B1/B6 are earlier design decisions, not R-numbered rulings. +R-MV language other derivable SPEC:function_parameters.md,CR7 True no-twin two-way a runtime-value high overload,default-parameter Overload resolution prefers the candidate with no defaulted parameters, as the spec states, instead of reporting ambiguity. +R-MW language other choice False no-twin two-way a admit medium pipe,constructor Constructor piping is allowed: x |> C(args) means C(x, args), and the spec limitation is removed. Any callee kind a call accepts is accepted by the pipe operator; no callee is special-cased. CR7: The spec's stated limitation is removed instead of the implementation conforming to it. +R-MX implementation choice False n/a two-way a n/a high The IR port's done-when covers type, symbol, layout or diagnostic facts; module layouts stay layout facts; the third tranche splits the type half of operator and type-test lowerings. +R-MY test-instrument choice False n/a two-way a n/a medium The cell budget and refusal-rate ceilings are derived from the fixture corpus so no single fixture moves them, with a planted spike as the mutation test. Instrument thresholds are derived from the corpus, never re-pinned per fixture. Mutation requirement follows VC2. +R-MZ test-instrument derivable CR6,R-LZ True n/a two-way a n/a high The CPython oracle moves from 3.14 to 3.15 now that 3.15.1 has shipped, and each resulting stdout difference becomes a cell, never a snapshot update. Precedent R-LZ cited; CR6 now states it. +R-NA process choice False n/a two-way a n/a high A band chore deletes a dead source file and moves old stdlib batch plans under the process plans directory; an unnamed isalnum cell is dropped. Resolves chores left open by R-MA. +R-NB test-instrument choice False n/a two-way a n/a medium Three silent-wrong walrus-in-dict-spread-comprehension rows stay allowlisted until the S2 refusal lands, rather than landing that refusal before the mainline merge. A known silent-wrong cell may wait on its class fix when a sibling already carries the same missing refusal. T1: Ships known silently wrong values to mainline pending the fix. +R-NC library io-os derivable FS,R-CM True deviates two-way a deviation-row medium requests,result,deviation requests' files= keeps path strings and returns Err(RequestException), recorded as a deviation row. FS: unlisted surface is DEVIATION; choice among a/b/c is partly design. +R-ND library io-os choice False matches one-way a admit medium open,archive,file-mode open and the archive openers accept every mode Python accepts, delivered as a new two-phase group. A Python-surface API accepts the full Python argument domain rather than a subset with a recorded deviation. AP: Leans toward adding surface because Python has it. +R-NE process choice False n/a two-way a n/a high The ConnectionError exception family waits for the namespace-layout group; TimeoutError and EnvironmentError go to the builtin-exceptions group, subject to its own decision on which names Core declares. Placement only; depends on R-NN. +R-NF language exceptions choice False matches one-way a runtime-error medium sys-exit,systemexit,except,entry-point sys.exit raises SystemExit; the generated entry point catches it and returns its code as the process exit code; a bare except Exception still catching it remains a recorded deviation. Move toward Python's run-time behaviour where it needs no spec rewrite; a remaining gap that would need one stays a recorded deviation. SPEC:exceptions: The spec's 'No BaseException' section is why except Exception still catches SystemExit, kept as a deviation. Main effect matches Python (print runs, code returned); except Exception catching SystemExit deviates. Option (b) rejected partly to avoid rewriting the spec. +R-NG library io-os derivable AP False matches one-way a runtime-value medium encoding,open,path,xml,requests open, Path, xml and requests all resolve encoding names through one shared codec resolver; .NET-only aliases are lost at the xml and requests seams, and two cells are deviation rows. AP 'one way to do the same thing' picks one resolver over per-seam switches. Row says one-way for the lost aliases; deviation cells cite R-CI and Axiom 1. +R-NH library numeric exception FS False deviates two-way a deviation-row medium decimal,zerodivisionerror,invalidoperation Decimal zero divided by zero raises ZeroDivisionError, recorded as a deviation row, instead of adding decimal.InvalidOperation for the undefined case. A missing Python exception subclass is a recorded deviation rather than a new type when the raised base type still catches it. FS: FS marks exception TYPE as COMPARED with divergences going to an issue, but this records a deviation row instead. Not acknowledged as a departure from FS. CPython raises DivisionUndefined (subclass of both InvalidOperation and ZeroDivisionError), so except ZeroDivisionError behaves the same. +R-NI cli-lsp choice False n/a two-way A1 n/a high target-framework,net11 Compiler tools multi-target net10.0 and net11.0, compiled programs keep defaulting to net10.0, emission is unchanged, and a light group first measures the work and gain of a net11/C# 15 migration. Move the runtime target of compiled programs only after a measured smoke of its cost and gain; tooling may multi-target ahead. Door two-way stated for A1 only. Option given as A(1), B, C. +R-NJ process choice False n/a unstated a n/a high One band chore audits every Stdlib module that has a CPython namesake and completes the third-party notices file; the pre-tag deadline is dropped because the release already exists. Licensing/notice completeness; SPDX id decided by R-NO. +R-NK test-instrument choice False n/a two-way a n/a high The procedure-bytes scorecard key also counts the verification contract and the process README, with the baseline raised once by their size. +R-NL process choice False n/a two-way b n/a medium A new issue is filed as the Format Selection refused-work tracker, sweep allowlist rows re-cite it, and the old issue closes once its ceilings-from-corpus ask is confirmed landed. Could be read as VC10 (file by class), but VC10 does not pick filing a new tracker over retitling the old one. +R-NM process derivable VC12 False n/a unstated a n/a high The exception-group handler group is promoted to the full tier under criterion (c) because its remaining seam is in lowering; tiers move only upward. VC12 (c) makes a Lowering seam full; '(c)' in the row is VC12's criterion letter but VC12 is not named, so law_cited false. +R-NN library exceptions derivable AP False deviates one-way b deviation-row medium exception-class,builtins,core Core declares a Python builtin exception name only where a Core or Stdlib site raises it or an existing type derives from it; one deviation row records all other names as ruled absences. A Python builtin name enters Core only when a Core/Stdlib site uses it; the rest are recorded absences. AP 'no add X because Python has it' rules out (a); (c) none would drop names in use. Each added name reserves the spelling (SPY0212). +R-NO cli-lsp choice False n/a two-way n/a high license,packaging Packages carrying CPython-derived code (Core, Stdlib, Cli) declare the SPDX licence Python-2.0, the full CPython licence stack the notices reproduce, not the narrower id used before. Licence metadata names the exact upstream licence stack whose text the shipped notices reproduce. Two-way until each release. +R-NP implementation choice False n/a unstated n/a high operator-lowering The operator-lowering table stays a table in tranche 3, read by the lowering pass and const eligibility; deriving the kinds in the pass and deleting the table waits for tranche 4. Transport an existing structure intact first; redesign it in a later tranche. Also a scheduling decision. +R-NQ process derivable VC11 False n/a unstated n/a medium The array-bridge conversion and sequence-materialization table leave tranche 3 for tranche 4 because they need their own generator over position, route and conversion. VC11: a 3-axis matrix needs a generator first; deferring is the consequence. +R-NR library exceptions choice False matches one-way runtime-value high socket,errno socket.error.errno is the platform's native error code, compared with Python where .NET's SocketError round trip is exact; all other cases are one recorded deviation row; the fidelity table gains the row. Promote a surface to COMPARED where .NET reproduces Python's value exactly; record the rest as one deviation row. Promotion of an unlisted surface under FS's procedure (R-CM); FS permits but does not decide promotion. +R-NS library exceptions derivable T1,FS False matches unstated runtime-value medium socket,errno,gaierror,timeout Socket bad-type/protocol errors keep .NET codes as a deviation since mapping would corrupt genuine ones; errno is int or None, None on timeout; an unknown host raises gaierror with -2. Never remap an error code when the mapping would rewrite genuine occurrences of the target code. E2/E3 match Python (FS: exception type compared); E1 deviates, decided by T1 (no silently wrong value). +R-NT process choice False n/a unstated n/a high The membership group runs ahead of the charter queue in its own lane with tier full, criteria (b) and (c). Queue jump is a choice; the tier itself follows VC12 (b),(c). +R-NU language typing-conversion derivable SPEC:conversion_operators.md,A3 False deviates two-way refuse medium in,range,bytes,bool,decimal bool and decimal needles tested for membership in range or bytes stay refused at compile time, because no implicit conversion to int exists; the deviation row is reworded. R-NW: bytes accepts an int needle while a bool needle (an int in Python) is refused. Row names 'the implicit-conversion rule' but not the spec file. +R-NV language nullability-narrowing choice False deviates unstated refuse medium in,optional,none-literal,str,bytes A T | None membership needle is accepted and answers False when None; a literal None needle is accepted only where the element type is optional and refused elsewhere, including str and bytes. A literal None compared against something that statically cannot hold None is a compile error; a possibly-None value is accepted. R-NX: Here a None needle answers False, while for IPv4Network/IPv6Network/EmailMessage a None needle raises AttributeError.; R-OS: R-OS later makes a None needle into a plain value-type Contains parameter raise TypeError rather than answer False. Supersedes earlier same-day unnumbered answers. Python gives False for None in a list and TypeError for str; refusing a literal follows A3/T2 in spirit. +R-NW library operators derivable A2 False matches unstated admit medium in,bytes A bytes container accepts a bytes needle (subsequence test) and an int needle (single byte) for membership; the spec row is amended. CR7: The spec row is amended to fit the ruling rather than the implementation to the spec.; R-NU: int needle admitted while bool needle refused. Python's twin decides; no A1 conflict. +R-NX library nullability-narrowing derivable FS False matches unstated runtime-error medium in,ipaddress,email,none A None needle tested for membership in IPv4Network, IPv6Network or EmailMessage raises AttributeError as CPython does; separately, the scorecard allowlist-rows baseline is set to 546. R-NV: Built-in containers answer False for a None needle; these Stdlib types raise. Second half (baseline 546) is a test-instrument decision. FS compares exception types for Stdlib. +R-NY partial:R-OQ language typing-conversion derivable A1,CR11 False no-twin unstated emission medium enum,optional,value-type Enums are treated as value types throughout the compiler, not only at membership checks, which moves the emitted nullable shape of Enum | None; a third plan-verification pass is allowed. Row says 'one-way in effect'. CR11 (fix the class) picks compiler-wide over membership-only; A1 says enums are CLR value types. Placement superseded by R-OQ; work confirmed by R-OU. +R-NZ language operators derivable A2 False matches unstated admit medium in,iter,dunder,class A user class defining __iter__ but not __contains__ answers in / not in by iterating; a class with neither stays refused. R-OA: The analogous Python fallback via __len__ + __getitem__ is refused. Rejected keeping the refusal with a deviation row. +R-OA language operators choice False deviates two-way refuse medium in,getitem,len,dunder,class A class with only __len__ and __getitem__ stays refused for in / not in, with a deviation row explaining the index need not be an integer nor dense. A Python fallback protocol is admitted only when the declared dunders statically guarantee its contract; legacy implicit protocols stay refused. R-NZ: The __iter__ fallback is admitted as CPython does, this one is not.; A2: Python has a twin here and would run the program. +R-OB language nullability-narrowing derivable A2 False matches one-way a runtime-value medium optional,t-or-none,truthiness,bool A T | None is falsy when None or when its payload is falsy, in every truth-testing position and in bool(x), as in Python; T? stays truthy exactly when it is Some. CR7: Rejects the spec's existing null-check rule; the spec is rewritten to the ruling. Python twin decides for T | None; T? has no twin. +R-OC partial:R-OP language nullability-narrowing choice False matches two-way a′ runtime-error medium optional,t-or-none,ordering,in Container-side operations with a T | None operand stay allowed and a None raises Python's TypeError; ordering on a T | None, first refused, is now allowed with a warning per the later nullability principle. A possibly-None operand into an operation Python accepts stays legal and fails like Python at run time. R-OP: R-OP replaced the compile-time refusal of ordering with a warning plus run-time TypeError.; T2: Keeping run-time TypeError over a compile-time refusal pulls against T2. +R-OD library nullability-narrowing derivable A2 False matches two-way a admit medium hash,none,t-or-none hash(x) accepts a None value instead of raising TypeError. Python hashes None; consistent with R-OP's 'dict keys always allowed'. +R-OE process derivable VC1,VC11 False n/a two-way a n/a medium The three membership-related issues form one group directly after the membership group, built on its generator, rather than being scattered across three groups. +R-OF process choice False n/a two-way a n/a high The issue goes first in its group and that group moves to the head of the Core lane, rather than a band fix for five routes. +R-OG process choice False n/a two-way a n/a high The compiler lane order is fixed as a specific sequence of six groups, with tranche 4 of the operator group before the next group. +R-OH language numeric choice False no-twin two-way a admit medium augmented-assignment,float32,decimal,literal,power A float32 variable accepts **= with a float literal, as its other augmented operators do; a decimal variable with **= 2.0 is refused at compile time. Members of one operator family treat a literal operand the same way on a given type. float32 has no Python twin; Decimal ** float is a TypeError in Python, so the decimal refusal moves it to compile time. +R-OI process derivable VC10 False n/a two-way a n/a low The socket cells get their own tracker and light group; remaining errno cells and constant values stay deviation rows; import errno and exception args/strerror go to other named groups. VC10 (file by class) supports a separate tracker but does not clearly decide. +R-OJ process derivable VC1,VC10 False n/a two-way a n/a medium The scorecard issue splits by class: the Markdown-reading checks become their own tracker and group with one CommonMark reader; three cells go to the band; the rest stay. +R-OK process derivable VC1,VC10 False n/a two-way a n/a medium A conditional expression against a generic-parameter slot is one class; the existing issue is retitled and stays in its group instead of opening a second tracker. +R-OL process derivable VC11 False n/a two-way n/a low Conditional-expression and fresh-walrus needles are outside the membership plan's contract and are tracked under the nullability group; a fourth plan-verification pass is allowed. VC12: Repeated extra verify-plan passes sit uneasily with VC12's convergence rule. VC11 one group per plan favours not widening the plan. +R-OM language operators choice False matches one-way runtime-value medium is,enum,identity is / is not with an operand statically typed as an enum compares by member, like CPython singletons; members of two different enum types are never identical; other cases are a deviation row. Enum members are identities: is on enums compares by member even though the CLR representation is a boxed value type. R-OX: R-OX makes is identity only and value-type operands always False; enums are its one ruled exception.; A1: Under A1 boxed value types are never reference-equal. Could be argued as RR (zero-cost compile-time rewrite reconciling A1 and A2), but RR's listed mechanisms don't clearly cover it. Landed as a no-plan lane. +R-ON partial:R-QG language operators derivable A2 False matches unstated runtime-value medium equality,enum,int-enum == between members of two different int-backed enum types answers False and != answers True, both operands evaluated once, rather than a compile-time refusal. R-OW: R-OW treats int-backed enums as IntEnum for ordering, under which cross-type == would compare by value.; R-QG: Amended for string-backed enums to compare by value. Matches plain Enum, not IntEnum. +R-OO partial:R-OQ language typing-conversion precedent R-NY True no-twin unstated emission high struct,generics,type-parameter,self,value-type Value-ness agrees with the emitted C# type for constructed generic structs, struct-constrained type parameters and Self in a struct, at every reader, as already ruled for enums; a fifth verification pass is allowed. Placement moved by R-OQ; confirmed by R-OU. +R-OP language nullability-narrowing choice False matches one-way runtime-error medium optional,t-or-none,none,truthiness,warning T never holds None; T | None is loose (behaves as T, warns where None fails, fails as CPython, never NRE); T? is strict (Some/None() only, refused until narrowed, x == None steered to is None). Python's union spelling is loose and fails as CPython at run time with warnings; Sharpy's own Optional spelling is strict and refused until narrowed. T2: Loose T | None prefers warnings plus run-time TypeError over compile-time errors.; A3: A3 says None requires opt-in via T?, while T | None is a second, looser opt-in.; AP: Two nullable spellings with different strictness risks 'multiple ways to do the same thing'.; R-OC: Supersedes R-OC's compile-time refusal of ordering. Foundational; T3 (correct programs keep running) supports the loose half. Rewrites nullable_types.md and logical_operators.md. +R-OQ process derivable VC11 False n/a unstated n/a medium The membership plan keeps only membership work; the value-ness work moves to the nullability tracker under its principle, and generator cells needing it stay known-red citing that tracker. R-NY: Supersedes R-NY's placement.; R-OO: Supersedes R-OO's placement. +R-OR process choice False n/a unstated n/a medium A sixth plan-verification pass is allowed after the plan split discarded the fifth pass's converged verdict. VC12: VC12 says the verify loop ends on a decision, yet passes kept being granted. +R-OS language nullability-narrowing precedent R-OP False deviates unstated runtime-error medium in,contains,t-or-none,value-type,boundary A None needle passed to an opaque __contains__ or CLR Contains whose parameter is a plain value type raises TypeError at that boundary, as for any T | None flowing into a plain T, landed with the general boundary work. R-NV: R-NV answered False for a T | None needle; this raises for opaque value-type receivers. Row quotes the nullability principle verbatim without naming R-OP. +R-OT process precedent R-LK,VC1 True n/a two-way a n/a high The nullability work is one group, re-chartered as 'every cell of the nullability ledger matches its target', in four tranches each with its own plan and gate. +R-OU language nullability-narrowing precedent R-OP,R-NY False no-twin one-way a runtime-error medium enum,struct,type-parameter,value-type,t-or-none Value-ness matches the emitted C# type compiler-wide, and the checker stays loose on such operands: programs that run today keep running, gain a warning and raise TypeError on None. T2: Rejects the compile-time refusals the plan proposed in favour of run-time TypeError. T3 also supports keeping today's running programs. +R-OV diagnostic nullability-narrowing choice False n/a one-way a n/a high warning,t-or-none,diagnostic-code Two new default-on warning codes: one for an operation on T | None that fails on None, one for a T | None flowing into a plain T where the compiler inserts a check. Each distinct failure mechanism gets its own suppressible code; existing codes are not reused for a new meaning. Codes from the 0710-0799 range. +R-OW language operators derivable T3,A1,T2 False deviates unstated a deviation-row medium ordering,enum,int-enum Ordering within one int-backed enum type keeps .NET order, as IntEnum, recorded as a deviation; ordering across two enum types is refused at compile time. R-ON: Cross-type == on int-backed enums follows plain Enum (False), while ordering follows IntEnum. Row notes (a) records the status quo (T3); cross-type refusal turns Python's TypeError into a compile error (T2). +R-OX language operators choice False deviates unstated a refuse medium is,identity,isinstance,value-type x is not is refused with the existing type-test code steering to not isinstance; is / is not are identity only, never a type test or __eq__; value-type operands are always False with a warning. An operator keeps one meaning; a likely misuse is refused with a steer, reusing the existing code for the same mistake. R-OM: Enums compare by member under is, the one acknowledged exception. Enum exception confirmed by owner. +R-OY language operators choice False deviates one-way refuse medium comparison-chain,eq,class Each link of a comparison chain has exactly its binary twin's outcome: value, refusal code or internal error; a chain over a class without __eq__ is refused wherever the binary comparison is. A desugared form inherits its primitive's outcome exactly (value, refusal code, internal error); no form-specific refusal or exemption. T3: Chains that ran and printed a value are now refused.; R-PI: Depends on the refusal of == without __eq__, which Python answers by identity. Close in spirit to N7 (spelling never changes the verdict) and T4, but neither speaks of operator desugarings. +R-OZ test-instrument choice False n/a two-way n/a medium allowlist,generator A stage-0 allowlist row is one fact and one cause; a bulk row is valid only while its cells share both; extending a generator extends its allowlist file; a compiler-crashing form is a known-red row, not an exclusion. Every known failure is a counted, cited row with one fact and one cause; nothing failing is excluded from a generator. Refines VC11's allowlist mechanics; VC11 does not fix row granularity, so the owner picked. +R-PA test-instrument choice False n/a two-way n/a medium generator,comparison-chain,membership The membership generator draws its axes from compiler enumerations by reflection, crosses blocks pairwise with operand forms and hoist kinds, and rules out the full cube and chains longer than three links by cost. Generator axes are images of compiler enumerations; combinatorial cost is cut by pairwise crossing, never by hand-picked cells. The reflection-sourced axes are VC11-derivable; the pairwise cut and length bound are the owner's choice. +R-PB process derivable VC11 False n/a unstated n/a high The stage-0 allowlist baseline was raised step by step to the count one-row-per-fact-and-cause gives at each tip, without registering the allowlist as a seed harness. VC11 prescribes raising allowlist_rows_outside_seed with the owner's word; seed registration is owner-ruled and was declined. +R-PC process choice False n/a unstated n/a medium The membership generator's CI cost is accepted; extra compiler shards and a 40-minute PR shard limit are added in separate changes rather than cutting the generated facts. Coverage the contract requires is kept; CI capacity is raised to carry it, never coverage cut to fit CI. +R-PD language typing-conversion precedent R-OY False matches unstated runtime-value medium comparison-chain,membership A chain middle operand that is also an in-needle is typed as its left link's binary comparison types it and cast to the in-slot only where the in-link reads it. Fixes a wrong False versus CPython True; also moves 28 cells' refusal code to the twin's code. +R-PE language typing-conversion precedent R-OY False matches unstated admit medium comparison-chain,membership,literal A constant middle needle in a chain is admitted by its value where it fits the in-slot, as the standalone membership test is, and always cast at the in-read; out-of-range constants are refused. Follows the chain-link-equals-binary-twin rule; the row cites the standalone form, not R-OY. +R-PF language nullability-narrowing precedent R-OY False matches unstated A runtime-value medium comparison-chain,optional,narrowing In a comparison chain each link reads a shared operand as its binary twin would: is-None links read it un-narrowed, others narrowed; it is evaluated once, typed by its first reader, converted at later reads. Option letter is A of A/B/C; rejected a deviation row and a refusal. +R-PG process choice False n/a two-way a n/a high The one-decider, class-own-__iter__ clause is split out of its group into a new group with a fixed issue order. +R-PH R-PM process choice False n/a two-way a n/a high The membership/nullability lane was ordered as three groups in sequence. R-PM: R-PM supersedes the lane's position, keeping only relative order. +R-PI language operators choice False deviates two-way a refuse medium eq,class,struct,function == and != on a type declaring no __eq__ stay refused, with one rule and one code for every spelling, wrapper and site, plus a deviations row and spec line. Absent a declared equality, comparison is refused rather than defaulting to identity; the refusal is uniform across spellings and kept relaxable. R-PL: R-PL adopts identity-before-__eq__ semantics for containers, while plain == never falls back to identity.; RR: Reference identity is a zero-cost .NET default that could reconcile A1 and A2, yet the refusal was chosen. T2/T4 are compatible but do not decide refusal versus identity; row flags a caveat that may bring option c back. +R-PJ language typing-conversion choice False no-twin two-way a refuse medium sequence-repetition,int,sized-int A sequence-repetition count is an int slot: widths implicitly widening to int are accepted; other widths are refused with an int(n) steer. Builtin operand slots are statically typed: implicit widening is accepted, narrowing needs an explicit conversion, never a checked run-time conversion. T2 rules out the checked-conversion option; (a) versus refusing all non-int is the owner's pick. +R-PK language operators choice False matches two-way a refuse medium enum,string-enum,ordering Ordering comparisons on a string-backed enum are refused in Semantic, as CPython's plain Enum does; int-backed enums keep value ordering. Where Python's twin is ambiguous, choose the refusal that can later be relaxed over a one-way runtime ordering. R-QG: R-QG treats string-backed enums as StrEnum for ==, while this ruling treats them as plain Enum for ordering.; R-OW: Int-backed enums order by value, string-backed do not. +R-PL library operators choice False matches one-way a runtime-value medium membership,list,eq,container-equality Container search and container equality check identity before __eq__ for reference-type elements, as CPython documents; value types keep Equals; NaN-by-identity is a deviations row. Where CPython documents a semantics observable through user __eq__, Sharpy matches it for reference types; value types keep .NET Equals. R-PI: Identity semantics are adopted in containers while == without __eq__ is refused rather than identity-based. A promotion to COMPARED under FS; FS requires a ruling for promotion but does not decide it. +R-PM process choice False n/a two-way n/a high The next arc is: values ready before use, order-free name resolution, global/nonlocal, then let/var/const bindings; the membership/nullability lane follows later in its prior relative order. User-facing language features outrank deeper correctness digs in scheduling, subject to dependency order. R-PH: Supersedes R-PH's placement of the membership lane next. Dependency (N3 before N1 forward reads) fixed P77 ahead of P78. +R-PN test-instrument derivable VC11 False n/a unstated n/a high generator,allowlist The initialization group's stage 0 is a new generated test type with its own allowlist, and the outside-seed allowlist baseline rises by the measured red count. VC11 describes exactly this; seed registration and other pool options not approved. +R-PO process derivable N1 True n/a unstated n/a medium Harness rows failing because a later module variable is invisible are re-cited to the order-free name-resolution issue; the initialization group does not take N1 for module variables. N1's text names the issue that implements it. +R-PP language initialization derivable N3 False matches unstated runtime-error medium module,initializer,exception An initializer that throws during the load sweep ends the program before main with the original exception, never TypeInitializationException; retry remains observable only on lazy hosts. N3 runs initializers at load before main and retries on next read; the original-exception choice follows CV's Python exceptions. +R-PQ process choice False n/a unstated n/a high The no-initializer cell is moved out of the initialization group to another issue unruled, and the group's issue closes on its own criteria. The cell was later ruled by R-QI. +R-PR process choice False n/a unstated n/a medium A plan may depart from the charter's prescribed emission where a refuted cell requires it, provided ruled behaviour stays fixed and each departure is named in the plan. Rulings bind observable behaviour, not emission shape; a plan may reshape implementation if each departure is named. +R-PS language initialization derivable N3,T2 False no-twin unstated refuse medium initializer,cycle,const Whether an initialization cycle is visible at compile time is decided by a total map classifying each expression child position as conditional or unconditional, so non-const visible cycles are compile errors too. Rejected option made non-const visible cycles run-time NameErrors, against N3 and T2; the roster/totality mechanism echoes VC11. +R-PT language classes-members derivable A1,T4 False no-twin two-way refuse medium ref-out-in,property,static-member,module A property passed as a ref, out or in operand is refused at the checker in every host, whether or not it has a default. C# refuses properties as by-reference arguments; door read from 'Relaxable'. +R-PU process choice False n/a unstated n/a high The initialization group's benchmark acceptance records every ratio in the pull request and blocks nothing; the owner judges cost at review. Performance cost is reported and judged by the owner, not enforced by an automatic threshold. +R-PV language initialization choice False no-twin unstated runtime-value medium ref-out-in,module-variable,static-member An out operand naming a module or static value is a temporary stored on return before the value's initializer runs, and the storage itself once ready; the arm follows the value's state, not its host. Readiness-dependent behaviour is keyed on the value's state, never its host; residual differences are accepted and named in the spec. T3: Four programs change their output as accepted residue. +R-PW language initialization derivable N3,T1 False matches unstated runtime-value medium module-variable,static-member,initializer A store to a module or static value before its initializer is kept and visible, and the initializer still runs at its declared position and replaces it; an initializer is never skipped. R-PY: Across classes, the class-as-a-unit sweep governs instead of declaration order.; T4: Module values and class values follow different sweep rules. T1 forbids a skipped initializer; N3's top-to-bottom load picks declaration order over initialize-before-first-use. +R-PX language initialization derivable A1 False no-twin unstated runtime-value medium generic,static-member,initializer A closed generic type runs all its initializers in declaration order on its first use, wherever that use is; a cross-type read-back NameError is accepted residue. A1 names generic instantiation and type initialization as inherited CLR behaviour. +R-PY language initialization derivable A1,T4 False no-twin unstated runtime-value medium class,static-member,module-variable,initializer Every class sweeps all its static values in declaration order when first touched or when the module sweep reaches it, whichever comes first; module values keep declaration-order sweep with on-demand forward reads. R-PW: Declaration order with replacement governs module values but not cross-class order.; R-QA: R-QA departs from C# touch-order results this ruling otherwise inherits. Owner chose 'C# order'; A1 now states this default. +R-PZ language initialization derivable A1,N3,T1 True matches unstated runtime-error high initializer,module-variable,static-member,cycle N3's emission does what C# does unless N3 forbids it: a self-store inside an initializer is visible then replaced; a self-read before any store is a cycle, NameError or SPY0278, never a default. Inherit C# run-time behaviour unless N3 forbids it; silent default values are never acceptable. This ruling is the source of A1's run-time-default text; judged against the law as written today. +R-QA language initialization derivable T1,N3 False no-twin unstated runtime-error high class,static-member,cycle,initializer Two classes whose initializers read each other's values raise NameError whichever is touched first, including touch orders that print correct values today. T3: Programs that print correct values today now raise; the row names this departure.; R-PY: Departs from the C# class-initialization order R-PY inherits. T1 forbids a value depending on which initializer ran first; A1 lets N3 override C#. Departure from C# acknowledged. +R-QB language initialization derivable N3,T2 False no-twin unstated refuse medium cycle,module-variable,const A ring of non-const values is a compile error unless a same-module store names one of its values; a ring kept alive only by another module's store is refused, a recorded false refusal. A rare false refusal is accepted to keep cycles compile-time errors. T3: A correct program kept alive by a cross-module store is falsely refused. +R-QC process exception VC12 False n/a unstated n/a medium One plan received three extra verify-plan passes beyond the standing two, each after a narrow revision; the standing two-pass rule holds for every other plan. A one-off extension of a process limit is spent, never precedent. R-LW: Exceeds R-LW's two-pass limit for this plan. VC12's convergence says the loop ends on a decision; row acknowledges the departure as spent. Exception is against R-LW precedent as much as VC12. +R-QD process derivable VC11 False n/a unstated n/a high The outside-seed allowlist baseline was set to the measured red count at each stage-0 commit of the initialization group, without seed registration. +R-QE language scope-binding derivable N2,T1 True deviates unstated refuse high class,const,static-member A class-body initializer's bare read of a later non-compile-time const of its own type, while an outer binding holds the name, stays a compile error until N2's own code replaces it. Supersedes a lead ruling that let such cells run behind allowlisted rows. +R-QF implementation precedent R-LK True n/a unstated n/a high The membership needle side table moves onto an IR node and its pin returns; the side-table field-count pin is raised only on the owner's quoted word. A ratchet pin rises only on the owner's quoted word; an exception granted once is not precedent. Also consistent with CR2's materialization guard. +R-QG language operators choice False matches one-way runtime-value medium enum,string-enum,eq,is == between two different string-backed enum types compares by value as StrEnum does; is and is not never run a user __eq__. Enum equality follows the Python enum flavour whose backing matches; identity operators never dispatch to user code. R-PK: R-PK refuses ordering on string-backed enums as plain Enum, while this treats them as StrEnum for equality.; R-ON: Amends R-ON, which stands only for int-backed enums. +R-QH test-instrument choice False n/a unstated n/a high ci,sweep The name-resolution sweep's hang timeout and job limit were raised for the initialization group, then the sweep is to be sharded and both limits restored. Raise CI limits to admit necessary coverage, then shard to win them back. Same pattern as R-PC. +R-QI language initialization derivable A3,T1,T2 False deviates two-way a refuse high module-variable,static-member,initializer A module-level or static declaration with no initializer is refused in Semantic with a steer to an explicit zero or None initializer. A3 requires initialization at declaration; T2 beats the NameError option; door read from 'relaxable to (b)'. +R-QJ language typing-conversion derivable N4 True no-twin unstated c admit medium ref-out-in,const,literal An in modifier at a call site on a literal or other non-name expression is refused; on any const it runs, with the keyword dropped for a compile-time constant. N4 rules out treating literal and computed consts differently; admitting literals is rejected by analogy with ref. Outcome mixes admit and refuse. +R-QK language classes-members derivable A1,T1 False no-twin unstated a refuse medium struct,property,method A member store into a struct-typed property value is refused in Semantic; a method call on it keeps C#'s copy semantics, documented in the struct spec. C# refuses the same store (CS1612); copy-in/copy-out rejected as a one-way runtime change. +R-QL language evaluation-order exception A1 False matches one-way a runtime-value low assignment,subscript,attribute An assignment evaluates its value before its target's subexpressions, as CPython does, hoisting the value only where the target has effects. Evaluation order observable through side effects follows Python where a cheap hoist reconciles it, rather than inheriting C#'s order. A1: C# evaluates target subexpressions first; the row does not name this as an A1 departure.; FS: Evaluation order is an unlisted surface, DEVIATION by default; this acts as a promotion. RR's zero-cost bridge may cover it, making it derivable; the row does not argue either way. +R-QM language classes-members choice False no-twin two-way a refuse medium property,observer,backing-field An observer property's storage is opaque: its underscore-prefixed backing name is refused in every position; the mixed form keeps its documented backing name. Compiler-synthesized storage is not nameable from user code unless documented; start with the relaxable refusal. Door read from 'relaxable to (b)'. +R-QN process choice False n/a unstated a n/a medium Two cells leave their planned groups now as no-plan lanes, each with a generated test and a mutation record; cells touching Semantic stay put while another group is in flight. Contained fixes ship early as no-plan lanes unless they touch a seam an in-flight group owns. +R-QO process derivable VC12 False n/a unstated a n/a high A new full-tier group is created for observer-property storage, tracker filed, scheduled in the compiler lane after the IR tranche. Tier letters (c, d) are VC12's criteria; the row cites them by letter, not section. +R-QP process exception VC12 False n/a unstated a n/a medium One group is light-tier although the criteria read full, scheduled after the rule table; another is light before the IR tranche; tiers only move upward once planning begins. The owner may set a tier below the criteria at charter time; after planning begins tiers only rise. VC12: VC12 makes a group full when any criterion holds; the row acknowledges the criteria read full (b).; CR13: CR13 says the tier is a charter fact never lowered. Departure acknowledged in the row. +R-QQ test-instrument choice False n/a unstated b n/a high ci The allowlist-issue-state CI job keeps running on mainline unchanged; its red was resolved by retargeting Dependabot to dev. +R-QR language evaluation-order derivable A1 False no-twin unstated a runtime-value medium async,ref-out-in Inside an async def, only out operands, member stores and mutating calls are hoisted; a ref operand evaluates in operand order as in a plain def. CR7: The spec is edited by ruling; the row acknowledges rule 7. Row cites R-PZ's principle, which A1 now codifies; precedent R-PZ would also fit. diff --git a/docs/process/rulings/README.md b/docs/process/rulings/README.md new file mode 100644 index 000000000..99600c236 --- /dev/null +++ b/docs/process/rulings/README.md @@ -0,0 +1,119 @@ +# Ruling records + +An owner ruling is a row of prose in a charter. These files hold the same rulings as data, so a +script can check what prose cannot: that a ruling names its law, that a replaced ruling says so, +that two rulings do not give one case two answers. + +Background: [the 2026-11-21 ruling audit](../../audits/ruling-audit-2026-11-21.md). + +| File | Holds | +|---|---| +| `rulings.yaml` | One record per ruling | +| `laws.yaml` | The written laws (with where their text is) and the audit's draft principles | +| `axes.yaml` | The closed lists a *case* is named from | +| `policy.yaml` | Which decisions an agent may take without the owner. A draft; the owner's to set | +| `known-findings.yaml` | Findings that wait for the owner. A ratchet | + +```bash +python3 build_tools/check_rulings.py # the gate; no compiler needed +python3 build_tools/check_rulings.py --list-known # also print what is waiting +python3 build_tools/ruling_evidence.py recheck # re-run every recorded program (needs sharpyc) +``` + +Both also run as tests under `build_tools/tests/`, so CI runs them. + +## Status + +The 460 records marked `seed:` were written by the audit. Their labels are a language model's +reading of each charter row and the owner has not reviewed them. The charter row stays the +authority for a seed ruling's text. Fifteen cases are filled in, all from conflicts the audit +verified by reading the rows, each with a program that was run. + +The five families in `axes.yaml` are hand-listed. Issues #2486, #2487 and #2733 are where the +lists get derived from the compiler; replace these with theirs as they land. + +## Adding a ruling + +A record without `seed:` must provide all of this, and the check fails if it does not: + +```yaml +- id: R-QS + date: 2026-11-22 + issue: "#2800" + kind: language # language | library | diagnostic | implementation | cli-lsp | test-instrument | process + rule: A walrus onto an existing let is a compile error. + options: # at least two; exactly one chosen, exactly one recommended + - {text: refuse, chosen: true, recommended: true} + - {text: rebind, as today} + basis: follows # follows | precedent | exception | new-law | choice + laws: [R-GV] # what it rests on: law ids or ruling ids (not needed for `choice`) + considered: # every other ruling or law with a case in the same family + - {id: R-BK, why: "R-BK is an ordinary local; this target is a let"} + - {id: R-LR, why: "R-LR parked the question; this ruling answers it"} + - {id: R-MH, why: "R-MH is the comprehension position"} + - {id: N5, why: "N5's case is the comprehension position"} + decided_by: owner # owner | agent + door: two-way # must equal what the evidence gives; see below + breaks_running: true + undo_breaks: false + supersedes: [] # the other record must carry the matching superseded_by / amended_by + amends: [R-LR] + cases: # required for language and library rulings + - family: walrus-target + coords: {position: statement, target: let} + verdict: refuse # run | refuse | open + evidence: # paste from: ruling_evidence.py measure prog.spy [--python twin.py] + program: | + def main() -> None: + let x = 1 + if (x := 2) > 0: + print(x) + sharpy: | # what the compiler did when measured + runs:2 + python: no-twin + after: refused:SPY0611 # what the ruling decides it will do +``` + +An observation is `runs:`, `refused:`, `raises:` (followed by whatever was +printed first) or, for python only, `no-twin`. The compiler can also give `crashes:`: an +internal error such as SPY0908, or one of the emitter's own failures in the SPY05xx range. That is a defect to report. It is valid as `sharpy`, and a ruling +can never decide it as `after`. + +Three fields are computed, not chosen. `ruling_evidence.py door --before ... --after ...` prints +them, and the `door` check compares: + +- `breaks_running`: a program that runs today is refused, or prints or raises something else. +- `undo_breaks`: taking the decision back later would break programs written under it. +- `door`: `one-way` when `undo_breaks`, else `two-way`. + +An agent may record a ruling itself (`decided_by: agent`) only for the decision classes +`policy.yaml` marks `true`. Anything else needs `decided_by: owner`. + +## What a failure means + +| Check | Meaning | Cure | +|---|---|---| +| `schema` | A required field is missing or malformed | Provide it | +| `charter-totality` | A charter row has no record | Add the record | +| `law-anchor` | A law's text moved or was reworded | Update `anchor`, or restore the text | +| `reference` | An id, family, axis or value that does not exist | Fix it, or add the value to `axes.yaml` | +| `supersession` | Only one of two rulings records that one replaced the other | Add the other side | +| `charter-mark` | A replaced ruling's charter row does not say so | Strike the row, or name the later ruling on it | +| `exception-in-law` | A ruling departs from a law that does not name it: the law's own section of its source, or a draft's `against` list | Name the ruling there | +| `collision` | Two live rulings give one case two verdicts | Rule; then supersede or amend one | +| `invariance` | A law says an axis does not matter and two cases differ along it | Rule; then change a case, or record `differs_because` with `exception_to` | +| `door` | The stated door is not what the evidence gives | Use the computed values | +| `considered` | A related ruling was not answered | Say why it does not decide this one | +| `owner-required` | An agent took a decision `policy.yaml` reserves | The owner decides | + +A finding that needs the owner goes in `known-findings.yaml` with a reference. Only `charter-mark`, +`exception-in-law`, `collision` and `invariance` findings can wait there; anything else is a +malformed record and is fixed. A collision or invariance row also carries `where`, the case, copied +from the check's output, so one row covers exactly one finding. When it is ruled, change the +records and delete the row; a row whose finding no longer fires fails the check. + +## What this does not check + +Whether a label is right. A `basis: follows` naming a law that does not decide the case passes. +The checks prove a step was done and recorded consistently, and that recorded programs still do +what the record says. The judgement inside a record still needs a reader. diff --git a/docs/process/rulings/axes.yaml b/docs/process/rulings/axes.yaml new file mode 100644 index 000000000..b5bef01fa --- /dev/null +++ b/docs/process/rulings/axes.yaml @@ -0,0 +1,42 @@ +# The closed lists a case is named from. A case is (family, one value per axis) -> verdict. +# Two live cases with the same family and coordinates must agree (check `collision`); a law may say an +# axis must not matter (check `invariance`). Add a value here before using it in a case. +# +# These five families are the ones the 2026-11-21 audit's verified conflicts needed, listed by hand. +# Contract section 11 wants each axis to be the image of a compiler enumeration; #2486, #2487 and #2733 +# are where that is built, and these lists should be replaced by theirs as they land. +families: + enum-operator: + doc: 'An operator applied to members of an enum that has values. `answer` is the python enum class the result + matches: a plain Enum (cross-type == is False, no ordering) or a valued one (IntEnum / StrEnum: compares + and orders by value).' + axes: + backing: [int, string] + operator: [eq, order] + operands: [one-type, two-types] + answers: [plain-enum, valued-enum] + walrus-target: + doc: What `name := value` does, by where it is written and what `name` already is. + axes: + position: [statement, comprehension-element] + target: [new-name, existing-local, let, module, enclosing] + equality-without-eq: + doc: An equality question about two values whose type declares no `__eq__`. + axes: + site: [operator, container-search] + operand: [reference-type, value-type] + wrapper-str: + doc: 'The text of a built-in wrapper value. `answer` is what is printed: the payload alone (`1`) or the constructor + spelling (`Ok(1)`).' + axes: + wrapper: [optional, result, union] + conversion: [str, repr] + answers: [payload, constructor] + spec-silent-acceptance: + doc: The spec does not say whether a program is legal, python3 and Sharpy disagree today, and a ruling picks + one. Two rulings here with the same coordinates are the same question; if they are not, the axis that separates + them is missing and adding it is the ruling. + axes: + spec: [silent] + python: [refuses, runs] + sharpy-before: [refused, runs] diff --git a/docs/process/rulings/known-findings.yaml b/docs/process/rulings/known-findings.yaml new file mode 100644 index 000000000..7331625a9 --- /dev/null +++ b/docs/process/rulings/known-findings.yaml @@ -0,0 +1,112 @@ +# Findings of build_tools/check_rulings.py that wait for the owner or for a text to be brought into line. +# A ratchet: a finding not listed here fails the check, and so does a row whose finding no longer fires. +# Only charter-mark, exception-in-law, collision and invariance findings may wait here; a collision or +# invariance row also carries `where` (the case), as the check prints it. +# When a question is ruled, change the records (or the law, or the charter row) and delete the row. +findings: + - check: charter-mark + subjects: [R-Z, R-OV] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-BI, R-CN] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-BK, R-GV] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-BL, R-GV] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-CN, R-GV] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-DW, R-EH] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-DX, R-ES] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-FR, R-FV] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-LK, R-LV] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-LK, R-MB] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-NY, R-OO] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-NY, R-OQ] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: charter-mark + subjects: [R-PY, R-QA] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.5 + note: >- + An earlier ruling was narrowed by a later one and its charter row does not say so. Cure: name the later ruling on the earlier row. + - check: exception-in-law + subjects: [R-MH, N5] + ref: docs/audits/ruling-audit-2026-11-21.md section 6.3, L1 + note: >- + R-MH overrode N5 for a comprehension walrus over a same-function local; N5, comprehensions.md and walrus_operator.md still say the program is refused. Cure: bring the three texts into line with R-MH, naming it. + - check: collision + subjects: [R-GV, R-LR] + where: walrus-target position=statement,target=let + ref: docs/audits/ruling-audit-2026-11-21.md section 6.1, C1 + note: >- + Owner question: is `:=` onto an existing `let` an error (R-GV), still open (R-LR), or a rebind (R-BK, and what the compiler does today)? + - check: collision + subjects: [R-HH, R-HT] + where: spec-silent-acceptance python=refuses,sharpy-before=runs,spec=silent + ref: docs/audits/ruling-audit-2026-11-21.md section 6.1, C2 + note: >- + Owner question: when the spec is silent on whether a program is legal, does python3 decide (R-HH) or does today's behaviour stand (R-HT)? + - check: invariance + subjects: [R-PI, R-PL, P-uniform-verdict-across-forms] + where: equality-without-eq operand=reference-type + ref: docs/audits/ruling-audit-2026-11-21.md section 6.2, U2 + note: >- + Owner question: is a container search a site of R-PI's refusal of `==` on a type with no `__eq__`? + - check: invariance + subjects: [R-CH, R-IM, P-uniform-verdict-across-forms] + where: wrapper-str conversion=str + ref: docs/audits/ruling-audit-2026-11-21.md section 6.2, U3 + note: >- + Owner question: one rule for `str` of Optional and of Result? + - check: invariance + subjects: [R-ON, R-OW, P-backed-enum-flavour] + where: enum-operator backing=int + ref: docs/audits/ruling-audit-2026-11-21.md section 6.2, U1 + note: >- + Owner question: what python enum class is a backed enum, for every operator? + - check: invariance + subjects: [R-PK, R-QG, P-backed-enum-flavour] + where: enum-operator backing=string + ref: docs/audits/ruling-audit-2026-11-21.md section 6.2, U1 + note: >- + Owner question: what python enum class is a backed enum, for every operator? diff --git a/docs/process/rulings/laws.yaml b/docs/process/rulings/laws.yaml new file mode 100644 index 000000000..8230946f7 --- /dev/null +++ b/docs/process/rulings/laws.yaml @@ -0,0 +1,498 @@ +# The law table. Checked by build_tools/check_rulings.py; see README.md here. +# +# status: written the law's text is in `source`, at `anchor` (the check fails if the text is gone). +# `statement` is a one-line reminder, never the authority. +# status: draft a principle the 2026-11-21 audit found recurring in the rulings and written in no +# law (its Appendix A). The wording and boundary are the audit agent's and are not the +# owner's. A draft becomes a law when the owner adopts it and writes it into a source. +# +# cases: what the law's text gives for a case, so a ruling that says otherwise is seen. +# invariants: the law says the answer must not change along these axes of a family. +laws: +- id: A1 + status: written + source: docs/language_specification/introduction.md + anchor: '**Axiom 1 — .NET Runtime:**' + statement: Sharpy compiles to C# and runs on the CLR; it inherits the run-time behaviour .NET or C# defines. +- id: A2 + status: written + source: docs/language_specification/introduction.md + anchor: '**Axiom 2 — Python Surface:**' + statement: Sharpy uses Python 3 syntax and idioms; Python is evidence for behaviour only where a twin program + exists. +- id: A3 + status: written + source: docs/language_specification/introduction.md + anchor: '**Axiom 3 — Static & Null-Safe:**' + statement: Every type is known at compile time; None needs T?; a CLR default never stands in for an initializer + that has not run. +- id: RR + status: written + source: docs/language_specification/introduction.md + anchor: '**Resolution Rule:**' + statement: When Axiom 1 and Axiom 2 conflict, Axiom 1 wins unless the compiler can reconcile them at zero cost. +- id: T1 + status: written + source: docs/language_specification/introduction.md + anchor: 1. **No silently wrong value.** + statement: Never a silently wrong value. +- id: T2 + status: written + source: docs/language_specification/introduction.md + anchor: 2. **A compile-time error over a run-time error.** + statement: A compile-time error over a run-time error. +- id: T3 + status: written + source: docs/language_specification/introduction.md + anchor: 3. **A correct program keeps its value.** + statement: A correct program keeps its value unless a recorded decision changes it. +- id: T4 + status: written + source: docs/language_specification/introduction.md + anchor: 4. **One rule for every host** + statement: One rule for every host (module, class, generic class) over a special case. +- id: N1 + status: written + source: docs/design/name-resolution.md + anchor: '### N1. Scope decides meaning, not order' + statement: A module-level or class-level declaration is visible throughout its scope. +- id: N2 + status: written + source: docs/design/name-resolution.md + anchor: '### N2. Ambiguity is an error' + statement: A read whose meaning would depend on reading order is an error. +- id: N3 + status: written + source: docs/design/name-resolution.md + anchor: '### N3. Values are ready before use' + statement: A value's initializer has run before the value is read, or the read is an error. +- id: N4 + status: written + source: docs/design/name-resolution.md + anchor: '### N4. Constants are not special' + statement: Constants follow the same rules as other declarations. +- id: N5 + status: written + source: docs/design/name-resolution.md + anchor: '### N5. Locals are ordered' + statement: A local is visible from its declaration to the end of its block; loop, with, except and comprehension + targets are fresh bindings. + cases: + - family: walrus-target + coords: + position: comprehension-element + target: existing-local + verdict: refuse +- id: N6 + status: written + source: docs/design/name-resolution.md + anchor: '### N6. Writing across a function boundary needs a declaration' + statement: A store assigns a binding of the same function; writing an outer binding needs global or nonlocal. +- id: N7 + status: written + source: docs/design/name-resolution.md + anchor: '### N7. Spelling never changes the verdict' + statement: How a name is spelled never changes what the compiler decides about it. +- id: FS + status: written + source: docs/design/python-fidelity-scope.md + anchor: '## The table' + statement: Which surfaces are compared with python3 and which deviate by default; an unlisted surface is a deviation + until promoted. +- id: CR2 + status: written + source: CLAUDE.md + anchor: '**RoslynEmitter is a pure translator**' + statement: The emitter translates; semantic analysis decides. +- id: CR7 + status: written + source: CLAUDE.md + anchor: '**The spec is authoritative**' + statement: Read the spec first; change the implementation, never the spec. +- id: AP + status: written + source: CLAUDE.md + anchor: '## Design Anti-Patterns' + statement: No feature because Python has it, no runtime type checks, no wrapper types, one way to do a thing, + no magic. +- id: CV + status: written + source: CLAUDE.md + anchor: '**Wrap .NET, expose Python**' + statement: Core and Stdlib wrap .NET and expose Python names; absence is T?, expected failure is Result, bugs + throw. +- id: P-reversible-door + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`reversible-door`' + scope: language + statement: 'Among open options pick the one from which the others stay additive: refuse a form not yet admitted + rather than admit it, and keep admitting a form already admitted rather than restrict it.' + boundary: Yields when the reversible option leaves a silent difference from Python on a COMPARED surface, a + silently wrong or order-dependent value (T1), or withdraws a documented surface; then the one-way fix is taken + and recorded by direction. + rulings: [R-H, R-AM, R-EQ, R-FA, R-JZ, R-IZ, R-PK, R-PI, R-QM, R-DR, R-LR, R-AO, R-BF, R-CS, R-LE, R-KT, R-HW, + R-AW, R-HH, R-EW, R-DW, R-CW, R-CX, R-FM, R-FC, R-DJ, R-BR, R-ML, R-JG, R-KW, R-HJ, R-DH, R-GD, R-DL, R-FH, + R-IA, R-OA, R-NU, R-HT, R-DZ, R-AX, R-FW, R-OW] + against: [R-OY, R-QA, R-EU, R-QL, R-PL, R-OB, R-ND, R-MT, R-AI, R-HU] +- id: P-uniform-verdict-across-forms + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`uniform-verdict-across-forms`' + scope: language + statement: A desugared form, an alternative spelling, another host, or another member of an operator or declaration + family gets exactly its primitive's verdict, value and diagnostic code; no form-specific refusal or exemption. + boundary: Uniformity is judged by Sharpy's own type and conversion rules and by the mechanism (what gates, what + converts), not by Python's family lines; a second spelling may survive to keep a correct program running (T3). + nearest_written_law: N7 + rulings: [R-OY, R-PD, R-PE, R-PF, R-IA, R-OH, R-PI, R-MI, R-LS, R-CW, R-BU, R-MW, R-EI, R-ER, R-LH, R-KY, R-PT, + R-R, R-II, R-AA, R-EE, R-CR, R-DP, R-IP, R-HH] + against: [R-EU, R-DZ, R-NU, R-ON] + invariants: + - family: equality-without-eq + along: [site] + - family: wrapper-str + along: [wrapper] +- id: P-one-authority-per-fact + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`one-authority-per-fact`' + scope: language + statement: 'Each fact or behaviour has one implementation every consumer calls: a compile-time check calls the + runtime''s pure function, an operator and its library function share one engine, and one authority spells + each name or identity.' + nearest_written_law: CR2 + rulings: [R-BX, R-CG, R-IP, R-AN, R-CF, R-DE, R-NG, R-LP, R-CO, R-HD, R-IB, R-IL, R-DH, R-CW, R-DD, R-JC, R-R, + R-AQ] +- id: P-csharp-limit-named-refusal + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`csharp-limit-named-refusal`' + scope: language + statement: When C# cannot express a construct, refuse it before Roslyn with a named Sharpy code and the steer + a C# programmer would write; do not emulate it with a lowering users could depend on. + boundary: Emulation is taken when the lowering is unobservable from Sharpy (R-AV) or when refusing would leave + ordinary Python programs either refused en masse or printing a different value (R-QL, R-AI). + nearest_written_law: RR + rulings: [R-N, R-JG, R-KT, R-ML, R-IW, R-CS, R-QK, R-PT, R-HJ, R-LE, R-KW, R-HW, R-FO, R-JL, R-AW, R-HU, R-FW] + against: [R-QL, R-AI, R-AV] +- id: P-no-invented-type-or-conversion + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`no-invented-type-or-conversion`' + scope: language + statement: 'The compiler never invents a type or conversion: a common type is the slot''s or an operand''s own; + anything beyond value-preserving widening is spelled by the user; disagreeing candidates are refused, asking + for an annotation.' + boundary: Compile-time constants that fit the target, stores into a narrowed Optional, and nullability-oblivious + foreign values convert implicitly; everything else is spelled. + nearest_written_law: A3 + rulings: [R-G, R-W, R-AB, R-AE, R-BH, R-BO, R-PJ, R-JP, R-FN, R-KW, R-F, R-U, R-IC, R-AJ] + against: [R-T, R-EH, R-OP] +- id: P-diagnostic-code-per-cure + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`diagnostic-code-per-cure`' + scope: diagnostics + statement: 'A diagnostic code means one failure with one cure: reuse it, naming the kind in the message, for + the same mistake; mint a new code when the cure differs; never filter a code by route.' + nearest_written_law: CR10 + rulings: [R-BL, R-IK, R-GL, R-OV, R-OX, R-HI, R-JI, R-LI, R-AT, R-AZ, R-JO, R-ED, R-FN] +- id: P-silent-wrong-first + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`silent-wrong-first`' + scope: process + statement: A group that removes a silently wrong value is queued ahead of groups fixing refusals, crashes or + tooling; tooling and tests-only residues wait behind user-facing silent-wrong work, regressions excepted. + boundary: Order applies within a band; across arcs the owner weighs user-facing value, and a silent-wrong cell + waits when its class fix is already scheduled. + nearest_written_law: batch-issues SKILL step 3 (not a listed law) + rulings: [R-JU, R-KI, R-CN, R-GF, R-GO, R-GU, R-HC, R-HQ, R-IX, R-JF, R-HY, R-IJ, R-JA] + against: [R-PM, R-GX, R-NB] +- id: P-group-by-class-and-seam + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`group-by-class-and-seam`' + scope: process + statement: Cells join the open tracker and group whose contract owns their class; defects on one seam form one + group with one generator, built by the group that consumes it. + boundary: A new group is formed when the cure reuses facts a just-landed group built (R-JY); otherwise cells + go to existing trackers (R-JW). + nearest_written_law: VC10 + rulings: [R-GZ, R-HB, R-KL, R-JW, R-JB, R-GR, R-JY, R-LO, R-KV, R-MF, R-LR, R-JQ] + against: [R-JY] +- id: P-collision-is-error + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`collision-is-error`' + scope: language + statement: When two declarations, imports or source files claim one name in one scope, refuse and name both; + neither order, kind nor star-ness picks a silent winner, and no deterministic rename is applied. + boundary: When the other party is an open-ended external set (CLR namespaces, references), whose growth would + newly refuse existing code, the local name wins with a default-on warning naming the escape. + nearest_written_law: N2 + rulings: [R-IZ, R-JZ, R-DH, R-AX, R-HJ, R-LD, R-CY, R-II, R-JO, R-AW, R-JI] + against: [R-BA, R-CV] +- id: P-tooling-keeps-user-bytes + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`tooling-keeps-user-bytes`' + scope: diagnostics + statement: An editor, formatter or refactoring route keeps the user's written spelling and bytes unless it can + prove the change legal and meaning-preserving; it re-spells only when forced, and otherwise is not offered. + boundary: A formatter run the user asked for may canonicalize within a stated bound (R-ET); repair routes acting + on an unparseable document may not. + rulings: [R-DL, R-GD, R-GQ, R-GS, R-FK, R-FU, R-FQ, R-FR, R-FV, R-FP, R-ET] + against: [R-ET] +- id: P-promote-fidelity-where-exact + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`promote-fidelity-where-exact`' + scope: library + statement: Promote a Python surface to COMPARED by whole type or message family, covering what .NET reproduces + exactly or Core alone can cure; the remainder becomes one family deviation row. + boundary: Where an exact reproduction would rewrite genuine values (R-NS, R-FL's 128+N), the inexact part stays + a deviation even inside a promoted family. + nearest_written_law: FS + rulings: [R-CJ, R-NR, R-KS, R-NF, R-CK, R-IQ, R-IM, R-PL, R-FL, R-NS] + against: [R-BN] +- id: P-measure-before-mechanism + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`measure-before-mechanism`' + scope: process + statement: Add a mechanism, optimisation, CI leg or runtime-target move only after a measurement shows the need; + record an unmeasured hazard. Performance is reported for the owner to judge, not gated automatically. + boundary: Correctness checks on every platform the product ships for are not optional. + nearest_written_law: VC5 + rulings: [R-AS, R-KR, R-KN, R-KA, R-NI, R-GH, R-HA, R-PU, R-LW, R-MY] + against: [R-GM] +- id: P-documented-surface-implemented + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`documented-surface-implemented`' + scope: language + statement: A documented feature that can be typed and lowered is implemented rather than documented away; the + spec is rewritten only where the feature has no CLR carrier or admitting it would be the one-way door. + boundary: The spec yields when it promises something with no CLR carrier (R-BR) or when a later principle (Python + fidelity, R-OB) supersedes its text by ruling. + nearest_written_law: CR7 + rulings: [R-MT, R-DJ, R-ND, R-JS, R-MR, R-MV, R-AC, R-MW, R-AG] + against: [R-BR, R-OB, R-MD] +- id: P-loose-none-fails-like-python + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`loose-none-fails-like-python`' + scope: language + statement: A possibly-None `T | None` operand in an operation Python accepts stays legal, warns, and fails as + CPython does; a literal None where the type cannot hold None is a compile error. + boundary: Applies to the loose `T | None` spelling only; Sharpy's strict `T?` is refused until narrowed. It + overrides T2 for that spelling. + nearest_written_law: T2 + rulings: [R-OP, R-OC, R-NV, R-OS, R-OU, R-OB, R-Z, R-OV] + against: [R-OC, R-DX] +- id: P-untypeable-api-is-deviation + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`untypeable-api-is-deviation`' + scope: library + statement: A Python library surface that cannot be typed statically, or whose Python value occurs only in misuse, + becomes one recorded deviation row with a steer, not dynamic invocation, generated factories or a widened + nullable type. + boundary: A typeable surface with no other route is implemented; only untypeable, misuse-only, or alternative-covered + surfaces deviate. + nearest_written_law: FS + rulings: [R-FC, R-FE, R-NH, R-NN, R-DC, R-DY, R-IE, R-FW] + against: [R-ND, R-IR] +- id: P-land-semantics-before-instruments + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`land-semantics-before-instruments`' + scope: process + statement: Do not build an instrument, generator or stopgap on semantics a ruled change will flip; land the + semantic change first, and move an existing structure intact before redesigning it. + boundary: An instrument that hides missing refusals goes first, since the band it audits depends on it. + nearest_written_law: VC11 + rulings: [R-GV, R-LO, R-EC, R-HA, R-NP, R-FF, R-JN, R-MF] + against: [R-HQ] +- id: P-coverage-over-ci-capacity + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`coverage-over-ci-capacity`' + scope: process + statement: Coverage a contract requires is kept and CI capacity raised to carry it; every known failure is a + counted, cited row, and a missing precondition reports Skipped, never a vacuous pass. + nearest_written_law: VC2 + rulings: [R-PC, R-QH, R-HZ, R-OZ, R-MC, R-ID, R-KK, R-JE] +- id: P-clr-values-keep-clr-shape + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`clr-values-keep-clr-shape`' + scope: language + statement: A CLR value keeps its CLR identity and nullability-oblivious shape; Sharpy may add capabilities but + never subtracts what the CLR shape shows, and converts it only explicitly or with a check at a declared boundary. + boundary: Builtin types that are Sharpy types over a CLR backing follow Sharpy rules; the principle covers foreign + values only. + nearest_written_law: CV + rulings: [R-BH, R-BO, R-AN, R-EH, R-DW, R-BT, R-EG] + against: [R-AP, R-BU] +- id: P-repr-is-construction-spelling + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`repr-is-construction-spelling`' + scope: library + statement: A value's str/repr is its source construction spelling with payload reprs; where the runtime lacks + the source information, print a fixed documented placeholder, never CLR text or compiler-injected names. + boundary: A placeholder is a deviation only until a cheap mechanism carries the information (R-DG); then the + name is kept. + nearest_written_law: FS + rulings: [R-IM, R-CH, R-BN, R-DG, R-IF, R-CF, R-HO] + against: [R-CJ] +- id: P-one-mechanical-name-rule + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`one-mechanical-name-rule`' + scope: language + statement: Name mangling is one mechanical rule for every name; exceptions are spelled with the backtick escape + and collisions it creates are refused, never handled by tables, per-name renames or silent fallbacks. + boundary: A special case already visible to C# consumers is not reopened (R-AD). + nearest_written_law: AP + rulings: [R-CR, R-EB, R-AW, R-ED, R-CZ, R-DD, R-DP] + against: [R-AD, R-DZ] +- id: P-host-invariant-output + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`host-invariant-output`' + scope: library + statement: 'A program''s verdict and output never depend on the machine: locale, filesystem case, or assemblies + a process happened to load; an OS that cannot reproduce a behaviour gets its own deviation row.' + boundary: Where an OS lacks the data (Windows time-zone names), the difference is confined to that OS and recorded. + nearest_written_law: T4 + rulings: [R-CL, R-HH, R-CV, R-DB, R-FL, R-GM] + against: [R-DB] +- id: P-sentinel-defaults-not-magic + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`sentinel-defaults-not-magic`' + scope: library + statement: A Python default or calling convention C# cannot express is modelled by overloads, a nullable parameter + with a body coalesce, or a lambda steer; never an in-band magic value or dynamic invocation. + boundary: Overloads are synthesized only at rung 1 in library source; user-written defaults are refused with + a steer. + nearest_written_law: AP + rulings: [R-EV, R-R, R-AV, R-A, R-FC, R-FW] + against: [R-R] +- id: P-identity-never-runs-user-code + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`identity-never-runs-user-code`' + scope: language + statement: '`is` is identity only and never runs user code or a type test; `==` always runs the type''s declared + equality and is refused when none is declared; enum members count as identities.' + boundary: Container search follows CPython's documented identity-first semantics (R-PL); value-type operands + of `is` answer False with a warning. + rulings: [R-EJ, R-ES, R-OX, R-QG, R-OM, R-PI] + against: [R-PL] +- id: P-contained-fix-ships-now + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`contained-fix-ships-now`' + scope: process + statement: A contained fix to a false refusal or crash on an ordinary program, with a closed matrix and no seam + an in-flight group owns, ships now as a chore, not with its distant group. + boundary: Not when a scheduled ruled fix would rewrite the interim change, or when the fix carves a seam out + of another group's contract. + nearest_written_law: CR13 + rulings: [R-JD, R-JM, R-JX, R-KB, R-QN, R-GG] + against: [R-JN, R-EC, R-KL] +- id: P-pre-1.0-break-early + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`pre-1.0-break-early`' + scope: process + statement: 'Before 1.0 there is no compatibility promise: breaking respellings land early, unconsumed public + APIs that cannot be made correct are deleted, stale hand models are dropped, and ruled designs ship without + a feature flag.' + boundary: Rows disagree on whether the C# consumer surface is protected before 1.0; R-GW and R-KM say no users + exist, R-AD and R-EW protect it. + rulings: [R-GW, R-KM, R-BJ, R-FX, R-JC, R-DG] + against: [R-AD, R-EW] +- id: P-process-extensions-are-one-off + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`process-extensions-are-one-off`' + scope: process + statement: An extension of a process limit (an extra verify pass, a raised ratchet pin) is granted once on the + owner's quoted word and is never precedent. + boundary: None stated; recurrence suggests the cap itself needs a written extension clause. + nearest_written_law: VC12 + rulings: [R-QC, R-QF, R-OR, R-NY, R-OO] + against: [R-OO] +- id: P-clr-limit-saturates-not-refuses + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`clr-limit-saturates-not-refuses`' + scope: library + statement: A run-time argument Python accepts but a CLR limit cannot hold saturates, or raises CPython's nearest + exception, recorded as one family deviation row; the call is not refused. + boundary: 'Values in source text, known at compile time, are refused (T2); only run-time values saturate. R-FH + calls refusing Python-accepted calls the one-way option, R-HU calls admitting Python''s value the one-way + option: the door reading flips with compile-time knowability.' + nearest_written_law: A1 + rulings: [R-DA, R-FH, R-IR, R-IS] + against: [R-HU, R-IA] +- id: P-bug-dependent-program-not-correct + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`bug-dependent-program-not-correct`' + scope: language + statement: Under T3, a program whose current value comes from a defect, or whose verdict differs from its primitive + twin's, is not a correct program; changing it needs a direction record, not a deviation row. + boundary: Status-quo behaviour that is consistent and documented (R-OW) is kept as a deviation, not treated + as a bug. + nearest_written_law: T3 + rulings: [R-LP, R-OY, R-JZ, R-QA] + against: [R-OW] +- id: P-tier-below-letters-at-charter + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`tier-below-letters-at-charter`' + scope: process + statement: A group's tier may be set below its derived letter at charter time when full-tier dimensions have + no subject (tests-only, mechanical respellings); once planning begins tiers only rise. + nearest_written_law: VC12 + rulings: [R-JR, R-KE, R-KQ, R-QP] +- id: P-static-check-only-definite + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`static-check-only-definite`' + scope: language + statement: A static check refuses only a definite mismatch; where the operand kind, format spec or target symbol + is not statically known, it stays silent and the run-time check answers. + boundary: Holds where the missing fact is unknowable at compile time; T2 governs wherever the fact is known. + nearest_written_law: T2 + rulings: [R-U, R-CD, R-BW] + against: [R-AT] +- id: P-users-first-release + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`users-first-release`' + scope: process + statement: A defect that breaks the documented install on a supported host is fixed at once as its own chore + and released as a patch, and a known workaround is posted on the issue immediately. + rulings: [R-GG, R-GI, R-GJ] +- id: P-backed-enum-flavour + status: draft + source: docs/audits/ruling-audit-2026-11-21.md + anchor: '`backed-enum-flavour`' + scope: language + statement: A backed enum behaves as the Python enum flavour of its backing (IntEnum, StrEnum) for every operator. + boundary: 'No consistent boundary: string-backed enums are StrEnum for == and Enum for ordering, int-backed + the reverse. R-PK''s reason (''no .NET order to keep'') suggests ''keep .NET behaviour where it exists, else + refuse'', which R-ON does not fit.' + rulings: [R-OW, R-QG] + against: [R-ON, R-PK] + invariants: + - family: enum-operator + along: [operator, operands] diff --git a/docs/process/rulings/policy.yaml b/docs/process/rulings/policy.yaml new file mode 100644 index 000000000..2e4e4735c --- /dev/null +++ b/docs/process/rulings/policy.yaml @@ -0,0 +1,14 @@ +# Which decisions an agent may take without the owner, by what the measured evidence shows +# (build_tools/ruling_evidence.py derive_door). A DRAFT: every `true` here is the owner's to grant. +# +# no_change nothing a program can observe changes +# reversible_refusal a program that is refused today stays refused (a different code or wording) +# breaking_refusal a program that runs today is refused +# admission_or_value_change a refused program now runs, or a running one prints or raises something else +# kept_divergence today's result is kept although python's twin gives another +agent_may_decide: + no_change: true + reversible_refusal: true + breaking_refusal: false + admission_or_value_change: false + kept_divergence: false diff --git a/docs/process/rulings/rulings.yaml b/docs/process/rulings/rulings.yaml new file mode 100644 index 000000000..8e37b0d55 --- /dev/null +++ b/docs/process/rulings/rulings.yaml @@ -0,0 +1,7782 @@ +# Ruling records: one per owner ruling. Checked by build_tools/check_rulings.py; see README.md here. +# +# A record with `seed:` was written by the 2026-11-21 audit from its charter row. Its `kind`, `rule`, +# `outcome`, `python` and everything under `audit:` are a language model's reading of the row and have +# not been reviewed by the owner; the charter row stays the authority for the text. `door_stated` is a +# keyword count over the row (one-way / two-way, relaxable, additive / both / unstated). +# +# A record without `seed:` is a new ruling and must meet the strict schema in README.md. +schema: 1 +rulings: +- id: R-A + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: initialization + units: [dataclass, field-default, list] + rule: A dataclass field whose default is a collection literal is initialized freshly per instance, never emitted + as a C# default-parameter value; function-parameter collection defaults stay refused (SPY0400). + outcome: admit + python: deviates + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-B + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [ternary, common-type] + rule: A conditional expression whose branches have incompatible types takes their nearest common ancestor type, + falling back to object. + outcome: admit + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + superseded_by: [R-W] +- id: R-C + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: nullability-narrowing + units: [isinstance, generics, narrowing] + rule: isinstance checks against a constructed generic type such as list[int] are supported with full reified + narrowing, not parked. + outcome: admit + python: deviates + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-D + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: patterns + units: [match, sequence-pattern, generics] + rule: A bare sequence pattern against an open (non-closed) scrutinee is refused with a steer to a typed class + pattern like case list[int]([1, 2]); closed scrutinees still match. + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: precedent + laws: [] + law_cited: false + confidence: medium +- id: R-E + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [cast, as-optional, as-force] + rule: A coercion that is statically impossible is refused at semantic time with a steer, uniformly for as? and + as!, and never lowered to a constant None. + outcome: refuse + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [T2, A1] + law_cited: false + confidence: medium +- id: R-F + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: nullability-narrowing + units: [cast, as-optional, optional] + rule: The safe cast as? yields the strict Optional[T]; strict T? versus loose T | None remains a type-level + distinction, and as? T? stays refused (SPY0334). + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-G + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: nullability-narrowing + units: [optional, none, some, maybe] + rule: 'Optional construction is fully strict: no implicit T to T? conversion, bare None is not a T? value, Some(v)/None() + are the only constructors, and maybe is the sole bridge from T | None.' + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: derivable + laws: [CV, AP] + law_cited: false + confidence: medium +- id: R-H + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: generics + units: [interface, generics, inheritance] + rule: A type whose supertype closure contains the same generic interface at two different instantiations is + refused when a Sharpy declaration introduces the second, naming both paths; duplicates entirely inside a CLR + type are exempt. + outcome: refuse + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-I + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: classes-members + units: [union, delegate, type-alias, nested-type] + rule: Union, delegate and type-alias declarations nested inside a class body are supported. + outcome: admit + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [A1, T4] + law_cited: false + confidence: medium +- id: R-J + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: patterns + units: [list-target, tuple-unpacking, assignment] + rule: A list-shaped assignment target like [a, b] = xs is accepted by normalizing it to the tuple-target form + in the parser; an augmented assignment to a list target stays refused. + outcome: admit + python: matches + door_stated: unstated + option: A + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: high +- id: R-K + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: implementation + rule: The common type of a conditional's branches is recorded as a node-keyed semantic fact merged by MergeFrom; + value positions cast one branch to it and truthiness tests distribute per branch; the emitter never casts + on its own. + outcome: emission + door_stated: unstated + audit: + basis: derivable + laws: [CR2] + law_cited: true + confidence: high +- id: R-L + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [protocol, interface, inheritance] + rule: Synthesized protocol interfaces count as ancestors of a type, with their synthesis hoisted into declaration + resolution; the join use is superseded and the hoist survives only for the duplicate-instantiation closure + check. + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amended_by: [R-W] +- id: R-M + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: exceptions + units: [with, context-manager, reachability, return] + rule: Code after a with whose manager may suppress exceptions is reachable, so a non-None function that can + fall off there is refused (SPY0266) with a steer; -> None functions are clean. + outcome: refuse + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [A3, T2] + law_cited: false + confidence: medium +- id: R-N + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: exceptions + units: [yield, with, context-manager, generator] + rule: A yield inside a with whose manager can suppress exceptions is refused by name; a ? early-return there + is accepted under R-M's reachability rule. + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: derivable + laws: [A1] + law_cited: false + confidence: medium +- id: R-O + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: process + rule: Strict-Optional enforcement lands in the first batch of its group at the seam that batch builds, the group + splits into two plans, and the guard is a Roslyn semantic-model scan of snapshots for implicit Optional conversions. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-P + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [literal-string, str, f-string] + rule: Literal-derived strings (PEP 675) are tracked as one node-keyed fact while the expression type stays str, + consumed by the store seam in every position, with forms extended later. + outcome: admit + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-Q + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: process + rule: A reopened issue is placed in a named batch with acceptance defined as its allowlist rows draining; re-citing + the rows to a fresh issue number is rejected. + door_stated: unstated + audit: + basis: derivable + laws: [VC8] + law_cited: false + confidence: medium +- id: R-R + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: initialization + units: [parameter-default, lambda, optional, tuple] + rule: One predicate decides which parameter defaults C# can emit as constants across all three hosts; Some(...) + and tuple defaults are refused (SPY0401) steering to = None() plus x ??= Some(v); lambdas share def's emission. + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-S + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: interop-naming-emission + units: [some, none, ok, err, union] + rule: Bare Some, None(), Ok and Err are the only spellings of the Optional and Result constructors; qualified + forms are refused by name and the names reserved, while user unions keep Union.Case(...). + outcome: spelling + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [AP] + law_cited: false + confidence: high +- id: R-T + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: nullability-narrowing + units: [optional, narrowing, assignment] + rule: Inside a narrowing, a store to the narrowed T? name accepts the payload type and is re-wrapped, the narrowing + survives, and a narrowed read into a slot of the declared T? type passes the Optional through. + outcome: admit + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-U + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [in-operator, clr-constructor, overload] + rule: in/not in follow the promotion rule (a constant needle converts, a variable needle is refused by name), + and CLR constructor calls are checked against bridged parameter types, refusing only on definite mismatch. + outcome: refuse + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: low +- id: R-V + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [walrus] + rule: A walrus expression's type is what its target reads as immediately after the store, after seam conversion + and rebinding narrowing. + outcome: runtime-value + python: matches + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-W + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [ternary, list-literal, dict-literal, set-literal, tuple] + rule: 'Several expressions'' common type follows C#''s best-common-type: the slot directs it when one exists; + otherwise one operand''s type must accept all others; otherwise refuse with an annotate steer. Tuples iterate; + count/index are refused.' + outcome: refuse + python: deviates + door_stated: two-way + audit: + basis: derivable + laws: [A1] + law_cited: false + confidence: medium + supersedes: [R-B] + amends: [R-L] +- id: R-X + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: operators + units: [dict, null-coalescing-assign] + rule: d[k] ??= v requires the key to exist and raises KeyError when it is missing (setdefault handles absence); + ??= is statement-only; whether the store is skipped when present is left to the plan. + outcome: runtime-error + python: no-twin + door_stated: unstated + option: B + audit: + basis: derivable + laws: [A1] + law_cited: false + confidence: low +- id: R-Y + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: scope-binding + units: [method, class-member, assignment] + rule: In a method, a bare store to a name declared in the enclosing class or struct body is refused by name + with two steers; a bare read is unresolved (SPY0200) with a self. steer. + outcome: refuse + python: deviates + door_stated: unstated + option: c + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-Z + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: nullability-narrowing + units: [optional, union-none] + rule: Dereferencing a loose T | None value without narrowing is accepted by design, per the spec's loose family; + an opt-in warning for unnarrowed dereference is parked. + python: matches + door_stated: unstated + audit: + basis: derivable + laws: ['SPEC:tagged_unions_optional.md'] + law_cited: true + confidence: medium + amended_by: [R-OV] +- id: R-AB + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [none, list-literal, ternary] + rule: A bare None has no type in best-common-type, so a slot-less literal or conditional containing one is refused + with the annotate steer; None alone stays SPY0227. + outcome: refuse + python: deviates + door_stated: two-way + option: i + audit: + basis: precedent + laws: [R-W] + law_cited: true + confidence: high +- id: R-AC + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: classes-members + units: [const, interface] + rule: A const declared in an interface is legal and emitted as a C# const; the spec is expanded accordingly, + never a refusal or property. + outcome: admit + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [A1] + law_cited: false + confidence: high +- id: R-AD + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: interop-naming-emission + units: [module, class, module-class] + rule: 'A class named like its file stays merged into the module class (other kinds refused); qualification bugs + are fixed through universal global:: qualification instead.' + outcome: emission + python: no-twin + door_stated: one-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-AA + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: scope-binding + units: [method, class-member, property, inheritance] + rule: In a method, a bare store to any name resolving to a member of the enclosing class or struct, own or inherited, + field or property, is refused (SPY0606) with the same steers. + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: precedent + laws: [R-Y] + law_cited: true + confidence: high +- id: R-AE + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [walrus, none, optional] + rule: A walrus binding of None directly under a store slot takes the slot's type, as g(None) does; in any other + position it is refused like x = None (SPY0227), and a void-call walrus is refused everywhere. + outcome: admit + python: matches + door_stated: two-way + option: b + audit: + basis: precedent + laws: [R-W] + law_cited: false + confidence: medium +- id: R-AF + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [overload, keyword-argument, generics, constructor] + rule: 'Overload resolution follows C#''s ordering: keyword arguments count for applicability and betterness, + inference failure makes a candidate inapplicable, and constructor ambiguity is refused (SPY0353) rather than + left to Roslyn.' + outcome: runtime-value + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [A1] + law_cited: false + confidence: high +- id: R-AH + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: generics + units: [list, set, dict, variance] + rule: list, set and dict are invariant in their type arguments; read-only interfaces keep their declared out + T, and a widened write slot is refused at the slot with a read-only steer. + outcome: refuse + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [A1, A3] + law_cited: false + confidence: high +- id: R-AI + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: initialization + units: [with, definite-assignment, local] + rule: A local assigned inside a suppression-capable with body and read after is checked at run time with an + assigned flag, raising UnboundLocalError on an unset read. + outcome: runtime-error + python: matches + door_stated: unstated + option: C + audit: + basis: exception + laws: [T2] + law_cited: false + confidence: medium +- id: R-AJ + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: numeric + units: [list-literal, int, float] + rule: Numeric literal widening in a slot-less display (int widened to float) is a documented deviation from + Python, with a permanent differential-test row. + outcome: deviation-row + python: deviates + door_stated: unstated + audit: + basis: precedent + laws: [R-W] + law_cited: true + confidence: high +- id: R-AK + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: other + units: [call, parentheses] + rule: A parenthesized callee such as (f)(x) is treated exactly as the callee. + outcome: admit + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: high +- id: R-AL + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: operators + units: [and, or, bool] + rule: and/or keep returning bool as the spec states; the issue becomes a steer from the type error toward ??; + do not re-propose. + outcome: refuse + python: deviates + door_stated: one-way + audit: + basis: derivable + laws: ['SPEC:logical_operators.md'] + law_cited: true + confidence: high +- id: R-AM + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [tuple, variadic-tuple, callable] + rule: tuple[T, ...] (and ... in type arguments such as Callable[..., T]) is refused by name in the parser with + a list[T]/Sequence[T] steer; support is parked. + outcome: refuse + python: deviates + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-AN + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: typing-conversion + units: [protocol, clr-type] + rule: The registry's protocol table can only add protocol memberships; absent a positive registry answer, membership + falls through to the CLR checks. + outcome: admit + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-AO + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: library + axis: nullability-narrowing + units: [dict, none] + rule: Sharpy's Dict supports None keys through an internal null-key slot beside the wrapped .NET Dictionary, + with the user surface unchanged. + outcome: runtime-value + python: matches + door_stated: one-way + audit: + basis: derivable + laws: [RR, T3] + law_cited: false + confidence: medium +- id: R-AP + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: interop-naming-emission + units: [builtin, clr-member, naming] + rule: PascalCase CLR member spellings on a Sharpy builtin receiver are refused by name (SPY0203) with the Sharpy + spelling as steer; the backtick escape remains. + outcome: refuse + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [AP, CV] + law_cited: false + confidence: high +- id: R-AQ + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: interop-naming-emission + units: [clr-type, qualification] + rule: Every non-Sharpy CLR type symbol, generic or not, is emitted through the single qualification authority; + no per-namespace using list. + outcome: emission + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [T4] + law_cited: false + confidence: low +- id: R-AR + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: classes-members + units: [property, decorator] + rule: '@property and its setter/getter/deleter decorators are a named parser refusal steering to property get + p(self) -> T:, and an executing spec-block sweep is built now.' + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: derivable + laws: [AP] + law_cited: false + confidence: medium +- id: R-AS + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: test-instrument + rule: The dotnet serialization lock publishes log, cwd and start time, waiters say to report rather than kill, + and no heartbeat is added until a quiet holder is measured; guarded by a stub-holder test. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-AT + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: diagnostic + axis: typing-conversion + units: [overload, clr-method] + rule: The lossy-CLR-mapping decline is deleted and SPY0354's CLR candidate-list arm retired, so every CLR overload + refusal is explained. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: low +- id: R-AU + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: operators + units: [tuple, truthiness, optional] + rule: A fixed-arity tuple is not truth-testable and stays refused with the reason named in the message; tuple + | None keeps its null test, and no always-true lowering is added. + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: derivable + laws: ['SPEC:logical_operators.md'] + law_cited: true + confidence: high +- id: R-AV + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: initialization + units: [dataclass, struct, mutable-default, constructor] + rule: A mutable-collection default on a non-nullable dataclass or struct field lowers to a nullable constructor + parameter assigned with ?? before PostInit; nullable fields and tuple/Some/call defaults keep their existing + refusals. + outcome: admit + python: deviates + door_stated: two-way + audit: + basis: precedent + laws: [R-A, R-R] + law_cited: true + confidence: medium +- id: R-AG + seed: audit-2026-11-21 + round: '2026-08-30' + issues: [] + kind: language + axis: iteration + units: [generator-expression, comprehension, iterator] + rule: 'Generator expressions are added: parenthesized anywhere, bare only as a sole call argument (else a named + parse refusal), typed Iterator[T], lowered to a lazy LINQ chain; async clauses stay refused.' + outcome: admit + python: matches + door_stated: unstated + option: A + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-AW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1871'] + kind: language + axis: interop-naming-emission + units: [member-name, name-mangling, class] + rule: A member whose PascalCase-mangled name equals its enclosing type's name is refused with a new named code, + steering to rename or backtick-escape. + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-AX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1932'] + kind: language + axis: imports-modules + units: [package, module, namespace] + rule: In project mode a directory named the same as a module file in it is refused with a rename steer now; + later, package directories emit as C# namespaces. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-AY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1892'] + kind: language + axis: typing-conversion + units: [as-cast, enum, optional] + rule: 'as? lowers per conversion-verdict kind with a runtime test: enum to backing always Some, backing to enum + Some only if defined, explicit-conversion throw becomes None; a totality guard covers every kind.' + outcome: runtime-value + python: no-twin + door_stated: two-way + option: c + audit: + basis: derivable + laws: [T1] + law_cited: false + confidence: medium +- id: R-AZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1931'] + kind: diagnostic + axis: other + units: [error-type, diagnostic-cascade] + rule: Every refusal site returns a dedicated error type that every check accepts without reporting, distinct + from the permissive Unknown type, so one mistake does not cascade into further diagnostics. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-BA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1898'] + kind: language + axis: imports-modules + units: [module, clr-namespace, import, backtick-escape] + rule: A user module on the search path resolves before a same-named CLR namespace; the namespace stays reachable + via backtick spelling, and a default-on warning at the definition names the shadow and the escape. + outcome: admit + python: matches + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-BB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1915'] + kind: diagnostic + axis: classes-members + units: [iter, dunder, generator] + rule: A non-producer __iter__/__reversed__ declaration is refused by the dunder signature validator under its + existing code; a body returning a non-producer under a producer annotation is SPY0260 at the return slot. + outcome: refuse + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-BC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1911'] + kind: cli-lsp + units: [stdlib-docs, type-name] + rule: Stdlib documentation renders a module-defined type by its bare name on its own module's page and module-qualified + on other pages. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-BD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1939'] + kind: test-instrument + units: [spec-blocks, allowlist] + rule: 'The spec-block sweep drains in order: a per-file prelude first, then fragment markers for genuine partial + residue, then one tracking issue per remaining first-error bucket; the gate glob widens now.' + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-BE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1955'] + kind: language + axis: strings-formatting + units: [str-format, keyword-argument] + rule: str.format keyword fields stay refused with SPY0234, now with a steer to use an f-string or format_map. + outcome: refuse + python: deviates + door_stated: both + option: a + audit: + basis: derivable + laws: [CV, AP] + law_cited: true + confidence: medium +- id: R-BF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1950'] + kind: language + axis: typing-conversion + units: [bound-method, method-group, delegate] + rule: A bound method or CLR method group used as a value is a typed delegate and is not refused; a spec sentence + with an executed example documents it. + outcome: admit + python: matches + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-BG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1952'] + kind: process + rule: Spec-block residue gets a dedicated last work group plus a standing rule to drain entries whenever a change + touches them. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-BH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1960'] + kind: language + axis: typing-conversion + units: [clr-collection, list, dict, set, conversion] + rule: CLR interface sequence and mapping types keep CLR identity; list(x), dict(x) or set(x) is the only conversion, + and implicit slot materialization is replaced by a type mismatch with a steer. + outcome: refuse + python: no-twin + door_stated: one-way + option: d + audit: + basis: derivable + laws: [AP, T1] + law_cited: false + confidence: medium +- id: R-BI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974'] + kind: process + rule: The let-declaration work runs last after P20 in three sub-phases (stage 1, codemod and migration, stage + 2), each its own plan and measured gate. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high + amended_by: [R-CN] +- id: R-BJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974'] + kind: language + axis: scope-binding + units: [let, feature-flag] + rule: let lands as an unconditional keyword with no experimental feature flag, because the design is ruled and + the large migration cannot run behind a gate. + outcome: admit + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-BK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974'] + kind: language + axis: scope-binding + units: [walrus] + rule: := keeps declare-if-new, rebind-if-existing semantics and remains the only expression-position introducer + after let's stage 2. + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A2, T3] + law_cited: false + confidence: high + amended_by: [R-GV] + cases: + - family: walrus-target + coords: + position: statement + target: existing-local + verdict: run + evidence: + program: | + def main() -> None: + x: int = 1 + if (x := 2) > 0: + print(x) + print(x) + twin: | + x = 1 + if (x := 2) > 0: + print(x) + print(x) + sharpy: | + runs:2 + 2 + python: | + runs:2 + 2 +- id: R-BL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974'] + kind: diagnostic + axis: scope-binding + units: [let, assignment, module-variable, const] + rule: Assignment to an undeclared name gets one new code steering to let; module-scope non-const bindings reuse + SPY0340 with the steer that module-scope bindings are const. + outcome: refuse + python: no-twin + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amended_by: [R-GV] +- id: R-BM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974'] + kind: language + axis: scope-binding + units: [out-parameter, let] + rule: out let x introduces a new binding and out x writes through to an existing one, mirroring C# out var x + and out x. + outcome: spelling + python: no-twin + door_stated: two-way + option: b + audit: + basis: precedent + laws: [R-BL] + law_cited: false + confidence: medium +- id: R-BN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1968'] + kind: library + axis: repr-display + units: [defaultdict, repr] + rule: str/repr of defaultdict render the factory as a fixed placeholder, defaultdict(, {...}), documented + as a deviation. + outcome: deviation-row + python: deviates + door_stated: two-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-BO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1973', '#1975'] + kind: language + axis: typing-conversion + units: [clr-interface, overload-resolution, conversion] + rule: Non-generic CLR interfaces keep CLR identity with no object fallback; unmapped types are refusal-only + for pointers/by-ref, interface satisfaction is proven by reflection, and the checker picks Roslyn's overload. + outcome: refuse + python: no-twin + door_stated: two-way + option: a″ + audit: + basis: precedent + laws: [R-BH] + law_cited: true + confidence: high +- id: R-BP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1976'] + kind: language + axis: typing-conversion + units: [tuple, annotation] + rule: A bare tuple annotation is refused with a steer to () or tuple[()] for the empty tuple or tuple[T, ...]; + any-arity tuples stay parked. + outcome: refuse + python: deviates + door_stated: two-way + option: a + audit: + basis: derivable + laws: [A1, RR] + law_cited: true + confidence: medium +- id: R-BQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2002'] + kind: language + axis: generics + units: [tuple, type-argument, shorthand] + rule: A parenthesized (A, B) in expression-position type arguments is one tuple[A, B] argument, matching the + annotation shorthand, not Python's flattening to two arguments. + outcome: spelling + python: deviates + door_stated: unstated + option: a + audit: + basis: derivable + laws: [CR7] + law_cited: true + confidence: high +- id: R-BR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1977'] + kind: language + axis: typing-conversion + units: [function-type, named-parameter, annotation] + rule: Named parameters in function type annotations stay refused (SPY0104) and the spec section describing them + is deleted. + outcome: refuse + python: no-twin + door_stated: two-way + option: b + audit: + basis: exception + laws: [CR7] + law_cited: false + confidence: medium +- id: R-BS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1983'] + kind: library + axis: repr-display + units: [template, interpolation, repr] + rule: repr of PEP 750 Interpolation and Template uses CPython 3.14's constructor spelling, reachable through + user-facing repr(). + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: derivable + laws: [FS, A2] + law_cited: false + confidence: medium +- id: R-BT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1982'] + kind: language + axis: typing-conversion + units: [clr-collection, len, truthiness] + rule: A BCL collection exposing Count has __len__ for len, bool and truth testing via one shared reflective + predicate. + outcome: admit + python: no-twin + door_stated: unstated + option: a + audit: + basis: precedent + laws: [R-BH] + law_cited: true + confidence: high +- id: R-BU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1987'] + kind: language + axis: classes-members + units: [str, unbound-method, static-member, backtick-escape] + rule: Calling an instance method via a CLR-backed builtin type name (str.upper(...)) is refused with SPY0290, + as for user classes; a same-named CLR static is steered to the backtick escape. + outcome: refuse + python: deviates + door_stated: one-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-BV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1993'] + kind: language + axis: typing-conversion + units: [void-call, none] + rule: Using a call that returns no value as a value is a new compile error in every value position and for every + callee kind; statement position stays valid. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: derivable + laws: [A3] + law_cited: true + confidence: high +- id: R-BW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1997'] + kind: language + axis: strings-formatting + units: [format, method-group, delegate, format-spec] + rule: A bad spec passed through a format method-group delegate is a runtime ValueError only; no compile-time + check follows the delegate. + outcome: runtime-error + python: matches + door_stated: two-way + option: b + audit: + basis: exception + laws: [T2] + law_cited: false + confidence: low +- id: R-BX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1984'] + kind: implementation + units: [format-spec] + rule: Core exposes one pure format-spec validator used by both the runtime formatter and the compiler's static + check, retiring the duplicated mirror. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-BY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1988'] + kind: language + axis: strings-formatting + units: [format-spec, f-string, user-class] + rule: A non-empty format spec on an operand type without __format__ (list, dict, set, tuple, plain user class) + is a runtime TypeError, and SPY0609 when the spec is a literal, on every route. + outcome: refuse + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [A2, FS, T2] + law_cited: false + confidence: medium +- id: R-BZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2039'] + kind: process + rule: Emitting user types beside the module class is its own plan right after the package-namespace plan, which + first settles the module-as-namespace layout. + door_stated: one-way + option: a + audit: + basis: derivable + laws: [CR13, VC11] + law_cited: false + confidence: medium +- id: R-CA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2033'] + kind: language + axis: interop-naming-emission + units: [interface, private-member, backtick-escape] + rule: An interface member named _m or __m is refused with a new code steering to drop the underscore; a backtick-escaped + spelling emits verbatim as a public member. + outcome: refuse + python: deviates + door_stated: two-way + option: a + audit: + basis: derivable + laws: [A1, RR] + law_cited: false + confidence: medium +- id: R-CB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2009'] + kind: language + axis: strings-formatting + units: [format, dunder, iformattable] + rule: A user def __format__ synthesizes an IFormattable implementation whose ToString(format, provider) calls + __format__. + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: derivable + laws: [CV, RR] + law_cited: false + confidence: low +- id: R-CC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2031'] + kind: library + axis: strings-formatting + units: [format, f-string, iformattable] + rule: 'Formatting with an empty spec follows Python: IFormattable values use ToString("", invariant), everything + else uses str; a plain f-string hole calls Format only for Formattable/Unknown kinds.' + outcome: runtime-value + python: matches + door_stated: unstated + option: a + audit: + basis: derivable + laws: [A2, FS] + law_cited: false + confidence: high +- id: R-CD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2029'] + kind: language + axis: strings-formatting + units: [format-spec, str-format] + rule: The static format-spec walk stops at a nested-spec field and at a non-empty spec on an Unknown-kind operand, + leaving those to the runtime ValueError. + outcome: runtime-error + python: matches + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-CE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2008'] + kind: language + axis: strings-formatting + units: [str-format, format-field] + rule: 'A literal format template with an out-of-range index or unmatched keyword field is a new compile error, + and the runtime keyword error text becomes Python''s KeyError: ''name''.' + outcome: refuse + python: deviates + door_stated: two-way + option: a + audit: + basis: derivable + laws: [T2] + law_cited: false + confidence: medium +- id: R-CF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2006', '#2007', '#2030', '#2035'] + kind: library + axis: repr-display + units: [type-name, enum, repr, str] + rule: 'One Python-name authority spells runtime type names: Python names for Core/Stdlib/CLR kinds, source names + for user types; enum str prints Color.RED and repr .' + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A2, FS] + law_cited: false + confidence: medium +- id: R-CG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2040'] + kind: implementation + units: [name-mangling] + rule: The member-name mangling rule moves into Core and the compiler delegates to it; runtime attribute lookup + tries the mangled name then verbatim. + door_stated: unstated + option: a + audit: + basis: precedent + laws: [R-BX] + law_cited: true + confidence: high +- id: R-CH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2005'] + kind: library + axis: repr-display + units: [optional, repr, str] + rule: str of an Optional is transparent (1 or None), while repr uses the constructor spelling Some(1) or None() + on both variants. + outcome: runtime-value + python: no-twin + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A1, T3] + law_cited: false + confidence: medium + cases: + - family: wrapper-str + coords: + wrapper: optional + conversion: str + verdict: run + answer: payload + evidence: + program: | + def main() -> None: + x: int? = Some(1) + print(x) + sharpy: | + runs:1 + python: no-twin +- id: R-CI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2108'] + kind: library + axis: exceptions + units: [exception-message] + rule: Exception message text beyond the type name is a deviation by default, recorded as a ledger row; a message + quoted in the spec stays compared. + outcome: deviation-row + python: deviates + door_stated: two-way + option: a + audit: + basis: derivable + laws: [FS] + law_cited: false + confidence: medium +- id: R-CJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2104'] + kind: library + axis: repr-display + units: [repr, str, stdlib] + rule: str/repr of every Stdlib type is compared with Python, one tracker per type family, each type implementing + IRepr with a constructor-spelled repr. + outcome: runtime-value + python: matches + door_stated: one-way + option: b + audit: + basis: derivable + laws: [FS] + law_cited: false + confidence: medium +- id: R-CK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2089', '#2090'] + kind: library + axis: other + units: [sorted, sort-key, min, max] + rule: Which operand a sort refusal names stays a deviation (inherited .NET algorithm), but key= is called exactly + once per element, as in Python. + outcome: deviation-row + python: deviates + door_stated: unstated + option: b + audit: + basis: derivable + laws: [A1, FS] + law_cited: true + confidence: medium +- id: R-CL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2056'] + kind: library + axis: strings-formatting + units: [culture, format, datetime] + rule: Every Core and Stdlib text path uses the invariant culture, matching CPython's C locale; current-culture + output is a bug. + outcome: runtime-value + python: matches + door_stated: one-way + option: b + audit: + basis: derivable + laws: [FS, A2] + law_cited: false + confidence: medium +- id: R-CM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2059'] + kind: process + rule: A surface not listed in the Python-fidelity table is a deviation until an owner ruling promotes it; the + next long-tail cell is a ledger row, not an issue. + door_stated: unstated + option: a + audit: + basis: derivable + laws: [FS] + law_cited: false + confidence: medium +- id: R-CN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974'] + kind: process + rule: The remaining let-declaration sub-phases run next, before P15, with silent-wrong binding fixes ahead of + the codemod; this replaces R-BI's sequencing only. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high + amends: [R-BI] + amended_by: [R-GV] +- id: R-CO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2044', '#2045', '#2048', '#2129'] + kind: language + axis: strings-formatting + units: [string-literal, f-string, t-string, raw-string, lexer] + rule: All Python string-literal prefixes (rf, fr, rb, br, tr, rt) are accepted in any order and case; doubled + braces, backslash escapes and line continuations in format specs work; one lexer table drives the editor grammar. + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-CP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2057'] + kind: language + axis: repr-display + units: [repr, str, dunder, class] + rule: A user __repr__ implements the repr channel separately from __str__ (which stays ToString); a class defining + only __str__ reprs as , as in Python. + outcome: runtime-value + python: matches + door_stated: unstated + option: a + audit: + basis: derivable + laws: [FS] + law_cited: false + confidence: high +- id: R-CQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2083'] + kind: library + axis: repr-display + units: [enum, clr-interop, name-value] + rule: '.name and .value work on CLR interop enums as on Sharpy enums: .name gives the member name, .value the + underlying integer.' + outcome: admit + python: no-twin + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-CF] + law_cited: false + confidence: medium +- id: R-CR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2065', '#2094'] + kind: language + axis: interop-naming-emission + units: [entry-point, function, name-mangling, module] + rule: Every function, including main, emits its ordinary mangled name (main becomes Main) in every module kind; + the executable entry point is chosen by a compilation option instead of a MainFunc rename. + outcome: emission + python: no-twin + door_stated: one-way + option: c′ + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-CS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2063'] + kind: language + axis: scope-binding + units: [local-class, local-import, function] + rule: Class, struct, enum, union and interface declarations and imports inside a function are refused with one + new validation code steering to module or class level. + outcome: refuse + python: deviates + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-CT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2053', '#2064', '#2110'] + kind: language + axis: imports-modules + units: [stdlib, module, import, clr-interop] + rule: A Stdlib module's type is reachable only through its module; a bare type name not imported is SPY0202 + with an import steer, except an explicit spec-cited Core interop roster. + outcome: refuse + python: matches + door_stated: two-way + option: a + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: medium +- id: R-CU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2081'] + kind: language + axis: typing-conversion + units: [hash, list, dict, set, tuple] + rule: 'Mutable containers and tuples or records containing them are unhashable: a compile-time refusal at hash(), + dict-key and set-element positions plus a runtime TypeError twin.' + outcome: refuse + python: matches + door_stated: unstated + option: a + audit: + basis: derivable + laws: [T2, CR4] + law_cited: true + confidence: high +- id: R-CV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1898', '#2113'] + kind: language + axis: imports-modules + units: [module, import, stdlib, clr-namespace, shadowing] + rule: A local module binds before stdlib, referenced libraries and CLR namespaces, as Python's sys.path order; + only referenced assemblies count; a default-on warning names the shadow. + outcome: runtime-value + python: matches + door_stated: two-way + option: a + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: medium +- id: R-CW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2131'] + kind: language + axis: imports-modules + units: [module-variable, private-name, import] + rule: 'Underscore-prefixed module variables are module-private like underscore module functions: importing or + qualifying them from another module is SPY0283, decided by one access authority.' + outcome: refuse + python: deviates + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-CX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2122'] + kind: language + axis: imports-modules + units: [from-import, package, submodule, namespace-package] + rule: '`from pkg import sub` binds a child submodule when __init__ does not export the name; a directory without + __init__.spy stays refused with a steer to add one.' + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-CY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2125'] + kind: language + axis: scope-binding + units: [module-variable, const, redeclaration] + rule: Redeclaring an annotated module-level name is refused with SPY0204, as a repeated const already is, instead + of silently keeping the first value. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: derivable + laws: [T1] + law_cited: false + confidence: medium +- id: R-CZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2046'] + kind: language + axis: interop-naming-emission + units: [backtick-identifier, member, name-mangling] + rule: A member's declaration fixes its emitted name and every reference uses it, for class members as for enum + members; a member declared with backticks is reachable by its plain spelling. + outcome: admit + python: no-twin + door_stated: unstated + option: a + audit: + basis: precedent + laws: [plan-0ca7b7 ruling 3] + law_cited: true + confidence: high +- id: R-DA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2126'] + kind: library + axis: numeric + units: [lru-cache, functools, decorator] + rule: lru_cache honours maxsize (None means unbounded, values above the CLR int range saturate with a deviation + row), and `from functools import lru_cache` binds the builtin decorator. + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-DB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2134'] + kind: library + axis: io-os + units: [datetime, strftime, timezone] + rule: strftime %Z uses the C library time-zone name on Unix; on Windows it uses the .NET display name with a + deviation row. + outcome: runtime-value + python: matches + door_stated: unstated + option: a + audit: + basis: derivable + laws: [FS] + law_cited: false + confidence: medium +- id: R-DC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2059'] + kind: library + axis: numeric + units: [int, float, complex, real-imag] + rule: .real and .imag on int and float are not added; their absence is a recorded deviation row, while complex + keeps both. + outcome: deviation-row + python: deviates + door_stated: two-way + option: a + audit: + basis: derivable + laws: [FS] + law_cited: false + confidence: high +- id: R-DD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2047'] + kind: library + axis: interop-naming-emission + units: [stdlib, namespace, package, module] + rule: All Stdlib modules, spy-sourced and hand-written, move under a stdlib package with __init__.spy, namespaced + Sharpy.Stdlib., with one prefix-strip rule replacing the python-name map. + outcome: emission + door_stated: one-way + option: c + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-DE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2136'] + kind: library + axis: interop-naming-emission + units: [json, yaml, toml, serialization, member] + rule: Members whose mangled name differs carry a [SharpyName] attribute, read by one naming policy shared by + json, yaml and toml, so field names round-trip losslessly. + outcome: runtime-value + python: no-twin + door_stated: unstated + option: b + audit: + basis: precedent + laws: [R-CF] + law_cited: true + confidence: high +- id: R-DF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2092'] + kind: language + axis: repr-display + units: [dunder-name, class, function] + rule: '__name__ on both class and function references compiles: classes via the Python type-name helper, functions + via the [SharpyName] attribute on the method; nothing is refused.' + outcome: admit + python: matches + door_stated: unstated + option: b + audit: + basis: precedent + laws: [R-DG] + law_cited: true + confidence: high +- id: R-DG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2105'] + kind: language + axis: repr-display + units: [function, lambda, repr, name-mangling] + rule: Methods whose emitted name differs from the source get a [SharpyName] attribute, so function objects print + , lambdas >; nameless closures get one deviation row. + outcome: runtime-value + python: matches + door_stated: unstated + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-DH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2160'] + kind: language + axis: imports-modules + units: [module, module-identity, source-root] + rule: Two source files mapping to the same dotted module name (derived from the source root by one authority) + are refused with a new validation code naming both files. + outcome: refuse + python: no-twin + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-DI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2164'] + kind: library + axis: interop-naming-emission + units: [list, dict, set, clr-collection, public-api] + rule: Public Core and Stdlib signatures may not use raw .NET container types (KeyValuePair becomes tuple); a + commented list exempts IEnumerable and a few interfaces until a Sharpy Iterable spelling exists. + outcome: emission + door_stated: both + option: a + audit: + basis: derivable + laws: [AP, CV] + law_cited: false + confidence: high +- id: R-DJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2165'] + kind: library + axis: classes-members + units: [lru-cache, functools, decorator, function] + rule: cache_info() and cache_clear() are members of any function memoized by the cache decorator, recognised + from one materialized fact; CacheInfo's str is compared with Python. + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-DK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2168'] + kind: cli-lsp + units: [lsp, formatter] + rule: LSP range formatting returns only the minimal line-diff hunks of the whole-document format that intersect + the range, re-checked on the applied text at one formatter seam. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-DL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2169'] + kind: cli-lsp + units: [formatter, parser, underscore, tuple, decorator] + rule: The parser records how the placeholder, empty tuple and empty parentheses were written, and the unparser + writes that spelling back unchanged. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-DM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2179'] + kind: process + rule: Work group P41 runs first after the chores. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-DN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2182', '#2183'] + kind: implementation + units: [reflection, clr-interop, assembly] + rule: CLR reflection skips unloadable types and unresolvable assemblies with a warning naming them and follows + type forwards; metadata-only loading is deferred. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-DO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2191'] + kind: language + axis: interop-naming-emission + units: [emitter, netstandard, csharp-version] + rule: C# the emitter synthesizes stays within the netstandard2.1 surface, guarded by compiling the emitted corpus + against netstandard2.1 references; no target-framework switch. + outcome: emission + python: no-twin + door_stated: two-way + option: a + audit: + basis: derivable + laws: [A1, CR5] + law_cited: false + confidence: medium +- id: R-DP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2192'] + kind: language + axis: interop-naming-emission + units: [namespace, module, compilation-route] + rule: Without -n, every module's C# namespace is SharpyApp., on every compilation + route. + outcome: emission + python: no-twin + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-DQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2215', '#2219'] + kind: language + axis: imports-modules + units: [import-cycle, annotation, module] + rule: An import cycle compiles only when every symbol imported on every edge is used only in annotations, regardless + of entry or file names; otherwise the diagnostic names the offending import use. + outcome: admit + python: deviates + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-DR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2190'] + kind: language + axis: exceptions + units: [raise, match-expression] + rule: '`raise` is accepted as the body of a match-expression arm only, lowering to a C# throw expression; it + is not a general expression.' + outcome: admit + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-DS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2188'] + kind: language + axis: imports-modules + units: [from-import, parentheses] + rule: Parenthesized `from m import (a, b)` is accepted, and the formatter keeps the written form. + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: medium +- id: R-DT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2210'] + kind: language + axis: patterns + units: [match-expression, brackets, lexer] + rule: A match expression written directly inside brackets stays refused, with a steer to bind it to a local + first. + outcome: refuse + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-DU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2194'] + kind: implementation + units: [range, for-loop] + rule: A for loop over range lowers to a C# for loop and nothing more; direct array indexing is not added. + outcome: emission + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-DV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2175'] + kind: language + axis: interop-naming-emission + units: [clr-namespace, qualified-name, import] + rule: A dotted CLR type name not bound by an import is refused with the import steer; fully qualified names + from referenced assemblies are not a second spelling. + outcome: refuse + python: no-twin + door_stated: two-way + option: a + audit: + basis: derivable + laws: [AP] + law_cited: false + confidence: medium +- id: R-DW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2199'] + kind: language + axis: nullability-narrowing + units: [clr-interop, oblivious-nullability, none] + rule: Members and parameters of nullable-oblivious CLR types accept None when written to and read as non-null + T. + outcome: admit + python: no-twin + door_stated: unstated + option: a + audit: + basis: exception + laws: [A3] + law_cited: false + confidence: medium + amended_by: [R-EH] +- id: R-DX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2198', '#2221'] + kind: language + axis: nullability-narrowing + units: [none, equality, clr-interop, truthiness] + rule: Comparing a CLR reference with == None or != None is refused with an `is None` steer; a CLR implicit conversion + to bool joins the single truthiness predicate. + outcome: refuse + python: deviates + door_stated: two-way + option: a+c + audit: + basis: derivable + laws: [AP] + law_cited: false + confidence: medium + amended_by: [R-ES] +- id: R-DY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2187'] + kind: language + axis: typing-conversion + units: [type, typeof, clr-interop] + rule: '`type(X)` where X names a type means the CLR typeof(X) in every expression position; Python''s `type(int) + is type` differs and is recorded as a deviation row.' + outcome: admit + python: deviates + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-DZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2185'] + kind: language + axis: interop-naming-emission + units: [enum, clr-interop, name-mangling, constant] + rule: CLR enum members and constants resolve by their screaming-caps spelling, the verbatim CLR name keeps working, + and an unknown member is SPY0203 with a did-you-mean. + outcome: admit + python: no-twin + door_stated: two-way + option: b + audit: + basis: derivable + laws: ['SPEC:name_mangling.md', T3] + law_cited: true + confidence: medium +- id: R-EA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2206'] + kind: language + axis: scope-binding + units: [underscore, discard, assignment, backtick-identifier] + rule: A bare `_` as an assignment target is a discard; only the backticked `_` is an ordinary identifier. + outcome: spelling + python: deviates + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-EB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2214'] + kind: language + axis: interop-naming-emission + units: [name-mangling, reflection, backtick-identifier] + rule: Names dispatched by reflection must use the backtick spelling; this is by design, recorded in one spec + sentence, with no acronym table or near-miss warning. + python: no-twin + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-EC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2204'] + kind: process + rule: An issue about SPY0606 is folded into an existing tracker rather than relaxing SPY0606 to a warning now. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-ED + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2209'] + kind: diagnostic + axis: other + units: [keyword, type, backtick-identifier] + rule: '`type` stays a hard keyword; using it as a name gives a diagnostic naming the keyword and the backtick + escape.' + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-EE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2174'] + kind: language + axis: interop-naming-emission + units: [assert, membership, test-host] + rule: In emitted test files, `assert x in c` lowers to Assert.True over the ordinary membership lowering for + every container, and the files disable the related xUnit analyzer warnings. + outcome: emission + python: no-twin + door_stated: unstated + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-EF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2178'] + kind: process + rule: The CI matrix is written on a branch and verified by a PR run whose counts are compared with the sequential + control before merging. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-EG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2229'] + kind: language + axis: classes-members + units: [system-object, class, clr-interop] + rule: System.Object members bind on Sharpy class instances, landing with the inherited-member-name group; until + then the refusal stands. + outcome: admit + python: no-twin + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A1, CV] + law_cited: false + confidence: medium +- id: R-EH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2199', '#2221', '#2230'] + kind: language + axis: nullability-narrowing + units: [clr-interop, oblivious-nullability, none, maybe] + rule: 'Unannotated CLR references have unknown nullability: usable as T, testable with `is None`, maybe-wrappable, + null-checked when stored into a non-null slot; a None test on declared non-null T is refused.' + outcome: runtime-error + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amends: [R-DW] +- id: R-EI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2174'] + kind: library + axis: other + units: [unittest, assert-marker, in-operator] + rule: The unittest assert_in and assert_not_in marker calls are type-checked like the expression `x in c` and + lowered to an assertion on that ordinary lowering, rather than being retired or kept on a contains-assertion. + outcome: runtime-value + python: matches + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-EJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2221', '#2224'] + kind: language + axis: nullability-narrowing + units: [is-none, operator-eq, clr-type, reference-type] + rule: '`is None` and `is not None` are a pure reference null check on every reference type and never run user + code; the `==` operator synthesized from `__eq__` is null-safe.' + outcome: runtime-value + python: matches + door_stated: one-way + option: d+b + audit: + basis: derivable + laws: [A2, T4, T1] + law_cited: false + confidence: medium +- id: R-EK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2223'] + kind: cli-lsp + units: [spyproj, assembly-reference] + rule: A `.spyproj` Reference item honours HintPath as the assembly path with Include as the name; without HintPath, + Include is the path; an unresolved reference is a diagnostic. + outcome: admit + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-EL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2216', '#2223', '#2233'] + kind: process + rule: Making module search paths reach import resolution is filed as a standalone chore now rather than cured + inside the namespaces group or kept in its current group. + door_stated: two-way + option: c + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-EM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2232'] + kind: process + rule: LSP code-action shape preservation becomes its own work group scheduled directly after the preceding LSP + group, not folded into it. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-EN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2199', '#2230'] + kind: process + rule: A new work group runs directly after a named predecessor group and absorbs one of that group's issues + as its first phase. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-EO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2174'] + kind: process + rule: One work group covers the whole unittest assert marker family, generated against the plain-assert twin, + instead of fixing only assert_in and assert_not_in. + door_stated: unstated + option: a + audit: + basis: derivable + laws: [VC1, VC11] + law_cited: false + confidence: high +- id: R-EP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: Accepts the proposed ordering of four work groups and puts the `is None` chore first among chores. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-EQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2234'] + kind: language + axis: imports-modules + units: [import, spyproj, module] + rule: In project mode, an import that resolves to a `.spy` file outside the project's declared source set is + refused with a diagnostic, rather than silently compiling the import closure. + outcome: refuse + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-ER + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2237'] + kind: language + axis: patterns + units: [match, guard, truthiness] + rule: A per-alternative guard in a match arm tests truthiness, the same as the whole-arm guard, instead of requiring + bool in either or both positions. + outcome: admit + python: no-twin + door_stated: two-way + option: a + audit: + basis: derivable + laws: [T3, T4] + law_cited: false + confidence: medium +- id: R-ES + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2221', '#2230', '#2238'] + kind: language + axis: operators + units: [operator-eq, none, clr-type, reference-type] + rule: '`== None` and `!= None` compile on every .NET reference type and run that type''s own `==` operator; + the earlier refusal is lifted for CLR types.' + outcome: admit + python: no-twin + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-EJ] + law_cited: true + confidence: high + amends: [R-DX] +- id: R-ET + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2239'] + kind: cli-lsp + units: [formatter, blank-line] + rule: The formatter keeps up to one user-written blank line between statements, rather than fully canonical + layout or layout preserved exactly as written. + door_stated: one-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-EU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2246'] + kind: language + axis: nullability-narrowing + units: [match, guard, narrowing] + rule: A guard that gates a whole match arm narrows types in the arm body; a per-alternative guard never narrows, + even as the sole alternative. + outcome: admit + python: no-twin + door_stated: both + option: a + audit: + basis: derivable + laws: [A1, T4] + law_cited: false + confidence: medium +- id: R-EV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2236'] + kind: library + axis: other + units: [default-parameter, overload, socket, stdlib] + rule: Where a CPython stdlib function uses a sentinel default, the Sharpy source offers an overload without + that parameter (applying the real default) and one with it, explicit None meaning the Python value. + outcome: runtime-value + python: matches + door_stated: two-way + option: b + audit: + basis: derivable + laws: [FS, AP, CV] + law_cited: true + confidence: high +- id: R-EW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2244'] + kind: library + axis: operators + units: [frozenset, operator-eq, none, deviation] + rule: 'The frozenset `== null` deviation is kept with its stated reason corrected: user programs lower `== None` + to a null test; only Core''s C# and C# consumers bear the residual cost.' + outcome: deviation-row + python: deviates + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-EX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2250'] + kind: process + rule: Concurrency defects become their own work group whose first step is a thread-concurrency harness over + a compile/load/stdlib by thread-count matrix with an allowlist ratchet, before fixing the seams. + door_stated: unstated + option: a + audit: + basis: derivable + laws: [VC11] + law_cited: false + confidence: high +- id: R-EY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2253', '#2259'] + kind: process + rule: A set of small issues ship as ordered chores, measurement chores carrying their table in the commit body, + rather than one plan with a gate. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-EZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: Accepts a batch of reorderings, moves an earlier group forward so a dependent group does not land short, + and folds, posts or closes several issues. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-FA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2260'] + kind: library + axis: other + units: [re, hmac, default-parameter, deviation] + rule: When a stdlib callable accepts a call CPython rejects, a harmless widening (re endpos=None) is a deviation + row, while one users would come to depend on (hmac without digestmod) is refused. + outcome: refuse + python: matches + door_stated: both + option: c + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2260'] + kind: process + rule: A stdlib default-parameter audit becomes its own group with the widened audit (spy-sourced and hand-written + C#, a hand table, each candidate confirmed by a run) first. + door_stated: unstated + option: a + audit: + basis: derivable + laws: [VC11] + law_cited: true + confidence: high +- id: R-FC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2261'] + kind: library + axis: other + units: [threading, thread, lambda, varargs] + rule: threading.Thread's args and kwargs parameters are not supported; this is a recorded deviation whose steer + is to pass a lambda as target. + outcome: deviation-row + python: deviates + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2105', '#2261'] + kind: library + axis: repr-display + units: [threading, thread, thread-name] + rule: A Thread's default name is `Thread-N` (the main thread `MainThread`) and name is a non-null str; the Python + target suffix is deferred. + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: precedent + laws: [R-CJ] + law_cited: true + confidence: medium +- id: R-FE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2261'] + kind: library + axis: nullability-narrowing + units: [threading, thread, optional] + rule: Thread.ident before start() is a recorded deviation rather than typing ident as `int | None`. + outcome: deviation-row + python: deviates + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2260', '#2261', '#2262'] + kind: process + rule: 'An issue is split at the process-wide-state boundary: stateless cells now, state-adding cells after the + concurrency harness group; a related issue is a chore and a group is placed.' + door_stated: unstated + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2263'] + kind: process + rule: The timeout-conversion tracker is widened to every stdlib seconds parameter across modules, as one stdlib-wide + conversion. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC1] + law_cited: false + confidence: high +- id: R-FH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2263'] + kind: library + axis: numeric + units: [timeout, threading, deviation] + rule: A timeout above the CLR's int.MaxValue milliseconds but at or below TIMEOUT_MAX saturates at about 24.8 + days, recorded as one family deviation row. + outcome: deviation-row + python: deviates + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The timeout chore runs first, before an LSP group, since it adds no process-wide state. + door_stated: unstated + audit: + basis: precedent + laws: [R-FF] + law_cited: false + confidence: medium +- id: R-FJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2267', '#2268', '#2269'] + kind: process + rule: Three design issues are scheduled at proposed positions rather than parked; one remains a parked card. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-FK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2271'] + kind: cli-lsp + units: [formatter, lexer, string-literal, indent-repair] + rule: 'The literal-loss fact widens: a lex that dropped a line holding a quote, re-paired a triple quote, or + stopped at its error budget marks the literal map unknown; a generator comes first.' + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2266'] + kind: library + axis: io-os + units: [subprocess, signal, returncode] + rule: Sharpy's subprocess kill, terminate and send_signal deliver the real Unix signal and report negative returncodes + like Python; externally signalled children keep 128+N as one deviation row. + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A2, FS, T1] + law_cited: false + confidence: medium +- id: R-FM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2269'] + kind: language + axis: other + units: [noreturn, return-annotation, attribute] + rule: '`-> NoReturn` is the spelling for a non-returning function, lowering to void with DoesNotReturn honoured + on every callee; `Never` is refused with a steer; raise-only bodies are not inferred.' + outcome: spelling + python: matches + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2267'] + kind: language + axis: scope-binding + units: [implicit-member, enum, static-member, const] + rule: The leading-dot implicit member covers enum members, constants, static fields and properties only, excludes + static methods and constructors, and gets a new refusal code with a qualify fix-it. + outcome: admit + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2268'] + kind: language + axis: other + units: [ref, list, span, array] + rule: A ref to a Sharpy list element is refused with a steer to arrays or spans; ref is allowed for arrays, + struct fields, spans, ref/out parameters and locals. + outcome: refuse + python: no-twin + door_stated: two-way + option: a + audit: + basis: derivable + laws: [T1, T2] + law_cited: false + confidence: low +- id: R-FP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2273'] + kind: cli-lsp + units: [formatter, lexer, indent-repair] + rule: The lex that feeds the indent map continues past its error budget without reporting, so the unread tail + gets real tokens and existing repairs are kept. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-FK] + law_cited: true + confidence: medium +- id: R-FQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2274'] + kind: test-instrument + units: [formatter, lexer, allowlist] + rule: A stray triple quote that leaves the lexer signature of a correct document is a permanent documented limit; + its rows leave the allowlist and become a census floor. + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2275'] + kind: cli-lsp + units: [formatter, lexer, string-literal] + rule: The re-pair arm keys on a dropped span holding a quote on the close line, rather than any lexer error + there or a growing list of codes. + door_stated: two-way + option: b + audit: + basis: precedent + laws: [R-FK] + law_cited: true + confidence: medium + amended_by: [R-FV] +- id: R-FS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2272'] + kind: process + rule: A stdlib docs generator with a guard twin is a chore in the next slot; an unreachable documented member + is filed as a stdlib cell by class at close. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: An LSP sweep group moves to directly before another so its allowlist drains while the sweep and driver + are warm. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-FU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2279'] + kind: cli-lsp + units: [formatter, lexer, bracket, indent-repair] + rule: A lexer fact records a bracket open at end of file and the recovery line; indent-only routes make no edits + below the opener while it is open, keeping repairs above. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-FQ, R-FP] + law_cited: true + confidence: medium +- id: R-FV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2280'] + kind: cli-lsp + units: [formatter, lexer, string-literal] + rule: 'The re-pair arm narrows: a quote in the given-up span counts only if a literal is still open at the line''s + end, with each new tail paired with a positive control.' + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-FR] + law_cited: true + confidence: low + amends: [R-FR] +- id: R-FW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2277'] + kind: language + axis: typing-conversion + units: [function-type, varargs, lambda, function-value] + rule: A function with a *args tail cannot be used as a function value without a lambda; it is refused in the + existing family with a wrap-it-in-a-lambda steer. + outcome: refuse + python: deviates + door_stated: both + option: a + audit: + basis: precedent + laws: [R-BR] + law_cited: true + confidence: high +- id: R-FX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2287'] + kind: process + rule: The stale hand-written grammar file is deleted now; an executable grammar derived from the parser is written + late in its own group. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2286'] + kind: test-instrument + units: [spec-block, output-marker] + rule: The spec output-marker mechanism (running blocks, reporting mismatches, seeding prose that states results) + is a chore now; converting blocks rides the existing review rule and any plan touching a spec file. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-FZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2288'] + kind: process + rule: The exact-diagnostic-code oracle fix in the error injector is a chore now; the per-construct census roster + and new injections become a group after the concurrency group. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2281', '#2282', '#2283', '#2284', '#2285'] + kind: process + rule: Four owner-filed sub-issues form one plan in phases under their parent, scheduled after a named group + and before two others. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-GB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2289'] + kind: process + rule: A mutation-testing pilot runs as a background chore in a lock-idle slot, Lexer first, with a report carrying + the command and measured score; survivors become test-gap issues by class. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The round's group order is fixed as proposed, with the stdlib ICE group and the per-module ledger group + kept in their proposed late slots rather than pulled forward. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2290'] + kind: cli-lsp + units: [formatter, comment, indentation] + rule: Every indent-only formatting route leaves a comment-only line byte-identical, including its leading whitespace, + rather than re-indenting it by column or by the following line. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The indent-only formatter residue becomes its own small group directly before the editor block, with its + generator extended first and a verify round. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-GF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: 'The formatter/indent residue family is capped: further residues become cells on an open tracker and queue + behind waiting user-facing groups, unless they are regressions against the last pushed sha.' + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2291'] + kind: cli-lsp + units: [pdb, windows] + rule: The one PDB-emitting site emits an explicit portable PDB, guarded by a signature check with a mutation + record, as a chore before other work. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-GH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2291'] + kind: test-instrument + units: [ci, release, windows] + rule: Release publishing runs a per-RID smoke of the published artifact, and every push builds and smoke-tests + the CLI on a Windows leg; the full Windows test matrix waits for evidence. + door_stated: two-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2291'] + kind: process + rule: A patch release is cut as soon as the Windows-install fix's gate is green, rather than waiting for the + next minor. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2291'] + kind: process + rule: The investigation comment with the workaround is posted on the issue immediately, before the placement + comment, rather than waiting for the application turn. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2292'] + kind: cli-lsp + units: [cli, dotnet-host, run] + rule: All three dotnet-launching CLI sites share one preflight that refuses before compiling, naming runtime + versus SDK and the install link; an in-process run is parked as a roadmap design. + door_stated: both + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2292'] + kind: diagnostic + axis: other + units: [cli, dotnet-host] + rule: A missing dotnet host tool is a new coded diagnostic shared by all launching sites, with an explanation + entry; the restore site's uncoded message migrates to it. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-GM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2292'] + kind: test-instrument + units: [ci, dotnet-host] + rule: A per-RID CI job runs the archive with dotnet scrubbed from the path and asserts the new code and exit + code, plus a table-driven child-process theory with a path-intact positive control. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-GN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2295', '#2297'] + kind: process + rule: Two issues sharing one mechanism (node end positions read from the wrong token) are one class and one + group with one generator and one shared end-of-token helper. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC1, VC11] + law_cited: false + confidence: medium +- id: R-GO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: Three editor-refactoring groups queue behind the waiting Core silent-wrong groups, applying the residue + cap's reasoning to a second family. + door_stated: two-way + option: b + audit: + basis: precedent + laws: [R-GF] + law_cited: true + confidence: high +- id: R-GP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2296'] + kind: cli-lsp + units: [refactoring, extract, wrap] + rule: Wrap/Extract on a selection holding a declaration referenced after the region is not offered, restoring + the prior verdict now as a chore with a direction record. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC3] + law_cited: true + confidence: high +- id: R-GQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2232', '#2296'] + kind: cli-lsp + units: [refactoring, match, literal, raw-string] + rule: Convert-forms writes header literals as the source token verbatim when legal in the target form, re-spells + as the cooked equivalent only when not, and otherwise is not offered. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2289', '#2300'] + kind: process + rule: The seven mutation-survivor test-gap classes go on one class tracker with seven rows, drained by one tests-only + group, rather than seven issues or a cell table on the pilot's tracker. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-GS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2296'] + kind: cli-lsp + units: [refactoring, try-except, wrap, local] + rule: Wrap in try/except is not offered when a name declared in the selected region is read after it; it is + offered when nothing escapes. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-GT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2239'] + kind: process + rule: Two informational formatter cells stay recorded on the closed issue's close comment, pointed at from the + ledger, rather than opening a new class issue. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-GU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2301', '#2304', '#2309'] + kind: process + rule: The editor residues of the definition/navigation family form one residue group, generator first, placed + late in the editor residue band behind Core work. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-GF] + law_cited: true + confidence: high +- id: R-GV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974', '#2063', '#2125', '#2144', '#2148', '#2150', '#2151', '#2152', '#2153', '#2154', '#2155', + '#2156', '#2206'] + kind: process + rule: The bindings work is regrouped into two plans matching the owner's scope list, with two smaller residue + groups after them; the bindings design rulings are recorded by pointer and never re-asked. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amends: [R-CN, R-BK, R-BL] + cases: + - family: walrus-target + coords: + position: statement + target: let + verdict: refuse + evidence: + program: | + def main() -> None: + let x = 1 + if (x := 2) > 0: + print(x) + print(x) + sharpy: | + runs:2 + 2 + python: no-twin +- id: R-GW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2305', '#2306'] + kind: process + rule: The variance and prop respelling groups go directly after the instrument group, early, to stop corpus + drift before the grammar generator. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-GX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2002', '#2162', '#2303', '#2307'] + kind: process + rule: The expression-position error-type feature joins the type-resolution group as its acceptance gate, a cell + is folded onto its tracker, and both groups move ahead of the group previously preferred first. + door_stated: two-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-GY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2219'] + kind: language + axis: imports-modules + units: [generic, import-cycle, constructor, type-argument] + rule: A constructor call through a type-argued generic reference, or any expression-position type argument naming + a deferred circular-import symbol, is runtime use and refused like a bare constructor call. + outcome: refuse + python: no-twin + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-DQ] + law_cited: true + confidence: medium +- id: R-GZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2302', '#2308', '#2309'] + kind: process + rule: Identity-request resolution and reference recording form one group with one resolver entry point and a + request x spelling x position x target matrix, placed after the editor residue group. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1804'] + kind: process + rule: A parked design for fresh locals on bare store stays parked and is closed only after the bindings change + that moots it is measured. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-HB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2310', '#2312'] + kind: process + rule: REPL echo and repeated-warning defects form one snippet-totality group with one transcript generator compared + against the interactive python twin. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The REPL group is placed after the resolver group, keeping tooling behind the Core silent-wrong groups. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-GF, R-GO, R-GU] + law_cited: true + confidence: high +- id: R-HD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2311'] + kind: diagnostic + axis: other + units: [error-cap, parser, cli] + rule: The maximum-errors cap is enforced at one seam at the parser's counting site, so no recovery diagnostic + follows the Nth error; catch-site copies are removed. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2223', '#2313'] + kind: process + rule: Defect cells left by a closed round get one new successor tracker, placed as its own group with generator + first, instead of staying on or reopening the closed issue. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC10] + law_cited: true + confidence: high +- id: R-HF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2223', '#2313'] + kind: cli-lsp + units: [cli, build, deployment] + rule: The build and project commands deploy referenced assemblies and runtime dependencies beside the output, + like compile and run; a --no-deps flag gives assembly-only output on every producing command. + door_stated: both + option: c + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2223', '#2313'] + kind: cli-lsp + units: [cli, metrics, emit] + rule: The metrics options of emit diagnostics stay rostered as ignored on both branches, as landed, with the + open question recorded as a tracker cell. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-HH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2132'] + kind: language + axis: imports-modules + units: [module, import, filesystem] + rule: Module file names match by exact case on every OS, so a case-mismatched import is refused on case-insensitive + filesystems as on Linux; the module resolution spec gains the sentence. + outcome: refuse + python: matches + door_stated: both + option: a + audit: + basis: derivable + laws: [FS, T4] + law_cited: false + confidence: medium + cases: + - family: spec-silent-acceptance + coords: + spec: silent + python: refuses + sharpy-before: runs + verdict: refuse +- id: R-HI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2182'] + kind: diagnostic + axis: imports-modules + units: [reference, assembly] + rule: The unloadable-reference code keeps one meaning, every registry route reports it unfiltered, and the long-lived-process + duplicate-load case is removed at source rather than coded. + outcome: refuse + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2314'] + kind: language + axis: scope-binding + units: [def, local-function, redefinition] + rule: A second def of the same name in the same block of a function is a compile error; sibling blocks bind + fresh, and nested-block shadowing follows the bindings rules. + outcome: refuse + python: deviates + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: low +- id: R-HK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2063', '#2314', '#2316', '#2319'] + kind: process + rule: The declaration-position totality group is re-scoped and moved ahead of the bindings plans and the variance + group, with its own matrix test extended first. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2321'] + kind: library + axis: interop-naming-emission + units: [random, stdlib-naming] + rule: random.random() is spelled as CPython spells it and the .NET-style name is deleted; the module's other + missing names stay on the per-module ledger. + outcome: spelling + python: matches + door_stated: one-way + option: a + audit: + basis: derivable + laws: [CV] + law_cited: true + confidence: high +- id: R-HM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2320'] + kind: implementation + units: [emitter, codegeninfo, generic] + rule: The emitter's last reflection site becomes a symbol-keyed fact computed in semantic analysis and frozen + on the imported type's CodeGenInfo, as a chore now. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [CR2] + law_cited: true + confidence: high +- id: R-HN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2322'] + kind: process + rule: A host-dependency reference defect joins the reference-target group as its second tracker, acceptance + being one resolution set for loading and for C# metadata references. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2057'] + kind: library + axis: repr-display + units: [str, repr, user-class, iter] + rule: A Sharpy-compiled class is never formatted as a plain CLR sequence by str or repr; the Sharpy-instance + check precedes the sequence check, giving Python's default object display. + outcome: runtime-value + python: matches + door_stated: unstated + option: a + audit: + basis: derivable + laws: [FS, R-CF] + law_cited: true + confidence: high +- id: R-HP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2169'] + kind: implementation + units: [unparser, conditional-expression] + rule: The pretty-printer gives a conditional's test position the same precedence context as its branches, and + the pin and hardening item for it are deleted. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2324'] + kind: process + rule: The typed-generator injection-reach residue is a new group placed after the declaration totality group + with a mutation generator first, ahead of tooling residues. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2074', '#2335'] + kind: process + rule: The entry-point shape issue stays open as a tracker in the module-kind group, and its access-decorator + cells move to the access tracker. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-HS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2074', '#2335'] + kind: language + axis: classes-members + units: [decorator, access-modifier, top-level-type] + rule: '@private or @protected on a top-level type is refused with the steer that module-level privacy is spelled + _Name; nested types keep the member access table.' + outcome: refuse + python: no-twin + door_stated: two-way + option: a + audit: + basis: derivable + laws: [AP, A1, 'SPEC:decorators.md'] + law_cited: true + confidence: high +- id: R-HT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2300'] + kind: language + axis: numeric + units: [int-literal, leading-zero] + rule: Decimal integer literals with leading zeros are accepted as digits, C#'s rule, recorded as a deviation + row and a spec sentence; no compiler change. + outcome: deviation-row + python: deviates + door_stated: one-way + option: a + audit: + basis: derivable + laws: [FS, A1] + law_cited: true + confidence: medium + cases: + - family: spec-silent-acceptance + coords: + spec: silent + python: refuses + sharpy-before: runs + verdict: run + evidence: + program: | + def main() -> None: + print(01) + twin: | + print(01) + sharpy: | + runs:1 + python: refused:SyntaxError +- id: R-HU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2340'] + kind: language + axis: numeric + units: [float-literal, decimal, numeric-literal] + rule: Every numeric literal outside the range of its own resolved type is a compile error at one semantic seam; + float64 literals never become infinity. + outcome: refuse + python: deviates + door_stated: both + option: a + audit: + basis: derivable + laws: [A3, T1, T2] + law_cited: true + confidence: medium +- id: R-HV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2340'] + kind: process + rule: The literal-range fix is a seam-free chore in the current band riding the declaration group's gate, with + a closed type x spelling x magnitude theory and mutation record. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC1, VC11] + law_cited: true + confidence: medium +- id: R-HW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2300'] + kind: language + axis: interop-naming-emission + units: [identifier, unicode] + rule: Identifier letters are limited to the Basic Multilingual Plane, C#'s identifier alphabet; a supplementary-plane + letter stays refused and is recorded as a deviation row plus a spec sentence. + outcome: deviation-row + python: deviates + door_stated: both + option: a + audit: + basis: derivable + laws: [A1, FS] + law_cited: true + confidence: medium +- id: R-HX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2337', '#2338', '#2339'] + kind: process + rule: 'Three lexer issues are placed by class: the f-string dedent arm into the prefix-table group, the token-position + defect into the position-contract group, and the numeric-suffix defect as a separate chore landing first.' + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC11, VC1] + law_cited: true + confidence: high +- id: R-HY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The f-string prefix/escape table group moves up to run directly after the current tests-only group, after + the numeric-suffix chore and before the keyword codemods that rewrite the same lexer. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-HZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2342'] + kind: test-instrument + rule: Python-twin tests skip through one helper that reports a counted skip when no python oracle is present; + a required mode fails instead in CI; a census guard keeps ad hoc 'SKIP:' returns at zero. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-IA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2344'] + kind: language + axis: numeric + units: [decimal, numeric-literal] + rule: A non-zero decimal literal whose value underflows to zero is refused on both the suffixed and the annotated + spelling; float32 and float64 keep IEEE underflow to zero. + outcome: refuse + python: no-twin + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-IB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2344'] + kind: process + rule: 'Three literal-typing defects form one chore under a widened contract: a numeric literal''s type, value + and admissibility are decided once at one seam every consumer reads, with a consumer axis added to the range + matrix.' + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC1] + law_cited: true + confidence: high +- id: R-IC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2344'] + kind: language + axis: typing-conversion + units: [numeric-literal, sized-int, unsigned] + rule: An unsuffixed integer constant whose value fits an unsigned type converts to it at every site (annotated + slot, operand, argument, return, const); a constant that does not fit keeps its own type. + outcome: admit + python: no-twin + door_stated: both + option: a + audit: + basis: derivable + laws: [A1, 'SPEC:integer_literals.md'] + law_cited: true + confidence: high +- id: R-ID + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2343'] + kind: test-instrument + rule: The isolation sweep samples a fixture when a deterministic hash of its stem is divisible by 16, so inserting + a fixture moves only itself; stale allowlist rows are reported, never dropped silently. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-IE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2143'] + kind: language + axis: classes-members + units: [class, inheritance, list, dict, set] + rule: Subclassing a Core collection type is refused because those types are sealed; a deviation row and spec + sentence record it, and the diagnostic is replaced by a sealed-base refusal steering to composition or protocols. + outcome: deviation-row + python: deviates + door_stated: both + option: a + audit: + basis: derivable + laws: [FS, A1] + law_cited: true + confidence: medium +- id: R-IF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2057'] + kind: language + axis: repr-display + units: [generator, str-repr, iteration] + rule: A generator's str/repr is '' without enumerating it; that generators re-run their + body on each iteration (IEnumerable) is recorded as a deviation row and spec sentence. + outcome: runtime-value + python: matches + door_stated: both + option: a + audit: + basis: precedent + laws: [R-HO, R-CF, R-CM] + law_cited: true + confidence: medium +- id: R-IG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2261'] + kind: library + axis: exceptions + units: [threading, thread, exception] + rule: An exception escaping a thread's target or run method is printed to stderr as CPython's thread excepthook + does and the process continues; exit code and continuation are compared with Python, message text beyond the + type is not. + outcome: runtime-error + python: matches + door_stated: two-way + option: a + audit: + basis: derivable + laws: [CV] + law_cited: false + confidence: medium +- id: R-IH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2342'] + kind: test-instrument + rule: The no-vacuous-pass tracker is reopened; precondition skips report Skipped through a general helper, swallowed + compile failures become hard failures, and the skip census widens to 'skipping' strings. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC10, VC2] + law_cited: true + confidence: high +- id: R-II + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2359'] + kind: language + axis: scope-binding + units: [import-alias, module, builtin-shadowing] + rule: 'An import alias is checked like every other module binding: a same-module collision is SPY0204, a builtin + type name is SPY0212, and a builtin function name gets the same shadowing verdict as a def of that name.' + outcome: refuse + python: deviates + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-HJ, R-CY] + law_cited: true + confidence: high +- id: R-IJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2359', '#2360', '#2362'] + kind: process + rule: A new declaration-rule residue group of three issues is placed directly after the current tests-only group + and before the lexer group, extending its existing generator first. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: true + confidence: medium +- id: R-IK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2362'] + kind: diagnostic + axis: classes-members + units: [property, event, def, declaration-position] + rule: A property, event or accessor declared inside a def reuses SPY0708 (declaration kind not allowed at this + position) with the kind named in the message, rather than a new code. + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-IL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2361'] + kind: process + rule: Same-named nested defs in different match arms are fixed in the local-naming group as one symbol-keyed + versioned name read at declaration and every call site, never by a lowering fallback. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC3, VC11, CR2] + law_cited: true + confidence: medium +- id: R-IM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2057'] + kind: language + axis: repr-display + units: [union, str-repr, result, optional] + rule: str and repr of a user union value are its constructor spelling with payload reprs, unit cases parenthesized + ('Shape.Empty()'); Result follows; a user __str__/__repr__ wins; the surface becomes compared. + outcome: runtime-value + python: no-twin + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + cases: + - family: wrapper-str + coords: + wrapper: result + conversion: str + verdict: run + answer: constructor + evidence: + program: | + def main() -> None: + r: Result[int, str] = Ok(1) + print(r) + sharpy: | + runs:Ok(1) + python: no-twin +- id: R-IN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2353'] + kind: language + axis: patterns + units: [match, case-literal] + rule: A match arm duplicating an earlier literal case compiles with an unreachable-case warning, and the first + arm wins under every lowering, decided at one seam. + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: derivable + laws: [FS, CR7] + law_cited: false + confidence: medium +- id: R-IO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2355'] + kind: language + axis: other + units: [semicolon, statement] + rule: Semicolons do not separate statements; every separator position draws a dedicated parse diagnostic with + a steer, recorded as a deviation row and a spec sentence. + outcome: deviation-row + python: deviates + door_stated: two-way + option: a + audit: + basis: derivable + laws: [AP, FS] + law_cited: true + confidence: high +- id: R-IP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2356'] + kind: language + axis: operators + units: [tuple, comparison, sorted] + rule: Ordering operators on tuples work with Python's lexicographic semantics through the one comparer engine + sorted uses; an unorderable element pair is refused statically naming its position. + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: derivable + laws: [A2, T2] + law_cited: true + confidence: medium +- id: R-IQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2349', '#2350'] + kind: library + axis: numeric + units: [math] + rule: Stdlib math values must match python3 within a stated per-function ulp bound; this becomes a compared + surface, with a differential numerics corpus built first in a new Stdlib group. + outcome: runtime-value + python: matches + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-IR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2351'] + kind: library + axis: numeric + units: [int, sized-int, sys] + rule: int and every sized int gain to_bytes, from_bytes, bit_length and bit_count through one size-keyed helper, + plus sys.byteorder; non-fitting values raise OverflowError, recorded as deviation rows. + outcome: admit + python: matches + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-IS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2357'] + kind: library + axis: exceptions + units: [int, parse] + rule: A well-formed integer string that does not fit the target sized int raises OverflowError, recorded as + a deviation; each sized int parses its own range; PEP 515 underscores are accepted at one shared parser. + outcome: runtime-error + python: deviates + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-IT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2347'] + kind: library + axis: strings-formatting + units: [str, char] + rule: center, ljust and rjust take a str fill character validated to length one with CPython's TypeError, dropping + the char overload; the CLR char-route parity cell is filed on its class tracker. + outcome: admit + python: matches + door_stated: one-way + option: c + audit: + basis: derivable + laws: [CV] + law_cited: false + confidence: medium +- id: R-IU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2366'] + kind: language + axis: patterns + units: [match, capture] + rule: A name captured twice in any pattern spelling is refused with SPY0372, generalised, as python3 refuses + it. + outcome: refuse + python: matches + door_stated: both + option: a + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: high +- id: R-IV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2363'] + kind: language + axis: exceptions + units: [try-except, except-handler] + rule: A dead typed except handler draws a warning and is omitted so the program runs first-wins; a non-final + bare except is refused; the unreachable-arm fact is shared with match arms. + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-IN] + law_cited: true + confidence: high +- id: R-IW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2286'] + kind: language + axis: other + units: [expression-statement, conditional-expression, lambda] + rule: A None-typed non-call expression statement (a conditional of calls, a bare lambda, a module reference) + stays refused with SPY0603; the spec states the rule and a deviation row records it. + outcome: refuse + python: deviates + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: true + confidence: medium +- id: R-IX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2324'] + kind: process + rule: The per-sample cost cut is a chore riding the next gate; the injection-instrument residue becomes a new + tests-only group placed after the syntax and silent-wrong bands. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-IY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2310'] + kind: cli-lsp + units: [repl, import, class] + rule: In a mixed REPL submission, imports and type definitions register at module level while defs, aliases, + declarations and statements stay in the synthesized main in order; both commit only on success. + outcome: admit + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-CS] + law_cited: true + confidence: high +- id: R-IZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2359'] + kind: language + axis: imports-modules + units: [import-star, import, import-alias] + rule: An explicit import of a different source collides with a star-imported name in either order, reported + as SPY0204 at the explicit import. + outcome: refuse + python: deviates + door_stated: two-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-JA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: A second declaration-rule residue group is placed directly after the first, before the lexer group, extending + its generator first. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-IJ] + law_cited: true + confidence: high +- id: R-JB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2360', '#2372'] + kind: process + rule: The reopened issue stays the class tracker under a broader title; the duplicate issue's table is posted + there and it is closed. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-JC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2359'] + kind: implementation + rule: The dead single-file import route is deleted, its one test re-homed on the project pipeline, and a census + guard pins one caller of the import-binding function. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: true + confidence: medium +- id: R-JD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2369', '#2370'] + kind: language + axis: classes-members + units: [property, setter] + rule: A set-only property is typed by its setter's parameter, and a setter's return annotation must be None + or absent; the class homes go to the property group, with this arm landing now as a chore. + outcome: admit + python: matches + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: low +- id: R-JE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2075'] + kind: test-instrument + rule: A known cascade in the property-test error injector is pinned by shape, reported, and fails once the shape + stops cascading; it drains with the planned sentinel rather than a local fix. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-AZ] + law_cited: true + confidence: high +- id: R-JF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2382', '#2384', '#2385', '#2386', '#2389', '#2390'] + kind: process + rule: Six residue issues form two groups, type bodies and module bindings, placed back-to-back before the lexer + group with generators extended first. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-JG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2382'] + kind: language + axis: classes-members + units: [interface, property, accessor] + rule: In an interface, an abstract property half beside a bodied half is refused at the later half with one + dedicated code, in both orders; both-abstract and both-bodied pairs keep running. + outcome: refuse + python: no-twin + door_stated: two-way + option: a + audit: + basis: derivable + laws: [A1, T2] + law_cited: false + confidence: high +- id: R-JH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2390'] + kind: language + axis: scope-binding + units: [interface, explicit-interface, member] + rule: An explicit-interface member does not claim the bare name, so 'area' and 'IShape.area' coexist as in C#; + collision is keyed on name plus interface. + outcome: admit + python: no-twin + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A1] + law_cited: false + confidence: high +- id: R-JI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2390'] + kind: diagnostic + axis: classes-members + units: [union, member] + rule: Union-case name collisions go through the general member-declaration seam, and SPY0365 is retired into + SPY0204 with a retirement note. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [P21g-D3] + law_cited: true + confidence: medium +- id: R-JJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2384'] + kind: language + axis: scope-binding + units: [class-body, field-initializer, parameter-default] + rule: A bare class-body name read outside a method resolves only what C# resolves at that position (const/static + siblings in field initializers, const in parameter defaults); other siblings are SPY0200 with a steer. + outcome: refuse + python: deviates + door_stated: both + option: c + audit: + basis: exception + laws: [N1] + law_cited: true + confidence: medium + amended_by: [R-KD] +- id: R-JK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2389'] + kind: language + axis: imports-modules + units: [re-export, import, module] + rule: A re-export resolves to its defining module and symbol before import identities are compared, so importing + one symbol via a package re-export and directly is not a collision. + outcome: admit + python: matches + door_stated: both + option: b + audit: + basis: derivable + laws: ['SPEC:import_statements.md', 'SPEC:module_system.md'] + law_cited: true + confidence: medium +- id: R-JL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2383'] + kind: language + axis: classes-members + units: [interface, property, default-interface-member] + rule: A defaulted get-only interface property is a C# default interface member; a settable defaulted one is + refused with a steer, since an interface has no storage. + outcome: admit + python: no-twin + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A1, AP] + law_cited: true + confidence: medium +- id: R-JM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2391'] + kind: process + rule: Static-overload calls through a type name are fixed now as a semantic-only chore with a receiver × kind + × overload-count guard, not queued behind the overload sentinel group. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-JN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2383'] + kind: process + rule: No stopgap refusal for defaulted interface properties; the crash waits for the property group where the + ruled lowering lands. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-JO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2075'] + kind: diagnostic + axis: classes-members + units: [property, accessor] + rule: Colliding declarations produce one SPY0204 per colliding declaration group; later halves of the same property + are silent. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-JP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2394'] + kind: language + axis: generics + units: [lambda, overload, type-inference] + rule: For an unannotated lambda passed to an overload set, arity and other arguments narrow candidates first; + agreeing survivors type the lambda; disagreeing survivors draw SPY0343 asking to annotate; the body never + picks an overload. + outcome: refuse + python: no-twin + door_stated: both + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-JQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2394'] + kind: process + rule: Typing a lambda argument by the overload its call resolves to gets its own full-tier group with a generator + built first, placed right after the group it builds on, not folded into a distant tracker or a band chore. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-JR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: Charter tiers are the contract-derived letters, except four groups (two keyword codemods, two tests-only + instruments) overridden down to light; tiers may only move upward once planning begins. + door_stated: unstated + option: b + audit: + basis: exception + laws: [VC12] + law_cited: true + confidence: medium +- id: R-JS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2395'] + kind: language + axis: classes-members + units: [property, auto-property, setter] + rule: 'A lone auto-property setter is admitted: the compiler synthesizes a private backing field named as function-style + accessors already read it, keeping the spec rows that allow it.' + outcome: admit + python: no-twin + door_stated: two-way + option: a + audit: + basis: derivable + laws: [CR7] + law_cited: true + confidence: high +- id: R-JT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2396'] + kind: language + axis: initialization + units: [static-member, class, field, initializer-order] + rule: 'A type''s members are emitted in source order so C#''s textual initialization order equals the Sharpy + source and Python''s class-body order; the forward static-read refusal (later superseded: it now runs) was + part of the ruling.' + outcome: emission + python: matches + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amended_by: [R-KD] +- id: R-JU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2396'] + kind: process + rule: Static-initializer source order gets its own full, alone group with a generator first, scheduled directly + after the group it depends on so the silent wrong value does not wait two plans. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-JV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2398'] + kind: language + axis: scope-binding + units: [lambda, class-body, initializer, static-member] + rule: A lambda in a class-body initializer may read whatever its enclosing initializer may read, in source order; + instance siblings stay refused with a steer naming the lambda. + outcome: admit + python: deviates + door_stated: two-way + option: b + audit: + basis: exception + laws: [N1, CR7] + law_cited: false + confidence: medium + amended_by: [R-KF] +- id: R-JW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2397', '#2398', '#2400', '#2401'] + kind: process + rule: 'The class-body residue is distributed by class: one issue to a new class-body-read group, others to existing + trackers for modifiers and type-reference positions, one to the band, an enum cell to its tracker.' + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amended_by: [R-KF] +- id: R-JX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2399'] + kind: process + rule: A false refusal where two codes count an explicit-interface member by its bare name is fixed now as a + band chore with a closed-axis guard, riding a gate whose group shares no seam. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-JM] + law_cited: true + confidence: high +- id: R-JY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1928', '#2402', '#2403', '#2408'] + kind: process + rule: The residue of one-name-one-meaning consumer crashes forms a new full group with a generator first, placed + right after the preceding residue group, instead of being scattered to distant trackers. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-JZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2408'] + kind: language + axis: imports-modules + units: [import, import-star, module-variable] + rule: An explicit import keeps its name whatever the order relative to a star import, so a module variable colliding + with it is a same-scope re-declaration error even when the star came first. + outcome: refuse + python: deviates + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2404'] + kind: implementation + units: [list, indexing, core] + rule: 'Core element access gets a new light group: a throw-helper fast path at every accessor first, and direct + backing-storage indexing only if the kernel stays over 1.3x the BCL list.' + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2409'] + kind: process + rule: The backing-field collision check gains the module host as a band chore now, turning a crash into a refusal, + rather than waiting for the modifier group far down the queue. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-JM] + law_cited: true + confidence: medium +- id: R-KC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2116', '#2406'] + kind: language + axis: imports-modules + units: [import, re-export, package, assignment] + rule: Assigning through an import binding (a package forwarder or re-export) is a compile error with a steer + to assign through the declaring module; reads stay live and a deviation row records it. + outcome: refuse + python: deviates + door_stated: both + option: a + audit: + basis: derivable + laws: [T1, T3, FS] + law_cited: false + confidence: medium +- id: R-KD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2421', '#2422', '#2423', '#2424', '#2425', '#2426', '#2427'] + kind: process + rule: 'The name-resolution principle is implemented as one block of five plans in fixed order: harness, then + N3 alone, then N1/N2/N4/N7, then N6, then S2.' + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC11] + law_cited: true + confidence: high + amends: [R-JJ, R-JT] +- id: R-KE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2421'] + kind: process + rule: The tests-only name-resolution harness group is light tier, since the full-tier reading dimensions have + nothing to grade in a tests-only plan; tiers never lower once set. + door_stated: unstated + option: a + audit: + basis: exception + laws: [VC12] + law_cited: false + confidence: medium +- id: R-KF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2398'] + kind: process + rule: The class-body read residue group dissolves into the N1/N2 plan, its scope-by-host matrix becoming that + plan's hand control beside the harness generator. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC11] + law_cited: true + confidence: high + amends: [R-JV, R-JW] +- id: R-KG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2398'] + kind: language + axis: scope-binding + units: [nested-class, class-body, name-lookup] + rule: A nested type body reading the enclosing type's members by bare name is refused with a steer to qualify + them, as class scopes do not nest in Python. + outcome: refuse + python: matches + door_stated: both + option: a + audit: + basis: derivable + laws: [N1, A2, T4] + law_cited: true + confidence: high +- id: R-KH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2249'] + kind: process + rule: The type-member declaration-order group moves up to directly after the name-resolution block, and its + required generator becomes an extension of the block's existing harness. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The name-resolution block is scheduled directly after the Core accessor group and before other pending + groups, because it cures silent wrong values, common false refusals and a temporary refusal. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-JU] + law_cited: true + confidence: high +- id: R-KJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2413', '#2415', '#2416'] + kind: process + rule: Two closure issues are folded into the N3 tracker and closed, a third closed as resolved by N2's refusal, + and one kept open because allowlist rows cite it. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC10] + law_cited: false + confidence: medium +- id: R-KK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2365'] + kind: test-instrument + rule: The nightly red from a None-literal receiver is pinned by a self-failing known-red draw filter keyed on + that shape and citing its issue, rather than left red or spot-fixed outside its class. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-JE] + law_cited: true + confidence: high +- id: R-KL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2351', '#2410'] + kind: process + rule: Two integer-construction and primitive-method issues join the existing call-resolution group by class + rather than forming a new earlier group. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2429'] + kind: library + axis: interop-naming-emission + units: [index, slice, range, core] + rule: Three public C#-only from-end index and range conversions in Core are deleted; the list's Index and Range + indexers remain the C# route. + python: no-twin + door_stated: one-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2404'] + kind: process + rule: Six Stdlib accessor cells of the inlining class are recorded on the closed tracker only; the throw-helper + shape is applied to a Stdlib accessor when a benchmark shows it hot. + door_stated: two-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2433'] + kind: process + rule: The name-resolution harness residue gets a new tests-only group immediately after the harness group and + before the N3 plan, rather than being folded into each rule plan. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC11] + law_cited: true + confidence: high +- id: R-KP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2433'] + kind: test-instrument + rule: The name-resolution harness cell budget rises to about 7,400 and every pruned outer kind and builtin is + restored, re-ratcheting the resulting reds. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC11] + law_cited: false + confidence: medium +- id: R-KQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2433'] + kind: process + rule: The harness-residue group is light tier although a full-tier residue criterion matches literally, overridden + as for the harness group. + door_stated: unstated + option: a + audit: + basis: exception + laws: [VC12] + law_cited: false + confidence: medium +- id: R-KR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2438'] + kind: test-instrument + rule: Sweep tests mute their compile output and a per-result stdout ceiling guards the class, fixing an out-of-memory + in result sending; no memory sampler is added yet. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2436'] + kind: library + axis: other + units: [slice, range, list, core] + rule: Indexing by a slice value, negative range indexing and slicing, and slice repr are promoted to match Python + in Core; slice assignment is recorded as a deviation. + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2434'] + kind: language + axis: scope-binding + units: [struct, closure, self] + rule: Capturing self in a closure inside a struct method is a compile error with a named code and a steer to + copy self to a local. + outcome: refuse + python: no-twin + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A1, T1, T2] + law_cited: true + confidence: high +- id: R-KU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2435'] + kind: language + axis: classes-members + units: [static-member, self, inheritance, assignment] + rule: Storing to a static field or property through self or a derived type is a compile error steering to write + through the declaring type, since Python's per-instance meaning cannot be matched. + outcome: refuse + python: deviates + door_stated: one-way + option: a + audit: + basis: derivable + laws: [N2, A2] + law_cited: false + confidence: medium +- id: R-KV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2432'] + kind: process + rule: The constant-position validator is placed in the N1/N2/N4/N7 plan under N4, not in the modifier group + whose member table it reads. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2437'] + kind: language + axis: typing-conversion + units: [lambda, none, callable] + rule: A lambda whose body yields a value is refused in a slot expecting a None return, with the same type-mismatch + error a wrong-typed body gets elsewhere. + outcome: refuse + python: no-twin + door_stated: two-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-KX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2425', '#2427'] + kind: language + axis: scope-binding + units: [local, shadowing, declaration-order] + rule: Reading a name above its same-scope declaration while an outer binding exists is a compile error saying + the name is declared later in this scope. + outcome: refuse + python: matches + door_stated: unstated + option: a + audit: + basis: derivable + laws: [N1, N5] + law_cited: true + confidence: medium +- id: R-KY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2424', '#2427'] + kind: language + axis: scope-binding + units: [function, class, assignment, global] + rule: A store to a function, class, struct, enum, union, interface or alias name is refused in every store form + with one code and a steer to declare a new local. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: derivable + laws: [N6, N7] + law_cited: true + confidence: high +- id: R-KZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2425', '#2427'] + kind: language + axis: scope-binding + units: [match, capture, as] + rule: 'Match and as captures are fresh per arm: without an outer binding a later read stays undefined; with + one, a later read is refused as for a loop target.' + outcome: refuse + python: deviates + door_stated: one-way + option: a + audit: + basis: derivable + laws: [S2, N5, T4] + law_cited: true + confidence: high +- id: R-LA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2425', '#2427'] + kind: language + axis: scope-binding + units: [builtin, for, shadowing] + rule: A builtin counts as a visible outer binding for the construct-target rule, so reusing a builtin's name + as a loop target and calling it afterwards is refused. + outcome: refuse + python: matches + door_stated: unstated + option: a + audit: + basis: derivable + laws: [S2, T4] + law_cited: true + confidence: high +- id: R-LB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2426', '#2427'] + kind: language + axis: scope-binding + units: [let, for, while, match, block-scope] + rule: A let in a for body, loop else body or match case is block-scoped, recorded as deviation rows, with a + must-run harness arm. + outcome: deviation-row + python: deviates + door_stated: unstated + option: a + audit: + basis: derivable + laws: [CR14, FS] + law_cited: false + confidence: medium +- id: R-LC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2425', '#2427'] + kind: language + axis: scope-binding + units: [nested-function, closure, declaration-order] + rule: A nested function reading an enclosing local declared below it is refused as declared later, with or without + an outer binding. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: precedent + laws: [R-KX] + law_cited: true + confidence: high +- id: R-LD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974', '#2427'] + kind: language + axis: scope-binding + units: [redeclaration, parameter, nested-function] + rule: Re-declaring a name in the same scope, including a nested def over a parameter, is refused as a same-scope + re-declaration rather than silently keeping the first value. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: precedent + laws: [R-HJ] + law_cited: true + confidence: high +- id: R-LE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2425', '#2427'] + kind: diagnostic + axis: scope-binding + units: [lambda, recursion, local] + rule: A lambda-typed local reading itself stays refused, with the message steering to write a nested def instead. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-LF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974', '#2426', '#2427'] + kind: language + axis: scope-binding + units: [block-scope, let, def, lambda, closure] + rule: The block-scope deviation row widens to every binder in every block body; two same-block closure re-declaration + cells go to the shadowing tracker. + outcome: deviation-row + python: deviates + door_stated: unstated + option: a + audit: + basis: precedent + laws: [R-LB] + law_cited: false + confidence: medium +- id: R-LG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2426', '#2427'] + kind: language + axis: scope-binding + units: [for, closure, loop-variable, with, except] + rule: Every binding made inside a loop body is fresh per iteration, so a closure created in the loop captures + that iteration's value; the deviation row widens accordingly. + outcome: deviation-row + python: deviates + door_stated: one-way + option: a + audit: + basis: derivable + laws: [N5, T4] + law_cited: false + confidence: medium +- id: R-LH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2424', '#2427'] + kind: language + axis: classes-members + units: [method, assignment, class-body] + rule: A bare assignment over a method's name is refused with the same code as for fields and a steer to declare + a new local, one verdict per member kind. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: derivable + laws: [N7, CR7, T4] + law_cited: true + confidence: high +- id: R-LI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2427'] + kind: diagnostic + axis: scope-binding + units: [lambda, local, declaration-order] + rule: The rule against calling a local def before its definition stays def-only; a lambda-typed local read early + is cited under the declared-later rule instead, with the same verdict. + outcome: refuse + door_stated: unstated + option: a + audit: + basis: precedent + laws: [R-KX] + law_cited: true + confidence: high +- id: R-LJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2426', '#2427'] + kind: language + axis: scope-binding + units: [module-variable, builtin, import, initializer] + rule: A module-level initializer that reads a builtin or imported name at or before its own same-named declaration + is refused as ambiguous. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: derivable + laws: [N2] + law_cited: true + confidence: medium +- id: R-LK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2443'] + kind: implementation + rule: 'The emitter port to a lowering IR resumes as one full group: the IR becomes the emitter''s only input, + SemanticInfo freezes after validation, node-keyed tables may only fall, and new lowering facts are IR node + properties.' + outcome: emission + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amended_by: [R-LV, R-MB] +- id: R-LL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2439'] + kind: process + rule: Constructor-body lowering gets a new full-tier group placed directly after the IR port's row and ahead + of the Core band, rather than joining a later tranche or the host-variance group. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-LM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2498'] + kind: library + axis: nullability-narrowing + units: [optional, dict, nullable] + rule: Sharpy's V? is Optional, so dict.get returns Optional; no code changes, and the anti-pattern against + Optional returns is scoped to Stdlib C# APIs consumed from .NET. + python: deviates + door_stated: one-way + option: a + audit: + basis: derivable + laws: [CV, AP, CR7] + law_cited: true + confidence: medium +- id: R-LN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2457'] + kind: test-instrument + rule: Most cells of the issue become a new tests-only light group; one cell is posted to the bindings group's + tracker and two become a band chore. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-LO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2486', '#2487', '#2488', '#2489', '#2494'] + kind: process + rule: Each executable rule table is built as the generator row of the group that consumes it, with one tracker + across them, rather than one tooling group building all tables ahead of their consumers. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-LP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2495'] + kind: library + axis: strings-formatting + units: [codec, encode, decode, open, chr] + rule: One shared codec table (name to encoding plus BOM policy) serves encode, decode and open; error handlers + form a closed enumeration with a totality test; open gains errors=; chr returns a lone surrogate. + outcome: runtime-value + python: matches + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-LQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2397'] + kind: language + axis: classes-members + units: [nested-class, self, static-member] + rule: Calling a nested type through self, self.N(), compiles and is lowered to the type-qualified C.N(), the + same rule as other class attributes read through self. + outcome: admit + python: matches + door_stated: one-way + option: a + audit: + basis: derivable + laws: [N1, A2] + law_cited: false + confidence: medium +- id: R-LR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974', '#2427'] + kind: language + axis: scope-binding + units: [walrus, let] + rule: A walrus assignment targeting a let binding is decided in the let/var plan with let's own semantics; until + then the cells stay pinned Unruled and docs keep the open question. + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high + cases: + - family: walrus-target + coords: + position: statement + target: let + verdict: open +- id: R-LS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2424'] + kind: language + axis: scope-binding + units: [nonlocal, for-target, with-target, except-target] + rule: nonlocal x over a for, with or except target gets the same refusal and steer as global x does. + outcome: refuse + python: deviates + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-MI] + law_cited: true + confidence: high +- id: R-LT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: 'Work runs in two lanes: the IR port''s second tranche on its own PR series while the Core band runs, + then the name-resolution block, one group per plan per lane.' + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: true + confidence: high +- id: R-LU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The Core band groups run ahead of the codemod groups. + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-LV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2443'] + kind: language + axis: nullability-narrowing + units: [walrus, tuple, optional] + rule: A walrus inside a tuple prints the plain value, not Some(value), fixed in the IR port's first tranche; + the walrus site carries an explicit own-site Optional wrap so the strict-Optional guard stays unrelaxed. + outcome: runtime-value + python: matches + door_stated: one-way + option: B + audit: + basis: derivable + laws: [T1, FS] + law_cited: false + confidence: medium + amends: [R-LK] +- id: R-LW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: Plan bodies are capped at 20 KB excluding verification summaries, at most two verify passes run before + an open finding goes to the owner, and light plans keep their adequacy pass. + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: true + confidence: high +- id: R-LX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: test-instrument + rule: Every allowlist row carries a structured issue cite, each generator has one ledger, and every cited issue + must be a class issue with a cell table, replacing the per-issue row cap. + door_stated: two-way + audit: + basis: derivable + laws: [VC10] + law_cited: false + confidence: medium +- id: R-LY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: Keep the dev branch and protect it to require pull requests, keep the nightly mainline soak, and enforce + the 72-character commit-subject check. + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-LZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2497'] + kind: test-instrument + rule: One pinned CPython minor in a single file serves every workflow; the pin is the newest minor whose first + bugfix release has shipped, bumped at a batching call (3.14 at the time). + door_stated: two-way + audit: + basis: exception + laws: [CR6] + law_cited: false + confidence: medium +- id: R-MA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: Items already filed are closed by default; one tooling issue is placed as a band row, and three unfiled + chores are left for the owner to file or drop. + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-MB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2443'] + kind: implementation + rule: MergeFrom accepts a key present in both operands when the values are equal and throws on a conflicting + value, replacing the earlier disjoint wording. + door_stated: one-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: high + amends: [R-LK] +- id: R-MC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2461', '#2467'] + kind: test-instrument + rule: Permanent bug-guard rows in the stdlib CLR-throw allowlist cite one standing tracker that stays open while + the file has rows and whose count may only fall. + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-MD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2087', '#2124', '#2476'] + kind: library + axis: exceptions + units: [oserror, ioerror, exception-hierarchy] + rule: Core defines one OSError deriving from IOException, with FileNotFoundError, FileExistsError, IsADirectoryError + and PermissionError deriving from it, and IOError an alias of OSError. + outcome: runtime-error + python: matches + door_stated: one-way + option: '2' + audit: + basis: derivable + laws: [FS] + law_cited: false + confidence: medium +- id: R-ME + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2468', '#2481'] + kind: process + rule: The whole-build up-to-date check lands first, then the module-discovery cost cuts as their own group. + door_stated: two-way + option: '3' + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-MF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1974', '#2427'] + kind: process + rule: The walrus's role in Sharpy is reconsidered alongside the let/var and global/nonlocal binding work, not + in the IR port; it is not a verdict on any cell. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-MG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2397'] + kind: language + axis: scope-binding + units: [nested-class, class-body, closure, comprehension] + rule: A nested type's bare name denotes the type wherever class-body names are visible; in methods, nested functions, + lambdas or comprehension elements a bare read is refused unless an outer binding exists; spell it C.N(). + outcome: refuse + python: matches + door_stated: two-way + option: a + audit: + basis: derivable + laws: [N1, T2] + law_cited: true + confidence: high +- id: R-MH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2425', '#2427'] + kind: language + axis: scope-binding + units: [walrus, comprehension, parameter, local] + rule: A comprehension's walrus over a local or parameter of the same function writes through to that binding + as Python does. + outcome: admit + python: matches + door_stated: one-way + option: b + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: medium + amends: [R-MJ] + cases: + - family: walrus-target + coords: + position: comprehension-element + target: existing-local + verdict: run + exception_to: N5 + differs_because: refusing costs a working program that agrees with python (the row's own words) + evidence: + program: | + def main() -> None: + xs: list[int] = [1, 2, 3] + last: int = 0 + ys = [(last := x) for x in xs] + print(ys) + print(last) + twin: | + def main(): + xs = [1, 2, 3] + last = 0 + ys = [(last := x) for x in xs] + print(ys) + print(last) + main() + sharpy: | + runs:[1, 2, 3] + 3 + python: | + runs:[1, 2, 3] + 3 +- id: R-MI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2424', '#2427'] + kind: language + axis: scope-binding + units: [global, for-target, with-target, except-target] + rule: Under global x, for, with and except targets naming x are refused with the steer to assign inside the + loop body instead. + outcome: refuse + python: deviates + door_stated: two-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-MJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2425', '#2427'] + kind: language + axis: scope-binding + units: [walrus, comprehension, module] + rule: A comprehension's walrus over a visible outer name that is read after it is refused by the S2 rule. + outcome: refuse + python: deviates + door_stated: unstated + option: A + audit: + basis: derivable + laws: [S2] + law_cited: true + confidence: medium + amended_by: [R-MH] +- id: R-MK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The live charter is extended in place for the new call rather than starting a new round charter. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-ML + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2507'] + kind: language + axis: classes-members + units: [constructor, super, init] + rule: A statement ahead of self.__init__(...) or super().__init__() in a constructor is refused with one diagnostic + steering the user to move the call first. + outcome: refuse + python: deviates + door_stated: both + option: a + audit: + basis: derivable + laws: [A1, T2] + law_cited: false + confidence: medium +- id: R-MM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2507', '#2508'] + kind: process + rule: Constructor-initializer totality becomes a new full-tier compiler-lane group after the IR port's third + tranche, ahead of name resolution. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-LL] + law_cited: false + confidence: medium +- id: R-MN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2510'] + kind: language + axis: numeric + units: [float-literal, unary-minus] + rule: The real-literal fit check unwraps a unary sign as the integer check does, so a signed float literal that + was refused now compiles. + outcome: admit + python: matches + door_stated: unstated + option: a + audit: + basis: precedent + laws: [R-HV, R-IB] + law_cited: true + confidence: high +- id: R-MO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2517'] + kind: library + axis: numeric + units: [true-division, power, zero-division] + rule: True division and a zero base raised to a negative power raise ZeroDivisionError with Python's messages, + routed through Builtins helpers as floor division is. + outcome: runtime-error + python: matches + door_stated: one-way + option: a + audit: + basis: derivable + laws: [CR7, FS] + law_cited: false + confidence: high +- id: R-MP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2352', '#2525'] + kind: process + rule: A new light group makes the parser accept what the spec states, with a parse-verdict roster, absorbing + a related issue as a cell. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-MQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2525'] + kind: language + axis: patterns + units: [match, guard, or-pattern] + rule: A per-alternative guard in an or-pattern must be parenthesised as (p if g); the contradicting example + is rewritten and the parser is unchanged. + outcome: spelling + python: no-twin + door_stated: two-way + option: a + audit: + basis: derivable + laws: ['SPEC:match_statement.md', CR7] + law_cited: true + confidence: high +- id: R-MR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2525'] + kind: language + axis: patterns + units: [named-tuple, tuple-pattern, match] + rule: 'Named-field tuple patterns like case (x=0.0, y=0.0): are implemented, binding by field name and lowered + to positional ValueTuple matching.' + outcome: admit + python: no-twin + door_stated: unstated + option: a + audit: + basis: derivable + laws: [CR7] + law_cited: true + confidence: medium +- id: R-MS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2527'] + kind: language + axis: other + units: [partial-application, functools] + rule: functools.partial is not provided; docs mark it superseded by _ partial application. + outcome: spelling + python: deviates + door_stated: two-way + option: a + audit: + basis: derivable + laws: [AP, A3] + law_cited: true + confidence: high +- id: R-MT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2527'] + kind: language + axis: classes-members + units: [dataclass, copy] + rule: Dataclasses get a synthesized copy(**changes) member with one keyword-only optional parameter per field. + outcome: admit + python: no-twin + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-MU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2148'] + kind: language + axis: classes-members + units: [field, let, var, class-body] + rule: Keywordless inferred class fields stay unsupported; the spec sentence gets a pending marker and is rewritten + to let/var/const spellings by the bindings plan. + outcome: refuse + python: deviates + door_stated: one-way + option: a + audit: + basis: precedent + laws: [B6] + law_cited: true + confidence: medium +- id: R-MV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1952'] + kind: language + axis: other + units: [overload, default-parameter] + rule: Overload resolution prefers the candidate with no defaulted parameters, as the spec states, instead of + reporting ambiguity. + outcome: runtime-value + python: no-twin + door_stated: two-way + option: a + audit: + basis: derivable + laws: ['SPEC:function_parameters.md', CR7] + law_cited: true + confidence: high +- id: R-MW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1999'] + kind: language + axis: other + units: [pipe, constructor] + rule: 'Constructor piping is allowed: x |> C(args) means C(x, args), and the spec limitation is removed.' + outcome: admit + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-MX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2443'] + kind: implementation + rule: The IR port's done-when covers type, symbol, layout or diagnostic facts; module layouts stay layout facts; + the third tranche splits the type half of operator and type-test lowerings. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-MY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2458', '#2538'] + kind: test-instrument + rule: The cell budget and refusal-rate ceilings are derived from the fixture corpus so no single fixture moves + them, with a planted spike as the mutation test. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-MZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2537'] + kind: test-instrument + rule: The CPython oracle moves from 3.14 to 3.15 now that 3.15.1 has shipped, and each resulting stdout difference + becomes a cell, never a snapshot update. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [CR6, R-LZ] + law_cited: true + confidence: high +- id: R-NA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2539'] + kind: process + rule: A band chore deletes a dead source file and moves old stdlib batch plans under the process plans directory; + an unnamed isalnum cell is dropped. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-NB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2425', '#2609'] + kind: test-instrument + rule: Three silent-wrong walrus-in-dict-spread-comprehension rows stay allowlisted until the S2 refusal lands, + rather than landing that refusal before the mainline merge. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-NC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2553'] + kind: library + axis: io-os + units: [requests, result, deviation] + rule: requests' files= keeps path strings and returns Err(RequestException), recorded as a deviation row. + outcome: deviation-row + python: deviates + door_stated: both + option: a + audit: + basis: derivable + laws: [FS, R-CM] + law_cited: true + confidence: medium +- id: R-ND + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2565'] + kind: library + axis: io-os + units: [open, archive, file-mode] + rule: open and the archive openers accept every mode Python accepts, delivered as a new two-phase group. + outcome: admit + python: matches + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-NE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2554'] + kind: process + rule: The ConnectionError exception family waits for the namespace-layout group; TimeoutError and EnvironmentError + go to the builtin-exceptions group, subject to its own decision on which names Core declares. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-NF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2591'] + kind: language + axis: exceptions + units: [sys-exit, systemexit, except, entry-point] + rule: sys.exit raises SystemExit; the generated entry point catches it and returns its code as the process exit + code; a bare except Exception still catching it remains a recorded deviation. + outcome: runtime-error + python: matches + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-NG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2495'] + kind: library + axis: io-os + units: [encoding, open, path, xml, requests] + rule: open, Path, xml and requests all resolve encoding names through one shared codec resolver; .NET-only aliases + are lost at the xml and requests seams, and two cells are deviation rows. + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: derivable + laws: [AP] + law_cited: false + confidence: medium +- id: R-NH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2590'] + kind: library + axis: numeric + units: [decimal, zerodivisionerror, invalidoperation] + rule: Decimal zero divided by zero raises ZeroDivisionError, recorded as a deviation row, instead of adding + decimal.InvalidOperation for the undefined case. + outcome: deviation-row + python: deviates + door_stated: two-way + option: a + audit: + basis: exception + laws: [FS] + law_cited: false + confidence: medium +- id: R-NI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#15', '#2548'] + kind: cli-lsp + units: [target-framework, net11] + rule: Compiler tools multi-target net10.0 and net11.0, compiled programs keep defaulting to net10.0, emission + is unchanged, and a light group first measures the work and gain of a net11/C# 15 migration. + door_stated: two-way + option: A1 + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-NJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2602'] + kind: process + rule: One band chore audits every Stdlib module that has a CPython namesake and completes the third-party notices + file; the pre-tag deadline is dropped because the release already exists. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-NK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2607'] + kind: test-instrument + rule: The procedure-bytes scorecard key also counts the verification contract and the process README, with the + baseline raised once by their size. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-NL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2538', '#2613'] + kind: process + rule: A new issue is filed as the Format Selection refused-work tracker, sweep allowlist rows re-cite it, and + the old issue closes once its ceilings-from-corpus ask is confirmed landed. + door_stated: two-way + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-NM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2130'] + kind: process + rule: The exception-group handler group is promoted to the full tier under criterion (c) because its remaining + seam is in lowering; tiers move only upward. + door_stated: unstated + option: a + audit: + basis: derivable + laws: [VC12] + law_cited: false + confidence: high +- id: R-NN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2554', '#2555', '#2573'] + kind: library + axis: exceptions + units: [exception-class, builtins, core] + rule: Core declares a Python builtin exception name only where a Core or Stdlib site raises it or an existing + type derives from it; one deviation row records all other names as ruled absences. + outcome: deviation-row + python: deviates + door_stated: one-way + option: b + audit: + basis: derivable + laws: [AP] + law_cited: false + confidence: medium +- id: R-NO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2602'] + kind: cli-lsp + units: [license, packaging] + rule: Packages carrying CPython-derived code (Core, Stdlib, Cli) declare the SPDX licence Python-2.0, the full + CPython licence stack the notices reproduce, not the narrower id used before. + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-NP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2443'] + kind: implementation + units: [operator-lowering] + rule: The operator-lowering table stays a table in tranche 3, read by the lowering pass and const eligibility; + deriving the kinds in the pass and deleting the table waits for tranche 4. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-NQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2443'] + kind: process + rule: The array-bridge conversion and sequence-materialization table leave tranche 3 for tranche 4 because they + need their own generator over position, route and conversion. + door_stated: unstated + audit: + basis: derivable + laws: [VC11] + law_cited: false + confidence: medium +- id: R-NR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2556', '#2664'] + kind: library + axis: exceptions + units: [socket, errno] + rule: socket.error.errno is the platform's native error code, compared with Python where .NET's SocketError + round trip is exact; all other cases are one recorded deviation row; the fidelity table gains the row. + outcome: runtime-value + python: matches + door_stated: one-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-NS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2556', '#2664'] + kind: library + axis: exceptions + units: [socket, errno, gaierror, timeout] + rule: Socket bad-type/protocol errors keep .NET codes as a deviation since mapping would corrupt genuine ones; + errno is int or None, None on timeout; an unknown host raises gaierror with -2. + outcome: runtime-value + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [T1, FS] + law_cited: false + confidence: medium +- id: R-NT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635'] + kind: process + rule: The membership group runs ahead of the charter queue in its own lane with tier full, criteria (b) and + (c). + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-NU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635'] + kind: language + axis: typing-conversion + units: [in, range, bytes, bool, decimal] + rule: bool and decimal needles tested for membership in range or bytes stay refused at compile time, because + no implicit conversion to int exists; the deviation row is reworded. + outcome: refuse + python: deviates + door_stated: two-way + audit: + basis: derivable + laws: ['SPEC:conversion_operators.md', A3] + law_cited: false + confidence: medium +- id: R-NV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635'] + kind: language + axis: nullability-narrowing + units: [in, optional, none-literal, str, bytes] + rule: A T | None membership needle is accepted and answers False when None; a literal None needle is accepted + only where the element type is optional and refused elsewhere, including str and bytes. + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-NW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635', '#2647'] + kind: library + axis: operators + units: [in, bytes] + rule: A bytes container accepts a bytes needle (subsequence test) and an int needle (single byte) for membership; + the spec row is amended. + outcome: admit + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: medium +- id: R-NX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635'] + kind: library + axis: nullability-narrowing + units: [in, ipaddress, email, none] + rule: A None needle tested for membership in IPv4Network, IPv6Network or EmailMessage raises AttributeError + as CPython does; separately, the scorecard allowlist-rows baseline is set to 546. + outcome: runtime-error + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [FS] + law_cited: false + confidence: medium +- id: R-NY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635'] + kind: language + axis: typing-conversion + units: [enum, optional, value-type] + rule: Enums are treated as value types throughout the compiler, not only at membership checks, which moves the + emitted nullable shape of Enum | None; a third plan-verification pass is allowed. + outcome: emission + python: no-twin + door_stated: one-way + audit: + basis: derivable + laws: [A1, CR11] + law_cited: false + confidence: medium + amended_by: [R-OO, R-OQ] +- id: R-NZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2653'] + kind: language + axis: operators + units: [in, iter, dunder, class] + rule: A user class defining __iter__ but not __contains__ answers in / not in by iterating; a class with neither + stays refused. + outcome: admit + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: medium +- id: R-OA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2653'] + kind: language + axis: operators + units: [in, getitem, len, dunder, class] + rule: A class with only __len__ and __getitem__ stays refused for in / not in, with a deviation row explaining + the index need not be an integer nor dense. + outcome: refuse + python: deviates + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-OB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2644'] + kind: language + axis: nullability-narrowing + units: [optional, t-or-none, truthiness, bool] + rule: A T | None is falsy when None or when its payload is falsy, in every truth-testing position and in bool(x), + as in Python; T? stays truthy exactly when it is Some. + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: medium +- id: R-OC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2644'] + kind: language + axis: nullability-narrowing + units: [optional, t-or-none, ordering, in] + rule: Container-side operations with a T | None operand stay allowed and a None raises Python's TypeError; ordering + on a T | None, first refused, is now allowed with a warning per the later nullability principle. + outcome: runtime-error + python: matches + door_stated: two-way + option: a′ + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amended_by: [R-OP] +- id: R-OD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2644'] + kind: library + axis: nullability-narrowing + units: [hash, none, t-or-none] + rule: hash(x) accepts a None value instead of raising TypeError. + outcome: admit + python: matches + door_stated: two-way + option: a + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: medium +- id: R-OE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2645', '#2648', '#2653'] + kind: process + rule: The three membership-related issues form one group directly after the membership group, built on its generator, + rather than being scattered across three groups. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC1, VC11] + law_cited: false + confidence: medium +- id: R-OF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2655'] + kind: process + rule: The issue goes first in its group and that group moves to the head of the Core lane, rather than a band + fix for five routes. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-OG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The compiler lane order is fixed as a specific sequence of six groups, with tranche 4 of the operator + group before the next group. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-OH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2657'] + kind: language + axis: numeric + units: [augmented-assignment, float32, decimal, literal, power] + rule: A float32 variable accepts **= with a float literal, as its other augmented operators do; a decimal variable + with **= 2.0 is refused at compile time. + outcome: admit + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-OI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2664'] + kind: process + rule: The socket cells get their own tracker and light group; remaining errno cells and constant values stay + deviation rows; import errno and exception args/strerror go to other named groups. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC10] + law_cited: false + confidence: low +- id: R-OJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2607', '#2665'] + kind: process + rule: 'The scorecard issue splits by class: the Markdown-reading checks become their own tracker and group with + one CommonMark reader; three cells go to the band; the rest stay.' + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC1, VC10] + law_cited: false + confidence: medium +- id: R-OK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#1934'] + kind: process + rule: A conditional expression against a generic-parameter slot is one class; the existing issue is retitled + and stays in its group instead of opening a second tracker. + door_stated: two-way + option: a + audit: + basis: derivable + laws: [VC1, VC10] + law_cited: false + confidence: medium +- id: R-OL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635', '#2644'] + kind: process + rule: Conditional-expression and fresh-walrus needles are outside the membership plan's contract and are tracked + under the nullability group; a fourth plan-verification pass is allowed. + door_stated: two-way + audit: + basis: derivable + laws: [VC11] + law_cited: false + confidence: low +- id: R-OM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2668', '#2669', '#2679'] + kind: language + axis: operators + units: [is, enum, identity] + rule: is / is not with an operand statically typed as an enum compares by member, like CPython singletons; members + of two different enum types are never identical; other cases are a deviation row. + outcome: runtime-value + python: matches + door_stated: one-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-ON + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2670', '#2679'] + kind: language + axis: operators + units: [equality, enum, int-enum] + rule: == between members of two different int-backed enum types answers False and != answers True, both operands + evaluated once, rather than a compile-time refusal. + outcome: runtime-value + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [A2] + law_cited: false + confidence: medium + amended_by: [R-QG] + cases: + - family: enum-operator + coords: + backing: int + operator: eq + operands: two-types + verdict: run + answer: plain-enum + evidence: + program: | + enum Color: + RED = 1 + GREEN = 2 + + enum Level: + LOW = 1 + + enum Verb: + GET = "GET" + POST = "POST" + + enum Word: + GET = "GET" + + def main() -> None: + print(Color.RED == Level.LOW) + sharpy: | + runs:False + python: no-twin +- id: R-OO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635', '#2674'] + kind: language + axis: typing-conversion + units: [struct, generics, type-parameter, self, value-type] + rule: Value-ness agrees with the emitted C# type for constructed generic structs, struct-constrained type parameters + and Self in a struct, at every reader, as already ruled for enums; a fifth verification pass is allowed. + outcome: emission + python: no-twin + door_stated: unstated + audit: + basis: precedent + laws: [R-NY] + law_cited: true + confidence: high + amends: [R-NY] + amended_by: [R-OQ] +- id: R-OP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2674', '#2678'] + kind: language + axis: nullability-narrowing + units: [optional, t-or-none, none, truthiness, warning] + rule: T never holds None; T | None is loose (behaves as T, warns where None fails, fails as CPython, never NRE); + T? is strict (Some/None() only, refused until narrowed, x == None steered to is None). + outcome: runtime-error + python: matches + door_stated: one-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amends: [R-OC] +- id: R-OQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635', '#2674'] + kind: process + rule: The membership plan keeps only membership work; the value-ness work moves to the nullability tracker under + its principle, and generator cells needing it stay known-red citing that tracker. + door_stated: unstated + audit: + basis: derivable + laws: [VC11] + law_cited: false + confidence: medium + amends: [R-NY, R-OO] +- id: R-OR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2635'] + kind: process + rule: A sixth plan-verification pass is allowed after the plan split discarded the fifth pass's converged verdict. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-OS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2674'] + kind: language + axis: nullability-narrowing + units: [in, contains, t-or-none, value-type, boundary] + rule: A None needle passed to an opaque __contains__ or CLR Contains whose parameter is a plain value type raises + TypeError at that boundary, as for any T | None flowing into a plain T, landed with the general boundary work. + outcome: runtime-error + python: deviates + door_stated: unstated + audit: + basis: precedent + laws: [R-OP] + law_cited: false + confidence: medium +- id: R-OT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2644', '#2672', '#2674', '#2675', '#2676'] + kind: process + rule: The nullability work is one group, re-chartered as 'every cell of the nullability ledger matches its target', + in four tranches each with its own plan and gate. + door_stated: two-way + option: a + audit: + basis: precedent + laws: [R-LK, VC1] + law_cited: true + confidence: high +- id: R-OU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2674'] + kind: language + axis: nullability-narrowing + units: [enum, struct, type-parameter, value-type, t-or-none] + rule: 'Value-ness matches the emitted C# type compiler-wide, and the checker stays loose on such operands: programs + that run today keep running, gain a warning and raise TypeError on None.' + outcome: runtime-error + python: no-twin + door_stated: one-way + option: a + audit: + basis: precedent + laws: [R-OP, R-NY] + law_cited: false + confidence: medium +- id: R-OV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2674'] + kind: diagnostic + axis: nullability-narrowing + units: [warning, t-or-none, diagnostic-code] + rule: 'Two new default-on warning codes: one for an operation on T | None that fails on None, one for a T | + None flowing into a plain T where the compiler inserts a check.' + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high + amends: [R-Z] +- id: R-OW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2680'] + kind: language + axis: operators + units: [ordering, enum, int-enum] + rule: Ordering within one int-backed enum type keeps .NET order, as IntEnum, recorded as a deviation; ordering + across two enum types is refused at compile time. + outcome: deviation-row + python: deviates + door_stated: two-way + option: a + audit: + basis: derivable + laws: [T3, A1, T2] + law_cited: false + confidence: medium + cases: + - family: enum-operator + coords: + backing: int + operator: order + operands: one-type + verdict: run + answer: valued-enum + evidence: + program: | + enum Color: + RED = 1 + GREEN = 2 + + enum Level: + LOW = 1 + + enum Verb: + GET = "GET" + POST = "POST" + + enum Word: + GET = "GET" + + def main() -> None: + print(Color.RED < Color.GREEN) + sharpy: | + runs:True + python: no-twin +- id: R-OX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2681'] + kind: language + axis: operators + units: [is, identity, isinstance, value-type] + rule: x is not is refused with the existing type-test code steering to not isinstance; is / is not are + identity only, never a type test or __eq__; value-type operands are always False with a warning. + outcome: refuse + python: deviates + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-OY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2648'] + kind: language + axis: operators + units: [comparison-chain, eq, class] + rule: 'Each link of a comparison chain has exactly its binary twin''s outcome: value, refusal code or internal + error; a chain over a class without __eq__ is refused wherever the binary comparison is.' + outcome: refuse + python: deviates + door_stated: one-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-OZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2645'] + kind: test-instrument + units: [allowlist, generator] + rule: A stage-0 allowlist row is one fact and one cause; a bulk row is valid only while its cells share both; + extending a generator extends its allowlist file; a compiler-crashing form is a known-red row, not an exclusion. + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-PA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2645', '#2653'] + kind: test-instrument + units: [generator, comparison-chain, membership] + rule: The membership generator draws its axes from compiler enumerations by reflection, crosses blocks pairwise + with operand forms and hoist kinds, and rules out the full cube and chains longer than three links by cost. + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-PB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2645'] + kind: process + rule: The stage-0 allowlist baseline was raised step by step to the count one-row-per-fact-and-cause gives at + each tip, without registering the allowlist as a seed harness. + door_stated: unstated + audit: + basis: derivable + laws: [VC11] + law_cited: false + confidence: high +- id: R-PC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2645', '#2690'] + kind: process + rule: The membership generator's CI cost is accepted; extra compiler shards and a 40-minute PR shard limit are + added in separate changes rather than cutting the generated facts. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-PD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2648'] + kind: language + axis: typing-conversion + units: [comparison-chain, membership] + rule: A chain middle operand that is also an in-needle is typed as its left link's binary comparison types it + and cast to the in-slot only where the in-link reads it. + outcome: runtime-value + python: matches + door_stated: unstated + audit: + basis: precedent + laws: [R-OY] + law_cited: false + confidence: medium +- id: R-PE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2648'] + kind: language + axis: typing-conversion + units: [comparison-chain, membership, literal] + rule: A constant middle needle in a chain is admitted by its value where it fits the in-slot, as the standalone + membership test is, and always cast at the in-read; out-of-range constants are refused. + outcome: admit + python: matches + door_stated: unstated + audit: + basis: precedent + laws: [R-OY] + law_cited: false + confidence: medium +- id: R-PF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2648'] + kind: language + axis: nullability-narrowing + units: [comparison-chain, optional, narrowing] + rule: 'In a comparison chain each link reads a shared operand as its binary twin would: is-None links read it + un-narrowed, others narrowed; it is evaluated once, typed by its first reader, converted at later reads.' + outcome: runtime-value + python: matches + door_stated: unstated + option: A + audit: + basis: precedent + laws: [R-OY] + law_cited: false + confidence: medium +- id: R-PG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The one-decider, class-own-__iter__ clause is split out of its group into a new group with a fixed issue + order. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-PH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: The membership/nullability lane was ordered as three groups in sequence. + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: high + superseded_by: [R-PM] +- id: R-PI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2695'] + kind: language + axis: operators + units: [eq, class, struct, function] + rule: == and != on a type declaring no __eq__ stay refused, with one rule and one code for every spelling, wrapper + and site, plus a deviations row and spec line. + outcome: refuse + python: deviates + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + cases: + - family: equality-without-eq + coords: + site: operator + operand: reference-type + verdict: refuse + evidence: + program: | + class P: + def __init__(self) -> None: + pass + + def main() -> None: + a = P() + b = P() + print(a == b) + twin: | + class P: + pass + a = P() + b = P() + print(a == b) + sharpy: refused:SPY0402 + python: | + runs:False +- id: R-PJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2687'] + kind: language + axis: typing-conversion + units: [sequence-repetition, int, sized-int] + rule: 'A sequence-repetition count is an int slot: widths implicitly widening to int are accepted; other widths + are refused with an int(n) steer.' + outcome: refuse + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-PK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2680'] + kind: language + axis: operators + units: [enum, string-enum, ordering] + rule: Ordering comparisons on a string-backed enum are refused in Semantic, as CPython's plain Enum does; int-backed + enums keep value ordering. + outcome: refuse + python: matches + door_stated: both + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + cases: + - family: enum-operator + coords: + backing: string + operator: order + operands: one-type + verdict: refuse + answer: plain-enum + evidence: + program: | + enum Color: + RED = 1 + GREEN = 2 + + enum Level: + LOW = 1 + + enum Verb: + GET = "GET" + POST = "POST" + + enum Word: + GET = "GET" + + def main() -> None: + print(Verb.GET < Verb.POST) + sharpy: crashes:SPY0908 + python: no-twin +- id: R-PL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2696'] + kind: library + axis: operators + units: [membership, list, eq, container-equality] + rule: Container search and container equality check identity before __eq__ for reference-type elements, as CPython + documents; value types keep Equals; NaN-by-identity is a deviations row. + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + cases: + - family: equality-without-eq + coords: + site: container-search + operand: reference-type + verdict: run + evidence: + program: | + class P: + def __init__(self) -> None: + pass + + def main() -> None: + a = P() + b = P() + print(a in [b]) + print(a in [a]) + twin: | + class P: + pass + a = P() + b = P() + print(a in [b]) + print(a in [a]) + sharpy: | + runs:False + True + python: | + runs:False + True +- id: R-PM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: process + rule: 'The next arc is: values ready before use, order-free name resolution, global/nonlocal, then let/var/const + bindings; the membership/nullability lane follows later in its prior relative order.' + door_stated: two-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: high + supersedes: [R-PH] +- id: R-PN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: test-instrument + units: [generator, allowlist] + rule: The initialization group's stage 0 is a new generated test type with its own allowlist, and the outside-seed + allowlist baseline rises by the measured red count. + door_stated: unstated + audit: + basis: derivable + laws: [VC11] + law_cited: false + confidence: high +- id: R-PO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422', '#2423'] + kind: process + rule: Harness rows failing because a later module variable is invisible are re-cited to the order-free name-resolution + issue; the initialization group does not take N1 for module variables. + door_stated: unstated + audit: + basis: derivable + laws: [N1] + law_cited: true + confidence: medium +- id: R-PP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: initialization + units: [module, initializer, exception] + rule: An initializer that throws during the load sweep ends the program before main with the original exception, + never TypeInitializationException; retry remains observable only on lazy hosts. + outcome: runtime-error + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [N3] + law_cited: false + confidence: medium +- id: R-PQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: process + rule: The no-initializer cell is moved out of the initialization group to another issue unruled, and the group's + issue closes on its own criteria. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-PR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: process + rule: A plan may depart from the charter's prescribed emission where a refuted cell requires it, provided ruled + behaviour stays fixed and each departure is named in the plan. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-PS + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: initialization + units: [initializer, cycle, const] + rule: Whether an initialization cycle is visible at compile time is decided by a total map classifying each + expression child position as conditional or unconditional, so non-const visible cycles are compile errors + too. + outcome: refuse + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [N3, T2] + law_cited: false + confidence: medium +- id: R-PT + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: classes-members + units: [ref-out-in, property, static-member, module] + rule: A property passed as a ref, out or in operand is refused at the checker in every host, whether or not + it has a default. + outcome: refuse + python: no-twin + door_stated: two-way + audit: + basis: derivable + laws: [A1, T4] + law_cited: false + confidence: medium +- id: R-PU + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: process + rule: The initialization group's benchmark acceptance records every ratio in the pull request and blocks nothing; + the owner judges cost at review. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-PV + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: initialization + units: [ref-out-in, module-variable, static-member] + rule: An out operand naming a module or static value is a temporary stored on return before the value's initializer + runs, and the storage itself once ready; the arm follows the value's state, not its host. + outcome: runtime-value + python: no-twin + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-PW + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: initialization + units: [module-variable, static-member, initializer] + rule: A store to a module or static value before its initializer is kept and visible, and the initializer still + runs at its declared position and replaces it; an initializer is never skipped. + outcome: runtime-value + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [N3, T1] + law_cited: false + confidence: medium +- id: R-PX + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: initialization + units: [generic, static-member, initializer] + rule: A closed generic type runs all its initializers in declaration order on its first use, wherever that use + is; a cross-type read-back NameError is accepted residue. + outcome: runtime-value + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [A1] + law_cited: false + confidence: medium +- id: R-PY + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: initialization + units: [class, static-member, module-variable, initializer] + rule: Every class sweeps all its static values in declaration order when first touched or when the module sweep + reaches it, whichever comes first; module values keep declaration-order sweep with on-demand forward reads. + outcome: runtime-value + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [A1, T4] + law_cited: false + confidence: medium + amended_by: [R-QA] +- id: R-PZ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: initialization + units: [initializer, module-variable, static-member, cycle] + rule: 'N3''s emission does what C# does unless N3 forbids it: a self-store inside an initializer is visible + then replaced; a self-read before any store is a cycle, NameError or SPY0278, never a default.' + outcome: runtime-error + python: matches + door_stated: unstated + audit: + basis: derivable + laws: [A1, N3, T1] + law_cited: true + confidence: high +- id: R-QA + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: initialization + units: [class, static-member, cycle, initializer] + rule: Two classes whose initializers read each other's values raise NameError whichever is touched first, including + touch orders that print correct values today. + outcome: runtime-error + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [T1, N3] + law_cited: false + confidence: high + amends: [R-PY] +- id: R-QB + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: language + axis: initialization + units: [cycle, module-variable, const] + rule: A ring of non-const values is a compile error unless a same-module store names one of its values; a ring + kept alive only by another module's store is refused, a recorded false refusal. + outcome: refuse + python: no-twin + door_stated: unstated + audit: + basis: derivable + laws: [N3, T2] + law_cited: false + confidence: medium +- id: R-QC + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: process + rule: One plan received three extra verify-plan passes beyond the standing two, each after a narrow revision; + the standing two-pass rule holds for every other plan. + door_stated: unstated + audit: + basis: exception + laws: [VC12] + law_cited: false + confidence: medium +- id: R-QD + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2422'] + kind: process + rule: The outside-seed allowlist baseline was set to the measured red count at each stage-0 commit of the initialization + group, without seed registration. + door_stated: unstated + audit: + basis: derivable + laws: [VC11] + law_cited: false + confidence: high +- id: R-QE + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2423'] + kind: language + axis: scope-binding + units: [class, const, static-member] + rule: A class-body initializer's bare read of a later non-compile-time const of its own type, while an outer + binding holds the name, stays a compile error until N2's own code replaces it. + outcome: refuse + python: deviates + door_stated: unstated + audit: + basis: derivable + laws: [N2, T1] + law_cited: true + confidence: high +- id: R-QF + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2443'] + kind: implementation + rule: The membership needle side table moves onto an IR node and its pin returns; the side-table field-count + pin is raised only on the owner's quoted word. + door_stated: unstated + audit: + basis: precedent + laws: [R-LK] + law_cited: true + confidence: high +- id: R-QG + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2680', '#2727', '#2732'] + kind: language + axis: operators + units: [enum, string-enum, eq, is] + rule: == between two different string-backed enum types compares by value as StrEnum does; is and is not never + run a user __eq__. + outcome: runtime-value + python: matches + door_stated: one-way + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium + amends: [R-ON] + cases: + - family: enum-operator + coords: + backing: string + operator: eq + operands: two-types + verdict: run + answer: valued-enum + evidence: + program: | + enum Color: + RED = 1 + GREEN = 2 + + enum Level: + LOW = 1 + + enum Verb: + GET = "GET" + POST = "POST" + + enum Word: + GET = "GET" + + def main() -> None: + print(Verb.GET == Word.GET) + sharpy: | + runs:True + python: no-twin +- id: R-QH + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2458', '#2742'] + kind: test-instrument + units: [ci, sweep] + rule: The name-resolution sweep's hang timeout and job limit were raised for the initialization group, then + the sweep is to be sharded and both limits restored. + door_stated: unstated + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-QI + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2427'] + kind: language + axis: initialization + units: [module-variable, static-member, initializer] + rule: A module-level or static declaration with no initializer is refused in Semantic with a steer to an explicit + zero or None initializer. + outcome: refuse + python: deviates + door_stated: both + option: a + audit: + basis: derivable + laws: [A3, T1, T2] + law_cited: false + confidence: high +- id: R-QJ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2025'] + kind: language + axis: typing-conversion + units: [ref-out-in, const, literal] + rule: An in modifier at a call site on a literal or other non-name expression is refused; on any const it runs, + with the keyword dropped for a compile-time constant. + outcome: admit + python: no-twin + door_stated: two-way + option: c + audit: + basis: derivable + laws: [N4] + law_cited: true + confidence: medium +- id: R-QK + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2268'] + kind: language + axis: classes-members + units: [struct, property, method] + rule: A member store into a struct-typed property value is refused in Semantic; a method call on it keeps C#'s + copy semantics, documented in the struct spec. + outcome: refuse + python: no-twin + door_stated: one-way + option: a + audit: + basis: derivable + laws: [A1, T1] + law_cited: false + confidence: medium +- id: R-QL + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2694'] + kind: language + axis: evaluation-order + units: [assignment, subscript, attribute] + rule: An assignment evaluates its value before its target's subexpressions, as CPython does, hoisting the value + only where the target has effects. + outcome: runtime-value + python: matches + door_stated: one-way + option: a + audit: + basis: exception + laws: [A1] + law_cited: false + confidence: low +- id: R-QM + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2400', '#2427', '#2752'] + kind: language + axis: classes-members + units: [property, observer, backing-field] + rule: 'An observer property''s storage is opaque: its underscore-prefixed backing name is refused in every position; + the mixed form keeps its documented backing name.' + outcome: refuse + python: no-twin + door_stated: two-way + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-QN + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2644', '#2723'] + kind: process + rule: Two cells leave their planned groups now as no-plan lanes, each with a generated test and a mutation record; + cells touching Semantic stay put while another group is in flight. + door_stated: unstated + option: a + audit: + basis: choice + laws: [] + law_cited: false + confidence: medium +- id: R-QO + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2752'] + kind: process + rule: A new full-tier group is created for observer-property storage, tracker filed, scheduled in the compiler + lane after the IR tranche. + door_stated: unstated + option: a + audit: + basis: derivable + laws: [VC12] + law_cited: false + confidence: high +- id: R-QP + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2733', '#2734'] + kind: process + rule: One group is light-tier although the criteria read full, scheduled after the rule table; another is light + before the IR tranche; tiers only move upward once planning begins. + door_stated: unstated + option: a + audit: + basis: exception + laws: [VC12] + law_cited: false + confidence: medium +- id: R-QQ + seed: audit-2026-11-21 + round: '2026-09-20' + issues: ['#2458'] + kind: test-instrument + units: [ci] + rule: The allowlist-issue-state CI job keeps running on mainline unchanged; its red was resolved by retargeting + Dependabot to dev. + door_stated: unstated + option: b + audit: + basis: choice + laws: [] + law_cited: false + confidence: high +- id: R-QR + seed: audit-2026-11-21 + round: '2026-09-20' + issues: [] + kind: language + axis: evaluation-order + units: [async, ref-out-in] + rule: Inside an async def, only out operands, member stores and mutating calls are hoisted; a ref operand evaluates + in operand order as in a plain def. + outcome: runtime-value + python: no-twin + door_stated: unstated + option: a + audit: + basis: derivable + laws: [A1] + law_cited: false + confidence: medium