Answer stability round 1: 1 🔴, 8 🟡 (0 misread); read only a regular file, only as far as the shown lines, skip cut-short output, and test the surviving mutants
This commit is contained in:
+5
-1
@@ -2,7 +2,11 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- rule-hook has a new rule, `repeat-read`, and now runs before each Read call too. It blocks a Read, or a Bash `cat`, `head` or `sed -n '<A>,<B>p'` of one file, whose lines the agent's context already holds unchanged, with a note naming the lines. It judges by the agent's own transcript: the lines must show in earlier reads' results since the last compaction, as the file holds them now. A changed file, a compaction or a read cut short lets the read through. A subagent is judged on its own transcript, not its session's. Where the context lacks lines the transcript shows, as after Claude Code cleared old tool results, `grep -n ''` reads them.
|
||||
- rule-hook has a new rule, `repeat-read`, and now runs before each Read call too. It blocks a Read, or a Bash `cat`, `head` or `sed -n '<A>,<B>p'` of one file, when every line it asks for is already in the agent's context, and the block names those lines. The rule takes no override.
|
||||
- A line is in context when an earlier read's result in the agent's own transcript showed it since the last compaction, as the file holds it now. A subagent is judged on its own transcript, not its session's.
|
||||
- A read goes through when it asks for a line no earlier read showed, or one that changed since. A Bash output that Claude Code cut short shows no lines.
|
||||
- A Read also goes through once the file changed after the agent last read it with Read or wrote it with Edit, MultiEdit or Write, since those refuse the file until it is read again.
|
||||
- Where the context lacks lines the transcript shows, as after Claude Code cleared old tool results, `grep -n '' <file> | sed -n '<A>,<B>p'` reads them.
|
||||
- Install the latest stable Python, today 3.14, as `python3`: the tools and their tests no longer support 3.11 to 3.13. A full test run now takes about 29 s, where it took about 3.3 minutes. It runs once, on that Python, in four pytest-xdist workers, where it used to rerun the whole suite on 3.11.
|
||||
- `routing-figures.md` now reports dollars by project, subagent type, rung and tool, in place of tokens. Cache reads are included; the tokens left them out, though they were about a quarter of the cost. The dollars are what each worker transcript's last `cost-state` entry records for each model, split across the messages of the worker and its subagents in proportion to their cost at list prices. The judge's runs are not counted, since the archive doesn't hold them.
|
||||
- larv-review's principles pass now launches one auditor per round, which checks the README's goals, code health and every principles file that applies, so it reads the project once per round. It used to launch one auditor for the goals with code health and one for each principles file, each reading the whole project. Its report is `principles-round-<n>.md`, like every other pass's.
|
||||
|
||||
@@ -103,7 +103,7 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a
|
||||
- `rank_todo.py [--check] [todo.md]` scores and ranks a project's `todo.md`; `rank_todo.py --help` states the format.
|
||||
- `reading-cost [--reset] [record]` appends a figure for each chunk `loop-claude` finished to a project's `docs/reading-cost.md`, and says whether the figures rise; `reading-cost --help` states the measure.
|
||||
- `review-replay <pass> <model>` replays a review pass's archived rounds from the projects run on the model, on the code each reviewed, and prints the lowest rung below the project's that, like each rung above it, finds every 🔴 and 🟡 the project's rung finds again; `review-replay --help` states the replay. Each replayed reviewer skips every permission prompt, stability-reviewer has Bash, and an archived prompt may name paths on the host.
|
||||
- `rule-hook [overrides]` blocks a tool call that breaks a rule a program can check, unless the call overrides the rule; `settings.json` → `hooks` runs it before each Bash, Edit, MultiEdit, Write, Agent and Read call, and `rule-hook --help` states the rules and the override.
|
||||
- `rule-hook [overrides]` blocks a tool call that breaks a rule a program can check, unless the call overrides the rule; `settings.json` → `hooks` runs it before each Agent, Bash, Edit, MultiEdit, Read and Write call, and `rule-hook --help` states the rules and the override.
|
||||
- `run-heavy <command>` runs a heavy command once it holds one of the machine's heavy slots, one per 4 CPUs, which every session shares; `run-heavy --help` states the slots, and the memory cap it gives a container that sets no limit.
|
||||
- `score-outcomes [L E I S]` lists the finished items whose guessed scores sit nearest the given ones, and the shipped items the project's `docs/score-anchors.md` names for each level of L, E and I, each with what its chunk measured; then the median outcome at each guessed R and S, and how well L, E and I each order the chunks by review rounds and 🔴 findings; then each chunk's 🔴 and 🟡 findings with how many a reviewer marked `[misread]`, code health's counter-signal; `score-outcomes --help` states the measures.
|
||||
- `settings_filter.py` is git's clean filter for `settings.json`: it drops `"model"` and sorts the keys. `.gitattributes` sets the filter `settings` on `settings.json`, and Install's `git config` line makes this script that filter.
|
||||
|
||||
@@ -59,6 +59,9 @@ class CurrentThread(unittest.TestCase):
|
||||
looped = [{"uuid": "a", "parentUuid": "b"}, {"uuid": "b", "parentUuid": "a"}]
|
||||
self.assertEqual([entry["uuid"] for entry in transcript.current_thread(looped)], ["a", "b"])
|
||||
|
||||
def test_entries_without_a_uuid_make_no_thread(self):
|
||||
self.assertEqual(transcript.current_thread([{"type": "summary"}]), [])
|
||||
|
||||
|
||||
class HumanTurns(unittest.TestCase):
|
||||
def test_counts_typed_turns_and_not_tool_results(self):
|
||||
|
||||
@@ -22,13 +22,15 @@ def read_transcript(path: str) -> list[dict] | Failure:
|
||||
|
||||
|
||||
def current_thread(entries: list[dict]) -> list[dict]:
|
||||
"""The entries of the transcript's current thread since its last compaction, oldest first: the newest entry with a uuid and its ancestors by parentUuid, which leaves out a branch the session rewound."""
|
||||
"""The entries of the transcript's current thread since its last compaction, oldest first: the newest entry with a uuid and its ancestors by parentUuid.
|
||||
|
||||
That leaves out a branch the session rewound, and the results of parallel tool calls that Claude Code chains on a side branch."""
|
||||
chained = [entry for entry in entries if isinstance(entry.get("uuid"), str)]
|
||||
by_uuid = {entry["uuid"]: entry for entry in chained}
|
||||
found: list[dict] = []
|
||||
entry = chained[-1] if chained else None
|
||||
# {"type": "system", "subtype": "compact_boundary", "parentUuid": null, ...} starts the thread anew after a compaction; the length check stops a parent cycle.
|
||||
while entry is not None and entry.get("subtype") != "compact_boundary" and len(found) < len(chained):
|
||||
# A compaction writes {"type": "system", "subtype": "compact_boundary", "parentUuid": null, ...}, so the thread starts there; the length check stops a parent cycle.
|
||||
while entry is not None and len(found) < len(chained):
|
||||
found.append(entry)
|
||||
entry = by_uuid.get(entry.get("parentUuid"))
|
||||
return found[::-1]
|
||||
|
||||
@@ -27,7 +27,6 @@ def shell_reads(command: str, cwd: str, home: str) -> Reads:
|
||||
return Reads(read, added)
|
||||
|
||||
|
||||
# rule_hook/repeat_read.py parses a shell read too, strictly: a measure of reading counts any file a reader names, while a rule that blocks must match only a read whose lines it knows exactly.
|
||||
def operands(words: list[str]) -> list[str]:
|
||||
program = posixpath.basename(words[0])
|
||||
if program not in READERS or (program == "sed" and any(word.startswith("-i") for word in words)):
|
||||
|
||||
+30
-6
@@ -3,7 +3,7 @@
|
||||
usage: rule-hook (a PreToolUse hook: reads the call as JSON on stdin)
|
||||
rule-hook overrides (prints this chunk's overrides)
|
||||
|
||||
settings.json runs it before each Bash, Edit, MultiEdit, Write, Agent and Read call, in every session and
|
||||
settings.json runs it before each Agent, Bash, Edit, MultiEdit, Read and Write call, in every session and
|
||||
subagent. The rules:
|
||||
|
||||
{rules}
|
||||
@@ -29,15 +29,18 @@ override cannot be logged; 0 otherwise. `rule-hook overrides` exits 1 when git c
|
||||
checkout or the branch's reflog. Exit 1, a non-blocking error to Claude Code, on input it
|
||||
cannot read.
|
||||
"""
|
||||
import datetime
|
||||
import itertools
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import stat
|
||||
import sys
|
||||
import time
|
||||
import typing
|
||||
|
||||
from rule_hook.call import applied, Call, FILE_TOOLS, parsed_call, text
|
||||
from rule_hook.repeat_read import asked_lines, file_lines, repeat_breaches
|
||||
from rule_hook.repeat_read import asked_lines, repeat_breaches, shown_lines
|
||||
from rule_hook.rules import Breach, check, Checked, command_breaches, file_breaches, rules_help
|
||||
from git_command import commits
|
||||
from claude_code.transcript import current_thread, read_transcript
|
||||
@@ -112,12 +115,33 @@ def bash_breaches(command: str, cwd: str, home: str) -> list[Breach]:
|
||||
|
||||
|
||||
def read_breaches(call: Call, home: str) -> list[Breach]:
|
||||
"""The repeat-read breaches of a call, read from the asked file and the calling agent's transcript; none where either cannot be read."""
|
||||
"""The repeat-read breaches of a call, read from the calling agent's transcript and the asked file; none where either cannot be read, or the file is not a regular file."""
|
||||
asked = asked_lines(call.tool, call.given, call.cwd, home)
|
||||
entries = read_transcript(call.transcript) if asked and call.transcript else []
|
||||
if asked is None or isinstance(entries, Failure) or not entries:
|
||||
changed = modified(asked.path) if asked else None
|
||||
entries = read_transcript(call.transcript) if changed and call.transcript else []
|
||||
if asked is None or changed is None or isinstance(entries, Failure):
|
||||
return []
|
||||
shown = shown_lines(current_thread(entries), call.tool, asked.path, changed, home)
|
||||
# No line past the last one shown is in context, so the file's lines through one past it tell as much as all of them, and a long file is not read whole.
|
||||
return repeat_breaches(asked, first_lines(asked.path, max(shown) + 1), shown, call.cwd) if shown else []
|
||||
|
||||
|
||||
def modified(path: str) -> str | None:
|
||||
"""When a regular file last changed, stamped as a transcript entry is; None for any other path, such as a FIFO, whose read could hang."""
|
||||
try:
|
||||
status = os.stat(path)
|
||||
except (OSError, ValueError):
|
||||
return None
|
||||
return datetime.datetime.fromtimestamp(status.st_mtime, datetime.UTC).isoformat(timespec="milliseconds").replace("+00:00", "Z") if stat.S_ISREG(status.st_mode) else None
|
||||
|
||||
|
||||
def first_lines(path: str, count: int) -> list[str]:
|
||||
"""The file's first count lines, without their line ends; none where it cannot be read as UTF-8."""
|
||||
try:
|
||||
with open(path, encoding="utf-8") as file:
|
||||
return [line.removesuffix("\n") for line in itertools.islice(file, count)]
|
||||
except (OSError, UnicodeDecodeError):
|
||||
return []
|
||||
return repeat_breaches(asked, file_lines(read(asked.path)), current_thread(entries), call.cwd, home)
|
||||
|
||||
|
||||
def read(path: str) -> str:
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
"""Whether a read asks for lines of a file already in the agent's context, for the `repeat-read` rule.
|
||||
|
||||
A read is a Read call, or a Bash command that is one `cat <file>`, `head [-n <N> | -<N>] <file>` or `sed -n '<A>[,<B>]p' <file>`, with no pipe or redirect.
|
||||
Lines are in context when earlier reads' results show each of them, as the file holds it now and at its line number now, in the transcript's thread since its last compaction.
|
||||
main.py reads the file and the transcript; this module only decides."""
|
||||
A line is in context when a read since the transcript thread's last compaction showed it at its line number, as the file holds it now.
|
||||
Against a Read, no line is in context when the file changed after the agent last read it with Read or wrote it with Edit, MultiEdit or Write, or when it never did."""
|
||||
import dataclasses
|
||||
import re
|
||||
|
||||
from rule_hook.rules import Breach
|
||||
from rule_hook.call import FILE_TOOLS, text
|
||||
from claude_code.entries import parts, tool_call, tool_result, tool_use_id
|
||||
from shell_command import resolved, simple_commands
|
||||
from rule_hook.call import text
|
||||
|
||||
# The lines a Read without a limit returns.
|
||||
READ_LIMIT = 2000
|
||||
@@ -27,24 +26,21 @@ class Asked:
|
||||
last: int | None
|
||||
|
||||
|
||||
def repeat_breaches(asked: Asked, lines: list[str], thread: list[dict], cwd: str, home: str) -> list[Breach]:
|
||||
"""thread is the calling agent's transcript thread since its last compaction, and lines the asked file's lines now."""
|
||||
def repeat_breaches(asked: Asked, lines: list[str], shown: dict[int, str], cwd: str) -> list[Breach]:
|
||||
"""shown is what shown_lines found, and lines the asked file's lines now, read at least through one past the last shown line."""
|
||||
last = len(lines) if asked.last is None else min(asked.last, len(lines))
|
||||
if not in_context(asked.first, last, lines, shown_lines(thread, asked.path, home)):
|
||||
if not in_context(asked.first, last, lines, shown):
|
||||
return []
|
||||
return [Breach("repeat-read", f"lines {asked.first}-{last} of {asked.path} are in your context, unchanged since you read them; read them there", cwd)]
|
||||
named = f"line {last} of {asked.path} is" if asked.first == last else f"lines {asked.first}-{last} of {asked.path} are"
|
||||
return [Breach("repeat-read", f"{named} in your context, unchanged since your last read of it", cwd)]
|
||||
|
||||
|
||||
def in_context(first: int, last: int, lines: list[str], shown: dict[int, str]) -> bool:
|
||||
return first <= last and all(shown.get(number) == lines[number - 1] for number in range(first, last + 1))
|
||||
|
||||
|
||||
def file_lines(content: str) -> list[str]:
|
||||
return content.removesuffix("\n").split("\n") if content else []
|
||||
|
||||
|
||||
def asked_lines(tool: object, given: object, cwd: str, home: str) -> Asked | None:
|
||||
"""The lines a tool call reads; None for a call that is no read, or whose output goes elsewhere than the agent's context."""
|
||||
"""The lines a tool call reads; None for any call but a Read and the Bash reads the rule names, such as one whose output goes elsewhere."""
|
||||
if not isinstance(given, dict):
|
||||
return None
|
||||
return read_asked(given, cwd, home) if tool == "Read" else shell_asked(text(given, "command"), cwd, home) if tool == "Bash" else None
|
||||
@@ -73,21 +69,47 @@ def shell_asked(command: str, cwd: str, home: str) -> Asked | None:
|
||||
return None
|
||||
|
||||
|
||||
def shown_lines(thread: list[dict], path: str, home: str) -> dict[int, str]:
|
||||
"""Each line number of path that a successful read in the thread showed, with the line its latest read showed."""
|
||||
reads: dict[str, tuple[object, Asked]] = {}
|
||||
def shown_lines(thread: list[dict], asker: str, path: str, changed: str, home: str) -> dict[int, str]:
|
||||
"""Each line number of path that a successful read in the thread showed, with the line its latest read showed; none against a Read when the file changed after the agent last read it with Read or wrote it with Edit, MultiEdit or Write, or when it never did.
|
||||
|
||||
changed is when the file last changed, stamped as the transcript stamps its entries, so the two compare as text."""
|
||||
used = results_on(thread, path, home)
|
||||
# Claude Code's Edit and Write refuse such a file until a Read, and a Bash read does not count as one.
|
||||
touched = max((stamp for tool, _, _, stamp in used if tool == "Read" or tool in FILE_TOOLS), default="")
|
||||
if asker == "Read" and changed > touched:
|
||||
return {}
|
||||
shown: dict[int, str] = {}
|
||||
for entry in thread:
|
||||
for part in parts(entry):
|
||||
if (call := tool_call(part)) and (called := tool_use_id(part)) and (asked := asked_lines(*call, str(entry.get("cwd", "")), home)) and asked.path == path:
|
||||
reads[called] = (call[0], asked)
|
||||
elif (result := tool_result(part)) and not result.failed and (read := reads.get(result.tool_use_id)):
|
||||
shown |= result_lines(*read, result.text)
|
||||
for tool, asked, result, _ in used:
|
||||
shown |= result_lines(tool, asked, result) if asked else {}
|
||||
return shown
|
||||
|
||||
|
||||
def results_on(thread: list[dict], path: str, home: str) -> list[tuple[object, Asked | None, str, str]]:
|
||||
"""Each successful result in the thread of a call that read lines of path or wrote it: the call's tool, the lines it read (None for a write), the result's text and its entry's timestamp."""
|
||||
calls: dict[str, tuple[object, Asked | None]] = {}
|
||||
found: list[tuple[object, Asked | None, str, str]] = []
|
||||
for entry in thread:
|
||||
cwd = str(entry.get("cwd", ""))
|
||||
for part in parts(entry):
|
||||
if (call := tool_call(part)) and (called := tool_use_id(part)):
|
||||
asked = asked_lines(*call, cwd, home)
|
||||
if (asked.path if asked else written(*call, cwd, home)) == path:
|
||||
calls[called] = (call[0], asked)
|
||||
elif (result := tool_result(part)) and not result.failed and (use := calls.get(result.tool_use_id)):
|
||||
found.append((use[0], use[1], result.text, text(entry, "timestamp")))
|
||||
return found
|
||||
|
||||
|
||||
def written(tool: object, given: object, cwd: str, home: str) -> str:
|
||||
"""The file an Edit, MultiEdit or Write call writes; empty for any other call."""
|
||||
return resolved(cwd, path, home) if tool in FILE_TOOLS and isinstance(given, dict) and (path := text(given, "file_path")) else ""
|
||||
|
||||
|
||||
def result_lines(tool: object, asked: Asked, result: str) -> dict[int, str]:
|
||||
if tool == "Read":
|
||||
return {int(numbered.group(1)): numbered.group(2) for line in result.split("\n") if (numbered := NUMBERED.fullmatch(line))}
|
||||
# A Bash output Claude Code cut short shows a note in place of the lines it left out, so those lines differ from the file's and count as unread.
|
||||
# Claude Code cuts a long Bash output short with a note: before the output, "<persisted-output>\n" or "<truncated-output>\n" and a few more lines, or after it, "\n\n... [N lines truncated] ...".
|
||||
# The note's lines would take the numbers of the file's, so such an output shows no lines.
|
||||
if result.startswith(("<persisted-output>\n", "<truncated-output>\n")) or result.endswith(" lines truncated] ..."):
|
||||
return {}
|
||||
return {number: line for number, line in enumerate(result.split("\n"), asked.first) if asked.last is None or number <= asked.last}
|
||||
|
||||
@@ -48,7 +48,7 @@ RULES: dict[RuleName, Rule] = {
|
||||
),
|
||||
# A Read carries no text for a marker, and a misjudged read has a way through that the message names, so no marker waives it.
|
||||
"repeat-read": Rule(
|
||||
"an agent reads no lines of a file that its context already holds unchanged, since each read pays for them again; where the context lacks them although the transcript shows them, as after Claude Code cleared old tool results, read them with another command, such as `grep -n ''`",
|
||||
"an agent reads no lines of a file that its context already holds unchanged, since each read pays for them again; where the context lacks them although the transcript shows them, as after Claude Code cleared old tool results, read them with another command, such as `grep -n '' <file> | sed -n '<A>,<B>p'`; a Read goes through once the file changed after the agent last read it with Read or wrote it with Edit, MultiEdit or Write, since those refuse a file until then",
|
||||
"a Read call, and a Bash command that is one `cat <file>`, `head [-n <N> | -<N>] <file>` or `sed -n '<A>[,<B>]p' <file>`, with no pipe or redirect, against the reads in the calling agent's own transcript since its last compaction",
|
||||
overridable=False,
|
||||
),
|
||||
@@ -127,7 +127,7 @@ def check(breaches: list[Breach], written: str, markdown: bool, bash: bool) -> C
|
||||
for rule in sorted({breach.rule for breach in blocking}):
|
||||
details = "; ".join(breach.detail for breach in blocking if breach.rule == rule)
|
||||
if not RULES[rule].overridable:
|
||||
messages.append(f"Blocked by rule {rule}: {details}. The rule: {RULES[rule].holds}.")
|
||||
messages.append(f"Blocked by rule {rule}: {details}. The rule: {RULES[rule].holds}. No marker overrides it.")
|
||||
continue
|
||||
marker = f"<!-- rule-override {rule}: <reason> -->" if markdown else f"# rule-override {rule}: <reason>"
|
||||
messages.append(f"Blocked by rule {rule}: {details}. The rule: {RULES[rule].holds}. Where it does not fit this case, add `{marker}` to {where}; larv-review rules on the reason.")
|
||||
|
||||
+103
-26
@@ -1,3 +1,4 @@
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
@@ -9,6 +10,7 @@ import unittest.mock
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from rule_hook.repeat_read import Asked, result_lines
|
||||
from rule_hook.rules import blocks, Breach, check, command_breaches, file_breaches, overrides
|
||||
from rule_hook.main import breaches_of, read_breaches
|
||||
from rule_hook.call import Call, parsed_call
|
||||
@@ -40,7 +42,7 @@ def checked(command: str) -> list[str]:
|
||||
|
||||
|
||||
def hook(call: dict, cwd: str, env: dict[str, str] | None = None) -> subprocess.CompletedProcess:
|
||||
return subprocess.run([str(HOOK)], capture_output=True, cwd=cwd, env=isolated_env() | (env or {}), input=json.dumps(call), text=True)
|
||||
return subprocess.run([str(HOOK)], capture_output=True, cwd=cwd, env=isolated_env() | (env or {}), input=json.dumps(call), text=True, timeout=10)
|
||||
|
||||
|
||||
def git(cwd: str, *args: str) -> str:
|
||||
@@ -330,29 +332,44 @@ class ReviewerReport(unittest.TestCase):
|
||||
|
||||
class RepeatRead(unittest.TestCase):
|
||||
LINES = [f"line {n}" for n in range(1, 31)]
|
||||
# The file is written at WRITTEN and each entry stamped READ_AT, unless a test changes the file at CHANGED and stamps a later entry AFTER_THE_CHANGE.
|
||||
WRITTEN = datetime.datetime(2026, 5, 1, tzinfo=datetime.UTC).timestamp()
|
||||
READ_AT = "2026-06-01T00:00:00.000Z"
|
||||
CHANGED = datetime.datetime(2026, 7, 1, tzinfo=datetime.UTC).timestamp()
|
||||
AFTER_THE_CHANGE = "2026-07-01T00:00:01.000Z"
|
||||
|
||||
def setUp(self):
|
||||
self.folder = tempfile.mkdtemp()
|
||||
self.addCleanup(subprocess.run, ["rm", "-rf", self.folder])
|
||||
self.file = f"{self.folder}/f.txt"
|
||||
pathlib.Path(self.file).write_text("\n".join(self.LINES) + "\n")
|
||||
self.write(self.LINES, self.WRITTEN)
|
||||
self.transcript = f"{self.folder}/s.jsonl"
|
||||
self.entries: list[dict] = []
|
||||
|
||||
def write(self, lines: list[str], at: float) -> None:
|
||||
pathlib.Path(self.file).write_text("\n".join(lines) + "\n")
|
||||
os.utime(self.file, (at, at))
|
||||
|
||||
def change(self, number: int) -> None:
|
||||
self.write([("changed" if n == number else line) for n, line in enumerate(self.LINES, 1)], self.CHANGED)
|
||||
|
||||
def add(self, entry: dict, parent: str | None = "last") -> str:
|
||||
uuid = f"u{len(self.entries)}"
|
||||
parent = (self.entries[-1]["uuid"] if self.entries else None) if parent == "last" else parent
|
||||
self.entries.append({"uuid": uuid, "parentUuid": parent, "cwd": self.folder} | entry)
|
||||
self.entries.append({"uuid": uuid, "parentUuid": parent, "cwd": self.folder, "timestamp": self.READ_AT} | entry)
|
||||
pathlib.Path(self.transcript).write_text("\n".join(json.dumps(entry) for entry in self.entries) + "\n")
|
||||
return uuid
|
||||
|
||||
def used(self, tool: str, given: dict, result: str, error: bool = False) -> None:
|
||||
def used(self, tool: str, given: dict, result: str, error: bool = False, at: str = READ_AT) -> None:
|
||||
tool_id = f"toolu_{len(self.entries)}"
|
||||
self.add({"type": "assistant", "message": {"content": [{"type": "tool_use", "id": tool_id, "name": tool, "input": given}]}})
|
||||
self.add({"type": "user", "message": {"content": [{"type": "tool_result", "tool_use_id": tool_id, "content": result, "is_error": error}]}})
|
||||
self.add({"type": "assistant", "timestamp": at, "message": {"content": [{"type": "tool_use", "id": tool_id, "name": tool, "input": given}]}})
|
||||
self.add({"type": "user", "timestamp": at, "message": {"content": [{"type": "tool_result", "tool_use_id": tool_id, "content": result, "is_error": error}]}})
|
||||
|
||||
def numbered(self, start: int, end: int) -> str:
|
||||
return "\n".join(f"{n}\t{self.LINES[n - 1]}" for n in range(start, end + 1))
|
||||
|
||||
def read(self, start: int, end: int) -> None:
|
||||
self.used("Read", {"file_path": self.file, "offset": start, "limit": end - start + 1}, "\n".join(f"{n}\t{self.LINES[n - 1]}" for n in range(start, end + 1)))
|
||||
self.used("Read", {"file_path": self.file, "offset": start, "limit": end - start + 1}, self.numbered(start, end))
|
||||
|
||||
def shown(self, start: int, end: int) -> str:
|
||||
return "\n".join(self.LINES[start - 1:end])
|
||||
@@ -366,6 +383,10 @@ class RepeatRead(unittest.TestCase):
|
||||
self.assertEqual(rules(found), ["repeat-read"])
|
||||
self.assertIn(f"lines 2-6 of {self.file} are in your context", found[0].detail)
|
||||
|
||||
def test_the_note_names_a_single_line_as_one(self):
|
||||
self.read(1, 10)
|
||||
self.assertIn(f"line 7 of {self.file} is in your context", self.found("Bash", {"command": "sed -n 7p f.txt"})[0].detail)
|
||||
|
||||
def test_lines_read_in_two_reads_are_in_context(self):
|
||||
self.read(1, 10)
|
||||
self.read(11, 20)
|
||||
@@ -389,24 +410,48 @@ class RepeatRead(unittest.TestCase):
|
||||
self.add({"type": "user", "message": {"content": "This session is being continued"}})
|
||||
self.assertEqual(self.found("Read", {"file_path": self.file, "offset": 1, "limit": 10}), [])
|
||||
|
||||
def change_the_first_line(self) -> None:
|
||||
pathlib.Path(self.file).write_text("changed\n" + "\n".join(self.LINES[1:]) + "\n")
|
||||
|
||||
def test_a_changed_line_lets_the_read_through(self):
|
||||
self.read(1, 10)
|
||||
self.change_the_first_line()
|
||||
self.assertEqual(self.found("Read", {"file_path": self.file, "offset": 1, "limit": 10}), [])
|
||||
self.change(1)
|
||||
self.assertEqual(self.found("Bash", {"command": f"head {self.file}"}), [])
|
||||
|
||||
def test_a_change_in_the_last_asked_line_lets_the_read_through(self):
|
||||
self.read(1, 10)
|
||||
self.change(10)
|
||||
self.assertEqual(self.found("Bash", {"command": "sed -n 1,10p f.txt"}), [])
|
||||
|
||||
def test_lines_that_did_not_change_stay_in_context(self):
|
||||
self.read(1, 10)
|
||||
self.change_the_first_line()
|
||||
self.assertEqual(rules(self.found("Read", {"file_path": self.file, "offset": 2, "limit": 9})), ["repeat-read"])
|
||||
self.change(1)
|
||||
self.assertEqual(rules(self.found("Bash", {"command": "sed -n 2,10p f.txt"})), ["repeat-read"])
|
||||
|
||||
def test_a_failed_read_holds_no_lines(self):
|
||||
self.used("Read", {"file_path": self.file, "offset": 1, "limit": 10}, "\n".join(f"{n}\t{self.LINES[n - 1]}" for n in range(1, 11)), error=True)
|
||||
def test_a_read_without_an_offset_starts_at_line_1(self):
|
||||
self.read(2, 11)
|
||||
self.assertEqual(self.found("Read", {"file_path": self.file, "limit": 10}), [])
|
||||
|
||||
# Claude Code's Edit refuses a file changed since the agent last read it with Read, or wrote it with Edit or Write, until it reads it again.
|
||||
def test_a_read_goes_through_once_the_file_changed_after_the_last_read(self):
|
||||
self.read(1, 10)
|
||||
self.change(30)
|
||||
self.assertEqual(self.found("Read", {"file_path": self.file, "offset": 1, "limit": 10}), [])
|
||||
|
||||
def test_a_read_on_a_branch_the_session_left_holds_no_lines(self):
|
||||
def test_a_refused_edit_does_not_count_as_reading_the_file(self):
|
||||
self.read(1, 10)
|
||||
self.change(30)
|
||||
self.used("Edit", {"file_path": self.file, "old_string": "line 5", "new_string": "five"}, "<tool_use_error>File has been modified since read, either by the user or by a linter. Read it again before attempting to write it.</tool_use_error>", error=True, at=self.AFTER_THE_CHANGE)
|
||||
self.assertEqual(self.found("Read", {"file_path": self.file, "offset": 1, "limit": 10}), [])
|
||||
|
||||
def test_an_edit_keeps_the_lines_it_left_unchanged_in_context(self):
|
||||
self.read(1, 10)
|
||||
self.change(30)
|
||||
self.used("Edit", {"file_path": self.file, "old_string": "line 30", "new_string": "changed"}, f"The file {self.file} has been updated successfully.", at=self.AFTER_THE_CHANGE)
|
||||
self.assertEqual(rules(self.found("Read", {"file_path": self.file, "offset": 1, "limit": 10})), ["repeat-read"])
|
||||
|
||||
def test_a_failed_read_holds_no_lines(self):
|
||||
self.used("Read", {"file_path": self.file, "offset": 1, "limit": 10}, self.numbered(1, 10), error=True)
|
||||
self.assertEqual(self.found("Read", {"file_path": self.file, "offset": 1, "limit": 10}), [])
|
||||
|
||||
def test_a_read_on_a_branch_the_session_rewound_holds_no_lines(self):
|
||||
start = self.add({"type": "user", "message": {"content": "go"}})
|
||||
self.read(1, 10)
|
||||
self.add({"type": "user", "message": {"content": "go again"}}, parent=start)
|
||||
@@ -418,11 +463,21 @@ class RepeatRead(unittest.TestCase):
|
||||
with self.subTest(command):
|
||||
self.assertEqual(rules(self.found("Bash", {"command": command})), ["repeat-read"])
|
||||
|
||||
def test_a_head_starts_at_line_1(self):
|
||||
self.read(2, 11)
|
||||
self.assertEqual(self.found("Bash", {"command": f"head {self.file}"}), [])
|
||||
|
||||
def test_a_cat_asks_for_the_whole_file(self):
|
||||
self.read(1, 20)
|
||||
self.assertEqual(self.found("Bash", {"command": f"cat {self.file}"}), [])
|
||||
|
||||
def test_a_sed_output_puts_its_lines_in_context(self):
|
||||
# Claude Code's Edit and Write take only a Read as having read the file.
|
||||
def test_a_read_goes_through_until_the_agent_read_the_file_with_read(self):
|
||||
self.used("Bash", {"command": f"sed -n '1,20p' {self.file}"}, self.shown(1, 20))
|
||||
self.assertEqual(self.found("Read", {"file_path": self.file, "offset": 4, "limit": 3}), [])
|
||||
|
||||
def test_a_bash_output_counts_against_a_read_once_the_agent_read_the_file_with_read(self):
|
||||
self.read(21, 30)
|
||||
self.used("Bash", {"command": f"sed -n '1,20p' {self.file}"}, self.shown(1, 20))
|
||||
self.assertEqual(rules(self.found("Read", {"file_path": self.file, "offset": 4, "limit": 3})), ["repeat-read"])
|
||||
|
||||
@@ -430,19 +485,40 @@ class RepeatRead(unittest.TestCase):
|
||||
self.used("Bash", {"command": f"cat {self.file}"}, self.shown(1, 30))
|
||||
self.assertEqual(rules(self.found("Bash", {"command": "sed -n '25,$p' f.txt"})), ["repeat-read"])
|
||||
|
||||
def test_a_read_whose_output_goes_elsewhere_is_not_checked(self):
|
||||
def test_a_relative_path_in_the_transcript_is_under_its_entry_s_cwd(self):
|
||||
self.used("Bash", {"command": "cat f.txt"}, self.shown(1, 30))
|
||||
self.assertEqual(rules(read_breaches(Call("Bash", {"command": f"head -n 5 {self.file}"}, "/", "", self.transcript), "/h")), ["repeat-read"])
|
||||
|
||||
def test_a_tilde_path_is_under_the_home_folder(self):
|
||||
self.used("Read", {"file_path": "~/f.txt", "offset": 1, "limit": 10}, self.numbered(1, 10))
|
||||
self.used("Bash", {"command": "cat ~/f.txt"}, self.shown(1, 30))
|
||||
for tool, given in [("Read", {"file_path": "~/f.txt", "offset": 1, "limit": 10}), ("Bash", {"command": "sed -n 1,30p ~/f.txt"})]:
|
||||
with self.subTest(tool):
|
||||
self.assertEqual(rules(read_breaches(Call(tool, given, "/", "", self.transcript), self.folder)), ["repeat-read"])
|
||||
|
||||
def test_other_commands_on_the_file_are_not_checked(self):
|
||||
self.used("Bash", {"command": f"cat {self.file}"}, self.shown(1, 30))
|
||||
for command in [f"cat {self.file} > copy", f"cat {self.file} | wc -l", f"cat {self.file} {self.file}", f"head -c 5 {self.file}", f"sed 's/a/b/' {self.file}"]:
|
||||
with self.subTest(command):
|
||||
self.assertEqual(self.found("Bash", {"command": command}), [])
|
||||
|
||||
def test_a_truncated_output_leaves_out_the_lines_it_cut(self):
|
||||
self.used("Bash", {"command": f"cat {self.file}"}, self.shown(1, 5) + "\n... [25 lines truncated] ...")
|
||||
self.assertEqual(self.found("Bash", {"command": f"head -n 10 {self.file}"}), [])
|
||||
# As Claude Code 2.1.312 writes a Bash output it cut short.
|
||||
def test_an_output_cut_short_shows_no_lines(self):
|
||||
for cut in [
|
||||
f"<persisted-output>\nOutput too large (37.9KB). Full output saved to: {self.folder}/tool-results/b2hymdt7w.txt\n\nPreview (first 2KB):\n{self.shown(1, 30)}\n...\n</persisted-output>",
|
||||
f"<truncated-output>\nOutput too large (37.9KB). It could not be saved, so only the first 2KB are shown; the rest was dropped. If the tool can page or filter its results, call it again for the part you need.\n\n{self.shown(1, 30)}\n</truncated-output>",
|
||||
self.shown(1, 5) + "\n\n... [25 lines truncated] ...",
|
||||
]:
|
||||
with self.subTest(cut[:20]):
|
||||
self.assertEqual(result_lines("Bash", Asked(self.file, 1, None), cut), {})
|
||||
|
||||
def test_a_truncated_output_holds_the_lines_it_shows(self):
|
||||
self.used("Bash", {"command": f"cat {self.file}"}, self.shown(1, 5) + "\n... [25 lines truncated] ...")
|
||||
self.assertEqual(rules(self.found("Bash", {"command": f"head -n 5 {self.file}"})), ["repeat-read"])
|
||||
def test_a_fifo_is_never_opened(self):
|
||||
fifo = f"{self.folder}/fifo"
|
||||
os.mkfifo(fifo)
|
||||
self.used("Bash", {"command": f"cat {fifo}"}, "line 1")
|
||||
# Opened, the FIFO would block the hook, since it has no writer.
|
||||
ran = hook({"cwd": self.folder, "tool_name": "Bash", "tool_input": {"command": f"head -n 1 {fifo}"}, "transcript_path": self.transcript}, self.folder)
|
||||
self.assertEqual((ran.returncode, ran.stderr), (0, ""))
|
||||
|
||||
def called(self, agent_id: str = "") -> Call:
|
||||
given = {"cwd": self.folder, "tool_name": "Read", "tool_input": {"file_path": self.file, "offset": 1, "limit": 10}, "transcript_path": self.transcript}
|
||||
@@ -459,7 +535,7 @@ class RepeatRead(unittest.TestCase):
|
||||
self.read(1, 10)
|
||||
self.assertEqual(rules(read_breaches(self.called(), "/h")), ["repeat-read"])
|
||||
|
||||
def test_a_missing_transcript_blocks_nothing(self):
|
||||
def test_a_missing_transcript_lets_the_read_through(self):
|
||||
self.assertEqual(read_breaches(Call("Read", {"file_path": self.file}, self.folder, "", f"{self.folder}/none.jsonl"), "/h"), [])
|
||||
|
||||
def test_the_hook_blocks_a_repeated_read_without_offering_an_override(self):
|
||||
@@ -471,6 +547,7 @@ class RepeatRead(unittest.TestCase):
|
||||
self.assertEqual(ran.returncode, 2)
|
||||
self.assertIn("Blocked by rule repeat-read: ", ran.stderr)
|
||||
self.assertNotIn("rule-override", ran.stderr)
|
||||
self.assertIn("No marker overrides it.", ran.stderr)
|
||||
|
||||
|
||||
class Hook(unittest.TestCase):
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ loop-claude hands each worker's claude `CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000`
|
||||
|
||||
Why 200k. Item 231 asked for the best means to lower what a chunk spends on context, in dollars, then hours, with no loss of quality. Measured from loop-claude's archive, the 90 chunks with messages after the routing figures' reset of 2026-10-21 cost $1,215 at the list prices read on 2026-10-26 (Opus 5.5: $4 per million input tokens, $5 and $8 for 5-minute and 1-hour cache writes, $0.20 for cache reads, $20 for output; no model but Haiku 5.5 charges more above 200k). That is 0.86 of what the chunks' `cost-state` entries sum to, since some chunks' subagent transcripts are not in the archive. Worker main threads cost $375 (31%): 1-hour cache writes $149, cache reads $153, output $74. Subagents cost $840: 5-minute cache writes $379, output $274, cache reads $187, with the principles auditors at $274 over 342 runs, the stability reviewers $179 and general-purpose subagents $192. A worker starts at 41k tokens of context and peaks at a median 167k, one in ten past 358k, the largest at 848k. The worker's messages above 200k were 32% of its messages and 55% of its cost.
|
||||
|
||||
What reads cost, and whether a tool cuts them, measured at lilleman's ask after those figures: no tool cut a reviewer's reading without losing a finding, except a scout, which kept the stability reviewers' findings but lost the auditors' 🔴 and slowed every round; so none of them ships here. lilleman chose on 2026-10-27: workers trial a reading rule (`todo.md` item 240), reviewers get no scout, and the principles audit keeps reading the project whole. Two measures of reading: the characters a thread read, 93M in all, about 27M tokens; and the new input tokens of the messages that took results in, charged to those results, which also count what arrives beside a result, such as the agent's own previous reply. By the second measure tool results caused $620 of the $1,215, and reads (Read, Bash reads, Grep, Glob and git's diff, show and log) $537 of that: the worker's reads $140 (Bash reads $115, Read $12) of its $190 of results, the principles auditors' $133 (Read $109, Grep $22) of $139, the stability reviewers' $97 (Bash reads $79) of $106, general-purpose subagents' $84 of $97, the prose reviewers' $32, the architects' $30 and the product-owner reviewers' $21. By the first measure the worker's reads are about $45. Precision is low everywhere: of the characters a principles auditor read, 13% were in a file its report names; a stability reviewer 8%; a prose reviewer 18%; an architect 11%; the worker 4% in a file it later edited. Reading is mostly to find things and to learn what a project holds. The worker's `sed` ranges are small, median 25 lines, one in ten over 80. Of the worker's read characters, 49% were of a file it had read earlier in the thread: 36% within three messages, paging through it, and 13% later, with the file unchanged, about $6 of the $45; a reviewer's later reads of an unchanged file it had read are 1 to 2%; rule-hook's `repeat-read` now blocks a read of lines already in context.
|
||||
What reads cost, and whether a tool cuts them, measured at lilleman's ask after those figures: no tool cut a reviewer's reading without losing a finding, except a scout, which kept the stability reviewers' findings but lost the auditors' 🔴 and slowed every round; so none of them ships here. lilleman chose on 2026-10-27: workers trial a reading rule (`todo.md` item 240), reviewers get no scout, and the principles audit keeps reading the project whole. Two measures of reading: the characters a thread read, 93M in all, about 27M tokens; and the new input tokens of the messages that took results in, charged to those results, which also count what arrives beside a result, such as the agent's own previous reply. By the second measure tool results caused $620 of the $1,215, and reads (Read, Bash reads, Grep, Glob and git's diff, show and log) $537 of that: the worker's reads $140 (Bash reads $115, Read $12) of its $190 of results, the principles auditors' $133 (Read $109, Grep $22) of $139, the stability reviewers' $97 (Bash reads $79) of $106, general-purpose subagents' $84 of $97, the prose reviewers' $32, the architects' $30 and the product-owner reviewers' $21. By the first measure the worker's reads are about $45. Precision is low everywhere: of the characters a principles auditor read, 13% were in a file its report names; a stability reviewer 8%; a prose reviewer 18%; an architect 11%; the worker 4% in a file it later edited. Reading is mostly to find things and to learn what a project holds. The worker's `sed` ranges are small, median 25 lines, one in ten over 80. Of the worker's read characters, 49% were of a file it had read earlier in the thread: 36% within three messages, paging through it, and 13% later, with the file unchanged, about $6 of the $45; a reviewer's later reads of an unchanged file it had read are 1 to 2%. rule-hook's `repeat-read` now blocks a read of lines already in context.
|
||||
|
||||
The trials: four stability rounds and five principles rounds archived on 2026-10-23, each holding 🔴 or 🟡 findings, replayed on the project's rung as `review-replay` replays them, with the reviewer's definition changed through `--agents`; and three worker-like tasks, a search, a rename and an explanation, run on fresh clones at the project's rung. The baseline, the reviewer as it is, found 4 of its own 6 archived findings in each pass, so a variant that finds 4 or 5 of 6 does what the same reviewer does twice. The options todo item 231 named, each simulated on the 90 chunks and, where lilleman asked, tried:
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
"type": "command"
|
||||
}
|
||||
],
|
||||
"matcher": "Bash|Edit|MultiEdit|Write|Agent|Read"
|
||||
"matcher": "Agent|Bash|Edit|MultiEdit|Read|Write"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
`Bar = 0.1`
|
||||
|
||||
`Next ID = 247`
|
||||
`Next ID = 248`
|
||||
|
||||
## Items
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
| 167 | 0.5.0 | | | **Refuse a `/security-review` or `/claude-security` Skill call below the project's rung, as rule-hook refuses such an Agent call.** | 3 | 2 | 3 | 6 | 2 | 1.1 by 4 | 5.6 |
|
||||
| 6 | 0.5.0 | | decision | **Move what `loop-claude` writes out of `~/.claude.json`, and ask the human about each write that must stay.** | 3 | 3 | 3 | 7 | 3 | 1.1 by 5 | 5.3 |
|
||||
| 240 | 0.5.0 | | decision | **Give loop-claude's worker prompt the reading rule "never read more than 80 lines of a file at once, nor take a tool output over 3,000 characters into your context", and keep it only where the 20 chunks after it hold the 20 before's review rounds, unfinished verdicts, 🔴, 🟡 and misread findings, dollars and hours per chunk.** | 1 | 2 | 3 | 4 | 2 | 1.4 by 3 | 4.0 |
|
||||
| 247 | 0.5.0 | | | **Have rule-hook's Edit, MultiEdit and Write checks read only a regular file, so a FIFO or device as `file_path` no longer hangs or floods the hook.** | 1 | 1 | 3 | 3 | 2 | 1.5 by 2 | 2.6 |
|
||||
| 1 | 0.6.0 | | question | **Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.** | 1 | 2 | 1 | 2 | 1 | | 0.0 |
|
||||
| 229 | 0.6.0 | | | **Keep the rule for which commands reach run-heavy's docker beside that docker in `bin/run_heavy/capped_docker.py`, so rule-hook's `docker-run-memory` asks it instead of repeating run-heavy's PATH rules.** | 2 | 1 | 3 | 4 | 2 | code health by 3 | 18.0 |
|
||||
| 219 | 0.6.0 | | | **Name the project's rung `project` in `bin/judge_replay/main.py`, `bin/subagent_rung/main.py` and `bin/review_replay/main.py`, in place of `anchor`, as `bin/model_routing/ladder.py` and `bin/loop_claude` name it.** | 1 | 1 | 3 | 3 | 2 | code health by 2 | 12.0 |
|
||||
@@ -101,7 +102,7 @@ Found by review of PR #370. Today `uv run mutmut run`, `poetry run mutmut run`,
|
||||
|
||||
### 246. Answer whether the `rule-hook:` decision should name every rule that takes no override, `repeat-read`, `reviewer-report` and `reviewer-rung`, with each one's reason.
|
||||
|
||||
Filed from PR #387's architecture round 1. The decision's 2026-10-16 addendum says `reviewer-rung` is the one rule no marker overrides. `reviewer-report` already took no marker, and PR #387 adds `repeat-read`, so three rules take none, each with its reason only in a comment above it in `bin/rule_hook/rules.py`. A reader of the decision, the judge included, believes every other rule takes an override. The fix rewords the title and the addendum to name all three; it changes a decision, so it is lilleman's.
|
||||
Filed from PR #387's architecture round 1. The decision's 2026-10-16 addendum says `reviewer-rung` is the one rule no marker overrides. `reviewer-report` already took no marker, and PR #387 adds `repeat-read`, so three rules take none, each with its reason in a comment above it in `bin/rule_hook/rules.py`; only `reviewer-report`'s is also in a decision, the `review:` one. A reader of the decision, the judge included, believes every other rule takes an override. The fix rewords the title and the addendum to name all three; it changes a decision, so it is lilleman's.
|
||||
|
||||
### 235. Compare the first 20 chunks whose worker ran under the 200k compaction window with the 20 before them, on review rounds past each pass's first, unfinished verdicts, 🔴, 🟡 and misread findings, dollars and hours per chunk, and file an item where any rose.
|
||||
|
||||
@@ -119,6 +120,10 @@ Claude Code owns that file and writes it. `trust` reads it, changes it and write
|
||||
|
||||
lilleman's call, 2026-10-27, answering PR #376's trials, recorded in `docs/decisions.md` → `loop-claude: the worker's claude compacts its context before it fills a 200k window…`: three worker-like tasks each ran four ways, as workers run today, with an outline tool, with the LSP tool and under the rule, and only the rule cut reading, by 45% to 60%, at the same or lower cost and with the tasks done as well. The rule is for workers, so it goes into the prompt loop-claude gives a chunk's worker (`bin/loop_claude/cycle/prompts.py`), not into `CLAUDE.md`, which reviewers load too and where the one reviewer run under a like rule found 2 of 6 findings. A worker that reads less may misread more, so measure the 20 chunks after the rule merges against the 20 before, as item 235 measures the compaction window, and drop the rule where any of those figures rose.
|
||||
|
||||
### 247. Have rule-hook's Edit, MultiEdit and Write checks read only a regular file, so a FIFO or device as `file_path` no longer hangs or floods the hook.
|
||||
|
||||
Found by the stability review of PR #387. `read` in `bin/rule_hook/main.py`, which serves these checks, opens the target with `pathlib.Path(path).read_text` whatever it is. A FIFO without a writer hangs rule-hook until Claude Code's hook timeout, and a path such as `/dev/zero` makes it read without bound. rule-hook runs on every such call in every session. Reuse the check `modified` in the same file makes, `stat.S_ISREG` before any read, and have `read` return `""` for any other path. A test passes a FIFO and expects the check to finish.
|
||||
|
||||
### 1. Say in README → Install how the transcript archive is backed up, once bender-infra backs up ai-sandbox's data volume.
|
||||
|
||||
It lives under `~/.claude`, which `.gitignore` keeps from the remote, so a lost disk loses every unattended run's record. Back it up only to a destination private to me and encrypted at rest: the worker runs with permissions bypassed, so the archived tool results can hold credentials it read.
|
||||
|
||||
Reference in New Issue
Block a user