pierre-review 0.1.54 → 0.1.56

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.
@@ -2,7 +2,8 @@ import { config } from '../../config.js';
2
2
  import { accountToLocalUser } from '../../auth/account.js';
3
3
  import { accountIdOf } from '../plugins/auth.js';
4
4
  import { getProCapabilities } from '../../pro/contract.js';
5
- import { countNewMyTurnFeedItems, dismissMyTurn, getCompletedDismissals, getFeedLastSeenAt, getMyTurn, markFeedSeen, undismissMyTurn, } from '../../db/queries.js';
5
+ import { getFyiProvider } from '../../feed/fyi-provider.js';
6
+ import { dismissMyTurn, getCompletedDismissals, getFeedLastSeenAt, getMyTurn, markFeedSeen, undismissMyTurn, } from '../../db/queries.js';
6
7
  const dismissSchema = {
7
8
  body: {
8
9
  type: 'object',
@@ -24,11 +25,11 @@ export async function meRoutes(app) {
24
25
  const myTurn = await getMyTurn(accountId);
25
26
  // Feed "seen" marker + how many FYI items are new since. Only counted once a
26
27
  // baseline exists (feedLastSeenAt set by the first feed view) so a fresh account
27
- // never sees a scary first-load number.
28
+ // never sees a scary first-load number. FYI is a Pro capability — the count comes
29
+ // from the plugin's enricher (0 on the free tier, where there's no provider).
28
30
  const feedLastSeen = await getFeedLastSeenAt(accountId);
29
- const newFeedItems = feedLastSeen
30
- ? await countNewMyTurnFeedItems(accountId, feedLastSeen)
31
- : 0;
31
+ const fyi = getFyiProvider();
32
+ const newFeedItems = feedLastSeen && fyi ? await fyi.countNewSince(accountId, feedLastSeen) : 0;
32
33
  return {
33
34
  user,
34
35
  counts: {
@@ -41,7 +42,7 @@ export async function meRoutes(app) {
41
42
  },
42
43
  feedLastSeenAt: feedLastSeen ? feedLastSeen.toISOString() : null,
43
44
  newFeedItems,
44
- claudeReviewEnabled: config.claudeReviewEnabled,
45
+ // Claude Review is now the Pro `claudeReview` capability (in `pro` below).
45
46
  deploymentMode: config.deploymentMode,
46
47
  pro: getProCapabilities(),
47
48
  };
package/dist/app.js CHANGED
@@ -19,7 +19,6 @@ import { feedRoutes } from './api/routes/feed.js';
19
19
  import { mergersRoutes } from './api/routes/mergers.js';
20
20
  import { insightsRoutes } from './api/routes/insights.js';
21
21
  import { activityRoutes } from './api/routes/activity.js';
22
- import { claudeReviewRoutes } from './api/routes/claude-review.js';
23
22
  export async function buildApp() {
24
23
  const app = Fastify({
25
24
  // In production (the installed CLI) the per-request "incoming request" /
@@ -132,10 +131,9 @@ export async function buildApp() {
132
131
  await app.register(mergersRoutes);
133
132
  await app.register(insightsRoutes);
134
133
  await app.register(activityRoutes);
135
- // Claude Review is local-only + opt-in. Only register its routes when enabled,
136
- // so the clone-manager / gh-CLI dependency is unreachable in cloud mode.
137
- if (config.claudeReviewEnabled)
138
- await app.register(claudeReviewRoutes);
134
+ // Claude Review moved into the @pierre/pro plugin (its routes register there, gated on the
135
+ // `claudeReview` capability). The SDK-run / diff-prep / GitHub-post infra + the tables stay
136
+ // in core behind the ctx.review seam; nothing to register here.
139
137
  return app;
140
138
  }
141
139
  //# sourceMappingURL=app.js.map
package/dist/config.js CHANGED
@@ -141,18 +141,16 @@ export const config = {
141
141
  digestMaxReposPerRefresh: intFromEnv('PRO_DIGEST_MAX_REPOS', 30),
142
142
  digestMinIntervalSec: intFromEnv('PRO_DIGEST_MIN_INTERVAL_SEC', 60),
143
143
  },
144
- // ---- Claude Review (agentic PR review; opt-in, LOCAL-ONLY) ----
145
- // OFF by default: the feature spends real money / Agent-SDK credits per run.
146
- // Enable with ENABLE_CLAUDE_REVIEW=true. FORCE-DISABLED in cloud mode (it
147
- // shells out to a local gh + writable clone dir that don't exist on Railway).
148
- claudeReviewEnabled: !isCloud && process.env.ENABLE_CLAUDE_REVIEW === 'true',
144
+ // ---- Claude Review — CORE infra knobs (the product moved to @pierre/pro) ----
145
+ // The SDK-run / diff-prep infra behind the ctx.review seam reads these. The old
146
+ // `claudeReviewEnabled` env flag was removed Claude Review is now the Pro
147
+ // `claudeReview` capability (PRO_CLAUDE_REVIEW_ENABLED); the routing thresholds,
148
+ // concurrency + queue caps, and the default-model picker moved to PRO_REVIEW_* env.
149
149
  // Partial clones + ephemeral worktrees live here (a user-writable home path,
150
150
  // never the read-only install dir). CLONE_DIR overrides.
151
151
  cloneDir: process.env.CLONE_DIR ?? resolve(homedir(), '.pierre-review', 'clones'),
152
152
  // Soft cap on the clone cache before LRU cleanup evicts idle repos (default 2 GiB).
153
153
  cloneCacheMaxBytes: intFromEnv('CLONE_CACHE_MAX_BYTES', 2 * 1024 * 1024 * 1024),
154
- // Default model for the picker; per-run model still overrides on the request.
155
- defaultReviewModel: process.env.DEFAULT_REVIEW_MODEL ?? 'claude-sonnet-4-6',
156
154
  // Per-run caps (cost/disk/time runaway guards). The diff is inlined in full, so
157
155
  // reviews need far fewer turns than the old default; 30 is still generous.
158
156
  reviewMaxTurns: intFromEnv('REVIEW_MAX_TURNS', 30),
@@ -191,16 +189,8 @@ export const config = {
191
189
  // Applied only to effort-capable models (Sonnet/Opus); Haiku ignores it.
192
190
  reviewEffort: effortFromEnv('REVIEW_EFFORT', 'medium'),
193
191
  reviewDiffOnlyEffort: effortFromEnv('REVIEW_DIFF_ONLY_EFFORT', 'low'),
194
- // At most one review per PR; this caps concurrent reviews across all PRs. Default
195
- // 4 so the user can bulk-review (extras queue, see review-manager). Raising this
196
- // also DISABLES the per-run env auth adjustment (which mutates process.env and is
197
- // only safe at concurrency 1 — see auth.applyClaudeReviewAuth); the raw ambient
198
- // env is used instead. Set REVIEW_CONCURRENCY=1 to restore prefer-ambient + the
199
- // API-key fallback.
200
- reviewConcurrency: intFromEnv('REVIEW_CONCURRENCY', 4),
201
- // Hard ceiling on QUEUED (not-yet-started) reviews, a runaway guard for bulk
202
- // triggering; further starts return 'busy' until the queue drains.
203
- reviewMaxQueued: intFromEnv('REVIEW_MAX_QUEUED', 50),
192
+ // (Review concurrency + queue caps + the routing thresholds moved to the plugin's
193
+ // PRO_REVIEW_* env the plugin owns the queue/manager + the mode-routing decision.)
204
194
  // ---- AI Fix (Pro: agentic code fixer) — core infra knobs ----
205
195
  // The write-capable fixer (packages/pro/ai-fix) reuses the review clone/agent
206
196
  // machinery. A runaway fixer is pricier than a review (it edits + re-reads files),
@@ -217,26 +207,6 @@ export const config = {
217
207
  // rebased commit that conflicts gets one resolver pass, up to this many steps, then
218
208
  // we abort the rebase rather than loop forever on a pathological history.
219
209
  aiFixRebaseMaxSteps: intFromEnv('AI_FIX_REBASE_MAX_STEPS', 10),
220
- // ---- Claude Review routing (diff-only vs worktree) — THE THRESHOLDS ----
221
- // The deterministic pre-check (review/routing.ts) decides, BEFORE the agent runs,
222
- // whether a PR can be reviewed from its diff alone (fast, tool-less, no worktree)
223
- // or needs the full cloned worktree as explorable context. A change stays
224
- // 'diff_only' only if it is within EVERY ceiling below AND touches no exported/
225
- // public API; otherwise it routes to 'worktree'. The numbers are deliberately
226
- // CONSERVATIVE — any tie routes to worktree, since over-reviewing is safe but
227
- // under-reviewing a risky change is not. Every decision input is logged on the
228
- // run (claude_reviews.route_reason) so these can be tuned against the agent's own
229
- // scopeUsed self-report. This is the single place to review/adjust the thresholds.
230
- reviewRouting: {
231
- // Max (non-noise) files changed for a diff-only review.
232
- maxFiles: intFromEnv('REVIEW_ROUTE_MAX_FILES', 5),
233
- // Max added + deleted lines (non-noise files) for a diff-only review.
234
- maxLines: intFromEnv('REVIEW_ROUTE_MAX_LINES', 150),
235
- // Max distinct directories touched for a diff-only review.
236
- maxDirs: intFromEnv('REVIEW_ROUTE_MAX_DIRS', 2),
237
- // Max distinct top-level subsystems (first path segment) for a diff-only review.
238
- maxSubsystems: intFromEnv('REVIEW_ROUTE_MAX_SUBSYSTEMS', 1),
239
- },
240
210
  };
241
211
  // Fail loud at startup if a required cloud var is missing — mirrors the
242
212
  // gh-auth loud failure. Called from index.ts only when deploymentMode==='cloud'.