diff --git a/bin/rule_hook/main.py b/bin/rule_hook/main.py index b2fde2cb..66c758d4 100644 --- a/bin/rule_hook/main.py +++ b/bin/rule_hook/main.py @@ -40,8 +40,8 @@ from rule_hook.call import applied, Call, FILE_TOOLS, parsed_call, text from rule_hook.rules import Breach, check, Checked, command_breaches, file_breaches, rules_help from git_command import commits from failure import Failure -from rule_hook.repeat_read import repeat_breaches from rule_hook.override_log import Log, log_path, logged, print_overrides, write_override +from rule_hook.repeat_read import repeat_breaches from rule_hook.reviewer_report import report_breaches from rule_hook.reviewer_rung import reviewer_breaches from shell_command import simple_commands diff --git a/bin/rule_hook/repeat_read.py b/bin/rule_hook/repeat_read.py index bb6474dc..a810619a 100644 --- a/bin/rule_hook/repeat_read.py +++ b/bin/rule_hook/repeat_read.py @@ -5,9 +5,9 @@ Lines are in context when earlier reads' results show each of them, as the file import dataclasses import re -from claude_code.entries import parse_entry, part_text, parts -from rule_hook.call import Call, text from rule_hook.rules import Breach +from rule_hook.call import Call, text +from claude_code.entries import parse_entry, part_text, parts from shell_command import resolved, simple_commands # The lines a Read without a limit returns. @@ -57,8 +57,8 @@ def asked_lines(tool: object, given: object, cwd: str, home: str) -> Asked | Non if name == "head" and (counted := HEAD_COUNT.fullmatch(" ".join(options) or "-10")): return Asked(path, 1, int(counted.group(1))) if name == "sed" and len(options) == 2 and options[0] == "-n" and (ranged := SED_RANGE.fullmatch(options[1])): - first, last = ranged.groups() - return Asked(path, int(first), None if last == "$" else int(last or first)) + start, end = ranged.groups() + return Asked(path, int(start), None if end == "$" else int(end or start)) return None diff --git a/bin/rule_hook/test_rule_hook.py b/bin/rule_hook/test_rule_hook.py index f8f77b6a..fa72c52d 100644 --- a/bin/rule_hook/test_rule_hook.py +++ b/bin/rule_hook/test_rule_hook.py @@ -12,12 +12,12 @@ sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1])) from rule_hook.rules import blocks, Breach, check, command_breaches, file_breaches, overrides from rule_hook.main import breaches_of from rule_hook.call import Call, parsed_call -from rule_hook.repeat_read import repeat_breaches from git_command import Commit, commit_message, commits from test_rank_todo import DECISIONS, README, TODO from test_env import isolated_env from model_routing import ladder from rule_hook.override_log import LogLine, parsed_entry, this_chunks +from rule_hook.repeat_read import repeat_breaches from rule_hook.reviewer_rung import reviewer_breaches from rule_hook.git import git as rule_hook_git from model_routing.ladder import Rung