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

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.
@@ -1,5 +1,5 @@
1
1
  import { Context, DateTime, Effect, Layer, Option, Redacted, Schema } from "effect";
2
- import { AgentPolicy, RunEvent, RuntimeBinding, SubagentPolicy } from "effect-agent";
2
+ import { AgentPolicy, BudgetAdapterError, BudgetExceeded, RunBudgetHook, RunEvent, RuntimeBinding } from "effect-agent";
3
3
  import { Tool, Toolkit } from "effect/unstable/ai";
4
4
  import { HttpClient } from "effect/unstable/http";
5
5
  //#region src/internal/diff.d.ts
@@ -384,9 +384,148 @@ declare const PullRequestReviewer: import("effect-agent").Definition<typeof Revi
384
384
  /** Why a finding cannot anchor to the current new-version diff, if any. */
385
385
  declare const anchorViolation: (finding: ReviewFinding, files: ReadonlyArray<ChangedFile>) => string | undefined;
386
386
  //#endregion
387
+ //#region src/internal/review-units.d.ts
388
+ /** The delegation fan-out bound: one parent Run spawns at most this many children. */
389
+ declare const MAX_REVIEW_UNITS = 8;
390
+ /** A unit never carries more files than this, regardless of their size. */
391
+ 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
+ /**
395
+ * Bound the complete model-visible evidence assigned to one child. This is a
396
+ * character bound rather than a token estimate because it is deterministic,
397
+ * provider-independent, and enforced before any model call.
398
+ */
399
+ declare const UNIT_EVIDENCE_CHAR_BUDGET = 240000;
400
+ /** Maximum complete evidence shards placed in one child brief. */
401
+ declare const MAX_UNIT_EVIDENCE_SHARDS = 12;
402
+ /**
403
+ * Keep overflow diagnostics bounded to one plan's total assignment capacity.
404
+ * The plan separately records the exact overflow count and every affected
405
+ * path, so identifiers are a deterministic diagnostic sample rather than the
406
+ * authority for whether input coverage is complete.
407
+ */
408
+ 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
+ /** The merged review never exceeds the `CodeReview` findings bound. */
412
+ declare const MAX_MERGED_FINDINGS = 20;
413
+ declare const ReviewUnitId: Schema.NonEmptyString;
414
+ /** High-risk surfaces that receive an explicit specialist focus label. */
415
+ declare const ReviewRiskCategory: Schema.Literals<readonly ["authentication-authorization", "security-boundary", "persistence-durability", "concurrency", "credential-handling", "external-side-effects"]>;
416
+ type ReviewRiskCategory = typeof ReviewRiskCategory.Type;
417
+ declare const ReviewDiscoveryPerspective: Schema.Literals<readonly ["general", "risk-specialist"]>;
418
+ type ReviewDiscoveryPerspective = typeof ReviewDiscoveryPerspective.Type;
419
+ declare const ReviewPassId: Schema.NonEmptyString;
420
+ declare const ReviewEvidenceShardId: Schema.NonEmptyString;
421
+ declare const ReviewEvidenceShard_base: Schema.Class<ReviewEvidenceShard, Schema.Struct<{
422
+ readonly shardId: Schema.NonEmptyString;
423
+ readonly path: Schema.NonEmptyString;
424
+ readonly ordinal: Schema.Int;
425
+ readonly total: Schema.Int;
426
+ readonly evidenceChars: Schema.Int;
427
+ }>, {}>;
428
+ /** One complete bounded slice of a changed path's model-visible evidence. */
429
+ declare class ReviewEvidenceShard extends ReviewEvidenceShard_base {}
430
+ declare const ReviewDiscoveryPass_base: Schema.Class<ReviewDiscoveryPass, Schema.Struct<{
431
+ readonly passId: Schema.NonEmptyString;
432
+ readonly unitId: Schema.NonEmptyString;
433
+ readonly paths: Schema.$Array<Schema.NonEmptyString>;
434
+ readonly evidenceShardIds: Schema.$Array<Schema.NonEmptyString>;
435
+ readonly perspective: Schema.Literals<readonly ["general", "risk-specialist"]>;
436
+ /** Empty for the general pass; explicit deterministic focus for specialists. */
437
+ readonly riskCategories: Schema.$Array<Schema.Literals<readonly ["authentication-authorization", "security-boundary", "persistence-durability", "concurrency", "credential-handling", "external-side-effects"]>>;
438
+ }>, {}>;
439
+ /** One required, independently scoped discovery attempt. */
440
+ declare class ReviewDiscoveryPass extends ReviewDiscoveryPass_base {}
441
+ declare const ReviewUnit_base: Schema.Class<ReviewUnit, Schema.Struct<{
442
+ readonly unitId: Schema.NonEmptyString;
443
+ readonly paths: Schema.$Array<Schema.NonEmptyString>;
444
+ readonly evidenceShards: Schema.$Array<typeof ReviewEvidenceShard>;
445
+ /** additions + deletions across the unit's files, for honest sizing. */
446
+ readonly changedLines: Schema.Int;
447
+ /** Complete model-visible diff/content evidence assigned to each child. */
448
+ readonly evidenceChars: Schema.Int;
449
+ /** Host-classified focus labels for the unit's redundant specialist pass. */
450
+ readonly riskCategories: Schema.$Array<Schema.Literals<readonly ["authentication-authorization", "security-boundary", "persistence-durability", "concurrency", "credential-handling", "external-side-effects"]>>;
451
+ }>, {}>;
452
+ /** One bounded slice of the changeset delegated to one child reviewer. */
453
+ declare class ReviewUnit extends ReviewUnit_base {}
454
+ declare const ReviewUnitPlan_base: Schema.Class<ReviewUnitPlan, Schema.Struct<{
455
+ readonly totalFiles: Schema.Int;
456
+ /** True when the source returned fewer files than the pull request has. */
457
+ readonly truncated: Schema.Boolean;
458
+ readonly units: Schema.$Array<typeof ReviewUnit>;
459
+ /** Exact discovery calls the coordinator must make. */
460
+ readonly discoveryPasses: Schema.$Array<typeof ReviewDiscoveryPass>;
461
+ /** Changed files with neither a textual diff nor bounded base/head text. */
462
+ readonly undiffablePaths: Schema.$Array<Schema.NonEmptyString>;
463
+ /** Assigned paths with one or more evidence shards beyond plan capacity. */
464
+ readonly partialEvidencePaths: Schema.$Array<Schema.NonEmptyString>;
465
+ /** Exact number of shards beyond the bounded unit capacity. */
466
+ readonly unassignedEvidenceShardCount: Schema.Int;
467
+ /** Bounded deterministic prefix of the unassigned shard identifiers. */
468
+ readonly unassignedEvidenceShardIds: Schema.$Array<Schema.NonEmptyString>;
469
+ /**
470
+ * Diffable files beyond the fan-out capacity (MAX_REVIEW_UNITS units of
471
+ * MAX_UNIT_FILES files). Never silently dropped: the coordinator must name
472
+ * them as unreviewed in its summary.
473
+ */
474
+ readonly unassignedPaths: Schema.$Array<Schema.NonEmptyString>;
475
+ }>, {}>;
476
+ /** The complete deterministic fan-out plan over one changeset. */
477
+ declare class ReviewUnitPlan extends ReviewUnitPlan_base {}
478
+ /**
479
+ * Deterministic host policy for specialist assignment. It intentionally
480
+ * favors false positives: an extra bounded pass costs work, while a missed
481
+ * high-risk classification removes redundancy. This is not a claim that the
482
+ * keyword policy recognizes every semantically risky change.
483
+ */
484
+ declare const classifyReviewRisks: (file: ChangedFile) => ReadonlyArray<ReviewRiskCategory>;
485
+ /**
486
+ * Whether every claimed finding anchor was present in the exact bounded
487
+ * evidence shards assigned to one unit. This is stricter than checking the
488
+ * full pull-request diff when an oversized path spans multiple units.
489
+ */
490
+ declare const findingAnchorInUnitEvidence: (finding: ReviewFinding, unit: ReviewUnit, files: ReadonlyArray<ChangedFile>) => boolean;
491
+ /**
492
+ * Group the changeset into at most `MAX_REVIEW_UNITS` review units.
493
+ *
494
+ * Deterministic by construction: files are ordered by path (so files sharing
495
+ * a directory become neighbors — directory affinity without a heuristic),
496
+ * then split into complete line-bounded evidence shards and packed greedily
497
+ * under the hard evidence and per-unit shard bounds. Capacity is finite and
498
+ * explicit:
499
+ *
500
+ * - files without a textual diff are still delegated when the source
501
+ * recovered complete bounded UTF-8 base/head content. Findings from that
502
+ * evidence cannot anchor inline and are reported as concerns;
503
+ * - files with neither form of textual evidence surface in
504
+ * `undiffablePaths` instead of laundering missing coverage;
505
+ * - an oversized path spans as many deterministic shards and units as needed;
506
+ * - shards beyond `MAX_REVIEW_UNITS` full units surface explicitly, so a path
507
+ * is partial only when finite plan capacity is genuinely exhausted.
508
+ */
509
+ declare const planReviewUnits: (files: ReadonlyArray<ChangedFile>, options: {
510
+ readonly totalChangedFiles: number;
511
+ }) => ReviewUnitPlan;
512
+ /**
513
+ * Merge the children's findings into one bounded, deterministic list: dedupe
514
+ * findings sharing an anchor (path + line range) keeping the most severe —
515
+ * and, at equal severity, the first in declaration order — then rank by
516
+ * severity, path, and line, and cap at the `CodeReview` findings bound.
517
+ * This is the merge policy the coordinator's instructions state in prose;
518
+ * pinning it here keeps the policy itself deterministic and testable.
519
+ */
520
+ declare const rankAndDedupeFindings: (findings: ReadonlyArray<ReviewFinding>) => ReadonlyArray<ReviewFinding>;
521
+ /**
522
+ * The concern analogue of `rankAndDedupeFindings`: dedupe by exact content
523
+ * keeping the most severe duplicate, rank by severity, and cap at the
524
+ * `CodeReview` concerns bound.
525
+ */
526
+ declare const rankAndDedupeConcerns: (concerns: ReadonlyArray<ReviewConcern>) => ReadonlyArray<ReviewConcern>;
527
+ //#endregion
387
528
  //#region src/internal/coverage.d.ts
