@senpi-ai/runtime 3.0.77 → 3.0.78

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.
Files changed (165) hide show
  1. package/README.md +76 -2
  2. package/dist/cli/deploy-render.d.ts +93 -0
  3. package/dist/cli/deploy-render.d.ts.map +1 -0
  4. package/dist/cli/deploy-render.js +438 -0
  5. package/dist/cli/deploy-render.js.map +1 -0
  6. package/dist/cli/guide-commands.d.ts.map +1 -1
  7. package/dist/cli/guide-commands.js +94 -9
  8. package/dist/cli/guide-commands.js.map +1 -1
  9. package/dist/cli/senpi-commands.d.ts +6 -1
  10. package/dist/cli/senpi-commands.d.ts.map +1 -1
  11. package/dist/cli/senpi-commands.js +290 -41
  12. package/dist/cli/senpi-commands.js.map +1 -1
  13. package/dist/cli/validate-command.d.ts.map +1 -1
  14. package/dist/cli/validate-command.js +10 -1
  15. package/dist/cli/validate-command.js.map +1 -1
  16. package/dist/deploy/deadlines.d.ts +107 -0
  17. package/dist/deploy/deadlines.d.ts.map +1 -0
  18. package/dist/deploy/deadlines.js +139 -0
  19. package/dist/deploy/deadlines.js.map +1 -0
  20. package/dist/deploy/error-text.d.ts +25 -0
  21. package/dist/deploy/error-text.d.ts.map +1 -0
  22. package/dist/deploy/error-text.js +42 -0
  23. package/dist/deploy/error-text.js.map +1 -0
  24. package/dist/deploy/funding.d.ts +125 -0
  25. package/dist/deploy/funding.d.ts.map +1 -0
  26. package/dist/deploy/funding.js +268 -0
  27. package/dist/deploy/funding.js.map +1 -0
  28. package/dist/deploy/install-gate-runner.d.ts +12 -0
  29. package/dist/deploy/install-gate-runner.d.ts.map +1 -0
  30. package/dist/deploy/install-gate-runner.js +17 -0
  31. package/dist/deploy/install-gate-runner.js.map +1 -0
  32. package/dist/deploy/job.d.ts +215 -0
  33. package/dist/deploy/job.d.ts.map +1 -0
  34. package/dist/deploy/job.js +484 -0
  35. package/dist/deploy/job.js.map +1 -0
  36. package/dist/deploy/messages.d.ts +603 -0
  37. package/dist/deploy/messages.d.ts.map +1 -0
  38. package/dist/deploy/messages.js +1388 -0
  39. package/dist/deploy/messages.js.map +1 -0
  40. package/dist/deploy/min-budget.d.ts +68 -0
  41. package/dist/deploy/min-budget.d.ts.map +1 -0
  42. package/dist/deploy/min-budget.js +297 -0
  43. package/dist/deploy/min-budget.js.map +1 -0
  44. package/dist/deploy/orchestrator.d.ts +314 -0
  45. package/dist/deploy/orchestrator.d.ts.map +1 -0
  46. package/dist/deploy/orchestrator.js +2171 -0
  47. package/dist/deploy/orchestrator.js.map +1 -0
  48. package/dist/deploy/package.d.ts +228 -0
  49. package/dist/deploy/package.d.ts.map +1 -0
  50. package/dist/deploy/package.js +542 -0
  51. package/dist/deploy/package.js.map +1 -0
  52. package/dist/deploy/proof-gate.d.ts +86 -0
  53. package/dist/deploy/proof-gate.d.ts.map +1 -0
  54. package/dist/deploy/proof-gate.js +278 -0
  55. package/dist/deploy/proof-gate.js.map +1 -0
  56. package/dist/deploy/python-float.d.ts +34 -0
  57. package/dist/deploy/python-float.d.ts.map +1 -0
  58. package/dist/deploy/python-float.js +46 -0
  59. package/dist/deploy/python-float.js.map +1 -0
  60. package/dist/deploy/recheck-commands.d.ts +50 -0
  61. package/dist/deploy/recheck-commands.d.ts.map +1 -0
  62. package/dist/deploy/recheck-commands.js +77 -0
  63. package/dist/deploy/recheck-commands.js.map +1 -0
  64. package/dist/deploy/register.d.ts +101 -0
  65. package/dist/deploy/register.d.ts.map +1 -0
  66. package/dist/deploy/register.js +714 -0
  67. package/dist/deploy/register.js.map +1 -0
  68. package/dist/deploy/taxonomy.d.ts +43 -0
  69. package/dist/deploy/taxonomy.d.ts.map +1 -0
  70. package/dist/deploy/taxonomy.js +59 -0
  71. package/dist/deploy/taxonomy.js.map +1 -0
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +467 -222
  74. package/dist/index.js.map +1 -1
  75. package/dist/runtime/env-resolve.d.ts +13 -0
  76. package/dist/runtime/env-resolve.d.ts.map +1 -1
  77. package/dist/runtime/env-resolve.js +14 -1
  78. package/dist/runtime/env-resolve.js.map +1 -1
  79. package/dist/runtime/runtime-descriptor.d.ts +37 -0
  80. package/dist/runtime/runtime-descriptor.d.ts.map +1 -0
  81. package/dist/runtime/runtime-descriptor.js +163 -0
  82. package/dist/runtime/runtime-descriptor.js.map +1 -0
  83. package/dist/runtime/runtime-schema.d.ts +100 -100
  84. package/dist/runtime/strategy-registry.d.ts +8 -0
  85. package/dist/runtime/strategy-registry.d.ts.map +1 -1
  86. package/dist/runtime/strategy-registry.js +14 -1
  87. package/dist/runtime/strategy-registry.js.map +1 -1
  88. package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -1
  89. package/dist/runtime-api/intake/intake-mount.js +7 -4
  90. package/dist/runtime-api/intake/intake-mount.js.map +1 -1
  91. package/dist/scanners/external/scaffold/preflight.py +39 -0
  92. package/dist/scanners/implementations/market-regime.d.ts +1 -1
  93. package/dist/senpi/client.d.ts +58 -4
  94. package/dist/senpi/client.d.ts.map +1 -1
  95. package/dist/senpi/client.js +262 -18
  96. package/dist/senpi/client.js.map +1 -1
  97. package/dist/senpi/strategy-status.d.ts +32 -0
  98. package/dist/senpi/strategy-status.d.ts.map +1 -0
  99. package/dist/senpi/strategy-status.js +70 -0
  100. package/dist/senpi/strategy-status.js.map +1 -0
  101. package/dist/senpi/types.d.ts +65 -3
  102. package/dist/senpi/types.d.ts.map +1 -1
  103. package/dist/skills-manager/manifest.js +3 -3
  104. package/dist/skills-manager/skills-manifest.json +3 -3
  105. package/dist/telemetry/metrics.d.ts +30 -0
  106. package/dist/telemetry/metrics.d.ts.map +1 -1
  107. package/dist/telemetry/metrics.js +72 -0
  108. package/dist/telemetry/metrics.js.map +1 -1
  109. package/dist/types/strategy.d.ts +9 -1
  110. package/dist/types/strategy.d.ts.map +1 -1
  111. package/dist/universe/package-universe.d.ts +97 -0
  112. package/dist/universe/package-universe.d.ts.map +1 -0
  113. package/dist/universe/package-universe.js +304 -0
  114. package/dist/universe/package-universe.js.map +1 -0
  115. package/dist/validate/codes.d.ts +30 -0
  116. package/dist/validate/codes.d.ts.map +1 -1
  117. package/dist/validate/codes.js +74 -1
  118. package/dist/validate/codes.js.map +1 -1
  119. package/dist/validate/index.d.ts +1 -1
  120. package/dist/validate/index.d.ts.map +1 -1
  121. package/dist/validate/index.js.map +1 -1
  122. package/dist/validate/install-gate.d.ts.map +1 -1
  123. package/dist/validate/install-gate.js +10 -2
  124. package/dist/validate/install-gate.js.map +1 -1
  125. package/dist/validate/live-instruments.d.ts +44 -0
  126. package/dist/validate/live-instruments.d.ts.map +1 -0
  127. package/dist/validate/live-instruments.js +71 -0
  128. package/dist/validate/live-instruments.js.map +1 -0
  129. package/dist/validate/live-stage.d.ts +8 -0
  130. package/dist/validate/live-stage.d.ts.map +1 -1
  131. package/dist/validate/live-stage.js +87 -18
  132. package/dist/validate/live-stage.js.map +1 -1
  133. package/dist/validate/package-gates-stage.d.ts +61 -0
  134. package/dist/validate/package-gates-stage.d.ts.map +1 -0
  135. package/dist/validate/package-gates-stage.js +215 -0
  136. package/dist/validate/package-gates-stage.js.map +1 -0
  137. package/dist/validate/proof.d.ts +11 -1
  138. package/dist/validate/proof.d.ts.map +1 -1
  139. package/dist/validate/proof.js +10 -6
  140. package/dist/validate/proof.js.map +1 -1
  141. package/dist/validate/recipe-checks.d.ts.map +1 -1
  142. package/dist/validate/recipe-checks.js +6 -4
  143. package/dist/validate/recipe-checks.js.map +1 -1
  144. package/dist/validate/run.d.ts +29 -1
  145. package/dist/validate/run.d.ts.map +1 -1
  146. package/dist/validate/run.js +65 -6
  147. package/dist/validate/run.js.map +1 -1
  148. package/dist/validate/target.d.ts +41 -0
  149. package/dist/validate/target.d.ts.map +1 -1
  150. package/dist/validate/target.js +192 -16
  151. package/dist/validate/target.js.map +1 -1
  152. package/dist/validate/taxonomy-finding.d.ts +22 -0
  153. package/dist/validate/taxonomy-finding.d.ts.map +1 -0
  154. package/dist/validate/taxonomy-finding.js +25 -0
  155. package/dist/validate/taxonomy-finding.js.map +1 -0
  156. package/dist/validate/universe-stage.d.ts +71 -0
  157. package/dist/validate/universe-stage.d.ts.map +1 -0
  158. package/dist/validate/universe-stage.js +165 -0
  159. package/dist/validate/universe-stage.js.map +1 -0
  160. package/dist/validate/wallet-binding-stage.d.ts +44 -0
  161. package/dist/validate/wallet-binding-stage.d.ts.map +1 -0
  162. package/dist/validate/wallet-binding-stage.js +92 -0
  163. package/dist/validate/wallet-binding-stage.js.map +1 -0
  164. package/openclaw.plugin.json +1 -1
  165. package/package.json +1 -1
