@wrenautomation/raven 0.8.0 → 0.8.2
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 +1 -1
- package/dist/review.d.ts +3 -2
- package/dist/review.js +9 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Three calls, one record each:
|
|
|
12
12
|
|---|---|---|
|
|
13
13
|
| `plan` | an ask (text, kind, what is known, what the person says: `steer`, rendered first in every prompt), proposals from people or other models, yield rows from earlier runs | a `Plan`: typed queries, each with `why`, `from` (ai or human) and `by` (model id, plan file or person), the sources it may use, the budget, and a snapshot of what raven was given |
|
|
14
14
|
| `triage` | hits as a source shows them for free (title, channel, length, date, snippet, which sources returned it) | read or skip per hit; the model writes a why on a read only (a skip's is fixed text); the read budget caps it |
|
|
15
|
-
| `review` | what a round came to (counts, found lines with their dates, the extractor's verdict and gap per read, the steps' gaps, the sample check, notes) | the edge: `stop`, `again` (a new round from plan) or `back` (rerun one step), with why |
|
|
15
|
+
| `review` | what a round came to (counts, found lines with their dates, the extractor's verdict and gap per read, the steps' gaps, the sample check, notes) | the edge: `stop`, `again` (a new round from plan) or `back` (rerun one step), with why. On the last round of the budget the edge is `stop` whatever the model says; its why says what the ask still lacks |
|
|
16
16
|
|
|
17
17
|
Ask kinds: `web`, `video`, `channel`, `person`, `site`. Each has a default plan file
|
|
18
18
|
(prompts, sources, budget, and `age`: one sentence on how much a source's age counts). Copy one, tune it, keep it beside your ledger: that is where a run
|
package/dist/review.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* After a round: stop, go again from plan, or back to one step. The round budget is a guard
|
|
3
|
-
* rail, not a stop rule:
|
|
4
|
-
*
|
|
3
|
+
* rail, not a stop rule: before it is spent the model decides and says why. On the last round
|
|
4
|
+
* the model still reads the round, so its why says what the ask still lacks, but the edge is
|
|
5
|
+
* stop whatever it answers. The runner takes the edge; raven never loops.
|
|
5
6
|
*/
|
|
6
7
|
import type { Model } from "@wrenautomation/models";
|
|
7
8
|
import { type Edge, type PlanFile, type Round } from "./types.js";
|
package/dist/review.js
CHANGED
|
@@ -26,17 +26,20 @@ export function reviewPrompt(round, planFile) {
|
|
|
26
26
|
verdicts: lines(round.verdicts.map(verdictLine), "(none)"),
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
/** Told to the model on the last round: its answer cannot be again or back. */
|
|
30
|
+
const LAST = "This is the last round: the run stops whatever you answer. Answer stop, and in why say what the ask still lacks, or that it is answered.";
|
|
29
31
|
export async function review(round, model, options = {}) {
|
|
30
|
-
|
|
32
|
+
const planFile = options.planFile ?? defaultPlanFile(round.ask.kind);
|
|
33
|
+
const last = round.round >= round.budget.rounds;
|
|
34
|
+
const shown = last ? { ...round, notes: [...round.notes, LAST] } : round;
|
|
35
|
+
const { value: out } = await model.ask(reviewPrompt(shown, planFile), EdgeAnswer);
|
|
36
|
+
if (last)
|
|
31
37
|
return {
|
|
32
38
|
next: "stop",
|
|
33
|
-
why: `round budget spent (${round.round} of ${round.budget.rounds})`,
|
|
39
|
+
why: `round budget spent (${round.round} of ${round.budget.rounds}): ${out.why}`,
|
|
34
40
|
from: "ai",
|
|
35
|
-
by:
|
|
41
|
+
by: model.id,
|
|
36
42
|
};
|
|
37
|
-
}
|
|
38
|
-
const planFile = options.planFile ?? defaultPlanFile(round.ask.kind);
|
|
39
|
-
const { value: out } = await model.ask(reviewPrompt(round, planFile), EdgeAnswer);
|
|
40
43
|
const edge = { next: out.next, why: out.why, from: "ai", by: model.id };
|
|
41
44
|
if (out.next === "back")
|
|
42
45
|
edge.to = out.to ?? "fetch";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrenautomation/raven",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Ask in, plan out. The planner of Wren's research engine: typed queries with who proposed them and why, proposals merged into one plan under a plan file per ask kind, read-or-skip on hits, and the edge to take after a round. Pure functions and prompts; the model is injected.",
|
|
5
5
|
"license": "PolyForm-Shield-1.0.0",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"commander": "15.0.0",
|
|
34
34
|
"zod": "4.6.5",
|
|
35
|
-
"@wrenautomation/models": "0.8.
|
|
35
|
+
"@wrenautomation/models": "0.8.2"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"typecheck": "tsc --noEmit",
|