@spendgraph/workflows 0.2.0 → 0.2.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/README.md +8 -0
- package/dist/noesis/attribution.js +0 -20
- package/dist/noesis/context.js +0 -8
- package/dist/noesis/draft/draft.js +0 -13
- package/dist/noesis/events.js +0 -10
- package/dist/noesis/execute/execute.js +0 -17
- package/dist/noesis/execute/order.js +0 -8
- package/dist/noesis/gates/closure-checklist/invoke.js +0 -1
- package/dist/noesis/gates/closure-checklist/prompt.js +0 -2
- package/dist/noesis/gates/cqot-gate/invoke.js +0 -1
- package/dist/noesis/gates/cqot-gate/prompt.js +0 -2
- package/dist/noesis/gates/premortem/invoke.js +0 -1
- package/dist/noesis/gates/premortem/prompt.js +0 -2
- package/dist/noesis/gates/red-team/invoke.js +0 -1
- package/dist/noesis/gates/red-team/prompt.js +0 -2
- package/dist/noesis/gates/standards-review/invoke.js +0 -1
- package/dist/noesis/gates/standards-review/prompt.js +0 -2
- package/dist/noesis/gates/think-checkpoint/invoke.js +0 -1
- package/dist/noesis/gates/think-checkpoint/prompt.js +0 -2
- package/dist/noesis/producers/cove-answers/invoke.js +0 -1
- package/dist/noesis/producers/cove-answers/prompt.js +0 -2
- package/dist/noesis/producers/cove-questions/invoke.js +0 -1
- package/dist/noesis/producers/cove-questions/prompt.js +0 -2
- package/dist/noesis/producers/decompose/invoke.js +0 -1
- package/dist/noesis/producers/decompose/prompt.js +0 -18
- package/dist/noesis/producers/discriminating-test/invoke.js +0 -1
- package/dist/noesis/producers/discriminating-test/prompt.js +0 -2
- package/dist/noesis/producers/plan-candidates/invoke.js +0 -1
- package/dist/noesis/producers/plan-candidates/prompt.js +0 -2
- package/dist/noesis/producers/qn-brief/invoke.js +0 -1
- package/dist/noesis/producers/qn-brief/prompt.js +0 -9
- package/dist/noesis/producers/toulmin/answer.js +0 -21
- package/dist/noesis/producers/toulmin/invoke.js +0 -10
- package/dist/noesis/producers/toulmin/prompt.js +0 -9
- package/dist/noesis/producers/toulmin/render.js +0 -24
- package/dist/noesis/question.js +0 -19
- package/dist/noesis/repair/reflection/invoke.js +0 -1
- package/dist/noesis/repair/reflection/prompt.js +0 -2
- package/dist/noesis/retry.js +0 -34
- package/dist/noesis/route.js +0 -27
- package/dist/noesis/router/triage/invoke.js +0 -23
- package/dist/noesis/router/triage/prompt.js +0 -8
- package/dist/noesis/run/artifacts.js +0 -17
- package/dist/noesis/run/errors.js +0 -18
- package/dist/noesis/run/ledger.js +0 -13
- package/dist/noesis/run/loop.js +0 -19
- package/dist/noesis/run/plan.js +0 -13
- package/dist/noesis/run/produce.js +0 -34
- package/dist/noesis/run/redo.js +0 -20
- package/dist/noesis/run/result.js +0 -8
- package/dist/noesis/run/run.js +0 -21
- package/dist/noesis/run/stages/classify.js +0 -1
- package/dist/noesis/run/stages/direct.js +0 -1
- package/dist/noesis/run/stages/full.js +0 -9
- package/dist/noesis/run/stages/retrieve.js +0 -8
- package/dist/noesis/run/stages/standard.js +0 -7
- package/dist/noesis/run/state.js +0 -4
- package/dist/noesis/run/stream.js +0 -13
- package/dist/noesis/run/verify.js +0 -18
- package/dist/noesis/slugs.js +0 -14
- package/dist/noesis/stage.js +0 -10
- package/dist/noesis/started.js +0 -15
- package/dist/noesis/usage.js +0 -16
- package/dist/noesis/verify/verify.js +0 -29
- package/package.json +7 -7
|
@@ -1,36 +1,8 @@
|
|
|
1
1
|
const DEFAULT_FLOOR = 0.6;
|
|
2
|
-
/**
|
|
3
|
-
* What a check can honestly have been settled by when 5B is given no tools.
|
|
4
|
-
*
|
|
5
|
-
* `coveAnswers` is called with a client, a model and a question — there is no
|
|
6
|
-
* `ToolBus` on that call, so parametric memory is the only thing the stage can
|
|
7
|
-
* have used. Every other value in the enum is reachable only by passing a wider
|
|
8
|
-
* set to `compare()`, which is the caller saying it wired the tools up.
|
|
9
|
-
*/
|
|
10
2
|
export const SETTLED_WITHOUT_TOOLS = new Set(["knowledge"]);
|
|
11
|
-
/**
|
|
12
|
-
* The questions as 5B is allowed to see them: ids and questions, nothing else.
|
|
13
|
-
*
|
|
14
|
-
* `claim_it_tests` and `claim_type` are stripped here rather than trusted to a
|
|
15
|
-
* prompt. Answering blind is the whole reason 5A and 5B are two stages, and a
|
|
16
|
-
* stage that can read the claim will answer the claim.
|
|
17
|
-
*/
|
|
18
3
|
export function blind(questions) {
|
|
19
4
|
return questions.questions.map((q) => `${q.id}. ${q.question}`).join("\n");
|
|
20
5
|
}
|
|
21
|
-
/**
|
|
22
|
-
* 5A and 5B paired back together by id.
|
|
23
|
-
*
|
|
24
|
-
* In code because it has to be: whatever does this sees both the claim and the
|
|
25
|
-
* answer that was written without it, and a model given both is no longer a
|
|
26
|
-
* blind check of anything.
|
|
27
|
-
*
|
|
28
|
-
* A reply that named no provenance at all is not overclaiming. `checked_by` is
|
|
29
|
-
* required by the schema and nothing checks a reply against it on the way back,
|
|
30
|
-
* so an absent one is the model being terse rather than the stage claiming a
|
|
31
|
-
* tool it never had — it settles to `knowledge`, which is the floor anyway, and
|
|
32
|
-
* is not reported as a correction nobody made.
|
|
33
|
-
*/
|
|
34
6
|
export function compare(questions, answers, floor = DEFAULT_FLOOR, settledBy = SETTLED_WITHOUT_TOOLS) {
|
|
35
7
|
const replies = new Map(answers.answers.map((a) => [a.id, a]));
|
|
36
8
|
const asked = new Set(questions.questions.map((q) => q.id));
|
|
@@ -71,7 +43,6 @@ export function compare(questions, answers, floor = DEFAULT_FLOOR, settledBy = S
|
|
|
71
43
|
};
|
|
72
44
|
}
|
|
73
45
|
const line = (c) => `${c.id}. ${c.claim}\n asked: ${c.question}\n found: ${c.unknown ? "nothing" : c.answer} (${c.settled ? "settled" : "unsettled"}, confidence ${c.confidence})${c.as_of ? `\n as of: ${c.as_of}` : ""}`;
|
|
74
|
-
/** The verification as a stage reads it. */
|
|
75
46
|
export function render(verification) {
|
|
76
47
|
const parts = [
|
|
77
48
|
`<checks>\n${verification.checked.length
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spendgraph/workflows",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Ready-made workflows assembled from the spendgraph packages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"README.md"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@spendgraph/harness": "^0.2.
|
|
37
|
-
"@spendgraph/llms": "^0.2.
|
|
38
|
-
"@spendgraph/prompt": "^0.2.
|
|
39
|
-
"@spendgraph/tools": "^0.2.
|
|
36
|
+
"@spendgraph/harness": "^0.2.1",
|
|
37
|
+
"@spendgraph/llms": "^0.2.1",
|
|
38
|
+
"@spendgraph/prompt": "^0.2.1",
|
|
39
|
+
"@spendgraph/tools": "^0.2.1"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
|
-
"build": "tsc -p tsconfig.json",
|
|
42
|
+
"build": "tsc -p tsconfig.json --emitDeclarationOnly && tsc -p tsconfig.json --declaration false --removeComments",
|
|
43
43
|
"prebuild": "npm run build --workspace @spendgraph/harness --workspace @spendgraph/llms --workspace @spendgraph/prompt --workspace @spendgraph/tools",
|
|
44
44
|
"test": "vitest run",
|
|
45
45
|
"eval": "vitest run --config evals/vitest.config.mts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@locusgraph/client": "^0.8.1",
|
|
50
|
-
"@spendgraph/evals": "^0.2.
|
|
50
|
+
"@spendgraph/evals": "^0.2.1",
|
|
51
51
|
"typescript": "^5"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|