@wrenautomation/birdwatch 0.0.0-stage → 0.29.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/LICENSE.md +61 -0
- package/README.md +337 -2
- package/dist/app/cli.d.ts +4 -0
- package/dist/app/cli.js +149 -0
- package/dist/app/cli.js.map +1 -0
- package/dist/app/engine-cli.d.ts +50 -0
- package/dist/app/engine-cli.js +738 -0
- package/dist/app/engine-cli.js.map +1 -0
- package/dist/app/index.d.ts +6 -0
- package/dist/app/index.js +7 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/serve.d.ts +14 -0
- package/dist/app/serve.js +102 -0
- package/dist/app/serve.js.map +1 -0
- package/dist/document/body.d.ts +6 -0
- package/dist/document/body.js +18 -0
- package/dist/document/body.js.map +1 -0
- package/dist/document/check.d.ts +35 -0
- package/dist/document/check.js +68 -0
- package/dist/document/check.js.map +1 -0
- package/dist/document/extract.d.ts +81 -0
- package/dist/document/extract.js +226 -0
- package/dist/document/extract.js.map +1 -0
- package/dist/document/index.d.ts +11 -0
- package/dist/document/index.js +12 -0
- package/dist/document/index.js.map +1 -0
- package/dist/document/model.d.ts +10 -0
- package/dist/document/model.js +2 -0
- package/dist/document/model.js.map +1 -0
- package/dist/document/readers.d.ts +24 -0
- package/dist/document/readers.js +87 -0
- package/dist/document/readers.js.map +1 -0
- package/dist/document/types.d.ts +99 -0
- package/dist/document/types.js +93 -0
- package/dist/document/types.js.map +1 -0
- package/dist/engine/agent.d.ts +473 -0
- package/dist/engine/agent.js +989 -0
- package/dist/engine/agent.js.map +1 -0
- package/dist/engine/canonical.d.ts +4 -0
- package/dist/engine/canonical.js +55 -0
- package/dist/engine/canonical.js.map +1 -0
- package/dist/engine/cost.d.ts +13 -0
- package/dist/engine/cost.js +31 -0
- package/dist/engine/cost.js.map +1 -0
- package/dist/engine/index.d.ts +16 -0
- package/dist/engine/index.js +17 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/judge.d.ts +158 -0
- package/dist/engine/judge.js +323 -0
- package/dist/engine/judge.js.map +1 -0
- package/dist/engine/people.d.ts +34 -0
- package/dist/engine/people.js +125 -0
- package/dist/engine/people.js.map +1 -0
- package/dist/engine/plan.d.ts +6 -0
- package/dist/engine/plan.js +7 -0
- package/dist/engine/plan.js.map +1 -0
- package/dist/engine/ports.d.ts +124 -0
- package/dist/engine/ports.js +28 -0
- package/dist/engine/ports.js.map +1 -0
- package/dist/engine/recall.d.ts +42 -0
- package/dist/engine/recall.js +71 -0
- package/dist/engine/recall.js.map +1 -0
- package/dist/engine/runner.d.ts +30 -0
- package/dist/engine/runner.js +209 -0
- package/dist/engine/runner.js.map +1 -0
- package/dist/engine/state.d.ts +99 -0
- package/dist/engine/state.js +186 -0
- package/dist/engine/state.js.map +1 -0
- package/dist/engine/steps.d.ts +98 -0
- package/dist/engine/steps.js +560 -0
- package/dist/engine/steps.js.map +1 -0
- package/dist/engine/tree.d.ts +76 -0
- package/dist/engine/tree.js +148 -0
- package/dist/engine/tree.js.map +1 -0
- package/dist/engine/view.d.ts +138 -0
- package/dist/engine/view.js +188 -0
- package/dist/engine/view.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/ledger/files.d.ts +39 -0
- package/dist/ledger/files.js +113 -0
- package/dist/ledger/files.js.map +1 -0
- package/dist/ledger/ids.d.ts +4 -0
- package/dist/ledger/ids.js +9 -0
- package/dist/ledger/ids.js.map +1 -0
- package/dist/ledger/index.d.ts +11 -0
- package/dist/ledger/index.js +12 -0
- package/dist/ledger/index.js.map +1 -0
- package/dist/ledger/ledger.d.ts +46 -0
- package/dist/ledger/ledger.js +105 -0
- package/dist/ledger/ledger.js.map +1 -0
- package/dist/ledger/memory.d.ts +19 -0
- package/dist/ledger/memory.js +19 -0
- package/dist/ledger/memory.js.map +1 -0
- package/dist/ledger/records.d.ts +1424 -0
- package/dist/ledger/records.js +292 -0
- package/dist/ledger/records.js.map +1 -0
- package/dist/plan/index.d.ts +7 -0
- package/dist/plan/index.js +8 -0
- package/dist/plan/index.js.map +1 -0
- package/dist/plan/model.d.ts +6 -0
- package/dist/plan/model.js +7 -0
- package/dist/plan/model.js.map +1 -0
- package/dist/plan/plan.d.ts +31 -0
- package/dist/plan/plan.js +87 -0
- package/dist/plan/plan.js.map +1 -0
- package/dist/plan/plans/index.d.ts +17 -0
- package/dist/plan/plans/index.js +236 -0
- package/dist/plan/plans/index.js.map +1 -0
- package/dist/plan/render.d.ts +41 -0
- package/dist/plan/render.js +75 -0
- package/dist/plan/render.js.map +1 -0
- package/dist/plan/review.d.ts +11 -0
- package/dist/plan/review.js +39 -0
- package/dist/plan/review.js.map +1 -0
- package/dist/plan/triage.d.ts +18 -0
- package/dist/plan/triage.js +65 -0
- package/dist/plan/triage.js.map +1 -0
- package/dist/plan/types.d.ts +401 -0
- package/dist/plan/types.js +223 -0
- package/dist/plan/types.js.map +1 -0
- package/dist/sources/arxiv.d.ts +105 -0
- package/dist/sources/arxiv.js +321 -0
- package/dist/sources/arxiv.js.map +1 -0
- package/dist/sources/exa.d.ts +19 -0
- package/dist/sources/exa.js +59 -0
- package/dist/sources/exa.js.map +1 -0
- package/dist/sources/fetcher.d.ts +35 -0
- package/dist/sources/fetcher.js +67 -0
- package/dist/sources/fetcher.js.map +1 -0
- package/dist/sources/google.d.ts +16 -0
- package/dist/sources/google.js +64 -0
- package/dist/sources/google.js.map +1 -0
- package/dist/sources/index.d.ts +17 -0
- package/dist/sources/index.js +18 -0
- package/dist/sources/index.js.map +1 -0
- package/dist/sources/junk.d.ts +10 -0
- package/dist/sources/junk.js +16 -0
- package/dist/sources/junk.js.map +1 -0
- package/dist/sources/ladder.d.ts +47 -0
- package/dist/sources/ladder.js +158 -0
- package/dist/sources/ladder.js.map +1 -0
- package/dist/sources/ledger.d.ts +7 -0
- package/dist/sources/ledger.js +35 -0
- package/dist/sources/ledger.js.map +1 -0
- package/dist/sources/paste.d.ts +8 -0
- package/dist/sources/paste.js +22 -0
- package/dist/sources/paste.js.map +1 -0
- package/dist/sources/searxng.d.ts +11 -0
- package/dist/sources/searxng.js +38 -0
- package/dist/sources/searxng.js.map +1 -0
- package/dist/sources/sites.d.ts +53 -0
- package/dist/sources/sites.js +285 -0
- package/dist/sources/sites.js.map +1 -0
- package/dist/sources/ytdlp.d.ts +43 -0
- package/dist/sources/ytdlp.js +117 -0
- package/dist/sources/ytdlp.js.map +1 -0
- package/package.json +65 -3
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A run's state is the fold of its records, never held between steps: every step reads the
|
|
3
|
+
* trace again. The fold gives the ask, the round, the plan as the planner made it, what each step
|
|
4
|
+
* has handled, and the pointer: the next step to run, from the `done` and `edge` records.
|
|
5
|
+
*/
|
|
6
|
+
import { hostOf } from "../document/index.js";
|
|
7
|
+
import { latestCalls, ofType } from "../ledger/ledger.js";
|
|
8
|
+
import { STEPS, } from "../ledger/records.js";
|
|
9
|
+
import { Plan } from "../plan/index.js";
|
|
10
|
+
const after = (step) => STEPS[STEPS.indexOf(step) + 1] ?? null;
|
|
11
|
+
/** Records must be in time order. */
|
|
12
|
+
export function fold(run, records) {
|
|
13
|
+
let next = { round: 1, step: "plan" };
|
|
14
|
+
let note = null;
|
|
15
|
+
/** The round whose edge set the pointer: the review's own `done` then leaves it. */
|
|
16
|
+
let edged = 0;
|
|
17
|
+
for (const r of records) {
|
|
18
|
+
if (r.type === "done") {
|
|
19
|
+
if (!r.ok) {
|
|
20
|
+
next = { round: r.round, step: r.step };
|
|
21
|
+
note = r.note ?? null;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
if (r.step === "review" && edged === r.round)
|
|
25
|
+
continue;
|
|
26
|
+
const to = after(r.step);
|
|
27
|
+
next = to ? { round: r.round, step: to } : null;
|
|
28
|
+
note = null;
|
|
29
|
+
}
|
|
30
|
+
else if (r.type === "edge") {
|
|
31
|
+
edged = r.round;
|
|
32
|
+
if (r.next === "stop")
|
|
33
|
+
next = null;
|
|
34
|
+
else if (r.next === "again")
|
|
35
|
+
next = { round: r.round + 1, step: "plan" };
|
|
36
|
+
else if (r.to)
|
|
37
|
+
next = { round: r.round, step: r.to };
|
|
38
|
+
note = r.why;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const snapshots = ofType(records, "snapshot");
|
|
42
|
+
const hits = ofType(records, "hit");
|
|
43
|
+
return {
|
|
44
|
+
run,
|
|
45
|
+
records: [...records],
|
|
46
|
+
snapshot: snapshots.at(-1) ?? null,
|
|
47
|
+
round: next?.round ?? snapshots.at(-1)?.round ?? 1,
|
|
48
|
+
next,
|
|
49
|
+
note,
|
|
50
|
+
queries: ofType(records, "query"),
|
|
51
|
+
hits,
|
|
52
|
+
documents: ofType(records, "document"),
|
|
53
|
+
findings: ofType(records, "finding"),
|
|
54
|
+
verdicts: ofType(records, "verdict"),
|
|
55
|
+
calls: ofType(records, "call"),
|
|
56
|
+
spends: ofType(records, "spend"),
|
|
57
|
+
edges: ofType(records, "edge"),
|
|
58
|
+
steers: ofType(records, "steer"),
|
|
59
|
+
gaps: ofType(records, "gap"),
|
|
60
|
+
checks: ofType(records, "check"),
|
|
61
|
+
patterns: ofType(records, "pattern"),
|
|
62
|
+
drafts: ofType(records, "draft"),
|
|
63
|
+
classes: ofType(records, "class"),
|
|
64
|
+
dead: ofType(records, "dead"),
|
|
65
|
+
people: ofType(records, "person"),
|
|
66
|
+
classOf: new Map(ofType(records, "class").map((c) => [c.on, c.class])),
|
|
67
|
+
judged: new Map(ofType(records, "judge").map((j) => [j.on, j.answers])),
|
|
68
|
+
judges: ofType(records, "judge"),
|
|
69
|
+
founds: ofType(records, "found"),
|
|
70
|
+
hitByKey: new Map(hits.map((h) => [h.key, h.id])),
|
|
71
|
+
called: latestCalls(records),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const inRound = (round) => (r) => r.round === round;
|
|
75
|
+
/** The plan of a round as the planner made it, rebuilt from its snapshot and queries. */
|
|
76
|
+
export function planOf(state, round) {
|
|
77
|
+
const s = ofType(state.records, "snapshot").filter(inRound(round)).at(-1);
|
|
78
|
+
if (!s)
|
|
79
|
+
throw new Error(`round ${round} has no snapshot`);
|
|
80
|
+
const { ask, sources, budget, known, planFile, model, yieldRows, at } = s;
|
|
81
|
+
return Plan.parse({
|
|
82
|
+
ask,
|
|
83
|
+
round,
|
|
84
|
+
queries: state.queries.filter(inRound(round)).map((q) => ({
|
|
85
|
+
kind: q.kind,
|
|
86
|
+
terms: q.terms,
|
|
87
|
+
...(q.site ? { site: q.site } : {}),
|
|
88
|
+
why: q.why,
|
|
89
|
+
from: q.from === "tool" ? "ai" : q.from,
|
|
90
|
+
by: q.by,
|
|
91
|
+
})),
|
|
92
|
+
sources,
|
|
93
|
+
budget,
|
|
94
|
+
snapshot: { at, known, planFile, model, yieldRows },
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/** A finding stays kept unless its latest call is a drop. */
|
|
98
|
+
export const kept = (state, f) => state.called.get(f.id) !== "drop";
|
|
99
|
+
/** What the run has found so far: the kept findings' sentences with their URLs, oldest first. */
|
|
100
|
+
export const found = (state, round) => state.findings
|
|
101
|
+
.filter((f) => (round === undefined || f.round === round) && kept(state, f))
|
|
102
|
+
.map((f) => `${f.text} (${f.proof.url})`);
|
|
103
|
+
/**
|
|
104
|
+
* The round a person's gap or back edge is about. Between rounds (a pause, a stop) the pointer
|
|
105
|
+
* is one ahead of the last review, so it is the round that review closed; mid-round, the current one.
|
|
106
|
+
*/
|
|
107
|
+
export const personRound = (state) => {
|
|
108
|
+
const last = state.edges.at(-1);
|
|
109
|
+
return last && (!state.next || state.next.step === "plan") ? last.round : state.round;
|
|
110
|
+
};
|
|
111
|
+
/** The queries that found a hit: the one that wrote it, then every one it came back for. */
|
|
112
|
+
export const queriesOf = (state) => {
|
|
113
|
+
const out = new Map(state.hits.map((h) => [h.id, new Set(h.queries)]));
|
|
114
|
+
for (const f of state.founds)
|
|
115
|
+
out.get(f.hit)?.add(f.query);
|
|
116
|
+
return out;
|
|
117
|
+
};
|
|
118
|
+
/** The hits of a round, the ones no call has named yet. */
|
|
119
|
+
export const uncalledHits = (state, round) => state.hits.filter((h) => h.round === round && !state.called.has(h.id));
|
|
120
|
+
/**
|
|
121
|
+
* The hits to read: kept by triage in this round, no document yet. A failed open is tried again
|
|
122
|
+
* on a rerun (`birdwatch back <run> read`).
|
|
123
|
+
*/
|
|
124
|
+
export const toRead = (state, round) => {
|
|
125
|
+
const read = new Set(state.documents.map((d) => d.hit));
|
|
126
|
+
return state.hits.filter((h) => h.round === round && state.called.get(h.id) === "keep" && !read.has(h.id));
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* The kept findings to check, at most `n`, spread across documents: each document's first
|
|
130
|
+
* unchecked finding, then each one's second, and so on. A finding with no quote, or one checked
|
|
131
|
+
* already, is not in it. Findings come in record order, so the sample is the same on a rerun.
|
|
132
|
+
*/
|
|
133
|
+
export function spreadSample(state, n, only = () => true) {
|
|
134
|
+
const checked = new Set(state.checks.map((c) => c.on));
|
|
135
|
+
const byDoc = new Map();
|
|
136
|
+
for (const f of state.findings)
|
|
137
|
+
if (only(f) && f.proof.quote && !checked.has(f.id) && kept(state, f))
|
|
138
|
+
byDoc.set(f.document, [...(byDoc.get(f.document) ?? []), f]);
|
|
139
|
+
const out = [];
|
|
140
|
+
const lists = [...byDoc.values()];
|
|
141
|
+
for (let i = 0; out.length < n && lists.some((l) => i < l.length); i++)
|
|
142
|
+
for (const l of lists) {
|
|
143
|
+
const f = l[i];
|
|
144
|
+
if (f && out.length < n)
|
|
145
|
+
out.push(f);
|
|
146
|
+
}
|
|
147
|
+
return out;
|
|
148
|
+
}
|
|
149
|
+
/** Share of kept findings a check reads at least: the budget's `checks` is the floor under it. */
|
|
150
|
+
export const CHECK_SHARE = 0.1;
|
|
151
|
+
/** The sample's size: the budget's `checks`, or a tenth of the kept findings in reach, whichever is more; 0 checks is none. */
|
|
152
|
+
export const checkCount = (inReach, budget) => budget ? Math.max(budget, Math.ceil(inReach * CHECK_SHARE)) : 0;
|
|
153
|
+
/** A round's sample for the check step, less what the round checked already. */
|
|
154
|
+
export const toCheck = (state, round, budget) => {
|
|
155
|
+
const inRound = (f) => f.round === round;
|
|
156
|
+
const done = state.checks.filter((c) => c.round === round).length;
|
|
157
|
+
const reach = state.findings.filter((f) => inRound(f) && f.proof.quote && kept(state, f)).length;
|
|
158
|
+
return spreadSample(state, checkCount(reach, budget) - done, inRound);
|
|
159
|
+
};
|
|
160
|
+
/** The documents of a round without a verdict: the extract step has not finished them. */
|
|
161
|
+
export const toExtract = (state, round) => {
|
|
162
|
+
const judged = new Set(state.verdicts.map((v) => v.document));
|
|
163
|
+
return state.documents.filter((d) => d.round === round && !judged.has(d.id));
|
|
164
|
+
};
|
|
165
|
+
/** A finding's class: its own, else its document's; undefined when neither has one. */
|
|
166
|
+
export const classOfFinding = (state, f) => state.classOf.get(f.id) ?? state.classOf.get(f.document);
|
|
167
|
+
/**
|
|
168
|
+
* Sources per class over findings still kept: distinct sites, but each forum thread (a
|
|
169
|
+
* document) counts on its own, so 31 threads on one forum are 31 voices, not one site.
|
|
170
|
+
*/
|
|
171
|
+
export function classesOf(state, ids) {
|
|
172
|
+
const sources = new Map();
|
|
173
|
+
for (const f of state.findings) {
|
|
174
|
+
if (!ids.includes(f.id) || !kept(state, f))
|
|
175
|
+
continue;
|
|
176
|
+
const c = classOfFinding(state, f) ?? "unclassed";
|
|
177
|
+
const key = c === "forum" ? f.document : hostOf(f.proof.url);
|
|
178
|
+
sources.set(c, (sources.get(c) ?? new Set()).add(key));
|
|
179
|
+
}
|
|
180
|
+
return Object.fromEntries([...sources].map(([c, s]) => [c, s.size]));
|
|
181
|
+
}
|
|
182
|
+
/** The sources a set of findings rests on: the sum over `classesOf`. */
|
|
183
|
+
export const sourcesOf = (classes) => Object.values(classes).reduce((a, b) => a + (b ?? 0), 0);
|
|
184
|
+
/** Vendor echo: every classed source is a vendor, and vendors cite each other. */
|
|
185
|
+
export const echoOf = (classes) => !!classes.vendor && Object.keys(classes).every((c) => c === "vendor" || c === "unclassed");
|
|
186
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/engine/state.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAoBL,KAAK,GAIN,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAsDxC,MAAM,KAAK,GAAG,CAAC,IAAU,EAAe,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;AAElF,qCAAqC;AACrC,MAAM,UAAU,IAAI,CAAC,GAAW,EAAE,OAAgC;IAChE,IAAI,IAAI,GAAmB,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACtD,IAAI,IAAI,GAAkB,IAAI,CAAC;IAC/B,oFAAoF;IACpF,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACtB,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;gBACV,IAAI,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;gBACxC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC;gBACtB,SAAS;YACX,CAAC;YACD,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,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C,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAAqC,EAAU,EAAE,CACzE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAE3D,kFAAkF;AAClF,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAqC,EAAW,EAAE,CACvE,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The step table: one typed call per step, records in, records out. The runner interprets it in
|
|
3
|
+
* order; wren's executor mounts the same table as stations. A step reads the fold, calls ports,
|
|
4
|
+
* and appends records; it holds nothing between calls. Source calls fan out (per query across
|
|
5
|
+
* the searchers; reads and extracts a few at a time) and their records land in order, so a
|
|
6
|
+
* trace reads the same whatever answered first. A step runs again after a transient failure
|
|
7
|
+
* from where its records say it got to: a search with an ok spend, a hit with a document, a
|
|
8
|
+
* document with a verdict, are not done twice.
|
|
9
|
+
*/
|
|
10
|
+
import { type Model } from "@wrenautomation/models";
|
|
11
|
+
import type { EntryType, Judged, JudgeFailure, Questions } from "@wrenautomation/models/judge";
|
|
12
|
+
import type { DocumentRecord, Envelope, FindingRecord, From, HitRecord, LedgerRecord, Step } from "../ledger/records.js";
|
|
13
|
+
import { type Deps, type RunOptions, type Source } from "./ports.js";
|
|
14
|
+
import { type RunState } from "./state.js";
|
|
15
|
+
import { type Parent } from "./tree.js";
|
|
16
|
+
export interface StepContext {
|
|
17
|
+
deps: Deps;
|
|
18
|
+
options: RunOptions;
|
|
19
|
+
/** The run's model, wrapped so every ask writes a spend; a Transient after the tries run out. */
|
|
20
|
+
model: Model | null;
|
|
21
|
+
/** The same model, its spends marked with the record they are about. */
|
|
22
|
+
modelOn(on: string): Model | null;
|
|
23
|
+
run: string;
|
|
24
|
+
round: number;
|
|
25
|
+
step: Step;
|
|
26
|
+
/**
|
|
27
|
+
* One judge call with its spend written; its answers, or the failure's kind (`off`: no judge).
|
|
28
|
+
* Never throws.
|
|
29
|
+
*/
|
|
30
|
+
judge(on: string, about: string, state: EntryType, questions: Questions): Promise<Judged | {
|
|
31
|
+
failure: JudgeFailure | "off";
|
|
32
|
+
}>;
|
|
33
|
+
/** Appends one record with the envelope filled in. */
|
|
34
|
+
write<T extends Omit<LedgerRecord, keyof Envelope>>(record: T, who: {
|
|
35
|
+
from: From;
|
|
36
|
+
by: string;
|
|
37
|
+
}): Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Times a source call and writes its spend. A throw becomes `ok: false` and null; a
|
|
40
|
+
* Transient is tried again, and thrown when the tries run out.
|
|
41
|
+
*/
|
|
42
|
+
invoke<T>(source: Source, op: "search" | "open", about: string, on: string, call: () => Promise<T>): Promise<T | null>;
|
|
43
|
+
}
|
|
44
|
+
export type StepResult = {
|
|
45
|
+
ok: true;
|
|
46
|
+
note?: string;
|
|
47
|
+
} | {
|
|
48
|
+
ok: false;
|
|
49
|
+
note: string;
|
|
50
|
+
};
|
|
51
|
+
export type StepFn = (ctx: StepContext, state: RunState) => Promise<StepResult>;
|
|
52
|
+
/** Reads and extracts in flight at once. */
|
|
53
|
+
export declare const PARALLEL = 4;
|
|
54
|
+
/**
|
|
55
|
+
* What round `round` left open: its review's why when it said again, its gaps, and a person's
|
|
56
|
+
* keep or drop on its findings (often written after the review, between rounds).
|
|
57
|
+
*/
|
|
58
|
+
export declare const openAfter: (state: RunState, round: number) => string[];
|
|
59
|
+
/**
|
|
60
|
+
* What a round's plan reads, for the agent's plan and the runner's alike: the known lines (what
|
|
61
|
+
* the ask brought, what the run kept, then what its children found), the premises, and what is
|
|
62
|
+
* open (the last round's holes, children still going). A new child also reads what its parent
|
|
63
|
+
* and siblings found.
|
|
64
|
+
*/
|
|
65
|
+
export declare function planAsk(deps: Pick<Deps, "ledger">, state: RunState, base: {
|
|
66
|
+
text: string;
|
|
67
|
+
known?: readonly string[];
|
|
68
|
+
premises?: readonly string[];
|
|
69
|
+
}, round: number, parent?: Parent): Promise<{
|
|
70
|
+
known: string[];
|
|
71
|
+
premises: string[];
|
|
72
|
+
open: string[];
|
|
73
|
+
}>;
|
|
74
|
+
export declare const planStep: StepFn;
|
|
75
|
+
export declare const fetchStep: StepFn;
|
|
76
|
+
export declare const triageStep: StepFn;
|
|
77
|
+
export declare const readStep: StepFn;
|
|
78
|
+
/** Opens `hits`, each by the first opener that has it; the agent's `open` passes its own list. */
|
|
79
|
+
export declare function readHits(ctx: StepContext, state: RunState, wanted: readonly HitRecord[]): Promise<StepResult>;
|
|
80
|
+
export declare const extractStep: StepFn;
|
|
81
|
+
/** Extracts `docs` with the extractor on the run's model; the agent's `extract` passes its own list. */
|
|
82
|
+
export declare function extractDocuments(ctx: StepContext, state: RunState, docs: readonly DocumentRecord[]): Promise<StepResult>;
|
|
83
|
+
/**
|
|
84
|
+
* The sample check: a few kept findings, spread across the round's documents, each read by a
|
|
85
|
+
* model against its document. A finding whose quote does not back it gets a check record and a
|
|
86
|
+
* drop call; one that holds gets a check record. The share that fails is the review's read on
|
|
87
|
+
* the extract. A check record is the checkpoint: a rerun checks only the rest of the sample.
|
|
88
|
+
*/
|
|
89
|
+
export declare const checkStep: StepFn;
|
|
90
|
+
/**
|
|
91
|
+
* Checks `findings` against their documents; the agent's `check` passes its own sample. The
|
|
92
|
+
* judge first reads every kept, unchecked finding with a quote; each one it doubts joins the
|
|
93
|
+
* sample. A judge's yes never takes a finding out of it. A fail's fix (a narrower sentence on
|
|
94
|
+
* the same quote) passes the gate and a second check before it lands as a new finding.
|
|
95
|
+
*/
|
|
96
|
+
export declare function checkSample(ctx: StepContext, state: RunState, sample: readonly FindingRecord[]): Promise<StepResult>;
|
|
97
|
+
export declare const reviewStep: StepFn;
|
|
98
|
+
export declare const STEP_TABLE: Record<Step, StepFn>;
|