@directive-run/core 1.21.0 → 1.23.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 (86) hide show
  1. package/README.md +2 -2
  2. package/dist/adapter-utils.cjs +1 -1
  3. package/dist/adapter-utils.d.cts +1 -1
  4. package/dist/adapter-utils.d.ts +1 -1
  5. package/dist/adapter-utils.js +1 -1
  6. package/dist/chunk-AFPLATPV.js +16 -0
  7. package/dist/chunk-AFPLATPV.js.map +1 -0
  8. package/dist/{chunk-4OXCKDKS.cjs → chunk-FCCJUQB2.cjs} +3 -3
  9. package/dist/chunk-FCCJUQB2.cjs.map +1 -0
  10. package/dist/chunk-IZNOPHPL.js +3 -0
  11. package/dist/chunk-IZNOPHPL.js.map +1 -0
  12. package/dist/chunk-LN5H74CU.js +2 -0
  13. package/dist/{chunk-RBF653NR.js.map → chunk-LN5H74CU.js.map} +1 -1
  14. package/dist/chunk-PJIIBQTK.js +2 -0
  15. package/dist/chunk-PJIIBQTK.js.map +1 -0
  16. package/dist/chunk-PTT4MWNL.cjs +3 -0
  17. package/dist/chunk-PTT4MWNL.cjs.map +1 -0
  18. package/dist/{chunk-GKMJ7NMP.cjs → chunk-RD2HO5NZ.cjs} +2 -2
  19. package/dist/{chunk-GKMJ7NMP.cjs.map → chunk-RD2HO5NZ.cjs.map} +1 -1
  20. package/dist/{chunk-GACC2DMS.cjs → chunk-S6W6Y44G.cjs} +2 -2
  21. package/dist/{chunk-GACC2DMS.cjs.map → chunk-S6W6Y44G.cjs.map} +1 -1
  22. package/dist/{chunk-6PF2FRBG.js → chunk-WD47DB52.js} +2 -2
  23. package/dist/{chunk-6PF2FRBG.js.map → chunk-WD47DB52.js.map} +1 -1
  24. package/dist/chunk-WKGNK4QK.cjs +2 -0
  25. package/dist/chunk-WKGNK4QK.cjs.map +1 -0
  26. package/dist/chunk-WVP3GOY2.js +3 -0
  27. package/dist/chunk-WVP3GOY2.js.map +1 -0
  28. package/dist/chunk-XKXTRVJF.cjs +3 -0
  29. package/dist/chunk-XKXTRVJF.cjs.map +1 -0
  30. package/dist/{index-CvQuu0tu.d.cts → index-DpvgHVHR.d.cts} +29 -2
  31. package/dist/{index-DUbpbGw8.d.ts → index-n8oQmdOZ.d.ts} +29 -2
  32. package/dist/index.cjs +2 -2
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +46 -164
  35. package/dist/index.d.ts +46 -164
  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 +45 -25
  40. package/dist/internals.d.ts +45 -25
  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 +358 -3
  45. package/dist/plugins/index.d.ts +358 -3
  46. package/dist/plugins/index.js +2 -2
  47. package/dist/plugins/index.js.map +1 -1
  48. package/dist/{plugins-4IfhJV32.d.cts → plugins-CaPMTICa.d.cts} +400 -31
  49. package/dist/{plugins-4IfhJV32.d.ts → plugins-CaPMTICa.d.ts} +400 -31
  50. package/dist/{predicate-DBTPnlg6.d.cts → predicate-CU0YC1i6.d.cts} +1 -1
  51. package/dist/{predicate-BW05x5el.d.ts → predicate-CgpwJqf4.d.ts} +1 -1
  52. package/dist/system-HOP37Z4V.js +2 -0
  53. package/dist/{system-SJBP4TO5.js.map → system-HOP37Z4V.js.map} +1 -1
  54. package/dist/system-VZUHL56W.cjs +2 -0
  55. package/dist/{system-SB7JYMRB.cjs.map → system-VZUHL56W.cjs.map} +1 -1
  56. package/dist/testing.cjs +1 -1
  57. package/dist/testing.cjs.map +1 -1
  58. package/dist/testing.d.cts +1 -1
  59. package/dist/testing.d.ts +1 -1
  60. package/dist/testing.js +1 -1
  61. package/dist/testing.js.map +1 -1
  62. package/dist/worker.cjs +1 -1
  63. package/dist/worker.cjs.map +1 -1
  64. package/dist/worker.d.cts +1 -1
  65. package/dist/worker.d.ts +1 -1
  66. package/dist/worker.js +1 -1
  67. package/dist/worker.js.map +1 -1
  68. package/package.json +1 -1
  69. package/dist/chunk-4OXCKDKS.cjs.map +0 -1
  70. package/dist/chunk-6QAUJFQH.js +0 -3
  71. package/dist/chunk-6QAUJFQH.js.map +0 -1
  72. package/dist/chunk-E53A4NHM.js +0 -16
  73. package/dist/chunk-E53A4NHM.js.map +0 -1
  74. package/dist/chunk-GBCWXTXW.cjs +0 -3
  75. package/dist/chunk-GBCWXTXW.cjs.map +0 -1
  76. package/dist/chunk-KGTBTGOY.js +0 -2
  77. package/dist/chunk-KGTBTGOY.js.map +0 -1
  78. package/dist/chunk-M5PEB553.cjs +0 -3
  79. package/dist/chunk-M5PEB553.cjs.map +0 -1
  80. package/dist/chunk-MARZI3EY.cjs +0 -2
  81. package/dist/chunk-MARZI3EY.cjs.map +0 -1
  82. package/dist/chunk-RBF653NR.js +0 -2
  83. package/dist/chunk-SFUVPP4L.js +0 -3
  84. package/dist/chunk-SFUVPP4L.js.map +0 -1
  85. package/dist/system-SB7JYMRB.cjs +0 -2
  86. package/dist/system-SJBP4TO5.js +0 -2
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkM5PEB553_cjs=require('./chunk-M5PEB553.cjs'),chunkGACC2DMS_cjs=require('./chunk-GACC2DMS.cjs'),chunkGKMJ7NMP_cjs=require('./chunk-GKMJ7NMP.cjs'),chunkGBCWXTXW_cjs=require('./chunk-GBCWXTXW.cjs');Object.defineProperty(exports,"createConstraintFactory",{enumerable:true,get:function(){return chunkM5PEB553_cjs.c}});Object.defineProperty(exports,"createConstraintsManager",{enumerable:true,get:function(){return chunkM5PEB553_cjs.p}});Object.defineProperty(exports,"createDerivationsManager",{enumerable:true,get:function(){return chunkM5PEB553_cjs.q}});Object.defineProperty(exports,"createDisabledHistory",{enumerable:true,get:function(){return chunkM5PEB553_cjs.j}});Object.defineProperty(exports,"createEffectsManager",{enumerable:true,get:function(){return chunkM5PEB553_cjs.r}});Object.defineProperty(exports,"createEngine",{enumerable:true,get:function(){return chunkM5PEB553_cjs.A}});Object.defineProperty(exports,"createErrorBoundaryManager",{enumerable:true,get:function(){return chunkM5PEB553_cjs.t}});Object.defineProperty(exports,"createFacts",{enumerable:true,get:function(){return chunkM5PEB553_cjs.w}});Object.defineProperty(exports,"createFactsProxy",{enumerable:true,get:function(){return chunkM5PEB553_cjs.v}});Object.defineProperty(exports,"createFactsStore",{enumerable:true,get:function(){return chunkM5PEB553_cjs.u}});Object.defineProperty(exports,"createHistoryManager",{enumerable:true,get:function(){return chunkM5PEB553_cjs.i}});Object.defineProperty(exports,"createPluginManager",{enumerable:true,get:function(){return chunkM5PEB553_cjs.x}});Object.defineProperty(exports,"createResolverFactory",{enumerable:true,get:function(){return chunkM5PEB553_cjs.d}});Object.defineProperty(exports,"createResolversManager",{enumerable:true,get:function(){return chunkM5PEB553_cjs.y}});Object.defineProperty(exports,"createRetryLaterManager",{enumerable:true,get:function(){return chunkM5PEB553_cjs.s}});Object.defineProperty(exports,"createSourcesManager",{enumerable:true,get:function(){return chunkM5PEB553_cjs.z}});Object.defineProperty(exports,"dangerousRegex",{enumerable:true,get:function(){return chunkGACC2DMS_cjs.m}});Object.defineProperty(exports,"getCurrentDeps",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.f}});Object.defineProperty(exports,"isTracking",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.g}});Object.defineProperty(exports,"trackAccess",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.j}});Object.defineProperty(exports,"withTracking",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.h}});Object.defineProperty(exports,"withoutTracking",{enumerable:true,get:function(){return chunkGKMJ7NMP_cjs.i}});Object.defineProperty(exports,"hashObject",{enumerable:true,get:function(){return chunkGBCWXTXW_cjs.h}});Object.defineProperty(exports,"isPrototypeSafe",{enumerable:true,get:function(){return chunkGBCWXTXW_cjs.f}});Object.defineProperty(exports,"safeStringify",{enumerable:true,get:function(){return chunkGBCWXTXW_cjs.o}});Object.defineProperty(exports,"stableStringify",{enumerable:true,get:function(){return chunkGBCWXTXW_cjs.e}});//# sourceMappingURL=internals.cjs.map
1
+ 'use strict';var chunkXKXTRVJF_cjs=require('./chunk-XKXTRVJF.cjs'),chunkS6W6Y44G_cjs=require('./chunk-S6W6Y44G.cjs'),chunkRD2HO5NZ_cjs=require('./chunk-RD2HO5NZ.cjs'),chunkPTT4MWNL_cjs=require('./chunk-PTT4MWNL.cjs');Object.defineProperty(exports,"createConstraintFactory",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.c}});Object.defineProperty(exports,"createConstraintsManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.p}});Object.defineProperty(exports,"createDerivationsManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.q}});Object.defineProperty(exports,"createDisabledHistory",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.j}});Object.defineProperty(exports,"createEffectsManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.r}});Object.defineProperty(exports,"createEngine",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.A}});Object.defineProperty(exports,"createErrorBoundaryManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.t}});Object.defineProperty(exports,"createFacts",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.w}});Object.defineProperty(exports,"createFactsProxy",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.v}});Object.defineProperty(exports,"createFactsStore",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.u}});Object.defineProperty(exports,"createHistoryManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.i}});Object.defineProperty(exports,"createPluginManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.x}});Object.defineProperty(exports,"createResolverFactory",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.d}});Object.defineProperty(exports,"createResolversManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.y}});Object.defineProperty(exports,"createRetryLaterManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.s}});Object.defineProperty(exports,"createSourcesManager",{enumerable:true,get:function(){return chunkXKXTRVJF_cjs.z}});Object.defineProperty(exports,"dangerousRegex",{enumerable:true,get:function(){return chunkS6W6Y44G_cjs.m}});Object.defineProperty(exports,"getCurrentDeps",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.f}});Object.defineProperty(exports,"isTracking",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.g}});Object.defineProperty(exports,"trackAccess",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.j}});Object.defineProperty(exports,"withTracking",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.h}});Object.defineProperty(exports,"withoutTracking",{enumerable:true,get:function(){return chunkRD2HO5NZ_cjs.i}});Object.defineProperty(exports,"hashObject",{enumerable:true,get:function(){return chunkPTT4MWNL_cjs.i}});Object.defineProperty(exports,"isPrototypeSafe",{enumerable:true,get:function(){return chunkPTT4MWNL_cjs.g}});Object.defineProperty(exports,"safeStringify",{enumerable:true,get:function(){return chunkPTT4MWNL_cjs.p}});Object.defineProperty(exports,"stableStringify",{enumerable:true,get:function(){return chunkPTT4MWNL_cjs.f}});//# sourceMappingURL=internals.cjs.map
2
2
  //# sourceMappingURL=internals.cjs.map
@@ -1,7 +1,7 @@
1
- import { ah as Schema, aB as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, u as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aC as ConstraintState, F as FactPredicate, C as ClauseResult, af as ResolversDef, aD as ResolverStatus, r as Requirement, al as SourceDropReason, ak as SourceDef, P as Plugin, ap as System, aE as FactChange, O as FactsSnapshot, aF as ReconcileResult, aj as Snapshot, x as DirectiveError, aG as RecoveryStrategy, aw as TraceEntry, aH as ErrorSource, q as ErrorBoundaryConfig, aI as RetryLaterConfig, Q as HistoryAPI, U as HistoryOption, aq as SystemConfig } from './plugins-4IfhJV32.cjs';
2
- export { aJ as BatchItemResult, aK as BatchResolveResults, aL as ConstraintsControl, v as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, aM as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, w as CrossModuleEffectDef, i as CrossModuleEffectsDef, aN as CrossModuleFactsWithSelf, aO as DerivationKeys, aP as DerivationReturnType, aQ as DerivationsControl, aR as DerivationsSchema, aS as DeriveAccessor, aT as DispatchEventsFromSchema, y as DistributableSnapshot, z as DistributableSnapshotOptions, aU as EffectCleanup, aV as EffectsControl, aW as EventPayloadSchema, aX as EventsAccessor, aY as EventsAccessorFromSchema, K as EventsDef, aZ as EventsSchema, a_ as FactKeys, a$ as FactReturnType, b0 as FlexibleEventHandler, b1 as HistoryConfig, b2 as InferEventPayloadFromSchema, b3 as InferRequirementPayloadFromSchema, b4 as InferSchema, b5 as MutableNamespacedFacts, b6 as NamespacedDerivations, b7 as NamespacedEventsAccessor, b8 as NamespacedFacts, b9 as ObservableKeys, ba as RequirementExplanation, bb as RequirementOutput, bc as RequirementPayloadSchema, bd as RequirementsSchema, be as ResolverContext, bf as ResolversControl, bg as SnapshotMeta, bh as SystemEvent, bi as TraceConfig, ax as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, bj as TypedResolverContext, ay as TypedResolverDef, e as TypedResolversDef, bk as UnionEvents } from './plugins-4IfhJV32.cjs';
3
- import { b as DerivationsDef, y as DerivedValues } from './predicate-DBTPnlg6.cjs';
4
- export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-DBTPnlg6.cjs';
1
+ import { ar as Schema, aQ as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, y as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aR as ConstraintState, F as FactPredicate, C as ClauseResult, an as ResolversDef, aS as ResolverStatus, r as Requirement, aw as SourceDropReason, av as SourceDef, P as Plugin, aA as System, aT as FactChange, X as FactsSnapshot, aU as ReconcileResult, aa as ObservationEvent, au as Snapshot, I as DirectiveError, aV as RecoveryStrategy, aH as TraceEntry, aW as ErrorSource, q as ErrorBoundaryConfig, aX as RetryLaterConfig, Y as HistoryAPI, Z as HistoryOption, aB as SystemConfig } from './plugins-CaPMTICa.cjs';
2
+ export { aY as BatchItemResult, aZ as BatchResolveResults, a_ as ConstraintsControl, z as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, a$ as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, G as CrossModuleEffectDef, i as CrossModuleEffectsDef, b0 as CrossModuleFactsWithSelf, b1 as DerivationKeys, b2 as DerivationReturnType, b3 as DerivationsControl, b4 as DerivationsSchema, b5 as DeriveAccessor, b6 as DispatchEventsFromSchema, J as DistributableSnapshot, K as DistributableSnapshotOptions, b7 as EffectCleanup, b8 as EffectsControl, b9 as EventPayloadSchema, ba as EventsAccessor, bb as EventsAccessorFromSchema, V as EventsDef, bc as EventsSchema, bd as FactKeys, be as FactReturnType, bf as FlexibleEventHandler, bg as HistoryConfig, bh as InferEventPayloadFromSchema, bi as InferRequirementPayloadFromSchema, bj as InferSchema, bk as MutableNamespacedFacts, bl as NamespacedDerivations, bm as NamespacedEventsAccessor, bn as NamespacedFacts, bo as ObservableKeys, bp as RequirementExplanation, bq as RequirementOutput, br as RequirementPayloadSchema, bs as RequirementsSchema, bt as ResolverContext, bu as ResolversControl, bv as SnapshotMeta, bw as SystemEvent, bx as TraceConfig, aI as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, by as TypedResolverContext, aJ as TypedResolverDef, e as TypedResolversDef, bz as UnionEvents } from './plugins-CaPMTICa.cjs';
3
+ import { b as DerivationsDef, y as DerivedValues } from './predicate-CU0YC1i6.cjs';
4
+ export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-CU0YC1i6.cjs';
5
5
  export { h as hashObject, g as isPrototypeSafe, j as safeStringify, k as stableStringify } from './utils-DY8KTiD6.cjs';
6
6
 
7
7
  /**
@@ -615,7 +615,7 @@ interface ResolversManager<_S extends Schema> {
615
615
  * @param req - The requirement (with a stable identity ID) to resolve.
616
616
  * @param options.factsBaseline - Optional pre-dispatch facts snapshot
617
617
  * shared by every resolver dispatched in the same reconcile tick. Used
618
- * by RFC-1 constraint-binding to seed each resolver's `expected` map
618
+ * by RFC-0003 constraint-binding to seed each resolver's `expected` map
619
619
  * from a value that pre-dates any sibling resolver's writes, preventing
620
620
  * the sibling-clobber gap where resolver 2 silently overwrites
621
621
  * resolver 1's owned write.
@@ -624,15 +624,17 @@ interface ResolversManager<_S extends Schema> {
624
624
  factsBaseline?: Readonly<Record<string, unknown>>;
625
625
  }): void;
626
626
  /**
627
- * Cancel an in-flight or batch-queued resolver by requirement ID.
627
+ * Abort an in-flight or batch-queued resolver by requirement ID.
628
628
  *
629
629
  * @remarks
630
630
  * Aborts the `AbortController` for in-flight resolvers. For batch-queued
631
- * requirements, removes the requirement from the pending batch.
631
+ * requirements, removes the requirement from the pending batch. Named to
632
+ * match `AbortController.abort()` and the declarative `abortOn:` key on
633
+ * constraints — three surfaces, one verb, one signal.
632
634
  *
633
- * @param requirementId - The unique requirement ID to cancel.
635
+ * @param requirementId - The unique requirement ID to abort.
634
636
  */