@@ -34,6 +34,8 @@ export declare const VALIDATE_CODE: {
34
34
  readonly noRecipe: "E_VALIDATE_NO_RECIPE";
35
35
  /** More than one recipe candidate and no conventional name to break the tie. */
36
36
  readonly ambiguousRecipe: "E_VALIDATE_AMBIGUOUS_RECIPE";
37
+ /** A `strategy.yaml` is present and will not load, so which recipe it means is unknown. */
38
+ readonly unreadableManifest: "E_VALIDATE_UNREADABLE_MANIFEST";
37
39
  /** A depth that needs a recipe was requested against a target that has none. */
38
40
  readonly needsRecipe: "E_VALIDATE_NEEDS_RECIPE";
39
41
  /** Inline recipe content with no directory to resolve a relative scanner path against. */
@@ -66,6 +68,16 @@ export declare const VALIDATE_CODE: {
66
68
  readonly marginPctFraction: "E_VALIDATE_MARGIN_PCT_FRACTION";
67
69
  /** An LLM-mode decision action with no model configured. */
68
70
  readonly llmNoModel: "E_VALIDATE_LLM_NO_MODEL";
71
+ /** The recipe does not bind the wallet its package manifest declares for it. */
72
+ readonly walletUnbound: "E_VALIDATE_WALLET_UNBOUND";
73
+ /** The recipe ships no DSL exit block, so every position it opens runs with nothing to close it. */
74
+ readonly noDslExit: "E_VALIDATE_NO_DSL_EXIT";
75
+ /** A scanner entry declares `enabled`, which the engine never reads — it registers and ticks. */
76
+ readonly scannerEnabled: "E_VALIDATE_SCANNER_ENABLED";
77
+ /** The package id carries capitals, so its attribution stamp is written and read under two spellings. */
78
+ readonly packageIdCase: "E_VALIDATE_PACKAGE_ID_CASE";
79
+ /** Two instances resolve to one directory, so one proof file would answer for both recipes. */
80
+ readonly instanceDirCollision: "E_VALIDATE_INSTANCE_DIR_COLLISION";
69
81
  /** A syntax error in some file under the scanner root — including files never imported. */
70
82
  readonly syntax: "E_VALIDATE_SYNTAX";
71
83
  /** The entrypoint's import chain raised. */
@@ -98,6 +110,24 @@ export declare const VALIDATE_CODE: {
98
110
  readonly unknownMcpTool: "E_VALIDATE_UNKNOWN_MCP_TOOL";
99
111
  /** A hardcoded instrument that is not tradeable. */
100
112
  readonly unknownTicker: "E_VALIDATE_UNKNOWN_TICKER";
113
+ /**
114
+ * A hardcoded instrument in the package that is not live on the exchange. Deploy's pre-money
115
+ * check, run here too — it needs one live read, which is why it belongs to this depth.
116
+ */
117
+ readonly universeNotLive: "E_VALIDATE_UNIVERSE_NOT_LIVE";
118
+ /**
119
+ * That check could not run because the PACKAGE would not read — the manifest, or an instance
120
+ * recipe. Reported rather than passed over: a green verdict covering a check that never ran is
121
+ * the failure this command exists to correct. A warning, not an error, because it is ignorance
122
+ * about the package rather than evidence of a dead name.
123
+ */
124
+ readonly universeUnchecked: "W_VALIDATE_UNIVERSE_UNCHECKED";
125
+ /**
126
+ * That check could not run because the LIVE INSTRUMENT LIST would not read. A separate code from
127
+ * the one above because the actor differs: an unreadable list is an environment fault, and an
128
+ * agent that answers it by editing the package will loop.
129
+ */
130
+ readonly universeUnavailable: "W_VALIDATE_UNIVERSE_UNAVAILABLE";
101
131
  /** An emitted signal the runtime would reject on arrival. */
102
132
  readonly signalRejected: "E_VALIDATE_SIGNAL_REJECTED";
103
133
  /** Credentials absent or partially configured. */
@@ -1 +1 @@
1
- {"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../src/validate/codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,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qEAAqE;;IAErE,6FAA6F;;IAE7F,oDAAoD;;IAEpD;;;OAGG;;IAEH;;;;;OAKG;;IAEH;;;;OAIG;;IAEH,6DAA6D;;IAE7D,kDAAkD;;IAElD,sDAAsD;;IAEtD,kFAAkF;;IAElF,uDAAuD;;IAEvD,4FAA4F;;IAE5F,4FAA4F;;IAE5F,gDAAgD;;IAEhD,sFAAsF;;IAEtF,8FAA8F;;IAE9F,sFAAsF;;IAEtF,0EAA0E;;IAE1E,mFAAmF;;IAEnF,4FAA4F;;IAI5F,kDAAkD;;IAElD,qEAAqE;;IAErE,0FAA0F;;IAE1F,uFAAuF;;CAE/E,CAAC;AAEX,gDAAgD;AAChD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE9E,8FAA8F;AAC9F,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,mGAAmG;IACnG,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,YAAY,EAAE,gBAAgB,CA8QrE,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,kBAAkB,EAAE,SAAS,YAAY,EAEnC,CAAC;AAEpB;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ,CAEvD;AAED,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,EAAE,CAEpE"}
@@ -34,6 +34,8 @@ export const VALIDATE_CODE = {
34
34
  noRecipe: "E_VALIDATE_NO_RECIPE",
35
35
  /** More than one recipe candidate and no conventional name to break the tie. */
36
36
  ambiguousRecipe: "E_VALIDATE_AMBIGUOUS_RECIPE",
37
+ /** A `strategy.yaml` is present and will not load, so which recipe it means is unknown. */
38
+ unreadableManifest: "E_VALIDATE_UNREADABLE_MANIFEST",
37
39
  /** A depth that needs a recipe was requested against a target that has none. */
38
40
  needsRecipe: "E_VALIDATE_NEEDS_RECIPE",
39
41
  /** Inline recipe content with no directory to resolve a relative scanner path against. */
@@ -67,6 +69,16 @@ export const VALIDATE_CODE = {
67
69
  marginPctFraction: "E_VALIDATE_MARGIN_PCT_FRACTION",
68
70
  /** An LLM-mode decision action with no model configured. */
69
71
  llmNoModel: "E_VALIDATE_LLM_NO_MODEL",
72
+ /** The recipe does not bind the wallet its package manifest declares for it. */
73
+ walletUnbound: "E_VALIDATE_WALLET_UNBOUND",
74
+ /** The recipe ships no DSL exit block, so every position it opens runs with nothing to close it. */
75
+ noDslExit: "E_VALIDATE_NO_DSL_EXIT",
76
+ /** A scanner entry declares `enabled`, which the engine never reads — it registers and ticks. */
77
+ scannerEnabled: "E_VALIDATE_SCANNER_ENABLED",
78
+ /** The package id carries capitals, so its attribution stamp is written and read under two spellings. */
79
+ packageIdCase: "E_VALIDATE_PACKAGE_ID_CASE",
80
+ /** Two instances resolve to one directory, so one proof file would answer for both recipes. */
81
+ instanceDirCollision: "E_VALIDATE_INSTANCE_DIR_COLLISION",
70
82
  // ── import: will the code load ────────────────────────────────────────────
71
83
  /** A syntax error in some file under the scanner root — including files never imported. */
72
84
  syntax: "E_VALIDATE_SYNTAX",
@@ -101,6 +113,24 @@ export const VALIDATE_CODE = {
101
113
  unknownMcpTool: "E_VALIDATE_UNKNOWN_MCP_TOOL",
102
114
  /** A hardcoded instrument that is not tradeable. */
103
115
  unknownTicker: "E_VALIDATE_UNKNOWN_TICKER",
116
+ /**
117
+ * A hardcoded instrument in the package that is not live on the exchange. Deploy's pre-money
118
+ * check, run here too — it needs one live read, which is why it belongs to this depth.
119
+ */
120
+ universeNotLive: "E_VALIDATE_UNIVERSE_NOT_LIVE",
121
+ /**
122
+ * That check could not run because the PACKAGE would not read — the manifest, or an instance
123
+ * recipe. Reported rather than passed over: a green verdict covering a check that never ran is
124
+ * the failure this command exists to correct. A warning, not an error, because it is ignorance
125
+ * about the package rather than evidence of a dead name.
126
+ */
127
+ universeUnchecked: "W_VALIDATE_UNIVERSE_UNCHECKED",
128
+ /**
129
+ * That check could not run because the LIVE INSTRUMENT LIST would not read. A separate code from
130
+ * the one above because the actor differs: an unreadable list is an environment fault, and an
131
+ * agent that answers it by editing the package will loop.
132
+ */
133
+ universeUnavailable: "W_VALIDATE_UNIVERSE_UNAVAILABLE",
104
134
  /** An emitted signal the runtime would reject on arrival. */
105
135
  signalRejected: "E_VALIDATE_SIGNAL_REJECTED",
106
136
  /** Credentials absent or partially configured. */
@@ -159,6 +189,10 @@ export const VALIDATE_CODE_META = {
159
189
  stage: "invocation", actor: "agent", fix_kind: "choice",
160
190
  condition: "Several recipe candidates and no conventional name to break the tie.",
161
191
  },
192
+ [VALIDATE_CODE.unreadableManifest]: {
193
+ stage: "invocation", actor: "agent", fix_kind: "edit",
194
+ condition: "A strategy.yaml is present but does not load, so which recipe it names is unknown.",
195
+ },
162
196
  [VALIDATE_CODE.needsRecipe]: {
163
197
  stage: "invocation", actor: "agent", fix_kind: "command",
164
198
  condition: "A depth requiring a recipe was requested against a target that has none.",
@@ -212,6 +246,31 @@ export const VALIDATE_CODE_META = {
212
246
  stage: "static", actor: "agent", fix_kind: "edit",
213
247
  condition: "The declared entrypoint file is not on disk.",
214
248
  },
249
+ [VALIDATE_CODE.walletUnbound]: {
250
+ stage: "static", actor: "agent", fix_kind: "edit",
251
+ condition: "The package manifest declares a wallet_env for this instance and the recipe binds " +
252
+ "something else, so deploy would fund one wallet and trade another.",
253
+ },
254
+ [VALIDATE_CODE.noDslExit]: {
255
+ stage: "static", actor: "agent", fix_kind: "edit",
256
+ condition: "The recipe declares no DSL exit block, so positions would open with no stop loss and no " +
257
+ "trailing floor.",
258
+ },
259
+ [VALIDATE_CODE.scannerEnabled]: {
260
+ stage: "static", actor: "agent", fix_kind: "edit",
261
+ condition: "A scanner entry declares an `enabled` key, which the engine never reads — the scanner " +
262
+ "registers enabled and ticks whatever the value says.",
263
+ },
264
+ [VALIDATE_CODE.packageIdCase]: {
265
+ stage: "static", actor: "agent", fix_kind: "edit",
266
+ condition: "The package id is not lowercase, so the wallet attribution stamp is written verbatim and " +
267
+ "read back case-normalized.",
268
+ },
269
+ [VALIDATE_CODE.instanceDirCollision]: {
270
+ stage: "static", actor: "agent", fix_kind: "edit",
271
+ condition: "Two instances' recipes resolve to one directory, so the single proof file there cannot " +
272
+ "speak for either of them.",
273
+ },
215
274
  [VALIDATE_CODE.unresolvableScannerPath]: {
216
275
  stage: "static", actor: "agent", fix_kind: "edit",
217
276
  condition: "A relative scanner path has no directory to resolve against.",
@@ -288,7 +347,21 @@ export const VALIDATE_CODE_META = {
288
347
  },
289
348
  [VALIDATE_CODE.unknownTicker]: {
290
349
  stage: "live", actor: "agent", fix_kind: "lookup",
291
- condition: "A hardcoded instrument is not tradeable.",
350
+ // Deliberately not "a hardcoded instrument": this is observed at the call, so it fires the same
351
+ // way for a name the scanner derived at run time and reshaped, and one read of many is enough.
352
+ condition: "A read named an instrument the venue does not carry.",
353
+ },
354
+ [VALIDATE_CODE.universeNotLive]: {
355
+ stage: "live", actor: "agent", fix_kind: "edit",
356
+ condition: "A hardcoded instrument in the package is not live on the exchange.",
357
+ },
358
+ [VALIDATE_CODE.universeUnchecked]: {
359
+ stage: "live", actor: "agent", fix_kind: "edit",
360
+ condition: "The universe check could not run because the package itself would not read.",
361
+ },
362
+ [VALIDATE_CODE.universeUnavailable]: {
363
+ stage: "live", actor: "ops", fix_kind: "command",
364
+ condition: "The universe check could not run because the live instrument list would not read.",
292
365
  },
293
366
  [VALIDATE_CODE.signalRejected]: {
294
367
  stage: "live", actor: "agent", fix_kind: "edit",
@@ -1 +1 @@
1
- {"version":3,"file":"codes.js","sourceRoot":"","sources":["../../src/validate/codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH;;;;;GAKG;AACH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M,CACtE,aAAa,CACI,CAAC;AAEpB;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,IAAkB;IAC3C,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;AACrD,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,aAAa,CAAC,KAAsB;IAClD,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AACvF,CAAC"}
@@ -11,7 +11,7 @@ export { ALL_VALIDATE_CODES, VALIDATE_CODE, VALIDATE_CODE_META, codesForStage, s
11
11
  export { findUncoveredCodes, findUnknownCodes, type CoverageOptions } from "./coverage.js";
12
12
  export { findLlmActionsWithoutModel, findMarginPctFraction, findMissingEntrypoints, findUngatedStrategy, findUnsizedStrategy, } from "./recipe-checks.js";
13
13
  export { collectRecipeFindings, type RecipeSource, type RecipeValidation, } from "./recipe.js";
14
- export { isImplemented, runValidation, type ExitCode, type ValidateOptions, type ValidateResult, type Verdict, type VerdictBasis, } from "./run.js";
14
+ export { isImplemented, runValidation, type ExitCode, type ValidateDeps, type ValidateOptions, type ValidateResult, type Verdict, type VerdictBasis, } from "./run.js";
15
15
  export { renderFinding, renderHuman, renderJson } from "./report.js";
16
16
  /**
17
17
  * What the runtime refuses to install. Wired into `senpi.installRuntime`; the boot loop
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,KAAK,EACL,KAAK,EACL,OAAO,EACP,eAAe,EACf,OAAO,EACP,QAAQ,EACR,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EACL,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE3F,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,KAAK,YAAY,EACjB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,aAAa,EACb,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,YAAY,GAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErE;;;GAGG;AACH,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAErG;;;;GAIG;AACH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,K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AO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EACL,aAAa,GAKd,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,UAAU,GAGX,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAwB,MAAM,eAAe,CAAC;AAE3F,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,GAGtB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,aAAa,EACb,aAAa,GAMd,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErE;;;GAGG;AACH,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAA0B,MAAM,mBAAmB,CAAC;AAErG;;;;GAIG;AACH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,UAAU,GAMX,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,UAAU,GAEX,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EACL,aAAa,GAKd,MAAM,aAAa,CAAC;AAErB,OAAO,E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"}
1
+ {"version":3,"file":"install-gate.d.ts","sourceRoot":"","sources":["../../src/validate/install-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAgB1C,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,OAAO,CAAC;IACZ,mEAAmE;IACnE,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAwBD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAKvE;AAED,2FAA2F;AAC3F,eAAO,MAAM,sBAAsB,EAAE,SAAS,MAAM,EAAkB,CAAC"}
@@ -43,11 +43,19 @@ const BLOCKING = new Set([
43
43
  *
44
44
  * The gateway's error string is often the only thing an operator or agent ever reads, so it
45
45
  * carries the same what/why/fix the findings do rather than a count and a pointer to logs.
46
+ *
47
+ * Two things ride in front of and behind that, and both are conventions of this codebase rather
48
+ * than decoration. It LEADS with the first blocking code in brackets, because every other refusal
49
+ * on this boundary does and the taught surfaces tell agents to branch on that prefix
50
+ * (`deploy/taxonomy.ts` is its one reader). And it STATES that nothing was installed: a caller told
51
+ * only that a recipe "cannot be installed" still has to guess whether a partial install is sitting
52
+ * on the box to clean up, and guessing wrong in either direction costs more than the sentence.
46
53
  */
47
54
  function render(blocking) {
48
55
  const lines = blocking.map((f) => ` • ${f.what}\n why: ${f.why}\n fix: ${f.fix}`);
49
- return (`This recipe cannot be installed — it would not trade.\n\n${lines.join("\n\n")}\n\n` +
50
- `Run \`senpi validate\` on the package for the full report.`);
56
+ return (`[${blocking[0].code}] This recipe cannot be installed — it would not trade.\n\n` +
57
+ `${lines.join("\n\n")}\n\n` +
58
+ `Nothing was installed. Run \`openclaw senpi validate\` on the package for the full report.`);
51
59
  }
52
60
  /**
53
61
  * Decide whether a par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CAAC;AAED,2FAA2F;AAC3F,MAAM,CAAC,MAAM,sBAAsB,GAAsB,CAAC,GAAG,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Where `senpi validate` gets the exchange's live instrument list.
3
+ *
4
+ * The universe check is injected with a source rather than building one, so that the check stays
5
+ * testable and a programmatic caller can supply its own. This is the CLI's implementation of that
6
+ * source — the counterpart of `deploy/register.ts`'s `listLiveInstruments: () =>
7
+ * client.listInstrumentNames(callDeadline())`, which does the same thing on the money path.
8
+ *
9
+ * ## It is LAZY, and that is what keeps the offline depths offline
10
+ *
11
+ * Nothing is constructed and nothing is dialled until `listLiveInstruments()` is actually called,
12
+ * and the only caller is the live depth. So `--stage static` and `--stage import` reach no network
13
+ * even though the command always hands the source over — the property holds by construction rather
14
+ * than by a flag someone has to remember to set.
15
+ *
16
+ * ## It THROWS rather than returning nothing
17
+ *
18
+ * When credentials are absent, or the client cannot be reached, this raises with the reason.
19
+ * `checkPackageUniverse` turns a raising source into `{ status: "unavailable" }`, which validate
20
+ * renders as `W_VALIDATE_UNIVERSE_UNAVAILABLE` — "the check did not run, and here is why". The
21
+ * alternative — the command quietly declining to supply a source when the environment looks
22
+ * unpromising — is the dormancy this wiring exists to remove: a run that passes having never made
23
+ * the check it appears to make. Returning `[]` would be worse still: an empty list is defined
24
+ * upstream as "could not read", but nothing here should rely on a caller remembering that.
25
+ */
26
+ import { SenpiClient } from "../senpi/client.js";
27
+ import type { ValidateDeps } from "./universe-stage.js";
28
+ export interface LiveInstrumentSource {
29
+ deps: ValidateDeps;
30
+ /** Releases the connection, if one was ever opened. Never throws; safe to call unconditionally. */
31
+ close(): Promise<void>;
32
+ }
33
+ /**
34
+ * The CLI's live-instrument source. Opens nothing until asked.
35
+ *
36
+ * `env` and `connect` are injected for the tests — the credential rule and the laziness are the
37
+ * behaviour worth pinning, and neither should need a reachable MCP server to check.
38
+ */
39
+ export declare function createLiveInstrumentSource(options?: {
40
+ env?: NodeJS.ProcessEnv;
41
+ /** Builds the client. Defaults to a real self-managed `SenpiClient`. */
42
+ createClient?: () => Pick<SenpiClient, "listInstrumentNames" | "disconnect">;
43
+ }): LiveInstrumentSource;
44
+ //# sourceMappingURL=live-instruments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-instruments.d.ts","sourceRoot":"","sources":["../../src/validate/live-instruments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAYxD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,CAAC;IACnB,mGAAmG;IACnG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE;IAClD,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,wEAAwE;IACxE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,EAAE,qBAAqB,GAAG,YAAY,CAAC,CAAC;CACzE,GAAG,oBAAoB,CA4B5B"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Where `senpi validate` gets the exchange's live instrument list.
3
+ *
4
+ * The universe check is injected with a source rather than building one, so that the check stays
5
+ * testable and a programmatic caller can supply its own. This is the CLI's implementation of that
6
+ * source — the counterpart of `deploy/register.ts`'s `listLiveInstruments: () =>
7
+ * client.listInstrumentNames(callDeadline())`, which does the same thing on the money path.
8
+ *
9
+ * ## It is LAZY, and that is what keeps the offline depths offline
10
+ *
11
+ * Nothing is constructed and nothing is dialled until `listLiveInstruments()` is actually called,
12
+ * and the only caller is the live depth. So `--stage static` and `--stage import` reach no network
13
+ * even though the command always hands the source over — the property holds by construction rather
14
+ * than by a flag someone has to remember to set.
15
+ *
16
+ * ## It THROWS rather than returning nothing
17
+ *
18
+ * When credentials are absent, or the client cannot be reached, this raises with the reason.
19
+ * `checkPackageUniverse` turns a raising source into `{ status: "unavailable" }`, which validate
20
+ * renders as `W_VALIDATE_UNIVERSE_UNAVAILABLE` — "the check did not run, and here is why". The
21
+ * alternative — the command quietly declining to supply a source when the environment looks
22
+ * unpromising — is the dormancy this wiring exists to remove: a run that passes having never made
23
+ * the check it appears to make. Returning `[]` would be worse still: an empty list is defined
24
+ * upstream as "could not read", but nothing here should rely on a caller remembering that.
25
+ */
26
+ import { SenpiClient } from "../senpi/client.js";
27
+ import { missingCredentials } from "./run.js";
28
+ /**
29
+ * One instrument-list read, bounded.
30
+ *
31
+ * Deliberately far below deploy's 90s per-call budget: this is a single read on a command a person
32
+ * is waiting on, and the whole run's usefulness does not hinge on it — a slow list becomes
33
+ * "unavailable", which is a warning, not a failure.
34
+ */
35
+ const INSTRUMENT_LIST_TIMEOUT_MS = 20_000;
36
+ /**
37
+ * The CLI's live-instrument source. Opens nothing until asked.
38
+ *
39
+ * `env` and `connect` are injected for the tests — the credential rule and the laziness are the
40
+ * behaviour worth pinning, and neither should need a reachable MCP server to check.
41
+ */
42
+ export function createLiveInstrumentSource(options = {}) {
43
+ const env = options.env ?? process.env;
44
+ const build = options.createClient ?? (() => new SenpiClient({}));
45
+ let client;
46
+ return {
47
+ deps: {
48
+ async listLiveInstruments() {
49
+ // Named, not counted: "credentials are missing" leaves a reader guessing which, and this
50
+ // message is quoted verbatim into the finding that explains why the check did not run.
51
+ const missing = missingCredentials(env);
52
+ if (missing.length > 0) {
53
+ throw new Error(`${missing.join(" and ")} ${missing.length === 1 ? "is" : "are"} not set`);
54
+ }
55
+ client ??= build();
56
+ return client.listInstrumentNames({ signal: AbortSignal.timeout(INSTRUMENT_LIST_TIMEOUT_MS) });
57
+ },
58
+ },
59
+ async close() {
60
+ // A command that leaves a keep-alive socket open does not exit. Failing to close is not worth
61
+ // a message: the run's findings are already rendered by the time this is called.
62
+ try {
63
+ await client?.disconnect();
64
+ }
65
+ catch {
66
+ /* nothing left to do about it */
67
+ }
68
+ },
69
+ };
70
+ }
71
+ //# sourceMappingURL=live-instruments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live-instruments.js","sourceRoot":"","sources":["../../src/validate/live-instruments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C;;;;;;GAMG;AACH,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAQ1C;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,UAIvC,EAAE;IACJ,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;IAClE,IAAI,MAA2E,CAAC;IAEhF,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,CAAC,mBAAmB;gBACvB,yFAAyF;gBACzF,uFAAuF;gBACvF,MAAM,OAAO,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;gBACxC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACvB,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC;gBAC7F,CAAC;gBACD,MAAM,KAAK,KAAK,EAAE,CAAC;gBACnB,OAAO,MAAM,CAAC,mBAAmB,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;YACjG,CAAC;SACF;QACD,KAAK,CAAC,KAAK;YACT,8FAA8F;YAC9F,iFAAiF;YACjF,IAAI,CAAC;gBACH,MAAM,MAAM,EAAE,UAAU,EAAE,CAAC;YAC7B,CAAC;YAAC,MAAM,CAAC;gBACP,iCAAiC;YACnC,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -29,6 +29,14 @@ export interface ReadRecord {
29
29
  error_type?: string;
30
30
  response_keys?: string[];
31
31
  cast_dropped?: boolean;
32
+ /**
33
+ * The instrument the call named, as its own arguments carried it.
34
+ *
35
+ * Recorded by the harness at the call site, so a finding can name the offending instrument
36
+ * instead of the tool that was called with it. Absent when the call named none, and absent from
37
+ * older harness output — never inferred from the error text, which is the server's prose.
38
+ */
39
+ subject?: string;
32
40
  /** The call would have changed state and was refused rather than made. */
33
41
  blocked?: boolean;
34
42
  /** The response came back and the scanner never looked inside it. */
@@ -1 +1 @@
1
- {"version":3,"file":"live-stage.d.ts","sourceRoot":"","sources":["../../src/validate/live-stage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAaH,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAW,MAAM,YAAY,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,oDAAoD;AACpD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,qEAAqE;IACrE,M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vB,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,WAAgB,GACxB,OAAO,EAAE,CA6PX;AAiLD,oCAAoC;AACpC,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CAmGxE"}
@@ -167,8 +167,7 @@ export function judgeTick(scanner, outcome, context = {}) {
167
167
  // Diagnosed before the general accounting, because "the service is down" and "that name does not
168
168
  // exist" lead to completely different work and the second is answerable from a catalogue.
169
169
  const diagnosed = new Set();
170
- for (const [tool, cause] of namedCauses(reads)) {
171
- const example = reads.find((r) => r.tool === tool && !r.ok);
170
+ for (const [tool, { cause, matched }] of namedCauses(reads)) {
172
171
  for (const read of reads)
173
172
  if (read.tool === tool && !read.ok)
174
173
  diagnosed.add(read);
@@ -177,14 +176,9 @@ export function judgeTick(scanner, outcome, context = {}) {
177
176
  what: `'${tool}' is not a data source this server exposes`,
178
177
  why: "Every call to it fails, so whatever the scanner intended to read it never gets. The name is likely misremembered or from an older catalogue.",
179
178
  fix: "Look up the available data sources and use the one that carries this data.",
180
- evidence: { tool, error: example.error },
179
+ evidence: { tool, error: matched[0].error },
181
180
  })
182
- : liveFinding(VALIDATE_CODE.unknownTicker, "lookup", "error", {
183
- what: `The instrument named in the '${tool}' call is not tradeable`,
184
- why: "A hardcoded instrument that has been delisted, renamed, or never existed fails on every tick, and does so quietly enough that the scanner keeps running.",
185
- fix: "Check the name against the tradeable instrument list, or select instruments from that list rather than hardcoding them.",
186
- evidence: { tool, error: example.error },
187
- }));
181
+ : unknownInstrumentFinding(tool, matched, reads));
188
182
  }
189
183
  // ── what it read ─────────────────────────────────────────────────────────
190
184
  const undiagnosed = reads.filter((r) => !diagnosed.has(r));
@@ -297,6 +291,19 @@ export function judgeTick(scanner, outcome, context = {}) {
297
291
  }
298
292
  return findings;
299
293
  }
294
+ /** The cause one failed read's own message gives away, or nothing when it gives away nothing. */
295
+ function causeOf(read) {
296
+ if (read.ok || !read.error)
297
+ return undefined;
298
+ const message = read.error.toLowerCase();
299
+ if (/unknown tool|no such tool|tool not found|is not a (known|valid) tool/.test(message)) {
300
+ return "unknown-tool";
301
+ }
302
+ if (/unknown (asset|coin|symbol|instrument)|(asset|coin|symbol|instrument) not (found|supported)|not tradeable/.test(message)) {
303
+ return "unknown-instrument";
304
+ }
305
+ return undefined;
306
+ }
300
307
  /**
301
308
  * Failures whose cause the message itself gives away.
302
309
  *
@@ -305,23 +312,85 @@ export function judgeTick(scanner, outcome, context = {}) {
305
312
  * falls through to the general accounting, which is correct, whereas a wrong match sends someone
306
313
  * looking up a name that was never the problem.
307
314
  *
308
- * Keyed by tool, since one bad name fails every time it is called and is one thing to fix.
315
+ * Keyed by tool, since a misremembered tool name fails every time it is called and is one thing to
316
+ * fix. The reads that matched travel with the cause: one call in twelve can trip this, and a
317
+ * finding built from the tool's FIRST failure could quote a read that failed for something else
318
+ * entirely — a timeout among a dozen calls to the same tool is not evidence of a bad name.
309
319
  */
310
320
  function namedCauses(reads) {
311
321
  const causes = new Map();
312
322
  for (const read of reads) {
313
- if (read.ok || !read.error)
323
+ const cause = causeOf(read);
324
+ if (cause === undefined)
314
325
  continue;
315
- const message = read.error.toLowerCase();
316
- if (/unknown tool|no such tool|tool not found|is not a (known|valid) tool/.test(message)) {
317
- causes.set(read.tool, "unknown-tool");
318
- }
319
- else if (/unknown (asset|coin|symbol|instrument)|(asset|coin|symbol|instrument) not (found|supported)|not tradeable/.test(message)) {
320
- causes.set(read.tool, "unknown-instrument");
321
- }
326
+ const entry = causes.get(read.tool);
327
+ // The last match still sets the tool's cause, as it always has; a cause change starts the
328
+ // evidence over so the finding never carries reads that named a different fault.
329
+ if (entry !== undefined && entry.cause === cause)
330
+ entry.matched.push(read);
331
+ else
332
+ causes.set(read.tool, { cause, matched: [read] });
322
333
  }
323
334
  return causes;
324
335
  }
336
+ /**
337
+ * An instrument the venue rejected, stated as what was observed.
338
+ *
339
+ * Three things this has to get right, each of them a way the previous wording misled a reader.
340
+ *
341
+ * **It names the instruments.** They come from `subject`, recorded by the harness from the call's
342
+ * own arguments. When the harness recorded none the finding says so and points at the quoted error
343
+ * rather than describing a name it never saw.
344
+ *
345
+ * **It counts.** This fires when ONE read of a tool failed this way, not all of them, so a claim
346
+ * that the scanner "fails on every tick" is an overclaim the reader then has to unlearn. The
347
+ * counts are the tick's own.
348
+ *
349
+ * **It does not assume a hardcoded name.** A scanner that derives its universe from a live listing
350
+ * every tick hardcodes nothing, and sending its author hunting for a literal points at code that
351
+ * does not exist. Both origins get a next step.
352
+ */
353
+ function unknownInstrumentFinding(tool, matched, reads) {
354
+ const attempts = reads.filter((r) => r.tool === tool).length;
355
+ const named = [...new Set(matched.map((r) => r.subject).filter((s) => !!s))];
356
+ const quoted = named.map((name) => `"${name}"`).join(", ");
357
+ const scale = `${matched.length} of ${attempts} '${tool}' read${attempts === 1 ? "" : "s"}`;
358
+ // Which of three claims about the rest of the tick is actually true. Stated from the counts
359
+ // rather than assumed, because all three happen and they lead somewhere different.
360
+ const rest = matched.length === attempts
361
+ ? `Every '${tool}' read failed this way, so the scanner got nothing from it at all.`
362
+ : reads.some((r) => r.tool === tool && r.ok)
363
+ ? `Other '${tool}' reads succeeded, so this is a per-instrument fault rather than an outage — which is exactly why it survives a run that otherwise looks fine.`
364
+ : // Deliberately not "reported separately": every failed read of a diagnosed tool is taken
365
+ // out of the general accounting, so promising the reader another finding would be a
366
+ // promise this run does not keep. The read list is where those are.
367
+ `No '${tool}' read succeeded in this tick. The rest failed for reasons other than the name, which this finding does not cover — the read list has them.`;
368
+ return liveFinding(VALIDATE_CODE.unknownTicker, "lookup", "error", {
369
+ what: named.length > 0
370
+ ? `${scale} named an instrument the venue does not carry: ${quoted}`
371
+ : `${scale} named an instrument the venue does not carry; no instrument argument was recorded for ${matched.length === 1 ? "it" : "them"} — the rejected name is in the quoted error below`,
372
+ why: "The venue rejected the name itself, so those reads return no data and never will while the " +
373
+ "same name is sent. Nothing raises: the scanner scores without that instrument and the tick " +
374
+ "reports healthy. The name may be written into the strategy and since delisted or renamed — " +
375
+ "or derived from a live listing and then reshaped before the call, which looks identical " +
376
+ "from here, because instrument symbols are exact: a change of case, or a dropped dex prefix, " +
377
+ "is a different instrument and that one does not exist. " +
378
+ rest,
379
+ fix: (named.length > 0
380
+ ? `Check ${quoted} against the live instrument list (\`market_list_instruments\`). `
381
+ : "Take the rejected name from the error below and check it against the live instrument list (`market_list_instruments`). ") +
382
+ "If the strategy names instruments itself, replace or remove what is no longer listed. If it " +
383
+ "builds its universe at run time, pass each symbol to the call exactly as the listing " +
384
+ "returned it — do not upper-case it, re-case it, or rebuild it from parts.",
385
+ evidence: {
386
+ tool,
387
+ instruments: named,
388
+ failed_reads: matched.length,
389
+ tool_reads: attempts,
390
+ errors: [...new Set(matched.map((r) => r.error).filter((e) => !!e))].slice(0, 3),
391
+ },
392
+ });
393
+ }
325
394
  /** Values that are numbers written as text — `"1250.5"`, not `"BTC"` or `""`. */
326
395
  function textNumericFields(data) {
327
396
  if (typeof data !== "object" || data === null)