@effect-agent/pr-review 0.1.0-beta.23 → 0.1.0-beta.25

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.
Files changed (37) hide show
  1. package/README.md +83 -195
  2. package/dist/action.d.mts +27 -18
  3. package/dist/action.mjs +60 -39
  4. package/dist/action.mjs.map +1 -1
  5. package/dist/cli.mjs +3 -3
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/{fan-out-BJBTAYuh.d.mts → fan-out-CMEsbFLk.d.mts} +455 -177
  8. package/dist/{github-BbwYzNrC.mjs → github-NjgxGqwM.mjs} +2163 -1518
  9. package/dist/github-NjgxGqwM.mjs.map +1 -0
  10. package/dist/index.d.mts +30 -20
  11. package/dist/index.mjs +3 -3
  12. package/dist/{providers-NyP-4rS6.mjs → providers-CODZQCmL.mjs} +202 -80
  13. package/dist/providers-CODZQCmL.mjs.map +1 -0
  14. package/dist/testing.d.mts +3 -1
  15. package/dist/testing.mjs +3 -2
  16. package/dist/testing.mjs.map +1 -1
  17. package/package.json +2 -2
  18. package/src/action.ts +141 -78
  19. package/src/cli.ts +6 -1
  20. package/src/index.ts +1 -0
  21. package/src/internal/adjudication.ts +415 -0
  22. package/src/internal/coverage.ts +41 -60
  23. package/src/internal/factory.ts +4 -4
  24. package/src/internal/fan-out.ts +208 -14
  25. package/src/internal/fingerprint.ts +16 -10
  26. package/src/internal/fixtures.ts +6 -0
  27. package/src/internal/github-env.ts +9 -0
  28. package/src/internal/github.ts +243 -7
  29. package/src/internal/progress.ts +1 -1
  30. package/src/internal/render.ts +186 -42
  31. package/src/internal/retirement.ts +16 -17
  32. package/src/internal/review-agent.ts +39 -4
  33. package/src/internal/review-state.ts +315 -105
  34. package/src/internal/review-units.ts +10 -9
  35. package/src/internal/run.ts +197 -63
  36. package/dist/github-BbwYzNrC.mjs.map +0 -1
  37. package/dist/providers-NyP-4rS6.mjs.map +0 -1
@@ -281,6 +281,18 @@ declare const ReviewMission_base: Schema.Class<ReviewMission, Schema.Struct<{
281
281
  readonly baseRef: Schema.NonEmptyString;
282
282
  readonly headRef: Schema.NonEmptyString;
283
283
  readonly changedFileCount: Schema.Int;
284
+ /**
285
+ * Maintainer-adjudicated identities rendered as bounded context lines; the
286
+ * reviewer must not re-raise them without materially new evidence. Absent
287
+ * from fingerprint missions so an adjudication never invalidates the
288
+ * skip-unchanged authority.
289
+ */
290
+ readonly adjudicatedContext: Schema.optionalKey<Schema.$Array<Schema.String>>;
291
+ /**
292
+ * Prior-round findings on re-reviewed scope, rendered as bounded context
293
+ * lines; each must be confirmed, declared fixed, or explicitly withdrawn.
294
+ */
295
+ readonly priorFindingContext: Schema.optionalKey<Schema.$Array<Schema.String>>;
284
296
  }>, {}>;
285
297
  declare class ReviewMission extends ReviewMission_base {}
286
298
  declare const FindingSeverity: Schema.Literals<readonly ["blocking", "important", "nit"]>;
@@ -308,6 +320,7 @@ declare class ReviewFinding extends ReviewFinding_base {}
308
320
  declare const ReviewVerdict: Schema.Literals<readonly ["approve", "comment", "request-changes"]>;
309
321
  type ReviewVerdict = typeof ReviewVerdict.Type;
310
322
  declare const ReviewConcern_base: Schema.Class<ReviewConcern, Schema.Struct<{
323
+ readonly evidencePaths: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
311
324
  readonly severity: Schema.Literals<readonly ["blocking", "important", "nit"]>;
312
325
  readonly title: Schema.NonEmptyString;
313
326
  readonly body: Schema.NonEmptyString;
@@ -316,8 +329,11 @@ declare const ReviewConcern_base: Schema.Class<ReviewConcern, Schema.Struct<{
316
329
  * A concern with no diff line to anchor to: a missing deletion or cleanup,
317
330
  * rollout or migration sequencing, a coverage gap the diff implies but does
318
331
  * not add, or a scope question only the author can answer. Rendered as a
319
- * review-body section never as an inline comment, so it needs no anchor and
320
- * is never demoted.
332
+ * review-body section instead of an inline comment. `evidencePaths` binds the
333
+ * concern to changed files so a later incremental review can invalidate and
334
+ * recheck it when any supporting path changes. It remains optional only for
335
+ * decoding review output and continuity state written before path binding was
336
+ * introduced; a pathless concern cannot authorize incremental continuity.
321
337
  */
322
338
  declare class ReviewConcern extends ReviewConcern_base {}
323
339
  /** The per-entry walkthrough summary bound, and the entries bound (the changeset cap). */
@@ -380,6 +396,360 @@ declare const PullRequestReviewer: import("effect-agent").Definition<typeof Revi
380
396
  }, PullRequestSource>;
381
397
  }>, undefined>;
382
398
  //#endregion
399
+ //#region src/internal/review-state.d.ts
400
+ declare const ReviewMode: Schema.Literals<readonly ["incremental", "final"]>;
401
+ type ReviewMode = typeof ReviewMode.Type;
402
+ declare const ReviewScopeMode: Schema.Literals<readonly ["incremental", "full"]>;
403
+ type ReviewScopeMode = typeof ReviewScopeMode.Type;
404
+ declare const GitCommitSha: Schema.NonEmptyString;
405
+ declare const StoredReviewFinding_base: Schema.Class<StoredReviewFinding, Schema.Struct<{
406
+ readonly path: Schema.NonEmptyString;
407
+ readonly startLine: Schema.Int;
408
+ readonly endLine: Schema.Int;
409
+ readonly severity: Schema.Literals<readonly ["blocking", "important", "nit"]>;
410
+ readonly title: Schema.NonEmptyString;
411
+ readonly body: Schema.NonEmptyString;
412
+ }>, {}>;
413
+ /** A compact unresolved finding suitable for the bounded review-body marker. */
414
+ declare class StoredReviewFinding extends StoredReviewFinding_base {}
415
+ declare const StoredReviewConcern_base: Schema.Class<StoredReviewConcern, Schema.Struct<{
416
+ /** Absent only on legacy state written before concern path binding. */
417
+ readonly evidencePaths: Schema.optionalKey<Schema.$Array<Schema.NonEmptyString>>;
418
+ readonly severity: Schema.Literals<readonly ["blocking", "important", "nit"]>;
419
+ readonly title: Schema.NonEmptyString;
420
+ readonly body: Schema.NonEmptyString;
421
+ }>, {}>;
422
+ /** A compact unresolved non-anchored concern with its invalidation paths. */
423
+ declare class StoredReviewConcern extends StoredReviewConcern_base {}
424
+ /** How a maintainer settled a previously raised finding or concern. */
425
+ declare const AdjudicationDisposition: Schema.Literals<readonly ["accepted-risk", "refuted", "obsolete"]>;
426
+ type AdjudicationDisposition = typeof AdjudicationDisposition.Type;
427
+ /** The adjudications bound carried by the ReviewState schema. */
428
+ declare const MAX_STORED_ADJUDICATIONS = 20;
429
+ declare const StoredAdjudication_base: Schema.Class<StoredAdjudication, Schema.Struct<{
430
+ readonly path: Schema.optionalKey<Schema.NonEmptyString>;
431
+ readonly startLine: Schema.optionalKey<Schema.Int>;
432
+ readonly endLine: Schema.optionalKey<Schema.Int>;
433
+ readonly title: Schema.NonEmptyString;
434
+ readonly disposition: Schema.Literals<readonly ["accepted-risk", "refuted", "obsolete"]>;
435
+ readonly reason: Schema.optionalKey<Schema.NonEmptyString>;
436
+ /** GitHub login of the maintainer whose comment adjudicated the identity. */
437
+ readonly actor: Schema.NonEmptyString;
438
+ }>, {}>;
439
+ declare class StoredAdjudication extends StoredAdjudication_base {}
440
+ /**
441
+ * The one finding-identity composition shared by retirement, adjudication,
442
+ * and settlement. A tagged JSON tuple keeps anchored findings in a namespace
443
+ * disjoint from title-only concerns and remains unambiguous even when
444
+ * untrusted path or title text contains delimiter characters.
445
+ */
446
+ declare const findingIdentity: (finding: {
447
+ readonly path: string;
448
+ readonly startLine: number;
449
+ readonly endLine: number;
450
+ readonly title: string;
451
+ }) => string;
452
+ /** The disjoint title-only identity namespace for unanchored concerns. */
453
+ declare const concernIdentity: (concern: {
454
+ readonly title: string;
455
+ }) => string;
456
+ /**
457
+ * An adjudication's identity: the shared finding identity when anchored, the
458
+ * disjoint concern identity when unanchored.
459
+ */
460
+ declare const adjudicationIdentity: (adjudication: StoredAdjudication) => string;
461
+ /** The carried-scope bound; a run that cannot fit its leftovers publishes no state. */
462
+ declare const MAX_STORED_UNREVIEWED_PATHS = 100;
463
+ /** Failed-pass records stored beside the leftover paths; one per unit stage. */
464
+ declare const MAX_STORED_UNREVIEWED_PASSES = 24;
465
+ /** Stages a leftover path may need retried without a second general discovery. */
466
+ declare const UnreviewedStage: Schema.Literals<readonly ["discovery", "specialist", "verification"]>;
467
+ type UnreviewedStage = typeof UnreviewedStage.Type;
468
+ declare const StoredUnreviewedPass_base: Schema.Class<StoredUnreviewedPass, Schema.Struct<{
469
+ readonly stage: Schema.Literals<readonly ["discovery", "specialist", "verification"]>;
470
+ readonly paths: Schema.$Array<Schema.NonEmptyString>;
471
+ }>, {}>;
472
+ /** One failed fan-out pass whose paths should be retried, not rediscovered. */
473
+ declare class StoredUnreviewedPass extends StoredUnreviewedPass_base {}
474
+ declare const ReviewState_base: Schema.Class<ReviewState, Schema.Struct<{
475
+ readonly version: Schema.Literal<1>;
476
+ readonly repository: Schema.NonEmptyString;
477
+ readonly pullRequestNumber: Schema.Int;
478
+ readonly baseRef: Schema.NonEmptyString;
479
+ readonly baseSha: Schema.NonEmptyString;
480
+ readonly headRef: Schema.NonEmptyString;
481
+ readonly reviewedHeadSha: Schema.NonEmptyString;
482
+ readonly profileFingerprint: Schema.String;
483
+ readonly settledScopeFingerprint: Schema.String;
484
+ readonly reviewedPathCount: Schema.Int;
485
+ readonly unresolvedFindings: Schema.$Array<typeof StoredReviewFinding>;
486
+ readonly unresolvedConcerns: Schema.$Array<typeof StoredReviewConcern>;
487
+ /** Retryable review gaps carried into the next incremental run's scope. */
488
+ readonly unreviewedPaths: Schema.$Array<Schema.NonEmptyString>;
489
+ /** Which failed pass produced those leftovers. */
490
+ readonly unreviewedPasses: Schema.$Array<typeof StoredUnreviewedPass>;
491
+ /**
492
+ * True only when the producing run had complete input coverage, no
493
+ * unsettled pass, and nothing carried. Skip-unchanged authority: an
494
+ * unchanged patch may skip re-review only over a settled state.
495
+ */
496
+ readonly settled: Schema.Boolean;
497
+ readonly lastReviewMode: Schema.Literals<readonly ["incremental", "full"]>;
498
+ /**
499
+ * Maintainer adjudications standing against this pull request. optionalKey
500
+ * so state markers signed before the field existed still decode.
501
+ */
502
+ readonly adjudications: Schema.optionalKey<Schema.$Array<typeof StoredAdjudication>>;
503
+ }>, {}>;
504
+ /**
505
+ * Versioned state embedded after EVERY completed run that can be signed. The
506
+ * head plus full-scope fingerprint forms an incremental baseline; an absent
507
+ * unresolved item never means the path is defect-free. `unreviewedPaths`
508
+ * carries retryable review gaps (failed passes) forward so the next
509
+ * incremental run re-reviews exactly them plus the new delta — the baseline
510
+ * advances monotonically instead of freezing on one flaky pass and reopening
511
+ * the whole post-baseline scope. Storing hundreds of path strings separately
512
+ * would not fit GitHub's bounded review body in the worst case.
513
+ */
514
+ declare class ReviewState extends ReviewState_base {}
515
+ declare const toStoredFinding: (finding: ReviewFinding) => StoredReviewFinding;
516
+ declare const fromStoredFinding: (finding: StoredReviewFinding) => ReviewFinding;
517
+ declare const toStoredConcern: (concern: ReviewConcern) => StoredReviewConcern;
518
+ declare const fromStoredConcern: (concern: StoredReviewConcern) => ReviewConcern;
519
+ declare const MAX_REVIEW_STATE_MARKER_CHARS = 24000;
520
+ declare const ReviewStateMarker: Schema.brand<Schema.NonEmptyString, "@effect-agent/pr-review/ReviewStateMarker">;
521
+ type ReviewStateMarker = typeof ReviewStateMarker.Type;
522
+ declare const ReviewStateAuthenticationFailure_base: Schema.Class<ReviewStateAuthenticationFailure, Schema.TaggedStruct<"ReviewStateAuthenticationFailure", {
523
+ readonly operation: Schema.Literals<readonly ["sign", "verify"]>;
524
+ readonly reason: Schema.NonEmptyString;
525
+ }>, import("effect/Cause").YieldableError>;
526
+ declare class ReviewStateAuthenticationFailure extends ReviewStateAuthenticationFailure_base {}
527
+ declare const ReviewStateMarkerTooLarge_base: Schema.Class<ReviewStateMarkerTooLarge, Schema.TaggedStruct<"ReviewStateMarkerTooLarge", {
528
+ readonly observedChars: Schema.Int;
529
+ readonly maximumChars: Schema.Int;
530
+ }>, import("effect/Cause").YieldableError>;
531
+ declare class ReviewStateMarkerTooLarge extends ReviewStateMarkerTooLarge_base {}
532
+ declare const ReviewStateAuthenticator_base: Context.ServiceClass<ReviewStateAuthenticator, "@effect-agent/pr-review/ReviewStateAuthenticator", {
533
+ readonly status: "available" | "unavailable";
534
+ readonly unavailableReason: string | undefined;
535
+ readonly render: (state: ReviewState) => Effect.Effect<ReviewStateMarker, ReviewStateAuthenticationFailure | ReviewStateMarkerTooLarge>;
536
+ readonly extract: (body: string) => Effect.Effect<Option.Option<ReviewState>, ReviewStateAuthenticationFailure>;
537
+ }>;
538
+ declare class ReviewStateAuthenticator extends ReviewStateAuthenticator_base {}
539
+ /** Validated WebCrypto adapter selected at the Action composition root. */
540
+ declare const webCryptoReviewStateAuthenticatorLayer: (secret: Redacted.Redacted<string>) => Layer.Layer<ReviewStateAuthenticator>;
541
+ /** Explicit no-state implementation for hosts without a stable authentication secret. */
542
+ declare const unavailableReviewStateAuthenticatorLayer: (reason: string) => Layer.Layer<ReviewStateAuthenticator>;
543
+ declare const ReviewHeadComparison_base: Schema.Class<ReviewHeadComparison, Schema.Struct<{
544
+ readonly status: Schema.Literals<readonly ["ahead", "behind", "diverged", "identical"]>;
545
+ readonly baseSha: Schema.NonEmptyString;
546
+ readonly headSha: Schema.NonEmptyString;
547
+ readonly mergeBaseSha: Schema.NonEmptyString;
548
+ readonly files: Schema.$Array<typeof ChangedFile>;
549
+ /** GitHub caps compare-file payloads at 300; equality is conservatively truncated. */
550
+ readonly truncated: Schema.Boolean;
551
+ }>, {}>;
552
+ /** The bounded result of GitHub's previous-head...current-head comparison. */
553
+ declare class ReviewHeadComparison extends ReviewHeadComparison_base {}
554
+ /** Internal review selection applied as a decorator over the full PR source. */
555
+ interface ReviewSelection {
556
+ readonly mode: ReviewScopeMode;
557
+ readonly reason: string;
558
+ readonly files: ReadonlyArray<ChangedFile>;
559
+ /** Paths whose changes invalidate prior findings, including paths reverted out of the PR. */
560
+ readonly affectedPaths: ReadonlyArray<string>;
561
+ /**
562
+ * Leftover paths whose contents did not change. Fan-out retries only the
563
+ * recorded failed stages on these paths and keeps their stored findings.
564
+ */
565
+ readonly retryPaths: ReadonlyArray<string>;
566
+ readonly retryStages: ReadonlyArray<UnreviewedStage>;
567
+ readonly totalFiles: number;
568
+ readonly baselineSha: string | undefined;
569
+ readonly priorState: ReviewState | undefined;
570
+ /** Absent only for an explicit full review with no continuity profile. */
571
+ readonly profileFingerprint: string | undefined;
572
+ /** Action-owned authentication capability, constructed at the composition root. */
573
+ readonly stateAuthenticator?: ReviewStateAuthenticator["Service"] | undefined;
574
+ }
575
+ declare const fullReviewSelection: (input: {
576
+ readonly reason: string;
577
+ readonly files: ReadonlyArray<ChangedFile>;
578
+ readonly totalFiles: number;
579
+ readonly profileFingerprint?: string | undefined;
580
+ }) => ReviewSelection;
581
+ /** Three-dot lineage from the reviewed head to the current head is usable. */
582
+ declare const isLineageAncestor: (comparison: ReviewHeadComparison, priorState: ReviewState, currentHeadSha: string) => boolean;
583
+ /**
584
+ * Validate that persisted state belongs to this exact PR/base lineage and the
585
+ * same review profile. A mismatch is a full-review reason, never an error that
586
+ * silently suppresses review work.
587
+ */
588
+ declare const validateReviewState: (state: ReviewState, current: PullRequestMetadata, profileFingerprint: string) => string | undefined;
589
+ /** Pure, deterministic range selection with conservative full-review fallbacks. */
590
+ declare const selectReviewRange: (input: {
591
+ readonly requestedMode: ReviewMode;
592
+ readonly current: PullRequestMetadata;
593
+ readonly fullFiles: ReadonlyArray<ChangedFile>;
594
+ readonly profileFingerprint: string;
595
+ readonly priorState: ReviewState | undefined;
596
+ readonly comparison: ReviewHeadComparison | undefined;
597
+ readonly baseComparison?: ReviewHeadComparison | undefined;
598
+ /**
599
+ * Two-dot tree comparison used when the reviewed head is not a git ancestor
600
+ * (rebase, amend, force-push). Intersected with the current PR path set so
601
+ * main-drift outside the pull request never re-enters scope.
602
+ */
603
+ readonly contentComparison?: ReviewHeadComparison | undefined;
604
+ readonly lookupFailure?: string | undefined;
605
+ }) => ReviewSelection;
606
+ declare const ReviewExecutionContext_base: Context.ServiceClass<ReviewExecutionContext, "@effect-agent/pr-review/ReviewExecutionContext", ReviewSelection>;
607
+ /** Per-run context consumed by orchestration and publication, not by the model. */
608
+ declare class ReviewExecutionContext extends ReviewExecutionContext_base {}
609
+ /**
610
+ * Explicit direct-run adapter for callers that intentionally review the full
611
+ * source without authenticated incremental continuity.
612
+ */
613
+ declare const fullReviewExecutionContextLayer: (reason: string) => Layer.Layer<ReviewExecutionContext, PullRequestSourceFailure, PullRequestSource>;
614
+ /**
615
+ * Decorate the full source with the selected review range. Full anchor files
616
+ * remain available to host-side publication validation; model tools see only
617
+ * the selected delta and may read head context only for that delta's paths.
618
+ */
619
+ declare const selectedPullRequestSourceLayer: (selection: ReviewSelection) => Layer.Layer<PullRequestSource, never, PullRequestSource>;
620
+ /** Build the full-surface mission used only to resolve profile guidance. */
621
+ declare const buildProfileMission: (metadata: PullRequestMetadata, files: ReadonlyArray<ChangedFile>) => ReviewMission;
622
+ //#endregion
623
+ //#region src/internal/adjudication.d.ts
624
+ /** Maximum authorized command candidates retained for one inline thread. */
625
+ declare const MAX_THREAD_ADJUDICATION_COMMANDS = 100;
626
+ declare const AdjudicationComment_base: Schema.Class<AdjudicationComment, Schema.Struct<{
627
+ readonly body: Schema.String;
628
+ /** GitHub's author_association for the comment author, verbatim. */
629
+ readonly authorAssociation: Schema.String;
630
+ readonly authorLogin: Schema.NonEmptyString;
631
+ /** Creation time; a comment without one loses every later-wins tie. */
632
+ readonly createdAt: Schema.NullOr<Schema.DateTimeUtc>;
633
+ /** Stable zero-based order in the source listing, before thread grouping. */
634
+ readonly sourceOrder: Schema.Int;
635
+ }>, {}>;
636
+ /** One reply or top-level comment observed through the adjudication host. */
637
+ declare class AdjudicationComment extends AdjudicationComment_base {}
638
+ declare const AdjudicableThread_base: Schema.Class<AdjudicableThread, Schema.Struct<{
639
+ readonly path: Schema.NonEmptyString;
640
+ readonly startLine: Schema.NullOr<Schema.Int>;
641
+ readonly endLine: Schema.NullOr<Schema.Int>;
642
+ /** The root comment's body; its first line carries the finding title. */
643
+ readonly rootBody: Schema.String;
644
+ readonly replies: Schema.$Array<typeof AdjudicationComment>;
645
+ }>, {}>;
646
+ /** One of the action's own inline finding threads, replies in creation order. */
647
+ declare class AdjudicableThread extends AdjudicableThread_base {}
648
+ declare const ReviewAdjudicationFailure_base: Schema.Class<ReviewAdjudicationFailure, Schema.TaggedStruct<"ReviewAdjudicationFailure", {
649
+ readonly operation: Schema.String;
650
+ readonly reason: Schema.String;
651
+ }>, import("effect/Cause").YieldableError>;
652
+ /** A GitHub adjudication read failed. */
653
+ declare class ReviewAdjudicationFailure extends ReviewAdjudicationFailure_base {
654
+ get message(): string;
655
+ }
656
+ declare const ReviewAdjudicationHost_base: Context.ServiceClass<ReviewAdjudicationHost, "@effect-agent/pr-review/ReviewAdjudicationHost", {
657
+ /** This action's own inline finding threads with their replies. */
658
+ readonly listFindingThreads: Effect.Effect<ReadonlyArray<AdjudicableThread>, ReviewAdjudicationFailure>;
659
+ /** Top-level pull-request conversation comments. */
660
+ readonly listIssueComments: Effect.Effect<ReadonlyArray<AdjudicationComment>, ReviewAdjudicationFailure>;
661
+ }>;
662
+ /**
663
+ * Host-side GitHub reads used by adjudication. Domain code never reaches into
664
+ * REST directly, and deterministic tests substitute this port. Both listings
665
+ * return comments in creation order.
666
+ */
667
+ declare class ReviewAdjudicationHost extends ReviewAdjudicationHost_base {}
668
+ /** Explicit program-edge adapter for runs that intentionally perform no host reads. */
669
+ declare const noReviewAdjudicationHost: {
670
+ /** This action's own inline finding threads with their replies. */
671
+ readonly listFindingThreads: Effect.Effect<ReadonlyArray<AdjudicableThread>, ReviewAdjudicationFailure>;
672
+ /** Top-level pull-request conversation comments. */
673
+ readonly listIssueComments: Effect.Effect<ReadonlyArray<AdjudicationComment>, ReviewAdjudicationFailure>;
674
+ };
675
+ /** Layer form of {@link noReviewAdjudicationHost}. */
676
+ declare const noReviewAdjudicationHostLayer: Layer.Layer<ReviewAdjudicationHost, never, never>;
677
+ /** author_associations allowed to adjudicate; everything else is ignored. */
678
+ declare const AUTHORIZED_ADJUDICATION_ASSOCIATIONS: ReadonlySet<string>;
679
+ interface ParsedAdjudicationCommand {
680
+ readonly disposition: AdjudicationDisposition;
681
+ /** Present only for the issue-comment grammar's quoted target title. */
682
+ readonly title?: string | undefined;
683
+ readonly reason?: string | undefined;
684
+ }
685
+ /**
686
+ * Parse one inline-thread reply: `/adjudicate <disposition>(: <reason>)?`.
687
+ * The thread itself names the target identity. Returns undefined for a
688
+ * non-command body and "malformed" for a command that fails the grammar.
689
+ */
690
+ declare const parseThreadAdjudication: (body: string) => ParsedAdjudicationCommand | "malformed" | undefined;
691
+ /**
692
+ * Parse one top-level PR comment:
693
+ * `/adjudicate <disposition> "<exact title>"(: <reason>)?`. The quoted title
694
+ * is required because the conversation names no finding thread; it targets
695
+ * the title-alone identity of an unanchored concern.
696
+ */
697
+ declare const parseIssueAdjudication: (body: string) => ParsedAdjudicationCommand | "malformed" | undefined;
698
+ /** The finding identity an inline thread names, or undefined when unparsable. */
699
+ declare const threadFindingTarget: (thread: AdjudicableThread) => {
700
+ readonly path: string;
701
+ readonly startLine: number;
702
+ readonly endLine: number;
703
+ readonly title: string;
704
+ } | undefined;
705
+ interface DerivedAdjudications {
706
+ readonly adjudications: ReadonlyArray<StoredAdjudication>;
707
+ /** Commands ignored fail-closed: unauthorized authors and malformed bodies. */
708
+ readonly ignored: ReadonlyArray<string>;
709
+ /** Later-wins winners dropped oldest-first at the storage bound. */
710
+ readonly droppedOldest: number;
711
+ }
712
+ /**
713
+ * Derive the standing adjudications from the host's listings. Every command
714
+ * is screened fail-closed (authorization, grammar, a parsable target); later
715
+ * adjudications of the same identity win by comment creation order; the
716
+ * result is capped at the ReviewState bound dropping the oldest winners.
717
+ */
718
+ declare const deriveAdjudications: (input: {
719
+ readonly threads: ReadonlyArray<AdjudicableThread>;
720
+ readonly issueComments: ReadonlyArray<AdjudicationComment>;
721
+ }) => DerivedAdjudications;
722
+ /** Later-wins merge of stored prior adjudications with freshly derived ones. */
723
+ declare const mergeAdjudications: (prior: ReadonlyArray<StoredAdjudication>, fresh: ReadonlyArray<StoredAdjudication>) => ReadonlyArray<StoredAdjudication>;
724
+ /**
725
+ * Collect the standing maintainer adjudications: freshly derived through the
726
+ * host, merged later-wins over the prior state's stored set. The host is a
727
+ * visible Effect requirement; program edges that intentionally perform no
728
+ * reads provide {@link noReviewAdjudicationHost}. Fail-open — any listing
729
+ * fault keeps the complete prior set and never fails the review, because NOT
730
+ * suppressing a finding is the conservative direction.
731
+ */
732
+ declare const collectReviewAdjudications: (prior: readonly StoredAdjudication[]) => Effect.Effect<readonly StoredAdjudication[], never, ReviewAdjudicationHost>;
733
+ /** One adjudication as a bounded reviewer-prompt context line. */
734
+ declare const renderAdjudicationContextLine: (adjudication: StoredAdjudication) => string;
735
+ /** One prior-round finding as a bounded reviewer-prompt context line. */
736
+ declare const renderPriorFindingContextLine: (finding: StoredReviewFinding) => string;
737
+ /** Prior-review context threaded into fan-out discovery briefs, per path. */
738
+ interface PriorReviewContext {
739
+ /** Adjudicated identities; path-free entries apply to every unit. */
740
+ readonly adjudicated: ReadonlyArray<{
741
+ readonly path: string | undefined;
742
+ readonly line: string;
743
+ }>;
744
+ /** Prior-round findings whose paths are being re-reviewed. */
745
+ readonly priorFindings: ReadonlyArray<{
746
+ readonly path: string;
747
+ readonly line: string;
748
+ }>;
749
+ }
750
+ /** Build the fan-out prior-review context from the resolved continuity data. */
751
+ declare const buildPriorReviewContext: (adjudications: ReadonlyArray<StoredAdjudication>, priorFindingsOnScope: ReadonlyArray<StoredReviewFinding>) => PriorReviewContext;
752
+ //#endregion
383
753
  //#region src/internal/anchors.d.ts