388
- declare const ReviewShape: Schema.Literals<readonly ["flat", "fan-out"]>;
389
- type ReviewShape = typeof ReviewShape.Type;
390
529
  declare const FailedReviewUnit_base: Schema.Class<FailedReviewUnit, Schema.Struct<{
391
530
  readonly unitId: Schema.NonEmptyString;
392
531
  readonly errorTag: Schema.NonEmptyString;
@@ -413,6 +552,14 @@ declare const ReviewInputCoverage_base: Schema.Class<ReviewInputCoverage, Schema
413
552
  /** Assigned paths whose model-visible diff was truncated by the evidence bound. */
414
553
  readonly partialPaths: Schema.$Array<Schema.NonEmptyString>;
415
554
  readonly unassignedPaths: Schema.$Array<Schema.NonEmptyString>;
555
+ /**
556
+ * Paths with neither a textual diff nor bounded base/head text (binaries,
557
+ * oversized files). Fail-closed: they keep the status incomplete for as
558
+ * long as they are part of the pull request — an unreviewable change must
559
+ * never authorize a green check. Exclude them deliberately with ignore
560
+ * globs when that is intended.
561
+ */
562
+ readonly undiffablePaths: Schema.$Array<Schema.NonEmptyString>;
416
563
  readonly reasons: Schema.$Array<Schema.NonEmptyString>;
417
564
  }>, {}>;
418
565
  declare class ReviewInputCoverage extends ReviewInputCoverage_base {}
@@ -434,40 +581,56 @@ declare const ReviewAssurance_base: Schema.Class<ReviewAssurance, Schema.Struct<
434
581
  readonly confirmedCandidates: Schema.Int;
435
582
  readonly rejectedCandidates: Schema.Int;
436
583
  readonly unsettledCandidates: Schema.Int;
437
- /** Every failure remains visible within the coordinator's 32-call hard bound. */
584
+ /** Discovery claims discarded for anchors/paths outside their assigned evidence. */
585
+ readonly discardedInvalidFindings: Schema.Int;
438
586
  readonly failedPasses: Schema.$Array<typeof FailedReviewPass>;
439
587
  readonly reasons: Schema.$Array<Schema.NonEmptyString>;
440
588
  }>, {}>;
589
+ /**
590
+ * Settlement of scheduled review work. `incomplete` means reviewer-side work
591
+ * failed after its bounded retry — a machinery gap that is carried forward and
592
+ * retried on the next run, never a statement about the code under review.
593
+ * `unverified` is the flat reviewer's honest constant: one pass with no
594
+ * independent verifier is neither settled assurance nor a failure.
595
+ */
441
596
  declare class ReviewAssurance extends ReviewAssurance_base {}