635
- cancel(requirementId: string): void;
637
+ abort(requirementId: string): void;
636
638
  /**
637
639
  * Untrack an in-flight resolver by requirement ID **without** aborting it
638
640
  * (RFC-0003 resolver constraint-binding).
@@ -640,17 +642,17 @@ interface ResolversManager<_S extends Schema> {
640
642
  * @remarks
641
643
  * Used for bound resolvers whose triggering requirement was removed: the
642
644
  * resolver runs to completion (its data writes land; the binding still
643
- * guards owned facts) but it no longer occupies the `inflight` slot, so the
644
- * same requirement re-dispatches cleanly if it returns. A no-op if the
645
- * requirement is not in-flight.
645
+ * guards abort-bound facts) but it no longer occupies the `inflight`
646
+ * slot, so the same requirement re-dispatches cleanly if it returns. A
647
+ * no-op if the requirement is not in-flight.
646
648
  *
647
649
  * @param requirementId - The unique requirement ID to detach.
648
650
  */
649
651
  detach(requirementId: string): void;
650
652
  /**
651
- * Cancel every in-flight resolver and flush all pending batch queues.
653
+ * Abort every in-flight resolver and flush all pending batch queues.
652
654
  */
653
- cancelAll(): void;
655
+ abortAll(): void;
654
656
  /**
655
657
  * Get the current status of a resolver by requirement ID.
656
658
  *
@@ -731,20 +733,20 @@ interface ResolversManager<_S extends Schema> {
731
733
  destroy(): void;
732
734
  }
733
735
  /**
734
- * Per-constraint binding info, used by RFC-1 (resolver constraint-binding).
736
+ * Per-constraint binding info, used by RFC-0003 (resolver constraint-binding).
735
737
  *
736
738
  * The engine wires this lookup into the resolvers manager so that a resolver
737
- * dispatched from a constraint with an `owns` field knows which facts it
738
- * *owns* writes to those are clobber-checked (see {@link createBoundFacts}).
739
+ * dispatched from a constraint with an `abortOn` field knows which facts it
740
+ * compare-and-swaps on dispatch (see {@link createBoundFacts}).
739
741
  *
740
742
  * Returns `undefined`/`null` when the source constraint is unknown or has no
741
- * `owns` field — in which case binding is a no-op and the resolver behaves
742
- * exactly as before.
743
+ * `abortOn` field — in which case binding is a no-op and the resolver
744
+ * behaves exactly as before.
743
745
  *
744
746
  * @internal
745
747
  */
746
748
  interface ConstraintBindingInfo {
747
- /** Fact keys the triggering resolver owns; writes to these are clobber-checked. */
749
+ /** Fact keys this resolver aborts on when changed mid-flight; writes to these are clobber-checked. */
748
750
  readonly fields: readonly string[];
749
751
  }
750
752
  /**
@@ -760,11 +762,11 @@ interface CreateResolversOptions<S extends Schema> {
760
762
  /** Underlying fact store used for `batch()` coalescing of mutations. */
761
763
  store: FactsStore<S>;
762
764
  /**
763
- * Look up binding info for a source constraint id (RFC-1).
765
+ * Look up binding info for a source constraint id (RFC-0003).
764
766
  *
765
767
  * Wired by the engine — given the `fromConstraint` of a `RequirementWithId`,
766
- * returns the constraint's owned fact keys. Return `undefined` if the
767
- * constraint is unknown or has no `owns` field.
768
+ * returns the constraint's abort-binding fact keys. Return `undefined` if
769
+ * the constraint is unknown or has no `abortOn` field.
768
770
  */
769
771
  getConstraintBinding?: (constraintId: string) => ConstraintBindingInfo | undefined;
770
772
  /** Called when a resolver begins execution. */
@@ -775,7 +777,7 @@ interface CreateResolversOptions<S extends Schema> {
775
777
  onError?: (resolver: string, req: RequirementWithId, error: unknown) => void;
776
778
  /** Called before each retry attempt with the upcoming attempt number. */
777
779
  onRetry?: (resolver: string, req: RequirementWithId, attempt: number) => void;
778
- /** Called when a resolver is canceled via {@link ResolversManager.cancel | cancel}. */
780
+ /** Called when a resolver is aborted via {@link ResolversManager.abort | abort}. */
779
781
  onCancel?: (resolver: string, req: RequirementWithId) => void;
780
782
  /**
781
783
  * Called when a bound resolver's owned-fact write is dropped because the
@@ -802,7 +804,7 @@ interface CreateResolversOptions<S extends Schema> {
802
804
  }
803
805
  /**
804
806
  * Creates a resolver manager that tracks active resolver instances and
805
- * coordinates their lifecycle (start / complete / error / cancel) against
807
+ * coordinates their lifecycle (start / complete / error / abort) against
806
808
  * the engine's requirement graph.
807
809
  *
808
810
  * @param options - resolver definitions, facts reference, and event hooks
@@ -1065,6 +1067,18 @@ interface PluginManager<_S extends Schema = any> {
1065
1067
  emitReconcileEnd(result: ReconcileResult): void;
1066
1068
  emitConstraintEvaluate(id: string, active: boolean, whenExplain?: ClauseResult[]): void;
1067
1069
  emitConstraintError(id: string, error: unknown): void;
1070
+ /**
1071
+ * Fired once per lookup when the engine silently disables a
1072
+ * constraint's `abortOn:` binding because the constraint is async.
1073
+ * Pairs with the dev-mode `console.warn` for SIEM visibility — without
1074
+ * this signal, a production constraint loses its clobber-protection
1075
+ * with no plugin trail.
1076
+ *
1077
+ * `"async-declared"` means the def has `async: true` (author opted in);
1078
+ * `"async-promoted"` means `when()` returned a Promise at runtime
1079
+ * (author probably did not realize).
1080
+ */
1081
+ emitConstraintBindingDisabled(id: string, reason: "async-declared" | "async-promoted"): void;
1068
1082
  emitRequirementCreated(req: RequirementWithId): void;
1069
1083
  emitRequirementMet(req: RequirementWithId, byResolver: string): void;
1070
1084
  emitRequirementCanceled(req: RequirementWithId): void;
@@ -1102,6 +1116,12 @@ interface PluginManager<_S extends Schema = any> {
1102
1116
  emitSourceDetach(id: string, moduleId: string): void;
1103
1117
  emitSourceError(id: string, moduleId: string, phase: "attach" | "cleanup" | "runtime", error: unknown): void;
1104
1118
  emitGuardrailBlocked(plugin: string, key: string, kind: "redact" | "alert" | "detect", count: number, category?: string): void;
1119
+ emitClobberLoopDetected(event: ObservationEvent & {
1120
+ type: "resolver.clobber.loop.detected";
1121
+ }): void;
1122
+ emitClobberLoopResolved(event: ObservationEvent & {
1123
+ type: "resolver.clobber.loop.resolved";
1124
+ }): void;
1105
1125
  emitSnapshot(snapshot: Snapshot): void;
1106
1126
  emitHistoryNavigate(from: number, to: number): void;
1107
1127
  emitError(error: DirectiveError): void;
@@ -1,7 +1,7 @@
1
- import { ah as Schema, aB as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, u as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aC as ConstraintState, F as FactPredicate, C as ClauseResult, af as ResolversDef, aD as ResolverStatus, r as Requirement, al as SourceDropReason, ak as SourceDef, P as Plugin, ap as System, aE as FactChange, O as FactsSnapshot, aF as ReconcileResult, aj as Snapshot, x as DirectiveError, aG as RecoveryStrategy, aw as TraceEntry, aH as ErrorSource, q as ErrorBoundaryConfig, aI as RetryLaterConfig, Q as HistoryAPI, U as HistoryOption, aq as SystemConfig } from './plugins-4IfhJV32.js';
2
- export { aJ as BatchItemResult, aK as BatchResolveResults, aL as ConstraintsControl, v as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, aM as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, w as CrossModuleEffectDef, i as CrossModuleEffectsDef, aN as CrossModuleFactsWithSelf, aO as DerivationKeys, aP as DerivationReturnType, aQ as DerivationsControl, aR as DerivationsSchema, aS as DeriveAccessor, aT as DispatchEventsFromSchema, y as DistributableSnapshot, z as DistributableSnapshotOptions, aU as EffectCleanup, aV as EffectsControl, aW as EventPayloadSchema, aX as EventsAccessor, aY as EventsAccessorFromSchema, K as EventsDef, aZ as EventsSchema, a_ as FactKeys, a$ as FactReturnType, b0 as FlexibleEventHandler, b1 as HistoryConfig, b2 as InferEventPayloadFromSchema, b3 as InferRequirementPayloadFromSchema, b4 as InferSchema, b5 as MutableNamespacedFacts, b6 as NamespacedDerivations, b7 as NamespacedEventsAccessor, b8 as NamespacedFacts, b9 as ObservableKeys, ba as RequirementExplanation, bb as RequirementOutput, bc as RequirementPayloadSchema, bd as RequirementsSchema, be as ResolverContext, bf as ResolversControl, bg as SnapshotMeta, bh as SystemEvent, bi as TraceConfig, ax as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, bj as TypedResolverContext, ay as TypedResolverDef, e as TypedResolversDef, bk as UnionEvents } from './plugins-4IfhJV32.js';
3
- import { b as DerivationsDef, y as DerivedValues } from './predicate-BW05x5el.js';
4
- export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-BW05x5el.js';
1
+ import { ar as Schema, aQ as FactsStore, a as Facts, D as DefinitionMeta, E as EffectsDef, y as ConstraintsDef, s as RequirementKeyFn, R as RequirementWithId, aR as ConstraintState, F as FactPredicate, C as ClauseResult, an as ResolversDef, aS as ResolverStatus, r as Requirement, aw as SourceDropReason, av as SourceDef, P as Plugin, aA as System, aT as FactChange, X as FactsSnapshot, aU as ReconcileResult, aa as ObservationEvent, au as Snapshot, I as DirectiveError, aV as RecoveryStrategy, aH as TraceEntry, aW as ErrorSource, q as ErrorBoundaryConfig, aX as RetryLaterConfig, Y as HistoryAPI, Z as HistoryOption, aB as SystemConfig } from './plugins-CaPMTICa.js';
2
+ export { aY as BatchItemResult, aZ as BatchResolveResults, a_ as ConstraintsControl, z as CrossModuleConstraintDef, j as CrossModuleConstraintsDef, a$ as CrossModuleDerivationFn, h as CrossModuleDerivationsDef, G as CrossModuleEffectDef, i as CrossModuleEffectsDef, b0 as CrossModuleFactsWithSelf, b1 as DerivationKeys, b2 as DerivationReturnType, b3 as DerivationsControl, b4 as DerivationsSchema, b5 as DeriveAccessor, b6 as DispatchEventsFromSchema, J as DistributableSnapshot, K as DistributableSnapshotOptions, b7 as EffectCleanup, b8 as EffectsControl, b9 as EventPayloadSchema, ba as EventsAccessor, bb as EventsAccessorFromSchema, V as EventsDef, bc as EventsSchema, bd as FactKeys, be as FactReturnType, bf as FlexibleEventHandler, bg as HistoryConfig, bh as InferEventPayloadFromSchema, bi as InferRequirementPayloadFromSchema, bj as InferSchema, bk as MutableNamespacedFacts, bl as NamespacedDerivations, bm as NamespacedEventsAccessor, bn as NamespacedFacts, bo as ObservableKeys, bp as RequirementExplanation, bq as RequirementOutput, br as RequirementPayloadSchema, bs as RequirementsSchema, bt as ResolverContext, bu as ResolversControl, bv as SnapshotMeta, bw as SystemEvent, bx as TraceConfig, aI as TypedConstraintDef, d as TypedConstraintsDef, T as TypedDerivationsDef, b as TypedEventsDef, by as TypedResolverContext, aJ as TypedResolverDef, e as TypedResolversDef, bz as UnionEvents } from './plugins-CaPMTICa.js';
3
+ import { b as DerivationsDef, y as DerivedValues } from './predicate-CgpwJqf4.js';
4
+ export { z as DerivationState, T as TypedConstraint, A as TypedResolver, B as createConstraintFactory, C as createResolverFactory, E as dangerousRegex } from './predicate-CgpwJqf4.js';
5
5
  export { h as hashObject, g as isPrototypeSafe, j as safeStringify, k as stableStringify } from './utils-DY8KTiD6.js';
6
6
 
7
7
  /**
@@ -615,7 +615,7 @@ interface ResolversManager<_S extends Schema> {
615
615
  * @param req - The requirement (with a stable identity ID) to resolve.
616
616
  * @param options.factsBaseline - Optional pre-dispatch facts snapshot
617
617
  * shared by every resolver dispatched in the same reconcile tick. Used
618
- * by RFC-1 constraint-binding to seed each resolver's `expected` map
618
+ * by RFC-0003 constraint-binding to seed each resolver's `expected` map
619
619
  * from a value that pre-dates any sibling resolver's writes, preventing
620
620
  * the sibling-clobber gap where resolver 2 silently overwrites
621
621
  * resolver 1's owned write.
@@ -624,15 +624,17 @@ interface ResolversManager<_S extends Schema> {
624
624
  factsBaseline?: Readonly<Record<string, unknown>>;
625
625
  }): void;
626
626
  /**
627
- * Cancel an in-flight or batch-queued resolver by requirement ID.
627
+ * Abort an in-flight or batch-queued resolver by requirement ID.
628
628
  *
629
629
  * @remarks
630
630
  * Aborts the `AbortController` for in-flight resolvers. For batch-queued
631
- * requirements, removes the requirement from the pending batch.
631
+ * requirements, removes the requirement from the pending batch. Named to
632
+ * match `AbortController.abort()` and the declarative `abortOn:` key on
633
+ * constraints — three surfaces, one verb, one signal.
632
634
  *
633
- * @param requirementId - The unique requirement ID to cancel.
635
+ * @param requirementId - The unique requirement ID to abort.
634
636
  */
635
- cancel(requirementId: string): void;
637
+ abort(requirementId: string): void;
636
638
  /**
637
639
  * Untrack an in-flight resolver by requirement ID **without** aborting it
638
640
  * (RFC-0003 resolver constraint-binding).
@@ -640,17 +642,17 @@ interface ResolversManager<_S extends Schema> {
640
642
  * @remarks
641
643
  * Used for bound resolvers whose triggering requirement was removed: the
642
644
  * resolver runs to completion (its data writes land; the binding still
643
- * guards owned facts) but it no longer occupies the `inflight` slot, so the
644
- * same requirement re-dispatches cleanly if it returns. A no-op if the
645
- * requirement is not in-flight.
645
+ * guards abort-bound facts) but it no longer occupies the `inflight`
646
+ * slot, so the same requirement re-dispatches cleanly if it returns. A
647
+ * no-op if the requirement is not in-flight.
646
648
  *
647
649
  * @param requirementId - The unique requirement ID to detach.
648
650
  */
649
651
  detach(requirementId: string): void;
650
652
  /**
651
- * Cancel every in-flight resolver and flush all pending batch queues.
653
+ * Abort every in-flight resolver and flush all pending batch queues.
652
654
  */
653
- cancelAll(): void;
655
+ abortAll(): void;
654
656
  /**
655
657
  * Get the current status of a resolver by requirement ID.
656
658
  *
@@ -731,20 +733,20 @@ interface ResolversManager<_S extends Schema> {
731
733
  destroy(): void;
732
734
  }
733
735
  /**
734
- * Per-constraint binding info, used by RFC-1 (resolver constraint-binding).
736
+ * Per-constraint binding info, used by RFC-0003 (resolver constraint-binding).
735
737
  *
736
738
  * The engine wires this lookup into the resolvers manager so that a resolver
737
- * dispatched from a constraint with an `owns` field knows which facts it
738
- * *owns* writes to those are clobber-checked (see {@link createBoundFacts}).
739
+ * dispatched from a constraint with an `abortOn` field knows which facts it
740
+ * compare-and-swaps on dispatch (see {@link createBoundFacts}).
739
741
  *
740
742
  * Returns `undefined`/`null` when the source constraint is unknown or has no
741
- * `owns` field — in which case binding is a no-op and the resolver behaves
742
- * exactly as before.
743
+ * `abortOn` field — in which case binding is a no-op and the resolver
744
+ * behaves exactly as before.
743
745
  *
744
746
  * @internal
745
747
  */
746
748
  interface ConstraintBindingInfo {
747
- /** Fact keys the triggering resolver owns; writes to these are clobber-checked. */
749
+ /** Fact keys this resolver aborts on when changed mid-flight; writes to these are clobber-checked. */
748
750
  readonly fields: readonly string[];
749
751
  }
750
752
  /**
@@ -760,11 +762,11 @@ interface CreateResolversOptions<S extends Schema> {
760
762
  /** Underlying fact store used for `batch()` coalescing of mutations. */
761
763
  store: FactsStore<S>;
762
764
  /**
763
- * Look up binding info for a source constraint id (RFC-1).
765
+ * Look up binding info for a source constraint id (RFC-0003).
764
766
  *
765
767
  * Wired by the engine — given the `fromConstraint` of a `RequirementWithId`,
766
- * returns the constraint's owned fact keys. Return `undefined` if the
767
- * constraint is unknown or has no `owns` field.
768
+ * returns the constraint's abort-binding fact keys. Return `undefined` if
769
+ * the constraint is unknown or has no `abortOn` field.
768
770
  */
769
771
  getConstraintBinding?: (constraintId: string) => ConstraintBindingInfo | undefined;
770
772
  /** Called when a resolver begins execution. */
@@ -775,7 +777,7 @@ interface CreateResolversOptions<S extends Schema> {
775
777
  onError?: (resolver: string, req: RequirementWithId, error: unknown) => void;
776
778
  /** Called before each retry attempt with the upcoming attempt number. */
777
779
  onRetry?: (resolver: string, req: RequirementWithId, attempt: number) => void;
778
- /** Called when a resolver is canceled via {@link ResolversManager.cancel | cancel}. */
780
+ /** Called when a resolver is aborted via {@link ResolversManager.abort | abort}. */
779
781
  onCancel?: (resolver: string, req: RequirementWithId) => void;
780
782
  /**
781
783
  * Called when a bound resolver's owned-fact write is dropped because the
@@ -802,7 +804,7 @@ interface CreateResolversOptions<S extends Schema> {
802
804
  }
803
805
  /**
804
806
  * Creates a resolver manager that tracks active resolver instances and
805
- * coordinates their lifecycle (start / complete / error / cancel) against
807
+ * coordinates their lifecycle (start / complete / error / abort) against
806
808
  * the engine's requirement graph.
807
809
  *
808
810
  * @param options - resolver definitions, facts reference, and event hooks
@@ -1065,6 +1067,18 @@ interface PluginManager<_S extends Schema = any> {
1065
1067
  emitReconcileEnd(result: ReconcileResult): void;
1066
1068
  emitConstraintEvaluate(id: string, active: boolean, whenExplain?: ClauseResult[]): void;
1067
1069
  emitConstraintError(id: string, error: unknown): void;
1070
+ /**
1071
+ * Fired once per lookup when the engine silently disables a
1072
+ * constraint's `abortOn:` binding because the constraint is async.
1073
+ * Pairs with the dev-mode `console.warn` for SIEM visibility — without
1074
+ * this signal, a production constraint loses its clobber-protection
1075
+ * with no plugin trail.
1076
+ *
1077
+ * `"async-declared"` means the def has `async: true` (author opted in);
1078
+ * `"async-promoted"` means `when()` returned a Promise at runtime
1079
+ * (author probably did not realize).
1080
+ */
1081
+ emitConstraintBindingDisabled(id: string, reason: "async-declared" | "async-promoted"): void;
1068
1082
  emitRequirementCreated(req: RequirementWithId): void;
1069
1083
  emitRequirementMet(req: RequirementWithId, byResolver: string): void;
1070
1084
  emitRequirementCanceled(req: RequirementWithId): void;
@@ -1102,6 +1116,12 @@ interface PluginManager<_S extends Schema = any> {
1102
1116
  emitSourceDetach(id: string, moduleId: string): void;
1103
1117
  emitSourceError(id: string, moduleId: string, phase: "attach" | "cleanup" | "runtime", error: unknown): void;
1104
1118
  emitGuardrailBlocked(plugin: string, key: string, kind: "redact" | "alert" | "detect", count: number, category?: string): void;
1119
+ emitClobberLoopDetected(event: ObservationEvent & {
1120
+ type: "resolver.clobber.loop.detected";
1121
+ }): void;
1122
+ emitClobberLoopResolved(event: ObservationEvent & {
1123
+ type: "resolver.clobber.loop.resolved";
1124
+ }): void;
1105
1125
  emitSnapshot(snapshot: Snapshot): void;
1106
1126
  emitHistoryNavigate(from: number, to: number): void;
1107
1127
  emitError(error: DirectiveError): void;
package/dist/internals.js CHANGED
@@ -1,2 +1,2 @@
1
- export{c as createConstraintFactory,p as createConstraintsManager,q as createDerivationsManager,j as createDisabledHistory,r as createEffectsManager,A as createEngine,t as createErrorBoundaryManager,w as createFacts,v as createFactsProxy,u as createFactsStore,i as createHistoryManager,x as createPluginManager,d as createResolverFactory,y as createResolversManager,s as createRetryLaterManager,z as createSourcesManager}from'./chunk-6QAUJFQH.js';export{m as dangerousRegex}from'./chunk-RBF653NR.js';export{f as getCurrentDeps,g as isTracking,j as trackAccess,h as withTracking,i as withoutTracking}from'./chunk-6PF2FRBG.js';export{h as hashObject,f as isPrototypeSafe,o as safeStringify,e as stableStringify}from'./chunk-SFUVPP4L.js';//# sourceMappingURL=internals.js.map
1
+ export{c as createConstraintFactory,p as createConstraintsManager,q as createDerivationsManager,j as createDisabledHistory,r as createEffectsManager,A as createEngine,t as createErrorBoundaryManager,w as createFacts,v as createFactsProxy,u as createFactsStore,i as createHistoryManager,x as createPluginManager,d as createResolverFactory,y as createResolversManager,s as createRetryLaterManager,z as createSourcesManager}from'./chunk-WVP3GOY2.js';export{m as dangerousRegex}from'./chunk-LN5H74CU.js';export{f as getCurrentDeps,g as isTracking,j as trackAccess,h as withTracking,i as withoutTracking}from'./chunk-WD47DB52.js';export{i as hashObject,g as isPrototypeSafe,p as safeStringify,f as stableStringify}from'./chunk-IZNOPHPL.js';//# sourceMappingURL=internals.js.map
2
2
  //# sourceMappingURL=internals.js.map