384
754
  /** Why a finding cannot anchor to the current new-version diff, if any. */
385
755
  declare const anchorViolation: (finding: ReviewFinding, files: ReadonlyArray<ChangedFile>) => string | undefined;
@@ -389,8 +759,6 @@ declare const anchorViolation: (finding: ReviewFinding, files: ReadonlyArray<Cha
389
759
  declare const MAX_REVIEW_UNITS = 8;
390
760
  /** A unit never carries more files than this, regardless of their size. */
391
761
  declare const MAX_UNIT_FILES = 12;
392
- /** Compatibility export; complete evidence chars now own unit packing. */
393
- declare const UNIT_CHANGED_LINE_BUDGET = 800;
394
762
  /**
395
763
  * Bound the complete model-visible evidence assigned to one child. This is a
396
764
  * character bound rather than a token estimate because it is deterministic,
@@ -406,8 +774,6 @@ declare const MAX_UNIT_EVIDENCE_SHARDS = 12;
406
774
  * authority for whether input coverage is complete.
407
775
  */
408
776
  declare const MAX_REPORTED_UNASSIGNED_EVIDENCE_SHARDS: number;
409
- /** @deprecated Use `MAX_PATCH_CHARS`; this is now the per-shard bound. */
410
- declare const MAX_FILE_EVIDENCE_CHARS = 60000;
411
777
  /** The merged review never exceeds the `CodeReview` findings bound. */
412
778
  declare const MAX_MERGED_FINDINGS = 20;
413
779
  declare const ReviewUnitId: Schema.NonEmptyString;
@@ -519,32 +885,18 @@ declare const planReviewUnits: (files: ReadonlyArray<ChangedFile>, options: {
519
885
  */
520
886
  declare const rankAndDedupeFindings: (findings: ReadonlyArray<ReviewFinding>) => ReadonlyArray<ReviewFinding>;
521
887
  /**
522
- * The concern analogue of `rankAndDedupeFindings`: dedupe by exact content
523
- * keeping the most severe duplicate, rank by severity, and cap at the
888
+ * Stable identity for one concern. The paths are part of the claim: identical
889
+ * prose about two independent files must not collapse into one item.
890
+ */
891
+ declare const reviewConcernKey: (concern: ReviewConcern) => string;
892
+ /**
893
+ * The concern analogue of `rankAndDedupeFindings`: dedupe by exact scoped
894
+ * content keeping the most severe duplicate, rank by severity, and cap at the
524
895
  * `CodeReview` concerns bound.
525
896
  */
526
897
  declare const rankAndDedupeConcerns: (concerns: ReadonlyArray<ReviewConcern>) => ReadonlyArray<ReviewConcern>;
527
898
  //#endregion
528
899
  //#region src/internal/coverage.d.ts
529
- declare const FailedReviewUnit_base: Schema.Class<FailedReviewUnit, Schema.Struct<{
530
- readonly unitId: Schema.NonEmptyString;
531
- readonly errorTag: Schema.NonEmptyString;
532
- }>, {}>;
533
- declare class FailedReviewUnit extends FailedReviewUnit_base {}
534
- declare const ReviewCoverage_base: Schema.Class<ReviewCoverage, Schema.Struct<{
535
- readonly status: Schema.Literals<readonly ["complete", "incomplete"]>;
536
- readonly requiredPaths: Schema.$Array<Schema.NonEmptyString>;
537
- readonly reviewedPaths: Schema.$Array<Schema.NonEmptyString>;
538
- readonly unreviewedPaths: Schema.$Array<Schema.NonEmptyString>;
539
- readonly failedUnits: Schema.$Array<typeof FailedReviewUnit>;
540
- readonly reasons: Schema.$Array<Schema.NonEmptyString>;
541
- }>, {}>;
542
- /**
543
- * Compatibility diagnostic retained for callers that consumed the original
544
- * `coverage` field. New UI and state decisions use ReviewInputCoverage and
545
- * ReviewAssurance directly.
546
- */
547
- declare class ReviewCoverage extends ReviewCoverage_base {}
548
900
  declare const ReviewInputCoverage_base: Schema.Class<ReviewInputCoverage, Schema.Struct<{
549
901
  readonly status: Schema.Literals<readonly ["complete", "incomplete"]>;
550
902
  readonly requiredPaths: Schema.$Array<Schema.NonEmptyString>;
@@ -596,6 +948,26 @@ declare const ReviewAssurance_base: Schema.Class<ReviewAssurance, Schema.Struct<
596
948
  declare class ReviewAssurance extends ReviewAssurance_base {}
597
949
  /** Render a bounded, deterministic "label (n): a, b, … (+k more)" reason line. */
598
950
  declare const boundedListReason: (label: string, values: Iterable<string>) => string;
951
+ interface CarriedScope {
952
+ /** Carried paths a retry can actually settle (failed passes, overflow). */
953
+ readonly retryablePaths: ReadonlyArray<string>;
954
+ /** Carried paths no retry can settle (binaries, oversized files). */
955
+ readonly undiffablePaths: ReadonlyArray<string>;
956
+ /** Whether any incompleteness beyond the undiffable files exists. */
957
+ readonly retryableGap: boolean;
958
+ }
959
+ /**
960
+ * Split carried scope into paths a retry can settle and paths it never can.
961
+ * Undiffable files are a property of the pull request, not a transient
962
+ * reviewer-side failure: gate reasons and rendered callouts must never promise
963
+ * they are "retried automatically" — the honest instruction is to remove them
964
+ * from the pull request or exclude them with ignore globs.
965
+ */
966
+ declare const splitCarriedScope: (input: {
967
+ readonly inputCoverage?: ReviewInputCoverage | undefined;
968
+ readonly assurance?: ReviewAssurance | undefined;
969
+ readonly unreviewedPaths?: ReadonlyArray<string> | undefined;
970
+ }) => CarriedScope;
599
971
  /** The flat reviewer's honest constant assurance: one pass, no verifier. */
600
972
  declare const flatAssurance: () => ReviewAssurance;
601
973
  interface FlatReviewAssessment {
@@ -629,152 +1001,6 @@ declare const fanOutInputCoverage: (input: {
629
1001
  readonly anchorFiles: ReadonlyArray<ChangedFile>;
630
1002
  readonly totalAnchorFiles: number;
631
1003
  }) => ReviewInputCoverage;
632
- /** Compatibility aggregate over the two precise claims. */
633
- declare const compatibilityCoverage: (inputCoverage: ReviewInputCoverage, assurance: ReviewAssurance) => ReviewCoverage;
634
- //#endregion
635
- //#region src/internal/review-state.d.ts
636
- declare const ReviewMode: Schema.Literals<readonly ["incremental", "final"]>;
637
- type ReviewMode = typeof ReviewMode.Type;
638
- declare const ReviewScopeMode: Schema.Literals<readonly ["incremental", "full"]>;
639
- type ReviewScopeMode = typeof ReviewScopeMode.Type;
640
- declare const GitCommitSha: Schema.NonEmptyString;
641
- declare const StoredReviewFinding_base: Schema.Class<StoredReviewFinding, Schema.Struct<{
642
- readonly path: Schema.NonEmptyString;
643
- readonly startLine: Schema.Int;
644
- readonly endLine: Schema.Int;
645
- readonly severity: Schema.Literals<readonly ["blocking", "important", "nit"]>;
646
- readonly title: Schema.NonEmptyString;
647
- readonly body: Schema.NonEmptyString;
648
- }>, {}>;
649
- /** A compact unresolved finding suitable for the bounded review-body marker. */
650
- declare class StoredReviewFinding extends StoredReviewFinding_base {}
651
- declare const StoredReviewConcern_base: Schema.Class<StoredReviewConcern, Schema.Struct<{
652
- readonly severity: Schema.Literals<readonly ["blocking", "important", "nit"]>;
653
- readonly title: Schema.NonEmptyString;
654
- readonly body: Schema.NonEmptyString;
655
- }>, {}>;
656
- /** A compact unresolved non-anchored concern carried until a final audit. */
657
- declare class StoredReviewConcern extends StoredReviewConcern_base {}
658
- /** The carried-scope bound; a run that cannot fit its leftovers publishes no state. */
659
- declare const MAX_STORED_UNREVIEWED_PATHS = 100;
660
- declare const ReviewState_base: Schema.Class<ReviewState, Schema.Struct<{
661
- readonly version: Schema.Literal<2>;
662
- readonly repository: Schema.NonEmptyString;
663
- readonly pullRequestNumber: Schema.Int;
664
- readonly baseRef: Schema.NonEmptyString;
665
- readonly baseSha: Schema.NonEmptyString;
666
- readonly headRef: Schema.NonEmptyString;
667
- readonly reviewedHeadSha: Schema.NonEmptyString;
668
- readonly profileFingerprint: Schema.String;
669
- readonly acceptedScopeFingerprint: Schema.String;
670
- readonly reviewedPathCount: Schema.Int;
671
- readonly unresolvedFindings: Schema.$Array<typeof StoredReviewFinding>;
672
- readonly unresolvedConcerns: Schema.$Array<typeof StoredReviewConcern>;
673
- /** Retryable review gaps carried into the next incremental run's scope. */
674
- readonly unreviewedPaths: Schema.$Array<Schema.NonEmptyString>;
675
- /**
676
- * True only when the producing run had complete input coverage, no
677
- * unsettled pass, and nothing carried. Skip-unchanged authority: an
678
- * unchanged patch may skip re-review only over a settled state.
679
- */
680
- readonly settled: Schema.Boolean;
681
- readonly lastReviewMode: Schema.Literals<readonly ["incremental", "full"]>;
682
- }>, {}>;
683
- /**
684
- * Versioned state embedded after EVERY completed run that can be signed. The
685
- * head plus full-scope fingerprint forms an incremental baseline; an absent
686
- * unresolved item never means the path is defect-free. `unreviewedPaths`
687
- * carries retryable review gaps (failed passes) forward so the next
688
- * incremental run re-reviews exactly them plus the new delta — the baseline
689
- * advances monotonically instead of freezing on one flaky pass and reopening
690
- * the whole post-baseline scope. The `acceptedScopeFingerprint` name is
691
- * retained for wire compatibility. Storing hundreds of path strings
692
- * separately would not fit GitHub's bounded review body in the worst case.
693
- */
694
- declare class ReviewState extends ReviewState_base {}
695
- declare const toStoredFinding: (finding: ReviewFinding) => StoredReviewFinding;
696
- declare const fromStoredFinding: (finding: StoredReviewFinding) => ReviewFinding;
697
- declare const toStoredConcern: (concern: ReviewConcern) => StoredReviewConcern;
698
- declare const fromStoredConcern: (concern: StoredReviewConcern) => ReviewConcern;
699
- declare const MAX_REVIEW_STATE_MARKER_CHARS = 24000;
700
- declare const ReviewStateMarker: Schema.brand<Schema.NonEmptyString, "@effect-agent/pr-review/ReviewStateMarker">;
701
- type ReviewStateMarker = typeof ReviewStateMarker.Type;
702
- declare const ReviewStateAuthenticationFailure_base: Schema.Class<ReviewStateAuthenticationFailure, Schema.TaggedStruct<"ReviewStateAuthenticationFailure", {
703
- readonly operation: Schema.Literals<readonly ["sign", "verify"]>;
704
- readonly reason: Schema.NonEmptyString;
705
- }>, import("effect/Cause").YieldableError>;
706
- declare class ReviewStateAuthenticationFailure extends ReviewStateAuthenticationFailure_base {}
707
- declare const ReviewStateMarkerTooLarge_base: Schema.Class<ReviewStateMarkerTooLarge, Schema.TaggedStruct<"ReviewStateMarkerTooLarge", {
708
- readonly observedChars: Schema.Int;
709
- readonly maximumChars: Schema.Int;
710
- }>, import("effect/Cause").YieldableError>;
711
- declare class ReviewStateMarkerTooLarge extends ReviewStateMarkerTooLarge_base {}
712
- declare const ReviewStateAuthenticator_base: Context.ServiceClass<ReviewStateAuthenticator, "@effect-agent/pr-review/ReviewStateAuthenticator", {
713
- readonly status: "available" | "unavailable";
714
- readonly unavailableReason: string | undefined;
715
- readonly render: (state: ReviewState) => Effect.Effect<ReviewStateMarker, ReviewStateAuthenticationFailure | ReviewStateMarkerTooLarge>;
716
- readonly extract: (body: string) => Effect.Effect<Option.Option<ReviewState>, ReviewStateAuthenticationFailure>;
717
- }>;
718
- declare class ReviewStateAuthenticator extends ReviewStateAuthenticator_base {}
719
- /** Validated WebCrypto adapter selected at the Action composition root. */
720
- declare const webCryptoReviewStateAuthenticatorLayer: (secret: Redacted.Redacted<string>) => Layer.Layer<ReviewStateAuthenticator>;
721
- /** Explicit no-state implementation for hosts without a stable authentication secret. */
722
- declare const unavailableReviewStateAuthenticatorLayer: (reason: string) => Layer.Layer<ReviewStateAuthenticator>;
723
- declare const ReviewHeadComparison_base: Schema.Class<ReviewHeadComparison, Schema.Struct<{
724
- readonly status: Schema.Literals<readonly ["ahead", "behind", "diverged", "identical"]>;
725
- readonly baseSha: Schema.NonEmptyString;
726
- readonly headSha: Schema.NonEmptyString;
727
- readonly mergeBaseSha: Schema.NonEmptyString;
728
- readonly files: Schema.$Array<typeof ChangedFile>;
729
- /** GitHub caps compare-file payloads at 300; equality is conservatively truncated. */
730
- readonly truncated: Schema.Boolean;
731
- }>, {}>;
732
- /** The bounded result of GitHub's previous-head...current-head comparison. */
733
- declare class ReviewHeadComparison extends ReviewHeadComparison_base {}
734
- /** Internal review selection applied as a decorator over the full PR source. */
735
- interface ReviewSelection {
736
- readonly mode: ReviewScopeMode;
737
- readonly reason: string;
738
- readonly files: ReadonlyArray<ChangedFile>;
739
- /** Paths whose changes invalidate prior findings, including paths reverted out of the PR. */
740
- readonly affectedPaths: ReadonlyArray<string>;
741
- readonly totalFiles: number;
742
- readonly baselineSha: string | undefined;
743
- readonly priorState: ReviewState | undefined;
744
- readonly profileFingerprint: string;
745
- /** Action-owned authentication capability, constructed at the composition root. */
746
- readonly stateAuthenticator?: ReviewStateAuthenticator["Service"] | undefined;
747
- }
748
- /**
749
- * Validate that persisted state belongs to this exact PR/base lineage and the
750
- * same review profile. A mismatch is a full-review reason, never an error that
751
- * silently suppresses review work.
752
- */
753
- declare const validateReviewState: (state: ReviewState, current: PullRequestMetadata, profileFingerprint: string) => string | undefined;
754
- /** Pure, deterministic range selection with conservative full-review fallbacks. */
755
- declare const selectReviewRange: (input: {
756
- readonly requestedMode: ReviewMode;
757
- readonly current: PullRequestMetadata;
758
- readonly fullFiles: ReadonlyArray<ChangedFile>;
759
- readonly profileFingerprint: string;
760
- readonly priorState: ReviewState | undefined;
761
- readonly comparison: ReviewHeadComparison | undefined;
762
- readonly baseComparison?: ReviewHeadComparison | undefined;
763
- readonly lookupFailure?: string | undefined;
764
- }) => ReviewSelection;
765
- declare const ReviewExecutionContext_base: Context.ServiceClass<ReviewExecutionContext, "@effect-agent/pr-review/ReviewExecutionContext", ReviewSelection>;
766
- /** Per-run context consumed by orchestration and publication, not by the model. */
767
- declare class ReviewExecutionContext extends ReviewExecutionContext_base {}
768
- /**
769
- * Decorate the full source with the selected review range. Full anchor files
770
- * remain available to host-side publication validation; model tools see only
771
- * the selected delta and may read head context only for that delta's paths.
772
- */
773
- declare const selectedPullRequestSourceLayer: (selection: ReviewSelection) => Layer.Layer<PullRequestSource, never, PullRequestSource>;
774
- /** Profile fingerprints are SHA-256 over configuration-only signatures. */
775
- declare const computeProfileFingerprint: (signature: string) => Effect.Effect<string>;
776
- /** Build the full-surface mission used only to resolve profile guidance. */
777
- declare const buildProfileMission: (metadata: PullRequestMetadata, files: ReadonlyArray<ChangedFile>) => ReviewMission;
778
1004
  //#endregion
779
1005
  //#region src/internal/render.d.ts
780
1006
  declare const ReviewEvent: Schema.Literals<readonly ["COMMENT", "APPROVE", "REQUEST_CHANGES"]>;
@@ -872,6 +1098,12 @@ declare const planPublication: (review: CodeReview, files: ReadonlyArray<Changed
872
1098
  /** Unchanged unresolved items carried from the prior reviewed baseline. */
873
1099
  readonly carriedFindings?: ReadonlyArray<ReviewFinding> | undefined;
874
1100
  readonly carriedConcerns?: ReadonlyArray<ReviewConcern> | undefined;
1101
+ /**
1102
+ * Standing maintainer adjudications. The caller excludes their identities
1103
+ * from the review, the carried items, and every severity count; this
1104
+ * planner only renders them as the collapsed adjudicated section.
1105
+ */
1106
+ readonly adjudications?: ReadonlyArray<StoredAdjudication> | undefined;
875
1107
  /** Selected review scope, made visible whenever orchestration chose it. */
876
1108
  readonly reviewMode?: ReviewScopeMode | undefined;
877
1109
  readonly reviewReason?: string | undefined;
@@ -942,6 +1174,11 @@ interface ReviewRetirementDecision {
942
1174
  readonly resolvedFindings: ReadonlyArray<StoredReviewFinding>;
943
1175
  readonly priorFindingCount: number;
944
1176
  }
1177
+ /**
1178
+ * The first line of every inline finding comment this package posts. Shared
1179
+ * with adjudication so both parse the identical title shape.
1180
+ */
1181
+ declare const INLINE_FINDING_TITLE_PATTERN: RegExp;
945
1182
  /** The host-authored metadata marker is the authority gate for any edit. */
946
1183
  declare const hasReviewMetadataMarker: (body: string) => boolean;
947
1184
  /** Compute one prior review's resolved subset and deterministic retired body. */
@@ -1020,6 +1257,14 @@ declare const gitHubPullRequestSourceLayer: Layer.Layer<PullRequestSource, never
1020
1257
  declare const gitHubReviewPublisherLayer: Layer.Layer<ReviewPublisher, never, GitHubReviewTarget | HttpClient.HttpClient>;
1021
1258
  /** GitHub-backed host operations for cosmetic retirement after publication. */
1022
1259
  declare const gitHubReviewRetirementHostLayer: Layer.Layer<ReviewRetirementHost, never, GitHubReviewTarget | HttpClient.HttpClient>;
1260
+ /**
1261
+ * GitHub-backed host reads for maintainer adjudication, installed by
1262
+ * `gitHubReviewLayers` in `github-env.ts` at the public composition root: this action's own
1263
+ * inline finding threads (roots authored by the configured review author)
1264
+ * with their replies, and the pull request's top-level conversation comments.
1265
+ * Both listings are creation-ordered.
1266
+ */
1267
+ declare const gitHubReviewAdjudicationHostLayer: Layer.Layer<ReviewAdjudicationHost, never, GitHubReviewTarget | HttpClient.HttpClient>;
1023
1268
  declare const PriorReviewLookupFailure_base: Schema.Class<PriorReviewLookupFailure, Schema.TaggedStruct<"PriorReviewLookupFailure", {
1024
1269
  readonly reason: Schema.String;
1025
1270
  }>, import("effect/Cause").YieldableError>;
@@ -1034,6 +1279,12 @@ declare const PriorReviews_base: Context.ServiceClass<PriorReviews, "@effect-age
1034
1279
  readonly latestState: Effect.Effect<Option.Option<ReviewState>, PriorReviewLookupFailure, ReviewStateAuthenticator>;
1035
1280
  /** Compare a previously reviewed head to the live current head. */
1036
1281
  readonly compareHeads: (baseSha: string, headSha: string) => Effect.Effect<ReviewHeadComparison, PriorReviewLookupFailure>;
1282
+ /**
1283
+ * Two-dot tree comparison (`base..head`). Used when the reviewed head is
1284
+ * not a git ancestor so a rebase or amend can still name the paths whose
1285
+ * blob contents actually changed.
1286
+ */
1287
+ readonly compareTrees: (baseSha: string, headSha: string) => Effect.Effect<ReviewHeadComparison, PriorReviewLookupFailure>;
1037
1288
  }>;
1038
1289
  /**
1039
1290
  * Read-only view of this package's previously posted reviews on the target
@@ -1124,8 +1375,8 @@ declare const DiscoveredConcern_base: Schema.Class<DiscoveredConcern, Schema.Str
1124
1375
  /**
1125
1376
  * Concern candidates need explicit paths internally to bind the claim to
1126
1377
  * scheduled evidence. The verifier receives the complete bounded unit so it
1127
- * can use neighboring evidence to falsify the claim. The public ReviewConcern
1128
- * remains path-free after the host confirms and projects it.
1378
+ * can use neighboring evidence to falsify the claim. The host copies these
1379
+ * validated paths onto a confirmed public concern for incremental continuity.
1129
1380
  */
1130
1381
  declare class DiscoveredConcern extends DiscoveredConcern_base {}
1131
1382
  declare const FileReviewEvidence_base: Schema.Class<FileReviewEvidence, Schema.Struct<{
@@ -1150,6 +1401,10 @@ declare const FileReviewBrief_base: Schema.Class<FileReviewBrief, Schema.Struct<
1150
1401
  /** Empty for discovery; the exact discovered set for unit verification. */
1151
1402
  readonly candidates: Schema.$Array<Schema.Union<readonly [typeof FindingCandidate, typeof ConcernCandidate]>>;
1152
1403
  readonly evidence: Schema.$Array<typeof FileReviewEvidence>;
1404
+ /** Maintainer-adjudicated identities on this unit; do not re-raise. */
1405
+ readonly adjudicatedContext: Schema.optionalKey<Schema.$Array<Schema.String>>;
1406
+ /** Prior-round findings on this unit's re-reviewed paths. */
1407
+ readonly priorFindingContext: Schema.optionalKey<Schema.$Array<Schema.String>>;
1153
1408
  }>, {}>;
1154
1409
  /** Host-prepared child input with complete bounded diff/content evidence. */
1155
1410
  declare class FileReviewBrief extends FileReviewBrief_base {}
@@ -1194,6 +1449,11 @@ interface FanOutPipelineOutcome {
1194
1449
  readonly plan: ReviewUnitPlan;
1195
1450
  /** Paths of units with an unsettled pass — retryable scope for the next run. */
1196
1451
  readonly unreviewedPaths: ReadonlyArray<string>;
1452
+ /** Failed stages paired with the leftover paths they still own. */
1453
+ readonly unreviewedPasses: ReadonlyArray<{
1454
+ readonly stage: FailedReviewPass["stage"];
1455
+ readonly paths: ReadonlyArray<string>;
1456
+ }>;
1197
1457
  /** Total settled child turns across every scheduled pass. */
1198
1458
  readonly turns: number;
1199
1459
  }
@@ -1204,6 +1464,20 @@ interface FanOutPipelineInput {
1204
1464
  readonly maxFindings?: number | undefined;
1205
1465
  /** Shared run budget observed by every child pass. */
1206
1466
  readonly budget?: RunBudgetHook<BudgetExceeded | BudgetAdapterError> | undefined;
1467
+ /**
1468
+ * Unchanged leftover paths from a prior failed pass. Those units retry only
1469
+ * the recorded stages — no second general discovery on files nobody touched.
1470
+ */
1471
+ readonly retry?: {
1472
+ readonly paths: ReadonlyArray<string>;
1473
+ readonly stages: ReadonlyArray<FailedReviewPass["stage"]>;
1474
+ } | undefined;
1475
+ /**
1476
+ * Adjudicated identities and prior-round findings injected as discovery
1477
+ * context on the units whose paths they touch. Context only — they never
1478
+ * enter candidates or publication.
1479
+ */
1480
+ readonly priorContext?: PriorReviewContext | undefined;
1207
1481
  }
1208
1482
  /**
1209
1483
  * Run the complete host-scheduled fan-out pipeline over one selected
@@ -1216,8 +1490,12 @@ declare const runFanOutReview: <Provider, ModelProvides, ModelRequires>(binding:
1216
1490
  assurance: ReviewAssurance;
1217
1491
  plan: ReviewUnitPlan;
1218
1492
  unreviewedPaths: string[];
1493
+ unreviewedPasses: {
1494
+ stage: "discovery" | "specialist" | "verification";
1495
+ paths: readonly string[];
1496
+ }[];
1219
1497
  turns: number;
1220
1498
  }, never, import("effect-agent").IdGenerator | Exclude<Exclude<ModelRequires, import("effect-agent").EngineProvidedToolServices>, import("effect/Scope").Scope>>;
1221
1499
  //#endregion
1222
- export { decideReviewRetirement as $, readFileHandler as $n, ReviewDiscoveryPass as $t, makeFileReviewerInstructions as A, MAX_PATCH_CHARS as An, selectedPullRequestSourceLayer as At, fingerprintUnchanged as B, ReviewInstructionOptions as Bn, ReviewCoverage as Bt, ReviewWorkPerspective as C, FileSliceQuery as Cn, StoredReviewConcern as Ct, defaultFileReviewerPolicy as D, ListChangedFilesQuery as Dn, fromStoredConcern as Dt, confirmedFindingForPublication as E, ListChangedFiles as En, computeProfileFingerprint as Et, GitHubReviewTarget as F, ReadFile as Fn, webCryptoReviewStateAuthenticatorLayer as Ft, parseGitHubSubmittedAt as G, WalkthroughEntry as Gn, fanOutInputCoverage as Gt, gitHubPullRequestSourceLayer as H, ReviewToolkit as Hn, assessFlatReview as Ht, PriorReviewLookupFailure as I, ReadFileDiff as In, FailedReviewPass as It, ReviewRetirementDecision as J, fileDiffView as Jn, MAX_MERGED_FINDINGS as Jt, RetirableReview as K, clampMaxFindings as Kn, flatAssurance as Kt, PriorReviews as L, ReviewConcern as Ln, FailedReviewUnit as Lt, runFanOutReview as M, MAX_WALKTHROUGH_SUMMARY_CHARS as Mn, toStoredFinding as Mt, DEFAULT_GITHUB_REVIEW_AUTHOR_LOGIN as N, PullRequestReviewer as Nn, unavailableReviewStateAuthenticatorLayer as Nt, fileReviewerInstructions as O, MAX_CONCERNS as On, fromStoredFinding as Ot, GitHubApiFailure as P, REVIEW_TOOL_RESULT_MAX_BYTES as Pn, validateReviewState as Pt, ReviewRetirementReport as Q, readFileDiffHandler as Qn, MAX_UNIT_FILES as Qt, PublishedReview as R, ReviewFinding as Rn, FlatReviewAssessment as Rt, ReviewPassMisbehaved as S, FileSlice as Sn, ReviewStateMarkerTooLarge as St, assessmentSettlesSuggestionExactly as T, FindingSeverity as Tn, buildProfileMission as Tt, gitHubReviewPublisherLayer as U, ReviewToolkitLayer as Un, boundedListReason as Ut, gitHubPriorReviewsLayer as V, ReviewMission as Vn, ReviewInputCoverage as Vt, gitHubReviewRetirementHostLayer as W, ReviewVerdict as Wn, compatibilityCoverage as Wt, ReviewRetirementHost as X, listChangedFilesHandler as Xn, MAX_REVIEW_UNITS as Xt, ReviewRetirementFailure as Y, fileReviewEvidenceChunks as Yn, MAX_REPORTED_UNASSIGNED_EVIDENCE_SHARDS as Yt, ReviewRetirementInput as Z, makeReviewInstructions as Zn, MAX_UNIT_EVIDENCE_SHARDS as Zt, MAX_REVIEW_CHILDREN as _, ChangedFilesView as _n, isReviewableFile as _r, ReviewSelection as _t, FanOutPipelineInput as a, ReviewUnit as an, PullRequestSource as ar, ReviewPublicationPlan as at, ReviewCandidate as b, FileDiffView as bn, ReviewStateAuthenticator as bt, FileReviewEvidence as c, UNIT_CHANGED_LINE_BUDGET as cn, normalizeRepoRelativePath as cr, planWalkthrough as ct, FileReviewer as d, findingAnchorInUnitEvidence as dn, ChangedPath as dr, MAX_REVIEW_STATE_MARKER_CHARS as dt, ReviewDiscoveryPerspective as en, resolveGuidance as er, hasReviewMetadataMarker as et, FileReviewerBinding as f, planReviewUnits as fn, MAX_REVIEW_CONTENT_CHARS as fr, MAX_STORED_UNREVIEWED_PATHS as ft, MAX_FILE_REVIEW_TOOL_CALLS as g, ChangedFileSummary as gn, hasReviewableContent as gr, ReviewScopeMode as gt, MAX_CHILD_FINDINGS as h, anchorViolation as hn, commentableLines as hr, ReviewMode as ht, FanOutInstructionOptions as i, ReviewRiskCategory as in, PullRequestMetadata as ir, ReviewEvent as it, reviewCandidateSubjectKey as j, MAX_WALKTHROUGH_ENTRIES as jn, toStoredConcern as jt, makeFileReviewerDefinition as k, MAX_FINDINGS as kn, selectReviewRange as kt, FileReviewReport as l, UNIT_EVIDENCE_CHAR_BUDGET as ln, ChangedFile as lr, renderAgentPrompt as lt, MAX_CHILD_CONCERNS as m, rankAndDedupeFindings as mn, annotatePatch as mr, ReviewHeadComparison as mt, ConcernCandidate as n, ReviewEvidenceShardId as nn, MAX_CHANGED_FILES as nr, AGENT_PROMPT_PREAMBLE as nt, FanOutPipelineOutcome as o, ReviewUnitId as on, PullRequestSourceFailure as or, estimateReviewEffort as ot, FindingCandidate as p, rankAndDedupeConcerns as pn, PatchLine as pr, ReviewExecutionContext as pt, RetirableReviewComment as q, defaultReviewPolicy as qn, MAX_FILE_EVIDENCE_CHARS as qt, DiscoveredConcern as r, ReviewPassId as rn, MAX_FILE_CHARS as rr, ReviewCommentDraft as rt, FileReviewBrief as s, ReviewUnitPlan as sn, ReviewInputViolation as sr, planPublication as st, CandidateAssessment as t, ReviewEvidenceShard as tn, reviewInstructions as tr, retireStaleReviews as tt, FileReviewToolkit as u, classifyReviewRisks as un, ChangedFileStatus as ur, GitCommitSha as ut, MAX_UNIT_CANDIDATES as v, CodeReview as vn, parsePatch as vr, ReviewState as vt, ReviewWorkPhase as w, FindingCategory as wn, StoredReviewFinding as wt, ReviewCandidateId as x, FileReviewEvidenceChunk as xn, ReviewStateMarker as xt, REVIEW_UNIT_CONCURRENCY as y, FileDiffQuery as yn, renderReviewContent as yr, ReviewStateAuthenticationFailure as yt, ReviewPublisher as z, ReviewGuidance as zn, ReviewAssurance as zt };
1223
- //# sourceMappingURL=fan-out-BJBTAYuh.d.mts.map
1500
+ export { ReviewRetirementInput as $, FileSlice as $n, buildPriorReviewContext as $t, makeFileReviewerInstructions as A, UnreviewedStage as An, readFileHandler as Ar, ReviewEvidenceShardId as At, fingerprintUnchanged as B, selectReviewRange as Bn, ChangedFile as Br, rankAndDedupeConcerns as Bt, ReviewWorkPerspective as C, ReviewStateAuthenticator as Cn, clampMaxFindings as Cr, MAX_REPORTED_UNASSIGNED_EVIDENCE_SHARDS as Ct, defaultFileReviewerPolicy as D, StoredReviewConcern as Dn, listChangedFilesHandler as Dr, ReviewDiscoveryPass as Dt, confirmedFindingForPublication as E, StoredAdjudication as En, fileReviewEvidenceChunks as Er, MAX_UNIT_FILES as Et, GitHubReviewTarget as F, fromStoredConcern as Fn, PullRequestMetadata as Fr, ReviewUnitPlan as Ft, gitHubReviewRetirementHostLayer as G, validateReviewState as Gn, annotatePatch as Gr, AdjudicableThread as Gt, gitHubPullRequestSourceLayer as H, toStoredConcern as Hn, ChangedPath as Hr, reviewConcernKey as Ht, PriorReviewLookupFailure as I, fromStoredFinding as In, PullRequestSource as Ir, UNIT_EVIDENCE_CHAR_BUDGET as It, RetirableReview as J, ChangedFilesView as Jn, isReviewableFile as Jr, MAX_THREAD_ADJUDICATION_COMMANDS as Jt, parseGitHubSubmittedAt as K, webCryptoReviewStateAuthenticatorLayer as Kn, commentableLines as Kr, AdjudicationComment as Kt, PriorReviews as L, fullReviewExecutionContextLayer as Ln, PullRequestSourceFailure as Lr, classifyReviewRisks as Lt, runFanOutReview as M, buildProfileMission as Mn, reviewInstructions as Mr, ReviewRiskCategory as Mt, DEFAULT_GITHUB_REVIEW_AUTHOR_LOGIN as N, concernIdentity as Nn, MAX_CHANGED_FILES as Nr, ReviewUnit as Nt, fileReviewerInstructions as O, StoredReviewFinding as On, makeReviewInstructions as Or, ReviewDiscoveryPerspective as Ot, GitHubApiFailure as P, findingIdentity as Pn, MAX_FILE_CHARS as Pr, ReviewUnitId as Pt, ReviewRetirementHost as Q, FileReviewEvidenceChunk as Qn, ReviewAdjudicationHost as Qt, PublishedReview as R, fullReviewSelection as Rn, ReviewInputViolation as Rr, findingAnchorInUnitEvidence as Rt, ReviewPassMisbehaved as S, ReviewStateAuthenticationFailure as Sn, WalkthroughEntry as Sr, MAX_MERGED_FINDINGS as St, assessmentSettlesSuggestionExactly as T, ReviewStateMarkerTooLarge as Tn, fileDiffView as Tr, MAX_UNIT_EVIDENCE_SHARDS as Tt, gitHubReviewAdjudicationHostLayer as U, toStoredFinding as Un, MAX_REVIEW_CONTENT_CHARS as Ur, anchorViolation as Ut, gitHubPriorReviewsLayer as V, selectedPullRequestSourceLayer as Vn, ChangedFileStatus as Vr, rankAndDedupeFindings as Vt, gitHubReviewPublisherLayer as W, unavailableReviewStateAuthenticatorLayer as Wn, PatchLine as Wr, AUTHORIZED_ADJUDICATION_ASSOCIATIONS as Wt, ReviewRetirementDecision as X, FileDiffQuery as Xn, renderReviewContent as Xr, PriorReviewContext as Xt, RetirableReviewComment as Y, CodeReview as Yn, parsePatch as Yr, ParsedAdjudicationCommand as Yt, ReviewRetirementFailure as Z, FileDiffView as Zn, ReviewAdjudicationFailure as Zt, MAX_REVIEW_CHILDREN as _, ReviewHeadComparison as _n, ReviewInstructionOptions as _r, assessFlatReview as _t, FanOutPipelineInput as a, parseIssueAdjudication as an, MAX_CONCERNS as ar, ReviewCommentDraft as at, ReviewCandidate as b, ReviewSelection as bn, ReviewToolkitLayer as br, flatAssurance as bt, FileReviewEvidence as c, renderPriorFindingContextLine as cn, MAX_WALKTHROUGH_ENTRIES as cr, estimateReviewEffort as ct, FileReviewer as d, GitCommitSha as dn, REVIEW_TOOL_RESULT_MAX_BYTES as dr, renderAgentPrompt as dt, collectReviewAdjudications as en, FileSliceQuery as er, ReviewRetirementReport as et, FileReviewerBinding as f, MAX_REVIEW_STATE_MARKER_CHARS as fn, ReadFile as fr, CarriedScope as ft, MAX_FILE_REVIEW_TOOL_CALLS as g, ReviewExecutionContext as gn, ReviewGuidance as gr, ReviewInputCoverage as gt, MAX_CHILD_FINDINGS as h, MAX_STORED_UNREVIEWED_PATHS as hn, ReviewFinding as hr, ReviewAssurance as ht, FanOutInstructionOptions as i, noReviewAdjudicationHostLayer as in, ListChangedFilesQuery as ir, AGENT_PROMPT_PREAMBLE as it, reviewCandidateSubjectKey as j, adjudicationIdentity as jn, resolveGuidance as jr, ReviewPassId as jt, makeFileReviewerDefinition as k, StoredUnreviewedPass as kn, readFileDiffHandler as kr, ReviewEvidenceShard as kt, FileReviewReport as l, threadFindingTarget as ln, MAX_WALKTHROUGH_SUMMARY_CHARS as lr, planPublication as lt, MAX_CHILD_CONCERNS as m, MAX_STORED_UNREVIEWED_PASSES as mn, ReviewConcern as mr, FlatReviewAssessment as mt, ConcernCandidate as n, mergeAdjudications as nn, FindingSeverity as nr, hasReviewMetadataMarker as nt, FanOutPipelineOutcome as o, parseThreadAdjudication as on, MAX_FINDINGS as or, ReviewEvent as ot, FindingCandidate as p, MAX_STORED_ADJUDICATIONS as pn, ReadFileDiff as pr, FailedReviewPass as pt, INLINE_FINDING_TITLE_PATTERN as q, ChangedFileSummary as qn, hasReviewableContent as qr, DerivedAdjudications as qt, DiscoveredConcern as r, noReviewAdjudicationHost as rn, ListChangedFiles as rr, retireStaleReviews as rt, FileReviewBrief as s, renderAdjudicationContextLine as sn, MAX_PATCH_CHARS as sr, ReviewPublicationPlan as st, CandidateAssessment as t, deriveAdjudications as tn, FindingCategory as tr, decideReviewRetirement as tt, FileReviewToolkit as u, AdjudicationDisposition as un, PullRequestReviewer as ur, planWalkthrough as ut, MAX_UNIT_CANDIDATES as v, ReviewMode as vn, ReviewMission as vr, boundedListReason as vt, ReviewWorkPhase as w, ReviewStateMarker as wn, defaultReviewPolicy as wr, MAX_REVIEW_UNITS as wt, ReviewCandidateId as x, ReviewState as xn, ReviewVerdict as xr, splitCarriedScope as xt, REVIEW_UNIT_CONCURRENCY as y, ReviewScopeMode as yn, ReviewToolkit as yr, fanOutInputCoverage as yt, ReviewPublisher as z, isLineageAncestor as zn, normalizeRepoRelativePath as zr, planReviewUnits as zt };
1501
+ //# sourceMappingURL=fan-out-CMEsbFLk.d.mts.map