@afaik-lab/weigh 0.0.0-stage → 0.6.0
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/.env.example +49 -0
- package/LICENSE +373 -0
- package/README.md +102 -2
- package/dist/agent.d.ts +83 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +204 -0
- package/dist/agent.js.map +1 -0
- package/dist/ceilings.d.ts +32 -0
- package/dist/ceilings.d.ts.map +1 -0
- package/dist/ceilings.js +61 -0
- package/dist/ceilings.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +530 -0
- package/dist/cli.js.map +1 -0
- package/dist/config-cli.d.ts +15 -0
- package/dist/config-cli.d.ts.map +1 -0
- package/dist/config-cli.js +132 -0
- package/dist/config-cli.js.map +1 -0
- package/dist/config.d.ts +198 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +373 -0
- package/dist/config.js.map +1 -0
- package/dist/context-cli.d.ts +35 -0
- package/dist/context-cli.d.ts.map +1 -0
- package/dist/context-cli.js +251 -0
- package/dist/context-cli.js.map +1 -0
- package/dist/context.d.ts +118 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +159 -0
- package/dist/context.js.map +1 -0
- package/dist/corrections/correction-set.d.ts +67 -0
- package/dist/corrections/correction-set.d.ts.map +1 -0
- package/dist/corrections/correction-set.js +104 -0
- package/dist/corrections/correction-set.js.map +1 -0
- package/dist/corrections/correction.d.ts +74 -0
- package/dist/corrections/correction.d.ts.map +1 -0
- package/dist/corrections/correction.js +154 -0
- package/dist/corrections/correction.js.map +1 -0
- package/dist/corrections/follow-up.d.ts +69 -0
- package/dist/corrections/follow-up.d.ts.map +1 -0
- package/dist/corrections/follow-up.js +217 -0
- package/dist/corrections/follow-up.js.map +1 -0
- package/dist/corrections/index.d.ts +31 -0
- package/dist/corrections/index.d.ts.map +1 -0
- package/dist/corrections/index.js +31 -0
- package/dist/corrections/index.js.map +1 -0
- package/dist/corrections/ledger.d.ts +78 -0
- package/dist/corrections/ledger.d.ts.map +1 -0
- package/dist/corrections/ledger.js +117 -0
- package/dist/corrections/ledger.js.map +1 -0
- package/dist/corrections/promotion.d.ts +119 -0
- package/dist/corrections/promotion.d.ts.map +1 -0
- package/dist/corrections/promotion.js +221 -0
- package/dist/corrections/promotion.js.map +1 -0
- package/dist/corrections/schema.d.ts +125 -0
- package/dist/corrections/schema.d.ts.map +1 -0
- package/dist/corrections/schema.js +100 -0
- package/dist/corrections/schema.js.map +1 -0
- package/dist/corrections-cli.d.ts +28 -0
- package/dist/corrections-cli.d.ts.map +1 -0
- package/dist/corrections-cli.js +157 -0
- package/dist/corrections-cli.js.map +1 -0
- package/dist/diff.d.ts +105 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +202 -0
- package/dist/diff.js.map +1 -0
- package/dist/doctor.d.ts +38 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +197 -0
- package/dist/doctor.js.map +1 -0
- package/dist/events.d.ts +21 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +5 -0
- package/dist/events.js.map +1 -0
- package/dist/findings.d.ts +510 -0
- package/dist/findings.d.ts.map +1 -0
- package/dist/findings.js +645 -0
- package/dist/findings.js.map +1 -0
- package/dist/follow-up-cli.d.ts +88 -0
- package/dist/follow-up-cli.d.ts.map +1 -0
- package/dist/follow-up-cli.js +208 -0
- package/dist/follow-up-cli.js.map +1 -0
- package/dist/harness.d.ts +64 -0
- package/dist/harness.d.ts.map +1 -0
- package/dist/harness.js +71 -0
- package/dist/harness.js.map +1 -0
- package/dist/help/command-help.d.ts +9 -0
- package/dist/help/command-help.d.ts.map +1 -0
- package/dist/help/command-help.js +21 -0
- package/dist/help/command-help.js.map +1 -0
- package/dist/help/commands/answer.d.ts +3 -0
- package/dist/help/commands/answer.d.ts.map +1 -0
- package/dist/help/commands/answer.js +39 -0
- package/dist/help/commands/answer.js.map +1 -0
- package/dist/help/commands/config.d.ts +3 -0
- package/dist/help/commands/config.d.ts.map +1 -0
- package/dist/help/commands/config.js +25 -0
- package/dist/help/commands/config.js.map +1 -0
- package/dist/help/commands/context.d.ts +3 -0
- package/dist/help/commands/context.d.ts.map +1 -0
- package/dist/help/commands/context.js +44 -0
- package/dist/help/commands/context.js.map +1 -0
- package/dist/help/commands/corrections.d.ts +3 -0
- package/dist/help/commands/corrections.d.ts.map +1 -0
- package/dist/help/commands/corrections.js +30 -0
- package/dist/help/commands/corrections.js.map +1 -0
- package/dist/help/commands/doctor.d.ts +3 -0
- package/dist/help/commands/doctor.d.ts.map +1 -0
- package/dist/help/commands/doctor.js +12 -0
- package/dist/help/commands/doctor.js.map +1 -0
- package/dist/help/commands/index.d.ts +4 -0
- package/dist/help/commands/index.d.ts.map +1 -0
- package/dist/help/commands/index.js +27 -0
- package/dist/help/commands/index.js.map +1 -0
- package/dist/help/commands/memory.d.ts +3 -0
- package/dist/help/commands/memory.d.ts.map +1 -0
- package/dist/help/commands/memory.js +33 -0
- package/dist/help/commands/memory.js.map +1 -0
- package/dist/help/commands/models.d.ts +3 -0
- package/dist/help/commands/models.d.ts.map +1 -0
- package/dist/help/commands/models.js +17 -0
- package/dist/help/commands/models.js.map +1 -0
- package/dist/help/commands/options.d.ts +4 -0
- package/dist/help/commands/options.d.ts.map +1 -0
- package/dist/help/commands/options.js +13 -0
- package/dist/help/commands/options.js.map +1 -0
- package/dist/help/commands/review.d.ts +3 -0
- package/dist/help/commands/review.d.ts.map +1 -0
- package/dist/help/commands/review.js +50 -0
- package/dist/help/commands/review.js.map +1 -0
- package/dist/help/commands/sessions.d.ts +3 -0
- package/dist/help/commands/sessions.d.ts.map +1 -0
- package/dist/help/commands/sessions.js +23 -0
- package/dist/help/commands/sessions.js.map +1 -0
- package/dist/help/commands/show.d.ts +3 -0
- package/dist/help/commands/show.d.ts.map +1 -0
- package/dist/help/commands/show.js +18 -0
- package/dist/help/commands/show.js.map +1 -0
- package/dist/help/help.d.ts +16 -0
- package/dist/help/help.d.ts.map +1 -0
- package/dist/help/help.js +68 -0
- package/dist/help/help.js.map +1 -0
- package/dist/help/index.d.ts +4 -0
- package/dist/help/index.d.ts.map +1 -0
- package/dist/help/index.js +7 -0
- package/dist/help/index.js.map +1 -0
- package/dist/index.d.ts +80 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge/block.d.ts +65 -0
- package/dist/knowledge/block.d.ts.map +1 -0
- package/dist/knowledge/block.js +89 -0
- package/dist/knowledge/block.js.map +1 -0
- package/dist/knowledge/claim.d.ts +143 -0
- package/dist/knowledge/claim.d.ts.map +1 -0
- package/dist/knowledge/claim.js +297 -0
- package/dist/knowledge/claim.js.map +1 -0
- package/dist/knowledge/index.d.ts +32 -0
- package/dist/knowledge/index.d.ts.map +1 -0
- package/dist/knowledge/index.js +29 -0
- package/dist/knowledge/index.js.map +1 -0
- package/dist/knowledge/novelty.d.ts +65 -0
- package/dist/knowledge/novelty.d.ts.map +1 -0
- package/dist/knowledge/novelty.js +94 -0
- package/dist/knowledge/novelty.js.map +1 -0
- package/dist/knowledge/recall.d.ts +134 -0
- package/dist/knowledge/recall.d.ts.map +1 -0
- package/dist/knowledge/recall.js +229 -0
- package/dist/knowledge/recall.js.map +1 -0
- package/dist/knowledge/recalled-claim.d.ts +35 -0
- package/dist/knowledge/recalled-claim.d.ts.map +1 -0
- package/dist/knowledge/recalled-claim.js +67 -0
- package/dist/knowledge/recalled-claim.js.map +1 -0
- package/dist/knowledge/recalled.d.ts +70 -0
- package/dist/knowledge/recalled.d.ts.map +1 -0
- package/dist/knowledge/recalled.js +149 -0
- package/dist/knowledge/recalled.js.map +1 -0
- package/dist/knowledge/schema.d.ts +83 -0
- package/dist/knowledge/schema.d.ts.map +1 -0
- package/dist/knowledge/schema.js +96 -0
- package/dist/knowledge/schema.js.map +1 -0
- package/dist/knowledge/staleness.d.ts +48 -0
- package/dist/knowledge/staleness.d.ts.map +1 -0
- package/dist/knowledge/staleness.js +85 -0
- package/dist/knowledge/staleness.js.map +1 -0
- package/dist/knowledge/store.d.ts +100 -0
- package/dist/knowledge/store.d.ts.map +1 -0
- package/dist/knowledge/store.js +184 -0
- package/dist/knowledge/store.js.map +1 -0
- package/dist/memory/compose-file.d.ts +14 -0
- package/dist/memory/compose-file.d.ts.map +1 -0
- package/dist/memory/compose-file.js +25 -0
- package/dist/memory/compose-file.js.map +1 -0
- package/dist/memory/index.d.ts +43 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +119 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/oss.d.ts +62 -0
- package/dist/memory/oss.d.ts.map +1 -0
- package/dist/memory/oss.js +230 -0
- package/dist/memory/oss.js.map +1 -0
- package/dist/memory/platform.d.ts +37 -0
- package/dist/memory/platform.d.ts.map +1 -0
- package/dist/memory/platform.js +131 -0
- package/dist/memory/platform.js.map +1 -0
- package/dist/memory/scope.d.ts +49 -0
- package/dist/memory/scope.d.ts.map +1 -0
- package/dist/memory/scope.js +70 -0
- package/dist/memory/scope.js.map +1 -0
- package/dist/memory/types.d.ts +113 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +18 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/memory-cli.d.ts +17 -0
- package/dist/memory-cli.d.ts.map +1 -0
- package/dist/memory-cli.js +107 -0
- package/dist/memory-cli.js.map +1 -0
- package/dist/models-cli.d.ts +12 -0
- package/dist/models-cli.d.ts.map +1 -0
- package/dist/models-cli.js +54 -0
- package/dist/models-cli.js.map +1 -0
- package/dist/models.d.ts +111 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +227 -0
- package/dist/models.js.map +1 -0
- package/dist/paths.d.ts +35 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +65 -0
- package/dist/paths.js.map +1 -0
- package/dist/profile.d.ts +28 -0
- package/dist/profile.d.ts.map +1 -0
- package/dist/profile.js +154 -0
- package/dist/profile.js.map +1 -0
- package/dist/progress.d.ts +70 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +132 -0
- package/dist/progress.js.map +1 -0
- package/dist/quiet.d.ts +2 -0
- package/dist/quiet.d.ts.map +1 -0
- package/dist/quiet.js +21 -0
- package/dist/quiet.js.map +1 -0
- package/dist/reconcile/continuation.d.ts +132 -0
- package/dist/reconcile/continuation.d.ts.map +1 -0
- package/dist/reconcile/continuation.js +306 -0
- package/dist/reconcile/continuation.js.map +1 -0
- package/dist/reconcile/index.d.ts +26 -0
- package/dist/reconcile/index.d.ts.map +1 -0
- package/dist/reconcile/index.js +28 -0
- package/dist/reconcile/index.js.map +1 -0
- package/dist/reconcile/outcome-set.d.ts +53 -0
- package/dist/reconcile/outcome-set.d.ts.map +1 -0
- package/dist/reconcile/outcome-set.js +124 -0
- package/dist/reconcile/outcome-set.js.map +1 -0
- package/dist/reconcile/outcome.d.ts +56 -0
- package/dist/reconcile/outcome.d.ts.map +1 -0
- package/dist/reconcile/outcome.js +60 -0
- package/dist/reconcile/outcome.js.map +1 -0
- package/dist/reconcile/reconciliation.d.ts +49 -0
- package/dist/reconcile/reconciliation.d.ts.map +1 -0
- package/dist/reconcile/reconciliation.js +88 -0
- package/dist/reconcile/reconciliation.js.map +1 -0
- package/dist/reconcile/schema.d.ts +157 -0
- package/dist/reconcile/schema.d.ts.map +1 -0
- package/dist/reconcile/schema.js +97 -0
- package/dist/reconcile/schema.js.map +1 -0
- package/dist/record/index.d.ts +23 -0
- package/dist/record/index.d.ts.map +1 -0
- package/dist/record/index.js +25 -0
- package/dist/record/index.js.map +1 -0
- package/dist/record/review-record.d.ts +28 -0
- package/dist/record/review-record.d.ts.map +1 -0
- package/dist/record/review-record.js +78 -0
- package/dist/record/review-record.js.map +1 -0
- package/dist/record/schema.d.ts +153 -0
- package/dist/record/schema.d.ts.map +1 -0
- package/dist/record/schema.js +87 -0
- package/dist/record/schema.js.map +1 -0
- package/dist/record/store.d.ts +83 -0
- package/dist/record/store.d.ts.map +1 -0
- package/dist/record/store.js +162 -0
- package/dist/record/store.js.map +1 -0
- package/dist/record/stored-review.d.ts +36 -0
- package/dist/record/stored-review.d.ts.map +1 -0
- package/dist/record/stored-review.js +90 -0
- package/dist/record/stored-review.js.map +1 -0
- package/dist/refute.d.ts +318 -0
- package/dist/refute.d.ts.map +1 -0
- package/dist/refute.js +513 -0
- package/dist/refute.js.map +1 -0
- package/dist/render.d.ts +212 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +544 -0
- package/dist/render.js.map +1 -0
- package/dist/review-cli.d.ts +181 -0
- package/dist/review-cli.d.ts.map +1 -0
- package/dist/review-cli.js +598 -0
- package/dist/review-cli.js.map +1 -0
- package/dist/reviewer.d.ts +297 -0
- package/dist/reviewer.d.ts.map +1 -0
- package/dist/reviewer.js +580 -0
- package/dist/reviewer.js.map +1 -0
- package/dist/session-cli.d.ts +17 -0
- package/dist/session-cli.d.ts.map +1 -0
- package/dist/session-cli.js +62 -0
- package/dist/session-cli.js.map +1 -0
- package/dist/session.d.ts +36 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +105 -0
- package/dist/session.js.map +1 -0
- package/dist/settings.d.ts +68 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +175 -0
- package/dist/settings.js.map +1 -0
- package/dist/show-cli.d.ts +39 -0
- package/dist/show-cli.d.ts.map +1 -0
- package/dist/show-cli.js +56 -0
- package/dist/show-cli.js.map +1 -0
- package/dist/stdout.d.ts +28 -0
- package/dist/stdout.d.ts.map +1 -0
- package/dist/stdout.js +44 -0
- package/dist/stdout.js.map +1 -0
- package/dist/target.d.ts +58 -0
- package/dist/target.d.ts.map +1 -0
- package/dist/target.js +96 -0
- package/dist/target.js.map +1 -0
- package/dist/tools/index.d.ts +93 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +146 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/root.d.ts +62 -0
- package/dist/tools/root.d.ts.map +1 -0
- package/dist/tools/root.js +51 -0
- package/dist/tools/root.js.map +1 -0
- package/dist/usage.d.ts +75 -0
- package/dist/usage.d.ts.map +1 -0
- package/dist/usage.js +100 -0
- package/dist/usage.js.map +1 -0
- package/dist/version.d.ts +14 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +26 -0
- package/dist/version.js.map +1 -0
- package/dist/workspace.d.ts +48 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +126 -0
- package/dist/workspace.js.map +1 -0
- package/docker-compose.yml +61 -0
- package/package.json +70 -4
package/dist/progress.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
+
/**
|
|
5
|
+
* What the reviewer is doing, while it does it.
|
|
6
|
+
*
|
|
7
|
+
* A review runs for minutes — six of them on a cheaper model, which spends
|
|
8
|
+
* twenty turns where a stronger one spends six. Silence for that long is
|
|
9
|
+
* indistinguishable from a hang, and the user has no way to tell a model that
|
|
10
|
+
* is reading carefully from one that is stuck.
|
|
11
|
+
*
|
|
12
|
+
* It is also not only reassurance. Which files the reviewer chooses to open is
|
|
13
|
+
* the signal 2.4 tunes the prompt against, and today that choice is invisible
|
|
14
|
+
* until the run ends and the coverage line reports the total.
|
|
15
|
+
*
|
|
16
|
+
* Everything here goes to stderr, so `weigh review --json | jq` keeps working
|
|
17
|
+
* untouched.
|
|
18
|
+
*/
|
|
19
|
+
import { Palette } from './render.js';
|
|
20
|
+
/** How a tool call reads as one line: the verb, then what it was pointed at. */
|
|
21
|
+
const VERBS = {
|
|
22
|
+
Read: 'read',
|
|
23
|
+
Grep: 'grep',
|
|
24
|
+
Glob: 'glob',
|
|
25
|
+
StructuredOutput: 'report',
|
|
26
|
+
};
|
|
27
|
+
export class ProgressReporter {
|
|
28
|
+
_stream;
|
|
29
|
+
_palette;
|
|
30
|
+
_now;
|
|
31
|
+
_startedAt;
|
|
32
|
+
constructor(options = {}) {
|
|
33
|
+
this._stream = options.stream ?? process.stderr;
|
|
34
|
+
this._palette = Palette.for(this._stream);
|
|
35
|
+
this._now = options.now ?? Date.now;
|
|
36
|
+
this._startedAt = this._now();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A reporter, unless the user asked for silence.
|
|
40
|
+
*
|
|
41
|
+
* `--quiet` promises no output at all, so it implies this. `--json` does
|
|
42
|
+
* not: progress is on stderr and the JSON is on stdout, and the two do not
|
|
43
|
+
* collide.
|
|
44
|
+
*/
|
|
45
|
+
static for(options, opts = {}) {
|
|
46
|
+
if (options.quiet || options.noProgress)
|
|
47
|
+
return undefined;
|
|
48
|
+
return new ProgressReporter(opts);
|
|
49
|
+
}
|
|
50
|
+
/** `[0:04]`, so a long run shows where the time went. */
|
|
51
|
+
_elapsed() {
|
|
52
|
+
const seconds = Math.floor((this._now() - this._startedAt) / 1000);
|
|
53
|
+
return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, '0')}`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The same call, again.
|
|
57
|
+
*
|
|
58
|
+
* Counted because a repeat is the one thing a reader cannot interpret. Four
|
|
59
|
+
* identical `report` lines are the SDK re-asking for schema-valid output —
|
|
60
|
+
* measured on Haiku 4.5 — and they look exactly like a run that has stopped
|
|
61
|
+
* making progress. Saying "retry 2" is the difference between a loop you
|
|
62
|
+
* can diagnose and one you can only worry about.
|
|
63
|
+
*/
|
|
64
|
+
_last = '';
|
|
65
|
+
_repeats = 0;
|
|
66
|
+
_write(verb, detail) {
|
|
67
|
+
const key = `${verb}\u0000${detail}`;
|
|
68
|
+
this._repeats = key === this._last ? this._repeats + 1 : 0;
|
|
69
|
+
this._last = key;
|
|
70
|
+
const suffix = this._repeats > 0 ? this._palette.dim(` · retry ${this._repeats}`) : '';
|
|
71
|
+
const line = `${this._palette.dim(`[${this._elapsed()}]`)} ${verb.padEnd(6)} ${detail}${suffix}`;
|
|
72
|
+
this._stream.write(line.trimEnd() + '\n');
|
|
73
|
+
}
|
|
74
|
+
/** Announced before the model call, because assembly itself takes a moment. */
|
|
75
|
+
start(detail) {
|
|
76
|
+
this._write('review', this._palette.dim(detail));
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Announced before a prompt run, which has no diff to describe.
|
|
80
|
+
*
|
|
81
|
+
* The same job as `start` above with a different verb, because the two are
|
|
82
|
+
* different runs: one is handed a change to judge, the other a question to
|
|
83
|
+
* answer, and a line that said `review` over a question would be wrong about
|
|
84
|
+
* which of them is happening.
|
|
85
|
+
*/
|
|
86
|
+
asking(detail) {
|
|
87
|
+
this._write('ask', this._palette.dim(detail));
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* A blank line, for when the answer starts arriving on stdout.
|
|
91
|
+
*
|
|
92
|
+
* The run is no longer searching, it is answering, and a progress line
|
|
93
|
+
* landing mid-paragraph would splice itself into the output the user is
|
|
94
|
+
* reading. `done` writes this for a review; a prompt run has no findings to
|
|
95
|
+
* count, so it just needs the separation.
|
|
96
|
+
*/
|
|
97
|
+
settled() {
|
|
98
|
+
this._stream.write('\n');
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Announced before the second model call, for the same reason as the first.
|
|
102
|
+
*
|
|
103
|
+
* A refute pass reads files and takes minutes, and without a heading its
|
|
104
|
+
* tool calls appear under the review's as though the review had gone back
|
|
105
|
+
* for more. The caller holds back the review's `done` when a pass follows,
|
|
106
|
+
* so this is not printed after the line that closes the run.
|
|
107
|
+
*/
|
|
108
|
+
refuting(detail) {
|
|
109
|
+
this._write('refute', this._palette.dim(detail));
|
|
110
|
+
}
|
|
111
|
+
handle(event) {
|
|
112
|
+
if (event.type === 'tool_call') {
|
|
113
|
+
const verb = VERBS[event.name] ?? event.name;
|
|
114
|
+
this._write(verb, event.detail ? this._palette.path(event.detail) : '');
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (event.type === 'coverage_nudge') {
|
|
118
|
+
// Named plainly, because a run that suddenly reads ten more files looks
|
|
119
|
+
// like a hang otherwise.
|
|
120
|
+
this._write('back', this._palette.dim(`read ${event.read} of ${event.expected} — sending it back`));
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (event.type === 'done') {
|
|
124
|
+
const count = `${event.findings} finding${event.findings === 1 ? '' : 's'}`;
|
|
125
|
+
this._write('done', this._palette.dim(count));
|
|
126
|
+
// A blank line so the report that follows on stdout is not read as
|
|
127
|
+
// another progress line.
|
|
128
|
+
this._stream.write('\n');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress.js","sourceRoot":"","sources":["../src/progress.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4DAA4D;AAE5D;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAGtC,gFAAgF;AAChF,MAAM,KAAK,GAA2B;IACpC,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,gBAAgB,EAAE,QAAQ;CAC3B,CAAC;AASF,MAAM,OAAO,gBAAgB;IACV,OAAO,CAAqB;IAC5B,QAAQ,CAAU;IAClB,IAAI,CAAe;IACnB,UAAU,CAAS;IAEpC,YAAY,OAAO,GAAoB,EAAE;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,OAAO,CAA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KAAK,gBAAgB,EAAE,CAAC;YACpC,wEAAwE;YACxE,yBAAyB;YACzB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,QAAQ,oBAAoB,CAAC,CAAC,CAAC;YACpG,OAAO;QACT,CAAC;QACD,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,GAAG,KAAK,CAAC,QAAQ,WAAW,KAAK,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;YAC5E,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;YAC9C,mEAAmE;YACnE,yBAAyB;YACzB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;CACF"}
|
package/dist/quiet.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quiet.d.ts","sourceRoot":"","sources":["../src/quiet.ts"],"names":[],"mappings":""}
|
package/dist/quiet.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
+
/**
|
|
5
|
+
* Silences a dependency banner that would otherwise corrupt stdout.
|
|
6
|
+
*
|
|
7
|
+
* Something in the transitive dependency tree calls dotenv's `config()` at
|
|
8
|
+
* import time, and dotenv 17 prints an "injected env (N) from .env // tip: …"
|
|
9
|
+
* line to STDOUT on every call. For a headless agent that is not cosmetic: it
|
|
10
|
+
* puts non-JSON lines into `--json` output and breaks any `| jq` pipeline.
|
|
11
|
+
*
|
|
12
|
+
* `DOTENV_CONFIG_QUIET` is dotenv's own switch for this. It has to be set
|
|
13
|
+
* before those modules are evaluated, which is why this lives in its own module
|
|
14
|
+
* imported first — ES imports are evaluated in source order, so anything set in
|
|
15
|
+
* cli.ts's own body would run far too late.
|
|
16
|
+
*
|
|
17
|
+
* `??=` so an explicit DOTENV_CONFIG_QUIET=false still wins.
|
|
18
|
+
*/
|
|
19
|
+
process.env.DOTENV_CONFIG_QUIET ??= 'true';
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=quiet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quiet.js","sourceRoot":"","sources":["../src/quiet.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4DAA4D;AAE5D;;;;;;;;;;;;;;GAcG;AACH,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,MAAM,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { ReviewContext } from '../context.js';
|
|
2
|
+
import type { Finding } from '../findings.js';
|
|
3
|
+
import type { StoredReview } from '../record/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* This review, continuing the last one.
|
|
6
|
+
*
|
|
7
|
+
* A second review of a branch is not a fresh review and should not be run as
|
|
8
|
+
* one. It is shown what changed since the last review rather than the whole
|
|
9
|
+
* branch, handed the findings that review left standing, told to rule on them
|
|
10
|
+
* rather than restate them, and held to a schema with a place for both.
|
|
11
|
+
*
|
|
12
|
+
* Every finding is handed over, including those in files nothing has touched
|
|
13
|
+
* since. A fix can land somewhere other than the line a finding named — a
|
|
14
|
+
* caller that now validates its input — and only the model reading the change
|
|
15
|
+
* can see that. What it is told is which findings the change could plausibly
|
|
16
|
+
* have reached, so the rest cost it a ruling and not a re-read.
|
|
17
|
+
*
|
|
18
|
+
* Whether a run is a continuation is a fact about the stored record, decided
|
|
19
|
+
* before the call. Nothing about it is inferred from what comes back.
|
|
20
|
+
*/
|
|
21
|
+
export declare class Continuation {
|
|
22
|
+
/** The review this one continues. */
|
|
23
|
+
readonly prior: StoredReview;
|
|
24
|
+
private readonly _findings;
|
|
25
|
+
private constructor();
|
|
26
|
+
/**
|
|
27
|
+
* The continuation this run is, or nothing — in which case it is a fresh
|
|
28
|
+
* review, which is always the safe answer.
|
|
29
|
+
*
|
|
30
|
+
* Every condition below is a way for the prior findings to be about a
|
|
31
|
+
* different question than the one this run is asking. A review of another
|
|
32
|
+
* branch is a different change. A run that stopped on its ceilings never
|
|
33
|
+
* finished forming the list. A base or merge base that has moved means the
|
|
34
|
+
* comparison itself has changed, so "gone" could mean "no longer in the
|
|
35
|
+
* diff" rather than "fixed". And a review of the working tree has no commit
|
|
36
|
+
* to have been a baseline.
|
|
37
|
+
*/
|
|
38
|
+
static from(prior: StoredReview | undefined, context: ReviewContext): Continuation | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* The continuation of the newest review that can be one, or nothing.
|
|
41
|
+
*
|
|
42
|
+
* Walks back past the reviews `from` refuses instead of stopping at the
|
|
43
|
+
* first. Taking only the newest, one `--uncommitted` run made the next
|
|
44
|
+
* review start from scratch, and when that one stopped on its cost ceiling
|
|
45
|
+
* the next did too — each refusal sending every later run over the whole
|
|
46
|
+
* branch, while a complete review of an earlier commit sat one slot older.
|
|
47
|
+
* The refused ones are no baseline, but they do not make an older one wrong:
|
|
48
|
+
* it still names a commit that was read in full, against the same base.
|
|
49
|
+
*/
|
|
50
|
+
static latest(priors: Iterable<StoredReview>, context: ReviewContext): Continuation | undefined;
|
|
51
|
+
/** The findings this review has to rule on. */
|
|
52
|
+
get findings(): readonly Finding[];
|
|
53
|
+
/**
|
|
54
|
+
* Whether there is anything to rule on.
|
|
55
|
+
*
|
|
56
|
+
* Without, the review is asked for no rulings and returns the ordinary
|
|
57
|
+
* schema: a place for answers to questions nobody asked is a place for the
|
|
58
|
+
* model to invent some.
|
|
59
|
+
*/
|
|
60
|
+
get rulesOn(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The part of the reviewer's instructions that only applies when continuing.
|
|
63
|
+
*
|
|
64
|
+
* Appended to the standing instructions rather than replacing them. Two
|
|
65
|
+
* sets of instructions that were "mostly the same" would drift in prose the
|
|
66
|
+
* way two implementations drift in code, and these are the most heavily tuned
|
|
67
|
+
* words in the project.
|
|
68
|
+
*
|
|
69
|
+
* Shown only what changed since the last review, it is asked for less than
|
|
70
|
+
* the standing instructions describe: what became of the old findings, and
|
|
71
|
+
* regressions. Asked to review as usual, a continuation re-reviewed the
|
|
72
|
+
* branch through the narrow diff, and each run reported a fresh crop of
|
|
73
|
+
* findings in code the last review had already read — which is noise about
|
|
74
|
+
* the branch, not news about the fixes. Shown the whole branch, as it is when
|
|
75
|
+
* the last reviewed commit is gone, it cannot tell new code from old, so it
|
|
76
|
+
* reviews as usual.
|
|
77
|
+
*/
|
|
78
|
+
instructions(context: ReviewContext): string;
|
|
79
|
+
/**
|
|
80
|
+
* What this review is for, said before anything it is asked to do.
|
|
81
|
+
*
|
|
82
|
+
* First because it overrides the standing instructions above it, which
|
|
83
|
+
* describe a review that looks for every defect a colleague would catch.
|
|
84
|
+
*/
|
|
85
|
+
private _narrowJob;
|
|
86
|
+
/**
|
|
87
|
+
* The bar a new finding has to clear.
|
|
88
|
+
*
|
|
89
|
+
* A regression is tied to a changed line, because that is the one thing
|
|
90
|
+
* that tells it apart from a first-review finding arriving late. A broken
|
|
91
|
+
* caller still qualifies: the line it now breaks on is the one it cites.
|
|
92
|
+
*/
|
|
93
|
+
private _regressionsOnly;
|
|
94
|
+
/**
|
|
95
|
+
* The findings as this review receives them, appended to the change.
|
|
96
|
+
*
|
|
97
|
+
* The suggestion is included, which the refute pass deliberately withholds.
|
|
98
|
+
* The two are asking different questions: a refuter is deciding whether to
|
|
99
|
+
* believe a claim, and the suggested patch is that claim at its most
|
|
100
|
+
* persuasive — while this review is deciding whether the change answered it,
|
|
101
|
+
* and the fix that was proposed is part of what the change may have done.
|
|
102
|
+
*/
|
|
103
|
+
render(context: ReviewContext): string;
|
|
104
|
+
/**
|
|
105
|
+
* How to rule on a finding the change did not reach.
|
|
106
|
+
*
|
|
107
|
+
* Said once here and marked on each finding below, rather than left for the
|
|
108
|
+
* model to work out from the file list. Unmarked, it either re-reads every
|
|
109
|
+
* untouched file to confirm nothing moved — the cost this mode exists to cut
|
|
110
|
+
* — or calls them unverified, which tells the reader nothing they did not
|
|
111
|
+
* already know.
|
|
112
|
+
*/
|
|
113
|
+
private _scopeNote;
|
|
114
|
+
/**
|
|
115
|
+
* Every path the changes reached, under the name it had before them too.
|
|
116
|
+
*
|
|
117
|
+
* The findings were anchored at the last review's head, so a file renamed
|
|
118
|
+
* since is known to them by its old name.
|
|
119
|
+
*/
|
|
120
|
+
private _changed;
|
|
121
|
+
/** Whether the change reached the file a finding names, or any file it cites. */
|
|
122
|
+
private _touches;
|
|
123
|
+
/**
|
|
124
|
+
* One finding, with the fingerprint as its heading.
|
|
125
|
+
*
|
|
126
|
+
* On a line of its own because it is the one part of this the model has to
|
|
127
|
+
* reproduce character for character. Buried in a sentence it gets
|
|
128
|
+
* paraphrased, and a ruling nobody can match to a finding does nothing.
|
|
129
|
+
*/
|
|
130
|
+
private _describe;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=continuation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation.d.ts","sourceRoot":"","sources":["../../src/reconcile/continuation.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,YAAY;IAErB,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,YAAY;IAC5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAH5B,OAAO,eAIH;IAEJ;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,EAAE,OAAO,EAAE,aAAa,GAAG,YAAY,GAAG,SAAS,CAe7F;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,aAAa,GAAG,YAAY,GAAG,SAAS,CAM9F;IAED,+CAA+C;IAC/C,IAAI,QAAQ,IAAI,SAAS,OAAO,EAAE,CAEjC;IAED;;;;;;OAMG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CA8C3C;IAED;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAkBlB;;;;;;OAMG;IACH,OAAO,CAAC,gBAAgB;IAsBxB;;;;;;;;OAQG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAkBrC;IAED;;;;;;;;OAQG;IACH,OAAO,CAAC,UAAU;IAWlB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IAShB,iFAAiF;IACjF,OAAO,CAAC,QAAQ;IAIhB;;;;;;OAMG;IACH,OAAO,CAAC,SAAS;CAoBlB"}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
+
/**
|
|
5
|
+
* This review, continuing the last one.
|
|
6
|
+
*
|
|
7
|
+
* A second review of a branch is not a fresh review and should not be run as
|
|
8
|
+
* one. It is shown what changed since the last review rather than the whole
|
|
9
|
+
* branch, handed the findings that review left standing, told to rule on them
|
|
10
|
+
* rather than restate them, and held to a schema with a place for both.
|
|
11
|
+
*
|
|
12
|
+
* Every finding is handed over, including those in files nothing has touched
|
|
13
|
+
* since. A fix can land somewhere other than the line a finding named — a
|
|
14
|
+
* caller that now validates its input — and only the model reading the change
|
|
15
|
+
* can see that. What it is told is which findings the change could plausibly
|
|
16
|
+
* have reached, so the rest cost it a ruling and not a re-read.
|
|
17
|
+
*
|
|
18
|
+
* Whether a run is a continuation is a fact about the stored record, decided
|
|
19
|
+
* before the call. Nothing about it is inferred from what comes back.
|
|
20
|
+
*/
|
|
21
|
+
export class Continuation {
|
|
22
|
+
prior;
|
|
23
|
+
_findings;
|
|
24
|
+
constructor(
|
|
25
|
+
/** The review this one continues. */
|
|
26
|
+
prior, _findings) {
|
|
27
|
+
this.prior = prior;
|
|
28
|
+
this._findings = _findings;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The continuation this run is, or nothing — in which case it is a fresh
|
|
32
|
+
* review, which is always the safe answer.
|
|
33
|
+
*
|
|
34
|
+
* Every condition below is a way for the prior findings to be about a
|
|
35
|
+
* different question than the one this run is asking. A review of another
|
|
36
|
+
* branch is a different change. A run that stopped on its ceilings never
|
|
37
|
+
* finished forming the list. A base or merge base that has moved means the
|
|
38
|
+
* comparison itself has changed, so "gone" could mean "no longer in the
|
|
39
|
+
* diff" rather than "fixed". And a review of the working tree has no commit
|
|
40
|
+
* to have been a baseline.
|
|
41
|
+
*/
|
|
42
|
+
static from(prior, context) {
|
|
43
|
+
if (!prior)
|
|
44
|
+
return undefined;
|
|
45
|
+
const { repo } = context;
|
|
46
|
+
// A detached HEAD has no branch to match on, so there is nothing that makes
|
|
47
|
+
// one review the predecessor of another.
|
|
48
|
+
if (!repo.branch || prior.repo.branch !== repo.branch)
|
|
49
|
+
return undefined;
|
|
50
|
+
if (prior.stopped)
|
|
51
|
+
return undefined;
|
|
52
|
+
if (prior.repo.uncommitted)
|
|
53
|
+
return undefined;
|
|
54
|
+
if (prior.repo.base !== repo.base || prior.repo.mergeBase !== repo.mergeBase)
|
|
55
|
+
return undefined;
|
|
56
|
+
// A review that found nothing is still a baseline. It says which commit
|
|
57
|
+
// was read, and that is what lets this run be shown only what came after
|
|
58
|
+
// — or stop, when nothing did. Treated as no review at all, a clean
|
|
59
|
+
// result sent every later run back over the whole branch.
|
|
60
|
+
return new Continuation(prior, prior.findings());
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The continuation of the newest review that can be one, or nothing.
|
|
64
|
+
*
|
|
65
|
+
* Walks back past the reviews `from` refuses instead of stopping at the
|
|
66
|
+
* first. Taking only the newest, one `--uncommitted` run made the next
|
|
67
|
+
* review start from scratch, and when that one stopped on its cost ceiling
|
|
68
|
+
* the next did too — each refusal sending every later run over the whole
|
|
69
|
+
* branch, while a complete review of an earlier commit sat one slot older.
|
|
70
|
+
* The refused ones are no baseline, but they do not make an older one wrong:
|
|
71
|
+
* it still names a commit that was read in full, against the same base.
|
|
72
|
+
*/
|
|
73
|
+
static latest(priors, context) {
|
|
74
|
+
for (const prior of priors) {
|
|
75
|
+
const continuation = Continuation.from(prior, context);
|
|
76
|
+
if (continuation)
|
|
77
|
+
return continuation;
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
/** The findings this review has to rule on. */
|
|
82
|
+
get findings() {
|
|
83
|
+
return this._findings;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Whether there is anything to rule on.
|
|
87
|
+
*
|
|
88
|
+
* Without, the review is asked for no rulings and returns the ordinary
|
|
89
|
+
* schema: a place for answers to questions nobody asked is a place for the
|
|
90
|
+
* model to invent some.
|
|
91
|
+
*/
|
|
92
|
+
get rulesOn() {
|
|
93
|
+
return this._findings.length > 0;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The part of the reviewer's instructions that only applies when continuing.
|
|
97
|
+
*
|
|
98
|
+
* Appended to the standing instructions rather than replacing them. Two
|
|
99
|
+
* sets of instructions that were "mostly the same" would drift in prose the
|
|
100
|
+
* way two implementations drift in code, and these are the most heavily tuned
|
|
101
|
+
* words in the project.
|
|
102
|
+
*
|
|
103
|
+
* Shown only what changed since the last review, it is asked for less than
|
|
104
|
+
* the standing instructions describe: what became of the old findings, and
|
|
105
|
+
* regressions. Asked to review as usual, a continuation re-reviewed the
|
|
106
|
+
* branch through the narrow diff, and each run reported a fresh crop of
|
|
107
|
+
* findings in code the last review had already read — which is noise about
|
|
108
|
+
* the branch, not news about the fixes. Shown the whole branch, as it is when
|
|
109
|
+
* the last reviewed commit is gone, it cannot tell new code from old, so it
|
|
110
|
+
* reviews as usual.
|
|
111
|
+
*/
|
|
112
|
+
instructions(context) {
|
|
113
|
+
const narrowed = Boolean(context.since);
|
|
114
|
+
// Nothing to rule on. Shown the whole branch, this is a fresh review and
|
|
115
|
+
// the standing instructions are all of it; shown only what changed, it is
|
|
116
|
+
// a hunt for regressions and nothing else.
|
|
117
|
+
if (!this.rulesOn) {
|
|
118
|
+
if (!narrowed)
|
|
119
|
+
return '';
|
|
120
|
+
return [
|
|
121
|
+
'',
|
|
122
|
+
'This branch has been reviewed before, and that review reported no findings.',
|
|
123
|
+
...this._narrowJob(),
|
|
124
|
+
'',
|
|
125
|
+
...this._regressionsOnly(),
|
|
126
|
+
].join('\n');
|
|
127
|
+
}
|
|
128
|
+
return [
|
|
129
|
+
'',
|
|
130
|
+
'This branch has been reviewed before.',
|
|
131
|
+
...(narrowed ? this._narrowJob() : []),
|
|
132
|
+
'',
|
|
133
|
+
'The findings from that review are listed after the change, each under its fingerprint. They',
|
|
134
|
+
'are already known. Do not report them again as findings — rule on them instead, one entry',
|
|
135
|
+
'per fingerprint, in `outcomes`.',
|
|
136
|
+
'',
|
|
137
|
+
'Rule by reading the code as it stands now:',
|
|
138
|
+
'- open: the defect is still there, as described. Nothing to add.',
|
|
139
|
+
'- superseded: still there, but the code it pointed at has changed enough that the old',
|
|
140
|
+
' description no longer locates it. Rule it superseded *and* report it as a new finding.',
|
|
141
|
+
'- fixed: this change removed it. Cite the lines that did. A fix you cannot point at is a',
|
|
142
|
+
' finding you deleted, and it will be read as unverified instead.',
|
|
143
|
+
...(narrowed
|
|
144
|
+
? ['- unverified: you could not tell. Say why.', ...this._scopeNote()]
|
|
145
|
+
: [
|
|
146
|
+
'- unverified: you could not tell. Say why. This is the honest answer when nothing in the',
|
|
147
|
+
' change touches the code the finding was about and you have no way to check it.',
|
|
148
|
+
]),
|
|
149
|
+
'',
|
|
150
|
+
'A finding you leave open is still shown to the reader and still counts towards the',
|
|
151
|
+
'recommendation, so there is no need to restate it and no risk in leaving it standing. Rule on',
|
|
152
|
+
'every fingerprint: one you leave out is treated as unverified, which is safe and less useful',
|
|
153
|
+
'than the answer you could have given.',
|
|
154
|
+
'',
|
|
155
|
+
...(narrowed
|
|
156
|
+
? this._regressionsOnly()
|
|
157
|
+
: ['Review the rest of the change exactly as you would otherwise, and report anything new.']),
|
|
158
|
+
].join('\n');
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* What this review is for, said before anything it is asked to do.
|
|
162
|
+
*
|
|
163
|
+
* First because it overrides the standing instructions above it, which
|
|
164
|
+
* describe a review that looks for every defect a colleague would catch.
|
|
165
|
+
*/
|
|
166
|
+
_narrowJob() {
|
|
167
|
+
if (!this.rulesOn) {
|
|
168
|
+
return [
|
|
169
|
+
'',
|
|
170
|
+
'This review has a narrower job than the one described above. It is not a second look at the',
|
|
171
|
+
'branch: the rest of it was reviewed last time. Your job is to catch regressions — defects',
|
|
172
|
+
'that the changes since the last review introduced.',
|
|
173
|
+
];
|
|
174
|
+
}
|
|
175
|
+
return [
|
|
176
|
+
'',
|
|
177
|
+
'This review has a narrower job than the one described above. It is not a second look at the',
|
|
178
|
+
'branch: the rest of it was reviewed last time, and what that review found is listed below.',
|
|
179
|
+
'Your job is to rule on those findings, and to catch regressions — defects that the changes',
|
|
180
|
+
'since the last review introduced.',
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* The bar a new finding has to clear.
|
|
185
|
+
*
|
|
186
|
+
* A regression is tied to a changed line, because that is the one thing
|
|
187
|
+
* that tells it apart from a first-review finding arriving late. A broken
|
|
188
|
+
* caller still qualifies: the line it now breaks on is the one it cites.
|
|
189
|
+
*/
|
|
190
|
+
_regressionsOnly() {
|
|
191
|
+
return [
|
|
192
|
+
'Report a new finding only when it is a regression:',
|
|
193
|
+
'- It must be caused by a line these changes added or altered, and cite that line as',
|
|
194
|
+
' evidence. Code elsewhere that these changes now break counts, citing the change.',
|
|
195
|
+
'- Do not report problems in code these changes did not touch, even ones you notice while',
|
|
196
|
+
' checking a ruling. The last review read that code, and a new finding there is not news',
|
|
197
|
+
' about these changes.',
|
|
198
|
+
...(this.rulesOn ? ['- Restating a superseded finding is not a new finding, and is not held to this.'] : []),
|
|
199
|
+
'',
|
|
200
|
+
'An empty list of new findings is the expected outcome when the fixes are sound. Do not',
|
|
201
|
+
'look for something to report.',
|
|
202
|
+
'',
|
|
203
|
+
...(this.rulesOn
|
|
204
|
+
? [
|
|
205
|
+
'The summary and the recommendation are still about the branch as a whole: weigh the',
|
|
206
|
+
'findings you leave open alongside anything new.',
|
|
207
|
+
]
|
|
208
|
+
: ['The summary and the recommendation are still about the branch as a whole.']),
|
|
209
|
+
];
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* The findings as this review receives them, appended to the change.
|
|
213
|
+
*
|
|
214
|
+
* The suggestion is included, which the refute pass deliberately withholds.
|
|
215
|
+
* The two are asking different questions: a refuter is deciding whether to
|
|
216
|
+
* believe a claim, and the suggested patch is that claim at its most
|
|
217
|
+
* persuasive — while this review is deciding whether the change answered it,
|
|
218
|
+
* and the fix that was proposed is part of what the change may have done.
|
|
219
|
+
*/
|
|
220
|
+
render(context) {
|
|
221
|
+
// Nothing to hand over. An empty heading would read as findings lost.
|
|
222
|
+
if (!this.rulesOn)
|
|
223
|
+
return '';
|
|
224
|
+
const changed = context.since ? this._changed(context) : undefined;
|
|
225
|
+
const out = [
|
|
226
|
+
'# Findings from the last review',
|
|
227
|
+
'',
|
|
228
|
+
`Reported on ${this.prior.at} against the same base. ${this._findings.length} finding${this._findings.length === 1 ? '' : 's'}, most serious first.`,
|
|
229
|
+
];
|
|
230
|
+
if (changed) {
|
|
231
|
+
const touched = this._findings.filter((f) => this._touches(f, changed)).length;
|
|
232
|
+
out.push(`${touched} of them ${touched === 1 ? 'is' : 'are'} in files the changes since then touched.`);
|
|
233
|
+
}
|
|
234
|
+
out.push('Rule on each one in `outcomes`, keyed by the fingerprint above it.');
|
|
235
|
+
for (const finding of this._findings)
|
|
236
|
+
out.push('', ...this._describe(finding, changed));
|
|
237
|
+
return out.join('\n');
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* How to rule on a finding the change did not reach.
|
|
241
|
+
*
|
|
242
|
+
* Said once here and marked on each finding below, rather than left for the
|
|
243
|
+
* model to work out from the file list. Unmarked, it either re-reads every
|
|
244
|
+
* untouched file to confirm nothing moved — the cost this mode exists to cut
|
|
245
|
+
* — or calls them unverified, which tells the reader nothing they did not
|
|
246
|
+
* already know.
|
|
247
|
+
*/
|
|
248
|
+
_scopeNote() {
|
|
249
|
+
return [
|
|
250
|
+
'',
|
|
251
|
+
'Each finding is marked as touched by the changes since the last review, or not. A finding',
|
|
252
|
+
'nothing has touched is still there unless something in these changes fixed it from',
|
|
253
|
+
'elsewhere — a caller that now checks its input, a guard added upstream. Rule it open, or',
|
|
254
|
+
'fixed if you can cite the change that did it. You may open any file to check; you do not',
|
|
255
|
+
'need to re-read an untouched file only to keep its finding open.',
|
|
256
|
+
];
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Every path the changes reached, under the name it had before them too.
|
|
260
|
+
*
|
|
261
|
+
* The findings were anchored at the last review's head, so a file renamed
|
|
262
|
+
* since is known to them by its old name.
|
|
263
|
+
*/
|
|
264
|
+
_changed(context) {
|
|
265
|
+
const paths = new Set();
|
|
266
|
+
for (const file of context.files) {
|
|
267
|
+
paths.add(file.path);
|
|
268
|
+
if (file.previousPath)
|
|
269
|
+
paths.add(file.previousPath);
|
|
270
|
+
}
|
|
271
|
+
return paths;
|
|
272
|
+
}
|
|
273
|
+
/** Whether the change reached the file a finding names, or any file it cites. */
|
|
274
|
+
_touches(finding, changed) {
|
|
275
|
+
return changed.has(finding.path) || finding.evidence.some((cited) => changed.has(cited.path));
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* One finding, with the fingerprint as its heading.
|
|
279
|
+
*
|
|
280
|
+
* On a line of its own because it is the one part of this the model has to
|
|
281
|
+
* reproduce character for character. Buried in a sentence it gets
|
|
282
|
+
* paraphrased, and a ruling nobody can match to a finding does nothing.
|
|
283
|
+
*/
|
|
284
|
+
_describe(finding, changed) {
|
|
285
|
+
const out = [
|
|
286
|
+
`## ${finding.id}`,
|
|
287
|
+
`${finding.severity} · ${finding.category} · confidence ${finding.confidence.toFixed(2)}`,
|
|
288
|
+
`${finding.path}:${finding.line}`,
|
|
289
|
+
...(changed
|
|
290
|
+
? [this._touches(finding, changed) ? 'Touched by these changes.' : 'Not touched since the last review.']
|
|
291
|
+
: []),
|
|
292
|
+
'',
|
|
293
|
+
finding.title,
|
|
294
|
+
finding.body,
|
|
295
|
+
];
|
|
296
|
+
if (finding.evidence.length) {
|
|
297
|
+
out.push('', 'Evidence it cited:');
|
|
298
|
+
for (const cited of finding.evidence)
|
|
299
|
+
out.push(` ${cited.path}:${cited.line} ${cited.snippet}`);
|
|
300
|
+
}
|
|
301
|
+
if (finding.suggestion)
|
|
302
|
+
out.push('', `Fix it proposed: ${finding.suggestion}`);
|
|
303
|
+
return out;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=continuation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation.js","sourceRoot":"","sources":["../../src/reconcile/continuation.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4DAA4D;AAM5D;;;;;;;;;;;;;;;;GAgBG;AACH,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the last one.
|
|
3
|
+
*
|
|
4
|
+
* The question a second run has to answer is not "what do I find" but "what
|
|
5
|
+
* became of what was found before" — resolved, still there, or not something
|
|
6
|
+
* this run is in a position to say. This is the vocabulary that answer is given
|
|
7
|
+
* in, and the whole reason 2.1 anchored a finding's identity to the code rather
|
|
8
|
+
* than to a line number or the model's wording.
|
|
9
|
+
*
|
|
10
|
+
* The answer comes from the continuation review: `Continuation` decides whether
|
|
11
|
+
* this run is one and tells the model what it is ruling on, `OutcomeSet` joins
|
|
12
|
+
* the answer back to the findings and keeps whatever was not resolved in front
|
|
13
|
+
* of the reader, and `Reconciliation` is what the report and the record carry.
|
|
14
|
+
*
|
|
15
|
+
* A deterministic pass over the tree was built for this first and dropped. It
|
|
16
|
+
* could not see a defect fixed anywhere but where it was reported, and a second
|
|
17
|
+
* mechanism that defers to the model whenever they disagree is maintenance paid
|
|
18
|
+
* to be overruled.
|
|
19
|
+
*/
|
|
20
|
+
export { RECONCILED, continuationOutputSchema, outcomeSchema, reconciledSchema, reportedOutcomeSchema } from './schema.js';
|
|
21
|
+
export type { ContinuationOutput, OutcomeJson, ReconciledJson, ReconciledStatus, ReportedOutcome } from './schema.js';
|
|
22
|
+
export { Continuation } from './continuation.js';
|
|
23
|
+
export { Outcome } from './outcome.js';
|
|
24
|
+
export { OutcomeSet } from './outcome-set.js';
|
|
25
|
+
export { Reconciliation } from './reconciliation.js';
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reconcile/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,aAAa,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC3H,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACtH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|