Skip to content

feat(review): a fresh streamliner justifies every new piece, and the critic seconds each question - #293

Merged
Ardnived merged 11 commits into
mainfrom
claude/streamline-review
Nov 21, 2026
Merged

Ardnived merged 11 commits into
mainfrom
claude/streamline-review

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The critic now hands every new piece, and each file a PR grows, to a fresh subagent that justifies it from code and ticket alone, or sketches a smaller shape for address-review to build.
  • It gives its own pick on each of the builder's question threads; only a disagreement waits on you.
  • A refactor where the diff already works is in scope; a bot PR opened ready gets the critic; improve-loop counts what the critic misses.
  • Joined: parseDiff read a diff block inside a diff as its own header, which renamed the file and lost its walk. Every skill and doc here carries one.

Change outline

Flow — review-pr

The streamliner runs beside the critic's own reading, in a context that never sees the builder's prose.

 review-pr
   gather: ticket → PR body → diff
+  new-pieces.mjs --base origin/main --head origin/<branch> --json
+    NONE   → skip
+    PIECES → Task(streamliner.md, { checkout, branch, ticket, profile, pieces JSON, reviewReply budget })
+               never the PR body, threads or change outline
+               split → one per group of related files
   gather: surrounding code
+  walk the ladder yourself for each dependency, nested piece and `skipped` path
+  check each sketch against the code → post survivors as `should-fix`, led by **Streamline**
+  for each open question thread (questionMarker, no human reply):
+    own pick == built option → reply "Second opinion: X", resolve
+    otherwise               → reply with pick and costs, leave open
   submit review (What was checked carries the streamliner's counts)

Behaviour — address-review and the builder

 Rebut the critic: any point, with evidence
+  a **Streamline** thread: only with a fact the sketch breaks (a caller, a test, Never remove)
 ticket proposal options
+  recommend A (this PR) when the part sits in code this PR touches
 finalize-pr 7c: build the recommended option
+  recommend the option that leaves less to maintain, even when the PR grows

Behaviour — evaluateGreenPr

 ready PR, CI green, no critic review, over review.skipWhen
-  member → fire review-pr        bot → nothing
+  member, or bot not yet approved → fire review-pr

Contract — loop-config.json

"review": {
  "streamline": {
    "newFileLines": 150, "grownLines": 80, "splitLines": 1500,
    "sourceGlobs": ["**/*.ts", "…", "**/*.mdx"],
    "skipGlobs": ["**/*.test.*", "**/*.spec.*", "**/__tests__/**", "**/*.d.ts"]
  }
}

Each repo's generatedFiles, read from the base branch, is skipped too, which covers generated types, migrations, lockfiles and vendor/.

Preview

No preview surface.

Test results

  • Lean gate: ✓ claude plugin validate ./workflow --strict and node --test workflow/lib/*.test.mjs (156 passed, one new: a diff inside a diff)
  • Dispatcher: ✓ node --test dispatcher/test/*.test.mjs (399 passed); the new ready-PR test fails on main's decide.mjs
  • rule-delta.mjs: one directive added, none removed
  • /security-review over the branch: no findings

Notes for reviewer

  • One PR, one behaviour per commit, as you chose. Each reverts on its own. No ceiling or writing.budgets value moves, so the skill/ceiling split holds. The last four commits answer the critic's four threads, plus the defect that hunt turned up.
  • Task on review-pr adds no capability: the critic already holds Bash(*). The brief tells the subagent to touch nothing.
  • The critic that reviews this PR runs main's skill. The streamliner first runs on the PR after this merges.
  • What stays out of the streamliner, at your call: test files and vendored code. Fixtures, mocks, stories and docs are in — and a Markdown file is now judged by docs/documentation.md, not by the piece questions.
  • generatedFiles → RegExp now lives once, in workflow/lib/config.mjs, taking the JSON text: two callers read that file from disk, one from git show of the base.
Detail

Evidence (your inline comments, 2026-10-20 to 2026-11-20, SahajCloud, SahajAtlasWeb, WeMeditateWeb): 288 in all. About 50 asked a piece to justify itself or a file to be streamlined, 20 of them in the four days after the profile's 2026-11-15 refinement. 91 were bare option picks. Where the bot marked a default, you chose another option roughly 30 times to 24 (a rough parse). address-review adopted 74 of 91 critic threads.

Dry runs of new-pieces.mjs:

  • SahajCloud#1134 → calendarFeed.ts streamlined whole (14 pieces), calendarToken.ts five pieces. That is the file you flagged ("make sure each line earns its keep").
  • WeMeditateWeb#285 (final head) → clip-window.tsx whole; four files with pieces; tests and the lockfile skipped.

Declined: a streamliner per file, which cannot see the cross-file refactors you asked for (SahajCloud#1075, #1088). A proven rewrite run against tests, which is slower, can follow if the sketches prove too loose. A ledger of every kept piece in the review body, which you declined in favour of failures only.

🤖 Generated with Claude Code

Ardnived and others added 5 commits November 20, 2026 16:50
In the month to 2026-11-20 the reviewer asked about fifty times for a
new function to justify itself or a file to be streamlined, twenty of
them after the profile already asked the critic to. The critic's ladder
walk counted only a named alternative, it justified pieces by the
ticket's approach, and nothing made it cover each piece.

new-pieces.mjs lists every new top-level declaration, and each file new
at 150 lines or grown by 80, skipping tests, generated and vendored
files. review-pr gives that list, the ticket and the code (never the PR
body or its threads) to one fresh subagent briefed by streamliner.md,
checks what comes back, and posts each sketch that holds as a
Streamline should-fix. address-review may rebut one only with a fact
the sketch breaks.

Task adds no capability the critic lacks: it already holds Bash(*).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The scope lens called a refactor beside the fix smuggled, and the
builder's ticket proposals recommended a separate ticket. The reviewer
keeps choosing the refactor in this PR (SahajCloud#1102, #999) and asked
to favour long-term maintenance over small PRs. A refactor of the code
the diff touches, its callers, or siblings that share what it builds is
now in scope and preferred; unrelated code is still scope creep.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
91 of the reviewer's 288 inline comments in a month were bare option
picks, and where the bot marked a default they chose another option
more often than not, usually the one with less code. The builder
recommends what it built.

The critic now picks on its own for each open question thread. Agreement
on the built option resolves the thread and is named in the review body;
any other pick waits on the person with both views. The builder's own
default leans toward less to maintain over a smaller diff.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
evaluateGreenPr fired the critic for a bot PR only while it was a
draft. A session run by hand can open a bot-authored PR ready, and
SahajAtlasWeb#442, #444 and #450 reached the reviewer with no critic.
A ready bot PR now gets it as a member's does, unless a person has
already approved it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The profile already held the value behind most of the reviewer's
misses, so each weekly profile edit added text and the misses went on.
The usage report now counts the reviewer's substantive comments the
critic did not raise, by theme, and a miss the profile already covers
is proposed as a skill change instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot

sydevs-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running

recent dispatches
  • 00:00Z address-review · attempt 1 · session · done
  • 00:00Z address-review · attempt 1 · session
  • 23:51Z review-pr · attempt 1 · session · done
  • 23:51Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

The shape is right, and the evidence is better than most: 288 counted comments, a quoted reviewer ask behind each of the five behaviours, a script where CLAUDE.md asks for one. Nothing is smuggled. Both suites pass on the branch (155 and 399), and new-pieces.mjs run against this PR lists its own file and eleven pieces — the mechanism works on its author.

The two gaps are reach, not shape. The pass that now owns "does this piece need to exist" is the only one in the loop that cannot read the reviewer's profile. And skipped, the script's record of what nobody judged, has no reader: a piece outside sourceGlobs loses the ladder walk it had on main. Caveat: rule-delta.mjs cannot read a new file (fatal: on streamliner.md), so its 92 → 93 count omits the brief's own directives. Filed as friction.

Findings

  • should-fix — the streamliner never gets review.profilePath (streamliner.md:7).
  • should-fix — a piece outside sourceGlobs loses its ladder walk; skipped has no reader (review-pr/SKILL.md:55).
  • consider — generatedPatterns is a third copy (new-pieces.mjs:116).
  • consider — **/*.md sends prose to a brief written for code (loop-config.json:403).

What was checked

Read whole on the branch: new-pieces.mjs and its tests, streamliner.md, review-pr/SKILL.md, evaluateGreenPr, why.md, the profile. Ladder on the eleven pieces: matchesGlob has precedent (test-only.mjs:30), g.pattern matches doc-weight.mjs:96, Task matches ten skills' allowed-tools, reviewDecision is populated (gather.mjs:46) — only generatedPatterns had a named alternative. Confirmed: suites green, version 5.8.1 → 5.9.0, the README row, no hard-coded number in a skill. Unverified: the product checkouts are absent, so their generatedFiles shapes. No preview surface.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread workflow/skills/review-pr/SKILL.md Resolved
Comment thread workflow/lib/new-pieces.mjs Resolved
Comment thread loop-config.json Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 21, 2026
The pass that now owns "does this piece need to exist" was the only one in
the loop that could not read the profile answering it — the bimodal taste,
*The total*, *Membership*, *Guards*. improve-loop's new recall row already
assumes it does, so a profile value the streamliner never saw would be read
as a review-pr step gap.

The isolation rule bars the builder's prose, not a profile: a profile is the
reviewer's standing taste, written before this PR existed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZSiPHbyM3SKmRAqbc
On main the critic walked the ladder for every new piece the diff added.
The streamliner covers review.streamline.sourceGlobs only, and "the rest"
named just dependencies and nested pieces, so a new top-level piece in
ste-lint.py, dispatcher.yml, a .scss or a .rb file fell between the two and
lost the walk it used to get.

new-pieces.mjs already returns `skipped` for exactly those paths. It had no
reader; now the critic is it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZSiPHbyM3SKmRAqbc
new-pieces.mjs made a third copy of the generatedFiles-to-RegExp map that
doc-weight.mjs and comment-fingerprint.mjs already each held. The ladder's
rule 4 folds near-copies into one generic helper, and three copies of a
mapping is three places a change to the generatedFiles shape has to reach.

config.mjs now owns it, taking the JSON text rather than a path: two callers
read the file from disk and one reads it from `git show` of a base ref, and
the text is the only thing all three have.

Verified by running all three scripts.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZSiPHbyM3SKmRAqbc
review.streamline.sourceGlobs routes **/*.md and **/*.mdx to a brief whose
five piece questions speak only of callers and packages. In this repo that
is the common case: a skill rewrite over grownLines is prose, and almost
every diff here is prose.

Markdown never yields a piece — declarations() matches JS, TS and PHP only —
so a Markdown file reaches the streamliner as a whole file or not at all.
The whole-file pass now points at docs/documentation.md, the rule review-pr's
own *Prose is diff too* already uses, with its *Never delete* as the bound.

Keeping the globs rather than dropping them: prose is most of what this repo
ships, so it is the diff most in need of the pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZSiPHbyM3SKmRAqbc
parseDiff tested `+++ ` before the generic `+`, so an added line whose own
text began `++ ` was read as this diff's file header: the file's path became
whatever that line named, and `--- ` on a removed line went uncounted.

Effect was silent and exactly backwards. A renamed path falls outside
review.streamline.sourceGlobs, so the file lands in `skipped` and loses the
walk, or `length()` throws on a path that is not on the branch. In this repo
the trigger is ordinary: every `diff` block in a skill or in docs/why.md.

A header is now read only before the first `@@`. Inside a hunk every line is
content.

Found while addressing this PR's review.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZSiPHbyM3SKmRAqbc
The story named the code and the ticket as its inputs. It now gets the
profile too, and the isolation claim it is making — never the builder's
prose — is unchanged.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjZSiPHbyM3SKmRAqbc
@sydevs-bot

Copy link
Copy Markdown
Contributor

Four critic threads, all adopted. Pushed as 359f45e.

Joined: parseDiff read a ++ line inside a hunk as a +++ header, renaming the file into skipped. Every diff block in a skill triggers it. Fixed with a test (9d14157).

Lean gate 156, dispatcher 399, rule-delta.mjs no directive removed, /security-review clean. Body refreshed.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 21, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 21, 2026
@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 21, 2026
@Ardnived
Ardnived added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit f5ed5d1 Nov 21, 2026
73 of 78 checks passed
@Ardnived
Ardnived deleted the claude/streamline-review branch November 21, 2026 00:25
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 21, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 21, 2026
The branch bumped to 5.9.0 before #293 merged with the same number. An
install caches by version, so merging at 5.9.0 would leave every
installed plugin on #293's skills, never seeing this change.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXynNWRz4u2joFjv6F
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants