@directive-run/core 1.20.2 → 1.22.0

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 (82) hide show
  1. package/README.md +33 -0
  2. package/dist/adapter-utils.cjs +1 -1
  3. package/dist/adapter-utils.d.cts +2 -2
  4. package/dist/adapter-utils.d.ts +2 -2
  5. package/dist/adapter-utils.js +1 -1
  6. package/dist/chunk-6NCC6RBC.js +3 -0
  7. package/dist/chunk-6NCC6RBC.js.map +1 -0
  8. package/dist/chunk-6PF2FRBG.js +7 -0
  9. package/dist/chunk-6PF2FRBG.js.map +1 -0
  10. package/dist/{chunk-RWFKUNF7.cjs → chunk-GACC2DMS.cjs} +2 -2
  11. package/dist/{chunk-RWFKUNF7.cjs.map → chunk-GACC2DMS.cjs.map} +1 -1
  12. package/dist/{chunk-4MNQDXH7.cjs → chunk-GBCWXTXW.cjs} +3 -3
  13. package/dist/chunk-GBCWXTXW.cjs.map +1 -0
  14. package/dist/chunk-GKMJ7NMP.cjs +7 -0
  15. package/dist/chunk-GKMJ7NMP.cjs.map +1 -0
  16. package/dist/{chunk-WKCMOU2F.js → chunk-KGTBTGOY.js} +2 -2
  17. package/dist/{chunk-WKCMOU2F.js.map → chunk-KGTBTGOY.js.map} +1 -1
  18. package/dist/{chunk-4QCKAJCX.cjs → chunk-MARZI3EY.cjs} +2 -2
  19. package/dist/{chunk-4QCKAJCX.cjs.map → chunk-MARZI3EY.cjs.map} +1 -1
  20. package/dist/chunk-OAPD3HIG.cjs +16 -0
  21. package/dist/chunk-OAPD3HIG.cjs.map +1 -0
  22. package/dist/chunk-QTY2FXZY.cjs +3 -0
  23. package/dist/chunk-QTY2FXZY.cjs.map +1 -0
  24. package/dist/{chunk-O4GQEV4G.js → chunk-RBF653NR.js} +2 -2
  25. package/dist/{chunk-O4GQEV4G.js.map → chunk-RBF653NR.js.map} +1 -1
  26. package/dist/{chunk-PXRV64PA.js → chunk-SFUVPP4L.js} +3 -3
  27. package/dist/chunk-SFUVPP4L.js.map +1 -0
  28. package/dist/chunk-YJEDX2JX.js +16 -0
  29. package/dist/chunk-YJEDX2JX.js.map +1 -0
  30. package/dist/{index-D_K7eEOF.d.ts → index-BgKC_ZT_.d.ts} +1 -1
  31. package/dist/{index-DApsqJ0h.d.cts → index-DRPkZ8HE.d.cts} +1 -1
  32. package/dist/index.cjs +2 -2
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +47 -43
  35. package/dist/index.d.ts +47 -43
  36. package/dist/index.js +2 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/internals.cjs +1 -1
  39. package/dist/internals.d.cts +60 -28
  40. package/dist/internals.d.ts +60 -28
  41. package/dist/internals.js +1 -1
  42. package/dist/plugins/index.cjs +2 -2
  43. package/dist/plugins/index.cjs.map +1 -1
  44. package/dist/plugins/index.d.cts +159 -3
  45. package/dist/plugins/index.d.ts +159 -3
  46. package/dist/plugins/index.js +2 -2
  47. package/dist/plugins/index.js.map +1 -1
  48. package/dist/{plugins-C6MxOvot.d.cts → plugins-5Supk7it.d.cts} +174 -43
  49. package/dist/{plugins-C6MxOvot.d.ts → plugins-5Supk7it.d.ts} +174 -43
  50. package/dist/{predicate-C92yT5IR.d.ts → predicate-C9oMO_ny.d.ts} +1 -1
  51. package/dist/{predicate-CV3YJDup.d.cts → predicate-DYb-3Mvl.d.cts} +1 -1
  52. package/dist/system-5FKUBLLV.cjs +2 -0
  53. package/dist/{system-BXCEQBBS.cjs.map → system-5FKUBLLV.cjs.map} +1 -1
  54. package/dist/system-6YWCXQOQ.js +2 -0
  55. package/dist/{system-AWEKWMNI.js.map → system-6YWCXQOQ.js.map} +1 -1
  56. package/dist/testing.cjs +1 -1
  57. package/dist/testing.d.cts +1 -1
  58. package/dist/testing.d.ts +1 -1
  59. package/dist/testing.js +1 -1
  60. package/dist/{utils-BZBBwS5A.d.cts → utils-DY8KTiD6.d.cts} +20 -7
  61. package/dist/{utils-BZBBwS5A.d.ts → utils-DY8KTiD6.d.ts} +20 -7
  62. package/dist/worker.cjs +1 -1
  63. package/dist/worker.d.cts +1 -1
  64. package/dist/worker.d.ts +1 -1
  65. package/dist/worker.js +1 -1
  66. package/package.json +1 -1
  67. package/dist/chunk-3ETCZLAY.js +0 -7
  68. package/dist/chunk-3ETCZLAY.js.map +0 -1
  69. package/dist/chunk-4MNQDXH7.cjs.map +0 -1
  70. package/dist/chunk-CLJMEU2A.js +0 -3
  71. package/dist/chunk-CLJMEU2A.js.map +0 -1
  72. package/dist/chunk-JGPPJV5P.cjs +0 -7
  73. package/dist/chunk-JGPPJV5P.cjs.map +0 -1
  74. package/dist/chunk-MDMMMZUZ.cjs +0 -3
  75. package/dist/chunk-MDMMMZUZ.cjs.map +0 -1
  76. package/dist/chunk-PNB73G3E.cjs +0 -16
  77. package/dist/chunk-PNB73G3E.cjs.map +0 -1
  78. package/dist/chunk-PXRV64PA.js.map +0 -1
  79. package/dist/chunk-QQEXRNAI.js +0 -16
  80. package/dist/chunk-QQEXRNAI.js.map +0 -1
  81. package/dist/system-AWEKWMNI.js +0 -2
  82. package/dist/system-BXCEQBBS.cjs +0 -2
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { C as ClauseResult, F as FactPredicate, S as SchemaType, D as DefinitionMeta, M as ModuleSchema, a as Facts, T as TypedDerivationsDef, b as TypedEventsDef, E as EffectsDef, c as SourcesDef, d as TypedConstraintsDef, e as TypedResolversDef, f as ModuleHooks, g as CrossModuleDeps, h as CrossModuleDerivationsDef, i as CrossModuleEffectsDef, j as CrossModuleConstraintsDef, k as ModuleDef, l as CreateSystemOptionsSingle, m as SingleModuleSystem, n as ModulesMap, o as CreateSystemOptionsNamed, N as NamespacedSystem, P as Plugin, p as TraceOption, q as ErrorBoundaryConfig, R as RequirementWithId, r as Requirement, s as RequirementKeyFn } from './plugins-C6MxOvot.cjs';
2
- export { A as AnySystem, B as BatchConfig, t as ConstraintDefinition, u as ConstraintsDefinition, v as CrossModuleConstraintDefinition, w as CrossModuleEffectDefinition, x as DirectiveError, y as DistributableSnapshot, z as DistributableSnapshotOptions, G as DynamicConstraintDef, G as DynamicConstraintDefinition, H as DynamicEffectDef, I as DynamicResolverDef, I as DynamicResolverDefinition, J as EffectDefinition, K as EventsDefinition, L as FactTemplate, O as FactsSnapshot, Q as HistoryAPI, U as HistoryOption, V as HistoryState, W as InferDerivations, X as InferEvents, Y as InferFacts, Z as InferRequirementTypes, _ as InferRequirements, $ as InferSchemaType, a0 as InferSelectorState, a1 as KeySelector, a2 as MetaAccessor, a3 as MetaMatch, a4 as ObservationEvent, a5 as OperatorObject, a6 as PatchSpec, a7 as PatchValue, a8 as PayloadRef, a9 as PredicateClause, aa as PredicateCombinator, ab as PredicateCombinatorKey, ac as PredicateObject, ad as PredicateOp, ae as ResolverDefinition, af as ResolversDefinition, ag as RetryPolicy, ah as Schema, ai as SchemaTypedResolversDefinition, aj as Snapshot, ak as SourceDef, ak as SourceDefinition, al as SourcePublish, al as SourcePublishFn, am as SourceReportError, an as SourceUnsubscribe, an as SourceUnsubscribeFn, ao as System, ap as SystemConfig, aq as SystemDerived, ar as SystemFacts, as as SystemInspection, at as SystemMode, au as SystemSnapshot, av as TraceEntry, aw as TypedConstraintDefinition, ax as TypedResolverDefinition, ay as isNamespacedSystem, az as isSingleModuleSystem } from './plugins-C6MxOvot.cjs';
3
- import { S as SchemaKindNode } from './predicate-CV3YJDup.cjs';
4
- export { D as DerivationDefWithMeta, a as DerivationDefinition, D as DerivationDefinitionWithMeta, b as DerivationsDefinition, c as SchemaKind, d as SchemaValidationError, e as SchemaValidationOptions, f as SchemaValidationResult, g as applyPatch, h as evaluateKeySelector, i as evaluatePredicate, j as evaluatePredicateExplained, k as evaluateTemplate, l as extractDeps, m as extractTemplateKeys, n as getKind, o as getOperatorsForKind, p as getSchemaFieldKinds, q as isPredicate, r as isTemplate, s as listAllPredicateOperators, t as memoizePredicate, u as typedConstraint, v as typedResolver, w as validatePredicate, x as validatePredicateAgainstSchema } from './predicate-CV3YJDup.cjs';
5
- export { A as AuditEntry, a as AuditEntryKind, b as AuditLedger, c as AuditLedgerOptions, d as AuditLedgerSink, Q as QueryFilter, V as VerifyResult, e as createAuditLedger, m as memorySink } from './index-DApsqJ0h.cjs';
6
- export { D as DistributableSnapshotLike, S as SignedSnapshot, a as SnapshotDiff, b as SnapshotDiffEntry, d as diffSnapshots, i as isSignedSnapshot, c as isSnapshotExpired, s as shallowEqual, e as signSnapshot, v as validateSnapshot, f as verifySnapshotSignature } from './utils-BZBBwS5A.cjs';
1
+ import { C as ClauseResult, F as FactPredicate, S as SchemaType, D as DefinitionMeta, M as ModuleSchema, a as Facts, T as TypedDerivationsDef, b as TypedEventsDef, E as EffectsDef, c as SourcesDef, d as TypedConstraintsDef, e as TypedResolversDef, f as ModuleHooks, g as CrossModuleDeps, h as CrossModuleDerivationsDef, i as CrossModuleEffectsDef, j as CrossModuleConstraintsDef, k as ModuleDef, l as CreateSystemOptionsSingle, m as SingleModuleSystem, n as ModulesMap, o as CreateSystemOptionsNamed, N as NamespacedSystem, P as Plugin, p as TraceOption, q as ErrorBoundaryConfig, R as RequirementWithId, r as Requirement, s as RequirementKeyFn } from './plugins-5Supk7it.cjs';
2
+ export { A as AnySystem, B as BatchConfig, t as ConstraintDefinition, u as ConstraintsDefinition, v as CrossModuleConstraintDefinition, w as CrossModuleEffectDefinition, x as DirectiveError, y as DistributableSnapshot, z as DistributableSnapshotOptions, G as DynamicConstraintDef, G as DynamicConstraintDefinition, H as DynamicEffectDef, I as DynamicResolverDef, I as DynamicResolverDefinition, J as EffectDefinition, K as EventsDefinition, L as FactTemplate, O as FactsSnapshot, Q as HistoryAPI, U as HistoryOption, V as HistoryState, W as InferDerivations, X as InferEvents, Y as InferFacts, Z as InferRequirementTypes, _ as InferRequirements, $ as InferSchemaType, a0 as InferSelectorState, a1 as KeySelector, a2 as MetaAccessor, a3 as MetaMatch, a4 as ObservationEvent, a5 as OperatorObject, a6 as PatchSpec, a7 as PatchValue, a8 as PayloadRef, a9 as PredicateClause, aa as PredicateCombinator, ab as PredicateCombinatorKey, ac as PredicateObject, ad as PredicateOp, ae as ResolverDefinition, af as ResolversDefinition, ag as RetryPolicy, ah as Schema, ai as SchemaTypedResolversDefinition, aj as Snapshot, ak as SourceDef, ak as SourceDefinition, al as SourceDropReason, am as SourcePublish, am as SourcePublishFn, an as SourceReportError, ao as SourceUnsubscribe, ao as SourceUnsubscribeFn, ap as System, aq as SystemConfig, ar as SystemDerived, as as SystemFacts, at as SystemInspection, au as SystemMode, av as SystemSnapshot, aw as TraceEntry, ax as TypedConstraintDefinition, ay as TypedResolverDefinition, az as isNamespacedSystem, aA as isSingleModuleSystem } from './plugins-5Supk7it.cjs';
3
+ import { S as SchemaKindNode } from './predicate-DYb-3Mvl.cjs';
4
+ export { D as DerivationDefWithMeta, a as DerivationDefinition, D as DerivationDefinitionWithMeta, b as DerivationsDefinition, c as SchemaKind, d as SchemaValidationError, e as SchemaValidationOptions, f as SchemaValidationResult, g as applyPatch, h as evaluateKeySelector, i as evaluatePredicate, j as evaluatePredicateExplained, k as evaluateTemplate, l as extractDeps, m as extractTemplateKeys, n as getKind, o as getOperatorsForKind, p as getSchemaFieldKinds, q as isPredicate, r as isTemplate, s as listAllPredicateOperators, t as memoizePredicate, u as typedConstraint, v as typedResolver, w as validatePredicate, x as validatePredicateAgainstSchema } from './predicate-DYb-3Mvl.cjs';
5
+ export { A as AuditEntry, a as AuditEntryKind, b as AuditLedger, c as AuditLedgerOptions, d as AuditLedgerSink, Q as QueryFilter, V as VerifyResult, e as createAuditLedger, m as memorySink } from './index-DRPkZ8HE.cjs';
6
+ export { D as DistributableSnapshotLike, S as SignedSnapshot, a as SnapshotDiff, b as SnapshotDiffEntry, d as diffSnapshots, i as isSignedSnapshot, c as isSnapshotExpired, s as shallowEqual, e as signSnapshot, v as validateSnapshot, f as verifySnapshotSignature } from './utils-DY8KTiD6.cjs';
7
7
 
8
8
  /**
9
9
  * Predicate backtest — rule-change impact.
@@ -581,9 +581,10 @@ declare function predict<F = Record<string, unknown>>(predicate: FactPredicate<F
581
581
  * defensible.
582
582
  *
583
583
  * **v1 scope LIMITATION (M4):** `checkAgainst` operates on predicate
584
- * logic only. It does NOT consult `bind:` / `owns:` resolver metadata —
585
- * a candidate that would *write* to a fact owned by another constraint
586
- * will not be flagged here. Use `doctor.checkOwns()` for that gate.
584
+ * logic only. It does NOT consult `bind:` / `abortOn:` resolver
585
+ * metadata — a candidate that would *write* to a fact in another
586
+ * constraint's abort-binding will not be flagged here. Use
587
+ * `doctor.checkAbortOn()` for that gate.
587
588
  *
588
589
  * **INVARIANT (M11):** `checkAgainst` depends on `flattenPredicate`
589
590
  * emitting `{ path, op, value }` LeafClause shape — if that shape ever
@@ -632,30 +633,31 @@ interface ExistingConstraint {
632
633
  readonly id: string;
633
634
  readonly whenSpec?: unknown;
634
635
  /**
635
- * Fact paths the constraint's resolver(s) write to, if exposed by the
636
- * inspect API. Consulted by {@link doctor.checkOwns} to flag candidates
637
- * that would write to fields owned elsewhere. Optional older inspect
638
- * payloads omit it.
636
+ * Fact paths the constraint's resolver aborts on when changed
637
+ * mid-flight, if exposed by the inspect API. Consulted by
638
+ * {@link doctor.checkAbortOn} to flag candidates that would write to
639
+ * fields under another constraint's abort-binding. Optional — older
640
+ * inspect payloads omit it.
639
641
  */
640
- readonly owns?: readonly string[];
641
- /** Same as {@link owns} but for the bind: side of binding metadata. */
642
+ readonly abortOn?: readonly string[];
643
+ /** Same as {@link abortOn} but for the bind: side of binding metadata. */
642
644
  readonly bind?: readonly string[];
643
645
  }
644
646
  /**
645
- * Returned by {@link doctor.checkOwns}.
647
+ * Returned by {@link doctor.checkAbortOn}.
646
648
  *
647
649
  * `severity` matches the {@link Contradiction} discriminator on
648
650
  * {@link CheckAgainstResult} so callers can route both shapes
649
- * uniformly: by default, owns-collisions are `"warning"` (the engine
650
- * still has a runtime gate), but a caller can promote them to
651
- * `"error"` for stricter pre-deploy linting. (M5)
651
+ * uniformly: by default, abort-binding collisions are `"warning"`
652
+ * (the engine still has a runtime gate), but a caller can promote them
653
+ * to `"error"` for stricter pre-deploy linting. (M5)
652
654
  */
653
- interface CheckOwnsFinding {
655
+ interface CheckAbortOnFinding {
654
656
  readonly constraintId: string;
655
657
  /** The fact path on the candidate predicate that triggered the finding. */
656
658
  readonly candidatePath: string;
657
- /** The owner side it would collide with: "owns" or "bind". */
658
- readonly source: "owns" | "bind";
659
+ /** The binding side it would collide with: "abortOn" or "bind". */
660
+ readonly source: "abortOn" | "bind";
659
661
  readonly reason: string;
660
662
  /**
661
663
  * Severity discriminator — `"warning"` by default (the engine has
@@ -665,20 +667,21 @@ interface CheckOwnsFinding {
665
667
  readonly severity?: "error" | "warning";
666
668
  }
667
669
  /**
668
- * Result of {@link doctor.checkOwns}.
670
+ * Result of {@link doctor.checkAbortOn}.
669
671
  *
670
- * Owns-/bind- collisions are warnings, not contradictions — the engine
671
- * itself enforces the runtime binding gate, so a pre-deploy doctor pass
672
- * treats them as advisory. The {@link CheckOwnsFinding.severity}
673
- * discriminator anticipates v2 promotion of findings to errors. (M5, F-3)
672
+ * AbortOn-/bind- collisions are warnings, not contradictions — the
673
+ * engine itself enforces the runtime binding gate, so a pre-deploy
674
+ * doctor pass treats them as advisory. The
675
+ * {@link CheckAbortOnFinding.severity} discriminator anticipates v2
676
+ * promotion of findings to errors. (M5, F-3)
674
677
  */
675
- interface CheckOwnsResult {
678
+ interface CheckAbortOnResult {
676
679
  /**
677
- * Owns-/bind- collisions surfaced by {@link doctor.checkOwns}. Empty
678
- * when constraints expose no `owns:` / `bind:` metadata or the
679
- * candidate's fact paths don't overlap.
680
+ * AbortOn-/bind- collisions surfaced by {@link doctor.checkAbortOn}.
681
+ * Empty when constraints expose no `abortOn:` / `bind:` metadata or
682
+ * the candidate's fact paths don't overlap.
680
683
  */
681
- readonly warnings: readonly CheckOwnsFinding[];
684
+ readonly warnings: readonly CheckAbortOnFinding[];
682
685
  }
683
686
  declare const doctor: {
684
687
  /**
@@ -712,31 +715,32 @@ declare const doctor: {
712
715
  }): CheckAgainstResult;
713
716
  /**
714
717
  * Flag a candidate predicate whose referenced fact paths overlap with
715
- * fields *owned* (or `bind:`-bound) by an existing constraint's
716
- * resolvers. A v1 stub: relies on `inspect()` exposing `owns:` / `bind:`
717
- * on each constraint snapshot. When that metadata is absent, this
718
- * returns `{ findings: [] }` no false positives.
718
+ * fields in another constraint's `abortOn:` list (or `bind:`-bound by
719
+ * an existing constraint's resolvers). A v1 stub: relies on
720
+ * `inspect()` exposing `abortOn:` / `bind:` on each constraint
721
+ * snapshot. When that metadata is absent, this returns
722
+ * `{ findings: [] }` — no false positives.
719
723
  *
720
724
  * **TODO (v2):** wire the engine's resolver-ownership graph through
721
725
  * `system.inspect()` so this returns real findings without manual
722
- * `owns:` annotations on inspect payloads.
726
+ * `abortOn:` annotations on inspect payloads.
723
727
  *
724
728
  * @example
725
729
  * ```ts
726
- * doctor.checkOwns(
730
+ * doctor.checkAbortOn(
727
731
  * { cartTotal: { $gte: 100 } },
728
732
  * system.inspect(),
729
733
  * );
730
734
  * // → { findings: [
731
735
  * // { constraintId: "applyDiscount", candidatePath: "cartTotal",
732
- * // source: "owns",
733
- * // reason: "Constraint applyDiscount already owns cartTotal." }
736
+ * // source: "abortOn",
737
+ * // reason: "Constraint applyDiscount aborts on cartTotal." }
734
738
  * // ] }
735
739
  * ```
736
740
  */
737
- checkOwns<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
741
+ checkAbortOn<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
738
742
  constraints: readonly ExistingConstraint[];
739
- }): CheckOwnsResult;
743
+ }): CheckAbortOnResult;
740
744
  };
741
745
 
742
746
  /**
@@ -2253,4 +2257,4 @@ declare const Backoff: {
2253
2257
  readonly Exponential: "exponential";
2254
2258
  };
2255
2259
 
2256
- export { Backoff, type Branded, type ChainableSchemaType, type Change, type ChangeKind, type CheckAgainstResult, type CheckOwnsFinding, type CheckOwnsResult, ClauseResult, type ConstraintDiff, type ConstraintStatus, type Contradiction, type ContradictionType, CreateSystemOptionsNamed, CreateSystemOptionsSingle, CrossModuleConstraintsDef as CrossModuleConstraintsDefinition, CrossModuleDeps, CrossModuleDerivationsDef as CrossModuleDerivationsDefinition, CrossModuleEffectsDef as CrossModuleEffectsDefinition, DefinitionMeta, type DescribeOptions, type DiffRulesOptions, EffectsDef as EffectsDefinition, ErrorBoundaryConfig, type ExistingConstraint, type ExtendedSchemaType, FactPredicate, Facts, type LeafClause, MAX_REPLAY_FRAMES, MAX_SWEEP_POINTS, type ModuleConfig, type ModuleConfigWithDeps, ModuleDef, ModuleDef as ModuleDefinition, ModuleHooks, ModuleSchema, ModulesMap, NamespacedSystem, Plugin, type PredicateBacktestReport, type PredicateToMongoOptions, type PredicateToPostgrestOptions, type PredicateToSqlOptions, type PredicateToSqlResult, type PredictMissingChange, type PredictResult, type ReplayDiffSample, type ReplayFrame, type ReplayUnderOptions, Requirement, RequirementSet, type RequirementTypeStatus, RequirementWithId, type RulesDiffReport, type RulesMapInput, SchemaKindNode, SchemaType, type SignalClock, SingleModuleSystem, SourcesDef, SourcesDef as SourcesDefinition, type SweepHole, type SweepPoint, type SweepReport, type SweepUnderOptions, type TimerFactOpts, type TimerFactState, TraceOption, TypedConstraintsDef as TypedConstraintsDefinition, TypedDerivationsDef as TypedDerivationsDefinition, TypedEventsDef as TypedEventsDefinition, TypedResolversDef as TypedResolversDefinition, completeTimer, createModule, createModuleFactory, createRequirementStatusPlugin, createStatusHook, createSystem, createSystemWithStatus, defaultClock, describePredicate, diffClauses, diffRules, doctor, elapsedMs, flattenPredicate, forType, framesFromHistory, framesFromSnapshots, generateRequirementId, initialTimerState, isRequirementType, pauseTimer, predicateHash, predicateToMongo, predicateToPostgrest, predicateToSQL, predicateToWhere, predict, realClock, registerRepeat, remainingMs, replayUnder, req, resetTimer, resumeTimer, startTimer, sweepUnder, t, tickTimer, timerOps, toReplayFrames, toRulesMap, virtualClock };
2260
+ export { Backoff, type Branded, type ChainableSchemaType, type Change, type ChangeKind, type CheckAbortOnFinding, type CheckAbortOnResult, type CheckAgainstResult, ClauseResult, type ConstraintDiff, type ConstraintStatus, type Contradiction, type ContradictionType, CreateSystemOptionsNamed, CreateSystemOptionsSingle, CrossModuleConstraintsDef as CrossModuleConstraintsDefinition, CrossModuleDeps, CrossModuleDerivationsDef as CrossModuleDerivationsDefinition, CrossModuleEffectsDef as CrossModuleEffectsDefinition, DefinitionMeta, type DescribeOptions, type DiffRulesOptions, EffectsDef as EffectsDefinition, ErrorBoundaryConfig, type ExistingConstraint, type ExtendedSchemaType, FactPredicate, Facts, type LeafClause, MAX_REPLAY_FRAMES, MAX_SWEEP_POINTS, type ModuleConfig, type ModuleConfigWithDeps, ModuleDef, ModuleDef as ModuleDefinition, ModuleHooks, ModuleSchema, ModulesMap, NamespacedSystem, Plugin, type PredicateBacktestReport, type PredicateToMongoOptions, type PredicateToPostgrestOptions, type PredicateToSqlOptions, type PredicateToSqlResult, type PredictMissingChange, type PredictResult, type ReplayDiffSample, type ReplayFrame, type ReplayUnderOptions, Requirement, RequirementSet, type RequirementTypeStatus, RequirementWithId, type RulesDiffReport, type RulesMapInput, SchemaKindNode, SchemaType, type SignalClock, SingleModuleSystem, SourcesDef, SourcesDef as SourcesDefinition, type SweepHole, type SweepPoint, type SweepReport, type SweepUnderOptions, type TimerFactOpts, type TimerFactState, TraceOption, TypedConstraintsDef as TypedConstraintsDefinition, TypedDerivationsDef as TypedDerivationsDefinition, TypedEventsDef as TypedEventsDefinition, TypedResolversDef as TypedResolversDefinition, completeTimer, createModule, createModuleFactory, createRequirementStatusPlugin, createStatusHook, createSystem, createSystemWithStatus, defaultClock, describePredicate, diffClauses, diffRules, doctor, elapsedMs, flattenPredicate, forType, framesFromHistory, framesFromSnapshots, generateRequirementId, initialTimerState, isRequirementType, pauseTimer, predicateHash, predicateToMongo, predicateToPostgrest, predicateToSQL, predicateToWhere, predict, realClock, registerRepeat, remainingMs, replayUnder, req, resetTimer, resumeTimer, startTimer, sweepUnder, t, tickTimer, timerOps, toReplayFrames, toRulesMap, virtualClock };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { C as ClauseResult, F as FactPredicate, S as SchemaType, D as DefinitionMeta, M as ModuleSchema, a as Facts, T as TypedDerivationsDef, b as TypedEventsDef, E as EffectsDef, c as SourcesDef, d as TypedConstraintsDef, e as TypedResolversDef, f as ModuleHooks, g as CrossModuleDeps, h as CrossModuleDerivationsDef, i as CrossModuleEffectsDef, j as CrossModuleConstraintsDef, k as ModuleDef, l as CreateSystemOptionsSingle, m as SingleModuleSystem, n as ModulesMap, o as CreateSystemOptionsNamed, N as NamespacedSystem, P as Plugin, p as TraceOption, q as ErrorBoundaryConfig, R as RequirementWithId, r as Requirement, s as RequirementKeyFn } from './plugins-C6MxOvot.js';
2
- export { A as AnySystem, B as BatchConfig, t as ConstraintDefinition, u as ConstraintsDefinition, v as CrossModuleConstraintDefinition, w as CrossModuleEffectDefinition, x as DirectiveError, y as DistributableSnapshot, z as DistributableSnapshotOptions, G as DynamicConstraintDef, G as DynamicConstraintDefinition, H as DynamicEffectDef, I as DynamicResolverDef, I as DynamicResolverDefinition, J as EffectDefinition, K as EventsDefinition, L as FactTemplate, O as FactsSnapshot, Q as HistoryAPI, U as HistoryOption, V as HistoryState, W as InferDerivations, X as InferEvents, Y as InferFacts, Z as InferRequirementTypes, _ as InferRequirements, $ as InferSchemaType, a0 as InferSelectorState, a1 as KeySelector, a2 as MetaAccessor, a3 as MetaMatch, a4 as ObservationEvent, a5 as OperatorObject, a6 as PatchSpec, a7 as PatchValue, a8 as PayloadRef, a9 as PredicateClause, aa as PredicateCombinator, ab as PredicateCombinatorKey, ac as PredicateObject, ad as PredicateOp, ae as ResolverDefinition, af as ResolversDefinition, ag as RetryPolicy, ah as Schema, ai as SchemaTypedResolversDefinition, aj as Snapshot, ak as SourceDef, ak as SourceDefinition, al as SourcePublish, al as SourcePublishFn, am as SourceReportError, an as SourceUnsubscribe, an as SourceUnsubscribeFn, ao as System, ap as SystemConfig, aq as SystemDerived, ar as SystemFacts, as as SystemInspection, at as SystemMode, au as SystemSnapshot, av as TraceEntry, aw as TypedConstraintDefinition, ax as TypedResolverDefinition, ay as isNamespacedSystem, az as isSingleModuleSystem } from './plugins-C6MxOvot.js';
3
- import { S as SchemaKindNode } from './predicate-C92yT5IR.js';
4
- export { D as DerivationDefWithMeta, a as DerivationDefinition, D as DerivationDefinitionWithMeta, b as DerivationsDefinition, c as SchemaKind, d as SchemaValidationError, e as SchemaValidationOptions, f as SchemaValidationResult, g as applyPatch, h as evaluateKeySelector, i as evaluatePredicate, j as evaluatePredicateExplained, k as evaluateTemplate, l as extractDeps, m as extractTemplateKeys, n as getKind, o as getOperatorsForKind, p as getSchemaFieldKinds, q as isPredicate, r as isTemplate, s as listAllPredicateOperators, t as memoizePredicate, u as typedConstraint, v as typedResolver, w as validatePredicate, x as validatePredicateAgainstSchema } from './predicate-C92yT5IR.js';
5
- export { A as AuditEntry, a as AuditEntryKind, b as AuditLedger, c as AuditLedgerOptions, d as AuditLedgerSink, Q as QueryFilter, V as VerifyResult, e as createAuditLedger, m as memorySink } from './index-D_K7eEOF.js';
6
- export { D as DistributableSnapshotLike, S as SignedSnapshot, a as SnapshotDiff, b as SnapshotDiffEntry, d as diffSnapshots, i as isSignedSnapshot, c as isSnapshotExpired, s as shallowEqual, e as signSnapshot, v as validateSnapshot, f as verifySnapshotSignature } from './utils-BZBBwS5A.js';
1
+ import { C as ClauseResult, F as FactPredicate, S as SchemaType, D as DefinitionMeta, M as ModuleSchema, a as Facts, T as TypedDerivationsDef, b as TypedEventsDef, E as EffectsDef, c as SourcesDef, d as TypedConstraintsDef, e as TypedResolversDef, f as ModuleHooks, g as CrossModuleDeps, h as CrossModuleDerivationsDef, i as CrossModuleEffectsDef, j as CrossModuleConstraintsDef, k as ModuleDef, l as CreateSystemOptionsSingle, m as SingleModuleSystem, n as ModulesMap, o as CreateSystemOptionsNamed, N as NamespacedSystem, P as Plugin, p as TraceOption, q as ErrorBoundaryConfig, R as RequirementWithId, r as Requirement, s as RequirementKeyFn } from './plugins-5Supk7it.js';
2
+ export { A as AnySystem, B as BatchConfig, t as ConstraintDefinition, u as ConstraintsDefinition, v as CrossModuleConstraintDefinition, w as CrossModuleEffectDefinition, x as DirectiveError, y as DistributableSnapshot, z as DistributableSnapshotOptions, G as DynamicConstraintDef, G as DynamicConstraintDefinition, H as DynamicEffectDef, I as DynamicResolverDef, I as DynamicResolverDefinition, J as EffectDefinition, K as EventsDefinition, L as FactTemplate, O as FactsSnapshot, Q as HistoryAPI, U as HistoryOption, V as HistoryState, W as InferDerivations, X as InferEvents, Y as InferFacts, Z as InferRequirementTypes, _ as InferRequirements, $ as InferSchemaType, a0 as InferSelectorState, a1 as KeySelector, a2 as MetaAccessor, a3 as MetaMatch, a4 as ObservationEvent, a5 as OperatorObject, a6 as PatchSpec, a7 as PatchValue, a8 as PayloadRef, a9 as PredicateClause, aa as PredicateCombinator, ab as PredicateCombinatorKey, ac as PredicateObject, ad as PredicateOp, ae as ResolverDefinition, af as ResolversDefinition, ag as RetryPolicy, ah as Schema, ai as SchemaTypedResolversDefinition, aj as Snapshot, ak as SourceDef, ak as SourceDefinition, al as SourceDropReason, am as SourcePublish, am as SourcePublishFn, an as SourceReportError, ao as SourceUnsubscribe, ao as SourceUnsubscribeFn, ap as System, aq as SystemConfig, ar as SystemDerived, as as SystemFacts, at as SystemInspection, au as SystemMode, av as SystemSnapshot, aw as TraceEntry, ax as TypedConstraintDefinition, ay as TypedResolverDefinition, az as isNamespacedSystem, aA as isSingleModuleSystem } from './plugins-5Supk7it.js';
3
+ import { S as SchemaKindNode } from './predicate-C9oMO_ny.js';
4
+ export { D as DerivationDefWithMeta, a as DerivationDefinition, D as DerivationDefinitionWithMeta, b as DerivationsDefinition, c as SchemaKind, d as SchemaValidationError, e as SchemaValidationOptions, f as SchemaValidationResult, g as applyPatch, h as evaluateKeySelector, i as evaluatePredicate, j as evaluatePredicateExplained, k as evaluateTemplate, l as extractDeps, m as extractTemplateKeys, n as getKind, o as getOperatorsForKind, p as getSchemaFieldKinds, q as isPredicate, r as isTemplate, s as listAllPredicateOperators, t as memoizePredicate, u as typedConstraint, v as typedResolver, w as validatePredicate, x as validatePredicateAgainstSchema } from './predicate-C9oMO_ny.js';
5
+ export { A as AuditEntry, a as AuditEntryKind, b as AuditLedger, c as AuditLedgerOptions, d as AuditLedgerSink, Q as QueryFilter, V as VerifyResult, e as createAuditLedger, m as memorySink } from './index-BgKC_ZT_.js';
6
+ export { D as DistributableSnapshotLike, S as SignedSnapshot, a as SnapshotDiff, b as SnapshotDiffEntry, d as diffSnapshots, i as isSignedSnapshot, c as isSnapshotExpired, s as shallowEqual, e as signSnapshot, v as validateSnapshot, f as verifySnapshotSignature } from './utils-DY8KTiD6.js';
7
7
 
8
8
  /**
9
9
  * Predicate backtest — rule-change impact.
@@ -581,9 +581,10 @@ declare function predict<F = Record<string, unknown>>(predicate: FactPredicate<F
581
581
  * defensible.
582
582
  *
583
583
  * **v1 scope LIMITATION (M4):** `checkAgainst` operates on predicate
584
- * logic only. It does NOT consult `bind:` / `owns:` resolver metadata —
585
- * a candidate that would *write* to a fact owned by another constraint
586
- * will not be flagged here. Use `doctor.checkOwns()` for that gate.
584
+ * logic only. It does NOT consult `bind:` / `abortOn:` resolver
585
+ * metadata — a candidate that would *write* to a fact in another
586
+ * constraint's abort-binding will not be flagged here. Use
587
+ * `doctor.checkAbortOn()` for that gate.
587
588
  *
588
589
  * **INVARIANT (M11):** `checkAgainst` depends on `flattenPredicate`
589
590
  * emitting `{ path, op, value }` LeafClause shape — if that shape ever
@@ -632,30 +633,31 @@ interface ExistingConstraint {
632
633
  readonly id: string;
633
634
  readonly whenSpec?: unknown;
634
635
  /**
635
- * Fact paths the constraint's resolver(s) write to, if exposed by the
636
- * inspect API. Consulted by {@link doctor.checkOwns} to flag candidates
637
- * that would write to fields owned elsewhere. Optional older inspect
638
- * payloads omit it.
636
+ * Fact paths the constraint's resolver aborts on when changed
637
+ * mid-flight, if exposed by the inspect API. Consulted by
638
+ * {@link doctor.checkAbortOn} to flag candidates that would write to
639
+ * fields under another constraint's abort-binding. Optional — older
640
+ * inspect payloads omit it.
639
641
  */
640
- readonly owns?: readonly string[];
641
- /** Same as {@link owns} but for the bind: side of binding metadata. */
642
+ readonly abortOn?: readonly string[];
643
+ /** Same as {@link abortOn} but for the bind: side of binding metadata. */
642
644
  readonly bind?: readonly string[];
643
645
  }
644
646
  /**
645
- * Returned by {@link doctor.checkOwns}.
647
+ * Returned by {@link doctor.checkAbortOn}.
646
648
  *
647
649
  * `severity` matches the {@link Contradiction} discriminator on
648
650
  * {@link CheckAgainstResult} so callers can route both shapes
649
- * uniformly: by default, owns-collisions are `"warning"` (the engine
650
- * still has a runtime gate), but a caller can promote them to
651
- * `"error"` for stricter pre-deploy linting. (M5)
651
+ * uniformly: by default, abort-binding collisions are `"warning"`
652
+ * (the engine still has a runtime gate), but a caller can promote them
653
+ * to `"error"` for stricter pre-deploy linting. (M5)
652
654
  */
653
- interface CheckOwnsFinding {
655
+ interface CheckAbortOnFinding {
654
656
  readonly constraintId: string;
655
657
  /** The fact path on the candidate predicate that triggered the finding. */
656
658
  readonly candidatePath: string;
657
- /** The owner side it would collide with: "owns" or "bind". */
658
- readonly source: "owns" | "bind";
659
+ /** The binding side it would collide with: "abortOn" or "bind". */
660
+ readonly source: "abortOn" | "bind";
659
661
  readonly reason: string;
660
662
  /**
661
663
  * Severity discriminator — `"warning"` by default (the engine has
@@ -665,20 +667,21 @@ interface CheckOwnsFinding {
665
667
  readonly severity?: "error" | "warning";
666
668
  }
667
669
  /**
668
- * Result of {@link doctor.checkOwns}.
670
+ * Result of {@link doctor.checkAbortOn}.
669
671
  *
670
- * Owns-/bind- collisions are warnings, not contradictions — the engine
671
- * itself enforces the runtime binding gate, so a pre-deploy doctor pass
672
- * treats them as advisory. The {@link CheckOwnsFinding.severity}
673
- * discriminator anticipates v2 promotion of findings to errors. (M5, F-3)
672
+ * AbortOn-/bind- collisions are warnings, not contradictions — the
673
+ * engine itself enforces the runtime binding gate, so a pre-deploy
674
+ * doctor pass treats them as advisory. The
675
+ * {@link CheckAbortOnFinding.severity} discriminator anticipates v2
676
+ * promotion of findings to errors. (M5, F-3)
674
677
  */
675
- interface CheckOwnsResult {
678
+ interface CheckAbortOnResult {
676
679
  /**
677
- * Owns-/bind- collisions surfaced by {@link doctor.checkOwns}. Empty
678
- * when constraints expose no `owns:` / `bind:` metadata or the
679
- * candidate's fact paths don't overlap.
680
+ * AbortOn-/bind- collisions surfaced by {@link doctor.checkAbortOn}.
681
+ * Empty when constraints expose no `abortOn:` / `bind:` metadata or
682
+ * the candidate's fact paths don't overlap.
680
683
  */
681
- readonly warnings: readonly CheckOwnsFinding[];
684
+ readonly warnings: readonly CheckAbortOnFinding[];
682
685
  }
683
686
  declare const doctor: {
684
687
  /**
@@ -712,31 +715,32 @@ declare const doctor: {
712
715
  }): CheckAgainstResult;
713
716
  /**
714
717
  * Flag a candidate predicate whose referenced fact paths overlap with
715
- * fields *owned* (or `bind:`-bound) by an existing constraint's
716
- * resolvers. A v1 stub: relies on `inspect()` exposing `owns:` / `bind:`
717
- * on each constraint snapshot. When that metadata is absent, this
718
- * returns `{ findings: [] }` no false positives.
718
+ * fields in another constraint's `abortOn:` list (or `bind:`-bound by
719
+ * an existing constraint's resolvers). A v1 stub: relies on
720
+ * `inspect()` exposing `abortOn:` / `bind:` on each constraint
721
+ * snapshot. When that metadata is absent, this returns
722
+ * `{ findings: [] }` — no false positives.
719
723
  *
720
724
  * **TODO (v2):** wire the engine's resolver-ownership graph through
721
725
  * `system.inspect()` so this returns real findings without manual
722
- * `owns:` annotations on inspect payloads.
726
+ * `abortOn:` annotations on inspect payloads.
723
727
  *
724
728
  * @example
725
729
  * ```ts
726
- * doctor.checkOwns(
730
+ * doctor.checkAbortOn(
727
731
  * { cartTotal: { $gte: 100 } },
728
732
  * system.inspect(),
729
733
  * );
730
734
  * // → { findings: [
731
735
  * // { constraintId: "applyDiscount", candidatePath: "cartTotal",
732
- * // source: "owns",
733
- * // reason: "Constraint applyDiscount already owns cartTotal." }
736
+ * // source: "abortOn",
737
+ * // reason: "Constraint applyDiscount aborts on cartTotal." }
734
738
  * // ] }
735
739
  * ```
736
740
  */
737
- checkOwns<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
741
+ checkAbortOn<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
738
742
  constraints: readonly ExistingConstraint[];
739
- }): CheckOwnsResult;
743
+ }): CheckAbortOnResult;
740
744
  };
