Work in progress: Bash output ceiling and refusing Reads of session transcripts

This commit is contained in:
2026-11-18 08:28:38 +01:00
parent 641645c081
commit a7b2fd0ae1
16 changed files with 274 additions and 114 deletions
+7 -1
View File
@@ -12,7 +12,7 @@ from review_rules.review_folder import REPORTS
from project_config import templates
from command_lines.docker_command import unlimited
RuleName = typing.Literal["action-pin", "commit-one-line", "commit-title", "docker-run-memory", "env-file-read", "ignorefile-sorted", "image-pin", "no-ai-attribution", "repeat-read", "reviewer-report", "reviewer-rung", "round-cap", "round-title-counts", "run-heavy", "todo-rank-check"]
RuleName = typing.Literal["action-pin", "commit-one-line", "commit-title", "docker-run-memory", "env-file-read", "ignorefile-sorted", "image-pin", "no-ai-attribution", "repeat-read", "reviewer-report", "reviewer-rung", "round-cap", "round-title-counts", "run-heavy", "todo-rank-check", "transcript-read"]
@dataclasses.dataclass(frozen=True)
@@ -94,6 +94,12 @@ RULES: dict[RuleName, Rule] = {
"while todo.md has changes, staged or not, a git commit waits until rank_todo.py --check passes on it: the checkout's own bin/rank_todo.py where the checkout is of this setup's repo, else ~/.claude/bin/rank_todo.py",
"a git commit in a checkout whose todo.md has changes, and every git commit where the project's config puts todo.md outside the checkout, where the checkout's commits don't say whether it changed; and a git commit in the config's folder, `~/.claude-projects/<key>/`, whose todo.md has changes",
),
# A Read carries no text for a marker, so no marker waives it.
"transcript-read": Rule(
"an agent never reads a session transcript under ~/.claude/projects with Read, since the file holds the whole thread of its session and a read puts all of it in context; it prints the lines it needs with grep or jq; the `tool-results/` files that Claude Code saves a long Bash result to are not transcripts and may be read",
"a Read call whose file is a `.jsonl` file under ~/.claude/projects; a Grep or a Bash command that reads one is not checked",
overridable=False,
),
}
# The lookahead ends each reason at the next marker on its line, or at the line's end. The reason is lazy, so it stops at the next marker instead of running on and swallowing the markers after it.
# An HTML marker's closing `-->` stays in its reason; `overrides` strips it.