prreviewbuddy 0.44.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,86 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.46.0
4
+
5
+ **The change map: see what a change is about, and how its parts affect each other.** The Diagrams
6
+ page now opens on a **Change map**, drawn from the review's own themes. It reads from the goal of
7
+ the change, through what it does and the state it shares, to the rules it must keep, the risks, and
8
+ what the person using it gets. Every arrow says what it means, such as *adds another writer* or
9
+ *protects every change*, rather than just joining two boxes. Each idea says why it matters, names the
10
+ code to search for, and links to its theme in the review path. The ideas that matter most have a
11
+ heavier frame and are marked **Core idea**. Click an idea to highlight what it connects to, or open
12
+ **Read as a list** to read every relationship as a sentence.
13
+
14
+ **Simple or Technical.** A switch on the map changes its wording between everyday language and the
15
+ precise terms, without changing what is connected to what, and without asking Buddy AI again. Your
16
+ choice is remembered. If you have already asked Buddy AI to **Explain in simple terms**, the map's
17
+ Simple wording keeps the same analogy.
18
+
19
+ **Change map and Implementation, side by side.** The Diagrams page has two tabs. **Change map**
20
+ explains the change. **Implementation** is the diagram of how the code does it, which works as it
21
+ did before. A small check on each tab shows whether it has already been generated. Diagrams is now
22
+ always in the review's sidebar, and the Overview has a **Diagrams** button beside **Explain in simple
23
+ terms**.
24
+
25
+ **Nothing is generated until you ask.** Opening Diagrams, or either tab, never starts Buddy AI. Only a
26
+ button that says **Generate** or **Regenerate** does, and while one is running you see its progress
27
+ and **Stop**. Reviews made before this version open on a short description of the map and a
28
+ **Generate change map** button.
29
+
30
+ **A change map always matches the review beside it.** Running the analysis again, or updating the
31
+ review to newer commits, removes the map, because it was built from the analysis that was replaced.
32
+ Generate a new one to map the review as it is now. Implementation diagrams are kept as before and say
33
+ when they were drawn from an earlier commit.
34
+
35
+ **Every page of a review can be expanded.** The expand button now also appears on the Overview,
36
+ Diagrams, PR context, both KISS review pages and the progress page shown while a review is running,
37
+ as well as Buddy AI, Issues, Questions, Files and the review path. Diagrams and Files get much more
38
+ of the window, and an expanded change map shows its stages side by side; the others stay at a
39
+ comfortable reading width.
40
+
41
+ **Folding Your prompts now hides them.** Clicking **Your prompts** turned its arrow and saved your
42
+ choice, but the prompts stayed on screen. They now fold away as intended.
43
+
44
+ ## 0.45.0
45
+
46
+ **Expand a pane to fill the review page.** Buddy AI, Issues, Questions, Files and the review path
47
+ each have an expand button at the right of their title (on the review path, beside the theme count).
48
+ The pane you expand takes the whole review page below the header, which still shows the pull
49
+ request, its branch and its freshness. The collapse button, Escape or your browser's Back button puts
50
+ the page back as it was, and Forward expands it again. Nothing in the pane is reloaded on the way in
51
+ or out, so a conversation, an open file and your scroll position are all still there. An expanded
52
+ pane is part of the page's address, so a reload keeps it. With the review path expanded, its themes
53
+ are listed above the current one, and moving between them keeps it expanded.
54
+
55
+ **Ask Buddy about a whole issue or question.** Every issue and question card now has a sparkle icon
56
+ next to Copy. It opens the same questions you get by selecting text: **Explain**, **Explain simply**,
57
+ **Is this actually a problem?**, **Why does this matter?**, **Suggest a better implementation** and
58
+ **Generate a question for the author**, plus your own prompts. Buddy AI answers about the entire
59
+ finding straight away, in the pane beside the review. **Ask a question** and your own prompts put the
60
+ finding in the question box for you to finish instead. Selecting text works as before: whatever you
61
+ pick goes into the question box, and nothing is sent until you send it.
62
+
63
+ **Explain and Explain simply are now two different questions.** In the review page's menus,
64
+ **Explain** gives a full explanation with the technical detail kept, and **Explain simply** asks for
65
+ the plain version that **Explain** used to give.
66
+
67
+ **Starter prompts.** If you have never saved a prompt, **Your prompts** now starts with five:
68
+ **Teach me this**, **What could go wrong?**, **Walk me through it**, **What should I verify?** and
69
+ **What does it assume?**. They are ordinary prompts that you can edit or delete, and a prompt you delete
70
+ does not come back. If you have ever saved a prompt, your list is left exactly as it is.
71
+
72
+ **Your prompts can be folded away.** Click **Your prompts** in Buddy AI to hide the prompts and show
73
+ only how many you have, and click it again to show them. **Add** stays visible either way, and every
74
+ review remembers your choice. The suggested questions Buddy AI makes for each review are not affected.
75
+
76
+ **The address always names the theme you are reading.** Opening the review path now shows its
77
+ address as the theme it opens on, and a theme tag on a card changes the address too. Back and Forward
78
+ step through the themes you actually read, instead of going back to the review path while still
79
+ showing the theme you left.
80
+
81
+ **Review summaries on the Reviews page show code as code.** Names the review wrote in backticks now
82
+ appear as inline code instead of showing the backticks.
83
+
3
84
  ## 0.44.0
