Answer architecture round 1: 0 🔴, 3 🟡 (0 misread); keep the slot's share beside ROOM_SHARE in machine_load, move the rule's predicate into rule_hook, and have capped set both limits itself instead of leaning on docker taking the last option

This commit is contained in:
2026-10-24 11:24:21 +02:00
parent 4c1ab3f185
commit 52641079b7
7 changed files with 60 additions and 31 deletions
+9 -2
View File
@@ -6,9 +6,9 @@ import typing
from round_titles import CAP, lacks_counts, past_cap
from git_command import commits
from rule_hook.heavy_command import heavy
from shell_command import launched, Simple
from review_folder import REPORTS
from shell_command import Simple
from docker_command import unlimited_container
from docker_command import unlimited
RuleName = typing.Literal["action-pin", "commit-one-line", "docker-run-memory", "ignorefile-sorted", "image-pin", "no-ai-attribution", "reviewer-report", "reviewer-rung", "round-cap", "round-title-counts", "run-heavy", "todo-rank-check"]
@@ -151,6 +151,13 @@ def command_breaches(command: str, simples: list[Simple], home: str) -> list[Bre
return breaches
def unlimited_container(words: list[str]) -> bool:
"""Whether the simple command, directly or through a launcher, starts a container that lacks a memory limit or a swap limit."""
docker = launched(words, {"docker"})
# Under run-heavy, its docker adds the limits a container lacks.
return docker is not None and "run-heavy" not in docker.launchers and unlimited(docker.arguments)
def file_breaches(path: str, before: str, added: str, after: str) -> list[Breach]:
"""Breaches in an edit of path: added is the text the edit writes, after the whole file it leaves."""
breaches = [Breach("no-ai-attribution", f"{path} would carry an attribution", posixpath.dirname(path))] if ATTRIBUTION.search(added) else []