Repository navigation
feat(analyze): a shorter run that ends on next steps, and a review page that fits the browser - #61
Merged
Merged
Conversation
…ns take turns A raak analyze wrote a 164 MB page: 42 drizzle snapshot diffs (287k patch lines) took 48 of the 50 diff slots, so the drifted files and 14 of 15 pinned files with absent upstream lines got no diff at all. The 50-file cap assumed ~85 KB per diff; a rendered patch line costs ~0.6 KB. The page now renders at most 15,000 patch lines and lists a single patch over 2,000 lines instead of rendering it. Sections take one file each per turn, so every section gets diffs before one fills the page. The terminal line says how many files are listed without a diff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WC3pgMiDH9vv2KNbQwxKfx
…nner fits its divider A dry run counted the alignments arriving with the sync as open and said `1 open: pnpm cella align`, but `pnpm cella align` lists nothing until the sync lands. MergeResult.alignments.open is now the list of open ids: in analyze the fork's pending ones, in sync those plus the arrivals. The line reads `0 of 1 handled · 1 arrives with this sync`. The banner padded for `⧈ cella cli v0.4.2` but printed `⧈ cella cli · v0.4.2`, two columns past its 60-column divider. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WC3pgMiDH9vv2KNbQwxKfx
…, --all The analyze report keeps its banner, section headers and summary, and changes what sits under the headers: - Sections go from what syncs on its own to what needs you: behind, diverged, protected in fork, drifted, protected but behind upstream. - A file row is its path, linked, with a count and a short age (3h, 2d, 3mo) in columns sized per section. The `≠ 3 hours ago basename` tail that repeated every file name is gone, and so are the multi-sentence hints; one line stays where it names a command. - Over 15 behind files collapse to one row per folder, with the names that fit, added (+) and deleted (−) first. Over 8 pinned files keep the ones missing 10 or more upstream lines and count the rest. Five or more protected files of one kind under one override entry become one row: `backend/drizzle/ · 42 × snapshot.json 311.8k`. - Protected but behind upstream takes in ignored files only upstream changed (tagged new or deleted, with their line count and date), on the terminal and on the review page. Generated files are left out. - `--all` lists every path. - Engine steps take one line each: `✓ checkout`, `✓ upstream` with the newest commits under it (one line each, PR number, age, at most 10), `✓ analyzed`. Links: fork-side rows (protected in fork, drifted) link fork commits to the fork's GitHub repo instead of 404ing under upstream's, file links point at the analyzed commit instead of the branch tip, and files upstream deleted get no link. Lists are sorted by path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WC3pgMiDH9vv2KNbQwxKfx
… command and the alignments
The last lines of a run were the ones you act on, and they printed dim and
unlabeled: the review page path, and `alignments: 0 of 1 handled · 1
arrive with this sync · 1 open: pnpm cella align`. Both commands now close
with a `next steps` section, under the same header and divider as every
other section, numbered in the order you take them:
next steps
────────────────────────────────────────────────────────────
1 review file:///…/.git/cella-diff/analyze-review.html
22 diffs in 3 sections · 42 listed without a diff
2 sync pnpm cella sync
commits on a fresh branch, a rerun opens the PR · 36 update, 2 merge
3 align 1 alignment arrives with this sync
○ Migration notes become alignments · manual · not sync-breaking
after the sync: pnpm cella align
The review URL prints in full, so a terminal without OSC 8 links still
makes it clickable. Alignments are named with their kind and reach,
linked to their README, at most five; without a terminal each row also
gets its id for `align --show`. The sync step is there whenever upstream
has new commits, even when only an alignment changed.
Sync ends the same way at each stop: conflicts (resolve, finish, review,
align), the commit (review, triage, align, ship) and the shipped PR
(merge, align). The alignments line no longer prints twice on a clean
first run. Also: `1 conflict` in the singular, and a conflicted merge no
longer prints `✓ sync complete` right after `✗ sync completed with
conflicts`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WC3pgMiDH9vv2KNbQwxKfx
…ADME Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WC3pgMiDH9vv2KNbQwxKfx
…nc left The commit stop lists the review page of the merge it commits. When the merge had nothing to review, it fell back to whatever sync-review.html was on disk, which could be a page from an earlier sync cycle. A sync run with nothing to review now removes that page, and only a rerun that resumes a merge looks for the page on disk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WC3pgMiDH9vv2KNbQwxKfx
…splay, one PR number parser The post-implementation review of the output rework found three places where one behavior lived in two: - The terminal section and the review page each joined the protected files both sides changed with the ignored files only upstream changed. `findProtectedBehindUpstream` is that list, read by both. - The engine styled the `checkout` and `upstream` step text while display.ts laid out the commit rows under it. `formatCheckoutStep` and `formatUpstreamStep` now live in display.ts, with tests. - alignments.ts and display.ts each parsed the `(#1519)` a squash merge adds to a subject. `splitPrNumber` in utils/git.ts serves both. Output is unchanged: the analyze golden test passes as is, and a raak run prints the same lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WC3pgMiDH9vv2KNbQwxKfx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks the terminal output of
pnpm cella analyze(and the end ofpnpm cella sync) so the run is shorter and ends on what to do next. The banner, the section headers (title with the divider under it) and the analysis summary keep their original design. Along the way it fixes the bugs found while reading the analyze path, and ends with an evaluation of refactoring opportunities.Measured on raak at ac6106a against cella main at b374861 (6 commits):
alignments: 0 of 1 handled · 1 arrive with this sync · 1 open: pnpm cella alignnext steps: review page,pnpm cella sync, the alignment by titleFixes
fileLinkMode: 'commit', rows for protected-in-fork and drifted files linked the fork's commit hashes under the upstream repo, which 404s. They now link to the fork'sorigin, or not at all.filemode, file links now point at the analyzed commit instead of the branch tip. Files upstream deleted get no link.MergeResult.alignments.openis now a list of ids, and the arriving ones only count as open after the sync.1 conflictsand1 files.✓ sync completeright after✗ sync completed with conflicts.Output
next steps.3h,2d,3mo), in columns sized per section. The≠ 3 hours ago basenametail and the multi-sentence hints are gone.backend/drizzle/ · 42 × snapshot.json 311.8k).--alllists every path.--jsonand--listare unchanged.newordeleted, with their line counts and dates. This applies on the terminal and on the review page.next stepscloses analyze and every sync stop: conflicts, commit, ship and up to date. Without a terminal, each alignment row also gets its id.Refactor
findProtectedBehindUpstreamis now one list read by both the terminal and the review page. The step text moved intodisplay.ts(formatCheckoutStepandformatUpstreamStep). There is onesplitPrNumber. Output is unchanged: the golden test passes as is, and the raak run prints identical lines.Validation
pnpm check,pnpm test(326 tests, 297 at the start),pnpm test-buildandpnpm test:releaseall pass. This was run locally on Node 22; CI runs 26.tests/analyze-report.test.tscompares the full analyze file sections of a raak-shaped fixture line by line (the golden test), plus tests for links and--all.tests/next-steps.test.tscovers the printer and thealignstep.pnpm installandpnpm checkthere.Ledger
sync.tsrunSync+commitSyncMergealignstep undernext stepsenginesasks for 26.x. The suite passes on 22 (297 tests at the start); CI runs 26.findProtectedBehindsdk/gen/openapi.json,types.gen.ts), while the upstream-only report already leaves generated output out: the fork regenerates them from its own sources.printSummary, analyze sectionsrenamedanddeletedfiles are counted in the summary data but never shown: no summary row, no list.enrichChangeInfo,analyzeRefssync.tsshipSyncBranch,merge-engine.tsorigininline in the ship path; the analyze links need it too.readOriginGitHubUrl--jsonupstreamChangedLinesis now also set forupstreamOnlyfiles. Same keys, more values.· 1 files.runAnalyze+mainmainprints after every service.upstreamstep--ref <sha>run printed--ref b374861b9 @ b374861b9.main @ b374861b9 · --refgetShortShauses git's auto length (9 in raak), commit rows use 7, as before.formatMergeInProgressDetail,printSyncComplete1 conflicts to resolve in IDE,1 conflicts: no singular.printSyncComplete✓ sync completeright after✗ sync completed with conflicts.⚠ sync merge staged with conflictsrunSyncCommandnext stepssyncstep now keys off the upstream commit count (MergeResult.upstreamCommitCount), not file counts.pnpm installandpnpm checkin raak.sync-review.htmlan earlier sync cycle left.upstreamstepremote configuredstep printed the upstream URL; the compactupstreamline leaves it out to stay within 80 columns.spinnerSuccess(message, detail)(detail on its own line, then a blank line), so a sync run mixes two step styles.printSyncComplete→printProtectedConflicts--json --scope protectedupstreamChanged; the terminal leaves them out. JSON is raw flags, so consumers can filter.cella/alignments/README.md(line 40) quotes the oldalignments: … · 3 openline as what every sync ends with.cella/skills/cella-sync/SKILL.mdquotes "protected but behind upstream", which keeps its title.Refactor evaluation (after the implementation)
Act only where one behavior had to change in more than one place, or where two copies already disagree.
findProtectedBehindwithignoredUpstreamChanges(two copies of one membership rule).--jsonkeeps its own scope filter.findProtectedBehindUpstreamserves both. A full model object is not worth it yet.display.tsservices/analyze-report.ts.captureInfohelper;formatRowsalready returns lines.checkoutandupstreamtext whiledisplay.tslaid out the commit rows.formatCheckoutStep,formatUpstreamStepindisplay.ts, now testedreadOpenAlignments,alignmentsStep,readPrBodyAlignments. Each reads a different ref at a different moment; what they share is onereadAlignmentcall.(#NNNN)pattern.splitPrNumberinutils/git.tsGenerated by Claude Code