442
- interface ReviewPipelineAssessment {
597
+ /** Render a bounded, deterministic "label (n): a, b, … (+k more)" reason line. */
598
+ declare const boundedListReason: (label: string, values: Iterable<string>) => string;
599
+ /** The flat reviewer's honest constant assurance: one pass, no verifier. */
600
+ declare const flatAssurance: () => ReviewAssurance;
601
+ interface FlatReviewAssessment {
443
602
  readonly inputCoverage: ReviewInputCoverage;
444
603
  readonly assurance: ReviewAssurance;
445
- /** Deprecated compatibility aggregate. */
446
- readonly coverage: ReviewCoverage;
447
- readonly confirmedFindings: ReadonlyArray<ReviewFinding>;
448
- readonly confirmedConcerns: ReadonlyArray<ReviewConcern>;
449
- readonly walkthrough: ReadonlyArray<WalkthroughEntry>;
604
+ /** Retryable evidence gaps (failed or missing diff reads), never undiffable paths. */
605
+ readonly unreviewedPaths: ReadonlyArray<string>;
450
606
  }
451
- /** Assess one settled run without trusting coordinator prose or findings. */
452
- declare const assessReviewPipeline: (input: {
453
- readonly shape: ReviewShape;
607
+ /**
608
+ * Assess one settled flat run from its Run event trace: which required paths
609
+ * received successful bounded diff evidence. This observes tool INPUT
610
+ * assignment only — the host cannot know which evidence the model weighed.
611
+ */
612
+ declare const assessFlatReview: (input: {
454
613
  readonly files: ReadonlyArray<ChangedFile>;
455
614
  readonly totalFiles: number;
456
615
  readonly anchorFiles: ReadonlyArray<ChangedFile>;
457
616
  readonly totalAnchorFiles: number;
458
617
  readonly events: ReadonlyArray<RunEvent>;
459
- }) => ReviewPipelineAssessment;
460
- /** Compatibility helper; prefer assessReviewPipeline for precise claims. */
461
- declare const assessReviewCoverage: (input: {
462
- readonly shape: ReviewShape;
618
+ }) => FlatReviewAssessment;
619
+ /**
620
+ * Input coverage of one host-scheduled fan-out plan: which required paths the
621
+ * bounded plan actually assigned complete evidence for. Capacity overflow and
622
+ * undiffable paths are both real gaps; the pipeline carries them so the check
623
+ * stays fail-closed until they are reviewed, removed, or explicitly ignored.
624
+ */
625
+ declare const fanOutInputCoverage: (input: {
626
+ readonly plan: ReviewUnitPlan;
463
627
  readonly files: ReadonlyArray<ChangedFile>;
464
628
  readonly totalFiles: number;
465
629
  readonly anchorFiles: ReadonlyArray<ChangedFile>;
466
630
  readonly totalAnchorFiles: number;
467
- readonly events: ReadonlyArray<RunEvent>;
468
- }) => ReviewCoverage;
469
- /** Host-verified summaries from successful general discovery passes only. */
470
- declare const collectUnitFileSummaries: (events: ReadonlyArray<RunEvent>) => ReadonlyArray<WalkthroughEntry>;
631
+ }) => ReviewInputCoverage;
632
+ /** Compatibility aggregate over the two precise claims. */
633
+ declare const compatibilityCoverage: (inputCoverage: ReviewInputCoverage, assurance: ReviewAssurance) => ReviewCoverage;
471
634
  //#endregion
472
635
  //#region src/internal/review-state.d.ts
473
636
  declare const ReviewMode: Schema.Literals<readonly ["incremental", "final"]>;
@@ -492,8 +655,10 @@ declare const StoredReviewConcern_base: Schema.Class<StoredReviewConcern, Schema
492
655
  }>, {}>;
493
656
  /** A compact unresolved non-anchored concern carried until a final audit. */
