@afaik-lab/weigh 0.0.0 → 0.6.1
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 +103 -1
- 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 +141 -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 +303 -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 +100 -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 +228 -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 +584 -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 +72 -1
|
@@ -0,0 +1,28 @@
|
|
|
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, set against the last one.
|
|
6
|
+
*
|
|
7
|
+
* The question a second run has to answer is not "what do I find" but "what
|
|
8
|
+
* became of what was found before" — resolved, still there, or not something
|
|
9
|
+
* this run is in a position to say. This is the vocabulary that answer is given
|
|
10
|
+
* in, and the whole reason 2.1 anchored a finding's identity to the code rather
|
|
11
|
+
* than to a line number or the model's wording.
|
|
12
|
+
*
|
|
13
|
+
* The answer comes from the continuation review: `Continuation` decides whether
|
|
14
|
+
* this run is one and tells the model what it is ruling on, `OutcomeSet` joins
|
|
15
|
+
* the answer back to the findings and keeps whatever was not resolved in front
|
|
16
|
+
* of the reader, and `Reconciliation` is what the report and the record carry.
|
|
17
|
+
*
|
|
18
|
+
* A deterministic pass over the tree was built for this first and dropped. It
|
|
19
|
+
* could not see a defect fixed anywhere but where it was reported, and a second
|
|
20
|
+
* mechanism that defers to the model whenever they disagree is maintenance paid
|
|
21
|
+
* to be overruled.
|
|
22
|
+
*/
|
|
23
|
+
export { RECONCILED, continuationOutputSchema, outcomeSchema, reconciledSchema, reportedOutcomeSchema } from './schema.js';
|
|
24
|
+
export { Continuation } from './continuation.js';
|
|
25
|
+
export { Outcome } from './outcome.js';
|
|
26
|
+
export { OutcomeSet } from './outcome-set.js';
|
|
27
|
+
export { Reconciliation } from './reconciliation.js';
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reconcile/index.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4DAA4D;AAE5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,aAAa,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE3H,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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { FindingSet } from '../findings.js';
|
|
2
|
+
import type { Continuation } from './continuation.js';
|
|
3
|
+
import { Reconciliation } from './reconciliation.js';
|
|
4
|
+
import type { ReportedOutcome } from './schema.js';
|
|
5
|
+
/**
|
|
6
|
+
* What the model ruled, joined to the findings it was ruling on.
|
|
7
|
+
*
|
|
8
|
+
* Every path through here answers one question: when the review does not say a
|
|
9
|
+
* finding is gone, who keeps it in front of the reader? The answer is always
|
|
10
|
+
* this class, because the prompt has told the model not to restate a known
|
|
11
|
+
* finding — so a finding the model does not resolve has to be put back, or it
|
|
12
|
+
* disappears from the report *and* from the recommendation. A still-open
|
|
13
|
+
* critical defect printing as `APPROVE · nothing to fix` is the worst thing
|
|
14
|
+
* this tool could do, and it is one missing branch away.
|
|
15
|
+
*
|
|
16
|
+
* So the rule is: only `fixed`, and only a `fixed` that cites something, takes
|
|
17
|
+
* a finding out. Everything else is carried.
|
|
18
|
+
*/
|
|
19
|
+
export declare class OutcomeSet {
|
|
20
|
+
private readonly _outcomes;
|
|
21
|
+
private readonly _carried;
|
|
22
|
+
private readonly _fresh;
|
|
23
|
+
private readonly _continuation;
|
|
24
|
+
private constructor();
|
|
25
|
+
/**
|
|
26
|
+
* Matches rulings to findings by fingerprint.
|
|
27
|
+
*
|
|
28
|
+
* `rulings` is undefined when the run produced no structured answer at all —
|
|
29
|
+
* a continuation that stopped on its ceilings, or one whose output had to be
|
|
30
|
+
* recovered from prose. That is not a failure needing its own path: no ruling
|
|
31
|
+
* means unverified, which means carried, which is what the review would have
|
|
32
|
+
* reported if it had never been a continuation.
|
|
33
|
+
*/
|
|
34
|
+
static match(rulings: readonly ReportedOutcome[] | undefined, continuation: Continuation, reported: FindingSet): OutcomeSet;
|
|
35
|
+
/**
|
|
36
|
+
* The findings a continuation reports: what it found, plus what it left open.
|
|
37
|
+
*
|
|
38
|
+
* Carried findings keep their own words and their own fingerprint, so a
|
|
39
|
+
* reader sees the claim as it was first made and a correction recorded
|
|
40
|
+
* against it still matches. They are not put through the confidence floor
|
|
41
|
+
* again either: the floor is a bar on what this run is willing to assert, and
|
|
42
|
+
* these are last run's assertions, already reported once.
|
|
43
|
+
*/
|
|
44
|
+
applyTo(findings: FindingSet): FindingSet;
|
|
45
|
+
/**
|
|
46
|
+
* The comparison, as the report and the stored record carry it.
|
|
47
|
+
*
|
|
48
|
+
* `since` is the commit this run's diff started from, when it was narrowed
|
|
49
|
+
* to what changed after the last review.
|
|
50
|
+
*/
|
|
51
|
+
reconciliation(since?: string): Reconciliation;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=outcome-set.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome-set.d.ts","sourceRoot":"","sources":["../../src/reconcile/outcome-set.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAgB,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;GAaG;AACH,qBAAa,UAAU;IAEnB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAJhC,OAAO,eAKH;IAEJ;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,CACV,OAAO,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,EAC/C,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,UAAU,GACnB,UAAU,CAmEZ;IAED;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAKxC;IAED;;;;;OAKG;IACH,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,cAAc,CAQ7C;CACF"}
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
import { FindingSet } from '../findings.js';
|
|
5
|
+
import { Outcome } from './outcome.js';
|
|
6
|
+
import { Reconciliation } from './reconciliation.js';
|
|
7
|
+
/**
|
|
8
|
+
* What the model ruled, joined to the findings it was ruling on.
|
|
9
|
+
*
|
|
10
|
+
* Every path through here answers one question: when the review does not say a
|
|
11
|
+
* finding is gone, who keeps it in front of the reader? The answer is always
|
|
12
|
+
* this class, because the prompt has told the model not to restate a known
|
|
13
|
+
* finding — so a finding the model does not resolve has to be put back, or it
|
|
14
|
+
* disappears from the report *and* from the recommendation. A still-open
|
|
15
|
+
* critical defect printing as `APPROVE · nothing to fix` is the worst thing
|
|
16
|
+
* this tool could do, and it is one missing branch away.
|
|
17
|
+
*
|
|
18
|
+
* So the rule is: only `fixed`, and only a `fixed` that cites something, takes
|
|
19
|
+
* a finding out. Everything else is carried.
|
|
20
|
+
*/
|
|
21
|
+
export class OutcomeSet {
|
|
22
|
+
_outcomes;
|
|
23
|
+
_carried;
|
|
24
|
+
_fresh;
|
|
25
|
+
_continuation;
|
|
26
|
+
constructor(_outcomes, _carried, _fresh, _continuation) {
|
|
27
|
+
this._outcomes = _outcomes;
|
|
28
|
+
this._carried = _carried;
|
|
29
|
+
this._fresh = _fresh;
|
|
30
|
+
this._continuation = _continuation;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Matches rulings to findings by fingerprint.
|
|
34
|
+
*
|
|
35
|
+
* `rulings` is undefined when the run produced no structured answer at all —
|
|
36
|
+
* a continuation that stopped on its ceilings, or one whose output had to be
|
|
37
|
+
* recovered from prose. That is not a failure needing its own path: no ruling
|
|
38
|
+
* means unverified, which means carried, which is what the review would have
|
|
39
|
+
* reported if it had never been a continuation.
|
|
40
|
+
*/
|
|
41
|
+
static match(rulings, continuation, reported) {
|
|
42
|
+
const byFingerprint = new Map((rulings ?? []).map((r) => [r.fingerprint, r]));
|
|
43
|
+
const current = [...reported];
|
|
44
|
+
const outcomes = [];
|
|
45
|
+
const carried = [];
|
|
46
|
+
const restated = new Set();
|
|
47
|
+
for (const finding of continuation.findings) {
|
|
48
|
+
const ruling = byFingerprint.get(finding.id);
|
|
49
|
+
if (!ruling) {
|
|
50
|
+
outcomes.push(new Outcome(finding, 'unverified', 'this review did not rule on it'));
|
|
51
|
+
carried.push(finding);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (ruling.status === 'fixed') {
|
|
55
|
+
// Downgraded rather than refused. The review is still a good review;
|
|
56
|
+
// what it cannot do is remove a finding without showing the code that
|
|
57
|
+
// removed it.
|
|
58
|
+
if (ruling.evidence.length === 0) {
|
|
59
|
+
outcomes.push(new Outcome(finding, 'unverified', `called fixed with nothing cited — ${ruling.reason}`));
|
|
60
|
+
carried.push(finding);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
outcomes.push(new Outcome(finding, 'fixed', ruling.reason, undefined, ruling.evidence));
|
|
64
|
+
}
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
if (ruling.status === 'superseded') {
|
|
68
|
+
// Superseded by what? The model was told to report the restatement as a
|
|
69
|
+
// finding; where it did not, the claim is simply still open, and
|
|
70
|
+
// carrying it is the only way the reader sees it at all. A replacement
|
|
71
|
+
// restates one finding: once claimed, a second ruling cannot point at
|
|
72
|
+
// it too, or that second finding would leave with nothing restating it.
|
|
73
|
+
const replacement = current.find((f) => f.path === finding.path &&
|
|
74
|
+
f.category === finding.category &&
|
|
75
|
+
f.id !== finding.id &&
|
|
76
|
+
!restated.has(f.id));
|
|
77
|
+
if (replacement) {
|
|
78
|
+
restated.add(replacement.id);
|
|
79
|
+
outcomes.push(new Outcome(finding, 'superseded', ruling.reason, replacement, ruling.evidence));
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
outcomes.push(new Outcome(finding, 'open', `${ruling.reason} — but nothing in this review restates it`));
|
|
83
|
+
carried.push(finding);
|
|
84
|
+
}
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
// `open` and `unverified`: the finding stays in the report either way.
|
|
88
|
+
// The difference is what the section says about it, not whether it is
|
|
89
|
+
// shown — one is a claim that it is still there, the other an admission
|
|
90
|
+
// that nobody checked.
|
|
91
|
+
outcomes.push(new Outcome(finding, ruling.status, ruling.reason, undefined, ruling.evidence));
|
|
92
|
+
carried.push(finding);
|
|
93
|
+
}
|
|
94
|
+
const known = new Set(continuation.findings.map((f) => f.id));
|
|
95
|
+
const fresh = current.filter((f) => !known.has(f.id) && !restated.has(f.id));
|
|
96
|
+
return new OutcomeSet(outcomes, carried, fresh, continuation);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The findings a continuation reports: what it found, plus what it left open.
|
|
100
|
+
*
|
|
101
|
+
* Carried findings keep their own words and their own fingerprint, so a
|
|
102
|
+
* reader sees the claim as it was first made and a correction recorded
|
|
103
|
+
* against it still matches. They are not put through the confidence floor
|
|
104
|
+
* again either: the floor is a bar on what this run is willing to assert, and
|
|
105
|
+
* these are last run's assertions, already reported once.
|
|
106
|
+
*/
|
|
107
|
+
applyTo(findings) {
|
|
108
|
+
if (this._carried.length === 0)
|
|
109
|
+
return findings;
|
|
110
|
+
// Deduped, in case the model restated a known finding anyway — ignoring an
|
|
111
|
+
// instruction is not a reason to print the same thing twice.
|
|
112
|
+
return new FindingSet([...findings, ...this._carried], findings.suppressed).deduped();
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The comparison, as the report and the stored record carry it.
|
|
116
|
+
*
|
|
117
|
+
* `since` is the commit this run's diff started from, when it was narrowed
|
|
118
|
+
* to what changed after the last review.
|
|
119
|
+
*/
|
|
120
|
+
reconciliation(since) {
|
|
121
|
+
return new Reconciliation(this._continuation.prior.id, this._continuation.prior.at, this._outcomes, this._fresh, since);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=outcome-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome-set.js","sourceRoot":"","sources":["../../src/reconcile/outcome-set.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4DAA4D;AAE5D,OAAO,EAAE,UAAU,EAAgB,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,UAAU;IAEF,SAAS;IACT,QAAQ;IACR,MAAM;IACN,aAAa;IAJhC,YACmB,SAA6B,EAC7B,QA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ding } from '../findings.js';
|
|
2
|
+
import type { OutcomeJson, ReconciledStatus } from './schema.js';
|
|
3
|
+
/** One finding from the last review, and what this one found of it. */
|
|
4
|
+
export declare class Outcome {
|
|
5
|
+
/** The finding as the last review stored it. */
|
|
6
|
+
readonly finding: Finding;
|
|
7
|
+
readonly status: ReconciledStatus;
|
|
8
|
+
/** One line a human can check the status against. */
|
|
9
|
+
readonly reason: string;
|
|
10
|
+
/**
|
|
11
|
+
* What this run reported in its place.
|
|
12
|
+
*
|
|
13
|
+
* Present on a finding reported again, and on one restated after the code
|
|
14
|
+
* under it moved. Absent is not the same as nothing having been found: an
|
|
15
|
+
* `unverified` outcome has no restatement precisely because nobody looked.
|
|
16
|
+
*/
|
|
17
|
+
readonly restatedAs?: Finding | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The code the ruling rests on.
|
|
20
|
+
*
|
|
21
|
+
* Empty on most outcomes and never empty on a `fixed` one: a fix is the
|
|
22
|
+
* only status that takes a finding out of the report, so it is the only one
|
|
23
|
+
* that has to be checkable without re-running anything.
|
|
24
|
+
*/
|
|
25
|
+
readonly cited: readonly Evidence[];
|
|
26
|
+
constructor(
|
|
27
|
+
/** The finding as the last review stored it. */
|
|
28
|
+
finding: Finding, status: ReconciledStatus,
|
|
29
|
+
/** One line a human can check the status against. */
|
|
30
|
+
reason: string,
|
|
31
|
+
/**
|
|
32
|
+
* What this run reported in its place.
|
|
33
|
+
*
|
|
34
|
+
* Present on a finding reported again, and on one restated after the code
|
|
35
|
+
* under it moved. Absent is not the same as nothing having been found: an
|
|
36
|
+
* `unverified` outcome has no restatement precisely because nobody looked.
|
|
37
|
+
*/
|
|
38
|
+
restatedAs?: Finding | undefined,
|
|
39
|
+
/**
|
|
40
|
+
* The code the ruling rests on.
|
|
41
|
+
*
|
|
42
|
+
* Empty on most outcomes and never empty on a `fixed` one: a fix is the
|
|
43
|
+
* only status that takes a finding out of the report, so it is the only one
|
|
44
|
+
* that has to be checkable without re-running anything.
|
|
45
|
+
*/
|
|
46
|
+
cited?: readonly Evidence[]);
|
|
47
|
+
/**
|
|
48
|
+
* Whether the problem is still there.
|
|
49
|
+
*
|
|
50
|
+
* `superseded` counts, which is the whole point of having it: a finding whose
|
|
51
|
+
* anchor changed without being addressed must not read as resolved.
|
|
52
|
+
*/
|
|
53
|
+
get stands(): boolean;
|
|
54
|
+
toJSON(): OutcomeJson;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=outcome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../../src/reconcile/outcome.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEjE,uEAAuE;AACvE,qBAAa,OAAO;IAEhB,gDAAgD;IAChD,QAAQ,CAAC,OAAO,EAAE,OAAO;IACzB,QAAQ,CAAC,MAAM,EAAE,gBAAgB;IACjC,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO;IAC7B;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE;IArBrC;IACE,gDAAgD;IACvC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,gBAAgB;IACjC,qDAAqD;IAC5C,MAAM,EAAE,MAAM;IACvB;;;;;;OAMG;IACM,UAAU,CAAC,EAAE,OAAO,YAAA;IAC7B;;;;;;OAMG;IACM,KAAK,GAAE,SAAS,QAAQ,EAAO,EACtC;IAEJ;;;;;OAKG;IACH,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,MAAM,IAAI,WAAW,CAWpB;CACF"}
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
/** One finding from the last review, and what this one found of it. */
|
|
5
|
+
export class Outcome {
|
|
6
|
+
finding;
|
|
7
|
+
status;
|
|
8
|
+
reason;
|
|
9
|
+
restatedAs;
|
|
10
|
+
cited;
|
|
11
|
+
constructor(
|
|
12
|
+
/** The finding as the last review stored it. */
|
|
13
|
+
finding, status,
|
|
14
|
+
/** One line a human can check the status against. */
|
|
15
|
+
reason,
|
|
16
|
+
/**
|
|
17
|
+
* What this run reported in its place.
|
|
18
|
+
*
|
|
19
|
+
* Present on a finding reported again, and on one restated after the code
|
|
20
|
+
* under it moved. Absent is not the same as nothing having been found: an
|
|
21
|
+
* `unverified` outcome has no restatement precisely because nobody looked.
|
|
22
|
+
*/
|
|
23
|
+
restatedAs,
|
|
24
|
+
/**
|
|
25
|
+
* The code the ruling rests on.
|
|
26
|
+
*
|
|
27
|
+
* Empty on most outcomes and never empty on a `fixed` one: a fix is the
|
|
28
|
+
* only status that takes a finding out of the report, so it is the only one
|
|
29
|
+
* that has to be checkable without re-running anything.
|
|
30
|
+
*/
|
|
31
|
+
cited = []) {
|
|
32
|
+
this.finding = finding;
|
|
33
|
+
this.status = status;
|
|
34
|
+
this.reason = reason;
|
|
35
|
+
this.restatedAs = restatedAs;
|
|
36
|
+
this.cited = cited;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Whether the problem is still there.
|
|
40
|
+
*
|
|
41
|
+
* `superseded` counts, which is the whole point of having it: a finding whose
|
|
42
|
+
* anchor changed without being addressed must not read as resolved.
|
|
43
|
+
*/
|
|
44
|
+
get stands() {
|
|
45
|
+
return this.status === 'open' || this.status === 'superseded';
|
|
46
|
+
}
|
|
47
|
+
toJSON() {
|
|
48
|
+
return {
|
|
49
|
+
id: this.finding.id,
|
|
50
|
+
status: this.status,
|
|
51
|
+
reason: this.reason,
|
|
52
|
+
path: this.finding.path,
|
|
53
|
+
line: this.finding.line,
|
|
54
|
+
title: this.finding.title,
|
|
55
|
+
...(this.restatedAs && { restatedAs: this.restatedAs.id }),
|
|
56
|
+
...(this.cited.length > 0 && { evidence: [...this.cited] }),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=outcome.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcome.js","sourceRoot":"","sources":["../../src/reconcile/outcome.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4DAA4D;AAK5D,uEAAuE;AACvE,MAAM,OAAO,OAAO;IAGP,OAAO;IACP,MAAM;IAEN,MAAM;IAQN,UAAU;IAQV,KAAK;IArBhB;IACE,gDAAgD;IACvC,OAAgB,EAChB,MAAwB;IACjC,qDAAqD;IAC5C,MAAc;IACvB;;;;;;OAMG;IACM,UAAoB;IAC7B;;;;;;OAMG;IACM,KAAK,GAAwB,EAAE;uBAnB/B,OAAO;sBACP,MAAM;sBAEN,MAAM;0BAQN,UAAU;qBAQV,KAAK;IACb,CAAC;IAEJ;;;;;OAKG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,YAAY,CAAC;IAChE,CAAC;IAED,MAAM;QACJ,OAAO;YACL,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAE;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI;YACvB,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK;YACzB,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;YAC1D,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;SAC5D,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { FindingSet, type Finding } from '../findings.js';
|
|
2
|
+
import type { Outcome } from './outcome.js';
|
|
3
|
+
import { type ReconciledJson, type ReconciledStatus } from './schema.js';
|
|
4
|
+
/** One review set against the one before it. */
|
|
5
|
+
export declare class Reconciliation {
|
|
6
|
+
/** The id of the review this was compared against. */
|
|
7
|
+
readonly against: string;
|
|
8
|
+
/** When that review was, ISO 8601. */
|
|
9
|
+
readonly at: string;
|
|
10
|
+
private readonly _outcomes;
|
|
11
|
+
private readonly _fresh;
|
|
12
|
+
/** The commit that review was at, when this run was shown only what changed after it. */
|
|
13
|
+
readonly since?: string | undefined;
|
|
14
|
+
constructor(
|
|
15
|
+
/** The id of the review this was compared against. */
|
|
16
|
+
against: string,
|
|
17
|
+
/** When that review was, ISO 8601. */
|
|
18
|
+
at: string, _outcomes: readonly Outcome[], _fresh: readonly Finding[],
|
|
19
|
+
/** The commit that review was at, when this run was shown only what changed after it. */
|
|
20
|
+
since?: string | undefined);
|
|
21
|
+
/** What became of each finding the last review reported. */
|
|
22
|
+
get outcomes(): readonly Outcome[];
|
|
23
|
+
/**
|
|
24
|
+
* Findings reported for the first time this run.
|
|
25
|
+
*
|
|
26
|
+
* A restatement is not new. It carries a new fingerprint, because the code it
|
|
27
|
+
* names has changed, but the problem is one the last review already made —
|
|
28
|
+
* and counting it twice would say this run found something it did not.
|
|
29
|
+
*/
|
|
30
|
+
get fresh(): readonly Finding[];
|
|
31
|
+
/**
|
|
32
|
+
* The findings in `findings` that this run reported for the first time.
|
|
33
|
+
*
|
|
34
|
+
* Matched by fingerprint against `fresh`, so a finding a human's ruling has
|
|
35
|
+
* since taken out of the set stays out. What the last review found, carried
|
|
36
|
+
* or restated, is not here: those were judged when they were first reported,
|
|
37
|
+
* and a second opinion on a continuation is a second opinion on what is new.
|
|
38
|
+
*/
|
|
39
|
+
newIn(findings: FindingSet): FindingSet;
|
|
40
|
+
/** Nothing carried over and nothing new: there is no comparison to print. */
|
|
41
|
+
get isEmpty(): boolean;
|
|
42
|
+
count(status: ReconciledStatus): number;
|
|
43
|
+
/** Outcomes in report order: what still stands first, then what was closed. */
|
|
44
|
+
ordered(): Outcome[];
|
|
45
|
+
/** `1 still open · 2 fixed · 1 new`, leaving out whatever is zero. */
|
|
46
|
+
describe(): string;
|
|
47
|
+
toJSON(): ReconciledJson;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=reconciliation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconciliation.d.ts","sourceRoot":"","sources":["../../src/reconcile/reconciliation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAc,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAKrF,gDAAgD;AAChD,qBAAa,cAAc;IAEvB,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,EAAE,MAAM;IACnB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,yFAAyF;IACzF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM;IARzB;IACE,sDAAsD;IAC7C,OAAO,EAAE,MAAM;IACxB,sCAAsC;IAC7B,EAAE,EAAE,MAAM,EACF,SAAS,EAAE,SAAS,OAAO,EAAE,EAC7B,MAAM,EAAE,SAAS,OAAO,EAAE;IAC3C,yFAAyF;IAChF,KAAK,CAAC,EAAE,MAAM,YAAA,EACrB;IAEJ,4DAA4D;IAC5D,IAAI,QAAQ,IAAI,SAAS,OAAO,EAAE,CAEjC;IAED;;;;;;OAMG;IACH,IAAI,KAAK,IAAI,SAAS,OAAO,EAAE,CAE9B;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAGtC;IAED,6EAA6E;IAC7E,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,KAAK,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAEtC;IAED,+EAA+E;IAC/E,OAAO,IAAI,OAAO,EAAE,CAInB;IAED,sEAAsE;IACtE,QAAQ,IAAI,MAAM,CAUjB;IAED,MAAM,IAAI,cAAc,CAQvB;CACF"}
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
import { FindingSet } from '../findings.js';
|
|
5
|
+
import { RECONCILED } from './schema.js';
|
|
6
|
+
/** The order the statuses are reported in: what still stands, before what does not. */
|
|
7
|
+
const ORDER = ['open', 'superseded', 'unverified', 'fixed'];
|
|
8
|
+
/** One review set against the one before it. */
|
|
9
|
+
export class Reconciliation {
|
|
10
|
+
against;
|
|
11
|
+
at;
|
|
12
|
+
_outcomes;
|
|
13
|
+
_fresh;
|
|
14
|
+
since;
|
|
15
|
+
constructor(
|
|
16
|
+
/** The id of the review this was compared against. */
|
|
17
|
+
against,
|
|
18
|
+
/** When that review was, ISO 8601. */
|
|
19
|
+
at, _outcomes, _fresh,
|
|
20
|
+
/** The commit that review was at, when this run was shown only what changed after it. */
|
|
21
|
+
since) {
|
|
22
|
+
this.against = against;
|
|
23
|
+
this.at = at;
|
|
24
|
+
this._outcomes = _outcomes;
|
|
25
|
+
this._fresh = _fresh;
|
|
26
|
+
this.since = since;
|
|
27
|
+
}
|
|
28
|
+
/** What became of each finding the last review reported. */
|
|
29
|
+
get outcomes() {
|
|
30
|
+
return this._outcomes;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Findings reported for the first time this run.
|
|
34
|
+
*
|
|
35
|
+
* A restatement is not new. It carries a new fingerprint, because the code it
|
|
36
|
+
* names has changed, but the problem is one the last review already made —
|
|
37
|
+
* and counting it twice would say this run found something it did not.
|
|
38
|
+
*/
|
|
39
|
+
get fresh() {
|
|
40
|
+
return this._fresh;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The findings in `findings` that this run reported for the first time.
|
|
44
|
+
*
|
|
45
|
+
* Matched by fingerprint against `fresh`, so a finding a human's ruling has
|
|
46
|
+
* since taken out of the set stays out. What the last review found, carried
|
|
47
|
+
* or restated, is not here: those were judged when they were first reported,
|
|
48
|
+
* and a second opinion on a continuation is a second opinion on what is new.
|
|
49
|
+
*/
|
|
50
|
+
newIn(findings) {
|
|
51
|
+
const fresh = new Set(this._fresh.map((f) => f.id));
|
|
52
|
+
return new FindingSet([...findings].filter((f) => fresh.has(f.id)));
|
|
53
|
+
}
|
|
54
|
+
/** Nothing carried over and nothing new: there is no comparison to print. */
|
|
55
|
+
get isEmpty() {
|
|
56
|
+
return this._outcomes.length === 0 && this._fresh.length === 0;
|
|
57
|
+
}
|
|
58
|
+
count(status) {
|
|
59
|
+
return this._outcomes.filter((o) => o.status === status).length;
|
|
60
|
+
}
|
|
61
|
+
/** Outcomes in report order: what still stands first, then what was closed. */
|
|
62
|
+
ordered() {
|
|
63
|
+
return [...this._outcomes].sort((a, b) => ORDER.indexOf(a.status) - ORDER.indexOf(b.status) || a.finding.compare(b.finding));
|
|
64
|
+
}
|
|
65
|
+
/** `1 still open · 2 fixed · 1 new`, leaving out whatever is zero. */
|
|
66
|
+
describe() {
|
|
67
|
+
const labels = {
|
|
68
|
+
open: 'still open',
|
|
69
|
+
superseded: 'superseded',
|
|
70
|
+
unverified: 'unverified',
|
|
71
|
+
fixed: 'fixed',
|
|
72
|
+
};
|
|
73
|
+
const parts = RECONCILED.filter((s) => this.count(s) > 0).map((s) => `${this.count(s)} ${labels[s]}`);
|
|
74
|
+
if (this._fresh.length)
|
|
75
|
+
parts.push(`${this._fresh.length} new`);
|
|
76
|
+
return parts.join(' · ');
|
|
77
|
+
}
|
|
78
|
+
toJSON() {
|
|
79
|
+
return {
|
|
80
|
+
against: this.against,
|
|
81
|
+
at: this.at,
|
|
82
|
+
...(this.since && { since: this.since }),
|
|
83
|
+
outcomes: this.ordered().map((o) => o.toJSON()),
|
|
84
|
+
new: this._fresh.map((f) => f.id),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=reconciliation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconciliation.js","sourceRoot":"","sources":["../../src/reconcile/reconciliation.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4DAA4D;AAE5D,OAAO,EAAE,UAAU,EAAgB,MAAM,gBAAgB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAA8C,MAAM,aAAa,CAAC;AAErF,uFAAuF;AACvF,MAAM,KAAK,GAAgC,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAEzF,gDAAgD;AAChD,MAAM,OAAO,cAAc;IAGd,OAAO;IAEP,EAAE;IACM,SAAS;IACT,MAAM;IAEd,KAAK;IARhB;IACE,sDAAsD;IAC7C,OAAe;IACxB,sCAAsC;IAC7B,EAAU,EACF,SAA6B,EAC7B,MAA0B;IAC3C,yFAAyF;IAChF,KAAc;uBANd,OAAO;kBAEP,EAAE;yBACM,SAAS;sBACT,MAAM;qBAEd,KAAK;IACb,CAAC;IAEJ,4DAA4D;IAC5D,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;;;OAMG;IACH,IAAI,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F,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACtG,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM;YAAE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,MAAM,CAAC,CAAC;QAChE,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM;QACJ,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;YACxC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YAC/C,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClC,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* What a reconciliation says, as a stored review carries it.
|
|
4
|
+
*
|
|
5
|
+
* Its own file because it is a wire format two modules have to agree on: the
|
|
6
|
+
* reconciler produces it and the record stores it, and a shape declared inside
|
|
7
|
+
* whichever one happened to write it first changes without the other noticing.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* What became of a finding between two reviews.
|
|
11
|
+
*
|
|
12
|
+
* Four, and the fourth is the one that matters. `fixed` is a claim about the
|
|
13
|
+
* code — the problem is gone — and there are runs in no position to make it: one
|
|
14
|
+
* that never opened the file, or one that stopped before it had finished
|
|
15
|
+
* looking. Those produce `unverified` rather than a fix nobody checked.
|
|
16
|
+
*
|
|
17
|
+
* `superseded` is not a softer `fixed`. It means the code the finding pointed
|
|
18
|
+
* at changed and this run reports the same kind of problem in the same file: the
|
|
19
|
+
* claim stands, under a new fingerprint, because the old one named code that is
|
|
20
|
+
* no longer there.
|
|
21
|
+
*/
|
|
22
|
+
export declare const RECONCILED: readonly ['open', 'superseded', 'fixed', 'unverified'];
|
|
23
|
+
export type ReconciledStatus = (typeof RECONCILED)[number];
|
|
24
|
+
export declare const outcomeSchema: z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
status: z.ZodEnum<{
|
|
27
|
+
fixed: "fixed";
|
|
28
|
+
open: "open";
|
|
29
|
+
superseded: "superseded";
|
|
30
|
+
unverified: "unverified";
|
|
31
|
+
}>;
|
|
32
|
+
reason: z.ZodString;
|
|
33
|
+
path: z.ZodString;
|
|
34
|
+
line: z.ZodNumber;
|
|
35
|
+
title: z.ZodString;
|
|
36
|
+
restatedAs: z.ZodOptional<z.ZodString>;
|
|
37
|
+
evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
+
path: z.ZodString;
|
|
39
|
+
line: z.ZodNumber;
|
|
40
|
+
snippet: z.ZodString;
|
|
41
|
+
}, z.core.$strip>>>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export declare const reconciledSchema: z.ZodObject<{
|
|
44
|
+
against: z.ZodString;
|
|
45
|
+
at: z.ZodString;
|
|
46
|
+
since: z.ZodOptional<z.ZodString>;
|
|
47
|
+
outcomes: z.ZodArray<z.ZodObject<{
|
|
48
|
+
id: z.ZodString;
|
|
49
|
+
status: z.ZodEnum<{
|
|
50
|
+
fixed: "fixed";
|
|
51
|
+
open: "open";
|
|
52
|
+
superseded: "superseded";
|
|
53
|
+
unverified: "unverified";
|
|
54
|
+
}>;
|
|
55
|
+
reason: z.ZodString;
|
|
56
|
+
path: z.ZodString;
|
|
57
|
+
line: z.ZodNumber;
|
|
58
|
+
title: z.ZodString;
|
|
59
|
+
restatedAs: z.ZodOptional<z.ZodString>;
|
|
60
|
+
evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
|
+
path: z.ZodString;
|
|
62
|
+
line: z.ZodNumber;
|
|
63
|
+
snippet: z.ZodString;
|
|
64
|
+
}, z.core.$strip>>>;
|
|
65
|
+
}, z.core.$strip>>;
|
|
66
|
+
new: z.ZodArray<z.ZodString>;
|
|
67
|
+
}, z.core.$strip>;
|
|
68
|
+
export type OutcomeJson = z.infer<typeof outcomeSchema>;
|
|
69
|
+
export type ReconciledJson = z.infer<typeof reconciledSchema>;
|
|
70
|
+
/**
|
|
71
|
+
* A ruling on one finding the review was handed.
|
|
72
|
+
*
|
|
73
|
+
* `reportedOutcomeSchema` is to `Outcome` what `reportedFindingSchema` is to
|
|
74
|
+
* `Finding`: what the model is allowed to say, before anything has been checked
|
|
75
|
+
* about it. The fingerprint is how an answer is matched to the finding it is
|
|
76
|
+
* about, and it is the one string the model has to reproduce exactly.
|
|
77
|
+
*/
|
|
78
|
+
export declare const reportedOutcomeSchema: z.ZodObject<{
|
|
79
|
+
fingerprint: z.ZodString;
|
|
80
|
+
status: z.ZodEnum<{
|
|
81
|
+
fixed: "fixed";
|
|
82
|
+
open: "open";
|
|
83
|
+
superseded: "superseded";
|
|
84
|
+
unverified: "unverified";
|
|
85
|
+
}>;
|
|
86
|
+
reason: z.ZodString;
|
|
87
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
88
|
+
path: z.ZodString;
|
|
89
|
+
line: z.ZodNumber;
|
|
90
|
+
snippet: z.ZodString;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
/**
|
|
94
|
+
* What a continuation review returns: the review, plus a ruling on each finding
|
|
95
|
+
* it was handed.
|
|
96
|
+
*
|
|
97
|
+
* One schema rather than a second call. The model is reading the whole change
|
|
98
|
+
* either way, and asking afterwards whether the last review's findings are
|
|
99
|
+
* still there would pay a second time for the same reading.
|
|
100
|
+
*/
|
|
101
|
+
export declare const continuationOutputSchema: z.ZodObject<{
|
|
102
|
+
findings: z.ZodArray<z.ZodObject<{
|
|
103
|
+
severity: z.ZodEnum<{
|
|
104
|
+
critical: "critical";
|
|
105
|
+
high: "high";
|
|
106
|
+
low: "low";
|
|
107
|
+
medium: "medium";
|
|
108
|
+
nit: "nit";
|
|
109
|
+
}>;
|
|
110
|
+
category: z.ZodEnum<{
|
|
111
|
+
"api-contract": "api-contract";
|
|
112
|
+
concurrency: "concurrency";
|
|
113
|
+
correctness: "correctness";
|
|
114
|
+
"error-handling": "error-handling";
|
|
115
|
+
maintainability: "maintainability";
|
|
116
|
+
performance: "performance";
|
|
117
|
+
security: "security";
|
|
118
|
+
style: "style";
|
|
119
|
+
testing: "testing";
|
|
120
|
+
}>;
|
|
121
|
+
title: z.ZodString;
|
|
122
|
+
body: z.ZodString;
|
|
123
|
+
path: z.ZodString;
|
|
124
|
+
line: z.ZodNumber;
|
|
125
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
126
|
+
path: z.ZodString;
|
|
127
|
+
line: z.ZodNumber;
|
|
128
|
+
snippet: z.ZodString;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
confidence: z.ZodNumber;
|
|
131
|
+
suggestion: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
}, z.core.$strip>>;
|
|
133
|
+
summary: z.ZodString;
|
|
134
|
+
verdict: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
135
|
+
approve: "approve";
|
|
136
|
+
block: "block";
|
|
137
|
+
needs_work: "needs_work";
|
|
138
|
+
}>>>;
|
|
139
|
+
outcomes: z.ZodArray<z.ZodObject<{
|
|
140
|
+
fingerprint: z.ZodString;
|
|
141
|
+
status: z.ZodEnum<{
|
|
142
|
+
fixed: "fixed";
|
|
143
|
+
open: "open";
|
|
144
|
+
superseded: "superseded";
|
|
145
|
+
unverified: "unverified";
|
|
146
|
+
}>;
|
|
147
|
+
reason: z.ZodString;
|
|
148
|
+
evidence: z.ZodArray<z.ZodObject<{
|
|
149
|
+
path: z.ZodString;
|
|
150
|
+
line: z.ZodNumber;
|
|
151
|
+
snippet: z.ZodString;
|
|
152
|
+
}, z.core.$strip>>;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export type ReportedOutcome = z.infer<typeof reportedOutcomeSchema>;
|
|
156
|
+
export type ContinuationOutput = z.infer<typeof continuationOutputSchema>;
|
|
157
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/reconcile/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;GAMG;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,YAAI,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,CAAU,CAAC;AACjF,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;iBAkBxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;iBAgB3B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACxD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;iBAchC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAInC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|