From 439a35466a072b158915c14eac23a25fa83ce844 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 16 Oct 2026 04:51:07 +0200 Subject: [PATCH] Point stability-reviewer at the technical principles in place of its own copies --- CHANGELOG.md | 1 + agents/stability-reviewer.md | 13 +++++++------ todo.md | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6398a840..80fc39a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Reshape every project's `todo.md` to the new shape below: until it is reshaped, that is the project's only work, as it is while README.md lacks Goals and Audience, and `rank_todo.py` says so. First move every machine to this release: an older release rejects the new formula, so it fails on every reshaped `todo.md`. Then mark the README's goals `**Maintain:**` or `**Achieve:**`, and set a bar on the new scale below the score of every item to keep, since the old bar would drop most items. Until then, an old-shape `todo.md` still ranks by its own formula and weights. - `todo.md` ranks items by value per cost: this setup's own plan uses `Score = 100 * V / (2**S + 8)`, where 8 is a chunk's fixed cost, about one size-3 change, and `rank_todo.py --help` shows it. A Moves column replaces A, G and Goals, naming each achieve goal an item moves and how far, such as `1.1 by 8, 1.2 by 5`. V sums each named goal's weight times its move. `rank_todo.py` weighs each achieve goal by its position in README.md, the first heaviest, so the goal weights table goes. An item names the most specific goal it moves, never a goal beside its own sub-goal. `rules/todo-items.md` and `rank_todo.py --help` show the new shape. - An item that restores a maintain goal the project breaks today is exempt as `defect`, and its Moves may name that maintain goal, weighed as the heaviest achieve goal. A defect ranks by its score like any item. Only two kinds rank ahead of the rest of their release: questions first, since an answer may change other items, then security items. +- The stability reviewer applies `principles/technical-principles.md` as written, in place of its own copies of it. Its test-data check now asks for UUID v7, as the principle does, where it asked for randomised UUIDs. ## 0.1.0 diff --git a/agents/stability-reviewer.md b/agents/stability-reviewer.md index 4d10a49d..5cd6420c 100644 --- a/agents/stability-reviewer.md +++ b/agents/stability-reviewer.md @@ -24,6 +24,8 @@ You are an elite stability-focused code reviewer with deep expertise in defensiv For every piece of code you review, systematically evaluate these categories. For a per-PR reviewer, breaking existing callers (#1), growth that shouldn't exist (#2), built-in ambiguity (#3), data corruption (#7), and security holes (#9) carry the most weight. +The rules behind these checks are the technical principles, read in First Steps, step 2. A check names where to look; a finding that breaches a principle names it. + ### 1. Backward Compatibility, Blast Radius & Rollout "Breaking things" is mostly about impact on existing callers and contracts, not the new code in isolation. - What calls or depends on the changed code? Trace the callers. @@ -45,7 +47,7 @@ Before judging how well code works, judge whether it should exist. Every line is - Growth whose whole fix is deletion โ€” unasked additions, dead code, speculative abstraction, an unjustified dependency โ€” breaks KISS: a ๐Ÿ”ด. A "could be smaller" rewrite is a ๐ŸŸก. ### 3. Ambiguity & Implicit State -Catch behavior that is unclear or under-specified โ€” "building in ambiguousness." Cross-check the principles: make invalid states unrepresentable, validate/build DTOs early, explicit state machines, explicit over implicit. +Catch behavior that is unclear or under-specified โ€” "building in ambiguousness." Cross-check the technical principles. - Is stringly-typed or loosely-typed data used where an enum/DTO would make invalid states unrepresentable? - Is input parsed into a strict DTO at the boundary, or passed down as raw strings to be validated deep inside? - Past the boundary, do types carry the proof? Re-validating at every layer what the type already guarantees is noise that buries the real invariants โ€” deletion-worthy, not defensive. @@ -82,7 +84,7 @@ Catch behavior that is unclear or under-specified โ€” "building in ambiguousness ### 7. Data Integrity & Persistence - Are multi-step writes atomic (one transaction)? Are side effects โ€” events, jobs, mail, outbound HTTP โ€” deferred until after commit? Dispatch-before-commit emits effects for state that may still roll back. - Money: integer minor units or exact decimals, never binary floats; rounding rules explicit. -- Time: stored as full ISO datetimes in UTC; arithmetic DST-safe (adding a day โ‰  adding 24 h). +- Time: arithmetic DST-safe (adding a day โ‰  adding 24 h). - Are consumers idempotent under at-least-once delivery (webhooks, queue retries, double-submit)? Where a duplicate would double-charge or double-send, is there an idempotency key or dedup? - Do DB constraints (NOT NULL, unique, FK) mirror what the code assumes, so bad data cannot arrive via another path? - New column on an existing table: what do existing rows contain โ€” is null/default handled or backfilled? @@ -99,7 +101,7 @@ Works-on-fixtures, dies-on-volume is a stability bug. ### 9. Security Every PR gets at least this sweep. - Injection: SQL via raw/concatenated queries, shell/command, XSS via unescaped output. -- Does every new read and write path authorize access? (principle: grant explicit access to data โ€” every read and write is explicitly authorized.) +- Does every new read and write path authorize access? - Secrets: none hardcoded; none leaked into logs, error responses, or stack traces; PII sanitized before logging. - Mass assignment/over-posting on model-bound input; uploaded files and paths validated (traversal); user-supplied URLs constrained (SSRF). - Crypto: vetted primitives only, constant-time comparison for secrets, CSPRNG for tokens. @@ -116,14 +118,13 @@ Every PR gets at least this sweep. - **Never let documentation stand in for a fix.** A finding is not closed by describing the defect in a README, and neither is one of yours: if the only available remedy is telling the reader, say so and mark it a decision for the human, so it lands in the PR or ticket where a decision record belongs. Naming a residual risk is your job; choosing to publish it in the repo is not yours to hand out. ### 11. Tests -- Does the PR ship tests for the new behavior? (principle: most code has automated tests, and tests come first.) +- Does the PR ship tests for the new behavior? - Do they exercise the risky and error paths, not just the happy path? -- Does a mutant of a changed line survive (First Steps, step 5)? (principle: every mutant of a changed line fails a test, unless the mutant leaves behaviour unchanged.) +- Does a mutant of a changed line survive (First Steps, step 5)? - Was a test deleted while the behaviour it pinned remains? Flag it; restore the test. - Were tests and implementation changed together in a way that could mask a regression โ€” e.g. an assertion weakened to make a test pass? Flag it; these should be separate changes. - Would each test fail if the behavior regressed? Watch for assertion-free tests, tautological asserts, and mocks so broad the test exercises the mock instead of the code. - Tests are code too: prefer extending an existing test with an assertion over adding a near-duplicate; flag overlapping tests that pin the same behavior twice, and tests of framework behavior or trivial pass-throughs โ€” maintenance cost without protection. -- Test data: properly randomised UUIDs, never `aaaa-0000`-style placeholders. - Are there untestable side effects that should be refactored? diff --git a/todo.md b/todo.md index 8f1ec77f..08099545 100644 --- a/todo.md +++ b/todo.md @@ -6,13 +6,13 @@ `Bar = 0.1` -`Next ID = 160` +`Next ID = 161` ## Items | ID | Release | Blocked by | Exempt | Item | R | S | C | Moves | Score | |---|---|---|---|---|---|---|---|---|---| -| 67 | 0.2.0 | | principle | **Point stability-reviewer at the technical principles in place of its own restatement of them.** | 2 | 3 | 2 | 1.1 by 5 | 6.8 | +| 160 | 0.2.0 | | question | **Decide whether the principles audit runs on every chunk or only with the architecture pass, then make larv-review and its decisions say so.** | 2 | 2 | 2 | 1.1 by 4, 1.4 by 4 | 10.9 | | 146 | 0.2.0 | | decision | **Score R as L + E + I โˆ’ 2 from anchored levels, at least 7 at I5 and 5 at I4, with L, E and I in their own columns and `rank_todo.py` computing R, drop C, and route a task's model and effort on its R alone.** | 6 | 7 | 7 | 1.1 by 8, 1.2 by 8, 1.4 by 8 | 2.8 | | 152 | 0.2.0 | 146 | decision | **Anchor each score level in `rules/todo-items.md` with words, and each project's with two or three items it shipped, and have a scorer compare a new item against them.** | 2 | 4 | 3 | 1.1 by 7 | 6.4 | | 50 | 0.2.0 | | principle | **Grant the bench's runs only the tools a review needs, in place of skipping every permission.** | 2 | 2 | 3 | 1.1 by 3 | 5.5 | @@ -77,9 +77,9 @@ ## Details -### 67. Point stability-reviewer at the technical principles in place of its own restatement of them. +### 160. Decide whether the principles audit runs on every chunk or only with the architecture pass, then make larv-review and its decisions say so. -DRY, in `principles/technical-principles.md`: `agents/stability-reviewer.md` restates principles in its own words, and the copy has drifted: it asks for "properly randomised UUIDs" where the principle requires UUID v7. +`skills/larv-review/SKILL.md` ยง3 runs the principles audit only inside the architecture pass, which fires on an architectural decision, and the Audit bullets in ยง3 say the same. `docs/decisions.md`'s entry titled "review: a project decision may opt every chunk out of the architect, the product-owner pass or the comprehension check" says the audit judges every chunk, and so does CHANGELOG 0.1.0: "The principles audit always runs." Running the audit on every chunk adds one principles-auditor per principle file that applies, even to a chunk that changes no structure (goal 1.4). Running it only with the architect leaves a principle breach in a plain change unjudged (goal 1.1). The human picks one; then the other two places are changed to match. ### 146. Score R as L + E + I โˆ’ 2 from anchored levels, at least 7 at I5 and 5 at I4, with L, E and I in their own columns and `rank_todo.py` computing R, drop C, and route a task's model and effort on its R alone.