494
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;
495
660
  declare const ReviewState_base: Schema.Class<ReviewState, Schema.Struct<{
496
- readonly version: Schema.Literal<1>;
661
+ readonly version: Schema.Literal<2>;
497
662
  readonly repository: Schema.NonEmptyString;
498
663
  readonly pullRequestNumber: Schema.Int;
499
664
  readonly baseRef: Schema.NonEmptyString;
@@ -505,15 +670,26 @@ declare const ReviewState_base: Schema.Class<ReviewState, Schema.Struct<{
505
670
  readonly reviewedPathCount: Schema.Int;
506
671
  readonly unresolvedFindings: Schema.$Array<typeof StoredReviewFinding>;
507
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;
508
681
  readonly lastReviewMode: Schema.Literals<readonly ["incremental", "full"]>;
509
682
  }>, {}>;
510
683
  /**
511
- * Versioned state embedded only after complete input assignment and settled
512
- * configured review assurance. The head plus full-scope fingerprint forms an
513
- * incremental baseline; an absent unresolved item never means the path is
514
- * defect-free. The `acceptedScopeFingerprint` name is retained for wire
515
- * compatibility. Storing hundreds of path strings separately would not fit
516
- * GitHub's bounded review body in the worst case.
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.
517
693
  */
518
694
  declare class ReviewState extends ReviewState_base {}
519
695
  declare const toStoredFinding: (finding: ReviewFinding) => StoredReviewFinding;
@@ -677,25 +853,23 @@ declare const planPublication: (review: CodeReview, files: ReadonlyArray<Changed
677
853
  readonly modelLabel?: string | undefined;
678
854
  /** Workflow-run URL rendered into the footer. */
679
855
  readonly runUrl?: string | undefined;
680
- /** Observed run usage rendered into the footer. */
856
+ /** Observed whole-run usage rendered into the footer. */
681
857
  readonly usage?: {
682
858
  readonly inputTokens: number;
683
859
  readonly outputTokens: number;
684
860
  } | undefined;
685
- /** What the usage observed: the whole run, or the coordinator only. */
686
- readonly usageScope?: "run" | "coordinator" | undefined;
687
861
  /**
688
862
  * Changeset fingerprint embedded invisibly in the review body so a later
689
863
  * run can skip re-reviewing an unchanged changeset.
690
864
  */
691
865
  readonly fingerprint?: string | undefined;
692
- /** Host-owned coverage; incomplete coverage is rendered and fails the check. */
693
- readonly coverage?: ReviewCoverage | undefined;
694
866
  /** Host-owned path/evidence assignment, separate from review assurance. */
695
867
  readonly inputCoverage?: ReviewInputCoverage | undefined;
696
868
  /** Host-owned discovery/specialist/verification settlement. */
697
869
  readonly assurance?: ReviewAssurance | undefined;
698
- /** Unchanged unresolved items carried from the prior settled assurance baseline. */
870
+ /** Retryable scope this run could not settle; carried to the next run. */
871
+ readonly unreviewedPaths?: ReadonlyArray<string> | undefined;
872
+ /** Unchanged unresolved items carried from the prior reviewed baseline. */
699
873
  readonly carriedFindings?: ReadonlyArray<ReviewFinding> | undefined;
700
874
  readonly carriedConcerns?: ReadonlyArray<ReviewConcern> | undefined;
701
875
  /** Selected review scope, made visible whenever orchestration chose it. */
@@ -875,141 +1049,6 @@ declare const gitHubPriorReviewsLayer: Layer.Layer<PriorReviews, never, GitHubRe
875
1049
  */
876
1050
  declare const fingerprintUnchanged: (current: string) => Effect.Effect<boolean, never, PriorReviews>;
877
1051
  //#endregion
878
- //#region src/internal/review-units.d.ts
879
- /** The delegation fan-out bound: one parent Run spawns at most this many children. */
880
- declare const MAX_REVIEW_UNITS = 8;
881
- /** A unit never carries more files than this, regardless of their size. */
882
- declare const MAX_UNIT_FILES = 12;
883
- /** Compatibility export; complete evidence chars now own unit packing. */
884
- declare const UNIT_CHANGED_LINE_BUDGET = 800;
885
- /**
886
- * Bound the complete model-visible evidence assigned to one child. This is a
887
- * character bound rather than a token estimate because it is deterministic,
888
- * provider-independent, and enforced before any model call.
889
- */
890
- declare const UNIT_EVIDENCE_CHAR_BUDGET = 240000;
891
- /** Maximum complete evidence shards placed in one child brief. */
892
- declare const MAX_UNIT_EVIDENCE_SHARDS = 12;
893
- /**
894
- * Keep overflow diagnostics bounded to one plan's total assignment capacity.
895
- * The plan separately records the exact overflow count and every affected
896
- * path, so identifiers are a deterministic diagnostic sample rather than the
897
- * authority for whether input coverage is complete.
898
- */
899
- declare const MAX_REPORTED_UNASSIGNED_EVIDENCE_SHARDS: number;
900
- /** @deprecated Use `MAX_PATCH_CHARS`; this is now the per-shard bound. */
901
- declare const MAX_FILE_EVIDENCE_CHARS = 60000;
902
- /** The merged review never exceeds the `CodeReview` findings bound. */
903
- declare const MAX_MERGED_FINDINGS = 20;
904
- declare const ReviewUnitId: Schema.NonEmptyString;
905
- /** High-risk surfaces that receive an explicit specialist focus label. */
906
- declare const ReviewRiskCategory: Schema.Literals<readonly ["authentication-authorization", "security-boundary", "persistence-durability", "concurrency", "credential-handling", "external-side-effects"]>;
907
- type ReviewRiskCategory = typeof ReviewRiskCategory.Type;
908
- declare const ReviewDiscoveryPerspective: Schema.Literals<readonly ["general", "risk-specialist"]>;
909
- type ReviewDiscoveryPerspective = typeof ReviewDiscoveryPerspective.Type;
910
- declare const ReviewPassId: Schema.NonEmptyString;
911
- declare const ReviewEvidenceShardId: Schema.NonEmptyString;
912
- declare const ReviewEvidenceShard_base: Schema.Class<ReviewEvidenceShard, Schema.Struct<{
913
- readonly shardId: Schema.NonEmptyString;
914
- readonly path: Schema.NonEmptyString;
915
- readonly ordinal: Schema.Int;
916
- readonly total: Schema.Int;
917
- readonly evidenceChars: Schema.Int;
918
- }>, {}>;
919
- /** One complete bounded slice of a changed path's model-visible evidence. */
920
- declare class ReviewEvidenceShard extends ReviewEvidenceShard_base {}
921
- declare const ReviewDiscoveryPass_base: Schema.Class<ReviewDiscoveryPass, Schema.Struct<{
922
- readonly passId: Schema.NonEmptyString;
923
- readonly unitId: Schema.NonEmptyString;
924
- readonly paths: Schema.$Array<Schema.NonEmptyString>;
925
- readonly evidenceShardIds: Schema.$Array<Schema.NonEmptyString>;
926
- readonly perspective: Schema.Literals<readonly ["general", "risk-specialist"]>;
927
- /** Empty for the general pass; explicit deterministic focus for specialists. */
928
- readonly riskCategories: Schema.$Array<Schema.Literals<readonly ["authentication-authorization", "security-boundary", "persistence-durability", "concurrency", "credential-handling", "external-side-effects"]>>;
929
- }>, {}>;
930
- /** One required, independently scoped discovery attempt. */
931
- declare class ReviewDiscoveryPass extends ReviewDiscoveryPass_base {}
932
- declare const ReviewUnit_base: Schema.Class<ReviewUnit, Schema.Struct<{
933
- readonly unitId: Schema.NonEmptyString;
934
- readonly paths: Schema.$Array<Schema.NonEmptyString>;
935
- readonly evidenceShards: Schema.$Array<typeof ReviewEvidenceShard>;
936
- /** additions + deletions across the unit's files, for honest sizing. */
937
- readonly changedLines: Schema.Int;
938
- /** Complete model-visible diff/content evidence assigned to each child. */
939
- readonly evidenceChars: Schema.Int;
940
- /** Host-classified focus labels for the unit's redundant specialist pass. */
941
- readonly riskCategories: Schema.$Array<Schema.Literals<readonly ["authentication-authorization", "security-boundary", "persistence-durability", "concurrency", "credential-handling", "external-side-effects"]>>;
942
- }>, {}>;
943
- /** One bounded slice of the changeset delegated to one child reviewer. */
944
- declare class ReviewUnit extends ReviewUnit_base {}
945
- declare const ReviewUnitPlan_base: Schema.Class<ReviewUnitPlan, Schema.Struct<{
946
- readonly totalFiles: Schema.Int;
947
- /** True when the source returned fewer files than the pull request has. */
948
- readonly truncated: Schema.Boolean;
949
- readonly units: Schema.$Array<typeof ReviewUnit>;
950
- /** Exact discovery calls the coordinator must make. */
951
- readonly discoveryPasses: Schema.$Array<typeof ReviewDiscoveryPass>;
952
- /** Changed files with neither a textual diff nor bounded base/head text. */
953
- readonly undiffablePaths: Schema.$Array<Schema.NonEmptyString>;
954
- /** Assigned paths with one or more evidence shards beyond plan capacity. */
955
- readonly partialEvidencePaths: Schema.$Array<Schema.NonEmptyString>;
956
- /** Exact number of shards beyond the bounded unit capacity. */
957
- readonly unassignedEvidenceShardCount: Schema.Int;
958
- /** Bounded deterministic prefix of the unassigned shard identifiers. */
959
- readonly unassignedEvidenceShardIds: Schema.$Array<Schema.NonEmptyString>;
960
- /**
961
- * Diffable files beyond the fan-out capacity (MAX_REVIEW_UNITS units of
962
- * MAX_UNIT_FILES files). Never silently dropped: the coordinator must name
963
- * them as unreviewed in its summary.
964
- */
965
- readonly unassignedPaths: Schema.$Array<Schema.NonEmptyString>;
966
- }>, {}>;
967
- /** The complete deterministic fan-out plan over one changeset. */
968
- declare class ReviewUnitPlan extends ReviewUnitPlan_base {}
969
- /**
970
- * Deterministic host policy for specialist assignment. It intentionally
971
- * favors false positives: an extra bounded pass costs work, while a missed
972
- * high-risk classification removes redundancy. This is not a claim that the
973
- * keyword policy recognizes every semantically risky change.
974
- */
975
- declare const classifyReviewRisks: (file: ChangedFile) => ReadonlyArray<ReviewRiskCategory>;
976
- /**
977
- * Whether every claimed finding anchor was present in the exact bounded
978
- * evidence shards assigned to one unit. This is stricter than checking the
979
- * full pull-request diff when an oversized path spans multiple units.
980
- */
981
- declare const findingAnchorInUnitEvidence: (finding: ReviewFinding, unit: ReviewUnit, files: ReadonlyArray<ChangedFile>) => boolean;
982
- /**
983
- * Group the changeset into at most `MAX_REVIEW_UNITS` review units.
984
- *
985
- * Deterministic by construction: files are ordered by path (so files sharing
986
- * a directory become neighbors — directory affinity without a heuristic),
987
- * then split into complete line-bounded evidence shards and packed greedily
988
- * under the hard evidence and per-unit shard bounds. Capacity is finite and
989
- * explicit:
990
- *
991
- * - files without a textual diff are still delegated when the source
992
- * recovered complete bounded UTF-8 base/head content. Findings from that
993
- * evidence cannot anchor inline and are reported as concerns;
994
- * - files with neither form of textual evidence surface in
995
- * `undiffablePaths` instead of laundering missing coverage;
996
- * - an oversized path spans as many deterministic shards and units as needed;
997
- * - shards beyond `MAX_REVIEW_UNITS` full units surface explicitly, so a path
998
- * is partial only when finite plan capacity is genuinely exhausted.
999
- */
1000
- declare const planReviewUnits: (files: ReadonlyArray<ChangedFile>, options: {
1001
- readonly totalChangedFiles: number;
1002
- }) => ReviewUnitPlan;
1003
- /**
1004
- * Merge the children's findings into one bounded, deterministic list: dedupe
1005
- * findings sharing an anchor (path + line range) keeping the most severe —
1006
- * and, at equal severity, the first in declaration order — then rank by
1007
- * severity, path, and line, and cap at the `CodeReview` findings bound.
1008
- * This is the merge policy the coordinator's instructions state in prose;
1009
- * pinning it here keeps the policy itself deterministic and testable.
1010
- */
1011
- declare const rankAndDedupeFindings: (findings: ReadonlyArray<ReviewFinding>) => ReadonlyArray<ReviewFinding>;
1012
- //#endregion
1013
1052
  //#region src/internal/fan-out.d.ts
1014
1053
  /** One discovery pass returns at most this many anchored candidates. */
1015
1054
  declare const MAX_CHILD_FINDINGS = 6;
@@ -1017,8 +1056,14 @@ declare const MAX_CHILD_FINDINGS = 6;
1017
1056
  declare const MAX_CHILD_CONCERNS = 3;
1018
1057
  /** Every unit receives independent general and specialist discovery passes. */
1019
1058
  declare const MAX_UNIT_CANDIDATES: number;
1020
- /** General + specialist discovery for every unit, then one verifier per unit. */
1059
+ /**
1060
+ * General + specialist discovery for every unit, then one verifier per unit.
1061
+ * The one-retry budget doubles the worst-case child Run count, but the
1062
+ * schedule itself never exceeds this bound.
1063
+ */
1021
1064
  declare const MAX_REVIEW_CHILDREN: number;
1065
+ /** Bounded structured concurrency across units; passes inside a unit are sequential. */
1066
+ declare const REVIEW_UNIT_CONCURRENCY = 4;
1022
1067
  /** Structural minimum for a child that exposes no tools. */
1023
1068
  declare const MAX_FILE_REVIEW_TOOL_CALLS = 1;
1024
1069
  declare const ReviewWorkPhase: Schema.Literals<readonly ["discovery", "verification"]>;
@@ -1061,8 +1106,8 @@ declare const CandidateAssessment_base: Schema.Class<CandidateAssessment, Schema
1061
1106
  declare class CandidateAssessment extends CandidateAssessment_base {}
1062
1107
  /**
1063
1108
  * Exact suggestion settlement shape: a carried suggestion must be settled and
1064
- * nothing else may be. Enforced identically by the live delegation projection
1065
- * and the independent host coverage fold.
1109
+ * nothing else may be. A verification report that violates it is treated as a
1110
+ * misbehaving pass and retried within the pass budget.
1066
1111
  */
1067
1112
  declare const assessmentSettlesSuggestionExactly: (assessment: CandidateAssessment, candidate: ReviewCandidate) => boolean;
1068
1113
  /**
@@ -1083,19 +1128,6 @@ declare const DiscoveredConcern_base: Schema.Class<DiscoveredConcern, Schema.Str
1083
1128
  * remains path-free after the host confirms and projects it.
1084
1129
  */
1085
1130
  declare class DiscoveredConcern extends DiscoveredConcern_base {}
1086
- declare const FileReviewRequest_base: Schema.Class<FileReviewRequest, Schema.Struct<{
1087
- readonly phase: Schema.Literals<readonly ["discovery", "verification"]>;
1088
- readonly workId: Schema.NonEmptyString;
1089
- readonly unitId: Schema.NonEmptyString;
1090
- readonly paths: Schema.$Array<Schema.NonEmptyString>;
1091
- readonly evidenceShardIds: Schema.$Array<Schema.NonEmptyString>;
1092
- readonly perspective: Schema.Literals<readonly ["general", "risk-specialist", "candidate-verification"]>;
1093
- readonly riskCategories: Schema.$Array<Schema.Literals<readonly ["authentication-authorization", "security-boundary", "persistence-durability", "concurrency", "credential-handling", "external-side-effects"]>>;
1094
- /** Empty for discovery; the exact discovered set for unit verification. */
1095
- readonly candidates: Schema.$Array<Schema.Union<readonly [typeof FindingCandidate, typeof ConcernCandidate]>>;
1096
- }>, {}>;
1097
- /** Strict-object coordinator request for either discovery or verification. */
1098
- declare class FileReviewRequest extends FileReviewRequest_base {}
1099
1131
  declare const FileReviewEvidence_base: Schema.Class<FileReviewEvidence, Schema.Struct<{
1100
1132
  readonly shardId: Schema.NonEmptyString;
1101
1133
  readonly path: Schema.NonEmptyString;
@@ -1115,6 +1147,7 @@ declare const FileReviewBrief_base: Schema.Class<FileReviewBrief, Schema.Struct<
1115
1147
  readonly evidenceShardIds: Schema.$Array<Schema.NonEmptyString>;
1116
1148
  readonly perspective: Schema.Literals<readonly ["general", "risk-specialist", "candidate-verification"]>;
1117
1149
  readonly riskCategories: Schema.$Array<Schema.Literals<readonly ["authentication-authorization", "security-boundary", "persistence-durability", "concurrency", "credential-handling", "external-side-effects"]>>;
1150
+ /** Empty for discovery; the exact discovered set for unit verification. */
1118
1151
  readonly candidates: Schema.$Array<Schema.Union<readonly [typeof FindingCandidate, typeof ConcernCandidate]>>;
1119
1152
  readonly evidence: Schema.$Array<typeof FileReviewEvidence>;
1120
1153
  }>, {}>;
@@ -1131,27 +1164,17 @@ declare const FileReviewReport_base: Schema.Class<FileReviewReport, Schema.Struc
1131
1164
  }>, {}>;
1132
1165
  /** Child output; phase-inapplicable collections must be empty. */
1133
1166
  declare class FileReviewReport extends FileReviewReport_base {}
1134
- declare const FileReviewUnitResult_base: Schema.Class<FileReviewUnitResult, Schema.Struct<{
1135
- readonly phase: Schema.Literals<readonly ["discovery", "verification"]>;
1136
- readonly workId: Schema.NonEmptyString;
1137
- readonly unitId: Schema.NonEmptyString;
1138
- readonly candidates: Schema.$Array<Schema.Union<readonly [typeof FindingCandidate, typeof ConcernCandidate]>>;
1139
- readonly fileSummaries: Schema.$Array<typeof WalkthroughEntry>;
1140
- readonly assessments: Schema.$Array<typeof CandidateAssessment>;
1141
- }>, {}>;
1142
- /** Bounded coordinator-visible result with host-assigned candidate IDs. */
1143
- declare class FileReviewUnitResult extends FileReviewUnitResult_base {}
1144
- declare const FileReviewUnitFailed_base: Schema.Class<FileReviewUnitFailed, Schema.TaggedStruct<"FileReviewUnitFailed", {
1145
- readonly childErrorTag: Schema.NonEmptyString;
1146
- readonly message: Schema.String;
1147
- }>, import("effect/Cause").YieldableError>;
1148
- declare class FileReviewUnitFailed extends FileReviewUnitFailed_base {}
1149
- declare const FileReviewWorkRejected_base: Schema.Class<FileReviewWorkRejected, Schema.TaggedStruct<"FileReviewWorkRejected", {
1167
+ declare const ReviewPassMisbehaved_base: Schema.Class<ReviewPassMisbehaved, Schema.TaggedStruct<"ReviewPassMisbehaved", {
1150
1168
  readonly workId: Schema.NonEmptyString;
1151
1169
  readonly reason: Schema.NonEmptyString;
1152
1170
  }>, import("effect/Cause").YieldableError>;
1153
- declare class FileReviewWorkRejected extends FileReviewWorkRejected_base {}
1154
- declare const FileReviewFailure: Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>;
1171
+ /**
1172
+ * A structurally valid child report that does not answer the scheduled pass:
1173
+ * wrong identity, phase-inapplicable fields, or an inexact assessment set.
1174
+ * Retried once like any other pass fault, because it is model misbehavior,
1175
+ * not evidence about the code under review.
1176
+ */
1177
+ declare class ReviewPassMisbehaved extends ReviewPassMisbehaved_base {}
1155
1178
  interface FanOutInstructionOptions {
1156
1179
  readonly guidance?: string | ReadonlyArray<string> | undefined;
1157
1180
  }
@@ -1159,110 +1182,42 @@ interface FanOutInstructionOptions {
1159
1182
  declare const makeFileReviewerInstructions: (options?: FanOutInstructionOptions) => (brief: FileReviewBrief) => string;
1160
1183
  declare const fileReviewerInstructions: (brief: FileReviewBrief) => string;
1161
1184
  declare const FileReviewToolkit: Toolkit.Toolkit<{}>;
1162
- /** Compatibility export: the evidence-only child has no handler requirements. */
1163
- declare const FileReviewToolkitLayer: Layer.Layer<never, never, never>;
1164
1185
  declare const defaultFileReviewerPolicy: AgentPolicy;
1165
- declare const fileReviewPolicy: SubagentPolicy;
1166
- declare const mapFileReviewChildFailure: (failure: {
1167
- readonly _tag: string;
1168
- readonly message?: string;
1169
- }) => FileReviewUnitFailed;
1170
- declare const makeFileReviewDelegation: (child: ReturnType<typeof makeFileReviewerDefinition>) => import("effect-agent").SubagentDelegation<"delegate_file_review", typeof FileReviewBrief, typeof FileReviewReport, (brief: FileReviewBrief) => string, {}, typeof FileReviewRequest, typeof FileReviewUnitResult, Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>, PullRequestSource, PullRequestSource, "return">;
1171
- declare const ListReviewUnitsQuery_base: Schema.Class<ListReviewUnitsQuery, Schema.Struct<{
1172
- readonly scope: Schema.Literal<"all">;
1173
- }>, {}>;
1174
- declare class ListReviewUnitsQuery extends ListReviewUnitsQuery_base {}
1175
- declare const ListReviewUnits: Tool.Tool<"list_review_units", {
1176
- readonly parameters: typeof ListReviewUnitsQuery;
1177
- readonly success: typeof ReviewUnitPlan;
1178
- readonly failure: typeof PullRequestSourceFailure;
1179
- readonly failureMode: "error";
1180
- }, PullRequestSource>;
1181
- declare const FanOutCoordinatorToolkit: Toolkit.Toolkit<{
1182
- readonly list_review_units: Tool.Tool<"list_review_units", {
1183
- readonly parameters: typeof ListReviewUnitsQuery;
1184
- readonly success: typeof ReviewUnitPlan;
1185
- readonly failure: typeof PullRequestSourceFailure;
1186
- readonly failureMode: "error";
1187
- }, PullRequestSource>;
1188
- }>;
1189
- declare const FanOutCoordinatorToolkitLayer: Layer.Layer<Tool.Handler<"list_review_units">, never, never>;
1190
- declare const makeFanOutReviewInstructions: (options?: FanOutInstructionOptions & {
1191
- readonly maxFindings?: number | undefined;
1192
- }) => (mission: ReviewMission) => string;
1193
- declare const fanOutReviewInstructions: (mission: ReviewMission) => string;
1194
- declare const defaultFanOutPolicy: AgentPolicy;
1195
- interface FanOutReviewSuite {
1196
- readonly child: ReturnType<typeof makeFileReviewerDefinition>;
1197
- readonly parent: ReturnType<typeof makeFanOutReviewerDefinition>;
1198
- readonly delegation: ReturnType<typeof makeFileReviewDelegation>;
1199
- }
1200
1186
  declare const makeFileReviewerDefinition: (options?: FanOutInstructionOptions) => import("effect-agent").Definition<typeof FileReviewBrief, typeof FileReviewReport, (brief: FileReviewBrief) => string, Toolkit.Toolkit<{}>, undefined>;
1201
- declare const makeFanOutReviewerDefinition: (options: FanOutInstructionOptions & {
1202
- readonly maxFindings?: number | undefined;
1203
- }, delegation: ReturnType<typeof makeFileReviewDelegation>) => import("effect-agent").Definition<typeof ReviewMission, typeof CodeReview, (mission: ReviewMission) => string, Toolkit.Toolkit<{
1204
- readonly delegate_file_review: Tool.Tool<"delegate_file_review", {
1205
- readonly parameters: typeof FileReviewRequest;
1206
- readonly success: Schema.Union<readonly [typeof FileReviewUnitResult, import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>]>;
1207
- readonly failure: import("effect-agent").SubagentReturnModeFailure;
1208
- readonly failureMode: "error";
1209
- }, import("effect-agent").AgentSpawner | import("effect-agent").IdGenerator | import("effect-agent").RunEventSink | import("effect-agent").SubagentDurability>;
1210
- readonly list_review_units: Tool.Tool<"list_review_units", {
1211
- readonly parameters: typeof ListReviewUnitsQuery;
1212
- readonly success: typeof ReviewUnitPlan;
1213
- readonly failure: typeof PullRequestSourceFailure;
1214
- readonly failureMode: "error";
1215
- }, PullRequestSource>;
1216
- }>, undefined>;
1217
- interface FanOutSuiteOptions extends FanOutInstructionOptions {
1187
+ declare const FileReviewer: import("effect-agent").Definition<typeof FileReviewBrief, typeof FileReviewReport, (brief: FileReviewBrief) => string, Toolkit.Toolkit<{}>, undefined>;
1188
+ /** The exact child binding shape the host pipeline schedules. */
1189
+ type FileReviewerBinding<Provider, ModelProvides, ModelRequires> = RuntimeBinding<typeof FileReviewBrief, typeof FileReviewReport, ReturnType<typeof makeFileReviewerInstructions>, Toolkit.Tools<typeof FileReviewToolkit>, Provider, ModelProvides, ModelRequires>;
1190
+ /** Everything one settled fan-out pipeline run produced, before publication. */
1191
+ interface FanOutPipelineOutcome {
1192
+ readonly review: CodeReview;
1193
+ readonly assurance: ReviewAssurance;
1194
+ readonly plan: ReviewUnitPlan;
1195
+ /** Paths of units with an unsettled pass — retryable scope for the next run. */
1196
+ readonly unreviewedPaths: ReadonlyArray<string>;
1197
+ /** Total settled child turns across every scheduled pass. */
1198
+ readonly turns: number;
1199
+ }
1200
+ interface FanOutPipelineInput {
1201
+ readonly files: ReadonlyArray<ChangedFile>;
1202
+ readonly anchorFiles: ReadonlyArray<ChangedFile>;
1203
+ readonly totalChangedFiles: number;
1218
1204
  readonly maxFindings?: number | undefined;
1205
+ /** Shared run budget observed by every child pass. */
1206
+ readonly budget?: RunBudgetHook<BudgetExceeded | BudgetAdapterError> | undefined;
1219
1207
  }
1220
- declare const makeFanOutReviewSuite: (options?: FanOutSuiteOptions) => FanOutReviewSuite;
1221
- declare const FileReviewer: import("effect-agent").Definition<typeof FileReviewBrief, typeof FileReviewReport, (brief: FileReviewBrief) => string, Toolkit.Toolkit<{}>, undefined>;
1222
- declare const FanOutReviewer: import("effect-agent").Definition<typeof ReviewMission, typeof CodeReview, (mission: ReviewMission) => string, Toolkit.Toolkit<{
1223
- readonly delegate_file_review: Tool.Tool<"delegate_file_review", {
1224
- readonly parameters: typeof FileReviewRequest;
1225
- readonly success: Schema.Union<readonly [typeof FileReviewUnitResult, import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>]>;
1226
- readonly failure: import("effect-agent").SubagentReturnModeFailure;
1227
- readonly failureMode: "error";
1228
- }, import("effect-agent").AgentSpawner | import("effect-agent").IdGenerator | import("effect-agent").RunEventSink | import("effect-agent").SubagentDurability>;
1229
- readonly list_review_units: Tool.Tool<"list_review_units", {
1230
- readonly parameters: typeof ListReviewUnitsQuery;
1231
- readonly success: typeof ReviewUnitPlan;
1232
- readonly failure: typeof PullRequestSourceFailure;
1233
- readonly failureMode: "error";
1234
- }, PullRequestSource>;
1235
- }>, undefined>;
1236
- declare const fileReviewDelegation: import("effect-agent").SubagentDelegation<"delegate_file_review", typeof FileReviewBrief, typeof FileReviewReport, (brief: FileReviewBrief) => string, {}, typeof FileReviewRequest, typeof FileReviewUnitResult, Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>, PullRequestSource, PullRequestSource, "return">;
1237
- declare const DelegateFileReview: Tool.Tool<"delegate_file_review", {
1238
- readonly parameters: typeof FileReviewRequest;
1239
- readonly success: Schema.Union<readonly [typeof FileReviewUnitResult, import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>]>;
1240
- readonly failure: import("effect-agent").SubagentReturnModeFailure;
1241
- readonly failureMode: "error";
1242
- }, import("effect-agent").AgentSpawner | import("effect-agent").IdGenerator | import("effect-agent").RunEventSink | import("effect-agent").SubagentDurability>;
1243
- declare const FanOutReviewToolkit: Toolkit.Toolkit<{
1244
- readonly delegate_file_review: Tool.Tool<"delegate_file_review", {
1245
- readonly parameters: typeof FileReviewRequest;
1246
- readonly success: Schema.Union<readonly [typeof FileReviewUnitResult, import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>]>;
1247
- readonly failure: import("effect-agent").SubagentReturnModeFailure;
1248
- readonly failureMode: "error";
1249
- }, import("effect-agent").AgentSpawner | import("effect-agent").IdGenerator | import("effect-agent").RunEventSink | import("effect-agent").SubagentDurability>;
1250
- readonly list_review_units: Tool.Tool<"list_review_units", {
1251
- readonly parameters: typeof ListReviewUnitsQuery;
1252
- readonly success: typeof ReviewUnitPlan;
1253
- readonly failure: typeof PullRequestSourceFailure;
1254
- readonly failureMode: "error";
1255
- }, PullRequestSource>;
1256
- }>;
1257
- declare const FileReviewDelegationFailure: import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>;
1258
- declare const fanOutHandlersLayerFor: (delegation: ReturnType<typeof makeFileReviewDelegation>) => <Provider, ModelProvides, ModelRequires>(childBinding: RuntimeBinding<typeof FileReviewBrief, typeof FileReviewReport, ReturnType<typeof makeFileReviewerInstructions>, Toolkit.Tools<typeof FileReviewToolkit>, Provider, ModelProvides, ModelRequires>) => Layer.Layer<Tool.Handler<"delegate_file_review">, never, import("effect-agent").SubagentLayerRequirements<typeof FileReviewBrief, typeof FileReviewReport, (brief: FileReviewBrief) => string, {}, Provider, ModelProvides, ModelRequires, PullRequestSource, PullRequestSource, never, {
1259
- readonly _tag: string;
1260
- readonly message?: string;
1261
- }, never>>;
1262
- declare const fanOutHandlersLayer: <Provider, ModelProvides, ModelRequires>(childBinding: RuntimeBinding<typeof FileReviewBrief, typeof FileReviewReport, ReturnType<typeof makeFileReviewerInstructions>, Toolkit.Tools<typeof FileReviewToolkit>, Provider, ModelProvides, ModelRequires>) => Layer.Layer<Tool.Handler<"delegate_file_review">, never, import("effect-agent").SubagentLayerRequirements<typeof FileReviewBrief, typeof FileReviewReport, (brief: FileReviewBrief) => string, {}, Provider, ModelProvides, ModelRequires, PullRequestSource, PullRequestSource, never, {
1263
- readonly _tag: string;
1264
- readonly message?: string;
1265
- }, never>>;
1208
+ /**
1209
+ * Run the complete host-scheduled fan-out pipeline over one selected
1210
+ * changeset snapshot: plan, independent discovery, exact verification, and a
1211
+ * deterministic host-composed CodeReview from verifier-confirmed candidates
1212
+ * only. The verdict is derived from confirmed severities, never model prose.
1213
+ */
1214
+ declare const runFanOutReview: <Provider, ModelProvides, ModelRequires>(binding: FileReviewerBinding<Provider, ModelProvides, ModelRequires>, input: FanOutPipelineInput) => Effect.Effect<{
1215
+ review: CodeReview;
1216
+ assurance: ReviewAssurance;
1217
+ plan: ReviewUnitPlan;
1218
+ unreviewedPaths: string[];
1219
+ turns: number;
1220
+ }, never, import("effect-agent").IdGenerator | Exclude<Exclude<ModelRequires, import("effect-agent").EngineProvidedToolServices>, import("effect/Scope").Scope>>;
1266
1221
  //#endregion
1267
- export { MAX_REPORTED_UNASSIGNED_EVIDENCE_SHARDS as $, ReviewFinding as $n, ReviewMode as $t, MAX_REVIEW_CHILDREN as A, anchorViolation as An, commentableLines as Ar, parseGitHubSubmittedAt as At, fanOutHandlersLayer as B, FindingSeverity as Bn, retireStaleReviews as Bt, FileReviewer as C, ReviewCoverage as Cn, normalizeRepoRelativePath as Cr, PublishedReview as Ct, MAX_CHILD_CONCERNS as D, assessReviewCoverage as Dn, MAX_REVIEW_CONTENT_CHARS as Dr, gitHubPullRequestSourceLayer as Dt, ListReviewUnitsQuery as E, ReviewShape as En, ChangedPath as Er, gitHubPriorReviewsLayer as Et, ReviewWorkPhase as F, FileDiffView as Fn, ReviewRetirementHost as Ft, fileReviewerInstructions as G, MAX_PATCH_CHARS as Gn, estimateReviewEffort as Gt, fanOutReviewInstructions as H, ListChangedFilesQuery as Hn, ReviewCommentDraft as Ht, assessmentSettlesSuggestionExactly as I, FileReviewEvidenceChunk as In, ReviewRetirementInput as It, makeFileReviewerInstructions as J, PullRequestReviewer as Jn, renderAgentPrompt as Jt, makeFanOutReviewInstructions as K, MAX_WALKTHROUGH_ENTRIES as Kn, planPublication as Kt, confirmedFindingForPublication as L, FileSlice as Ln, ReviewRetirementReport as Lt, ReviewCandidate as M, ChangedFilesView as Mn, isReviewableFile as Mr, RetirableReviewComment as Mt, ReviewCandidateId as N, CodeReview as Nn, parsePatch as Nr, ReviewRetirementDecision as Nt, MAX_CHILD_FINDINGS as O, assessReviewPipeline as On, PatchLine as Or, gitHubReviewPublisherLayer as Ot, ReviewWorkPerspective as P, FileDiffQuery as Pn, renderReviewContent as Pr, ReviewRetirementFailure as Pt, MAX_MERGED_FINDINGS as Q, ReviewConcern as Qn, ReviewHeadComparison as Qt, defaultFanOutPolicy as R, FileSliceQuery as Rn, decideReviewRetirement as Rt, FileReviewWorkRejected as S, ReviewAssurance as Sn, ReviewInputViolation as Sr, PriorReviews as St, ListReviewUnits as T, ReviewPipelineAssessment as Tn, ChangedFileStatus as Tr, fingerprintUnchanged as Tt, fileReviewDelegation as U, MAX_CONCERNS as Un, ReviewEvent as Ut, fanOutHandlersLayerFor as V, ListChangedFiles as Vn, AGENT_PROMPT_PREAMBLE as Vt, fileReviewPolicy as W, MAX_FINDINGS as Wn, ReviewPublicationPlan as Wt, reviewCandidateSubjectKey as X, ReadFile as Xn, MAX_REVIEW_STATE_MARKER_CHARS as Xt, mapFileReviewChildFailure as Y, REVIEW_TOOL_RESULT_MAX_BYTES as Yn, GitCommitSha as Yt, MAX_FILE_EVIDENCE_CHARS as Z, ReadFileDiff as Zn, ReviewExecutionContext as Zt, FileReviewRequest as _, unavailableReviewStateAuthenticatorLayer as _n, MAX_CHANGED_FILES as _r, rankAndDedupeFindings as _t, FanOutCoordinatorToolkit as a, ReviewStateMarker as an, ReviewVerdict as ar, ReviewEvidenceShard as at, FileReviewUnitFailed as b, FailedReviewPass as bn, PullRequestSource as br, GitHubReviewTarget as bt, FanOutReviewSuite as c, StoredReviewFinding as cn, defaultReviewPolicy as cr, ReviewRiskCategory as ct, FanOutSuiteOptions as d, fromStoredConcern as dn, listChangedFilesHandler as dr, ReviewUnitPlan as dt, ReviewScopeMode as en, ReviewGuidance as er, MAX_REVIEW_UNITS as et, FileReviewBrief as f, fromStoredFinding as fn, makeReviewInstructions as fr, UNIT_CHANGED_LINE_BUDGET as ft, FileReviewReport as g, toStoredFinding as gn, reviewInstructions as gr, planReviewUnits as gt, FileReviewFailure as h, toStoredConcern as hn, resolveGuidance as hr, findingAnchorInUnitEvidence as ht, DiscoveredConcern as i, ReviewStateAuthenticator as in, ReviewToolkitLayer as ir, ReviewDiscoveryPerspective as it, MAX_UNIT_CANDIDATES as j, ChangedFileSummary as jn, hasReviewableContent as jr, RetirableReview as jt, MAX_FILE_REVIEW_TOOL_CALLS as k, collectUnitFileSummaries as kn, annotatePatch as kr, gitHubReviewRetirementHostLayer as kt, FanOutReviewToolkit as l, buildProfileMission as ln, fileDiffView as lr, ReviewUnit as lt, FileReviewEvidence as m, selectedPullRequestSourceLayer as mn, readFileHandler as mr, classifyReviewRisks as mt, ConcernCandidate as n, ReviewState as nn, ReviewMission as nr, MAX_UNIT_FILES as nt, FanOutCoordinatorToolkitLayer as o, ReviewStateMarkerTooLarge as on, WalkthroughEntry as or, ReviewEvidenceShardId as ot, FileReviewDelegationFailure as p, selectReviewRange as pn, readFileDiffHandler as pr, UNIT_EVIDENCE_CHAR_BUDGET as pt, makeFanOutReviewSuite as q, MAX_WALKTHROUGH_SUMMARY_CHARS as qn, planWalkthrough as qt, DelegateFileReview as r, ReviewStateAuthenticationFailure as rn, ReviewToolkit as rr, ReviewDiscoveryPass as rt, FanOutInstructionOptions as s, StoredReviewConcern as sn, clampMaxFindings as sr, ReviewPassId as st, CandidateAssessment as t, ReviewSelection as tn, ReviewInstructionOptions as tr, MAX_UNIT_EVIDENCE_SHARDS as tt, FanOutReviewer as u, computeProfileFingerprint as un, fileReviewEvidenceChunks as ur, ReviewUnitId as ut, FileReviewToolkit as v, validateReviewState as vn, MAX_FILE_CHARS as vr, DEFAULT_GITHUB_REVIEW_AUTHOR_LOGIN as vt, FindingCandidate as w, ReviewInputCoverage as wn, ChangedFile as wr, ReviewPublisher as wt, FileReviewUnitResult as x, FailedReviewUnit as xn, PullRequestSourceFailure as xr, PriorReviewLookupFailure as xt, FileReviewToolkitLayer as y, webCryptoReviewStateAuthenticatorLayer as yn, PullRequestMetadata as yr, GitHubApiFailure as yt, defaultFileReviewerPolicy as z, FindingCategory as zn, hasReviewMetadataMarker as zt };
1268
- //# sourceMappingURL=fan-out-n-00ppWr.d.mts.map
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