741
745
 
742
746
  /**
@@ -2253,4 +2257,4 @@ declare const Backoff: {
2253
2257
  readonly Exponential: "exponential";
2254
2258
  };
2255
2259
 
2256
- export { Backoff, type Branded, type ChainableSchemaType, type Change, type ChangeKind, type CheckAgainstResult, type CheckOwnsFinding, type CheckOwnsResult, ClauseResult, type ConstraintDiff, type ConstraintStatus, type Contradiction, type ContradictionType, CreateSystemOptionsNamed, CreateSystemOptionsSingle, CrossModuleConstraintsDef as CrossModuleConstraintsDefinition, CrossModuleDeps, CrossModuleDerivationsDef as CrossModuleDerivationsDefinition, CrossModuleEffectsDef as CrossModuleEffectsDefinition, DefinitionMeta, type DescribeOptions, type DiffRulesOptions, EffectsDef as EffectsDefinition, ErrorBoundaryConfig, type ExistingConstraint, type ExtendedSchemaType, FactPredicate, Facts, type LeafClause, MAX_REPLAY_FRAMES, MAX_SWEEP_POINTS, type ModuleConfig, type ModuleConfigWithDeps, ModuleDef, ModuleDef as ModuleDefinition, ModuleHooks, ModuleSchema, ModulesMap, NamespacedSystem, Plugin, type PredicateBacktestReport, type PredicateToMongoOptions, type PredicateToPostgrestOptions, type PredicateToSqlOptions, type PredicateToSqlResult, type PredictMissingChange, type PredictResult, type ReplayDiffSample, type ReplayFrame, type ReplayUnderOptions, Requirement, RequirementSet, type RequirementTypeStatus, RequirementWithId, type RulesDiffReport, type RulesMapInput, SchemaKindNode, SchemaType, type SignalClock, SingleModuleSystem, SourcesDef, SourcesDef as SourcesDefinition, type SweepHole, type SweepPoint, type SweepReport, type SweepUnderOptions, type TimerFactOpts, type TimerFactState, TraceOption, TypedConstraintsDef as TypedConstraintsDefinition, TypedDerivationsDef as TypedDerivationsDefinition, TypedEventsDef as TypedEventsDefinition, TypedResolversDef as TypedResolversDefinition, completeTimer, createModule, createModuleFactory, createRequirementStatusPlugin, createStatusHook, createSystem, createSystemWithStatus, defaultClock, describePredicate, diffClauses, diffRules, doctor, elapsedMs, flattenPredicate, forType, framesFromHistory, framesFromSnapshots, generateRequirementId, initialTimerState, isRequirementType, pauseTimer, predicateHash, predicateToMongo, predicateToPostgrest, predicateToSQL, predicateToWhere, predict, realClock, registerRepeat, remainingMs, replayUnder, req, resetTimer, resumeTimer, startTimer, sweepUnder, t, tickTimer, timerOps, toReplayFrames, toRulesMap, virtualClock };
2260
+ export { Backoff, type Branded, type ChainableSchemaType, type Change, type ChangeKind, type CheckAbortOnFinding, type CheckAbortOnResult, type CheckAgainstResult, ClauseResult, type ConstraintDiff, type ConstraintStatus, type Contradiction, type ContradictionType, CreateSystemOptionsNamed, CreateSystemOptionsSingle, CrossModuleConstraintsDef as CrossModuleConstraintsDefinition, CrossModuleDeps, CrossModuleDerivationsDef as CrossModuleDerivationsDefinition, CrossModuleEffectsDef as CrossModuleEffectsDefinition, DefinitionMeta, type DescribeOptions, type DiffRulesOptions, EffectsDef as EffectsDefinition, ErrorBoundaryConfig, type ExistingConstraint, type ExtendedSchemaType, FactPredicate, Facts, type LeafClause, MAX_REPLAY_FRAMES, MAX_SWEEP_POINTS, type ModuleConfig, type ModuleConfigWithDeps, ModuleDef, ModuleDef as ModuleDefinition, ModuleHooks, ModuleSchema, ModulesMap, NamespacedSystem, Plugin, type PredicateBacktestReport, type PredicateToMongoOptions, type PredicateToPostgrestOptions, type PredicateToSqlOptions, type PredicateToSqlResult, type PredictMissingChange, type PredictResult, type ReplayDiffSample, type ReplayFrame, type ReplayUnderOptions, Requirement, RequirementSet, type RequirementTypeStatus, RequirementWithId, type RulesDiffReport, type RulesMapInput, SchemaKindNode, SchemaType, type SignalClock, SingleModuleSystem, SourcesDef, SourcesDef as SourcesDefinition, type SweepHole, type SweepPoint, type SweepReport, type SweepUnderOptions, type TimerFactOpts, type TimerFactState, TraceOption, TypedConstraintsDef as TypedConstraintsDefinition, TypedDerivationsDef as TypedDerivationsDefinition, TypedEventsDef as TypedEventsDefinition, TypedResolversDef as TypedResolversDefinition, completeTimer, createModule, createModuleFactory, createRequirementStatusPlugin, createStatusHook, createSystem, createSystemWithStatus, defaultClock, describePredicate, diffClauses, diffRules, doctor, elapsedMs, flattenPredicate, forType, framesFromHistory, framesFromSnapshots, generateRequirementId, initialTimerState, isRequirementType, pauseTimer, predicateHash, predicateToMongo, predicateToPostgrest, predicateToSQL, predicateToWhere, predict, realClock, registerRepeat, remainingMs, replayUnder, req, resetTimer, resumeTimer, startTimer, sweepUnder, t, tickTimer, timerOps, toReplayFrames, toRulesMap, virtualClock };