@effect-agent/pr-review 0.1.0-beta.28 → 0.1.0-beta.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -204
- package/dist/index.d.mts +87 -914
- package/dist/index.mjs +163 -71
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -18
- package/src/index.ts +1 -25
- package/src/review.ts +212 -0
- package/dist/action.d.mts +0 -215
- package/dist/action.mjs +0 -505
- package/dist/action.mjs.map +0 -1
- package/dist/cli.d.mts +0 -1
- package/dist/cli.mjs +0 -106
- package/dist/cli.mjs.map +0 -1
- package/dist/fan-out-C3yG1cx3.d.mts +0 -1526
- package/dist/github-CCuLgyqb.mjs +0 -3437
- package/dist/github-CCuLgyqb.mjs.map +0 -1
- package/dist/logging-Q4j0oub-.mjs +0 -75
- package/dist/logging-Q4j0oub-.mjs.map +0 -1
- package/dist/providers-Br9FRn7j.mjs +0 -1349
- package/dist/providers-Br9FRn7j.mjs.map +0 -1
- package/dist/testing.d.mts +0 -86
- package/dist/testing.mjs +0 -184
- package/dist/testing.mjs.map +0 -1
- package/src/action.ts +0 -906
- package/src/cli.ts +0 -235
- package/src/internal/action-entry.ts +0 -45
- package/src/internal/adjudication.ts +0 -415
- package/src/internal/anchors.ts +0 -20
- package/src/internal/coverage.ts +0 -357
- package/src/internal/diff.ts +0 -193
- package/src/internal/effort.ts +0 -86
- package/src/internal/factory.ts +0 -357
- package/src/internal/fan-out-scripted.ts +0 -77
- package/src/internal/fan-out.ts +0 -1148
- package/src/internal/fingerprint.ts +0 -89
- package/src/internal/fixtures.ts +0 -148
- package/src/internal/github-env.ts +0 -164
- package/src/internal/github.ts +0 -1218
- package/src/internal/ignore.ts +0 -88
- package/src/internal/logging.ts +0 -124
- package/src/internal/profiles.ts +0 -91
- package/src/internal/progress.ts +0 -433
- package/src/internal/providers.ts +0 -133
- package/src/internal/render.ts +0 -819
- package/src/internal/retirement.ts +0 -337
- package/src/internal/review-agent.ts +0 -543
- package/src/internal/review-state.ts +0 -782
- package/src/internal/review-units.ts +0 -493
- package/src/internal/run.ts +0 -611
- package/src/internal/scripted.ts +0 -108
- package/src/internal/source.ts +0 -110
- package/src/testing.ts +0 -8
package/dist/action.d.mts
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { Hr as ChangedFile, L as PriorReviews, Lr as PullRequestMetadata, P as GitHubApiFailure, Q as ReviewRetirementHost, Qt as ReviewAdjudicationHost, Rr as PullRequestSource, _n as ReviewExecutionContext, wn as ReviewStateAuthenticator, yn as ReviewMode, z as ReviewPublisher, zr as PullRequestSourceFailure } from "./fan-out-C3yG1cx3.mjs";
|
|
2
|
-
import { EffortPosition, InvalidEffortInput, OpenAiServiceTier, ReviewProgressReporter, ReviewProvider, ReviewRunOutcome, ReviewTargetUnresolved, RunReviewOptions, UnsupportedServiceTierProvider } from "./index.mjs";
|
|
3
|
-
import { Config, Effect, FileSystem, Schema } from "effect";
|
|
4
|
-
import { BudgetExceeded } from "effect-agent";
|
|
5
|
-
//#region src/action.d.ts
|
|
6
|
-
declare const ReviewCheckConclusion: Schema.Literals<readonly ["success", "blocking", "incomplete"]>;
|
|
7
|
-
type ReviewCheckConclusion = typeof ReviewCheckConclusion.Type;
|
|
8
|
-
declare const ReviewGateFailed_base: Schema.Class<ReviewGateFailed, Schema.TaggedStruct<"ReviewGateFailed", {
|
|
9
|
-
readonly conclusion: Schema.Literals<readonly ["blocking", "incomplete"]>;
|
|
10
|
-
readonly reasons: Schema.$Array<Schema.NonEmptyString>;
|
|
11
|
-
}>, import("effect/Cause").YieldableError>;
|
|
12
|
-
/** The host-derived blocking or incomplete conclusion failed the check. */
|
|
13
|
-
declare class ReviewGateFailed extends ReviewGateFailed_base {
|
|
14
|
-
get message(): string;
|
|
15
|
-
}
|
|
16
|
-
declare const InvalidMaxDurationInput_base: Schema.Class<InvalidMaxDurationInput, Schema.TaggedStruct<"InvalidMaxDurationInput", {
|
|
17
|
-
readonly minutes: Schema.Int;
|
|
18
|
-
}>, import("effect/Cause").YieldableError>;
|
|
19
|
-
/** A configured max-duration that cannot bound a run; configuration faults fail loudly. */
|
|
20
|
-
declare class InvalidMaxDurationInput extends InvalidMaxDurationInput_base {
|
|
21
|
-
get message(): string;
|
|
22
|
-
}
|
|
23
|
-
/** Everything the packaged action reads from its environment. */
|
|
24
|
-
interface ResolvedActionInputs {
|
|
25
|
-
readonly provider: ReviewProvider;
|
|
26
|
-
readonly model: string | undefined;
|
|
27
|
-
readonly effort: EffortPosition | undefined;
|
|
28
|
-
readonly serviceTier: OpenAiServiceTier | undefined;
|
|
29
|
-
readonly post: boolean;
|
|
30
|
-
readonly applyVerdict: boolean;
|
|
31
|
-
readonly fanOut: boolean;
|
|
32
|
-
readonly guidance: string | undefined;
|
|
33
|
-
readonly guidanceFile: string | undefined;
|
|
34
|
-
readonly ignore: ReadonlyArray<string>;
|
|
35
|
-
readonly maxFindings: number | undefined;
|
|
36
|
-
readonly maxDurationMinutes: number | undefined;
|
|
37
|
-
readonly reviewMode: ReviewMode;
|
|
38
|
-
readonly skipUnchanged: boolean;
|
|
39
|
-
readonly retireStaleReviews: boolean;
|
|
40
|
-
readonly progressComment: boolean;
|
|
41
|
-
}
|
|
42
|
-
/** Read the PR_REVIEW_* input surface (all optional, all defaulted). */
|
|
43
|
-
declare const resolveActionInputs: () => Effect.Effect<{
|
|
44
|
-
provider: "anthropic" | "openai";
|
|
45
|
-
model: string | undefined;
|
|
46
|
-
effort: number | undefined;
|
|
47
|
-
serviceTier: "fast" | undefined;
|
|
48
|
-
post: boolean;
|
|
49
|
-
applyVerdict: boolean;
|
|
50
|
-
fanOut: boolean;
|
|
51
|
-
guidance: string | undefined;
|
|
52
|
-
guidanceFile: string | undefined;
|
|
53
|
-
ignore: string[];
|
|
54
|
-
maxFindings: number | undefined;
|
|
55
|
-
maxDurationMinutes: number | undefined;
|
|
56
|
-
reviewMode: "final" | "incremental";
|
|
57
|
-
skipUnchanged: boolean;
|
|
58
|
-
retireStaleReviews: boolean;
|
|
59
|
-
progressComment: boolean;
|
|
60
|
-
}, Config.ConfigError | InvalidEffortInput | InvalidMaxDurationInput | UnsupportedServiceTierProvider, never>;
|
|
61
|
-
/** A guidance file larger than this is refused, never silently truncated. */
|
|
62
|
-
declare const MAX_GUIDANCE_FILE_CHARS = 20000;
|
|
63
|
-
declare const GuidanceFileUnreadable_base: Schema.Class<GuidanceFileUnreadable, Schema.TaggedStruct<"GuidanceFileUnreadable", {
|
|
64
|
-
readonly path: Schema.String;
|
|
65
|
-
readonly reason: Schema.String;
|
|
66
|
-
}>, import("effect/Cause").YieldableError>;
|
|
67
|
-
/** A configured guidance file could not be used; configuration faults fail loudly. */
|
|
68
|
-
declare class GuidanceFileUnreadable extends GuidanceFileUnreadable_base {
|
|
69
|
-
get message(): string;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Resolve the effective review guidance: the committed guidance file (a
|
|
73
|
-
* repository-owned review profile) first, with any inline guidance appended.
|
|
74
|
-
* A configured-but-unreadable file fails typed — a review silently running
|
|
75
|
-
* without its profile would be worse than a red job.
|
|
76
|
-
*/
|
|
77
|
-
declare const resolveGuidance: (inputs: {
|
|
78
|
-
readonly guidance: string | undefined;
|
|
79
|
-
readonly guidanceFile: string | undefined;
|
|
80
|
-
}) => Effect.Effect<string | undefined, GuidanceFileUnreadable, FileSystem.FileSystem>;
|
|
81
|
-
/** Append step outputs to GITHUB_OUTPUT when present (no-op locally). */
|
|
82
|
-
declare const writeActionOutputs: (entries: readonly (readonly [name: string, value: string])[]) => Effect.Effect<void, Config.ConfigError | import("effect/PlatformError").PlatformError, FileSystem.FileSystem>;
|
|
83
|
-
/** Append markdown to the GITHUB_STEP_SUMMARY report when present (no-op locally). */
|
|
84
|
-
declare const writeStepSummary: (lines: readonly string[]) => Effect.Effect<void, Config.ConfigError | import("effect/PlatformError").PlatformError, FileSystem.FileSystem>;
|
|
85
|
-
/** The result of one action invocation: a typed skip or a settled review. */
|
|
86
|
-
type ReviewActionResult = {
|
|
87
|
-
readonly _tag: "Skipped";
|
|
88
|
-
readonly reason: string;
|
|
89
|
-
} | {
|
|
90
|
-
readonly _tag: "Completed";
|
|
91
|
-
readonly outcome: ReviewRunOutcome;
|
|
92
|
-
};
|
|
93
|
-
/**
|
|
94
|
-
* The reviewer surface the action harness drives. `PrReview.make` and
|
|
95
|
-
* `PrReview.makeFanOut` provide the state-selection effects. A fingerprint is
|
|
96
|
-
* skip authority only when a profile fingerprint and authenticated review
|
|
97
|
-
* state bind it to settled assurance.
|
|
98
|
-
*/
|
|
99
|
-
interface HarnessedReviewerBase<E, R> {
|
|
100
|
-
/** The action composition root always supplies the selected run context. */
|
|
101
|
-
readonly run: (runOptions?: RunReviewOptions) => Effect.Effect<ReviewRunOutcome, E, R | ReviewExecutionContext>;
|
|
102
|
-
}
|
|
103
|
-
type HarnessedReviewer<E, R, FingerprintE, FingerprintR> = HarnessedReviewerBase<E, R> & ({
|
|
104
|
-
readonly fingerprint?: undefined;
|
|
105
|
-
readonly profileFingerprint?: undefined;
|
|
106
|
-
readonly snapshot?: undefined;
|
|
107
|
-
readonly filterFiles?: undefined;
|
|
108
|
-
} | {
|
|
109
|
-
/** Current effective changeset fingerprint; not standalone skip authority. */
|
|
110
|
-
readonly fingerprint: Effect.Effect<string, FingerprintE, FingerprintR>;
|
|
111
|
-
readonly profileFingerprint: Effect.Effect<string, FingerprintE, FingerprintR>;
|
|
112
|
-
readonly snapshot: Effect.Effect<{
|
|
113
|
-
readonly metadata: PullRequestMetadata;
|
|
114
|
-
readonly files: ReadonlyArray<ChangedFile>;
|
|
115
|
-
}, FingerprintE, FingerprintR>;
|
|
116
|
-
readonly filterFiles?: ((files: ReadonlyArray<ChangedFile>) => ReadonlyArray<ChangedFile>) | undefined;
|
|
117
|
-
});
|
|
118
|
-
/**
|
|
119
|
-
* Host-derived check conclusion; model verdict prose cannot weaken it.
|
|
120
|
-
*
|
|
121
|
-
* Blocking code findings outrank machinery gaps — they are the actionable
|
|
122
|
-
* signal. A retryable machinery gap (failed passes, capacity overflow)
|
|
123
|
-
* concludes `incomplete` with reasons that explicitly say the failure is
|
|
124
|
-
* reviewer-side uncertainty carried forward for retry, never an invitation to
|
|
125
|
-
* change code. Undiffable files are the deliberate exception: no retry can
|
|
126
|
-
* settle them, so their reason instructs removal or ignore globs instead of
|
|
127
|
-
* promising an automatic retry. The flat reviewer's constant `unverified`
|
|
128
|
-
* assurance is not a gap.
|
|
129
|
-
*/
|
|
130
|
-
declare const concludeReviewOutcome: (outcome: ReviewRunOutcome) => {
|
|
131
|
-
readonly conclusion: ReviewCheckConclusion;
|
|
132
|
-
readonly reasons: ReadonlyArray<string>;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Harness one already-built reviewer inside the Actions environment: resolve
|
|
136
|
-
* the target from the event, provide the GitHub source/publisher/prior
|
|
137
|
-
* reviews, validate/select bounded continuity scope, write step outputs, and apply
|
|
138
|
-
* the host-derived coverage/blocker gate. Draft and non-PR skips are values;
|
|
139
|
-
* an unchanged reviewed head preserves and enforces its stored conclusion. The reviewer's
|
|
140
|
-
* remaining requirements — its model client, any extra tool handlers — stay
|
|
141
|
-
* visible in `R` for the caller.
|
|
142
|
-
*/
|
|
143
|
-
declare const runReviewAction: <E, R, FingerprintE = never, FingerprintR = never>(reviewer: HarnessedReviewer<E, R, FingerprintE, FingerprintR>, options?: {
|
|
144
|
-
readonly post?: boolean | undefined;
|
|
145
|
-
/** Skip model execution when the current head already has complete stored coverage. */
|
|
146
|
-
readonly skipUnchanged?: boolean | undefined;
|
|
147
|
-
/** Incremental by default; `final` deliberately re-reviews the full PR diff. */
|
|
148
|
-
readonly reviewMode?: ReviewMode | undefined;
|
|
149
|
-
/** Model binding descriptor for the Actions step summary. */
|
|
150
|
-
readonly modelLabel?: string | undefined;
|
|
151
|
-
/** Explicit test/custom-host history override; GitHub owns the default adapter. */
|
|
152
|
-
readonly priorReviews?: PriorReviews["Service"] | undefined;
|
|
153
|
-
/** Retire marker-bearing prior reviews after a successful post (default true). */
|
|
154
|
-
readonly retireStaleReviews?: boolean | undefined;
|
|
155
|
-
/**
|
|
156
|
-
* Maintain one sticky "review in progress" issue comment, updated in
|
|
157
|
-
* place when the run settles. Default false here for custom-harness
|
|
158
|
-
* compatibility; the packaged action enables it by default. Dry runs
|
|
159
|
-
* (`post: false`) never post progress.
|
|
160
|
-
*/
|
|
161
|
-
readonly progressComment?: boolean | undefined;
|
|
162
|
-
}) => Effect.Effect<{
|
|
163
|
-
_tag: "Skipped";
|
|
164
|
-
reason: string;
|
|
165
|
-
} | {
|
|
166
|
-
_tag: "Completed";
|
|
167
|
-
outcome: ReviewRunOutcome;
|
|
168
|
-
}, E | FingerprintE | Config.ConfigError | import("effect/PlatformError").PlatformError | PullRequestSourceFailure | ReviewGateFailed | ReviewTargetUnresolved, FileSystem.FileSystem | import("effect/unstable/http/HttpClient").HttpClient | ReviewStateAuthenticator | Exclude<FingerprintR, PriorReviews | PullRequestSource | ReviewAdjudicationHost | ReviewProgressReporter | ReviewPublisher | ReviewRetirementHost> | Exclude<Exclude<R, PullRequestSource | ReviewExecutionContext>, PriorReviews | PullRequestSource | ReviewAdjudicationHost | ReviewProgressReporter | ReviewPublisher | ReviewRetirementHost>>;
|
|
169
|
-
/**
|
|
170
|
-
* The packaged, environment-driven action program: inputs from PR_REVIEW_*,
|
|
171
|
-
* reviewer built from the packaged factory, provider client from the
|
|
172
|
-
* matching credential environment variable.
|
|
173
|
-
*/
|
|
174
|
-
declare const reviewActionProgram: Effect.Effect<{
|
|
175
|
-
_tag: "Skipped";
|
|
176
|
-
reason: string;
|
|
177
|
-
} | {
|
|
178
|
-
_tag: "Completed";
|
|
179
|
-
outcome: ReviewRunOutcome;
|
|
180
|
-
}, import("effect-agent").AgentApprovalDenied | import("effect-agent").AgentApprovalPending | import("effect-agent").AgentChildPending | import("effect-agent").AgentInputError | import("effect-agent").AgentOutputError | import("effect-agent").AgentPolicyError | import("effect-agent").AgentToolAuthorizationDenied | import("effect/unstable/ai/AiError").AiError | import("effect-agent").BudgetAdapterError | BudgetExceeded | Config.ConfigError | import("effect-agent").ContextBudgetError | import("effect-agent").ContextOverflowError | GitHubApiFailure | GuidanceFileUnreadable | InvalidEffortInput | InvalidMaxDurationInput | import("effect-agent").ModelProtocolError | import("effect/PlatformError").PlatformError | PullRequestSourceFailure | ReviewGateFailed | ReviewTargetUnresolved | Schema.SchemaError | UnsupportedServiceTierProvider, import("effect/Crypto").Crypto | FileSystem.FileSystem | import("effect/unstable/http/HttpClient").HttpClient>;
|
|
181
|
-
/** Run the packaged action program on Node; the bundled action entrypoint. */
|
|
182
|
-
declare const main: () => void;
|
|
183
|
-
/** The packaged GitHub Actions surface. */
|
|
184
|
-
declare const PrReviewAction: {
|
|
185
|
-
readonly inputs: () => Effect.Effect<{
|
|
186
|
-
provider: "anthropic" | "openai";
|
|
187
|
-
model: string | undefined;
|
|
188
|
-
effort: number | undefined;
|
|
189
|
-
serviceTier: "fast" | undefined;
|
|
190
|
-
post: boolean;
|
|
191
|
-
applyVerdict: boolean;
|
|
192
|
-
fanOut: boolean;
|
|
193
|
-
guidance: string | undefined;
|
|
194
|
-
guidanceFile: string | undefined;
|
|
195
|
-
ignore: string[];
|
|
196
|
-
maxFindings: number | undefined;
|
|
197
|
-
maxDurationMinutes: number | undefined;
|
|
198
|
-
reviewMode: "final" | "incremental";
|
|
199
|
-
skipUnchanged: boolean;
|
|
200
|
-
retireStaleReviews: boolean;
|
|
201
|
-
progressComment: boolean;
|
|
202
|
-
}, Config.ConfigError | InvalidEffortInput | InvalidMaxDurationInput | UnsupportedServiceTierProvider, never>;
|
|
203
|
-
readonly run: typeof runReviewAction;
|
|
204
|
-
readonly program: Effect.Effect<{
|
|
205
|
-
_tag: "Skipped";
|
|
206
|
-
reason: string;
|
|
207
|
-
} | {
|
|
208
|
-
_tag: "Completed";
|
|
209
|
-
outcome: ReviewRunOutcome;
|
|
210
|
-
}, import("effect-agent").AgentApprovalDenied | import("effect-agent").AgentApprovalPending | import("effect-agent").AgentChildPending | import("effect-agent").AgentInputError | import("effect-agent").AgentOutputError | import("effect-agent").AgentPolicyError | import("effect-agent").AgentToolAuthorizationDenied | import("effect/unstable/ai/AiError").AiError | import("effect-agent").BudgetAdapterError | BudgetExceeded | Config.ConfigError | import("effect-agent").ContextBudgetError | import("effect-agent").ContextOverflowError | GitHubApiFailure | GuidanceFileUnreadable | InvalidEffortInput | InvalidMaxDurationInput | import("effect-agent").ModelProtocolError | import("effect/PlatformError").PlatformError | PullRequestSourceFailure | ReviewGateFailed | ReviewTargetUnresolved | Schema.SchemaError | UnsupportedServiceTierProvider, import("effect/Crypto").Crypto | FileSystem.FileSystem | import("effect/unstable/http/HttpClient").HttpClient>;
|
|
211
|
-
readonly main: typeof main;
|
|
212
|
-
};
|
|
213
|
-
//#endregion
|
|
214
|
-
export { GuidanceFileUnreadable, HarnessedReviewer, InvalidMaxDurationInput, MAX_GUIDANCE_FILE_CHARS, PrReviewAction, ResolvedActionInputs, ReviewActionResult, ReviewCheckConclusion, ReviewGateFailed, concludeReviewOutcome, main, resolveActionInputs, resolveGuidance, reviewActionProgram, runReviewAction, writeActionOutputs, writeStepSummary };
|
|
215
|
-
//# sourceMappingURL=action.d.mts.map
|