@senpi/runtime 3.0.58 → 3.0.62
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 +73 -2
- package/dist/actions/action-events.d.ts +3 -3
- package/dist/actions/action-events.d.ts.map +1 -1
- package/dist/actions/action-events.js +24 -16
- package/dist/actions/action-events.js.map +1 -1
- package/dist/actions/action-runtime-module.d.ts.map +1 -1
- package/dist/actions/action-runtime-module.js +18 -1
- package/dist/actions/action-runtime-module.js.map +1 -1
- package/dist/actions/close-position/close-position.action.d.ts.map +1 -1
- package/dist/actions/close-position/close-position.action.js +84 -11
- package/dist/actions/close-position/close-position.action.js.map +1 -1
- package/dist/actions/decision-engine.d.ts +0 -2
- package/dist/actions/decision-engine.d.ts.map +1 -1
- package/dist/actions/decision-engine.js +1 -79
- package/dist/actions/decision-engine.js.map +1 -1
- package/dist/actions/event-derivation.d.ts +40 -2
- package/dist/actions/event-derivation.d.ts.map +1 -1
- package/dist/actions/event-derivation.js +178 -5
- package/dist/actions/event-derivation.js.map +1 -1
- package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
- package/dist/actions/open-position/open-position.action.js +103 -16
- package/dist/actions/open-position/open-position.action.js.map +1 -1
- package/dist/actions/position-tracker/position-tracker.action.d.ts +2 -1
- package/dist/actions/position-tracker/position-tracker.action.d.ts.map +1 -1
- package/dist/actions/position-tracker/position-tracker.action.js +47 -15
- package/dist/actions/position-tracker/position-tracker.action.js.map +1 -1
- package/dist/actions/skipped-signal-results.d.ts +16 -0
- package/dist/actions/skipped-signal-results.d.ts.map +1 -0
- package/dist/actions/skipped-signal-results.js +47 -0
- package/dist/actions/skipped-signal-results.js.map +1 -0
- package/dist/cli/deploy-render.d.ts +91 -0
- package/dist/cli/deploy-render.d.ts.map +1 -0
- package/dist/cli/deploy-render.js +216 -0
- package/dist/cli/deploy-render.js.map +1 -0
- package/dist/cli/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +78 -6
- package/dist/cli/guide-commands.js.map +1 -1
- package/dist/cli/senpi-commands.d.ts +6 -1
- package/dist/cli/senpi-commands.d.ts.map +1 -1
- package/dist/cli/senpi-commands.js +164 -5
- package/dist/cli/senpi-commands.js.map +1 -1
- package/dist/cli/validate-command.d.ts.map +1 -1
- package/dist/cli/validate-command.js +32 -1
- package/dist/cli/validate-command.js.map +1 -1
- package/dist/deploy/deadlines.d.ts +47 -0
- package/dist/deploy/deadlines.d.ts.map +1 -0
- package/dist/deploy/deadlines.js +56 -0
- package/dist/deploy/deadlines.js.map +1 -0
- package/dist/deploy/error-text.d.ts +25 -0
- package/dist/deploy/error-text.d.ts.map +1 -0
- package/dist/deploy/error-text.js +42 -0
- package/dist/deploy/error-text.js.map +1 -0
- package/dist/deploy/funding.d.ts +87 -0
- package/dist/deploy/funding.d.ts.map +1 -0
- package/dist/deploy/funding.js +229 -0
- package/dist/deploy/funding.js.map +1 -0
- package/dist/deploy/install-gate-runner.d.ts +12 -0
- package/dist/deploy/install-gate-runner.d.ts.map +1 -0
- package/dist/deploy/install-gate-runner.js +17 -0
- package/dist/deploy/install-gate-runner.js.map +1 -0
- package/dist/deploy/job.d.ts +199 -0
- package/dist/deploy/job.d.ts.map +1 -0
- package/dist/deploy/job.js +463 -0
- package/dist/deploy/job.js.map +1 -0
- package/dist/deploy/min-budget.d.ts +68 -0
- package/dist/deploy/min-budget.d.ts.map +1 -0
- package/dist/deploy/min-budget.js +297 -0
- package/dist/deploy/min-budget.js.map +1 -0
- package/dist/deploy/orchestrator.d.ts +305 -0
- package/dist/deploy/orchestrator.d.ts.map +1 -0
- package/dist/deploy/orchestrator.js +2910 -0
- package/dist/deploy/orchestrator.js.map +1 -0
- package/dist/deploy/package.d.ts +130 -0
- package/dist/deploy/package.d.ts.map +1 -0
- package/dist/deploy/package.js +351 -0
- package/dist/deploy/package.js.map +1 -0
- package/dist/deploy/proof-gate.d.ts +82 -0
- package/dist/deploy/proof-gate.d.ts.map +1 -0
- package/dist/deploy/proof-gate.js +269 -0
- package/dist/deploy/proof-gate.js.map +1 -0
- package/dist/deploy/python-float.d.ts +34 -0
- package/dist/deploy/python-float.d.ts.map +1 -0
- package/dist/deploy/python-float.js +46 -0
- package/dist/deploy/python-float.js.map +1 -0
- package/dist/deploy/recheck-commands.d.ts +50 -0
- package/dist/deploy/recheck-commands.d.ts.map +1 -0
- package/dist/deploy/recheck-commands.js +59 -0
- package/dist/deploy/recheck-commands.js.map +1 -0
- package/dist/deploy/register.d.ts +99 -0
- package/dist/deploy/register.d.ts.map +1 -0
- package/dist/deploy/register.js +689 -0
- package/dist/deploy/register.js.map +1 -0
- package/dist/deploy/taxonomy.d.ts +24 -0
- package/dist/deploy/taxonomy.d.ts.map +1 -0
- package/dist/deploy/taxonomy.js +31 -0
- package/dist/deploy/taxonomy.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +244 -132
- package/dist/index.js.map +1 -1
- package/dist/runtime/lifecycle-events.d.ts +13 -0
- package/dist/runtime/lifecycle-events.d.ts.map +1 -1
- package/dist/runtime/lifecycle-events.js +32 -0
- package/dist/runtime/lifecycle-events.js.map +1 -1
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +3 -1
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/strategy-registry.d.ts +8 -0
- package/dist/runtime/strategy-registry.d.ts.map +1 -1
- package/dist/runtime/strategy-registry.js +14 -1
- package/dist/runtime/strategy-registry.js.map +1 -1
- package/dist/runtime/supervisor/long-running-supervisor.d.ts +8 -0
- package/dist/runtime/supervisor/long-running-supervisor.d.ts.map +1 -1
- package/dist/runtime/supervisor/long-running-supervisor.js +1 -0
- package/dist/runtime/supervisor/long-running-supervisor.js.map +1 -1
- package/dist/runtime-api/intake/intake-events.d.ts +19 -3
- package/dist/runtime-api/intake/intake-events.d.ts.map +1 -1
- package/dist/runtime-api/intake/intake-events.js +64 -2
- package/dist/runtime-api/intake/intake-events.js.map +1 -1
- package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -1
- package/dist/runtime-api/intake/intake-mount.js +7 -4
- package/dist/runtime-api/intake/intake-mount.js.map +1 -1
- package/dist/runtime-api/intake/process-signal-post.d.ts.map +1 -1
- package/dist/runtime-api/intake/process-signal-post.js +7 -1
- package/dist/runtime-api/intake/process-signal-post.js.map +1 -1
- package/dist/runtime-api/intake/scanner-launcher.d.ts.map +1 -1
- package/dist/runtime-api/intake/scanner-launcher.js +12 -0
- package/dist/runtime-api/intake/scanner-launcher.js.map +1 -1
- package/dist/runtime-api/intake/types.d.ts +24 -0
- package/dist/runtime-api/intake/types.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.js +10 -1
- package/dist/runtime-api/routes/signals.js.map +1 -1
- package/dist/runtime-api/routes/signals.schema.d.ts +10 -0
- package/dist/runtime-api/routes/signals.schema.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.schema.js +14 -0
- package/dist/runtime-api/routes/signals.schema.js.map +1 -1
- package/dist/scanners/events.d.ts +7 -0
- package/dist/scanners/events.d.ts.map +1 -1
- package/dist/scanners/events.js.map +1 -1
- package/dist/scanners/external/scaffold/delivery.py +23 -12
- package/dist/scanners/external/scaffold/scaffold.py +55 -7
- package/dist/scanners/implementations/market-regime.d.ts +1 -1
- package/dist/scanners/runtime-module.d.ts.map +1 -1
- package/dist/scanners/runtime-module.js +10 -2
- package/dist/scanners/runtime-module.js.map +1 -1
- package/dist/senpi/client.d.ts +58 -4
- package/dist/senpi/client.d.ts.map +1 -1
- package/dist/senpi/client.js +192 -15
- package/dist/senpi/client.js.map +1 -1
- package/dist/senpi/strategy-status.d.ts +32 -0
- package/dist/senpi/strategy-status.d.ts.map +1 -0
- package/dist/senpi/strategy-status.js +70 -0
- package/dist/senpi/strategy-status.js.map +1 -0
- package/dist/senpi/types.d.ts +47 -3
- package/dist/senpi/types.d.ts.map +1 -1
- package/dist/skills-manager/manifest.js +1 -1
- package/dist/skills-manager/skills-manifest.json +1 -1
- package/dist/telemetry/event-builders.d.ts +45 -6
- package/dist/telemetry/event-builders.d.ts.map +1 -1
- package/dist/telemetry/event-builders.js +99 -11
- package/dist/telemetry/event-builders.js.map +1 -1
- package/dist/telemetry/metrics.d.ts +37 -2
- package/dist/telemetry/metrics.d.ts.map +1 -1
- package/dist/telemetry/metrics.js +84 -4
- package/dist/telemetry/metrics.js.map +1 -1
- package/dist/telemetry/scanner-tick-event.d.ts +32 -0
- package/dist/telemetry/scanner-tick-event.d.ts.map +1 -0
- package/dist/telemetry/scanner-tick-event.js +32 -0
- package/dist/telemetry/scanner-tick-event.js.map +1 -0
- package/dist/types/strategy.d.ts +9 -1
- package/dist/types/strategy.d.ts.map +1 -1
- package/dist/universe/package-universe.d.ts +97 -0
- package/dist/universe/package-universe.d.ts.map +1 -0
- package/dist/universe/package-universe.js +275 -0
- package/dist/universe/package-universe.js.map +1 -0
- package/dist/utils/event-catalog.d.ts +58 -0
- package/dist/utils/event-catalog.d.ts.map +1 -1
- package/dist/utils/event-catalog.js +1 -0
- package/dist/utils/event-catalog.js.map +1 -1
- package/dist/validate/codes.d.ts +20 -0
- package/dist/validate/codes.d.ts.map +1 -1
- package/dist/validate/codes.js +36 -0
- package/dist/validate/codes.js.map +1 -1
- package/dist/validate/import-stage.js +5 -5
- package/dist/validate/import-stage.js.map +1 -1
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/install-gate.d.ts.map +1 -1
- package/dist/validate/install-gate.js +10 -2
- package/dist/validate/install-gate.js.map +1 -1
- package/dist/validate/live-instruments.d.ts +44 -0
- package/dist/validate/live-instruments.d.ts.map +1 -0
- package/dist/validate/live-instruments.js +71 -0
- package/dist/validate/live-instruments.js.map +1 -0
- package/dist/validate/live-stage.js +5 -5
- package/dist/validate/live-stage.js.map +1 -1
- package/dist/validate/proof.d.ts +11 -1
- package/dist/validate/proof.d.ts.map +1 -1
- package/dist/validate/proof.js +7 -6
- package/dist/validate/proof.js.map +1 -1
- package/dist/validate/recipe-checks.d.ts.map +1 -1
- package/dist/validate/recipe-checks.js +6 -4
- package/dist/validate/recipe-checks.js.map +1 -1
- package/dist/validate/run.d.ts +5 -0
- package/dist/validate/run.d.ts.map +1 -1
- package/dist/validate/run.js +10 -1
- package/dist/validate/run.js.map +1 -1
- package/dist/validate/target.d.ts +41 -0
- package/dist/validate/target.d.ts.map +1 -1
- package/dist/validate/target.js +192 -16
- package/dist/validate/target.js.map +1 -1
- package/dist/validate/universe-stage.d.ts +71 -0
- package/dist/validate/universe-stage.d.ts.map +1 -0
- package/dist/validate/universe-stage.js +183 -0
- package/dist/validate/universe-stage.js.map +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/dist/runtime/managed-wallet-guard.d.ts +0 -47
- package/dist/runtime/managed-wallet-guard.d.ts.map +0 -1
- package/dist/runtime/managed-wallet-guard.js +0 -106
- package/dist/runtime/managed-wallet-guard.js.map +0 -1
- package/dist/runtime/protection-nudge.d.ts +0 -67
- package/dist/runtime/protection-nudge.d.ts.map +0 -1
- package/dist/runtime/protection-nudge.js +0 -244
- package/dist/runtime/protection-nudge.js.map +0 -1
package/dist/validate/target.js
CHANGED
|
@@ -15,19 +15,40 @@
|
|
|
15
15
|
* called `scanners/` — install accepts any path, and the scanner location is a field inside the
|
|
16
16
|
* recipe. Those names are used here only to break ties when a caller points at a directory, and the
|
|
17
17
|
* resolver refuses rather than guesses when they do not.
|
|
18
|
+
*
|
|
19
|
+
* ## The manifest wins over the filesystem
|
|
20
|
+
*
|
|
21
|
+
* When there IS a `strategy.yaml` around the target, it — not the directory listing — says which
|
|
22
|
+
* recipe belongs to the package and what its instances are called. Two package models on one
|
|
23
|
+
* directory disagreed in both harmful directions: a leftover root `runtime.yaml` was validated, and
|
|
24
|
+
* proven, against a file deploy would never install; and instance names came from directory names,
|
|
25
|
+
* so the re-check commands printed here named things `close.py --instance` cannot resolve. The
|
|
26
|
+
* filesystem walk below survives for the one case the manifest cannot serve — a directory with a
|
|
27
|
+
* recipe and no package around it yet, which is where an author lives while writing one.
|
|
28
|
+
*
|
|
29
|
+
* A manifest that is PRESENT and will not load is neither of those states, and collapsing it into
|
|
30
|
+
* "no package here" reinstates the very bug above: the root falls through to the conventional-name
|
|
31
|
+
* tie-break, resolves the leftover recipe, and reports a green PASS. Present-versus-absent is
|
|
32
|
+
* decidable with one `existsSync` and no reading of the file, so the two are kept apart — at a
|
|
33
|
+
* package root the resolver refuses, and anywhere the target resolves on its own merits it carries
|
|
34
|
+
* {@link ResolvedTarget.packageUnreadable} so no consumer has to guess which state it is in.
|
|
18
35
|
*/
|
|
19
36
|
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
20
37
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
21
|
-
import {
|
|
38
|
+
import { errorText } from "../deploy/error-text.js";
|
|
39
|
+
import { loadDeployPackage } from "../deploy/package.js";
|
|
40
|
+
import { VALIDATE_CODE, VALIDATE_CODE_META } from "./codes.js";
|
|
22
41
|
/**
|
|
23
42
|
* The conventional recipe filename. Used only to break ties inside a directory; an explicitly
|
|
24
43
|
* named file is honoured whatever it is called.
|
|
25
44
|
*/
|
|
26
45
|
const CONVENTIONAL_RECIPE = "runtime.yaml";
|
|
27
46
|
/**
|
|
28
|
-
* The deploy manifest. It is a `.yaml` sitting beside recipes, so it must be excluded from
|
|
29
|
-
*
|
|
30
|
-
* layer and is outside what this
|
|
47
|
+
* The deploy manifest. It is a `.yaml` sitting beside recipes, so it must be excluded from recipe
|
|
48
|
+
* candidates or a directory holding one would offer its own manifest as a thing to validate — a file
|
|
49
|
+
* that belongs to the deploy layer and is outside what this checks. Since a readable manifest now
|
|
50
|
+
* resolves the recipe itself, the surviving place that exclusion bites is the candidate list inside
|
|
51
|
+
* {@link unreadableManifestRefusal}.
|
|
31
52
|
*/
|
|
32
53
|
const DEPLOY_MANIFEST = "strategy.yaml";
|
|
33
54
|
const RECIPE_EXTENSIONS = [".yaml", ".yml"];
|
|
@@ -40,10 +61,75 @@ function invocationFinding(code, parts) {
|
|
|
40
61
|
severity: "error",
|
|
41
62
|
stage: "invocation",
|
|
42
63
|
actor: "agent",
|
|
43
|
-
|
|
64
|
+
// Read from the taxonomy rather than re-decided here. The rule this replaced was a two-code
|
|
65
|
+
// ternary that silently gave every future code "command", which is wrong for any refusal whose
|
|
66
|
+
// remedy is an edit — and a fix_kind disagreeing with the table is a finding that routes wrong.
|
|
67
|
+
fix_kind: VALIDATE_CODE_META[code].fix_kind,
|
|
44
68
|
...parts,
|
|
45
69
|
};
|
|
46
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* The package this target belongs to, when there is one.
|
|
73
|
+
*
|
|
74
|
+
* Tried at the target and then at its parent, because a target is either a package root or one
|
|
75
|
+
* instance inside it. `loadDeployPackage` throws when there is no manifest, and that is the
|
|
76
|
+
* mid-authoring case — a directory with a recipe and no package around it yet — so a throw means
|
|
77
|
+
* "fall back", never "fail".
|
|
78
|
+
*
|
|
79
|
+
* It also throws when the manifest is THERE and unusable, which means the opposite. The two are
|
|
80
|
+
* told apart the same way the loader itself decides: whether the file exists. That is a question
|
|
81
|
+
* about resolution — can this layer learn which recipe is meant — and needs no reading of the
|
|
82
|
+
* manifest's contents, which belong to deploy.
|
|
83
|
+
*/
|
|
84
|
+
function findPackage(dir) {
|
|
85
|
+
for (const candidate of [dir, dirname(dir)]) {
|
|
86
|
+
try {
|
|
87
|
+
return { kind: "package", pkg: loadDeployPackage(candidate) };
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
const manifestPath = join(candidate, DEPLOY_MANIFEST);
|
|
91
|
+
if (existsSync(manifestPath))
|
|
92
|
+
return { kind: "unreadable", manifestPath, error: errorText(err) };
|
|
93
|
+
// No manifest here. Try the parent, then give up and use filesystem resolution.
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return { kind: "none" };
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The package that DECLARES this recipe file, for a recipe named directly.
|
|
100
|
+
*
|
|
101
|
+
* Same recipe, different spelling of the target: `senpi validate pkg/swing` and
|
|
102
|
+
* `senpi validate pkg/swing/runtime.yaml` must carry the same package, or every check keyed on one
|
|
103
|
+
* would fire or not fire depending only on how the caller wrote the path. A file the manifest does
|
|
104
|
+
* not point at is deliberately package-less — that is the leftover-recipe case, and attaching the
|
|
105
|
+
* package to it would be the same false claim this resolver exists to stop making. An unreadable
|
|
106
|
+
* manifest passes straight through: the file cannot be excluded by a manifest nobody can read.
|
|
107
|
+
*/
|
|
108
|
+
function packageDeclaring(recipePath) {
|
|
109
|
+
const lookup = findPackage(dirname(recipePath));
|
|
110
|
+
if (lookup.kind !== "package")
|
|
111
|
+
return lookup;
|
|
112
|
+
const declared = lookup.pkg.instances.some((inst) => inst.runtimeYamlPath === recipePath);
|
|
113
|
+
return declared ? lookup : { kind: "none" };
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The package half of a resolved target.
|
|
117
|
+
*
|
|
118
|
+
* Both fields absent does NOT mean "there is no package anywhere near this target". It means this
|
|
119
|
+
* lookup found no manifest to attach: a recipe with no package around it yet (the mid-authoring
|
|
120
|
+
* case), and also a directory INSIDE a readable package that is not one of its instances — a
|
|
121
|
+
* `scanners/` directory resolves that way, with the package perfectly readable one level up. A
|
|
122
|
+
* consumer may read the pair as "no declared universe/instance I can check here"; it may not read it
|
|
123
|
+
* as "no package exists".
|
|
124
|
+
*/
|
|
125
|
+
function packageFields(lookup) {
|
|
126
|
+
if (lookup.kind === "package")
|
|
127
|
+
return { pkg: lookup.pkg };
|
|
128
|
+
if (lookup.kind === "unreadable") {
|
|
129
|
+
return { packageUnreadable: { manifestPath: lookup.manifestPath, error: lookup.error } };
|
|
130
|
+
}
|
|
131
|
+
return {};
|
|
132
|
+
}
|
|
47
133
|
/** Directory entries that could be a recipe: a YAML file that is not the deploy manifest. */
|
|
48
134
|
function recipeCandidates(dir) {
|
|
49
135
|
return readdirSync(dir, { withFileTypes: true })
|
|
@@ -71,7 +157,97 @@ function asArg(cwd, absolute) {
|
|
|
71
157
|
return ".";
|
|
72
158
|
return rel.startsWith("..") || isAbsolute(rel) ? absolute : `./${rel}`;
|
|
73
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* "This directory holds several runtimes — pick one."
|
|
162
|
+
*
|
|
163
|
+
* Shared by both resolution paths so the manifest and the filesystem refuse in one voice. Only the
|
|
164
|
+
* clause naming where the instances were read from differs, because that is the one thing a reader
|
|
165
|
+
* has to know to act: a name from the manifest is the one `close.py --instance` takes.
|
|
166
|
+
*/
|
|
167
|
+
function instanceChoiceRefusal(dir, cwd, source, instances) {
|
|
168
|
+
return invocationFinding(VALIDATE_CODE.noRecipe, {
|
|
169
|
+
what: `${asArg(cwd, dir)} has no recipe of its own — ${source} ${instances.length} instance${instances.length === 1 ? "" : "s"}`,
|
|
170
|
+
why: "Validation runs against one runtime. A package groups several, each with its own recipe and its own wallet.",
|
|
171
|
+
fix: `Pick an instance:\n${instances.map((i) => ` openclaw senpi validate ${asArg(cwd, i.dir)}`).join("\n")}`,
|
|
172
|
+
where: { file: asArg(cwd, dir) },
|
|
173
|
+
evidence: { instances: instances.map((i) => i.name) },
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* "There is a manifest here and I could not read it."
|
|
178
|
+
*
|
|
179
|
+
* Raised only at the package root, where the manifest is the only thing that could say which recipe
|
|
180
|
+
* is meant — so guessing from the directory is exactly the mistake this module exists to stop. It
|
|
181
|
+
* relays the loader's own message rather than diagnosing the file, and names both ways forward: fix
|
|
182
|
+
* the manifest at the layer that owns it, or take a specific recipe out of the package's hands.
|
|
183
|
+
*/
|
|
184
|
+
function unreadableManifestRefusal(dir, cwd, manifestPath, error) {
|
|
185
|
+
const named = recipeCandidates(dir).map((c) => ` openclaw senpi validate ${asArg(cwd, join(dir, c))}`);
|
|
186
|
+
return invocationFinding(VALIDATE_CODE.unreadableManifest, {
|
|
187
|
+
what: `${asArg(cwd, dir)} has a ${DEPLOY_MANIFEST} that does not load: ${error}`,
|
|
188
|
+
why: "The manifest names this package's recipes. While it cannot be read, the YAML files beside it " +
|
|
189
|
+
"are guesses — and validating the wrong one records a passing proof for a file that would " +
|
|
190
|
+
"never be installed.",
|
|
191
|
+
fix: `Fix ${asArg(cwd, manifestPath)} — \`senpi deploy\` reads the same file and refuses for the same reason.` +
|
|
192
|
+
(named.length > 0 ? `\nOr validate one recipe on its own, outside the package:\n${named.join("\n")}` : ""),
|
|
193
|
+
where: { file: asArg(cwd, manifestPath) },
|
|
194
|
+
evidence: { manifest: asArg(cwd, manifestPath), error },
|
|
195
|
+
});
|
|
196
|
+
}
|
|
74
197
|
function resolveDirectory(dir, cwd) {
|
|
198
|
+
// The manifest first: it, not the directory listing, decides which file is this package's recipe.
|
|
199
|
+
const lookup = findPackage(dir);
|
|
200
|
+
if (lookup.kind === "package") {
|
|
201
|
+
const { pkg } = lookup;
|
|
202
|
+
const instance = pkg.instances.find((inst) => inst.runtimeYamlDir === dir);
|
|
203
|
+
if (instance) {
|
|
204
|
+
return {
|
|
205
|
+
ok: true,
|
|
206
|
+
target: {
|
|
207
|
+
kind: "recipe",
|
|
208
|
+
recipePath: instance.runtimeYamlPath,
|
|
209
|
+
baseDir: dir,
|
|
210
|
+
allowedDepths: ALL_DEPTHS,
|
|
211
|
+
pkg,
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
// The package root, and no instance lives here. Any `runtime.yaml` beside the manifest is a
|
|
216
|
+
// leftover the manifest does not point at, so resolving to it would prove the wrong file.
|
|
217
|
+
if (pkg.dir === dir) {
|
|
218
|
+
return {
|
|
219
|
+
ok: false,
|
|
220
|
+
finding: instanceChoiceRefusal(dir, cwd, "its strategy.yaml declares", pkg.instances.map((inst) => ({ name: inst.name, dir: inst.runtimeYamlDir }))),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
// Somewhere else inside a package — a scanner directory, say. Nothing the manifest can answer;
|
|
224
|
+
// the filesystem walk below handles it.
|
|
225
|
+
}
|
|
226
|
+
if (lookup.kind === "unreadable") {
|
|
227
|
+
// At the root the manifest is the only authority on which recipe is meant, so falling through
|
|
228
|
+
// to the tie-break here is what used to prove a leftover file. Below the root the target stands
|
|
229
|
+
// on its own — one broken manifest must not poison every recipe beside it — so those keep
|
|
230
|
+
// resolving, carrying the unreadable manifest with them.
|
|
231
|
+
if (dirname(lookup.manifestPath) === dir) {
|
|
232
|
+
return {
|
|
233
|
+
ok: false,
|
|
234
|
+
finding: unreadableManifestRefusal(dir, cwd, lookup.manifestPath, lookup.error),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
const resolution = resolveByFilesystem(dir, cwd);
|
|
238
|
+
return resolution.ok
|
|
239
|
+
? { ok: true, target: { ...resolution.target, ...packageFields(lookup) } }
|
|
240
|
+
: resolution;
|
|
241
|
+
}
|
|
242
|
+
return resolveByFilesystem(dir, cwd);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Resolution by directory listing alone — the path for a directory no manifest speaks for.
|
|
246
|
+
*
|
|
247
|
+
* Kept whole rather than folded into the manifest branch: this is what an author's half-built
|
|
248
|
+
* package looks like, and it is the only resolver that can serve them.
|
|
249
|
+
*/
|
|
250
|
+
function resolveByFilesystem(dir, cwd) {
|
|
75
251
|
const conventional = join(dir, CONVENTIONAL_RECIPE);
|
|
76
252
|
if (existsSync(conventional) && statSync(conventional).isFile()) {
|
|
77
253
|
return { ok: true, target: { kind: "recipe", recipePath: conventional, baseDir: dir, allowedDepths: ALL_DEPTHS } };
|
|
@@ -87,7 +263,7 @@ function resolveDirectory(dir, cwd) {
|
|
|
87
263
|
finding: invocationFinding(VALIDATE_CODE.ambiguousRecipe, {
|
|
88
264
|
what: `${asArg(cwd, dir)} holds ${candidates.length} possible recipes and none is named ${CONVENTIONAL_RECIPE}`,
|
|
89
265
|
why: "Picking one would be a guess, and validating the wrong recipe is worse than refusing.",
|
|
90
|
-
fix: `Name the one you mean:\n${candidates.map((c) => ` senpi validate ${asArg(cwd, join(dir, c))}`).join("\n")}`,
|
|
266
|
+
fix: `Name the one you mean:\n${candidates.map((c) => ` openclaw senpi validate ${asArg(cwd, join(dir, c))}`).join("\n")}`,
|
|
91
267
|
where: { file: asArg(cwd, dir) },
|
|
92
268
|
evidence: { candidates },
|
|
93
269
|
}),
|
|
@@ -99,13 +275,7 @@ function resolveDirectory(dir, cwd) {
|
|
|
99
275
|
if (instances.length > 0) {
|
|
100
276
|
return {
|
|
101
277
|
ok: false,
|
|
102
|
-
finding:
|
|
103
|
-
what: `${asArg(cwd, dir)} has no recipe of its own — it holds ${instances.length} instance${instances.length === 1 ? "" : "s"}`,
|
|
104
|
-
why: "Validation runs against one runtime. A package groups several, each with its own recipe and its own wallet.",
|
|
105
|
-
fix: `Pick an instance:\n${instances.map((i) => ` senpi validate ${asArg(cwd, join(dir, i))}`).join("\n")}`,
|
|
106
|
-
where: { file: asArg(cwd, dir) },
|
|
107
|
-
evidence: { instances },
|
|
108
|
-
}),
|
|
278
|
+
finding: instanceChoiceRefusal(dir, cwd, "it holds", instances.map((name) => ({ name, dir: join(dir, name) }))),
|
|
109
279
|
};
|
|
110
280
|
}
|
|
111
281
|
// Scanner code with no recipe beside it. Legitimate mid-authoring: code exists before the
|
|
@@ -193,7 +363,13 @@ function resolveTargetShape(input) {
|
|
|
193
363
|
}
|
|
194
364
|
return {
|
|
195
365
|
ok: true,
|
|
196
|
-
target: {
|
|
366
|
+
target: {
|
|
367
|
+
kind: "recipe",
|
|
368
|
+
recipePath: path,
|
|
369
|
+
baseDir: dirname(path),
|
|
370
|
+
allowedDepths: ALL_DEPTHS,
|
|
371
|
+
...packageFields(packageDeclaring(path)),
|
|
372
|
+
},
|
|
197
373
|
};
|
|
198
374
|
}
|
|
199
375
|
/**
|
|
@@ -222,8 +398,8 @@ function depthUnreachable(target, requested, input) {
|
|
|
222
398
|
"its output is judged by — all of which live in the recipe. Substituting defaults would let it pass " +
|
|
223
399
|
"against invented inputs and fail on real ones.",
|
|
224
400
|
fix: `Point at the recipe to run every check, or keep this target and use --stage import to check the code alone:\n` +
|
|
225
|
-
` senpi validate ${asArg(input.cwd, dirname(target.scannerRoot ?? "."))}\n` +
|
|
226
|
-
` senpi validate ${asArg(input.cwd, target.scannerRoot ?? ".")} --stage import`,
|
|
401
|
+
` openclaw senpi validate ${asArg(input.cwd, dirname(target.scannerRoot ?? "."))}\n` +
|
|
402
|
+
` openclaw senpi validate ${asArg(input.cwd, target.scannerRoot ?? ".")} --stage import`,
|
|
227
403
|
where: { file: asArg(input.cwd, target.scannerRoot ?? ".") },
|
|
228
404
|
evidence: { requested_depth: requested, allowed_depths: target.allowedDepths },
|
|
229
405
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"target.js","sourceRoot":"","sources":["../../src/validate/target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C;;;GAGG;AACH,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAE3C;;;;GAIG;AACH,MAAM,eAAe,GAAG,eAAe,CAAC;AAExC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAqC5C,MAAM,UAAU,GAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAClE,MAAM,SAAS,GAAqB,CAAC,QAAQ,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAqB,CAAC,QAAQ,CAAC,CAAC;AA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AI,GAAG,CAAC,CAAC,IAAI;YACrF,6BAA6B,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,IAAI,GAAG,CAAC,iBAAiB;QAC3F,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,IAAI,GAAG,CAAC,EAAE;QAC5D,QAAQ,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,CAAC,aAAa,EAAE;KAC/E,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package universe: is every instrument this package hardcodes actually live on the exchange?
|
|
3
|
+
*
|
|
4
|
+
* Deploy's pre-money check, run here too. The SAME `checkPackageUniverse` `runDeploy` calls — not a
|
|
5
|
+
* second implementation and not a re-derivation: this module only renders the verdict it returns as
|
|
6
|
+
* findings. Deploy keeps its own call deliberately, because `strategy.yaml` is outside the proof
|
|
7
|
+
* fingerprint, so a `catalog.assets` edit is exactly the change a proof cannot see.
|
|
8
|
+
*
|
|
9
|
+
* ## Why this is a LIVE-depth check
|
|
10
|
+
*
|
|
11
|
+
* The scan of the package is static, but the verdict is not: it needs the exchange's live
|
|
12
|
+
* instrument list, and nothing about a hardcoded name can be judged without one. Static and import
|
|
13
|
+
* are the depths that do no I/O — CI runs them with no gateway and no credentials — so putting a
|
|
14
|
+
* network read there would have cost that property for every run. Nothing is lost by waiting: a
|
|
15
|
+
* proof requires `depth === "live"`, and deploy refuses a package with no proof, so every path that
|
|
16
|
+
* produces a deployable package reaches this depth. The author still learns before funding.
|
|
17
|
+
*
|
|
18
|
+
* ## Three states of "no package", and what each means here
|
|
19
|
+
*
|
|
20
|
+
* `pkg` set is the checkable one. `packageUnreadable` set means a `strategy.yaml` exists and would
|
|
21
|
+
* not load — the check could not run, which is reported, not passed over. NEITHER set is the only
|
|
22
|
+
* genuine "no package": a recipe being authored before its manifest exists, or a directory inside a
|
|
23
|
+
* readable package that is not one of its instances. Nothing is reported there, because there is no
|
|
24
|
+
* declared universe to check.
|
|
25
|
+
*
|
|
26
|
+
* ## What each kind of ignorance says, and why they are not one code
|
|
27
|
+
*
|
|
28
|
+
* Three things can stop this producing a verdict, and they route to different people:
|
|
29
|
+
*
|
|
30
|
+
* - The LIVE LIST could not be read — the source threw, or returned nothing (an empty list means
|
|
31
|
+
* "could not read", NEVER "everything is dead"). That is an environment fault:
|
|
32
|
+
* `W_VALIDATE_UNIVERSE_UNAVAILABLE`, actor `ops`. It names no instrument dead, because a read
|
|
33
|
+
* that did not succeed proves nothing about this package.
|
|
34
|
+
* - The PACKAGE could not be read — an unloadable manifest, or an instance recipe that will not
|
|
35
|
+
* parse. That is the author's to fix: `W_VALIDATE_UNIVERSE_UNCHECKED`, actor `agent`.
|
|
36
|
+
* - No source was supplied at all. Silent, and only here: that is a programmatic caller choosing
|
|
37
|
+
* not to run the check, not a run that tried and failed. The CLI always supplies one, so the
|
|
38
|
+
* "could not obtain a client" case arrives as `unavailable` above and speaks.
|
|
39
|
+
*
|
|
40
|
+
* Splitting the first two on `actor` is not tidiness. `actor` is loop control — an agent that
|
|
41
|
+
* answers "the MCP server is down" by editing `strategy.yaml` will keep editing until something
|
|
42
|
+
* else stops it, which is the exact failure `Actor` exists to prevent.
|
|
43
|
+
*
|
|
44
|
+
* What none of them ever do is call an instrument dead. That invariant is the whole point of the
|
|
45
|
+
* `unavailable` status upstream, and it survives being rendered here.
|
|
46
|
+
*/
|
|
47
|
+
import { type UniverseCheckDeps } from "../universe/package-universe.js";
|
|
48
|
+
import type { ResolvedTarget } from "./target.js";
|
|
49
|
+
import type { Finding } from "./types.js";
|
|
50
|
+
/**
|
|
51
|
+
* The read-only sources a check needs when it cannot answer from the package alone.
|
|
52
|
+
*
|
|
53
|
+
* Injected rather than constructed, so the offline depths stay offline for a caller that has none,
|
|
54
|
+
* and so the tests drive the real check rather than a stubbed module.
|
|
55
|
+
*/
|
|
56
|
+
export type ValidateDeps = UniverseCheckDeps;
|
|
57
|
+
/** What {@link universeFindings} needs from the run's options. */
|
|
58
|
+
export interface UniverseStageOptions {
|
|
59
|
+
deps?: ValidateDeps;
|
|
60
|
+
/** Directory the caller invoked from, for rendering paths a reader can act on. */
|
|
61
|
+
cwd: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The check, as findings. Called from the live depth; never from static or import.
|
|
65
|
+
*
|
|
66
|
+
* The order of the guards below is load-bearing: absent `deps` is checked BEFORE
|
|
67
|
+
* `packageUnreadable`, so a caller that asked for no universe check is never told about a manifest
|
|
68
|
+
* it never asked about.
|
|
69
|
+
*/
|
|
70
|
+
export declare function universeFindings(target: ResolvedTarget, options: UniverseStageOptions): Promise<Finding[]>;
|
|
71
|
+
//# sourceMappingURL=universe-stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"universe-stage.d.ts","sourceRoot":"","sources":["../../src/validate/universe-stage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAKH,OAAO,EAIL,KAAK,iBAAiB,EAEvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAE7C,kEAAkE;AAClE,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;CACb;AAyBD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,OAAO,EAAE,CAAC,CAiDpB"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package universe: is every instrument this package hardcodes actually live on the exchange?
|
|
3
|
+
*
|
|
4
|
+
* Deploy's pre-money check, run here too. The SAME `checkPackageUniverse` `runDeploy` calls — not a
|
|
5
|
+
* second implementation and not a re-derivation: this module only renders the verdict it returns as
|
|
6
|
+
* findings. Deploy keeps its own call deliberately, because `strategy.yaml` is outside the proof
|
|
7
|
+
* fingerprint, so a `catalog.assets` edit is exactly the change a proof cannot see.
|
|
8
|
+
*
|
|
9
|
+
* ## Why this is a LIVE-depth check
|
|
10
|
+
*
|
|
11
|
+
* The scan of the package is static, but the verdict is not: it needs the exchange's live
|
|
12
|
+
* instrument list, and nothing about a hardcoded name can be judged without one. Static and import
|
|
13
|
+
* are the depths that do no I/O — CI runs them with no gateway and no credentials — so putting a
|
|
14
|
+
* network read there would have cost that property for every run. Nothing is lost by waiting: a
|
|
15
|
+
* proof requires `depth === "live"`, and deploy refuses a package with no proof, so every path that
|
|
16
|
+
* produces a deployable package reaches this depth. The author still learns before funding.
|
|
17
|
+
*
|
|
18
|
+
* ## Three states of "no package", and what each means here
|
|
19
|
+
*
|
|
20
|
+
* `pkg` set is the checkable one. `packageUnreadable` set means a `strategy.yaml` exists and would
|
|
21
|
+
* not load — the check could not run, which is reported, not passed over. NEITHER set is the only
|
|
22
|
+
* genuine "no package": a recipe being authored before its manifest exists, or a directory inside a
|
|
23
|
+
* readable package that is not one of its instances. Nothing is reported there, because there is no
|
|
24
|
+
* declared universe to check.
|
|
25
|
+
*
|
|
26
|
+
* ## What each kind of ignorance says, and why they are not one code
|
|
27
|
+
*
|
|
28
|
+
* Three things can stop this producing a verdict, and they route to different people:
|
|
29
|
+
*
|
|
30
|
+
* - The LIVE LIST could not be read — the source threw, or returned nothing (an empty list means
|
|
31
|
+
* "could not read", NEVER "everything is dead"). That is an environment fault:
|
|
32
|
+
* `W_VALIDATE_UNIVERSE_UNAVAILABLE`, actor `ops`. It names no instrument dead, because a read
|
|
33
|
+
* that did not succeed proves nothing about this package.
|
|
34
|
+
* - The PACKAGE could not be read — an unloadable manifest, or an instance recipe that will not
|
|
35
|
+
* parse. That is the author's to fix: `W_VALIDATE_UNIVERSE_UNCHECKED`, actor `agent`.
|
|
36
|
+
* - No source was supplied at all. Silent, and only here: that is a programmatic caller choosing
|
|
37
|
+
* not to run the check, not a run that tried and failed. The CLI always supplies one, so the
|
|
38
|
+
* "could not obtain a client" case arrives as `unavailable` above and speaks.
|
|
39
|
+
*
|
|
40
|
+
* Splitting the first two on `actor` is not tidiness. `actor` is loop control — an agent that
|
|
41
|
+
* answers "the MCP server is down" by editing `strategy.yaml` will keep editing until something
|
|
42
|
+
* else stops it, which is the exact failure `Actor` exists to prevent.
|
|
43
|
+
*
|
|
44
|
+
* What none of them ever do is call an instrument dead. That invariant is the whole point of the
|
|
45
|
+
* `unavailable` status upstream, and it survives being rendered here.
|
|
46
|
+
*/
|
|
47
|
+
import { isAbsolute, join, relative } from "node:path";
|
|
48
|
+
import { errorText } from "../deploy/error-text.js";
|
|
49
|
+
import { checkPackageUniverse, checkedTickerForms, } from "../universe/package-universe.js";
|
|
50
|
+
import { VALIDATE_CODE, VALIDATE_CODE_META, severityOf } from "./codes.js";
|
|
51
|
+
/**
|
|
52
|
+
* A finding whose class comes from the taxonomy rather than from this call site.
|
|
53
|
+
*
|
|
54
|
+
* `severity`, `stage`, `actor` and `fix_kind` are all read from the table — the same rule
|
|
55
|
+
* `target.ts` follows and for the same reason: a `fix_kind` disagreeing with the table is a finding
|
|
56
|
+
* that routes wrong, and nothing in the suite compares a finding's metadata against the table, so a
|
|
57
|
+
* hand-written copy drifts silently. Here the values are stated once, in `codes.ts`.
|
|
58
|
+
*/
|
|
59
|
+
function taxonomyFinding(code, parts) {
|
|
60
|
+
const meta = VALIDATE_CODE_META[code];
|
|
61
|
+
return {
|
|
62
|
+
code,
|
|
63
|
+
severity: severityOf(code),
|
|
64
|
+
stage: meta.stage,
|
|
65
|
+
actor: meta.actor,
|
|
66
|
+
fix_kind: meta.fix_kind,
|
|
67
|
+
...parts,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The check, as findings. Called from the live depth; never from static or import.
|
|
72
|
+
*
|
|
73
|
+
* The order of the guards below is load-bearing: absent `deps` is checked BEFORE
|
|
74
|
+
* `packageUnreadable`, so a caller that asked for no universe check is never told about a manifest
|
|
75
|
+
* it never asked about.
|
|
76
|
+
*/
|
|
77
|
+
export async function universeFindings(target, options) {
|
|
78
|
+
if (options.deps === undefined)
|
|
79
|
+
return [];
|
|
80
|
+
if (target.packageUnreadable !== undefined) {
|
|
81
|
+
const { manifestPath, error } = target.packageUnreadable;
|
|
82
|
+
const shown = asPath(options.cwd, manifestPath);
|
|
83
|
+
return [
|
|
84
|
+
taxonomyFinding(VALIDATE_CODE.universeUnchecked, {
|
|
85
|
+
what: `The live-instrument check did not run: ${shown} could not be read (${error})`,
|
|
86
|
+
why: UNCHECKED_WHY,
|
|
87
|
+
fix: `Fix ${shown} — \`senpi deploy\` reads the same file and refuses for the same reason — ` +
|
|
88
|
+
`then run this command again.`,
|
|
89
|
+
where: { file: shown },
|
|
90
|
+
evidence: { manifest: shown, error },
|
|
91
|
+
}),
|
|
92
|
+
];
|
|
93
|
+
}
|
|
94
|
+
const pkg = target.pkg;
|
|
95
|
+
if (pkg === undefined)
|
|
96
|
+
return [];
|
|
97
|
+
let verdict;
|
|
98
|
+
try {
|
|
99
|
+
verdict = await checkPackageUniverse(pkg, options.deps);
|
|
100
|
+
}
|
|
101
|
+
catch (err) {
|
|
102
|
+
// `checkPackageUniverse` never lets the injected source throw, but it does NOT wrap reads of the
|
|
103
|
+
// package's own YAML — a deleted or unparseable instance recipe raises out of it. Deploy parses
|
|
104
|
+
// those files before it ever gets here; this call site is the one that can meet them, and the
|
|
105
|
+
// whole command going down would be a worse answer than "this check could not run".
|
|
106
|
+
const files = [join(pkg.dir, "strategy.yaml"), ...pkg.instances.map((inst) => inst.runtimeYamlPath)];
|
|
107
|
+
return [
|
|
108
|
+
taxonomyFinding(VALIDATE_CODE.universeUnchecked, {
|
|
109
|
+
what: `The live-instrument check did not run: this package's files could not be read (${errorText(err)})`,
|
|
110
|
+
why: UNCHECKED_WHY,
|
|
111
|
+
fix: "Make each of these readable and parseable as YAML, then run this command again:\n" +
|
|
112
|
+
files.map((file) => ` ${asPath(options.cwd, file)}`).join("\n"),
|
|
113
|
+
evidence: { error: errorText(err), files: files.map((file) => asPath(options.cwd, file)) },
|
|
114
|
+
}),
|
|
115
|
+
];
|
|
116
|
+
}
|
|
117
|
+
if (verdict.status === "unavailable")
|
|
118
|
+
return [universeUnavailableFinding(verdict.reason)];
|
|
119
|
+
// `no-hardcoded` and `clean` are the two states with nothing to say.
|
|
120
|
+
if (verdict.status !== "dead")
|
|
121
|
+
return [];
|
|
122
|
+
return [...verdict.dead.entries()].map(([ticker, rows]) => universeNotLiveFinding(ticker, rows, pkg, verdict.liveCount));
|
|
123
|
+
}
|
|
124
|
+
/** Shared by both unchecked causes: the consequence is the same whichever input was unreadable. */
|
|
125
|
+
const UNCHECKED_WHY = "A hardcoded instrument that is not live on the exchange is the one packaging fault that never " +
|
|
126
|
+
"raises — the scan skips the name and the strategy trades nothing on it. This run cannot say " +
|
|
127
|
+
"whether that is the case here, and a pass that covered it would be claiming otherwise.";
|
|
128
|
+
/** One dead name, everywhere it appears — the package-relative locations an author edits. */
|
|
129
|
+
function universeNotLiveFinding(ticker, rows, pkg, liveCount) {
|
|
130
|
+
// Both forms, from the function the comparison itself uses: telling an author to look for a name
|
|
131
|
+
// that was never checked is worse than saying nothing.
|
|
132
|
+
const checked = checkedTickerForms(ticker).map((form) => `"${form}"`).join(" or ");
|
|
133
|
+
const where = rows.map((row) => `${asPath(pkg.dir, row.file)} (${row.keyPath})`).join("; ");
|
|
134
|
+
return taxonomyFinding(VALIDATE_CODE.universeNotLive, {
|
|
135
|
+
where: { file: asPath(pkg.dir, rows[0].file), yaml_path: rows[0].keyPath },
|
|
136
|
+
what: `This package hardcodes "${ticker}", and no live instrument matches ${checked} — at ${where}`,
|
|
137
|
+
why: "A name the exchange does not carry never raises: the scan skips it and the strategy trades " +
|
|
138
|
+
"nothing on it. Funded, it looks healthy and silently never takes the position.",
|
|
139
|
+
fix: `Replace or remove "${ticker}" at ${where}. The correct spelling comes from the live ` +
|
|
140
|
+
`instrument list this was checked against (${liveCount} names) — \`senpi deploy\` runs the ` +
|
|
141
|
+
`same check before it funds anything and refuses on it.`,
|
|
142
|
+
evidence: {
|
|
143
|
+
ticker,
|
|
144
|
+
checked: checkedTickerForms(ticker),
|
|
145
|
+
live_count: liveCount,
|
|
146
|
+
occurrences: rows.map((row) => ({ file: asPath(pkg.dir, row.file), key_path: row.keyPath })),
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The live list could not be read — an environment fault, and never a verdict about the package.
|
|
152
|
+
*
|
|
153
|
+
* Deliberately names no instrument and quotes the reason verbatim. An empty response reaches here
|
|
154
|
+
* too: a real read always carries at least the majors, so empty is an unreadable list wearing a
|
|
155
|
+
* different hat, and unknown is never "not live".
|
|
156
|
+
*/
|
|
157
|
+
function universeUnavailableFinding(reason) {
|
|
158
|
+
return taxonomyFinding(VALIDATE_CODE.universeUnavailable, {
|
|
159
|
+
what: `The live-instrument check did not run: the exchange's instrument list could not be read (${reason})`,
|
|
160
|
+
why: "No instrument was declared dead — an unreadable list proves nothing about this package. But " +
|
|
161
|
+
"nothing about its hardcoded names was established either, so this run cannot stand in for " +
|
|
162
|
+
"the check `senpi deploy` makes before it funds anything.",
|
|
163
|
+
fix: "Re-run once the MCP server is reachable and credentials are set (SENPI_AUTH_TOKEN or " +
|
|
164
|
+
"SENPI_API_KEY, and SENPI_MCP_URL). Nothing in the package needs editing for this.",
|
|
165
|
+
evidence: { reason },
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* A path as a reader should see it: relative to `base` when it sits underneath it, absolute
|
|
170
|
+
* otherwise. Findings must not carry absolute machine paths where a relative one is meaningful, and
|
|
171
|
+
* must not carry a `../..` chain where it is not.
|
|
172
|
+
*
|
|
173
|
+
* The base differs by what the finding is about, deliberately. A dead instrument is a fact about a
|
|
174
|
+
* PACKAGE, so its locations are package-relative (`strategy.yaml`, `swing/runtime.yaml`) — the form
|
|
175
|
+
* {@link import("./types.js").FindingLocation.file} documents, and the one that reads the same from
|
|
176
|
+
* any directory. An unreadable manifest has no package to be relative to; it is named from the cwd,
|
|
177
|
+
* matching how `target.ts` renders the same file in the refusal it raises at a package root.
|
|
178
|
+
*/
|
|
179
|
+
function asPath(base, absolute) {
|
|
180
|
+
const rel = relative(base, absolute);
|
|
181
|
+
return rel === "" || rel.startsWith("..") || isAbsolute(rel) ? absolute : rel;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=universe-stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"universe-stage.js","sourceRoot":"","sources":["../../src/validate/universe-stage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EACL,oBAAoB,EACpB,kBAAkB,GAInB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,UAAU,EAAqB,MAAM,YAAY,CAAC;AAmB9F;;;;;;;GAOG;AACH,SAAS,eAAe,CACtB,IAAkB,EAClB,KAA+G;IAE/G,MAAM,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO;QACL,IAAI;QACJ,QAAQ,EAAE,UAAU,CAAC,IAAI,CAAC;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EA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Ac;IAChD,OAAO,eAAe,CAAC,aAAa,CAAC,mBAAmB,EAAE;QACxD,IAAI,EAAE,4FAA4F,MAAM,GAAG;QAC3G,GAAG,EACD,8FAA8F;YAC9F,4FAA4F;YAC5F,0DAA0D;QAC5D,GAAG,EACD,uFAAuF;YACvF,mFAAmF;QACrF,QAAQ,EAAE,EAAE,MAAM,EAAE;KACrB,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,MAAM,CAAC,IAAY,EAAE,QAAgB;IAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrC,OAAO,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;AAChF,CAAC"}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "runtime",
|
|
3
3
|
"name": "Senpi Runtime",
|
|
4
4
|
"description": "Senpi runtime plugin for OpenClaw. Orchestrates scanners, LLM-based trade decisions, and a DSL trailing stop-loss exit engine.",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.62",
|
|
6
6
|
"commandAliases": [
|
|
7
7
|
{
|
|
8
8
|
"name": "senpi"
|