Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions tests/arch/_acceptance_policy_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# automated repair sessions must not. Every approval needs a tracking issue and code-owner review.
"""Declared acceptance-policy surfaces and the human approval ledger.

A policy surface is a value the repository treats as the accepted limit for
something it measures. Because a surface and the measurement it gates live in
the same working tree, raising one is indistinguishable from satisfying it
unless a trusted revision is consulted; scripts/check_policy_relaxation.py
does that consulting and reads this file by AST from both revisions.
A policy surface holds accepted limits or numeric exemption flags. Because a
surface and the check it gates live in the same working tree, raising a limit
or adding an exemption is indistinguishable from satisfying the check unless
a trusted revision is consulted; scripts/check_policy_relaxation.py does that
consulting and reads this file by AST from both revisions. Classification flags
use int_map with default=0: enabling a flag with 1 is a policy relaxation.
"""

from __future__ import annotations
Expand All @@ -21,13 +22,13 @@

@dataclasses.dataclass(frozen=True)
class PolicySurface:
"""One module-level assignment holding an accepted limit."""
"""One module-level assignment holding accepted limits or exemption flags."""

path: str
symbol: str
kind: SurfaceKind
default: int | None = None
"""int_map only: the limit an absent key already implies."""
"""int_map only: the value an absent key already implies."""


@dataclasses.dataclass(frozen=True)
Expand Down Expand Up @@ -59,6 +60,12 @@ class PolicyRelaxationApproval:
"int_map",
default=12,
),
PolicySurface(
"tests/arch/test_autoskillit_root_children_registered.py",
"_CLASSIFIED_ELSEWHERE",
"int_map",
default=0,
),
PolicySurface(
"tests/arch/test_pyright_suppression_allowlist.py", "TYPE_IGNORE_BUDGET", "int_scalar"
),
Expand Down
Loading