@gaunt-sloth/review 2.0.0-beta.12 → 2.0.0-beta.14

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 CHANGED
@@ -73,7 +73,9 @@ by default, so anything posting this output identifies its reviewer without addi
73
73
  own; `output.header: "none"` on the config you pass to `review()` is the one setting that removes
74
74
  it, for a caller piping the review into a template of their own. With rating enabled, `review()`
75
75
  sets `process.exitCode = 1` when the rating comes back below `passThreshold` (or when the model
76
- fails to produce a rating), so the script exits non-zero exactly when `gth review` would. Those
76
+ fails to produce a rating); a run that fails inside the agent — a provider error, a context
77
+ overflow — sets it whatever the rating settings say, because there is no verdict to configure. So
78
+ the script exits non-zero exactly when `gth review` would. Those
77
79
  two — the attributed text on stdout and the exit code — are the whole embed contract.
78
80
  Configuration (provider, prompts, rating thresholds) is the standard Gaunt Sloth config, see
79
81
  [the configuration guide](https://github.com/pukeko-robotics/gaunt-sloth/blob/main/docs/configuration/index.md).
package/cli.js CHANGED
@@ -24,6 +24,7 @@ setEntryPoint(import.meta.url);
24
24
 
25
25
  import { initConfig } from '@gaunt-sloth/core/config.js';
26
26
  import { review } from '#src/modules/reviewModule.js';
27
+ import { writeReviewFailureReport } from '#src/modules/reviewFailureReport.js';
27
28
  import { displayError } from '@gaunt-sloth/core/utils/consoleUtils.js';
28
29
  import {
29
30
  getContentFromSource,
@@ -32,14 +33,31 @@ import {
32
33
  resolvePrIdFromArg,
33
34
  } from '#src/commands/commandUtils.js';
34
35
 
36
+ /** The source label this bin passes to `review()`, and therefore names its report file with. */
37
+ const REVIEW_SOURCE = 'pr-review';
38
+
35
39
  async function main() {
40
+ // REL-20 — the run is in two phases with two catches, because only the first one owes a report.
41
+ //
42
+ // Everything up to `review()` happens before the report file exists, so a failure there is the
43
+ // one that leaves a workflow reading `review.md` with nothing to read; it writes the report
44
+ // itself. Once `review()` is running the file is already open and captures its own failures, so
45
+ // the second catch stays as it was — writing a report over that one would replace a review that
46
+ // got part-way with a bare error.
47
+ //
48
+ // `gth pr` / `gth review` keep the same promise through the same helper. A second copy of the
49
+ // report-writing here is how the two entry points would drift apart.
50
+ let config;
51
+ let diffWithReqs;
52
+ let contentArg;
53
+ let preambleText;
36
54
  try {
37
- const config = await initConfig({
55
+ config = await initConfig({
38
56
  identityProfile: process.env.GSLOTH_IDENTITY_PROFILE,
39
57
  });
40
58
 
41
59
  // First arg is content (e.g. PR number), rest are requirements
42
- const contentArg = args[0];
60
+ contentArg = args[0];
43
61
  const requirementArgs = args.slice(1);
44
62
 
45
63
  // Get content (e.g. PR diff)
@@ -57,18 +75,26 @@ async function main() {
57
75
  }
58
76
  }
59
77
 
60
- // Build the review preamble (backstory + guidelines + review instructions + optional
61
- // system prompt), the same composition `gth review` / `gth pr` use.
62
- const preambleText = getReviewPreamble(config);
63
-
64
78
  // Combine requirements and content for the review
65
- const diffWithReqs = requirements
66
- ? `Requirements:\n${requirements}\nDiff:\n${content}`
67
- : content;
79
+ diffWithReqs = requirements ? `Requirements:\n${requirements}\nDiff:\n${content}` : content;
80
+
81
+ // Build the review preamble (backstory + guidelines + review instructions + optional
82
+ // system prompt), the same composition `gth review` / `gth pr` use. In this phase because it
83
+ // reads files off disk and can fail, and a failure there is still a run that never reached the
84
+ // agent.
85
+ preambleText = getReviewPreamble(config);
86
+ } catch (error) {
87
+ displayError(error instanceof Error ? error.message : String(error));
88
+ // `config` is undefined when `initConfig` itself threw; the helper knows there is no path to
89
+ // write to in that case and does nothing.
90
+ writeReviewFailureReport(config, REVIEW_SOURCE, 'pr', error);
91
+ process.exit(1);
92
+ }
68
93
 
94
+ try {
69
95
  // Pass the PR id on so GitHub-only tools address the PR explicitly instead of trying to
70
96
  // resolve it from the checked-out branch, which a CI runner's detached HEAD cannot provide.
71
- await review('pr-review', preambleText, diffWithReqs, config, 'pr', undefined, {
97
+ await review(REVIEW_SOURCE, preambleText, diffWithReqs, config, 'pr', undefined, {
72
98
  prId: resolvePrIdFromArg(contentArg),
73
99
  });
74
100
  } catch (error) {
@@ -46,6 +46,38 @@ const REVIEW_RATE_TOOL_NAME = 'gth_review_rate';
46
46
  * Override per command with `commands.<review|pr>.rating.timeoutMs`.
47
47
  */
48
48
  export const DEFAULT_REVIEW_RATE_TIMEOUT_MS = 120_000;
49
+ // [[EXT-183]] — the review GENERATION has no budget of its own. That is a decision deferred on a
50
+ // named measurement, not an oversight, and the asymmetry with the cap above is deliberate.
51
+ //
52
+ // The budget above bounds the rating call only. The generation that runs before it is bounded by
53
+ // nothing: its runnable config carries a recursion limit and a thread id, the agent adds only
54
+ // `streamFromInput`'s Esc `AbortController`, and gth sets no call timeout on any provider. Nor is a
55
+ // runaway there rare — across the recorded gate windows the runaways split about evenly between the
56
+ // two calls, and in the most recent one all three of them were generation.
57
+ //
58
+ // WHY NO NUMBER WAS CHOSEN. The seam exists: `wrapModelCall` wraps each model call individually, so
59
+ // a budget could bound ONE call without capping a legitimate many-turn review, and a value in the
60
+ // 120-240 s band would sit below the integration suite's 300 s per-test ceiling while clearing every
61
+ // healthy call measured here by a wide margin. What is missing is the measurement that would set it.
62
+ // Every healthy sample is a sub-kilobyte fixture reviewed by a local `gemma4:12b` at ~31.5 tokens a
63
+ // second, and none is the case a default has to survive: one call, a real diff, a remote provider,
64
+ // thinking enabled. Wall clock does not carry across providers — the same number is a few thousand
65
+ // tokens locally and something else entirely on a fast model with a large thinking budget — and
66
+ // GS2-105 could pick 120 s only because it had a healthy baseline for the call it was bounding.
67
+ // Truncating a real review is the failure a review tool can least afford, so the number waits for
68
+ // its measurement: legitimate single-call durations for `review` and `pr` across the providers
69
+ // people actually run, at real diff sizes.
70
+ //
71
+ // WHY THE GAP IS TOLERABLE MEANWHILE. What makes an unbounded RATING call the failure GS2-105 exists
72
+ // to prevent is that it renders NOTHING while it runs — a finished review followed by an unexplained
73
+ // pause. The generation is the opposite: it streams token by token (`streamOutput` defaults true),
74
+ // so a user watching it can see what it is doing and judge when it has gone wrong, and on a TTY
75
+ // `streamFromInput` has Esc armed to stop it.
76
+ //
77
+ // Two cases that reasoning does not cover, neither of them claimed harmless: `streamOutput: false`,
78
+ // whose non-streaming `invoke` path arms no Esc at all and so IS the silent shape described above;
79
+ // and any caller whose stdin is not a TTY — CI, a piped diff, the batch pipeline — where Esc is off
80
+ // by construction.
49
81
  export function createReviewRateMiddleware(settings, gthConfig) {
50
82
  const normalizedConfig = normalizeRatingConfig(settings);
51
83
  const rateTool = tool((input) => {
@@ -1 +1 @@
1
- {"version":3,"file":"reviewRateMiddleware.js","sourceRoot":"","sources":["../../src/middleware/reviewRateMiddleware.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAwB,MAAM,WAAW,CAAC;AACnE,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAE3E;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,4BAA4B,CAAC;IACtE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;CAC9D,CAAC,CAAC;AAaH,MAAM,CAAC,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE7D,MAAM,kBAA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,CAAC;IAC9D,MAAM,IAAI,GAAI,KAA4B,CAAC,IAAI,CAAC;IAChD,OAAO,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,cAAc,CAAC;AAC1D,CAAC;AAED,SAAS,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { GthConfig } from '@gaunt-sloth/core/config.js';
2
+ /**
3
+ * The one line that tells a reader of the report why there is no verdict under the heading.
4
+ *
5
+ * Exported so the specs assert on the same string production writes, rather than on a copy of it
6
+ * that can drift out of agreement without anything going red.
7
+ */
8
+ export declare const REVIEW_DID_NOT_RUN = "This review did not run. The error that stopped it follows; there is no verdict below it.";
9
+ /**
10
+ * Write the promised report for a run that ended before the agent was reached.
11
+ *
12
+ * Call it from every exit that fails a `review`/`pr` run before `review()` is invoked, passing the
13
+ * SAME source label that call would have used (`PR-42`, `PR-discovery`, `REVIEW`, `pr-review`) so
14
+ * the file lands where the successful run would have put it — the label picks the generated file
15
+ * name when `writeOutputToFile` is `true`.
16
+ *
17
+ * A no-op when the config asks for no file, so the default stdout-only run is untouched. It never
18
+ * throws: it runs inside a catch, and a report that cannot be written must not replace the error
19
+ * the caller is already reporting.
20
+ *
21
+ * @param config - The resolved config, or `undefined` when the run failed before config loaded
22
+ * (nothing can be written then — the path is a config field).
23
+ * @param source - The source label the successful run would have passed to `review()`.
24
+ * @param command - `review` or `pr`; names the command in the heading.
25
+ * @param error - The failure, as an `Error` or as text already rendered for the terminal.
26
+ * @returns The path written, or `null` when no report was asked for or the write failed.
27
+ */
28
+ export declare function writeReviewFailureReport(config: GthConfig | undefined, source: string, command: 'pr' | 'review', error: unknown): string | null;
@@ -0,0 +1,125 @@
1
+ /**
2
+ * REL-20 — the report a review still owes its caller when the run ends before the agent.
3
+ *
4
+ * `writeOutputToFile` is a promise about a path: a workflow reads the file back and posts it. That
5
+ * promise was kept only by runs that reached inference, because the file is created inside
6
+ * `review()` and every content-fetch failure returns before it. A PR over GitHub's 300-file diff
7
+ * limit therefore ended as `ENOENT: no such file or directory, open 'review.md'` in the *next* CI
8
+ * step — a crash about a missing file, several steps away from the HTTP 406 that caused it.
9
+ *
10
+ * So a failed run writes the report too: the same heading a successful review opens with, one line
11
+ * saying the review did not run, and the error exactly as the source produced it. The exit code
12
+ * does not change — the run still failed — but what the workflow posts now names the failure
13
+ * instead of dying on its absence.
14
+ *
15
+ * ## Why a shared helper rather than opening the report before the fetch
16
+ *
17
+ * Both were open (the file name is known before the fetch), and opening early was measured and
18
+ * rejected. The report file is a capture of console output, so opening it before the fetch puts
19
+ * everything the fetch prints into every SUCCESSFUL review: `fileSource` alone emits
20
+ * `Reading file …` through `display`, and the requirement sources, the discovery agent and the
21
+ * scoped-prompt warnings all write through the same channel. That is a visible change to the
22
+ * document every existing user already reads, paid on every run, to fix the runs that fail.
23
+ *
24
+ * A helper called from each failing exit costs one line per exit and cannot touch the success path
25
+ * at all — the success path never calls it.
26
+ *
27
+ * ## Why it writes synchronously, and why it truncates
28
+ *
29
+ * The session log is a `WriteStream`, and `stopSessionLogging()` ends it asynchronously. One of the
30
+ * two callers here — the `gaunt-sloth-review` bin — follows its failure with `process.exit(1)`,
31
+ * which tears the process down without waiting for a pending flush, so a report written through the
32
+ * stream could simply not exist. A single `writeFileSync` has completed by the time it returns.
33
+ *
34
+ * It truncates where the session log appends. Appending would leave CI posting the previous run's
35
+ * verdict with a failure notice stapled underneath it, which reads as a review that happened.
36
+ *
37
+ * @module
38
+ */
39
+ import { writeFileSync } from 'node:fs';
40
+ import { displayDebug, displayError } from '@gaunt-sloth/core/utils/consoleUtils.js';
41
+ import { reviewHeadingBlock } from '#src/modules/reviewHeading.js';
42
+ import { getCommandOutputFilePath } from '#src/utils/fileUtils.js';
43
+ /**
44
+ * The one line that tells a reader of the report why there is no verdict under the heading.
45
+ *
46
+ * Exported so the specs assert on the same string production writes, rather than on a copy of it
47
+ * that can drift out of agreement without anything going red.
48
+ */
49
+ export const REVIEW_DID_NOT_RUN = 'This review did not run. The error that stopped it follows; there is no verdict below it.';
50
+ /**
51
+ * Write the promised report for a run that ended before the agent was reached.
52
+ *
53
+ * Call it from every exit that fails a `review`/`pr` run before `review()` is invoked, passing the
54
+ * SAME source label that call would have used (`PR-42`, `PR-discovery`, `REVIEW`, `pr-review`) so
55
+ * the file lands where the successful run would have put it — the label picks the generated file
56
+ * name when `writeOutputToFile` is `true`.
57
+ *
58
+ * A no-op when the config asks for no file, so the default stdout-only run is untouched. It never
59
+ * throws: it runs inside a catch, and a report that cannot be written must not replace the error
60
+ * the caller is already reporting.
61
+ *
62
+ * @param config - The resolved config, or `undefined` when the run failed before config loaded
63
+ * (nothing can be written then — the path is a config field).
64
+ * @param source - The source label the successful run would have passed to `review()`.
65
+ * @param command - `review` or `pr`; names the command in the heading.
66
+ * @param error - The failure, as an `Error` or as text already rendered for the terminal.
67
+ * @returns The path written, or `null` when no report was asked for or the write failed.
68
+ */
69
+ export function writeReviewFailureReport(config, source, command, error) {
70
+ if (!config) {
71
+ return null;
72
+ }
73
+ const filePath = getCommandOutputFilePath(config, source);
74
+ if (!filePath) {
75
+ return null;
76
+ }
77
+ // The same gate the successful report is under: `review()` opens the file with
78
+ // `initSessionLogging(filePath, config.streamSessionInferenceLog)`, which writes nothing at all
79
+ // when that flag is off. A failure report appearing for a user whose successful runs write none
80
+ // would be a second, contradictory answer to "does this config produce a file".
81
+ if (!config.streamSessionInferenceLog) {
82
+ return null;
83
+ }
84
+ const body = `${REVIEW_DID_NOT_RUN}\n\n${errorText(error)}\n`;
85
+ // GS2-93 — `output.header: 'none'` silences the heading here exactly as it does in `review()`. A
86
+ // caller who turned it off to get a byte-clean stream did not ask for a clean stream only on the
87
+ // days the review succeeds.
88
+ //
89
+ // The trailing blank line matches what the success path produces: `display()` appends a newline
90
+ // to a heading block that already ends in one, so a report opens with the heading, a blank line,
91
+ // and then its content.
92
+ const report = config.output?.header === 'none'
93
+ ? body
94
+ : `${reviewHeadingBlock(command, config.modelDisplayName, config.modelProviderType)}\n${body}`;
95
+ try {
96
+ writeFileSync(filePath, stripAnsi(report), { encoding: 'utf8' });
97
+ return filePath;
98
+ }
99
+ catch (writeError) {
100
+ displayDebug(writeError instanceof Error ? writeError : String(writeError));
101
+ displayError(`Failed to write review to file: ${filePath}`);
102
+ return null;
103
+ }
104
+ }
105
+ /**
106
+ * The failure as the report should carry it: an `Error`'s message, or text a caller has already
107
+ * rendered. Nothing is reformatted — the 406 a large PR produces already names the 300-file limit
108
+ * and both ways around it, and a summary of it would lose exactly that.
109
+ */
110
+ function errorText(error) {
111
+ return error instanceof Error ? error.message : String(error);
112
+ }
113
+ /**
114
+ * The colour codes out, as the session log does to every line it writes.
115
+ *
116
+ * The report is read as a document — attached to a ticket, posted as a pull request comment — so a
117
+ * successful one has never contained an escape sequence, and this path must not be the one that
118
+ * starts. The text here is not ours: an error from a content source carries the child process's
119
+ * stderr, and a `gh` that decided it was talking to a terminal colours that. Same treatment on both
120
+ * paths is the only way the two cannot diverge, since only one of them is ever looked at.
121
+ */
122
+ function stripAnsi(text) {
123
+ return text.replace(/\x1b\[[0-9;]*m/g, '');
124
+ }
125
+ //# sourceMappingURL=reviewFailureReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reviewFailureReport.js","sourceRoot":"","sources":["../../src/modules/reviewFailureReport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OAAO,EAAE,aAAa,EA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,CAAC,CAAC;QACjE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,UAAU,EAAE,CAAC;QACpB,YAAY,CAAC,UAAU,YAAY,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QAC5E,YAAY,CAAC,mCAAmC,QAAQ,EAAE,CAAC,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;AAC7C,CAAC"}
@@ -1,5 +1,4 @@
1
1
  /**
2
- * @module reviewHeading
3
2
  * REL-12 — the line every `gth review` / `gth pr` run opens with, so a reader of the output knows
4
3
  * whose review it is and what produced it.
5
4
  *
@@ -32,6 +31,8 @@
32
31
  * site in `reviewModule.ts`, not here — this module builds the line and does not decide whether it
33
32
  * is shown), because a caller piping a review into their own template needs a byte-clean stream.
34
33
  * That rung is opt-in precisely so the reasoning above survives for everyone who does not set it.
34
+ *
35
+ * @module
35
36
  */
36
37
  import { modelProviderLabel } from '@gaunt-sloth/core/core/modelLabel.js';
37
38
  import { runHeaderLine } from '@gaunt-sloth/core/core/runHeader.js';
@@ -1 +1 @@
1
- {"version":3,"file":"reviewHeading.js","sourceRoot":"","sources":["../../src/modules/reviewHeading.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAwB,EACxB,KAAc,EACd,QAAiB;IAEjB,MAAM,KAAK,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9E,OAAO,GAAG,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC;AAC9C,CAAC"}
1
+ {"version":3,"file":"reviewHeading.js","sourceRoot":"","sources":["../../src/modules/reviewHeading.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAwB,EACxB,KAAc,EACd,QAAiB;IAEjB,MAAM,KAAK,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9E,OAAO,GAAG,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC;AAC9C,CAAC"}
@@ -12,6 +12,7 @@ import { deleteArtifact, getArtifact } from '@gaunt-sloth/core/state/artifactSto
12
12
  import { setExitCode, stdout } from '@gaunt-sloth/core/utils/systemUtils.js';
13
13
  import { ApprovalStopError, approvalStopRows } from '@gaunt-sloth/core/core/shell/approvalStop.js';
14
14
  import { displayTermination } from '@gaunt-sloth/core/core/terminationNotice.js';
15
+ import { displayOutstandingWork } from '@gaunt-sloth/core/core/outstandingWork.js';
15
16
  import { get as getGhReadFileTool, GTH_GH_READ_FILE_TOOL_NAME } from '#src/tools/ghReadFileTool.js';
16
17
  /**
17
18
  * Run a review of `diff` and print the verdict.
@@ -124,6 +125,19 @@ _preamble, diff, config, command = 'review', resolvers, reviewContext) {
124
125
  await runner.processMessages(messages);
125
126
  }
126
127
  catch (error) {
128
+ // REL-24 — the run failed, so the PROCESS says it failed. Reporting a failure is not the
129
+ // same as signalling one: `_review-shared.yml` keys its "Check review step result" step on
130
+ // the review step's OUTCOME, so a review that printed a provider error and exited 0 posted
131
+ // what reads as a verdict on a build CI called green.
132
+ //
133
+ // Deliberately NOT gated on `commands.<cmd>.rating.errorOnReviewFail`. That flag governs a
134
+ // VERDICT — exit 1 when the review scores below its threshold — and a run that never
135
+ // reached a verdict has no score to configure. The rating path below already draws the same
136
+ // line: its missing-artifact branch sets the code without consulting the flag, because a
137
+ // rating that did not happen is a malfunction rather than a low score.
138
+ //
139
+ // Set before the branches, so an approvals stop and an ordinary agent error signal alike.
140
+ setExitCode(1);
127
141
  displayDebug(error instanceof Error ? error : String(error));
128
142
  // [[TUI-C71]] — `review` and `pr` wire no tool-approval callback, so an escalation here is
129
143
  // always the §6.2 error and an `attack` verdict is always the halt: the untrusted text this
@@ -153,7 +167,12 @@ _preamble, diff, config, command = 'review', resolvers, reviewContext) {
153
167
  // snapshots at cleanup: the agent is gone by here, and its own sites are the innermost ones.
154
168
  // A run that produced a review says nothing — an ordinary completion is not news.
155
169
  try {
156
- displayTermination(runner.getTerminationReason());
170
+ const reason = runner.getTerminationReason();
171
+ displayTermination(reason);
172
+ // [[EXT-158]] — and whether the run finished its own checklist. `review` and `pr` are
173
+ // long multi-step runs with no prompt to come back to, so a review that stopped halfway
174
+ // through its plan and wrote a partial report is exactly the silent ending this fills.
175
+ displayOutstandingWork(runner.getOutstandingWork(), reason);
157
176
  }
158
177
  catch {
159
178
  /* fail-soft: explaining a run must never be what breaks it */
@@ -1 +1 @@
1
- {"version":3,"file":"reviewModule.js","sourceRoot":"","sources":["../../src/modules/reviewModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB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kB,CAAC,UAAoC,EAAE,OAAwB;IACxF,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAChD,mDAAmD;QACnD,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAAG,WAAW,CAAuB,wBAAwB,CAAC,CAAC;IAC3E,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,cAAc,CAAC,gDAAgD,OAAO,WAAW,CAAC,CAAC;QACnF,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,4EAA4E;QAC5F,OAAO;IACT,CAAC;IAED,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC;IACnE,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC;IAC3D,MAAM,WAAW,GAAG,GAAG,MAAM,CAAC,IAAI,IAAI,SAAS,gBAAgB,SAAS,GAAG,CAAC;IAC5E,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAE/B,IAAI,MAAM,CAAC,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,cAAc,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC;IACxC,CAAC;SAAM,CAAC;QACN,YAAY,CAAC,QAAQ,WAAW,EAAE,CAAC,CAAC;QACpC,IAAI,UAAU,CAAC,iBAAiB,IAAI,IAAI,EAAE,CAAC;YACzC,WAAW,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaunt-sloth/review",
3
- "version": "2.0.0-beta.12",
3
+ "version": "2.0.0-beta.14",
4
4
  "description": "Review functionality for Gaunt Sloth",
5
5
  "license": "MIT",
6
6
  "author": "Andrew Kondratev",
@@ -38,7 +38,7 @@
38
38
  "@langchain/langgraph": "^1.4.15",
39
39
  "langchain": "^1.5.11",
40
40
  "zod": "^4.6.3",
41
- "@gaunt-sloth/core": "2.0.0-beta.12"
41
+ "@gaunt-sloth/core": "2.0.0-beta.14"
42
42
  },
43
43
  "files": [
44
44
  "./dist/*",
@@ -48,6 +48,7 @@
48
48
  "tag": "beta"
49
49
  },
50
50
  "scripts": {
51
- "build": "tsc"
51
+ "build": "tsc",
52
+ "value-surface:generate": "node scripts/generate-value-surface.mjs"
52
53
  }
53
54
  }