@parcha/agentrun-serve 0.1.0-beta.33 → 0.1.0-beta.34
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/CHANGELOG.md +233 -0
- package/README.md +266 -201
- package/dist/adapters.d.ts +0 -4
- package/dist/adapters.js +11 -15
- package/dist/agent-rows.d.ts +98 -0
- package/dist/agent-rows.js +1 -0
- package/dist/agents-store.d.ts +6 -2
- package/dist/agents-store.js +60 -25
- package/dist/agents.d.ts +9 -125
- package/dist/agents.js +15 -305
- package/dist/answer-json.d.ts +23 -0
- package/dist/answer-json.js +58 -0
- package/dist/api-only.d.ts +1 -1
- package/dist/api-only.js +2 -2
- package/dist/bash-read-only.d.ts +22 -0
- package/dist/bash-read-only.js +701 -0
- package/dist/box-settings.d.ts +3 -23
- package/dist/box-settings.js +7 -51
- package/dist/boxes.d.ts +17 -0
- package/dist/boxes.js +27 -20
- package/dist/browser-commands.d.ts +5 -2
- package/dist/browser-commands.js +4 -4
- package/dist/browser-computer.d.ts +5 -0
- package/dist/browser-computer.js +21 -0
- package/dist/browser-cost.d.ts +9 -6
- package/dist/browser-cost.js +92 -50
- package/dist/browser-live.d.ts +7 -20
- package/dist/browser-live.js +15 -93
- package/dist/browser-person.d.ts +18 -51
- package/dist/browser-person.js +94 -277
- package/dist/cap.d.ts +8 -5
- package/dist/cap.js +12 -5
- package/dist/cli.js +39 -13
- package/dist/closed-pipes.d.ts +2 -0
- package/dist/closed-pipes.js +13 -0
- package/dist/computer-commands.d.ts +2 -0
- package/dist/computer-commands.js +2 -0
- package/dist/computer-keys.js +5 -2
- package/dist/computer-setting.d.ts +20 -4
- package/dist/computer-setting.js +25 -5
- package/dist/computers.d.ts +30 -2
- package/dist/computers.js +70 -11
- package/dist/confine.d.ts +120 -0
- package/dist/confine.js +436 -0
- package/dist/console/assets/index-RPHGlXmM.js +540 -0
- package/dist/console/assets/index-opTN5Naq.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/decision-rows.d.ts +1 -1
- package/dist/decision-rows.js +1 -1
- package/dist/docker-daemon.d.ts +31 -0
- package/dist/docker-daemon.js +56 -0
- package/dist/effort-guidance.js +4 -3
- package/dist/environment.d.ts +0 -3
- package/dist/environment.js +3 -5
- package/dist/errors.d.ts +0 -2
- package/dist/errors.js +6 -9
- package/dist/filed-answer.d.ts +32 -0
- package/dist/filed-answer.js +160 -0
- package/dist/files.d.ts +1 -3
- package/dist/files.js +2 -4
- package/dist/github-connection.d.ts +1 -1
- package/dist/graph-view.d.ts +3 -5
- package/dist/graph-view.js +4 -14
- package/dist/handed-values.d.ts +9 -0
- package/dist/handed-values.js +26 -0
- package/dist/harness-install.d.ts +1 -7
- package/dist/harness-install.js +1 -18
- package/dist/harness-opencode/adapter.d.ts +7 -0
- package/dist/harness-opencode/adapter.js +23 -6
- package/dist/harness-opencode/index.d.ts +1 -1
- package/dist/harness-opencode/index.js +1 -1
- package/dist/harness-opencode/verify.d.ts +17 -0
- package/dist/harness-opencode/verify.js +30 -10
- package/dist/harness-table.js +6 -1
- package/dist/heard.js +1 -1
- package/dist/held-fd.d.ts +5 -0
- package/dist/held-fd.js +14 -0
- package/dist/host-calls.d.ts +20 -0
- package/dist/host-calls.js +12 -0
- package/dist/host-tools.d.ts +4 -21
- package/dist/host-tools.js +4 -61
- package/dist/host.d.ts +2 -4
- package/dist/host.js +2 -7
- package/dist/import-summary.d.ts +1 -5
- package/dist/import-summary.js +0 -21
- package/dist/import.d.ts +6 -6
- package/dist/import.js +14 -15
- package/dist/key-refusal.d.ts +5 -1
- package/dist/key-refusal.js +19 -4
- package/dist/learn/check.d.ts +6 -2
- package/dist/learn/check.js +83 -29
- package/dist/learn/folder.d.ts +5 -1
- package/dist/learn/folder.js +10 -3
- package/dist/learn/grade.d.ts +14 -0
- package/dist/learn/grade.js +68 -12
- package/dist/learn/index.d.ts +4 -4
- package/dist/learn/index.js +4 -4
- package/dist/learn/reflect.d.ts +31 -2
- package/dist/learn/reflect.js +79 -4
- package/dist/learn/relevance.d.ts +24 -0
- package/dist/learn/relevance.js +91 -0
- package/dist/learn/secrets.d.ts +7 -1
- package/dist/learn/secrets.js +86 -19
- package/dist/learn/skills.d.ts +112 -14
- package/dist/learn/skills.js +556 -52
- package/dist/learned-workflow.d.ts +32 -1
- package/dist/learned-workflow.js +100 -9
- package/dist/learning-routes.d.ts +8 -4
- package/dist/learning-routes.js +23 -9
- package/dist/learning-run.d.ts +9 -26
- package/dist/learning-run.js +22 -32
- package/dist/learning-words.d.ts +12 -5
- package/dist/learning-words.js +18 -9
- package/dist/learning.d.ts +93 -77
- package/dist/learning.js +176 -304
- package/dist/live/stream.js +1 -1
- package/dist/live/translate.js +12 -2
- package/dist/local-models.d.ts +11 -5
- package/dist/local-models.js +13 -8
- package/dist/mcp-gateway.d.ts +11 -49
- package/dist/mcp-gateway.js +44 -135
- package/dist/mcp-oauth.d.ts +10 -14
- package/dist/mcp-oauth.js +14 -32
- package/dist/mcp-probe.d.ts +0 -7
- package/dist/mcp-probe.js +4 -10
- package/dist/mcp-servers-store.d.ts +6 -6
- package/dist/mcp-servers-store.js +12 -14
- package/dist/mcp-store.js +3 -4
- package/dist/mcp.js +4 -3
- package/dist/model.d.ts +6 -7
- package/dist/model.js +43 -27
- package/dist/monid.d.ts +0 -2
- package/dist/monid.js +3 -6
- package/dist/openapi.d.ts +8 -1
- package/dist/openapi.js +121 -47
- package/dist/page.d.ts +1 -3
- package/dist/page.js +6 -18
- package/dist/paid-calls.d.ts +21 -27
- package/dist/paid-calls.js +25 -60
- package/dist/propose.js +83 -39
- package/dist/push-handler.d.ts +1 -1
- package/dist/reflect-range.d.ts +25 -0
- package/dist/reflect-range.js +30 -0
- package/dist/refusal-words.d.ts +5 -1
- package/dist/refusal-words.js +5 -1
- package/dist/rows.d.ts +1 -1
- package/dist/run-cut.d.ts +0 -6
- package/dist/run-cut.js +0 -6
- package/dist/run-db.d.ts +2 -11
- package/dist/run-db.js +2 -37
- package/dist/run-launch.d.ts +19 -2
- package/dist/run-launch.js +13 -5
- package/dist/run-learning-served.d.ts +10 -4
- package/dist/run-learning-served.js +23 -13
- package/dist/run-reads-over-store.d.ts +1 -1
- package/dist/run-reads-over-store.js +15 -6
- package/dist/run-secrets.d.ts +1 -1
- package/dist/run-timeline-served.d.ts +5 -1
- package/dist/run-timeline-served.js +15 -4
- package/dist/run-view.d.ts +7 -8
- package/dist/run-view.js +26 -7
- package/dist/runnable.d.ts +18 -10
- package/dist/runnable.js +21 -10
- package/dist/runner/adapter-loop.d.ts +6 -1
- package/dist/runner/adapter-loop.js +423 -53
- package/dist/runner/adapter-run-spec.d.ts +21 -8
- package/dist/runner/adapter-run-spec.js +90 -32
- package/dist/runner/adapters/index.js +11 -1
- package/dist/runner/adapters/pi.d.ts +12 -2
- package/dist/runner/adapters/pi.js +16 -5
- package/dist/runner/beside.d.ts +30 -3
- package/dist/runner/beside.js +36 -5
- package/dist/runner/claim-secrets.d.ts +10 -1
- package/dist/runner/claim-secrets.js +48 -14
- package/dist/runner/cli-run-spec.d.ts +2 -0
- package/dist/runner/cli-run-spec.js +45 -16
- package/dist/runner/commands.js +1 -1
- package/dist/runner/computer-journal.d.ts +15 -2
- package/dist/runner/computer-journal.js +41 -5
- package/dist/runner/conformance/harness.js +118 -8
- package/dist/runner/conformance/subject.d.ts +4 -1
- package/dist/runner/dispatch.d.ts +8 -1
- package/dist/runner/dispatch.js +81 -7
- package/dist/runner/end-of-run.d.ts +8 -2
- package/dist/runner/end-of-run.js +10 -4
- package/dist/runner/github-app.js +1 -1
- package/dist/runner/harness-loops.d.ts +9 -1
- package/dist/runner/harness-loops.js +15 -2
- package/dist/runner/journal-kinds.d.ts +24 -6
- package/dist/runner/journal-kinds.js +20 -5
- package/dist/runner/journal-reader.d.ts +1 -1
- package/dist/runner/journal-reader.js +2 -2
- package/dist/runner/learning-ask.d.ts +4 -0
- package/dist/runner/learning-ask.js +15 -1
- package/dist/runner/learning-end.d.ts +18 -3
- package/dist/runner/learning-end.js +113 -11
- package/dist/runner/learning-loop.d.ts +5 -0
- package/dist/runner/learning-loop.js +26 -6
- package/dist/runner/main.d.ts +56 -9
- package/dist/runner/main.js +127 -18
- package/dist/runner/mcp-claim.js +1 -2
- package/dist/runner/mcp-run.d.ts +2 -0
- package/dist/runner/mcp-run.js +15 -5
- package/dist/runner/memory-claim.d.ts +9 -0
- package/dist/runner/memory-claim.js +25 -0
- package/dist/runner/metrics.d.ts +33 -1
- package/dist/runner/metrics.js +85 -1
- package/dist/runner/model-route.d.ts +13 -0
- package/dist/runner/model-route.js +133 -9
- package/dist/runner/reflect-hook.d.ts +12 -1
- package/dist/runner/reflect-hook.js +33 -3
- package/dist/runner/runner.d.ts +20 -0
- package/dist/runner/runner.js +56 -10
- package/dist/runner/store-port.d.ts +1 -1
- package/dist/runner/store-secrets.d.ts +3 -3
- package/dist/runner/store-secrets.js +8 -12
- package/dist/runner/text-tools.d.ts +44 -0
- package/dist/runner/text-tools.js +237 -0
- package/dist/runner/workflow-loop.d.ts +6 -0
- package/dist/runner/workflow-loop.js +6 -4
- package/dist/runner/workflow-spec.d.ts +18 -0
- package/dist/runner/workflow-spec.js +63 -17
- package/dist/runs-over-store.d.ts +7 -2
- package/dist/runs-over-store.js +60 -14
- package/dist/seal-key.js +5 -43
- package/dist/sealed-settings-store.d.ts +19 -4
- package/dist/sealed-settings-store.js +9 -9
- package/dist/sealing.d.ts +4 -0
- package/dist/sealing.js +20 -0
- package/dist/secret-cut.d.ts +1 -1
- package/dist/secret-cut.js +1 -1
- package/dist/secret-name.d.ts +9 -0
- package/dist/secret-name.js +15 -0
- package/dist/secret-writes.d.ts +0 -1
- package/dist/secret-writes.js +0 -1
- package/dist/server-fs.d.ts +4 -0
- package/dist/server-fs.js +8 -2
- package/dist/server-lock.d.ts +0 -24
- package/dist/server-lock.js +1 -80
- package/dist/server-secrets-store.d.ts +4 -4
- package/dist/server-secrets-store.js +9 -31
- package/dist/server-secrets.d.ts +4 -9
- package/dist/server-secrets.js +12 -36
- package/dist/server.d.ts +16 -38
- package/dist/server.js +145 -106
- package/dist/sign-ins-store.d.ts +34 -36
- package/dist/sign-ins-store.js +27 -38
- package/dist/sign-ins.d.ts +2 -119
- package/dist/sign-ins.js +5 -311
- package/dist/standard-webhooks.d.ts +1 -1
- package/dist/standard-webhooks.js +1 -1
- package/dist/stats.d.ts +3 -2
- package/dist/stats.js +1 -1
- package/dist/store/agent-body.d.ts +8 -2
- package/dist/store/agent-body.js +16 -4
- package/dist/store/index.d.ts +2 -2
- package/dist/store/index.js +2 -2
- package/dist/store/open.d.ts +6 -3
- package/dist/store/open.js +2 -2
- package/dist/store/postgres/connection.d.ts +18 -2
- package/dist/store/postgres/connection.js +156 -32
- package/dist/store/postgres/migrate.d.ts +4 -0
- package/dist/store/postgres/migrate.js +9 -2
- package/dist/store/postgres/migrations/0003_commands_one_answer.check.sql +19 -0
- package/dist/store/postgres/migrations/0003_commands_one_answer.sql +13 -0
- package/dist/store/postgres/store.d.ts +9 -2
- package/dist/store/postgres/store.js +9 -0
- package/dist/store/schema.js +1 -1
- package/dist/store/seal.js +2 -2
- package/dist/store/sqlite/connection.js +49 -5
- package/dist/store/sqlite/run-patch.d.ts +3 -0
- package/dist/store/sqlite/run-patch.js +3 -0
- package/dist/store/sqlite/store.js +41 -12
- package/dist/store/store.d.ts +35 -6
- package/dist/store/store.js +12 -2
- package/dist/store-reads/cap.d.ts +1 -1
- package/dist/store-reads/cap.js +22 -4
- package/dist/store-reads/journal.d.ts +9 -6
- package/dist/store-reads/journal.js +93 -17
- package/dist/store-reads/learning.d.ts +26 -8
- package/dist/store-reads/learning.js +12 -4
- package/dist/store-reads/workflow.d.ts +1 -1
- package/dist/store-reads/workflow.js +1 -1
- package/dist/store-view.d.ts +5 -1
- package/dist/store-view.js +53 -18
- package/dist/template-eval.d.ts +60 -4
- package/dist/template-eval.js +120 -54
- package/dist/templates.d.ts +24 -10
- package/dist/templates.js +69 -38
- package/dist/timeline/group.d.ts +33 -0
- package/dist/timeline/group.js +77 -0
- package/dist/timeline/index.d.ts +7 -0
- package/dist/timeline/index.js +7 -0
- package/dist/timeline/labels.d.ts +79 -0
- package/dist/timeline/labels.js +150 -0
- package/dist/timeline/origin.d.ts +56 -0
- package/dist/timeline/origin.js +92 -0
- package/dist/timeline/render-text.d.ts +11 -0
- package/dist/timeline/render-text.js +62 -0
- package/dist/timeline/timeline.d.ts +274 -0
- package/dist/timeline/timeline.js +1308 -0
- package/dist/timeline/util.d.ts +17 -0
- package/dist/timeline/util.js +49 -0
- package/dist/tool-gate.d.ts +41 -216
- package/dist/tool-gate.js +79 -540
- package/dist/tool-keys-store.d.ts +11 -12
- package/dist/tool-keys-store.js +24 -31
- package/dist/tool-keys.d.ts +5 -101
- package/dist/tool-keys.js +8 -267
- package/dist/tool-plane.d.ts +14 -42
- package/dist/tool-plane.js +23 -81
- package/dist/tool-settings-store.d.ts +1 -2
- package/dist/tool-settings-store.js +5 -8
- package/dist/tools.d.ts +30 -18
- package/dist/tools.js +97 -107
- package/dist/trigger-adapter.d.ts +2 -2
- package/dist/trigger-targets.d.ts +13 -1
- package/dist/trigger-targets.js +31 -1
- package/dist/triggers.d.ts +2 -2
- package/dist/triggers.js +3 -3
- package/dist/turn-end.d.ts +1 -1
- package/dist/turn-end.js +1 -1
- package/dist/turns.d.ts +0 -6
- package/dist/turns.js +0 -19
- package/dist/uploads.js +1 -1
- package/dist/usage.d.ts +0 -2
- package/dist/usage.js +0 -2
- package/dist/validate.d.ts +2 -0
- package/dist/validate.js +23 -14
- package/dist/webhooks.d.ts +102 -76
- package/dist/webhooks.js +266 -233
- package/dist/workflow-run.d.ts +114 -0
- package/dist/workflow-run.js +144 -0
- package/dist/workspace/beneath.d.ts +19 -0
- package/dist/workspace/beneath.js +106 -0
- package/dist/workspace/computer-deps.d.ts +24 -6
- package/dist/workspace/computer-deps.js +108 -20
- package/dist/workspace/computer-for-claim.d.ts +12 -11
- package/dist/workspace/computer-for-claim.js +76 -15
- package/dist/workspace/computer-hold.d.ts +6 -1
- package/dist/workspace/computer-hold.js +6 -1
- package/dist/workspace/computer-janitor.d.ts +47 -0
- package/dist/workspace/computer-janitor.js +182 -0
- package/dist/workspace/grep-worker.d.ts +5 -0
- package/dist/workspace/grep-worker.js +9 -6
- package/dist/workspace/index.d.ts +3 -2
- package/dist/workspace/index.js +3 -3
- package/dist/workspace/local.d.ts +11 -2
- package/dist/workspace/local.js +161 -43
- package/dist/workspace/resolve-computer.d.ts +50 -10
- package/dist/workspace/resolve-computer.js +46 -11
- package/dist/workspace/run-tools.d.ts +13 -31
- package/dist/workspace/run-tools.js +10 -27
- package/dist/workspace-paths.d.ts +0 -17
- package/dist/workspace-paths.js +1 -41
- package/dist/workspace.d.ts +0 -14
- package/dist/workspace.js +3 -96
- package/package.json +13 -13
- package/templates/README.md +9 -3
- package/templates/market-monitor/agent.md +2 -2
- package/templates/market-monitor/skills/monitor/SKILL.md +6 -4
- package/dist/bound-files.d.ts +0 -4
- package/dist/bound-files.js +0 -164
- package/dist/coding-tools.d.ts +0 -47
- package/dist/coding-tools.js +0 -189
- package/dist/computer-adb.d.ts +0 -12
- package/dist/computer-adb.js +0 -14
- package/dist/console/assets/index-Dn0ngwG9.js +0 -535
- package/dist/console/assets/index-DvW6Aled.css +0 -1
- package/dist/grade.d.ts +0 -63
- package/dist/grade.js +0 -150
- package/dist/mcp-servers.d.ts +0 -269
- package/dist/mcp-servers.js +0 -456
- package/dist/packs.d.ts +0 -71
- package/dist/packs.js +0 -180
- package/dist/sealed-settings.d.ts +0 -60
- package/dist/sealed-settings.js +0 -171
- package/dist/sessions.d.ts +0 -6
- package/dist/sessions.js +0 -109
- package/dist/workspace/computer-serves.d.ts +0 -12
- package/dist/workspace/computer-serves.js +0 -15
|
@@ -5,6 +5,26 @@ import { type Ledger } from "./paid-calls.js";
|
|
|
5
5
|
import type { Plane } from "./tool-plane.js";
|
|
6
6
|
import { type SettingFrom } from "./tool-gate.js";
|
|
7
7
|
import type { Complete } from "./llm.js";
|
|
8
|
+
/** What a learned_workflow call's approval card says of its MCP calls' arguments: the workflow decides them as it runs. */
|
|
9
|
+
export declare const LEARNED_MCP_ARGUMENTS = "decided by the workflow while it runs, from its input and its earlier steps";
|
|
10
|
+
/** What a learned_workflow call's card shows of the MCP tools set to ask that the workflow can call: that their arguments
|
|
11
|
+
* are the workflow's to decide, then every one of them by name. The card leads with these (the call's own input after
|
|
12
|
+
* them), so they are never cut behind a long input. */
|
|
13
|
+
export declare const learnedAskShown: (asks: readonly string[]) => Record<string, unknown>;
|
|
14
|
+
/** The most bytes of the card those fields may take: the card's preview is cut at ARGS_PREVIEW_BYTES (2 KB), and its
|
|
15
|
+
* braces and the call's name follow them. A workflow whose ask-gated MCP tools would not all show is refused, never
|
|
16
|
+
* approved by a person who could not see what they approved. */
|
|
17
|
+
export declare const LEARNED_ASK_CARD_BYTES: number;
|
|
18
|
+
/** Whether every MCP tool set to ask that the workflow can call fits on its card (learnedAskShown, LEARNED_ASK_CARD_BYTES). */
|
|
19
|
+
export declare const learnedAskFits: (asks: readonly string[]) => boolean;
|
|
20
|
+
/** The MCP tools a person's approval of a learned_workflow call covers: exactly those its card named (learnedAskShown's
|
|
21
|
+
* `mcp_calls`, read from the card they approved, host-calls.ts HostCalls.approved). None when no person approved it,
|
|
22
|
+
* or the card named none. A tool set to ask that the card did not name (one set to ask after the card was shown) is
|
|
23
|
+
* never run under that approval. */
|
|
24
|
+
export declare const learnedApprovedTools: (card: Readonly<Record<string, unknown>> | undefined) => ReadonlySet<string>;
|
|
25
|
+
/** The MCP tools a learned workflow's call nodes name (`via: "tool"`, `tool: "mcp:<server>/<tool>"`), each once; none for
|
|
26
|
+
* one that does not read. The run's gate asks about them before the workflow's call runs (adapter-run-spec.ts). */
|
|
27
|
+
export declare function learnedMcpTools(workflow: string): Promise<string[]>;
|
|
8
28
|
export declare const LEARNED_WORKFLOW_TOOL = "learned_workflow";
|
|
9
29
|
/** One line of a learned workflow's output for its row: an object's fields as `name value`, each value whole or, when
|
|
10
30
|
* longer than VALUE_MAX, only as its size, and whole fields only until LINE_MAX. Nothing is ever cut inside a value:
|
|
@@ -47,6 +67,14 @@ export type LearnedWorkflowRun = {
|
|
|
47
67
|
* each call node runs, before `policy` is asked: a tool set to deny since the call began is then refused. None: the
|
|
48
68
|
* gate reads its settings live (main's process). */
|
|
49
69
|
refresh?: () => Promise<void>;
|
|
70
|
+
/** The run's MCP tools by catalog name (`mcp:<server>/<tool>`): those the claim's pin holds, which its revision grants.
|
|
71
|
+
* A call node may name one of these; it runs through the run's own MCP, as the loop wrapped it (host-calls.ts). */
|
|
72
|
+
mcpTools?: readonly string[];
|
|
73
|
+
/** The gate's whole decision of an MCP node's call with its arguments, as the run's own call of the tool gets it
|
|
74
|
+
* (RunGate.decide: deny, argument pins, ask, no approver). Required for an MCP node: one with none is never sent. */
|
|
75
|
+
decide?: (tool: string, args: unknown) => Promise<"allow" | "ask" | {
|
|
76
|
+
deny: string;
|
|
77
|
+
}>;
|
|
50
78
|
};
|
|
51
79
|
/** The most characters of a learned workflow's output its answer holds, monid's bound (monid.ts CLIP): within the
|
|
52
80
|
* host's result bound, which each CLI is told to pass whole (host-bounds.test). */
|
|
@@ -57,7 +85,10 @@ export declare function learnedText(text: string): string;
|
|
|
57
85
|
/** What a learned workflow's model node is refused with when it names a tool: it runs in a session of its own here.
|
|
58
86
|
* The check before the run refuses such a workflow first (draftProblems); this one holds should it not. */
|
|
59
87
|
export declare const NODE_TOOLS_REFUSED = "a learned workflow's model node runs without tools here";
|
|
60
|
-
/** The tool's description
|
|
88
|
+
/** The tool's description, sent with every model request of the run, so it holds what a model needs to call it right and
|
|
89
|
+
* no more: one line of what the tool does (one call, by name, a JSON input with the listed fields, `*` marking a required
|
|
90
|
+
* one; what it answers), then each workflow on a line of its own (workflowLine): its name, its input's fields and the
|
|
91
|
+
* line its README says what it does with. */
|
|
61
92
|
export declare const learnedWorkflowDescription: (workflows: readonly LearnedWorkflow[]) => string;
|
|
62
93
|
/** The run's `learned_workflow` tool over `run.workflows`. */
|
|
63
94
|
export declare function learnedWorkflowTool(run: LearnedWorkflowRun): ToolRegistration;
|
package/dist/learned-workflow.js
CHANGED
|
@@ -1,12 +1,60 @@
|
|
|
1
1
|
import { defineTool } from "@earendil-works/pi-durable";
|
|
2
|
-
import { registerLabel, registerOutcome } from "
|
|
2
|
+
import { registerLabel, registerOutcome } from "./timeline/index.js";
|
|
3
3
|
import { sideRequests } from "./cap.js";
|
|
4
4
|
import { draftProblems, LEARNED_MAX_TURNS } from "./learn/index.js";
|
|
5
5
|
import { workflowLine } from "./learning.js";
|
|
6
6
|
import { ledgerOf } from "./paid-calls.js";
|
|
7
7
|
import { forModel } from "./result.js";
|
|
8
|
-
import { deniedText } from "./tool-gate.js";
|
|
9
|
-
import { allows, CALL_TOOLS, learnedDraftTools, toolOf } from "./tools.js";
|
|
8
|
+
import { ARGS_PREVIEW_BYTES, deniedText } from "./tool-gate.js";
|
|
9
|
+
import { allows, CALL_TOOLS, learnedDraftTools, toolOf, workflowTools } from "./tools.js";
|
|
10
|
+
import { hostCalls } from "./host-calls.js";
|
|
11
|
+
import { workflowNodes } from "./model.js";
|
|
12
|
+
/** What a learned_workflow call's approval card says of its MCP calls' arguments: the workflow decides them as it runs. */
|
|
13
|
+
export const LEARNED_MCP_ARGUMENTS = "decided by the workflow while it runs, from its input and its earlier steps";
|
|
14
|
+
/** What a learned_workflow call's card shows of the MCP tools set to ask that the workflow can call: that their arguments
|
|
15
|
+
* are the workflow's to decide, then every one of them by name. The card leads with these (the call's own input after
|
|
16
|
+
* them), so they are never cut behind a long input. */
|
|
17
|
+
export const learnedAskShown = (asks) => ({ mcp_arguments: LEARNED_MCP_ARGUMENTS, mcp_calls: [...asks] });
|
|
18
|
+
/** The most bytes of the card those fields may take: the card's preview is cut at ARGS_PREVIEW_BYTES (2 KB), and its
|
|
19
|
+
* braces and the call's name follow them. A workflow whose ask-gated MCP tools would not all show is refused, never
|
|
20
|
+
* approved by a person who could not see what they approved. */
|
|
21
|
+
export const LEARNED_ASK_CARD_BYTES = ARGS_PREVIEW_BYTES - 128;
|
|
22
|
+
/** Whether every MCP tool set to ask that the workflow can call fits on its card (learnedAskShown, LEARNED_ASK_CARD_BYTES). */
|
|
23
|
+
export const learnedAskFits = (asks) => Buffer.byteLength(JSON.stringify(learnedAskShown(asks)), "utf8") <= LEARNED_ASK_CARD_BYTES;
|
|
24
|
+
/** The MCP tools a person's approval of a learned_workflow call covers: exactly those its card named (learnedAskShown's
|
|
25
|
+
* `mcp_calls`, read from the card they approved, host-calls.ts HostCalls.approved). None when no person approved it,
|
|
26
|
+
* or the card named none. A tool set to ask that the card did not name (one set to ask after the card was shown) is
|
|
27
|
+
* never run under that approval. */
|
|
28
|
+
export const learnedApprovedTools = (card) => new Set(Array.isArray(card?.mcp_calls) ? card.mcp_calls.filter((name) => typeof name === "string") : []);
|
|
29
|
+
/** An MCP tool's catalog name, `mcp:<server>/<tool>`: a call node that names one runs it through the run's own MCP. */
|
|
30
|
+
const MCP_TOOL = /^mcp:[^/]+\/.+$/;
|
|
31
|
+
/** The MCP tools a learned workflow's call nodes name (`via: "tool"`, `tool: "mcp:<server>/<tool>"`), each once; none for
|
|
32
|
+
* one that does not read. The run's gate asks about them before the workflow's call runs (adapter-run-spec.ts). */
|
|
33
|
+
export async function learnedMcpTools(workflow) {
|
|
34
|
+
let doc;
|
|
35
|
+
try {
|
|
36
|
+
doc = JSON.parse(workflow);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
const { inspectWorkflow } = await import("@parcha/agentrun-dsl");
|
|
42
|
+
try {
|
|
43
|
+
return workflowTools(workflowNodes(doc, inspectWorkflow(doc))).calls.filter((tool) => MCP_TOOL.test(tool));
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** A call node's MCP result as the workflow's value: its text as JSON when it parses, else `{ text }`. */
|
|
50
|
+
const mcpValue = (text) => {
|
|
51
|
+
try {
|
|
52
|
+
return JSON.parse(text);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return { text };
|
|
56
|
+
}
|
|
57
|
+
};
|
|
10
58
|
export const LEARNED_WORKFLOW_TOOL = "learned_workflow";
|
|
11
59
|
/** The most of a learned workflow's output its result line shows, and the longest value it shows as written. */
|
|
12
60
|
const LINE_MAX = 120;
|
|
@@ -66,10 +114,12 @@ export function learnedText(text) {
|
|
|
66
114
|
/** What a learned workflow's model node is refused with when it names a tool: it runs in a session of its own here.
|
|
67
115
|
* The check before the run refuses such a workflow first (draftProblems); this one holds should it not. */
|
|
68
116
|
export const NODE_TOOLS_REFUSED = "a learned workflow's model node runs without tools here";
|
|
69
|
-
/** The tool's description
|
|
117
|
+
/** The tool's description, sent with every model request of the run, so it holds what a model needs to call it right and
|
|
118
|
+
* no more: one line of what the tool does (one call, by name, a JSON input with the listed fields, `*` marking a required
|
|
119
|
+
* one; what it answers), then each workflow on a line of its own (workflowLine): its name, its input's fields and the
|
|
120
|
+
* line its README says what it does with. */
|
|
70
121
|
export const learnedWorkflowDescription = (workflows) => [
|
|
71
|
-
"
|
|
72
|
-
"schema says. It answers the workflow's output as JSON, or why it did not run. The workflows:",
|
|
122
|
+
"Runs one of this agent's learned workflows in one call, by name, on a JSON input with the fields below (* required). Answers its output as JSON, or why it did not run.",
|
|
73
123
|
...workflows.map(workflowLine),
|
|
74
124
|
].join("\n");
|
|
75
125
|
/** One model request as a pi-ai event stream, sent through `models.completeSimple` as the run's own request, under its
|
|
@@ -109,8 +159,9 @@ export function learnedWorkflowTool(run) {
|
|
|
109
159
|
additionalProperties: false,
|
|
110
160
|
required: ["name", "input"],
|
|
111
161
|
properties: {
|
|
112
|
-
|
|
113
|
-
|
|
162
|
+
// No words of their own: the description says what each is, and the parameters go with every request too.
|
|
163
|
+
name: { type: "string", enum: names },
|
|
164
|
+
input: { type: "object" },
|
|
114
165
|
},
|
|
115
166
|
},
|
|
116
167
|
execute: async (args, api, context) => {
|
|
@@ -137,6 +188,20 @@ export async function runLearned(run, flow, input, signal, ledger) {
|
|
|
137
188
|
if (typeof run.policy !== "function" || typeof run.denyFrom !== "function")
|
|
138
189
|
return refuse("its run gave no tool policy for its call nodes");
|
|
139
190
|
const { tools, gated, deniedBy } = learnedDraftTools(run.granted, run.policy, run.plane, run.denyFrom);
|
|
191
|
+
// The run's MCP tools, held to the same gate: one set to allow may be named, and one set to ask only when a person
|
|
192
|
+
// approved this call with a card that named it (its ask is the call's own: adapter-run-spec.ts adapterRunGate); one set
|
|
193
|
+
// to deny is refused in its words. One the run's pin does not hold is no tool of the run at all.
|
|
194
|
+
const approved = learnedApprovedTools(hostCalls()?.approved);
|
|
195
|
+
for (const name of run.mcpTools ?? []) {
|
|
196
|
+
const setting = run.policy(name);
|
|
197
|
+
if (setting === "allow" || (setting === "ask" && approved.has(name)))
|
|
198
|
+
tools.push(name);
|
|
199
|
+
else {
|
|
200
|
+
gated[name] = setting;
|
|
201
|
+
if (setting === "deny")
|
|
202
|
+
deniedBy[name] = run.denyFrom(name);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
140
205
|
const problems = draftProblems(dsl, flow.workflow, tools, gated, deniedBy);
|
|
141
206
|
if (problems.length)
|
|
142
207
|
return refuse(problems.map(({ detail }) => detail).join("; "));
|
|
@@ -168,6 +233,32 @@ export async function runLearned(run, flow, input, signal, ledger) {
|
|
|
168
233
|
};
|
|
169
234
|
const runEffect = async ({ node, input: given, signal: own, executionPath, item }) => {
|
|
170
235
|
const tool = node.via === "tool" ? node.tool : undefined;
|
|
236
|
+
// Its call id under the workflow's call: the node, its execution path, its item in a map. Its paid requests are booked
|
|
237
|
+
// under it, as a call of its own.
|
|
238
|
+
const callId = `${ledger?.call ?? LEARNED_WORKFLOW_TOOL}/${node.label}@${executionPath ?? ""}${item ? `#${item.index}` : ""}`;
|
|
239
|
+
if (tool && MCP_TOOL.test(tool)) {
|
|
240
|
+
// An MCP tool of the run, through the run's own MCP as the loop wrapped it (its flush, its booking on the run's one
|
|
241
|
+
// ledger, a CLI's record, the stop's abort), after the gate's rule read again now, as the harness's own call is.
|
|
242
|
+
const send = (run.mcpTools ?? []).includes(tool) && run.decide ? hostCalls()?.mcp(tool) : undefined;
|
|
243
|
+
if (!send || !run.decide)
|
|
244
|
+
throw new Error(`call node "${node.label}": this agent runs no tool ${tool}`);
|
|
245
|
+
// The gate's whole decision of this call with the arguments the workflow resolved, as the harness's own call of the
|
|
246
|
+
// tool gets it: its deny, its argument pins (a messaging tool held to one channel), its ask, or no one to approve.
|
|
247
|
+
// The call's approval lifts only an ask, never a pin or a deny, and only for a tool its card named: one set to ask
|
|
248
|
+
// since the card was shown was never approved.
|
|
249
|
+
await run.refresh?.();
|
|
250
|
+
const verdict = await run.decide(tool, given);
|
|
251
|
+
if (typeof verdict === "object")
|
|
252
|
+
throw new Error(verdict.deny);
|
|
253
|
+
const card = hostCalls()?.approved;
|
|
254
|
+
if (verdict === "ask" && !learnedApprovedTools(card).has(tool)) {
|
|
255
|
+
throw new Error(card ? `This ${tool} call needs a person's approval, and the approval given for this learned workflow did not cover it: its card did not name ${tool}. It was not run.` : `This ${tool} call needs a person's approval, which was not given for this call; it was not run.`);
|
|
256
|
+
}
|
|
257
|
+
const answer = await send(given, { callId, signal: own });
|
|
258
|
+
if (answer.isError)
|
|
259
|
+
throw new Error(answer.text);
|
|
260
|
+
return mcpValue(answer.text);
|
|
261
|
+
}
|
|
171
262
|
const effect = tool && allows(CALL_TOOLS, tool) && tools.includes(tool) ? toolOf(tool)?.effect : undefined;
|
|
172
263
|
if (!effect)
|
|
173
264
|
throw new Error(`call node "${node.label}": this agent runs no tool ${tool ?? `via ${node.via}`}`);
|
|
@@ -181,7 +272,7 @@ export async function runLearned(run, flow, input, signal, ledger) {
|
|
|
181
272
|
if (permission === "ask")
|
|
182
273
|
throw new Error(`This ${tool} call needs a person's approval, which a workflow's call node cannot wait for; it was not run.`);
|
|
183
274
|
// Its paid requests booked under the tool's call, as a call of its own: the node, its execution path, its item in a map.
|
|
184
|
-
const booked = ledger ? { ledger: { call:
|
|
275
|
+
const booked = ledger ? { ledger: { call: callId, record: ledger.record } } : {};
|
|
185
276
|
return effect(given, { signal: own, env: run.env, work: run.work, ...(run.complete ? { complete: run.complete } : {}), ...booked });
|
|
186
277
|
};
|
|
187
278
|
try {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
-
import { type Problem } from "./learn/index.js";
|
|
3
2
|
import { type ItemStatus, type Learning, type NoteRuns, type Shown } from "./learning.js";
|
|
4
3
|
import type { Impact } from "./learning-run.js";
|
|
5
4
|
import type { Store } from "./store/store.js";
|
|
@@ -176,7 +175,11 @@ export declare function runLearningBody(input: {
|
|
|
176
175
|
keep: boolean;
|
|
177
176
|
}[];
|
|
178
177
|
} | null;
|
|
179
|
-
problems:
|
|
178
|
+
problems: {
|
|
179
|
+
detail: string;
|
|
180
|
+
path?: string | undefined;
|
|
181
|
+
rule: import("./learn/check.js").Rule;
|
|
182
|
+
}[];
|
|
180
183
|
cost_usd: {
|
|
181
184
|
grade: number | null;
|
|
182
185
|
};
|
|
@@ -190,7 +193,7 @@ export declare function runLearningBody(input: {
|
|
|
190
193
|
workflows?: import("./learning.js").LearnedFile[];
|
|
191
194
|
run: string;
|
|
192
195
|
state: "proposed" | "merged" | "seeded" | "reflecting" | "dropped";
|
|
193
|
-
reason: "empty" | "
|
|
196
|
+
reason: "empty" | "cancelled" | "unparsed" | "seed_failed" | "no_budget" | "unknown_cost" | "crashed" | "reflect_timeout" | "reflect_failed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
194
197
|
detail: string | null;
|
|
195
198
|
at: string;
|
|
196
199
|
};
|
|
@@ -199,7 +202,8 @@ export declare function runLearningBody(input: {
|
|
|
199
202
|
* its agent's learning folder); before, its kept proposal (new notes only, from its learning_proposals row) against its
|
|
200
203
|
* seed; a run that proposed nothing, no file, against the seed its launch's learning start names. A run that does not
|
|
201
204
|
* learn (no learning start and no learning end) is not_found. A file's patch is withheld when too large (as the script
|
|
202
|
-
* wrote it), or when it holds one of the host's secrets now (`shown`)
|
|
205
|
+
* wrote it), or when it holds one of the host's secrets now (`shown`); any other is served as every learning text is
|
|
206
|
+
* (`shown.text`: a loopback address reads "a local address"). */
|
|
203
207
|
export declare function runDiffOverStore(data: string, store: Store, runId: string, shown: Shown): Promise<{
|
|
204
208
|
base: string;
|
|
205
209
|
head: string;
|
package/dist/learning-routes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { approve, buildIndex, CAPS, checkNote, draftProblems, frontKeys, INDEX_FILE, INDEX_LINES, isHeld, LEARNED_KEYS, learnedName, learnedPlace, learnedStatus, NOTE_FILE, NOTE_STATUSES, parseNoteFile, printable, released, retire, retiredLearned, skillProblems, SKILLS_DIR, supersede, unstorable, WORKFLOWS_DIR } from "./learn/index.js";
|
|
1
|
+
import { approve, buildIndex, CAPS, checkNote, draftProblems, frontKeys, frontMatter, INDEX_FILE, INDEX_LINES, isHeld, LEARNED_KEYS, learnedName, learnedPlace, learnedStatus, statusOnOneLine, NOTE_FILE, NOTE_STATUSES, parseNoteFile, printable, released, retire, retiredLearned, skillProblems, SKILLS_DIR, supersede, UNCLEAR_FRONT, unstorable, WORKFLOWS_DIR } from "./learn/index.js";
|
|
2
2
|
import { beforeRetire, blobOid, FolderBusy, FolderRefused, FolderTooLarge, FolderUnreadable, heldOnMain, isBodyMismatch, readLearning, PATCH_CAP, readRunDiff, readSnapshot, snapshotNotes, writeLearning } from "./learn/folder.js";
|
|
3
3
|
import { ApiError, invalid } from "./errors.js";
|
|
4
|
-
import { detailShown, learningFolderOf, notesView, secretsShown, withAgentRepo } from "./learning.js";
|
|
4
|
+
import { detailShown, learningFolderOf, notesView, reasonShown, secretsShown, withAgentRepo } from "./learning.js";
|
|
5
5
|
import { isObject } from "./validate.js";
|
|
6
6
|
import { launchOf } from "./handed-values.js";
|
|
7
7
|
import { learningStartOf } from "./run-launch.js";
|
|
@@ -354,10 +354,13 @@ export async function writeNote(data, agentId, raw, input) {
|
|
|
354
354
|
throw new ApiError("precondition_failed", "The folder has a note by this name: read it, then edit it with If-Match.");
|
|
355
355
|
// A note whose text holds one of the host's secrets as they are now (a value made secret after it was written) is
|
|
356
356
|
// read cut of it, under its own ETag: an edit of what was shown would write the cut over the hidden text. Only a
|
|
357
|
-
// retire reaches it.
|
|
357
|
+
// retire reaches it. So is one holding a loopback address, read as "a local address" (secretsShown).
|
|
358
358
|
if (given !== undefined && current && secretsShown(input.refuse).holds(current.text)) {
|
|
359
359
|
throw refused([{ rule: "secret_value", path: file, detail: "This note holds a value the server now keeps secret, so its text was shown with that value hidden, and saving would replace the hidden text. Retire it and write a new note instead." }]);
|
|
360
360
|
}
|
|
361
|
+
if (given !== undefined && current && secretsShown(input.refuse).text(current.text) !== current.text) {
|
|
362
|
+
throw refused([{ rule: "note", path: file, detail: "This note holds a local address, so its text was shown with it hidden, and saving would replace it. Retire it and write a new note instead." }]);
|
|
363
|
+
}
|
|
361
364
|
let text = given;
|
|
362
365
|
// A note that waits for its owner's OK is made active by an approval alone: an edit keeps it waiting, so one that
|
|
363
366
|
// drops or changes its status is refused, whoever sends it.
|
|
@@ -389,6 +392,10 @@ export async function writeNote(data, agentId, raw, input) {
|
|
|
389
392
|
const kind = learned.kind === "skill" ? "skill" : "workflow";
|
|
390
393
|
if (status !== "retired")
|
|
391
394
|
throw new ApiError("bad_request", `The ${kind} is not retired: it is ${status}.`);
|
|
395
|
+
// Read as retired since its front matter reads no way, or its status is set on more than one line, which no
|
|
396
|
+
// writer edits (learnedStatus): refused until it is written so it does.
|
|
397
|
+
if (!frontMatter(current.text) || !statusOnOneLine(current.text))
|
|
398
|
+
throw refused([printable({ rule: kind, path: file, detail: UNCLEAR_FRONT }, input.refuse)]);
|
|
392
399
|
text = released(current.text);
|
|
393
400
|
const problems = skillProblems(text, learned.name).map((detail) => printable({ rule: kind, path: file, detail }, input.refuse));
|
|
394
401
|
const extra = (frontKeys(text) ?? []).filter((key) => !LEARNED_KEYS.includes(key) && key !== "status");
|
|
@@ -503,7 +510,7 @@ export function runLearningBody(input, shown, secrets) {
|
|
|
503
510
|
const { learning } = input;
|
|
504
511
|
const { state, reason, at, verdict, problems, merged, cost_usd, tokens, pending } = learning;
|
|
505
512
|
return {
|
|
506
|
-
run: input.id, state, reason, detail: detailShown(learning, shown), at,
|
|
513
|
+
run: input.id, state, reason: reasonShown(reason, shown), detail: detailShown(learning, shown), at,
|
|
507
514
|
// Once it settled (a run that runs again for a follow-up is still reading).
|
|
508
515
|
...notesView(learning, shown, input.settled),
|
|
509
516
|
seed: input.seed,
|
|
@@ -511,9 +518,10 @@ export function runLearningBody(input, shown, secrets) {
|
|
|
511
518
|
// The merge's notes that wait for a person's OK: on main as `status: pending`, read by no run until approved.
|
|
512
519
|
pending: (pending ?? []).map(({ file, name }) => ({ file: shown.name(file), name: shown.text(name) })),
|
|
513
520
|
// The grader's, with its item for each new note: a name holding one of the host's secrets reads [redacted], and
|
|
514
|
-
// each text is cut of them.
|
|
515
|
-
verdict: verdict ? { merge: verdict.merge, reason: shown.text(verdict.reason), items: (verdict.items ?? []).map(({ file, keep, pending: waits, origin, question, why }) => ({ file: shown.name(file), keep, ...(waits ? { pending: true } : {}), ...(origin ? { origin } : {}), ...(question ? { question: shown.text(question) } : {}), why: shown.text(why) })) } : null,
|
|
516
|
-
|
|
521
|
+
// each text is cut of them, its origin too (a kept row read back is untrusted).
|
|
522
|
+
verdict: verdict ? { merge: verdict.merge, reason: shown.text(verdict.reason), items: (verdict.items ?? []).map(({ file, keep, pending: waits, origin, question, why }) => ({ file: shown.name(file), keep, ...(waits ? { pending: true } : {}), ...(origin ? { origin: shown.text(origin) } : {}), ...(question ? { question: shown.text(question) } : {}), why: shown.text(why) })) } : null,
|
|
523
|
+
// Each cut of the host's secrets (printable), then as every served text is (`shown`: no loopback address).
|
|
524
|
+
problems: (problems ?? []).map((problem) => printable(problem, secrets)).map(({ rule, path, detail }) => ({ rule: shown.text(rule), ...(path === undefined ? {} : { path: shown.text(path) }), detail: shown.text(detail) })),
|
|
517
525
|
// The grade's alone: the end-of-run turn's cost is in the run's own totals.
|
|
518
526
|
cost_usd: { grade: cost_usd?.grade ?? null },
|
|
519
527
|
tokens: { grade: tokens?.grade ?? null },
|
|
@@ -533,7 +541,8 @@ function addedPatch(text) {
|
|
|
533
541
|
* its agent's learning folder); before, its kept proposal (new notes only, from its learning_proposals row) against its
|
|
534
542
|
* seed; a run that proposed nothing, no file, against the seed its launch's learning start names. A run that does not
|
|
535
543
|
* learn (no learning start and no learning end) is not_found. A file's patch is withheld when too large (as the script
|
|
536
|
-
* wrote it), or when it holds one of the host's secrets now (`shown`)
|
|
544
|
+
* wrote it), or when it holds one of the host's secrets now (`shown`); any other is served as every learning text is
|
|
545
|
+
* (`shown.text`: a loopback address reads "a local address"). */
|
|
537
546
|
export async function runDiffOverStore(data, store, runId, shown) {
|
|
538
547
|
const [end, kept, launch, row] = await Promise.all([runLearningEnd(store, runId), store.learning.proposal(runId), launchOf(store, runId), store.runs.get(runId)]);
|
|
539
548
|
const start = launch ? learningStartOf(launch) : undefined;
|
|
@@ -541,7 +550,12 @@ export async function runDiffOverStore(data, store, runId, shown) {
|
|
|
541
550
|
throw new ApiError("not_found", "the run does not learn, so it proposed nothing");
|
|
542
551
|
const file = (name, status, patch) => {
|
|
543
552
|
const path = shown.name(name);
|
|
544
|
-
|
|
553
|
+
if (Buffer.byteLength(patch) > PATCH_CAP)
|
|
554
|
+
return { path, status, withheld: "too_large" };
|
|
555
|
+
if (shown.holds(patch))
|
|
556
|
+
return { path, status, withheld: "secret" };
|
|
557
|
+
const served = shown.text(patch);
|
|
558
|
+
return Buffer.byteLength(served) > PATCH_CAP ? { path, status, withheld: "too_large" } : { path, status, patch: served };
|
|
545
559
|
};
|
|
546
560
|
if (end?.merged) {
|
|
547
561
|
const folder = learningFolderOf(data, row.agentId);
|
package/dist/learning-run.d.ts
CHANGED
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import {
|
|
4
|
-
import type
|
|
1
|
+
import type { RunRow } from "./agent-rows.js";
|
|
2
|
+
import type { AnalyticsFilter } from "./store-reads/analytics.js";
|
|
3
|
+
import type { TimelineEvent } from "./timeline/index.js";
|
|
4
|
+
import { type Learning, type NoteRuns, type Shown } from "./learning.js";
|
|
5
|
+
import { type Reflect } from "./reflect-range.js";
|
|
5
6
|
import type { NoteFiles } from "./usage.js";
|
|
6
|
-
/** A run's end-of-run turn: the job's outcome, the newest store entry before the turn and, once the run ended, the newest
|
|
7
|
-
* after it (its rows are those between), its deadline, and how it ended. */
|
|
8
|
-
export type Reflect = {
|
|
9
|
-
outcome: Status;
|
|
10
|
-
after: number;
|
|
11
|
-
until?: number;
|
|
12
|
-
deadline: string;
|
|
13
|
-
ended?: true;
|
|
14
|
-
timedOut?: true;
|
|
15
|
-
};
|
|
16
|
-
/** Who sent the end-of-run turn: the server, never a person, and no request field sets it. The one value it is sent
|
|
17
|
-
* with, at its one call (reflectTurn); the tool gate reads it there and refuses that turn's writes under work/.learning/ (tool-gate.ts NOTE_ONLY_TEXT). */
|
|
18
|
-
declare const REFLECT_ORIGIN = "reflect";
|
|
19
|
-
export type TurnOrigin = typeof REFLECT_ORIGIN;
|
|
20
|
-
/** Whether entry `id` (a number), or the row `id`, is the end-of-run turn's. Before the run has ended every later entry
|
|
21
|
-
* is, and so is a live row. */
|
|
22
|
-
export declare function reflects(reflect: Reflect | undefined, id: string | number): boolean;
|
|
23
|
-
/** `rows` with the end-of-run turn's labelled: never the run's answer (meaningful skips the label), its answer shown as
|
|
24
|
-
* a text row, and its message as the host's, in a person's words (learning-words.ts): what the model is asked stays in
|
|
25
|
-
* the run's store, and no row shows it. */
|
|
26
|
-
export declare function labelled(reflect: Reflect | undefined, rows: TimelineEvent[]): TimelineEvent[];
|
|
27
7
|
/** The files of the run's copy of the folder its job read, in the order it first read them, each once: every `read`
|
|
28
8
|
* call whose result came back a success, matched to its call by id (claude-agent's rows can hold the result above the
|
|
29
9
|
* call), on any harness: pi's, claude-agent's (the host's `read`, served to its CLI as `mcp__hands__read`) and codex's
|
|
@@ -31,6 +11,10 @@ export declare function labelled(reflect: Reflect | undefined, rows: TimelineEve
|
|
|
31
11
|
* end-of-run turn's reads are its own, not the job's, and are left out; so is a read that failed or never ended, and
|
|
32
12
|
* MEMORY.md, which is no note. Which of these files are notes the run started from is for its seed to say (noteUsed). */
|
|
33
13
|
export declare function notesRead(reflect: Reflect | undefined, rows: readonly TimelineEvent[]): string[];
|
|
14
|
+
/** The run's learning row, once its learning was proposed, merged or dropped (`seed_failed` included): its state, reason
|
|
15
|
+
* and detail, its summary the detail itself as the run's view says it (learning.ts detailShown: cut of the host's
|
|
16
|
+
* secrets now, `shown`, then cut short). One row, which says where the learning ended. */
|
|
17
|
+
export declare function withLearning(rows: readonly TimelineEvent[], learning: Learning | undefined, shown: Shown): TimelineEvent[];
|
|
34
18
|
/** How the runs that tried to learn fared, over the runs the analytics' `from`, `to` and `agent` pick (by when they
|
|
35
19
|
* started, unarchived): `runs` with a learning block, `merged`, `dropped` by reason, and `in_progress` (seeded,
|
|
36
20
|
* reflecting or proposed: a run this server holds). A run with learning off, a workflow's or an imported one, has
|
|
@@ -83,4 +67,3 @@ export type ImpactLearning = {
|
|
|
83
67
|
* An imported or archived run is on neither side, nor is a later one with learning off or seeded with no note (every
|
|
84
68
|
* note retired), nor one whose learning predates these figures. Null unless both sides hold 2 runs or more. */
|
|
85
69
|
export declare function learningImpact(rows: readonly RunRow[], learningOf: (row: RunRow) => ImpactLearning | null | undefined): Impact;
|
|
86
|
-
export {};
|
package/dist/learning-run.js
CHANGED
|
@@ -1,37 +1,11 @@
|
|
|
1
|
-
// A run's learning, as the server reads it from a run's rows and the runs' rows:
|
|
2
|
-
//
|
|
3
|
-
// agent's impact (noteRuns, learningImpact).
|
|
1
|
+
// A run's learning, as the server reads it from a run's rows and the runs' rows: the notes it read (notesRead), its
|
|
2
|
+
// learning row once its learning ended (withLearning), how the runs that tried to learn fared (learningStats), and an
|
|
3
|
+
// agent's impact (noteRuns, learningImpact). Which rows its end-of-run turn made is reflect-range.ts's (reflects,
|
|
4
|
+
// labelled). The runner runs the end-of-run turn itself (runner/reflect-hook.ts).
|
|
4
5
|
import { posix } from "node:path";
|
|
5
6
|
import { INDEX_FILE } from "./learn/index.js";
|
|
6
|
-
import { LEARNED_DIR, LEARNING_LABEL, LEARNING_REASONS } from "./learning.js";
|
|
7
|
-
import {
|
|
8
|
-
/** Who sent the end-of-run turn: the server, never a person, and no request field sets it. The one value it is sent
|
|
9
|
-
* with, at its one call (reflectTurn); the tool gate reads it there and refuses that turn's writes under work/.learning/ (tool-gate.ts NOTE_ONLY_TEXT). */
|
|
10
|
-
const REFLECT_ORIGIN = "reflect";
|
|
11
|
-
/** A row's store entry, from its id (`<conversation>:<entry>[:...]`); NaN for a row no entry made (a live one, usage). */
|
|
12
|
-
const entryOf = (id) => Number(id.split(":")[1]);
|
|
13
|
-
/** Whether entry `id` (a number), or the row `id`, is the end-of-run turn's. Before the run has ended every later entry
|
|
14
|
-
* is, and so is a live row. */
|
|
15
|
-
export function reflects(reflect, id) {
|
|
16
|
-
if (!reflect)
|
|
17
|
-
return false;
|
|
18
|
-
const entry = typeof id === "number" ? id : entryOf(id);
|
|
19
|
-
if (Number.isInteger(entry))
|
|
20
|
-
return entry > reflect.after && (reflect.until === undefined || entry <= reflect.until);
|
|
21
|
-
return reflect.until === undefined && typeof id === "string" && id.includes(":live:");
|
|
22
|
-
}
|
|
23
|
-
/** `rows` with the end-of-run turn's labelled: never the run's answer (meaningful skips the label), its answer shown as
|
|
24
|
-
* a text row, and its message as the host's, in a person's words (learning-words.ts): what the model is asked stays in
|
|
25
|
-
* the run's store, and no row shows it. */
|
|
26
|
-
export function labelled(reflect, rows) {
|
|
27
|
-
if (!reflect)
|
|
28
|
-
return rows;
|
|
29
|
-
return rows.map((row) => (!reflects(reflect, row.id) ? row : {
|
|
30
|
-
...row, agent_label: LEARNING_LABEL,
|
|
31
|
-
...(row.kind === "final_answer" ? { kind: "text_block" } : {}),
|
|
32
|
-
...(row.kind === "user_message" ? { summary: said.asked, text: said.asked } : {}),
|
|
33
|
-
}));
|
|
34
|
-
}
|
|
7
|
+
import { detailShown, LEARNED_DIR, LEARNING_LABEL, LEARNING_REASONS } from "./learning.js";
|
|
8
|
+
import { reflects } from "./reflect-range.js";
|
|
35
9
|
/** A path that names a file at the top of a run's copy of the folder: `.learning/<file>` relative to its work, as a
|
|
36
10
|
* harness's file tools take it, or the same at the end of an absolute path (claude-agent's CLI joins its working
|
|
37
11
|
* directory; a box names its own). */
|
|
@@ -54,6 +28,22 @@ export function notesRead(reflect, rows) {
|
|
|
54
28
|
}
|
|
55
29
|
return [...read];
|
|
56
30
|
}
|
|
31
|
+
/** The run's learning row, once its learning was proposed, merged or dropped (`seed_failed` included): its state, reason
|
|
32
|
+
* and detail, its summary the detail itself as the run's view says it (learning.ts detailShown: cut of the host's
|
|
33
|
+
* secrets now, `shown`, then cut short). One row, which says where the learning ended. */
|
|
34
|
+
export function withLearning(rows, learning, shown) {
|
|
35
|
+
if (!learning || learning.state === "seeded" || learning.state === "reflecting")
|
|
36
|
+
return [...rows];
|
|
37
|
+
const detail = detailShown(learning, shown);
|
|
38
|
+
const row = {
|
|
39
|
+
id: LEARNING_LABEL, timestamp: learning.at, created_at: learning.at, kind: "learning", summary: detail ?? `Learning ${learning.state}`, agent_label: LEARNING_LABEL,
|
|
40
|
+
tool_name: null, tool_use_id: null, tool_status: null, tool_input_preview: null, tool_result_preview: null, tool_result_size_bytes: null, text: detail,
|
|
41
|
+
learning: { state: learning.state, reason: learning.reason, detail },
|
|
42
|
+
};
|
|
43
|
+
// No store entry makes it: the served view adds it at each read, and learning that starts over (seeded, reflecting)
|
|
44
|
+
// has none.
|
|
45
|
+
return [...rows, row];
|
|
46
|
+
}
|
|
57
47
|
/** How the runs that tried to learn fared, over the runs the analytics' `from`, `to` and `agent` pick (by when they
|
|
58
48
|
* started, unarchived): `runs` with a learning block, `merged`, `dropped` by reason, and `in_progress` (seeded,
|
|
59
49
|
* reflecting or proposed: a run this server holds). A run with learning off, a workflow's or an imported one, has
|
package/dist/learning-words.d.ts
CHANGED
|
@@ -13,19 +13,19 @@ export declare function firstSentence(text: string): string;
|
|
|
13
13
|
export declare const STOPPED: {
|
|
14
14
|
readonly unreadable: "the agent's notes could not be read, so the run started without them";
|
|
15
15
|
readonly notCopied: "the agent's notes could not be copied into the run, so the run started without them";
|
|
16
|
+
readonly noSeed: "the run started without the agent's notes";
|
|
16
17
|
readonly serverStopped: "the server stopped while it set up the run's notes, so the run started without them";
|
|
17
18
|
readonly cancelled: "the run was cancelled";
|
|
18
19
|
readonly cancelledLooking: "the run was cancelled while it looked back";
|
|
19
20
|
readonly crashed: "the run's process ended before it could look back";
|
|
20
|
-
readonly crashedLooking: "the run's process ended while it looked back";
|
|
21
21
|
readonly timedOut: "looking back took too long";
|
|
22
|
-
readonly notAsked: "looking back could not start";
|
|
23
22
|
readonly failed: "looking back ended on an error";
|
|
24
|
-
readonly notSetAside: "the new notes could not be set aside to be checked";
|
|
25
23
|
readonly notChecked: "the new notes could not be checked";
|
|
26
24
|
readonly refuseUnread: "what the run must never learn (its agent's browser sign-in, the server's secrets) could not be read back, so nothing it learned is kept";
|
|
27
25
|
readonly noReview: "the review of the new notes gave no answer";
|
|
28
26
|
readonly unread: "the review of the new notes gave an answer that could not be read";
|
|
27
|
+
readonly contradicted: "the review of the new notes contradicted itself: it kept them and said not to";
|
|
28
|
+
readonly contradictedTwice: "the review of the new notes contradicted itself twice: it kept them and said not to";
|
|
29
29
|
};
|
|
30
30
|
/** A run's learning, in words, by where it stands. */
|
|
31
31
|
export declare const said: {
|
|
@@ -33,6 +33,9 @@ export declare const said: {
|
|
|
33
33
|
reflecting: string;
|
|
34
34
|
/** The end-of-run turn's message, as a person reads it in the timeline: never the prompt the model is sent. */
|
|
35
35
|
asked: string;
|
|
36
|
+
/** The end-of-run turn asked again because a workflow draft failed its dry run (learn/reflect.ts reflectDryRun), as a
|
|
37
|
+
* person reads it in the timeline: never the ask, which holds the check's words. */
|
|
38
|
+
askedDryRun: string;
|
|
36
39
|
proposed: (notes: number, skills?: number, workflows?: number) => string;
|
|
37
40
|
/** What it learned, by name, and how many older notes they replace, and its skill and workflow by name; then what
|
|
38
41
|
* waits for the owner's OK, by name; then, when the grader dropped an item and kept others (a verdict per item), its
|
|
@@ -46,6 +49,9 @@ export declare const said: {
|
|
|
46
49
|
why: string;
|
|
47
50
|
}[], checked?: readonly Pick<Problem, "rule" | "path">[]) => string;
|
|
48
51
|
empty: string;
|
|
52
|
+
/** A run whose only work was its learned workflows, each answering, with nothing said after its first message: it was
|
|
53
|
+
* not asked to look back (runner/learning-end.ts onlyLearnedWorkflows). */
|
|
54
|
+
onlyWorkflow: string;
|
|
49
55
|
/** A merge whose every item the owner has since retired: nothing it learned is kept now. */
|
|
50
56
|
retiredSince: string;
|
|
51
57
|
/** The run's answer gave its notes, but not in the format asked for, so none was read. */
|
|
@@ -73,6 +79,7 @@ export declare const said: {
|
|
|
73
79
|
export declare function notKept(verdict: Pick<Verdict, "reason" | "items">, lost?: readonly Pick<LearnedFile, "file">[]): string;
|
|
74
80
|
/** A run's learning in words as a read says them, whole: what it learned and what waits for the owner's OK, or why the
|
|
75
81
|
* grader kept nothing, said again from its parts (`learned`, `pending`, `verdict`) each cut by `cut` first (the host's
|
|
76
|
-
* secrets as they are now)
|
|
77
|
-
*
|
|
82
|
+
* secrets as they are now), and the whole line cut again, as notKept's is: a skill's or a workflow's file names it in
|
|
83
|
+
* the words, uncut until then; any other detail, the server's own sentence, cut as well. The caller cuts the words
|
|
84
|
+
* short after. */
|
|
78
85
|
export declare function wordsOf(learning: Pick<Learning, "state" | "reason" | "detail" | "learned" | "pending" | "verdict" | "skills" | "workflows" | "problems" | "lost">, cut: (text: string) => string): string | null;
|
package/dist/learning-words.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// secret later is found only whole, so a part of it kept would show for good. A run's learning keeps the parts its
|
|
8
8
|
// words are made of (`learned`, `verdict`), and each read says them again (wordsOf): every part cut of the host's
|
|
9
9
|
// secrets as they are then, and only then the words cut short (DETAIL_MAX for a run, LIST_DETAIL for a list's row).
|
|
10
|
-
import { CAPS, learnedPlace, parseVerdict } from "./learn/index.js";
|
|
10
|
+
import { CAPS, CONTRADICTED_REASON, CONTRADICTED_TWICE_REASON, learnedPlace, parseVerdict } from "./learn/index.js";
|
|
11
11
|
/** `n` of `one`, said as a person says it: "1 note", "2 notes". */
|
|
12
12
|
const count = (n, one) => `${n} ${one}${n === 1 ? "" : "s"}`;
|
|
13
13
|
/** `parts` as a person lists them: "a", "a and b", "a, b and c". */
|
|
@@ -78,19 +78,19 @@ const rulesIn = (problems) => [...new Set(problems.map(wordOf))].join("; ");
|
|
|
78
78
|
export const STOPPED = {
|
|
79
79
|
unreadable: "the agent's notes could not be read, so the run started without them",
|
|
80
80
|
notCopied: "the agent's notes could not be copied into the run, so the run started without them",
|
|
81
|
+
noSeed: "the run started without the agent's notes",
|
|
81
82
|
serverStopped: "the server stopped while it set up the run's notes, so the run started without them",
|
|
82
83
|
cancelled: "the run was cancelled",
|
|
83
84
|
cancelledLooking: "the run was cancelled while it looked back",
|
|
84
85
|
crashed: "the run's process ended before it could look back",
|
|
85
|
-
crashedLooking: "the run's process ended while it looked back",
|
|
86
86
|
timedOut: "looking back took too long",
|
|
87
|
-
notAsked: "looking back could not start",
|
|
88
87
|
failed: "looking back ended on an error",
|
|
89
|
-
notSetAside: "the new notes could not be set aside to be checked",
|
|
90
88
|
notChecked: "the new notes could not be checked",
|
|
91
89
|
refuseUnread: "what the run must never learn (its agent's browser sign-in, the server's secrets) could not be read back, so nothing it learned is kept",
|
|
92
90
|
noReview: "the review of the new notes gave no answer",
|
|
93
91
|
unread: "the review of the new notes gave an answer that could not be read",
|
|
92
|
+
contradicted: "the review of the new notes contradicted itself: it kept them and said not to",
|
|
93
|
+
contradictedTwice: "the review of the new notes contradicted itself twice: it kept them and said not to",
|
|
94
94
|
};
|
|
95
95
|
/** A run's learning, in words, by where it stands. */
|
|
96
96
|
export const said = {
|
|
@@ -98,6 +98,9 @@ export const said = {
|
|
|
98
98
|
reflecting: "Looking back on this run…",
|
|
99
99
|
/** The end-of-run turn's message, as a person reads it in the timeline: never the prompt the model is sent. */
|
|
100
100
|
asked: "Looking back on this run.",
|
|
101
|
+
/** The end-of-run turn asked again because a workflow draft failed its dry run (learn/reflect.ts reflectDryRun), as a
|
|
102
|
+
* person reads it in the timeline: never the ask, which holds the check's words. */
|
|
103
|
+
askedDryRun: "Looking back again: a workflow draft did not pass its dry run.",
|
|
101
104
|
proposed: (notes, skills = 0, workflows = 0) => `Checking ${listed([...(notes || !(skills || workflows) ? [count(notes, "new note")] : []), ...(skills ? [count(skills, "skill")] : []), ...(workflows ? [count(workflows, "workflow")] : [])])}…`,
|
|
102
105
|
/** What it learned, by name, and how many older notes they replace, and its skill and workflow by name; then what
|
|
103
106
|
* waits for the owner's OK, by name; then, when the grader dropped an item and kept others (a verdict per item), its
|
|
@@ -119,6 +122,9 @@ export const said = {
|
|
|
119
122
|
return dropped ? `${base}${base.endsWith(".") ? "" : "."} ${dropped}` : base;
|
|
120
123
|
},
|
|
121
124
|
empty: "Nothing new to remember from this run.",
|
|
125
|
+
/** A run whose only work was its learned workflows, each answering, with nothing said after its first message: it was
|
|
126
|
+
* not asked to look back (runner/learning-end.ts onlyLearnedWorkflows). */
|
|
127
|
+
onlyWorkflow: "Nothing new: the run only ran a learned workflow.",
|
|
122
128
|
/** A merge whose every item the owner has since retired: nothing it learned is kept now. */
|
|
123
129
|
retiredSince: "What it learned was retired since.",
|
|
124
130
|
/** The run's answer gave its notes, but not in the format asked for, so none was read. */
|
|
@@ -143,7 +149,7 @@ export const said = {
|
|
|
143
149
|
/** The reasons learn/grade.ts' parseVerdict gives of its own, never the grader's: an answer it could not read, and one
|
|
144
150
|
* it refused (an item for a file it was not asked about, a file judged twice, a new note with no item, a merge that
|
|
145
151
|
* did not keep every note). Found by asking it, so they follow it. */
|
|
146
|
-
const OWN_REASONS = new Set(["", "[]", '{"merge":true,"reason":"r","items":[{"file":"a.md","
|
|
152
|
+
const OWN_REASONS = new Set(["", "[]", '{"merge":true,"reason":"r","items":[{"file":"a.md","decision":"drop","why":"w"}]}', '{"merge":false,"reason":"r","items":[]}', '{"merge":false,"reason":"r","items":[{"file":"b.md","decision":"drop","why":"w"}]}', '{"merge":false,"reason":"r","items":[{"file":"a.md","decision":"drop","why":"w"},{"file":"a.md","decision":"drop","why":"w"}]}'].map((answer) => parseVerdict(answer, ["a.md"]).reason));
|
|
147
153
|
/** The skill or the workflow draft at `file` as a person names it ("the skill X", "the workflow Y"), or undefined for a
|
|
148
154
|
* note's file or a draft's README.md. */
|
|
149
155
|
const learnedWords = (file) => {
|
|
@@ -159,7 +165,9 @@ const learnedWords = (file) => {
|
|
|
159
165
|
* secrets: a name is the run's to choose. */
|
|
160
166
|
export function notKept(verdict, lost = []) {
|
|
161
167
|
const dropped = verdict.items.find((item) => !item.keep);
|
|
162
|
-
|
|
168
|
+
// A grade that contradicted itself (it kept every item and said no merge: once, or again when asked again) is said as
|
|
169
|
+
// such: never its own reason, which may say the items can be kept.
|
|
170
|
+
const said_ = dropped?.why ? said.grader(dropped.why) : verdict.reason === CONTRADICTED_TWICE_REASON ? said.stopped(STOPPED.contradictedTwice) : verdict.reason === CONTRADICTED_REASON ? said.stopped(STOPPED.contradicted) : OWN_REASONS.has(verdict.reason) ? said.stopped(STOPPED.unread) : said.grader(verdict.reason);
|
|
163
171
|
const subject = dropped?.why ? learnedWords(dropped.file) : undefined;
|
|
164
172
|
const others = [...new Set(lost.flatMap(({ file }) => learnedWords(file) ?? []))].filter((words) => words !== subject);
|
|
165
173
|
if (!subject && !others.length)
|
|
@@ -169,8 +177,9 @@ export function notKept(verdict, lost = []) {
|
|
|
169
177
|
}
|
|
170
178
|
/** A run's learning in words as a read says them, whole: what it learned and what waits for the owner's OK, or why the
|
|
171
179
|
* grader kept nothing, said again from its parts (`learned`, `pending`, `verdict`) each cut by `cut` first (the host's
|
|
172
|
-
* secrets as they are now)
|
|
173
|
-
*
|
|
180
|
+
* secrets as they are now), and the whole line cut again, as notKept's is: a skill's or a workflow's file names it in
|
|
181
|
+
* the words, uncut until then; any other detail, the server's own sentence, cut as well. The caller cuts the words
|
|
182
|
+
* short after. */
|
|
174
183
|
export function wordsOf(learning, cut) {
|
|
175
184
|
const { learned, pending, verdict } = learning;
|
|
176
185
|
if (learning.state === "merged") {
|
|
@@ -178,7 +187,7 @@ export function wordsOf(learning, cut) {
|
|
|
178
187
|
const waiting = Array.isArray(pending) ? pending.filter((note) => typeof note?.name === "string") : [];
|
|
179
188
|
const files = [...(Array.isArray(learning.skills) ? learning.skills : []), ...(Array.isArray(learning.workflows) ? learning.workflows : [])].filter((file) => typeof file?.file === "string" && typeof file.name === "string");
|
|
180
189
|
if (kept.length || waiting.length || files.length)
|
|
181
|
-
return said.merged(kept.map((note) => ({ name: cut(note.name), supersedes: note.supersedes })), waiting.map((note) => ({ name: cut(note.name) })), files.map((file) => ({ file: file.file, name: cut(file.name), ...(file.pending ? { pending: true } : {}) })), (verdict?.items ?? []).filter((item) => !item.keep && typeof item.why === "string").map((item) => ({ why: cut(item.why) })), Array.isArray(learning.problems) ? learning.problems : []);
|
|
190
|
+
return cut(said.merged(kept.map((note) => ({ name: cut(note.name), supersedes: note.supersedes })), waiting.map((note) => ({ name: cut(note.name) })), files.map((file) => ({ file: file.file, name: cut(file.name), ...(file.pending ? { pending: true } : {}) })), (verdict?.items ?? []).filter((item) => !item.keep && typeof item.why === "string").map((item) => ({ why: cut(item.why) })), Array.isArray(learning.problems) ? learning.problems : []));
|
|
182
191
|
}
|
|
183
192
|
if (learning.state === "dropped" && learning.reason === "grader" && verdict) {
|
|
184
193
|
// serve.json's `lost` is read as untrusted: an entry out of shape is left out. The whole line is cut again, the names
|