@effect-agent/pr-review 0.1.0-beta.21 → 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"]>;
@@ -1049,9 +1094,29 @@ declare const reviewCandidateSubjectKey: (candidate: ReviewCandidate) => string;
1049
1094
  declare const CandidateAssessment_base: Schema.Class<CandidateAssessment, Schema.Struct<{
1050
1095
  readonly candidateId: Schema.NonEmptyString;
1051
1096
  readonly disposition: Schema.Literals<readonly ["confirmed", "rejected"]>;
1097
+ /**
1098
+ * Exact suggestion settlement: required when the candidate finding carries
1099
+ * a suggestion, forbidden otherwise. Untrusted child output cannot publish
1100
+ * a GitHub replacement block by prompt compliance alone — the host keeps a
1101
+ * confirmed finding's suggestion only on an exact "committable" settlement.
1102
+ */
1103
+ readonly suggestion: Schema.optionalKey<Schema.Literals<readonly ["committable", "not-committable"]>>;
1052
1104
  readonly rationale: Schema.NonEmptyString;
1053
1105
  }>, {}>;
1054
1106
  declare class CandidateAssessment extends CandidateAssessment_base {}
1107
+ /**
1108
+ * Exact suggestion settlement shape: a carried suggestion must be settled and
1109
+ * nothing else may be. A verification report that violates it is treated as a
1110
+ * misbehaving pass and retried within the pass budget.
1111
+ */
1112
+ declare const assessmentSettlesSuggestionExactly: (assessment: CandidateAssessment, candidate: ReviewCandidate) => boolean;
1113
+ /**
1114
+ * Fail-closed publication of a confirmed finding: only an exact "committable"
1115
+ * settlement keeps the suggestion; anything else publishes the finding with
1116
+ * the suggestion stripped so unverified text can never become a one-click
1117
+ * GitHub replacement block.
1118
+ */
1119
+ declare const confirmedFindingForPublication: (assessment: CandidateAssessment, candidate: FindingCandidate) => ReviewFinding;
1055
1120
  declare const DiscoveredConcern_base: Schema.Class<DiscoveredConcern, Schema.Struct<{
1056
1121
  readonly concern: typeof ReviewConcern;
1057
1122
  readonly evidencePaths: Schema.$Array<Schema.NonEmptyString>;
@@ -1063,19 +1128,6 @@ declare const DiscoveredConcern_base: Schema.Class<DiscoveredConcern, Schema.Str
1063
1128
  * remains path-free after the host confirms and projects it.
1064
1129
  */
1065
1130
  declare class DiscoveredConcern extends DiscoveredConcern_base {}
1066
- declare const FileReviewRequest_base: Schema.Class<FileReviewRequest, Schema.Struct<{
1067
- readonly phase: Schema.Literals<readonly ["discovery", "verification"]>;
1068
- readonly workId: Schema.NonEmptyString;
1069
- readonly unitId: Schema.NonEmptyString;
1070
- readonly paths: Schema.$Array<Schema.NonEmptyString>;
1071
- readonly evidenceShardIds: Schema.$Array<Schema.NonEmptyString>;
1072
- readonly perspective: Schema.Literals<readonly ["general", "risk-specialist", "candidate-verification"]>;
1073
- readonly riskCategories: Schema.$Array<Schema.Literals<readonly ["authentication-authorization", "security-boundary", "persistence-durability", "concurrency", "credential-handling", "external-side-effects"]>>;
1074
- /** Empty for discovery; the exact discovered set for unit verification. */
1075
- readonly candidates: Schema.$Array<Schema.Union<readonly [typeof FindingCandidate, typeof ConcernCandidate]>>;
1076
- }>, {}>;
1077
- /** Strict-object coordinator request for either discovery or verification. */
1078
- declare class FileReviewRequest extends FileReviewRequest_base {}
1079
1131
  declare const FileReviewEvidence_base: Schema.Class<FileReviewEvidence, Schema.Struct<{
1080
1132
  readonly shardId: Schema.NonEmptyString;
1081
1133
  readonly path: Schema.NonEmptyString;
@@ -1095,6 +1147,7 @@ declare const FileReviewBrief_base: Schema.Class<FileReviewBrief, Schema.Struct<
1095
1147
  readonly evidenceShardIds: Schema.$Array<Schema.NonEmptyString>;
1096
1148
  readonly perspective: Schema.Literals<readonly ["general", "risk-specialist", "candidate-verification"]>;
1097
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. */
1098
1151
  readonly candidates: Schema.$Array<Schema.Union<readonly [typeof FindingCandidate, typeof ConcernCandidate]>>;
1099
1152
  readonly evidence: Schema.$Array<typeof FileReviewEvidence>;
1100
1153
  }>, {}>;
@@ -1111,27 +1164,17 @@ declare const FileReviewReport_base: Schema.Class<FileReviewReport, Schema.Struc
1111
1164
  }>, {}>;
