Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| afc9ee1653 |
@@ -2,7 +2,6 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- larv-review's claimed-output step runs each claim in a fresh clone, without the ignored files earlier runs wrote, and checks claims about what a command writes.
|
||||
- stability-reviewer now flags a regex that validates a whole input with `$`, which also matches before a final newline.
|
||||
- stability-reviewer checks that a guard on whether a file, row or record exists looks at every place the thing passes through.
|
||||
- stability-reviewer checks that a validation rule holds for the value the code uses after it trims, strips or converts the input.
|
||||
|
||||
@@ -45,7 +45,7 @@ Before anything else, **read the technical principles** in the folder your promp
|
||||
|
||||
6. **Assess reasonableness of usage paths**: Are there paths that exist but no real persona would use?
|
||||
|
||||
7. **Check each claim about output against its run.** A changed doc line that says what a command, flag or error prints, or what a command writes, is true only if the real output or the written file says so. Where your prompt has a `Claimed output:` line, that file holds each such claim's command and real output, or the lines it wrote. Report a claim the output or the written lines don't bear out, such as an error said to name the fix that doesn't, and name the missing words. Never settle one by reading code. A claim marked `not run`, or one you find that the prompt doesn't hand you a run of, is a ❓ naming the command that would run it.
|
||||
7. **Check each claim about output against its run.** A changed doc line that says what a command, flag or error prints is true only if the real output says so. Where your prompt has a `Claimed output:` line, that file holds each such claim's command and real output. Report a claim the output doesn't bear out, such as an error said to name the fix that doesn't, and name the missing words. Never settle one by reading code. A claim marked `not run`, or one you find that the prompt doesn't hand you a run of, is a ❓ naming the command that would run it.
|
||||
|
||||
## Your Output Format
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ Also report a list whose order carries no meaning and is not sorted (the technic
|
||||
|
||||
Where your prompt hands you claims a fix rewrote, judge each claim afresh, not only the finding it answered. Look for a counter-example: one input or case where it is false. Then check it against every term of the source it names, such as each credit and notice a licence file lists. Report a claim you can't check as a ❓ naming what would check it.
|
||||
|
||||
Where your prompt has a `Claimed output:` line, that file holds the command and real output of each changed line that says what a command prints or writes. Report a claim its output doesn't bear out, and name the missing words. A claim marked `not run` is a ❓ naming the command that would run it.
|
||||
Where your prompt has a `Claimed output:` line, that file holds the command and real output of each changed line that says what a command prints. Report a claim its output doesn't bear out, and name the missing words. A claim marked `not run` is a ❓ naming the command that would run it.
|
||||
|
||||
## Growth
|
||||
|
||||
|
||||
+16
-9
@@ -13,6 +13,8 @@ from forge.reviews import GITEA_DRAFT
|
||||
POLL_SECONDS = 10
|
||||
# How long checks_passed waits on Gitea for the checks before it gives up; CI took about 3 minutes in 2026-11. gh's watch waits as long as the checks run.
|
||||
WAIT_SECONDS = 30 * 60
|
||||
# How many pull requests one page of Gitea's list holds: its default cap.
|
||||
PAGE_SIZE = 50
|
||||
# What gh says of a pull request whose head has no check.
|
||||
NO_CHECKS = "no checks reported"
|
||||
|
||||
@@ -35,15 +37,20 @@ def pull_at(forge: Forge, branch: str, head: str, state: typing.Literal["open",
|
||||
return listed
|
||||
rows = [line.split("\t") for line in listed.splitlines()]
|
||||
return next((row[0] for row in rows if row[1:] == [head, "false"]), None)
|
||||
# Gitea lists at most 50 a page; the pull request sought is among the newest. Gitea has no merged state: a merged pull request is a closed one marked merged.
|
||||
pulls = gitea(run, f"repos/{{owner}}/{{repo}}/pulls?state={'open' if state == 'open' else 'closed'}&limit=50")
|
||||
if isinstance(pulls, Failure):
|
||||
return pulls
|
||||
try:
|
||||
# Match the label, not the ref: once origin deletes a merged branch, Gitea reports its ref as refs/pull/<N>/head.
|
||||
return next((str(pull["number"]) for pull in pulls if pull["head"]["label"] == branch and pull["head"]["sha"] == head and pull["head"]["repo"]["full_name"] == pull["base"]["repo"]["full_name"] and (state == "open" or pull["merged"] is True)), None)
|
||||
except (KeyError, TypeError):
|
||||
return Failure(f"tea api listed pull requests in a shape that can't be read: {str(pulls)[:200]}")
|
||||
# Gitea lists at most PAGE_SIZE a page, newest first, and the pull request sought may be older than any number of them, so read each page until one matches or one comes back short. Gitea has no merged state: a merged pull request is a closed one marked merged.
|
||||
page = 1
|
||||
while True:
|
||||
pulls = gitea(run, f"repos/{{owner}}/{{repo}}/pulls?state={'open' if state == 'open' else 'closed'}&limit={PAGE_SIZE}" + (f"&page={page}" if page > 1 else ""))
|
||||
if isinstance(pulls, Failure):
|
||||
return pulls
|
||||
try:
|
||||
# Match the label, not the ref: once origin deletes a merged branch, Gitea reports its ref as refs/pull/<N>/head.
|
||||
found = next((str(pull["number"]) for pull in pulls if pull["head"]["label"] == branch and pull["head"]["sha"] == head and pull["head"]["repo"]["full_name"] == pull["base"]["repo"]["full_name"] and (state == "open" or pull["merged"] is True)), None)
|
||||
except (KeyError, TypeError):
|
||||
return Failure(f"tea api listed pull requests in a shape that can't be read: {str(pulls)[:200]}")
|
||||
if found or len(pulls) < PAGE_SIZE:
|
||||
return found
|
||||
page += 1
|
||||
|
||||
|
||||
@dataclasses.dataclass(frozen=True)
|
||||
|
||||
+35
-1
@@ -9,7 +9,7 @@ import unittest
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
|
||||
|
||||
from forge.pulls import BEHIND, CheckFailed, checks_now, checks_passed, CONFLICTS, open_pull, other_base, Pending, POLL_SECONDS, ready_pulls, ReadyPull, required_checks, unmergeable, WAIT_SECONDS
|
||||
from forge.pulls import BEHIND, CheckFailed, checks_now, checks_passed, CONFLICTS, merged_pull, open_pull, other_base, Pending, POLL_SECONDS, ready_pulls, ReadyPull, required_checks, unmergeable, WAIT_SECONDS
|
||||
from failure import Failure
|
||||
from forge.commands import forge_of, gitea, runner, url_beside
|
||||
|
||||
@@ -50,6 +50,40 @@ class OpenPull(unittest.TestCase):
|
||||
self.assertEqual(open_pull("tea", "item-3", "abc", lambda command: LONG).reason, f"tea api listed pull requests in a shape that can't be read: {LONG[:200]}")
|
||||
|
||||
|
||||
def gitea_pulls(newer: int, sought: dict) -> typing.Callable[[list[str]], str]:
|
||||
"""A fake tea listing `newer` pull requests, newest first, then `sought` last: it serves the `limit` and `page` of the endpoint like Gitea."""
|
||||
def pull(number: int, label: str, sha: str, merged: bool) -> dict:
|
||||
return {"number": number, "merged": merged, "head": {"label": label, "sha": sha, "repo": {"full_name": "o/r"}}, "base": {"repo": {"full_name": "o/r"}}}
|
||||
everything = [pull(1000 - n, f"other-{n}", "f" * 40, True) for n in range(newer)] + [pull(sought["number"], sought["label"], sought["sha"], sought["merged"])]
|
||||
def run(command: list[str]) -> str:
|
||||
query = dict(part.split("=") for part in command[-1].split("?")[1].split("&"))
|
||||
limit, page = int(query["limit"]), int(query.get("page", "1"))
|
||||
return json.dumps(everything[(page - 1) * limit:page * limit])
|
||||
return run
|
||||
|
||||
|
||||
class PullsBeyondTheFirstPage(unittest.TestCase):
|
||||
SOUGHT = {"number": 652, "label": "item-3", "sha": "abc", "merged": True}
|
||||
|
||||
def test_finds_a_merged_pull_request_that_more_than_50_newer_ones_follow(self):
|
||||
self.assertEqual(merged_pull("tea", "item-3", "abc", gitea_pulls(120, self.SOUGHT)), "652")
|
||||
|
||||
def test_finds_one_that_is_the_first_after_a_full_page(self):
|
||||
self.assertEqual(merged_pull("tea", "item-3", "abc", gitea_pulls(50, self.SOUGHT)), "652")
|
||||
|
||||
def test_finds_none_after_the_last_page_where_none_matches(self):
|
||||
self.assertIsNone(merged_pull("tea", "item-9", "abc", gitea_pulls(120, self.SOUGHT)))
|
||||
|
||||
def test_asks_for_no_page_past_the_one_that_comes_back_short(self):
|
||||
asked = []
|
||||
run = gitea_pulls(70, self.SOUGHT)
|
||||
merged_pull("tea", "item-9", "abc", lambda command: asked.append(command[-1]) or run(command))
|
||||
self.assertEqual(asked, ["repos/{owner}/{repo}/pulls?state=closed&limit=50", "repos/{owner}/{repo}/pulls?state=closed&limit=50&page=2"])
|
||||
|
||||
def test_finds_an_open_pull_request_the_same_way(self):
|
||||
self.assertEqual(open_pull("tea", "item-3", "abc", gitea_pulls(120, {**self.SOUGHT, "merged": False})), "652")
|
||||
|
||||
|
||||
class Unmergeable(unittest.TestCase):
|
||||
def gh(self, mergeable: str, state: str) -> str | None | Failure:
|
||||
commands: list[list[str]] = []
|
||||
|
||||
@@ -3711,3 +3711,23 @@ Read most (opens and searches):
|
||||
- `bin/release_plan/release_standing.py` 3
|
||||
- `CHANGELOG.md` 1
|
||||
- `bin/deploy_release/cut.py` 1
|
||||
|
||||
## Reading cost, chunk 7361c9bb3e9a, finished 2026-11-27T14:31:28Z
|
||||
|
||||
48295 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `agents/stability-reviewer.md` 3
|
||||
- `README.md` 1
|
||||
- `agents/systems-architect.md` 1
|
||||
- `skills/larv-review/SKILL.md` 1
|
||||
|
||||
## Reading cost, chunk 73ef8355db51, finished 2026-11-27T14:52:23Z
|
||||
|
||||
61386 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `agents/stability-reviewer.md` 3
|
||||
- `skills/larv-review/SKILL.md` 2
|
||||
|
||||
@@ -74,12 +74,10 @@ Give a reviewer without Bash `git ls-files`'s output in its prompt, since some h
|
||||
|
||||
**Reports.** Run `~/.claude/bin/larv-review reviewer-header <pass>` in the chunk's worktree, and open each prompt to an agent under `~/.claude/agents/` with what it prints; then say in a few lines what the change does and which files it touches. The command makes the chunk's review folder and writes the branch diff and the plan's listing into it. The header names that diff, the reviewer's full report, `<pass>-round-<n>.md`, in the folder, the folders of technical principles and review standards the project's config sets, the files of coding conventions where it lists any, the listing, and for architecture and stability the places too. For a reviewer whose definition starts it without `CLAUDE.md`, the header's last line names the file that holds the project principles and decision titles, which the reviewer reads first. For a relaunch one rung up, add `--rerun`: the report becomes `<pass>-round-<n>-rerun.md`, and the header names the report that asked. Before you answer a 🔴 or 🟡, read its entry: Grep the report for the finding's place, with the lines after it, rather than Read the whole report. rule-hook refuses a reviewer's Edit and MultiEdit, and any Write outside `~/.local/state/larv-review/`. Keep the folder after the merge: `review-replay` replays a round from the reports its prompt names, and `compress-archives` gzips each file 30 days after it last changed.
|
||||
|
||||
**Claimed output.** Before the Product-owner or Prose pass launches in a round, find the lines the diff adds or changes that say what a command, flag or error prints, such as "the error names the fix", or what a command writes, such as "the diff of the regenerated file holds only X". In round 2, take only the lines the round's fixes changed. Those reviewers have no shell, and reading code can't show that an output holds the words a line claims.
|
||||
**Claimed output.** Before the Product-owner or Prose pass launches in a round, find the lines the diff adds or changes that say what a command, flag or error prints, such as "the error names the fix". In round 2, take only the lines the round's fixes changed. Those reviewers have no shell, and reading code can't show that an output holds the words a line claims.
|
||||
|
||||
- **Run.** Run each claim's command in a fresh clone of the chunk's worktree at its head, with every change committed: `git clone <worktree> <folder>`, the folder in the chunk's review folder. The clone lacks the ignored build and cache files that earlier runs wrote, so a command that needs one fails there, as it does in a fresh checkout. Run the command the way the project runs its tools (its container setup, unless its config sets `tooling-on-host`), with the input that triggers the output the line describes, such as the input that raises the error.
|
||||
- **Limits.** A command may change files in the clone only. Run none that changes a file elsewhere, or sends data out; list such a claim as `not run: <why>`.
|
||||
- **Writes.** Run a claim about what a command writes like one about what it prints, and compare the file it writes with the claim, such as `git diff` in the clone against the claim about the diff. Hand over the file's relevant lines or the diff.
|
||||
- **Hand over.** Write each claim into `claimed-output-round-<n>.md` in the chunk's review folder, `<n>` the round's number: its file and line, the command, the exit code and the real output (for a claim about what a command writes, the written lines or the diff), or `not run: <why>`. Add `Claimed output: <that path>` to the prompts of the Product-owner and Prose reviewers. With no claim, write no file and add no line. Then remove the clone.
|
||||
- **Run.** Run each claim's command in the chunk's worktree, the way the project runs its tools (its container setup, unless its config sets `tooling-on-host`), with the input that triggers the output the line describes, such as the input that raises the error. Run only a command that leaves every file as it was, in the worktree and outside it, and sends no data out. List any other claim as `not run: <why>`.
|
||||
- **Hand over.** Write each claim into `claimed-output-round-<n>.md` in the chunk's review folder, `<n>` the round's number: its file and line, the command, the exit code and the real output, or `not run: <why>`. Add `Claimed output: <that path>` to the prompts of the Product-owner and Prose reviewers. With no claim, write no file and add no line.
|
||||
|
||||
**Precedent, then ask** — for the full scan:
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
| 542 | 0.17.0 | | | **Make chunk-preflight report a project whose code is space-indented with no `.editorconfig` or formatter setting that says so, and narrow the tabs principle to explicit overrides.** | 2 | 2 | 3 | 5 | 4 | 1.1 by 4 | 1.2 |
|
||||
| 523 | 0.17.0 | | | **Make the security pass and stability-reviewer check that a new secret's docs name its scope and its reach, such as the other repositories its account can use.** | 1 | 1 | 2 | 2 | 1 | 1.1 by 2 | 0.9 |
|
||||
| 547 | 0.17.0 | | | **Add a technical principle: tell a failure's cause from a status code or a typed error, never from a tool's message text unless the tool documents that text as unique to the cause.** | 1 | 2 | 2 | 3 | 1 | 1.1 by 2 | 0.9 |
|
||||
| 549 | 0.17.0 | | | **Run each claimed output from the state a fresh checkout leaves, without the ignored files earlier runs wrote, and check each claim about what a command writes.** | 1 | 1 | 2 | 2 | 1 | 1.1 by 2 | 0.9 |
|
||||
| 541 | 0.17.0 | | | **Find a Gitea pull request by its branch and head however many pull requests are newer, so `chunk-pr clean`, `chunk-pr merge` and `chunk-preflight` see an older one.** | 2 | 2 | 3 | 5 | 2 | 1 by 2 | 0.8 |
|
||||
| 545 | 0.17.0 | | | **Have chunk-preflight name each next-release item with no `Touches:` list while others wait, and have loop-claude launch a subagent that writes the lists before it starts the next chunk.** | 3 | 2 | 3 | 6 | 6 | 1.1 by 4 | 0.6 |
|
||||
| 539 | 0.17.0 | | | **Leave out of a `task-bench` fix a change Haiku makes to a Rust test kept in a file of its own.** | 2 | 2 | 1 | 3 | 3 | 1.1 by 1 | 0.4 |
|
||||
@@ -176,6 +177,20 @@ Touches:
|
||||
|
||||
- `principles/technical-principles.md`: `Handle errors explicitly, as values — avoid the exception path.` (small)
|
||||
|
||||
### 549. Run each claimed output from the state a fresh checkout leaves, without the ignored files earlier runs wrote, and check each claim about what a command writes.
|
||||
|
||||
Found when an outside reviewer raised two findings that our review had missed:
|
||||
|
||||
- A documented local command failed on a fresh checkout. It needed a cache file that earlier writable runs had left in an ignored folder. The implementer's claimed-output runs reused that file, so the claimed-output step showed the command working.
|
||||
- A README sentence said what a regenerated file's diff holds. The claim was about the file the command writes, not what it prints, so the step never ran it, and the sentence was wrong.
|
||||
|
||||
Change `larv-review` §3 → "Claimed output" so that:
|
||||
- each claim runs from a state like a fresh checkout's, with the ignored build and cache files that earlier runs wrote moved aside;
|
||||
- a claim about what a command writes, such as a file or a diff, is run like a claim about what it prints.
|
||||
|
||||
Touches:
|
||||
- `skills/larv-review/SKILL.md`: `**Claimed output.**` (small)
|
||||
|
||||
### 541. Find a Gitea pull request by its branch and head however many pull requests are newer, so `chunk-pr clean`, `chunk-pr merge` and `chunk-preflight` see an older one.
|
||||
|
||||
Today `pull_at` in `bin/forge/pulls.py` reads only Gitea's first page of 50 pull requests, open or closed, and looks for the branch among them. A pull request with 50 newer ones in that state is missed. PR #652 here merged after 50+ newer PRs had closed, and `chunk-pr clean` then said "no merged pull request from filing-prose-reentry", leaving the worktree and branch to remove by hand. The same lookup serves `open_pull`, so `ready` and `merge` miss an old open one too, and `chunk-preflight` misses a merged chunk's worktree.
|
||||
|
||||
Reference in New Issue
Block a user