4
85
 
5
86
  **`prreviewbuddy review --queue` puts the reviews it starts on your review queue.** Add `--queue`
@@ -4644,6 +4644,28 @@ function reviewedCommit(workspace) {
4644
4644
  return workspace.session.metadata?.commitSha || workspace.changeSet.data.pullRequest.head.sha || null;
4645
4645
  }
4646
4646
  /**
4647
+ * Forget what was built from the analysis, because the analysis is being replaced.
4648
+ *
4649
+ * Only the change map. It is made from the review's own themes, so one kept beside a different set
4650
+ * of themes would contradict the guide it sits next to. Diagrams describe code and carry their
4651
+ * commit, so they stay and say they are dated; see `diagrams`.
4652
+ */
4653
+ function dropDerivedFromAnalysis(workspace) {
4654
+ delete workspace.changeMap;
4655
+ }
4656
+ /**
4657
+ * The same, for a review that has just moved to a different commit.
4658
+ *
4659
+ * Said by commit rather than by "an update happened", so an update that found nothing new keeps
4660
+ * the map, and a map drawn from the old analysis while the update was running goes with the rest.
4661
+ */
4662
+ function dropStaleChangeMap(workspace) {
4663
+ const drawnFrom = workspace.changeMap?.commitSha;
4664
+ if (!drawnFrom) return;
4665
+ const reviewed = reviewedCommit(workspace);
4666
+ if (reviewed && drawnFrom !== reviewed) dropDerivedFromAnalysis(workspace);
4667
+ }
4668
+ /**
4647
4669
  * The KISS run the page presents, or null when nobody has run one.
4648
4670
  *
4649
4671
  * Reads the recorded pointer rather than the end of the list, so a failed rerun does not become
@@ -10547,6 +10569,7 @@ async function reanalyseReview(workspaceId, agentId, onStarted, requestedModel)
10547
10569
  saveJob(job);
10548
10570
  workspace.jobId = job.id;
10549
10571
  workspace.session = beginReviewSession(sha, agent, void 0, model ?? void 0);
10572
+ dropDerivedFromAnalysis(workspace);
10550
10573
  saveWorkspace(workspace);
10551
10574
  return job;
10552
10575
  });
@@ -12199,6 +12222,7 @@ function mergeUpdateInto(fresh, updated) {
12199
12222
  for (const field of REVIEWER_SESSION_FIELDS) if (field in fresh.session) session[field] = current[field];
12200
12223
  else delete session[field];
12201
12224
  merged.session = session;
12225
+ dropStaleChangeMap(merged);
12202
12226
  return merged;
12203
12227
  }
12204
12228
  /**
@@ -12627,4 +12651,4 @@ function lineageIds(id) {
12627
12651
  return [.../* @__PURE__ */ new Set([id, ...lineage.map((review) => review.id)])];
