/** * The package universe: is every instrument this package hardcodes actually live on the exchange? * * Deploy's pre-money check, run here too. The SAME `checkPackageUniverse` `runDeploy` calls — not a * second implementation and not a re-derivation: this module only renders the verdict it returns as * findings. Deploy keeps its own call deliberately, because `strategy.yaml` is outside the proof * fingerprint, so a `catalog.assets` edit is exactly the change a proof cannot see. * * ## Why this is a LIVE-depth check * * The scan of the package is static, but the verdict is not: it needs the exchange's live * instrument list, and nothing about a hardcoded name can be judged without one. Static and import * are the depths that do no I/O — CI runs them with no gateway and no credentials — so putting a * network read there would have cost that property for every run. Nothing is lost by waiting: a * proof requires `depth === "live"`, and deploy refuses a package with no proof, so every path that * produces a deployable package reaches this depth. The author still learns before funding. * * ## Three states of "no package", and what each means here * * `pkg` set is the checkable one. `packageUnreadable` set means a `strategy.yaml` exists and would * not load — the check could not run, which is reported, not passed over. NEITHER set is the only * genuine "no package": a recipe being authored before its manifest exists, or a directory inside a * readable package that is not one of its instances. Nothing is reported there, because there is no * declared universe to check. * * ## What each kind of ignorance says, and why they are not one code * * Three things can stop this producing a verdict, and they route to different people: * * - The LIVE LIST could not be read — the source threw, or returned nothing (an empty list means * "could not read", NEVER "everything is dead"). That is an environment fault: * `W_VALIDATE_UNIVERSE_UNAVAILABLE`, actor `ops`. It names no instrument dead, because a read * that did not succeed proves nothing about this package. * - The PACKAGE could not be read — an unloadable manifest, or an instance recipe that will not * parse. That is the author's to fix: `W_VALIDATE_UNIVERSE_UNCHECKED`, actor `agent`. * - No source was supplied at all. Silent, and only here: that is a programmatic caller choosing * not to run the check, not a run that tried and failed. The CLI always supplies one, so the * "could not obtain a client" case arrives as `unavailable` above and speaks. * * Splitting the first two on `actor` is not tidiness. `actor` is loop control — an agent that * answers "the MCP server is down" by editing `strategy.yaml` will keep editing until something * else stops it, which is the exact failure `Actor` exists to prevent. * * What none of them ever do is call an instrument dead. That invariant is the whole point of the * `unavailable` status upstream, and it survives being rendered here. */ import { type UniverseCheckDeps } from "../universe/package-universe.js"; import type { ResolvedTarget } from "./target.js"; import type { Finding } from "./types.js"; /** * The read-only sources a check needs when it cannot answer from the package alone. * * Injected rather than constructed, so the offline depths stay offline for a caller that has none, * and so the tests drive the real check rather than a stubbed module. */ export type ValidateDeps = UniverseCheckDeps; /** What {@link universeFindings} needs from the run's options. */ export interface UniverseStageOptions { deps?: ValidateDeps; /** Directory the caller invoked from, for rendering paths a reader can act on. */ cwd: string; } /** * The check, as findings. Called from the live depth; never from static or import. * * The order of the guards below is load-bearing: absent `deps` is checked BEFORE * `packageUnreadable`, so a caller that asked for no universe check is never told about a manifest * it never asked about. */ export declare function universeFindings(target: ResolvedTarget, options: UniverseStageOptions): Promise; //# sourceMappingURL=universe-stage.d.ts.map