1112
1165
  /** Child output; phase-inapplicable collections must be empty. */
1113
1166
  declare class FileReviewReport extends FileReviewReport_base {}
1114
- declare const FileReviewUnitResult_base: Schema.Class<FileReviewUnitResult, Schema.Struct<{
1115
- readonly phase: Schema.Literals<readonly ["discovery", "verification"]>;
1116
- readonly workId: Schema.NonEmptyString;
1117
- readonly unitId: Schema.NonEmptyString;
1118
- readonly candidates: Schema.$Array<Schema.Union<readonly [typeof FindingCandidate, typeof ConcernCandidate]>>;
1119
- readonly fileSummaries: Schema.$Array<typeof WalkthroughEntry>;
1120
- readonly assessments: Schema.$Array<typeof CandidateAssessment>;
1121
- }>, {}>;
1122
- /** Bounded coordinator-visible result with host-assigned candidate IDs. */
1123
- declare class FileReviewUnitResult extends FileReviewUnitResult_base {}
1124
- declare const FileReviewUnitFailed_base: Schema.Class<FileReviewUnitFailed, Schema.TaggedStruct<"FileReviewUnitFailed", {
1125
- readonly childErrorTag: Schema.NonEmptyString;
1126
- readonly message: Schema.String;
1127
- }>, import("effect/Cause").YieldableError>;
1128
- declare class FileReviewUnitFailed extends FileReviewUnitFailed_base {}
1129
- declare const FileReviewWorkRejected_base: Schema.Class<FileReviewWorkRejected, Schema.TaggedStruct<"FileReviewWorkRejected", {
1167
+ declare const ReviewPassMisbehaved_base: Schema.Class<ReviewPassMisbehaved, Schema.TaggedStruct<"ReviewPassMisbehaved", {
1130
1168
  readonly workId: Schema.NonEmptyString;
1131
1169
  readonly reason: Schema.NonEmptyString;
1132
1170
  }>, import("effect/Cause").YieldableError>;
1133
- declare class FileReviewWorkRejected extends FileReviewWorkRejected_base {}
1134
- 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 {}
1135
1178
  interface FanOutInstructionOptions {
1136
1179
  readonly guidance?: string | ReadonlyArray<string> | undefined;
1137
1180
  }
@@ -1139,110 +1182,42 @@ interface FanOutInstructionOptions {
1139
1182
  declare const makeFileReviewerInstructions: (options?: FanOutInstructionOptions) => (brief: FileReviewBrief) => string;
1140
1183
  declare const fileReviewerInstructions: (brief: FileReviewBrief) => string;
1141
1184
  declare const FileReviewToolkit: Toolkit.Toolkit<{}>;
1142
- /** Compatibility export: the evidence-only child has no handler requirements. */
1143
- declare const FileReviewToolkitLayer: Layer.Layer<never, never, never>;
1144
1185
  declare const defaultFileReviewerPolicy: AgentPolicy;
1145
- declare const fileReviewPolicy: SubagentPolicy;
1146
- declare const mapFileReviewChildFailure: (failure: {
1147
- readonly _tag: string;
1148
- readonly message?: string;
1149
- }) => FileReviewUnitFailed;
1150
- 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">;
1151
- declare const ListReviewUnitsQuery_base: Schema.Class<ListReviewUnitsQuery, Schema.Struct<{
1152
- readonly scope: Schema.Literal<"all">;
1153
- }>, {}>;
1154
- declare class ListReviewUnitsQuery extends ListReviewUnitsQuery_base {}
1155
- declare const ListReviewUnits: Tool.Tool<"list_review_units", {
1156
- readonly parameters: typeof ListReviewUnitsQuery;
1157
- readonly success: typeof ReviewUnitPlan;
1158
- readonly failure: typeof PullRequestSourceFailure;
1159
- readonly failureMode: "error";
1160
- }, PullRequestSource>;
1161
- declare const FanOutCoordinatorToolkit: Toolkit.Toolkit<{
1162
- readonly list_review_units: Tool.Tool<"list_review_units", {
1163
- readonly parameters: typeof ListReviewUnitsQuery;
1164
- readonly success: typeof ReviewUnitPlan;
1165
- readonly failure: typeof PullRequestSourceFailure;
1166
- readonly failureMode: "error";
1167
- }, PullRequestSource>;
1168
- }>;
1169
- declare const FanOutCoordinatorToolkitLayer: Layer.Layer<Tool.Handler<"list_review_units">, never, never>;
1170
- declare const makeFanOutReviewInstructions: (options?: FanOutInstructionOptions & {
1171
- readonly maxFindings?: number | undefined;
1172
- }) => (mission: ReviewMission) => string;
1173
- declare const fanOutReviewInstructions: (mission: ReviewMission) => string;
1174
- declare const defaultFanOutPolicy: AgentPolicy;
1175
- interface FanOutReviewSuite {
1176
- readonly child: ReturnType<typeof makeFileReviewerDefinition>;
1177
- readonly parent: ReturnType<typeof makeFanOutReviewerDefinition>;
1178
- readonly delegation: ReturnType<typeof makeFileReviewDelegation>;
1179
- }
1180
1186
  declare const makeFileReviewerDefinition: (options?: FanOutInstructionOptions) => import("effect-agent").Definition<typeof FileReviewBrief, typeof FileReviewReport, (brief: FileReviewBrief) => string, Toolkit.Toolkit<{}>, undefined>;
1181
- declare const makeFanOutReviewerDefinition: (options: FanOutInstructionOptions & {
1182
- readonly maxFindings?: number | undefined;
1183
- }, delegation: ReturnType<typeof makeFileReviewDelegation>) => import("effect-agent").Definition<typeof ReviewMission, typeof CodeReview, (mission: ReviewMission) => string, Toolkit.Toolkit<{
1184
- readonly delegate_file_review: Tool.Tool<"delegate_file_review", {
1185
- readonly parameters: typeof FileReviewRequest;
1186
- readonly success: Schema.Union<readonly [typeof FileReviewUnitResult, import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>]>;
1187
- readonly failure: import("effect-agent").SubagentReturnModeFailure;
1188
- readonly failureMode: "error";
1189
- }, import("effect-agent").AgentSpawner | import("effect-agent").IdGenerator | import("effect-agent").RunEventSink | import("effect-agent").SubagentDurability>;
1190
- readonly list_review_units: Tool.Tool<"list_review_units", {
1191
- readonly parameters: typeof ListReviewUnitsQuery;
1192
- readonly success: typeof ReviewUnitPlan;
1193
- readonly failure: typeof PullRequestSourceFailure;
1194
- readonly failureMode: "error";
1195
- }, PullRequestSource>;
1196
- }>, undefined>;
1197
- 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;
1198
1204
  readonly maxFindings?: number | undefined;
1205
+ /** Shared run budget observed by every child pass. */
1206
+ readonly budget?: RunBudgetHook<BudgetExceeded | BudgetAdapterError> | undefined;
1199
1207
  }
1200
- declare const makeFanOutReviewSuite: (options?: FanOutSuiteOptions) => FanOutReviewSuite;
1201
- declare const FileReviewer: import("effect-agent").Definition<typeof FileReviewBrief, typeof FileReviewReport, (brief: FileReviewBrief) => string, Toolkit.Toolkit<{}>, undefined>;
1202
- declare const FanOutReviewer: import("effect-agent").Definition<typeof ReviewMission, typeof CodeReview, (mission: ReviewMission) => string, Toolkit.Toolkit<{
1203
- readonly delegate_file_review: Tool.Tool<"delegate_file_review", {
1204
- readonly parameters: typeof FileReviewRequest;
1205
- readonly success: Schema.Union<readonly [typeof FileReviewUnitResult, import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>]>;
1206
- readonly failure: import("effect-agent").SubagentReturnModeFailure;
1207
- readonly failureMode: "error";
1208
- }, import("effect-agent").AgentSpawner | import("effect-agent").IdGenerator | import("effect-agent").RunEventSink | import("effect-agent").SubagentDurability>;
1209
- readonly list_review_units: Tool.Tool<"list_review_units", {
1210
- readonly parameters: typeof ListReviewUnitsQuery;
1211
- readonly success: typeof ReviewUnitPlan;
1212
- readonly failure: typeof PullRequestSourceFailure;
1213
- readonly failureMode: "error";
1214
- }, PullRequestSource>;
1215
- }>, undefined>;
1216
- 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">;
1217
- declare const DelegateFileReview: Tool.Tool<"delegate_file_review", {
1218
- readonly parameters: typeof FileReviewRequest;
1219
- readonly success: Schema.Union<readonly [typeof FileReviewUnitResult, import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>]>;
1220
- readonly failure: import("effect-agent").SubagentReturnModeFailure;
1221
- readonly failureMode: "error";
1222
- }, import("effect-agent").AgentSpawner | import("effect-agent").IdGenerator | import("effect-agent").RunEventSink | import("effect-agent").SubagentDurability>;
1223
- declare const FanOutReviewToolkit: Toolkit.Toolkit<{
1224
- readonly delegate_file_review: Tool.Tool<"delegate_file_review", {
1225
- readonly parameters: typeof FileReviewRequest;
1226
- readonly success: Schema.Union<readonly [typeof FileReviewUnitResult, import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>]>;
1227
- readonly failure: import("effect-agent").SubagentReturnModeFailure;
1228
- readonly failureMode: "error";
1229
- }, import("effect-agent").AgentSpawner | import("effect-agent").IdGenerator | import("effect-agent").RunEventSink | import("effect-agent").SubagentDurability>;
1230
- readonly list_review_units: Tool.Tool<"list_review_units", {
1231
- readonly parameters: typeof ListReviewUnitsQuery;
1232
- readonly success: typeof ReviewUnitPlan;
1233
- readonly failure: typeof PullRequestSourceFailure;
1234
- readonly failureMode: "error";
1235
- }, PullRequestSource>;
1236
- }>;
1237
- declare const FileReviewDelegationFailure: import("effect-agent").SubagentContainedFailure<Schema.Union<readonly [typeof FileReviewUnitFailed, typeof FileReviewWorkRejected]>>;
1238
- 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, {
1239
- readonly _tag: string;
1240
- readonly message?: string;
1241
- }, never>>;
1242
- 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, {
1243
- readonly _tag: string;
1244
- readonly message?: string;
1245
- }, 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>>;
1246
1221
  //#endregion
1247
- export { MAX_UNIT_EVIDENCE_SHARDS as $, ReviewInstructionOptions as $n, ReviewSelection as $t, MAX_REVIEW_CHILDREN as A, ChangedFilesView as An, isReviewableFile as Ar, RetirableReviewComment as At, fanOutReviewInstructions as B, ListChangedFilesQuery as Bn, ReviewCommentDraft as Bt, FileReviewer as C, ReviewPipelineAssessment as Cn, ChangedFileStatus as Cr, fingerprintUnchanged as Ct, MAX_CHILD_CONCERNS as D, collectUnitFileSummaries as Dn, annotatePatch as Dr, gitHubReviewRetirementHostLayer as Dt, ListReviewUnitsQuery as E, assessReviewPipeline as En, PatchLine as Er, gitHubReviewPublisherLayer as Et, ReviewWorkPhase as F, FileSlice as Fn, ReviewRetirementReport as Ft, makeFanOutReviewSuite as G, MAX_WALKTHROUGH_SUMMARY_CHARS as Gn, planWalkthrough as Gt, fileReviewPolicy as H, MAX_FINDINGS as Hn, ReviewPublicationPlan as Ht, defaultFanOutPolicy as I, FileSliceQuery as In, decideReviewRetirement as It, reviewCandidateSubjectKey as J, ReadFile as Jn, MAX_REVIEW_STATE_MARKER_CHARS as Jt, makeFileReviewerInstructions as K, PullRequestReviewer as Kn, renderAgentPrompt as Kt, defaultFileReviewerPolicy as L, FindingCategory as Ln, hasReviewMetadataMarker as Lt, ReviewCandidate as M, FileDiffQuery as Mn, renderReviewContent as Mr, ReviewRetirementFailure as Mt, ReviewCandidateId as N, FileDiffView as Nn, ReviewRetirementHost as Nt, MAX_CHILD_FINDINGS as O, anchorViolation as On, commentableLines as Or, parseGitHubSubmittedAt as Ot, ReviewWorkPerspective as P, FileReviewEvidenceChunk as Pn, ReviewRetirementInput as Pt, MAX_REVIEW_UNITS as Q, ReviewGuidance as Qn, ReviewScopeMode as Qt, fanOutHandlersLayer as R, FindingSeverity as Rn, retireStaleReviews as Rt, FileReviewWorkRejected as S, ReviewInputCoverage as Sn, ChangedFile as Sr, ReviewPublisher as St, ListReviewUnits as T, assessReviewCoverage as Tn, MAX_REVIEW_CONTENT_CHARS as Tr, gitHubPullRequestSourceLayer as Tt, fileReviewerInstructions as U, MAX_PATCH_CHARS as Un, estimateReviewEffort as Ut, fileReviewDelegation as V, MAX_CONCERNS as Vn, ReviewEvent as Vt, makeFanOutReviewInstructions as W, MAX_WALKTHROUGH_ENTRIES as Wn, planPublication as Wt, MAX_MERGED_FINDINGS as X, ReviewConcern as Xn, ReviewHeadComparison as Xt, MAX_FILE_EVIDENCE_CHARS as Y, ReadFileDiff as Yn, ReviewExecutionContext as Yt, MAX_REPORTED_UNASSIGNED_EVIDENCE_SHARDS as Z, ReviewFinding as Zn, ReviewMode as Zt, FileReviewRequest as _, webCryptoReviewStateAuthenticatorLayer as _n, PullRequestMetadata as _r, GitHubApiFailure as _t, FanOutCoordinatorToolkit as a, StoredReviewConcern as an, clampMaxFindings as ar, ReviewPassId as at, FileReviewUnitFailed as b, ReviewAssurance as bn, ReviewInputViolation as br, PriorReviews as bt, FanOutReviewSuite as c, computeProfileFingerprint as cn, fileReviewEvidenceChunks as cr, ReviewUnitId as ct, FanOutSuiteOptions as d, selectReviewRange as dn, readFileDiffHandler as dr, UNIT_EVIDENCE_CHAR_BUDGET as dt, ReviewState as en, ReviewMission as er, MAX_UNIT_FILES as et, FileReviewBrief as f, selectedPullRequestSourceLayer as fn, readFileHandler as fr, classifyReviewRisks as ft, FileReviewReport as g, validateReviewState as gn, MAX_FILE_CHARS as gr, DEFAULT_GITHUB_REVIEW_AUTHOR_LOGIN as gt, FileReviewFailure as h, unavailableReviewStateAuthenticatorLayer as hn, MAX_CHANGED_FILES as hr, rankAndDedupeFindings as ht, DiscoveredConcern as i, ReviewStateMarkerTooLarge as in, WalkthroughEntry as ir, ReviewEvidenceShardId as it, MAX_UNIT_CANDIDATES as j, CodeReview as jn, parsePatch as jr, ReviewRetirementDecision as jt, MAX_FILE_REVIEW_TOOL_CALLS as k, ChangedFileSummary as kn, hasReviewableContent as kr, RetirableReview as kt, FanOutReviewToolkit as l, fromStoredConcern as ln, listChangedFilesHandler as lr, ReviewUnitPlan as lt, FileReviewEvidence as m, toStoredFinding as mn, reviewInstructions as mr, planReviewUnits as mt, ConcernCandidate as n, ReviewStateAuthenticator as nn, ReviewToolkitLayer as nr, ReviewDiscoveryPerspective as nt, FanOutCoordinatorToolkitLayer as o, StoredReviewFinding as on, defaultReviewPolicy as or, ReviewRiskCategory as ot, FileReviewDelegationFailure as p, toStoredConcern as pn, resolveGuidance as pr, findingAnchorInUnitEvidence as pt, mapFileReviewChildFailure as q, REVIEW_TOOL_RESULT_MAX_BYTES as qn, GitCommitSha as qt, DelegateFileReview as r, ReviewStateMarker as rn, ReviewVerdict as rr, ReviewEvidenceShard as rt, FanOutInstructionOptions as s, buildProfileMission as sn, fileDiffView as sr, ReviewUnit as st, CandidateAssessment as t, ReviewStateAuthenticationFailure as tn, ReviewToolkit as tr, ReviewDiscoveryPass as tt, FanOutReviewer as u, fromStoredFinding as un, makeReviewInstructions as ur, UNIT_CHANGED_LINE_BUDGET as ut, FileReviewToolkit as v, FailedReviewPass as vn, PullRequestSource as vr, GitHubReviewTarget as vt, FindingCandidate as w, ReviewShape as wn, ChangedPath as wr, gitHubPriorReviewsLayer as wt, FileReviewUnitResult as x, ReviewCoverage as xn, normalizeRepoRelativePath as xr, PublishedReview as xt, FileReviewToolkitLayer as y, FailedReviewUnit as yn, PullRequestSourceFailure as yr, PriorReviewLookupFailure as yt, fanOutHandlersLayerFor as z, ListChangedFiles as zn, AGENT_PROMPT_PREAMBLE as zt };
1248
- //# sourceMappingURL=fan-out-D5xrmadQ.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