12628
12652
  }
12629
12653
  //#endregion
12630
- export { bootstrapUrl as $, recentWorkspaces as $t, createPrState as A, STORE_ROOT as An, fail as At, toneOf as B, driverGone as Bt, readEvents as C, git as Cn, fillFileUrlTemplate as Ct, announceJob as D, readAgentPreference as Dn, reviewedShaOf as Dt, telemetryUploadConsent as E, clearAgentPreference as En, followedBranch as Et, markAllRead as F, detectAgents as Fn, isLiveJob as Ft, MANAGED_ROOT as G, latestKissRun as Gt, withUsageRecorded as H, followedRefName as Ht, markRead as I, AgentCancelledError as In, phasesFor as It, modelHelpLines as J, loadWorkspace as Jt, readMarker as K, lineageKeyFor as Kt, pruneNotifications as L, AgentUnavailableError as Ln, progressSteps as Lt, eventName as M, DEFAULT_AGENT_ID as Mn, loadJob as Mt, headline as N, agentById as Nn, saveJob as Nt, branchOf as O, writeAgentPreference as On, allJobs as Ot, listNotifications as P, agentFor as Pn, PHASES as Pt, readIndexToken as Q, previousKissResult as Qt, readNotification as R, purposeOf as Rt, startJob as S, isCommitReview as Sn, remoteHost as St, recordTelemetryUploadConsent as T, resolveModel as Tn, checkReview as Tt, EXPLAIN_SIMPLY_PROMPT as U, groupByLineage as Ut, unreadCount as V, isClaimed as Vt, ReviewBeingDeletedError as W, indexReviewGroups as Wt, compactQueue as X, mutateWorkspace as Xt, relativeTime as Y, matchingWorkspaceIds as Yt, queueForReview as Z, positionInLineage as Zt, agentEnvOf as _, reviewerDispositions as _n, statedWorkspacePort as _t, wasBlocked as a, workspaceStamps as an, spawnServer as at, reanalyseReview as b, resolveTarget as bn, forgeResolver as bt, RefreshUnavailableError as c, queueAddMany as cn, writeServerRecord as ct, refreshPrContext as d, readQueue as dn, feedbackUrl as dt, reviewedCommit as en, clearServerRecord as et, isUnchanged as f, doneVerb as fn, DEFAULT_WORKSPACE_PORT as ft, runningJobs as g, questionsOutstanding as gn, resolveWorkspacePort as gt, liveUpdateFor as h, issuesOutstanding as hn, parseWorkspacePort as ht, liveJobsFor as i, workspaceRevision as in, serverEntryExists as it, createPrUpdate as j, AGENT_IDS as jn, isTerminal as jt, subjectOf as k, CONFIG_PATH as kn, endedAt as kt, mergeUpdateInto as l, queueRemove as ln, BUILD_VERSION as lt, UpdateAlreadyRunningError as m, isQuestionOutstanding as mn, MIN_WORKSPACE_PORT as mt, deleteReview as n, summarise as nn, readServerRecord as nt, discardJob as o, dequeueOnComplete as on, stopServer as ot, askCheckout as p, isIssueOutstanding as pn, MAX_WORKSPACE_PORT as pt, removeWorktree as q, lineagePosition as qt, lineageIds as r, touchWorkspace as rn, reviewsUrl as rt, FETCH_TIMEOUT_MS as s, queueAdd as sn, workspaceUrl as st, deleteLineage as t, reviewedRepositories as tn, ensureServer as tt, updateReview as u, queueStamp as un, PACKAGE_NAME as ut, recordKissRun as v, processDiscussion as vn, writePortPreference as vt, record as w, resolveAgent as wn, checkCodeFreshness as wt, runJob as x, displayRef as xn, forgeFor as xt, startKissJob as y, describeAuthorship as yn, claimRequestUrl as yt, removeNotification as z, clearClaim as zt };
12654
+ export { queueForReview as $, positionInLineage as $t, createPrState as A, writeAgentPreference as An, allJobs as At, toneOf as B, purposeOf as Bt, readEvents as C, displayRef as Cn, forgeFor as Ct, announceJob as D, resolveModel as Dn, checkReview as Dt, telemetryUploadConsent as E, resolveAgent as En, checkCodeFreshness as Et, markAllRead as F, agentById as Fn, saveJob as Ft, extractJsonText as G, groupByLineage as Gt, withUsageRecorded as H, driverGone as Ht, markRead as I, agentFor as In, PHASES as It, readMarker as J, lineageKeyFor as Jt, ReviewBeingDeletedError as K, indexReviewGroups as Kt, pruneNotifications as L, detectAgents as Ln, isLiveJob as Lt, eventName as M, STORE_ROOT as Mn, fail as Mt, headline as N, AGENT_IDS as Nn, isTerminal as Nt, branchOf as O, clearAgentPreference as On, followedBranch as Ot, listNotifications as P, DEFAULT_AGENT_ID as Pn, loadJob as Pt, compactQueue as Q, mutateWorkspace as Qt, readNotification as R, AgentCancelledError as Rn, phasesFor as Rt, startJob as S, resolveTarget as Sn, forgeResolver as St, recordTelemetryUploadConsent as T, git as Tn, fillFileUrlTemplate as Tt, EXPLAIN_SIMPLY_PROMPT as U, isClaimed as Ut, unreadCount as V, clearClaim as Vt, asString as W, followedRefName as Wt, modelHelpLines as X, loadWorkspace as Xt, removeWorktree as Y, lineagePosition as Yt, relativeTime as Z, matchingWorkspaceIds as Zt, agentEnvOf as _, issuesOutstanding as _n, parseWorkspacePort as _t, wasBlocked as a, touchWorkspace as an, reviewsUrl as at, reanalyseReview as b, processDiscussion as bn, writePortPreference as bt, RefreshUnavailableError as c, dequeueOnComplete as cn, stopServer as ct, refreshPrContext as d, queueRemove as dn, BUILD_VERSION as dt, previousKissResult as en, readIndexToken as et, isUnchanged as f, queueStamp as fn, PACKAGE_NAME as ft, runningJobs as g, isQuestionOutstanding as gn, MIN_WORKSPACE_PORT as gt, liveUpdateFor as h, isIssueOutstanding as hn, MAX_WORKSPACE_PORT as ht, liveJobsFor as i, summarise as in, readServerRecord as it, createPrUpdate as j, CONFIG_PATH as jn, endedAt as jt, subjectOf as k, readAgentPreference as kn, reviewedShaOf as kt, mergeUpdateInto as l, queueAdd as ln, workspaceUrl as lt, UpdateAlreadyRunningError as m, doneVerb as mn, DEFAULT_WORKSPACE_PORT as mt, deleteReview as n, reviewedCommit as nn, clearServerRecord as nt, discardJob as o, workspaceRevision as on, serverEntryExists as ot, askCheckout as p, readQueue as pn, feedbackUrl as pt, MANAGED_ROOT as q, latestKissRun as qt, lineageIds as r, reviewedRepositories as rn, ensureServer as rt, FETCH_TIMEOUT_MS as s, workspaceStamps as sn, spawnServer as st, deleteLineage as t, recentWorkspaces as tn, bootstrapUrl as tt, updateReview as u, queueAddMany as un, writeServerRecord as ut, recordKissRun as v, questionsOutstanding as vn, resolveWorkspacePort as vt, record as w, isCommitReview as wn, remoteHost as wt, runJob as x, describeAuthorship as xn, claimRequestUrl as xt, startKissJob as y, reviewerDispositions as yn, statedWorkspacePort as yt, removeNotification as z, AgentUnavailableError as zn, progressSteps as zt };
package/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as bootstrapUrl, $t as recentWorkspaces, An as STORE_ROOT, Bt as driverGone, Cn as git, Dn as readAgentPreference, E as telemetryUploadConsent, Fn as detectAgents, G as MANAGED_ROOT, Ht as followedRefName, J as modelHelpLines, Jt as loadWorkspace, K as readMarker, Kt as lineageKeyFor, Lt as progressSteps, Mn as DEFAULT_AGENT_ID, Mt as loadJob, Nn as agentById, On as writeAgentPreference, Ot as allJobs, Pt as PHASES, Q as readIndexToken, Rt as purposeOf, S as startJob, T as recordTelemetryUploadConsent, Tn as resolveModel, Tt as checkReview, Ut as groupByLineage, Vt as isClaimed, Xt as mutateWorkspace, Y as relativeTime, Yt as matchingWorkspaceIds, Z as queueForReview, Zt as positionInLineage, _t as statedWorkspacePort, a as wasBlocked, b as reanalyseReview, bn as resolveTarget, bt as forgeResolver, ft as DEFAULT_WORKSPACE_PORT, g as runningJobs, h as liveUpdateFor, ht as parseWorkspacePort, i as liveJobsFor, jn as AGENT_IDS, jt as isTerminal, kn as CONFIG_PATH, l as mergeUpdateInto, lt as BUILD_VERSION, m as UpdateAlreadyRunningError, mt as MIN_WORKSPACE_PORT, n as deleteReview$1, nn as summarise, ot as stopServer, pt as MAX_WORKSPACE_PORT, q as removeWorktree, rt as reviewsUrl, st as workspaceUrl, tn as reviewedRepositories, tt as ensureServer, u as updateReview, ut as PACKAGE_NAME, v as recordKissRun, vt as writePortPreference, w as record$1, wn as resolveAgent, x as runJob, xn as displayRef, zt as clearClaim } from "./delete_review-BWMmO81Q.js";
2
+ import { $ as queueForReview, $t as positionInLineage, An as writeAgentPreference, At as allJobs, Bt as purposeOf, Cn as displayRef, Dn as resolveModel, Dt as checkReview, E as telemetryUploadConsent, En as resolveAgent, Fn as agentById, Gt as groupByLineage, Ht as driverGone, It as PHASES, J as readMarker, Jt as lineageKeyFor, Ln as detectAgents, Mn as STORE_ROOT, Nn as AGENT_IDS, Nt as isTerminal, Pn as DEFAULT_AGENT_ID, Pt as loadJob, Qt as mutateWorkspace, S as startJob, Sn as resolveTarget, St as forgeResolver, T as recordTelemetryUploadConsent, Tn as git, Ut as isClaimed, Vt as clearClaim, Wt as followedRefName, X as modelHelpLines, Xt as loadWorkspace, Y as removeWorktree, Z as relativeTime, Zt as matchingWorkspaceIds, _t as parseWorkspacePort, a as wasBlocked, at as reviewsUrl, b as reanalyseReview, bt as writePortPreference, ct as stopServer, dt as BUILD_VERSION, et as readIndexToken, ft as PACKAGE_NAME, g as runningJobs, gt as MIN_WORKSPACE_PORT, h as liveUpdateFor, ht as MAX_WORKSPACE_PORT, i as liveJobsFor, in as summarise, jn as CONFIG_PATH, kn as readAgentPreference, l as mergeUpdateInto, lt as workspaceUrl, m as UpdateAlreadyRunningError, mt as DEFAULT_WORKSPACE_PORT, n as deleteReview$1, q as MANAGED_ROOT, rn as reviewedRepositories, rt as ensureServer, tn as recentWorkspaces, tt as bootstrapUrl, u as updateReview, v as recordKissRun, w as record$1, x as runJob, yt as statedWorkspacePort, zt as progressSteps } from "./delete_review-lmVdoybL.js";
3
3
  import { basename, dirname, join, resolve } from "node:path";
4
4
  import { spawn } from "node:child_process";
5
5
  import { existsSync, mkdirSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync } from "node:fs";