@rackbops/docket-types 0.8.0 → 0.10.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/README.md +109 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/research-answer.d.ts +76 -2
- package/dist/research-answer.d.ts.map +1 -1
- package/dist/research-answer.js +69 -2
- package/dist/research-answer.js.map +1 -1
- package/dist/research-sources.d.ts +81 -4
- package/dist/research-sources.d.ts.map +1 -1
- package/dist/research-sources.js +235 -15
- package/dist/research-sources.js.map +1 -1
- package/dist/research.d.ts +65 -6
- package/dist/research.d.ts.map +1 -1
- package/dist/research.js +397 -33
- package/dist/research.js.map +1 -1
- package/package.json +2 -2
package/dist/research-sources.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { clean } from "@rackbops/docket-core";
|
|
2
|
-
import { safeUrl } from "./research-answer.js";
|
|
2
|
+
import { MAX_BLOCKED, safeUrl } from "./research-answer.js";
|
|
3
3
|
/** Pages one request uses: the first this many usable ones, by address. */
|
|
4
4
|
export const MAX_GATHERED_PAGES = 10;
|
|
5
5
|
export const MAX_PAGE_TITLE_CHARS = 200;
|
|
@@ -8,8 +8,91 @@ export const MAX_PAGE_CHARS = 12_000;
|
|
|
8
8
|
/** Text kept from all of a request's pages together; a page past it is cut, the rest dropped. */
|
|
9
9
|
export const MAX_GATHERED_CHARS = 100_000;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* The sites a run on gathered pages never opens (0.10.0, one list for the tool denials, the
|
|
12
|
+
* de-duplication of `blocked` and the belt): BoardGameGeek, whose pages there come from the
|
|
13
|
+
* person's browser, and eBay, which the tracker never opens (eBay's User Agreement, section 3
|
|
14
|
+
* (automated access)). A first pass on the web opens BoardGameGeek like any site (Rod, 2026-10-16)
|
|
15
|
+
* and lists a refused page in `blocked`; it never opens eBay (`everywhere`). Each is the best
|
|
16
|
+
* source for its field (board games; listings and prices). Only fetches are denied: WebSearch has
|
|
17
|
+
* no domain filter, so a search may still list their pages. `domains` are the permission-rule
|
|
18
|
+
* hosts (each also as `*.host`); `host` tells a URL's hostname on the site; `names` are the ways
|
|
19
|
+
* text names it, as a pattern source.
|
|
20
|
+
*/
|
|
21
|
+
export const BARRED_SITES = [
|
|
22
|
+
{
|
|
23
|
+
site: "boardgamegeek.com",
|
|
24
|
+
domains: ["boardgamegeek.com", "geekdo.com"],
|
|
25
|
+
host: /(^|\.)(boardgamegeek|geekdo)\.com$/i,
|
|
26
|
+
names: "board\\s?game\\s?geek|bgg|geekdo",
|
|
27
|
+
everywhere: false,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
site: "ebay.com",
|
|
31
|
+
domains: ["ebay.*", "ebay.co.*", "ebay.com.*"],
|
|
32
|
+
host: /(^|\.)ebay(\.[a-z]{2,3}){1,2}$/i,
|
|
33
|
+
names: "ebay",
|
|
34
|
+
everywhere: true,
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
/** Text that names the site `b`. */
|
|
38
|
+
function namedIn(b) {
|
|
39
|
+
return new RegExp(`\\b(?:${b.names})\\b`, "i");
|
|
40
|
+
}
|
|
41
|
+
/** Up to three words between a site and what is said of it ("the BGG ranking page was"). */
|
|
42
|
+
const GAP = "(?:[\\w'-]+[,):]?\\s+){0,3}";
|
|
43
|
+
/**
|
|
44
|
+
* A verb for reading a source, in any of its forms. "use" and "see" are left out: "I didn't use
|
|
45
|
+
* the BGG weight" and "I didn't see anything on BGG suggesting a reprint" are not unread pages.
|
|
46
|
+
*/
|
|
47
|
+
const READ_VERB = "(?:(?:check|open|read|access|reach|load|consult|get|visit|fetch|look(?:\\s+at)?)" +
|
|
48
|
+
"(?:ed|ing|s)?|verif(?:y|ies|ied|ying)|retriev(?:e|es|ed|ing))";
|
|
49
|
+
/** A negation before a reading verb: didn't, couldn't, haven't, unable to, not, without. */
|
|
50
|
+
const NEG_BEFORE = "(?:(?:did|could|can|would|should|have|has|had|do|does) ?n[o']?t|cannot|(?:was|were) ?n[o']?t able to|" +
|
|
51
|
+
"unable to|never|not|without)\\s+(?:be(?:en)?\\s+able\\s+to\\s+)?";
|
|
52
|
+
/** What a source did, or was not, after its name: refused, blocked, 403, not opened. */
|
|
53
|
+
const FAILED_AFTER = "(?:refused|blocked|(?:was|were) blocked|returned (?:a |an )?(?:403|error)|403|forbidden|" +
|
|
54
|
+
"showed a captcha|captcha|required (?:a )?sign-?in|inaccessible|unavailable|unreachable|" +
|
|
55
|
+
"failed to (?:load|open)|timed out|(?:access )?(?:was )?denied|" +
|
|
56
|
+
"(?:could|can|did|would|was|were|is|are|has|have|had) ?n[o']?t (?:be(?:en)? )?" +
|
|
57
|
+
"(?:checked|opened|read|accessed|reached|loaded|load|open|consulted|used|available|reachable|accessible|" +
|
|
58
|
+
"looked at)|not (?:been )?(?:checked|opened|read|accessed|reached|loaded|consulted|" +
|
|
59
|
+
"available|reachable|accessible|looked at))\\b";
|
|
60
|
+
/**
|
|
61
|
+
* The shapes in which a sentence says the site `b` was not read (0.10.0), with `’` read as `'`:
|
|
62
|
+
* a negated reading verb with the site as its object, a few words apart at most ("I didn't
|
|
63
|
+
* check BoardGameGeek", "without opening BGG", "unable to load the BGG page"); the site as the
|
|
64
|
+
* subject of a failure, a few words apart at most ("BGG refused the request", "the BoardGameGeek
|
|
65
|
+
* ranking was not checked", "eBay could not be opened"); or "no <site> data, ratings, rankings
|
|
66
|
+
* or results". A negation elsewhere in the sentence ("the game is not in print", "BGG users do
|
|
67
|
+
* not agree") is not one of them.
|
|
68
|
+
*/
|
|
69
|
+
function unreadShapes(b) {
|
|
70
|
+
const site = `(?:${b.names})(?:'s)?[,):]?`;
|
|
71
|
+
return [
|
|
72
|
+
new RegExp(`\\b${NEG_BEFORE}${READ_VERB}\\s+${GAP}${site}`, "i"),
|
|
73
|
+
new RegExp(`\\b${site}\\s+${GAP}${FAILED_AFTER}`, "i"),
|
|
74
|
+
new RegExp(`\\bno (?:${b.names})(?:'s)? (?:data|ratings?|rankings?|ranks?|scores?|results?)\\b`, "i"),
|
|
75
|
+
];
|
|
76
|
+
}
|
|
77
|
+
/** The sentences of `text`, split at a stop, a semicolon or a line break; "e.g." and "i.e." are no stop. */
|
|
78
|
+
function sentences(text) {
|
|
79
|
+
return text
|
|
80
|
+
.replace(/[\u2018\u2019]/g, "'")
|
|
81
|
+
.replace(/\b(e)\.(g)\.|\b(i)\.(e)\./gi, (_m, a, b, c, d) => `${a ?? c}${b ?? d}`)
|
|
82
|
+
.split(/(?<=[.!?;])\s+|\n/);
|
|
83
|
+
}
|
|
84
|
+
/** True when a sentence of `lines` says `b` was not read, in one of `unreadShapes`. */
|
|
85
|
+
function saysUnread(b, lines) {
|
|
86
|
+
const shapes = unreadShapes(b);
|
|
87
|
+
return lines.flatMap(sentences).some((line) => shapes.some((r) => r.test(line)));
|
|
88
|
+
}
|
|
89
|
+
function barredDomains(everywhereOnly = false) {
|
|
90
|
+
return BARRED_SITES.filter((b) => !everywhereOnly || b.everywhere).flatMap((b) => b.domains.flatMap((d) => [d, `*.${d}`]));
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* What a run on gathered pages may not fetch: BoardGameGeek, whose pages there come from the
|
|
94
|
+
* person's browser, and eBay, which the tracker never opens (eBay's User Agreement, section 3
|
|
95
|
+
* (automated access)). Claude Code permission rules (code.claude.com/docs/en/permissions,
|
|
13
96
|
* read 2026-10-13): `domain:host` matches that host only, `domain:*.host` any subdomain at any
|
|
14
97
|
* depth, and a `*` elsewhere one label, so `ebay.*` is `ebay.fr` and `ebay.co.*` is `ebay.co.uk`.
|
|
15
98
|
* Whether `*.ebay.*` (a leading and a later `*`) is accepted is inferred from that wording. Deny
|
|
@@ -17,18 +100,129 @@ export const MAX_GATHERED_CHARS = 100_000;
|
|
|
17
100
|
* still list their pages; the run cannot open them there (a cache or proxy site could still serve
|
|
18
101
|
* them: not covered).
|
|
19
102
|
*/
|
|
20
|
-
export const SENT_DISALLOWED_TOOLS =
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
103
|
+
export const SENT_DISALLOWED_TOOLS = barredDomains().map((host) => `WebFetch(domain:${host})`);
|
|
104
|
+
/**
|
|
105
|
+
* What a web first pass, and its reviewer, may not fetch (0.10.0): eBay only (eBay's User
|
|
106
|
+
* Agreement, section 3 (automated access)). BoardGameGeek they open like any site, and list a page
|
|
107
|
+
* that refuses them in `blocked`.
|
|
108
|
+
*/
|
|
109
|
+
export const WEB_DISALLOWED_TOOLS = barredDomains(true).map((host) => `WebFetch(domain:${host})`);
|
|
110
|
+
function hostOf(url) {
|
|
111
|
+
try {
|
|
112
|
+
return new URL(url).hostname;
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
return "";
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A site name or host as one site: a barred site's own name for any of its aliases (BGG,
|
|
120
|
+
* BoardGameGeek, geekdo.com; eBay, ebay.co.uk), otherwise the text lower-cased without `www.`.
|
|
121
|
+
* Nothing else is merged: amazon.de and amazon.co.uk stay two sites.
|
|
122
|
+
*/
|
|
123
|
+
function siteOf(text) {
|
|
124
|
+
const t = text
|
|
125
|
+
.trim()
|
|
126
|
+
.toLowerCase()
|
|
127
|
+
.replace(/^www\./, "");
|
|
128
|
+
for (const b of BARRED_SITES)
|
|
129
|
+
if (b.host.test(t) || namedIn(b).test(t))
|
|
130
|
+
return b.site;
|
|
131
|
+
return t;
|
|
132
|
+
}
|
|
133
|
+
/** A URL as one page: its site (`siteOf` its host), then its path, with no query or end slash. */
|
|
134
|
+
function pageOf(url) {
|
|
135
|
+
try {
|
|
136
|
+
const u = new URL(url);
|
|
137
|
+
return `${siteOf(u.hostname)}${u.pathname.replace(/\/+$/, "")}`;
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
return "";
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* The key one entry of `blocked` is told apart by (0.10.0): its page (`pageOf`) when it has a
|
|
145
|
+
* URL, so two pages on one site are two entries; its site (`siteOf`) when it has none.
|
|
146
|
+
*/
|
|
147
|
+
export function blockedKey(entry) {
|
|
148
|
+
return entry.url ? pageOf(entry.url) : siteOf(entry.site);
|
|
149
|
+
}
|
|
150
|
+
/** The sites an entry is on: its site's name, and its URL's host, each through `siteOf`. */
|
|
151
|
+
function sitesOf(entry) {
|
|
152
|
+
const out = new Set([siteOf(entry.site)]);
|
|
153
|
+
if (entry.url)
|
|
154
|
+
out.add(siteOf(hostOf(entry.url)));
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* `entries` with one entry per page, at most `MAX_BLOCKED` (0.10.0). Two entries with one page
|
|
159
|
+
* (`blockedKey`) are one, the first kept. An entry with no URL merges into any entry on its site
|
|
160
|
+
* (`sitesOf`): after one, it is dropped; before one, the entry with the URL takes its place. So
|
|
161
|
+
* "BoardGameGeek" and a boardgamegeek.com page are one entry, and two BoardGameGeek pages are two.
|
|
162
|
+
*/
|
|
163
|
+
export function uniqueBlocked(entries) {
|
|
164
|
+
const out = [];
|
|
165
|
+
for (const e of entries) {
|
|
166
|
+
const key = blockedKey(e);
|
|
167
|
+
if (out.some((o) => o.url && blockedKey(o) === key))
|
|
168
|
+
continue;
|
|
169
|
+
if (!e.url) {
|
|
170
|
+
const site = siteOf(e.site);
|
|
171
|
+
if (out.some((o) => sitesOf(o).has(site)))
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
const sites = sitesOf(e);
|
|
176
|
+
const bare = out.findIndex((o) => !o.url && sites.has(siteOf(o.site)));
|
|
177
|
+
if (bare >= 0) {
|
|
178
|
+
out[bare] = e;
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (out.length >= MAX_BLOCKED)
|
|
183
|
+
break;
|
|
184
|
+
out.push(e);
|
|
185
|
+
}
|
|
186
|
+
return out;
|
|
187
|
+
}
|
|
188
|
+
/** What the belt says of a barred site the answer leaves unread and unlisted. */
|
|
189
|
+
export const NOT_OPENED_WHY = "not opened by the research run";
|
|
190
|
+
/**
|
|
191
|
+
* The belt under the prompts (0.10.0): `blocked` with an entry `{site, why: NOT_OPENED_WHY}`, no
|
|
192
|
+
* URL, added for each site of `BARRED_SITES` the answer leaves unread without listing it. It reads
|
|
193
|
+
* the outgoing `answer` and the research run's own `draft`, so a reviewer's rewording or a claim
|
|
194
|
+
* moved to `uncertain` cannot hide it. A site counts as unread when a sentence of a summary or an
|
|
195
|
+
* uncertain line says so in one of `unreadShapes` ("I didn't check BoardGameGeek", "BGG refused
|
|
196
|
+
* the request", "no BGG ratings"); eBay, which no run opens, also when a finding of either rests
|
|
197
|
+
* only on eBay addresses (a search listing, never an opened page). A passing mention, or a
|
|
198
|
+
* negation that is not about the site, counts for neither. BoardGameGeek is left alone when a
|
|
199
|
+
* finding of the outgoing answer cites one of its pages (a web first pass may open it); eBay has
|
|
200
|
+
* no such exemption. An entry on the site, by its site's name or its URL's host (`sitesOf`: a
|
|
201
|
+
* "BoardGameGeek" entry with an archive.org URL counts), stops it; past `MAX_BLOCKED` nothing is
|
|
202
|
+
* added.
|
|
203
|
+
*/
|
|
204
|
+
export function withBarredSites(answer, blocked, draft) {
|
|
205
|
+
const out = [...blocked];
|
|
206
|
+
const lines = [answer.summary, ...answer.uncertain];
|
|
207
|
+
if (draft)
|
|
208
|
+
lines.push(draft.summary, ...draft.uncertain);
|
|
209
|
+
const findings = [...answer.findings, ...(draft?.findings ?? [])];
|
|
210
|
+
const cited = answer.findings.flatMap((f) => f.sources.map(hostOf));
|
|
211
|
+
for (const b of BARRED_SITES) {
|
|
212
|
+
if (out.length >= MAX_BLOCKED)
|
|
213
|
+
break;
|
|
214
|
+
const onlyOn = findings.some((f) => f.sources.length > 0 && f.sources.every((u) => b.host.test(hostOf(u))));
|
|
215
|
+
const unread = saysUnread(b, lines) || (b.everywhere && onlyOn);
|
|
216
|
+
if (!unread)
|
|
217
|
+
continue;
|
|
218
|
+
if (!b.everywhere && cited.some((h) => b.host.test(h)))
|
|
219
|
+
continue;
|
|
220
|
+
if (out.some((e) => sitesOf(e).has(b.site)))
|
|
221
|
+
continue;
|
|
222
|
+
out.push({ site: b.site, why: NOT_OPENED_WHY });
|
|
223
|
+
}
|
|
224
|
+
return out;
|
|
225
|
+
}
|
|
32
226
|
/** A page whose text would be cut shorter than this to fit the whole is dropped instead. */
|
|
33
227
|
export const MIN_PAGE_CHARS = 200;
|
|
34
228
|
/**
|
|
@@ -85,4 +279,30 @@ export function pagesBlock(pages) {
|
|
|
85
279
|
"PAGES>>>",
|
|
86
280
|
];
|
|
87
281
|
}
|
|
282
|
+
/** The longest a request waits for gathered pages, in days. */
|
|
283
|
+
export const SOURCES_WAIT_DAYS = 14;
|
|
284
|
+
export const SOURCES_WAIT_MS = SOURCES_WAIT_DAYS * 24 * 60 * 60 * 1000;
|
|
285
|
+
/**
|
|
286
|
+
* How long before its deadline a wait for pages ends when the deadline comes first: a research run
|
|
287
|
+
* makes no call once it starts past the deadline, and the execute tick picks a due run up within a
|
|
288
|
+
* minute or two, so a run queued at the deadline itself would always miss it.
|
|
289
|
+
*/
|
|
290
|
+
export const SOURCES_DEADLINE_MARGIN_MINUTES = 10;
|
|
291
|
+
export const SOURCES_DEADLINE_MARGIN_MS = SOURCES_DEADLINE_MARGIN_MINUTES * 60 * 1000;
|
|
292
|
+
/**
|
|
293
|
+
* When a wait for gathered pages begun at `now` ends if the pages never come: `SOURCES_WAIT_DAYS`
|
|
294
|
+
* out, or `SOURCES_DEADLINE_MARGIN_MINUTES` before the deadline when that is sooner (never before
|
|
295
|
+
* `now`). `byDeadline` says which. The tracker plugin's own copy (rackbops-bot-plugins
|
|
296
|
+
* `research-sources.ts`) moves here (0.9.0).
|
|
297
|
+
*/
|
|
298
|
+
export function sourcesExpiry(now, deadline) {
|
|
299
|
+
const wait = now.getTime() + SOURCES_WAIT_MS;
|
|
300
|
+
if (!deadline || deadline.getTime() - SOURCES_DEADLINE_MARGIN_MS >= wait) {
|
|
301
|
+
return { at: new Date(wait), byDeadline: false };
|
|
302
|
+
}
|
|
303
|
+
return {
|
|
304
|
+
at: new Date(Math.max(now.getTime(), deadline.getTime() - SOURCES_DEADLINE_MARGIN_MS)),
|
|
305
|
+
byDeadline: true,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
88
308
|
//# sourceMappingURL=research-sources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"research-sources.js","sourceRoot":"","sources":["../src/research-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"research-sources.js","sourceRoot":"","sources":["../src/research-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAoB,WAAW,EAAuB,OAAO,EAAE,MAAM,sBAAsB,CAAA;AA2BlG,2EAA2E;AAC3E,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;AACvC,+BAA+B;AAC/B,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAA;AACpC,iGAAiG;AACjG,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAA;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,YAAY,GAOnB;IACJ;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,CAAC,mBAAmB,EAAE,YAAY,CAAC;QAC5C,IAAI,EAAE,qCAAqC;QAC3C,KAAK,EAAE,k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AiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAEtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,EAAE,CAAA;AACjD,MAAM,CAAC,MAAM,0BAA0B,GAAG,+BAA+B,GAAG,EAAE,GAAG,IAAI,CAAA;AAErF;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,GAAS,EAAE,QAAqB;IAC5D,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,eAAe,CAAA;IAC5C,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,OAAO,EAAE,GAAG,0BAA0B,IAAI,IAAI,EAAE,CAAC;QACzE,OAAO,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;IAClD,CAAC;IACD,OAAO;QACL,EAAE,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,OAAO,EAAE,GAAG,0BAA0B,CAAC,CAAC;QACtF,UAAU,EAAE,IAAI;KACjB,CAAA;AACH,CAAC"}
|
package/dist/research.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type JobSpec, type TaskType } from "@rackbops/docket-core";
|
|
2
|
-
import { type ResearchAnswer } from "./research-answer.js";
|
|
2
|
+
import { type BlockedPage, type ResearchAnswer } from "./research-answer.js";
|
|
3
3
|
import { type GatheredPage, type ReadSources } from "./research-sources.js";
|
|
4
4
|
/**
|
|
5
5
|
* Category 5 (plan section 1.2 row 5): "look into X and report back once". Execute lane, a `once`
|
|
@@ -24,6 +24,34 @@ import { type GatheredPage, type ReadSources } from "./research-sources.js";
|
|
|
24
24
|
* moves the run to now once the pages are in. A run that finds no usable page makes no model call
|
|
25
25
|
* and tells the owner so, and so does a host that cannot read them.
|
|
26
26
|
*
|
|
27
|
+
* **A second pass on pages the run could not open** (0.9.0): a research run lists in `blocked` the
|
|
28
|
+
* pages it needed and could not open (a BoardGameGeek page that refused it; eBay, never opened). When
|
|
29
|
+
* the reviewed answer passes, the research run's own draft lists any, the request is a `web` one,
|
|
30
|
+
* and the host can read gathered pages (`readSources`), the owner gets the answer now with a short
|
|
31
|
+
* "Couldn't open:" list. With at least `MIN_SOURCES_WAIT_MS` (an hour) before `sourcesExpiry` (14
|
|
32
|
+
* days, or 10 minutes before a sooner deadline), the DM also says a fuller pass is queued, and the
|
|
33
|
+
* task waits (`awaiting-pages`) on a follow-up at that expiry, so the wait sends nothing, runs
|
|
34
|
+
* nothing and charges nothing; with less, the task ends there. The findings are saved either way.
|
|
35
|
+
* The host's `ready` (README: the contract) moves the once task to now and deletes that follow-up.
|
|
36
|
+
* Then a second research run gets the pages and the earlier answer and returns only new or
|
|
37
|
+
* corrected findings; its reviewer checks them as an update to the earlier answer, against the
|
|
38
|
+
* pages, and the owner gets an "Update to" DM (one line when it adds nothing), its findings tagged
|
|
39
|
+
* `update` beside the first pass's. With no pages, past the deadline, or on a second-pass failure,
|
|
40
|
+
* the task ends with one short line: the first answer stands, uncharged when no run was made.
|
|
41
|
+
*
|
|
42
|
+
* **Every part of the question** (0.10.0): the research run splits the question into the parts it
|
|
43
|
+
* needs answered before it searches, a part another depends on first, and answers each or names it
|
|
44
|
+
* in `uncertain`; both reviewers never approve an answer that silently skips one (`partsLines`,
|
|
45
|
+
* `answerChecks`, `updateChecks`). Prompt only: the schemas and the DM are as they were.
|
|
46
|
+
*
|
|
47
|
+
* **The best source** (0.10.0): the research run names each part's reference site first
|
|
48
|
+
* (BoardGameGeek for board games, eBay for listings and prices). A web first pass and its reviewer
|
|
49
|
+
* open BoardGameGeek like any site; eBay no run opens (`WEB_DISALLOWED_TOOLS`; eBay's User
|
|
50
|
+
* Agreement, section 3 (automated access)). Where a fuller pass can follow (`canWait`: a web first
|
|
51
|
+
* pass with `readSources`), a best source not opened goes in `blocked`, the reviewer adds one the
|
|
52
|
+
* answer leans around, and the belt (`withBarredSites`) adds a barred site the answer or its draft
|
|
53
|
+
* names as unread; elsewhere `blocked` is never shown, so the runs name it in `uncertain`.
|
|
54
|
+
*
|
|
27
55
|
* Failures (a usage limit never reaches `finish`: the dispatcher requeues the run):
|
|
28
56
|
*
|
|
29
57
|
* - `schema_miss`, a malformed answer, `timeout`, `error`: retried once in the same phase, at once.
|
|
@@ -52,13 +80,23 @@ export interface ResearchConfig {
|
|
|
52
80
|
}
|
|
53
81
|
/** True when `config` asks for gathered pages. */
|
|
54
82
|
export declare function usesSentSources(config: ResearchConfig): boolean;
|
|
55
|
-
|
|
83
|
+
/**
|
|
84
|
+
* `awaiting-pages` (0.9.0): the first answer went out, and the task waits for gathered pages for a
|
|
85
|
+
* second pass; its run is the second pass's research run.
|
|
86
|
+
*/
|
|
87
|
+
export type ResearchPhase = "research" | "review" | "awaiting-pages" | "done";
|
|
56
88
|
/** The current row: which run is next, how often it failed, and the draft once there is one. */
|
|
57
89
|
export interface ResearchState {
|
|
58
90
|
phase: ResearchPhase;
|
|
59
91
|
/** Failed tries in the current phase. */
|
|
60
92
|
failures: number;
|
|
61
93
|
draft: ResearchAnswer | null;
|
|
94
|
+
/** Which pass (0.9.0): 2 once the second pass's research run has answered. Absent: the first. */
|
|
95
|
+
pass?: 1 | 2;
|
|
96
|
+
/** The pages the first pass could not open, as its research run listed them. */
|
|
97
|
+
blocked?: BlockedPage[];
|
|
98
|
+
/** The first pass's reviewed answer, as sent: what the second pass builds on. */
|
|
99
|
+
earlier?: ResearchAnswer;
|
|
62
100
|
}
|
|
63
101
|
export declare const MAX_QUESTION_CHARS = 1000;
|
|
64
102
|
export declare const MAX_CONTEXT_CHARS = 2000;
|
|
@@ -85,7 +123,11 @@ export declare const RESEARCH_TIMEOUT_MS = 600000;
|
|
|
85
123
|
export declare const REVIEW_MAX_TURNS = 8;
|
|
86
124
|
export declare const REVIEW_MAX_BUDGET_USD = 0.5;
|
|
87
125
|
export declare const REVIEW_TIMEOUT_MS = 300000;
|
|
88
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* The state as stored, or a fresh one; a review phase with no readable draft starts over (in the
|
|
128
|
+
* second pass, from the wait for pages). A wait for pages with no readable earlier answer has
|
|
129
|
+
* nothing to build on, so it is done. A state stored before 0.9.0 reads as it did.
|
|
130
|
+
*/
|
|
89
131
|
export declare function researchState(value: unknown): ResearchState;
|
|
90
132
|
/** The deadline as an instant, or null when there is none or it does not parse. */
|
|
91
133
|
export declare function deadlineOf(config: ResearchConfig): Date | null;
|
|
@@ -96,14 +138,31 @@ export declare function deadlineOf(config: ResearchConfig): Date | null;
|
|
|
96
138
|
export declare function draftJson(draft: ResearchAnswer): string;
|
|
97
139
|
/**
|
|
98
140
|
* The research run: the spike's prompt (docket-runner spike/cases.json, case `research`), with the
|
|
99
|
-
* gathered pages when `pages` is given (`sources: "sent"
|
|
141
|
+
* gathered pages when `pages` is given (`sources: "sent"`, or a second pass). With `earlier`, the
|
|
142
|
+
* second pass (0.9.0): the answer already sent goes in as escaped JSON between markers, and the
|
|
143
|
+
* run answers with only what the pages add or correct.
|
|
144
|
+
*/
|
|
145
|
+
export declare function researchJob(config: ResearchConfig, pages?: readonly GatheredPage[], earlier?: ResearchAnswer, options?: ResearchJobOptions): JobSpec;
|
|
146
|
+
/**
|
|
147
|
+
* What a prompt builder needs to know beyond the request (0.10.0). `canWait`: a fuller pass can
|
|
148
|
+
* follow this answer -- a `web` first pass whose host can read gathered pages -- so a best source
|
|
149
|
+
* the run could not open goes in `blocked`, which then starts the wait. Anywhere else `blocked` is
|
|
150
|
+
* never shown, so the run names the missing source in one short `uncertain` line instead.
|
|
151
|
+
* Ignored on gathered pages and on a second pass, which never wait.
|
|
100
152
|
*/
|
|
101
|
-
export
|
|
153
|
+
export interface ResearchJobOptions {
|
|
154
|
+
canWait?: boolean;
|
|
155
|
+
}
|
|
102
156
|
/**
|
|
103
157
|
* The reviewer run: the question, and the draft as escaped JSON between markers; with `pages`
|
|
104
158
|
* (`sources: "sent"`), the same gathered pages the research run had, to check its claims against.
|
|
105
159
|
*/
|
|
106
|
-
export declare function reviewJob(config: ResearchConfig, draft: ResearchAnswer, pages?: readonly GatheredPage[]): JobSpec;
|
|
160
|
+
export declare function reviewJob(config: ResearchConfig, draft: ResearchAnswer, pages?: readonly GatheredPage[], earlier?: ResearchAnswer, options?: ResearchJobOptions): JobSpec;
|
|
161
|
+
/**
|
|
162
|
+
* The shortest wait for pages worth starting (0.9.0): with less than this before the expiry, a
|
|
163
|
+
* person has no real chance to gather pages, so the answer goes out as it is.
|
|
164
|
+
*/
|
|
165
|
+
export declare const MIN_SOURCES_WAIT_MS = 3600000;
|
|
107
166
|
export interface ResearchOptions {
|
|
108
167
|
/** The host's store of gathered pages; without it, a `sources: "sent"` request is not run. */
|
|
109
168
|
readSources?: ReadSources;
|
package/dist/research.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../src/research.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,OAAO,EAIZ,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../src/research.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,OAAO,EAIZ,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAEL,KAAK,WAAW,EAQhB,KAAK,cAAc,EAIpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,WAAW,EAMjB,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,MAAM,WAAW,cAAc;IAC7B,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,iFAAiF;IACjF,OAAO,CAAC,EAAE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