@jawache/flow 0.1.1 → 0.1.2

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.
@@ -191,6 +191,24 @@ export type World = Pick<Ctx, "exec" | "fs" | "git">;
191
191
  * would be called with `ctx` as its receiver and break any world that closes over itself.
192
192
  */
193
193
  export declare function makeCtx(moment: Moment, facts: Partial<Ctx>, world: World): Ctx;
194
+ /**
195
+ * Mark a configured check as built with options it cannot work with, and say why.
196
+ *
197
+ * WHY IT IS A VALUE AND NOT A THROW: a check factory runs while the config module is evaluating, so
198
+ * a throw there is a module that will not import, and the reader gets one fault with a stack trace
199
+ * instead of every fault with its entry named. Marked instead, the load collects it beside the
200
+ * grammar's own refusals and the engine blocks every gated moment with the same text — which is the
201
+ * shape every other load failure already has.
202
+ *
203
+ * WHY IT EXISTS AT ALL: an option can be well-TYPED and still be nonsense — the class that bit here
204
+ * was a depcruise layer written as a regex where the dialect takes globs, which compiled to a
205
+ * pattern matching nothing. The fence loaded, `flow status` called it armed, and it walked no graph
206
+ * for as long as nobody planted a probe. A rule that cannot do its job must refuse to load, never
207
+ * report green.
208
+ */
209
+ export declare function withFaults<C extends Check>(check: C, faults: readonly string[]): C;
210
+ /** What a configured check said is wrong with its own options. Empty for every healthy check. */
211
+ export declare function faultsOf(check: Check | undefined): readonly string[];
194
212
  /**
195
213
  * Declare a CONFIGURED check: a function that takes options and returns a check.
196
214
  *
@@ -631,7 +649,7 @@ export interface Overlaid {
631
649
  */
632
650
  export declare function overlay(base: EntrySpec, spoken: Readonly<Record<string, unknown>>, prior?: Readonly<Record<string, "pack" | "override">>): Overlaid;
633
651
  /** The closed vocabulary of refusals. Every load failure is exactly one of these. */
634
- export declare const REFUSAL_CODES: readonly ["not-a-pack", "missing-parameter", "unknown-entry", "unknown-key", "unknown-moment", "missing-mandatory", "undeclared-category", "no-cases", "duplicate-id", "dead-scope"];
652
+ export declare const REFUSAL_CODES: readonly ["not-a-pack", "missing-parameter", "unknown-entry", "unknown-key", "unknown-moment", "missing-mandatory", "undeclared-category", "no-cases", "duplicate-id", "dead-scope", "bad-check-options"];
635
653
  export type RefusalCode = (typeof REFUSAL_CODES)[number];
636
654
  /** One reason the config will not load. */
637
655
  export interface Refusal {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jawache/flow",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Guardrails and breadcrumbs as code — packs you import, a config that typechecks, one adapter per harness.",
5
5
  "license": "MIT",
6
6
  "repository": {