@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
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
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-4IfhJV32.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-4IfhJV32.cjs';
3
- import { S as SchemaKindNode } from './predicate-DBTPnlg6.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-DBTPnlg6.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-CvQuu0tu.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-CaPMTICa.cjs';
2
+ export { A as AnySystem, B as BatchConfig, t as Change, u as ChangeKind, v as ConstraintDefinition, w as ConstraintDiff, x as ConstraintStatus, y as ConstraintsDefinition, z as CrossModuleConstraintDefinition, G as CrossModuleEffectDefinition, H as DiffRulesOptions, I as DirectiveError, J as DistributableSnapshot, K as DistributableSnapshotOptions, L as DynamicConstraintDef, L as DynamicConstraintDefinition, O as DynamicEffectDef, Q as DynamicResolverDef, Q as DynamicResolverDefinition, U as EffectDefinition, V as EventsDefinition, W as FactTemplate, X as FactsSnapshot, Y as HistoryAPI, Z as HistoryOption, _ as HistoryState, $ as InferDerivations, a0 as InferEvents, a1 as InferFacts, a2 as InferRequirementTypes, a3 as InferRequirements, a4 as InferSchemaType, a5 as InferSelectorState, a6 as KeySelector, a7 as LeafClause, a8 as MetaAccessor, a9 as MetaMatch, aa as ObservationEvent, ab as OperatorObject, ac as PatchSpec, ad as PatchValue, ae as PayloadRef, af as PredicateClause, ag as PredicateCombinator, ah as PredicateCombinatorKey, ai as PredicateObject, aj as PredicateOp, ak as PredicateOverlapProof, al as ResolverAbortReason, am as ResolverDefinition, an as ResolversDefinition, ao as RetryPolicy, ap as RulesDiffReport, aq as RulesMapInput, ar as Schema, as as SchemaTypedResolversDefinition, at as ShouldRetryContext, au as Snapshot, av as SourceDef, av as SourceDefinition, aw as SourceDropReason, ax as SourcePublish, ax as SourcePublishFn, ay as SourceReportError, az as SourceUnsubscribe, az as SourceUnsubscribeFn, aA as System, aB as SystemConfig, aC as SystemDerived, aD as SystemFacts, aE as SystemInspection, aF as SystemMode, aG as SystemSnapshot, aH as TraceEntry, aI as TypedConstraintDefinition, aJ as TypedResolverDefinition, aK as diffClauses, aL as diffRules, aM as flattenPredicate, aN as isNamespacedSystem, aO as isSingleModuleSystem, aP as toRulesMap } from './plugins-CaPMTICa.cjs';
3
+ import { S as SchemaKindNode } from './predicate-CU0YC1i6.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-CU0YC1i6.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-DpvgHVHR.cjs';
6
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
  /**
@@ -325,128 +325,6 @@ declare const MAX_SWEEP_POINTS = 10000;
325
325
  */
326
326
  declare function sweepUnder<F = Record<string, unknown>>(options: SweepUnderOptions<F>): SweepReport;
327
327
 
328
- /**
329
- * Structural diff between two snapshots of a system's constraint `whenSpec`
330
- * map. The "git diff for business rules" — operates on the predicate AST
331
- * instead of source-text lines.
332
- *
333
- * A predicate is a tree of leaf clauses (`{ fact: operator(value) }`) and
334
- * combinators (`$all` / `$any` / `$not`). `diffRules` flattens both trees
335
- * into path-keyed leaf lists and compares: missing path → added/removed,
336
- * same path with different operand → changed (with relaxed/tightened
337
- * classification for numeric thresholds).
338
- *
339
- * Pure module — imports only utils. No engine / store / predicate-runtime
340
- * dependency: predicates are walked as plain JSON.
341
- */
342
- /** A leaf clause extracted from a predicate tree, keyed by its dotted path. */
343
- interface LeafClause {
344
- /** Dotted path through the predicate. E.g. `phase`, `$all[0].elapsed`, `$not.paused`. */
345
- path: string;
346
- /** Operator name. `$eq` is implied for bare-value equality. */
347
- op: string;
348
- /** Operand. */
349
- value: unknown;
350
- }
351
- /** Kind of change observed for a single clause. */
352
- type ChangeKind = "added" | "removed" | "changed" | "relaxed" | "tightened";
353
- /** A single change between two predicates at a specific path. */
354
- interface Change {
355
- path: string;
356
- kind: ChangeKind;
357
- before?: {
358
- op: string;
359
- value: unknown;
360
- };
361
- after?: {
362
- op: string;
363
- value: unknown;
364
- };
365
- }
366
- /** Status of a single constraint across the two snapshots. */
367
- type ConstraintStatus = "added" | "removed" | "changed" | "unchanged";
368
- interface ConstraintDiff {
369
- id: string;
370
- status: ConstraintStatus;
371
- /** Empty for `unchanged`. For `added` / `removed`, every leaf is listed once. */
372
- changes: Change[];
373
- }
374
- interface RulesDiffReport {
375
- constraints: ConstraintDiff[];
376
- summary: {
377
- added: number;
378
- removed: number;
379
- changed: number;
380
- unchanged: number;
381
- totalClauseChanges: number;
382
- };
383
- }
384
- interface DiffRulesOptions {
385
- before: RulesMapInput;
386
- after: RulesMapInput;
387
- }
388
- /**
389
- * Accepted shapes for the `before` / `after` predicate maps:
390
- * - A plain map `{ [constraintId]: whenSpec }`
391
- * - The `system.inspect().constraints` array form `Array<{ id, whenSpec? }>`
392
- * - Either wrapped as `{ constraints: <one-of-the-above> }`
393
- *
394
- * Anything else throws at `toRulesMap` so a bad input fails loud.
395
- */
396
- type RulesMapInput = unknown;
397
- /**
398
- * Coerce supported input shapes into a flat `Record<constraintId, whenSpec>`.
399
- * Constraints without a `whenSpec` (function-form `when`) are dropped with
400
- * an undefined entry so callers can distinguish them from absent constraints
401
- * if they care; the diff treats `undefined` as "no data" and skips clause
402
- * walking.
403
- */
404
- declare function toRulesMap(raw: RulesMapInput): Record<string, unknown>;
405
- /**
406
- * Walk a predicate tree and emit every leaf clause with its dotted path.
407
- * Combinators (`$all` / `$any` / `$not`) become indexed path segments.
408
- * Bare-value equality (`{ phase: "red" }`) emits as `op: "$eq"`.
409
- *
410
- * Array-form predicates (`[{ fact, op, value }, ...]`) are also accepted —
411
- * each clause's `fact` becomes the path, the operator is `op`, and the
412
- * value is `value`.
413
- *
414
- * **What gets dropped:** non-object combinator children (e.g. `$not: "red"`
415
- * with a string operand instead of a predicate object), function-form
416
- * predicates (the engine accepts a function for `when`; this walker only
417
- * sees data), and bare primitive predicates (a top-level `true` or `"x"`).
418
- * The walker is a tree visitor — anything not shaped like a predicate node
419
- * is silently skipped, never thrown on.
420
- */
421
- declare function flattenPredicate(spec: unknown, pathPrefix?: string, out?: LeafClause[]): LeafClause[];
422
- /**
423
- * Diff two snapshots of a system's constraint whenSpec map.
424
- *
425
- * @example
426
- * ```ts
427
- * const report = diffRules({
428
- * before: { blockCheckout: { cartTotal: { $gte: 100 } } },
429
- * after: { blockCheckout: { cartTotal: { $gte: 50 } } },
430
- * });
431
- *
432
- * report.constraints[0].status; // "changed"
433
- * report.constraints[0].changes[0].kind; // "relaxed"
434
- * report.summary.totalClauseChanges; // 1
435
- * ```
436
- *
437
- * The input shape is forgiving — either a flat `{ id: whenSpec }` map, the
438
- * `system.inspect().constraints` array form, or either wrapped as
439
- * `{ constraints: ... }`. Constraints whose `when` is a function (no
440
- * `whenSpec`) are tracked as added/removed but cannot be clause-diffed
441
- * (the function form is opaque).
442
- */
443
- declare function diffRules(options: DiffRulesOptions): RulesDiffReport;
444
- /**
445
- * Diff two predicate trees and return the list of leaf-level changes.
446
- * Exported for reuse beyond the full per-constraint report.
447
- */
448
- declare function diffClauses(before: unknown, after: unknown): Change[];
449
-
450
328
  /**
451
329
  * `predicateHash` — content-addressed fingerprint for a {@link FactPredicate}.
452
330
  *
@@ -581,9 +459,10 @@ declare function predict<F = Record<string, unknown>>(predicate: FactPredicate<F
581
459
  * defensible.
582
460
  *
583
461
  * **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.
462
+ * logic only. It does NOT consult `bind:` / `abortOn:` resolver
463
+ * metadata — a candidate that would *write* to a fact in another
464
+ * constraint's abort-binding will not be flagged here. Use
465
+ * `doctor.checkAbortOn()` for that gate.
587
466
  *
588
467
  * **INVARIANT (M11):** `checkAgainst` depends on `flattenPredicate`
589
468
  * emitting `{ path, op, value }` LeafClause shape — if that shape ever
@@ -632,30 +511,31 @@ interface ExistingConstraint {
632
511
  readonly id: string;
633
512
  readonly whenSpec?: unknown;
634
513
  /**
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.
514
+ * Fact paths the constraint's resolver aborts on when changed
515
+ * mid-flight, if exposed by the inspect API. Consulted by
516
+ * {@link doctor.checkAbortOn} to flag candidates that would write to
517
+ * fields under another constraint's abort-binding. Optional — older
518
+ * inspect payloads omit it.
639
519
  */
640
- readonly owns?: readonly string[];
641
- /** Same as {@link owns} but for the bind: side of binding metadata. */
520
+ readonly abortOn?: readonly string[];
521
+ /** Same as {@link abortOn} but for the bind: side of binding metadata. */
642
522
  readonly bind?: readonly string[];
643
523
  }
644
524
  /**
645
- * Returned by {@link doctor.checkOwns}.
525
+ * Returned by {@link doctor.checkAbortOn}.
646
526
  *
647
527
  * `severity` matches the {@link Contradiction} discriminator on
648
528
  * {@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)
529
+ * uniformly: by default, abort-binding collisions are `"warning"`
530
+ * (the engine still has a runtime gate), but a caller can promote them
531
+ * to `"error"` for stricter pre-deploy linting. (M5)
652
532
  */
653
- interface CheckOwnsFinding {
533
+ interface CheckAbortOnFinding {
654
534
  readonly constraintId: string;
655
535
  /** The fact path on the candidate predicate that triggered the finding. */
656
536
  readonly candidatePath: string;
657
- /** The owner side it would collide with: "owns" or "bind". */
658
- readonly source: "owns" | "bind";
537
+ /** The binding side it would collide with: "abortOn" or "bind". */
538
+ readonly source: "abortOn" | "bind";
659
539
  readonly reason: string;
660
540
  /**
661
541
  * Severity discriminator — `"warning"` by default (the engine has
@@ -665,20 +545,21 @@ interface CheckOwnsFinding {
665
545
  readonly severity?: "error" | "warning";
666
546
  }
667
547
  /**
668
- * Result of {@link doctor.checkOwns}.
548
+ * Result of {@link doctor.checkAbortOn}.
669
549
  *
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)
550
+ * AbortOn-/bind- collisions are warnings, not contradictions — the
551
+ * engine itself enforces the runtime binding gate, so a pre-deploy
552
+ * doctor pass treats them as advisory. The
553
+ * {@link CheckAbortOnFinding.severity} discriminator anticipates v2
554
+ * promotion of findings to errors. (M5, F-3)
674
555
  */
675
- interface CheckOwnsResult {
556
+ interface CheckAbortOnResult {
676
557
  /**
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.
558
+ * AbortOn-/bind- collisions surfaced by {@link doctor.checkAbortOn}.
559
+ * Empty when constraints expose no `abortOn:` / `bind:` metadata or
560
+ * the candidate's fact paths don't overlap.
680
561
  */
681
- readonly warnings: readonly CheckOwnsFinding[];
562
+ readonly warnings: readonly CheckAbortOnFinding[];
682
563
  }
683
564
  declare const doctor: {
684
565
  /**
@@ -712,31 +593,32 @@ declare const doctor: {
712
593
  }): CheckAgainstResult;
713
594
  /**
714
595
  * 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.
596
+ * fields in another constraint's `abortOn:` list (or `bind:`-bound by
597
+ * an existing constraint's resolvers). A v1 stub: relies on
598
+ * `inspect()` exposing `abortOn:` / `bind:` on each constraint
599
+ * snapshot. When that metadata is absent, this returns
600
+ * `{ findings: [] }` — no false positives.
719
601
  *
720
602
  * **TODO (v2):** wire the engine's resolver-ownership graph through
721
603
  * `system.inspect()` so this returns real findings without manual
722
- * `owns:` annotations on inspect payloads.
604
+ * `abortOn:` annotations on inspect payloads.
723
605
  *
724
606
  * @example
725
607
  * ```ts
726
- * doctor.checkOwns(
608
+ * doctor.checkAbortOn(
727
609
  * { cartTotal: { $gte: 100 } },
728
610
  * system.inspect(),
729
611
  * );
730
612
  * // → { findings: [
731
613
  * // { constraintId: "applyDiscount", candidatePath: "cartTotal",
732
- * // source: "owns",
733
- * // reason: "Constraint applyDiscount already owns cartTotal." }
614
+ * // source: "abortOn",
615
+ * // reason: "Constraint applyDiscount aborts on cartTotal." }
734
616
  * // ] }
735
617
  * ```
736
618
  */
737
- checkOwns<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
619
+ checkAbortOn<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
738
620
  constraints: readonly ExistingConstraint[];
739
- }): CheckOwnsResult;
621
+ }): CheckAbortOnResult;
740
622
  };
741
623
 
742
624
  /**
@@ -2253,4 +2135,4 @@ declare const Backoff: {
2253
2135
  readonly Exponential: "exponential";
2254
2136
  };
2255
2137
 
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 };
2138
+ export { Backoff, type Branded, type ChainableSchemaType, type CheckAbortOnFinding, type CheckAbortOnResult, type CheckAgainstResult, ClauseResult, type Contradiction, type ContradictionType, CreateSystemOptionsNamed, CreateSystemOptionsSingle, CrossModuleConstraintsDef as CrossModuleConstraintsDefinition, CrossModuleDeps, CrossModuleDerivationsDef as CrossModuleDerivationsDefinition, CrossModuleEffectsDef as CrossModuleEffectsDefinition, DefinitionMeta, type DescribeOptions, EffectsDef as EffectsDefinition, ErrorBoundaryConfig, type ExistingConstraint, type ExtendedSchemaType, FactPredicate, Facts, 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, 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, doctor, elapsedMs, 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, virtualClock };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
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-4IfhJV32.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-4IfhJV32.js';
3
- import { S as SchemaKindNode } from './predicate-BW05x5el.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-BW05x5el.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-DUbpbGw8.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-CaPMTICa.js';
2
+ export { A as AnySystem, B as BatchConfig, t as Change, u as ChangeKind, v as ConstraintDefinition, w as ConstraintDiff, x as ConstraintStatus, y as ConstraintsDefinition, z as CrossModuleConstraintDefinition, G as CrossModuleEffectDefinition, H as DiffRulesOptions, I as DirectiveError, J as DistributableSnapshot, K as DistributableSnapshotOptions, L as DynamicConstraintDef, L as DynamicConstraintDefinition, O as DynamicEffectDef, Q as DynamicResolverDef, Q as DynamicResolverDefinition, U as EffectDefinition, V as EventsDefinition, W as FactTemplate, X as FactsSnapshot, Y as HistoryAPI, Z as HistoryOption, _ as HistoryState, $ as InferDerivations, a0 as InferEvents, a1 as InferFacts, a2 as InferRequirementTypes, a3 as InferRequirements, a4 as InferSchemaType, a5 as InferSelectorState, a6 as KeySelector, a7 as LeafClause, a8 as MetaAccessor, a9 as MetaMatch, aa as ObservationEvent, ab as OperatorObject, ac as PatchSpec, ad as PatchValue, ae as PayloadRef, af as PredicateClause, ag as PredicateCombinator, ah as PredicateCombinatorKey, ai as PredicateObject, aj as PredicateOp, ak as PredicateOverlapProof, al as ResolverAbortReason, am as ResolverDefinition, an as ResolversDefinition, ao as RetryPolicy, ap as RulesDiffReport, aq as RulesMapInput, ar as Schema, as as SchemaTypedResolversDefinition, at as ShouldRetryContext, au as Snapshot, av as SourceDef, av as SourceDefinition, aw as SourceDropReason, ax as SourcePublish, ax as SourcePublishFn, ay as SourceReportError, az as SourceUnsubscribe, az as SourceUnsubscribeFn, aA as System, aB as SystemConfig, aC as SystemDerived, aD as SystemFacts, aE as SystemInspection, aF as SystemMode, aG as SystemSnapshot, aH as TraceEntry, aI as TypedConstraintDefinition, aJ as TypedResolverDefinition, aK as diffClauses, aL as diffRules, aM as flattenPredicate, aN as isNamespacedSystem, aO as isSingleModuleSystem, aP as toRulesMap } from './plugins-CaPMTICa.js';
3
+ import { S as SchemaKindNode } from './predicate-CgpwJqf4.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-CgpwJqf4.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-n8oQmdOZ.js';
6
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
  /**
@@ -325,128 +325,6 @@ declare const MAX_SWEEP_POINTS = 10000;
325
325
  */
326
326
  declare function sweepUnder<F = Record<string, unknown>>(options: SweepUnderOptions<F>): SweepReport;
327
327
 
328
- /**
329
- * Structural diff between two snapshots of a system's constraint `whenSpec`
330
- * map. The "git diff for business rules" — operates on the predicate AST
331
- * instead of source-text lines.
332
- *
333
- * A predicate is a tree of leaf clauses (`{ fact: operator(value) }`) and
334
- * combinators (`$all` / `$any` / `$not`). `diffRules` flattens both trees
335
- * into path-keyed leaf lists and compares: missing path → added/removed,
336
- * same path with different operand → changed (with relaxed/tightened
337
- * classification for numeric thresholds).
338
- *
339
- * Pure module — imports only utils. No engine / store / predicate-runtime
340
- * dependency: predicates are walked as plain JSON.
341
- */
342
- /** A leaf clause extracted from a predicate tree, keyed by its dotted path. */
343
- interface LeafClause {
344
- /** Dotted path through the predicate. E.g. `phase`, `$all[0].elapsed`, `$not.paused`. */
345
- path: string;
346
- /** Operator name. `$eq` is implied for bare-value equality. */
347
- op: string;
348
- /** Operand. */
349
- value: unknown;
350
- }
351
- /** Kind of change observed for a single clause. */
352
- type ChangeKind = "added" | "removed" | "changed" | "relaxed" | "tightened";
353
- /** A single change between two predicates at a specific path. */
354
- interface Change {
355
- path: string;
356
- kind: ChangeKind;
357
- before?: {
358
- op: string;
359
- value: unknown;
360
- };
361
- after?: {
362
- op: string;
363
- value: unknown;
364
- };
365
- }
366
- /** Status of a single constraint across the two snapshots. */
367
- type ConstraintStatus = "added" | "removed" | "changed" | "unchanged";
368
- interface ConstraintDiff {
369
- id: string;
370
- status: ConstraintStatus;
371
- /** Empty for `unchanged`. For `added` / `removed`, every leaf is listed once. */
372
- changes: Change[];
373
- }
374
- interface RulesDiffReport {
375
- constraints: ConstraintDiff[];
376
- summary: {
377
- added: number;
378
- removed: number;
379
- changed: number;
380
- unchanged: number;
381
- totalClauseChanges: number;
382
- };
383
- }
384
- interface DiffRulesOptions {
385
- before: RulesMapInput;
386
- after: RulesMapInput;
387
- }
388
- /**
389
- * Accepted shapes for the `before` / `after` predicate maps:
390
- * - A plain map `{ [constraintId]: whenSpec }`
391
- * - The `system.inspect().constraints` array form `Array<{ id, whenSpec? }>`
392
- * - Either wrapped as `{ constraints: <one-of-the-above> }`
393
- *
394
- * Anything else throws at `toRulesMap` so a bad input fails loud.
395
- */
396
- type RulesMapInput = unknown;
397
- /**
398
- * Coerce supported input shapes into a flat `Record<constraintId, whenSpec>`.
399
- * Constraints without a `whenSpec` (function-form `when`) are dropped with
400
- * an undefined entry so callers can distinguish them from absent constraints
401
- * if they care; the diff treats `undefined` as "no data" and skips clause
402
- * walking.
403
- */
404
- declare function toRulesMap(raw: RulesMapInput): Record<string, unknown>;
405
- /**
406
- * Walk a predicate tree and emit every leaf clause with its dotted path.
407
- * Combinators (`$all` / `$any` / `$not`) become indexed path segments.
408
- * Bare-value equality (`{ phase: "red" }`) emits as `op: "$eq"`.
409
- *
410
- * Array-form predicates (`[{ fact, op, value }, ...]`) are also accepted —
411
- * each clause's `fact` becomes the path, the operator is `op`, and the
412
- * value is `value`.
413
- *
414
- * **What gets dropped:** non-object combinator children (e.g. `$not: "red"`
415
- * with a string operand instead of a predicate object), function-form
416
- * predicates (the engine accepts a function for `when`; this walker only
417
- * sees data), and bare primitive predicates (a top-level `true` or `"x"`).
418
- * The walker is a tree visitor — anything not shaped like a predicate node
419
- * is silently skipped, never thrown on.
420
- */
421
- declare function flattenPredicate(spec: unknown, pathPrefix?: string, out?: LeafClause[]): LeafClause[];
422
- /**
423
- * Diff two snapshots of a system's constraint whenSpec map.
424
- *
425
- * @example
426
- * ```ts
427
- * const report = diffRules({
428
- * before: { blockCheckout: { cartTotal: { $gte: 100 } } },
429
- * after: { blockCheckout: { cartTotal: { $gte: 50 } } },
430
- * });
431
- *
432
- * report.constraints[0].status; // "changed"
433
- * report.constraints[0].changes[0].kind; // "relaxed"
434
- * report.summary.totalClauseChanges; // 1
435
- * ```
436
- *
437
- * The input shape is forgiving — either a flat `{ id: whenSpec }` map, the
438
- * `system.inspect().constraints` array form, or either wrapped as
439
- * `{ constraints: ... }`. Constraints whose `when` is a function (no
440
- * `whenSpec`) are tracked as added/removed but cannot be clause-diffed
441
- * (the function form is opaque).
442
- */
443
- declare function diffRules(options: DiffRulesOptions): RulesDiffReport;
444
- /**
445
- * Diff two predicate trees and return the list of leaf-level changes.
446
- * Exported for reuse beyond the full per-constraint report.
447
- */
448
- declare function diffClauses(before: unknown, after: unknown): Change[];
449
-
450
328
  /**
451
329
  * `predicateHash` — content-addressed fingerprint for a {@link FactPredicate}.
452
330
  *
@@ -581,9 +459,10 @@ declare function predict<F = Record<string, unknown>>(predicate: FactPredicate<F
581
459
  * defensible.
582
460
  *
583
461
  * **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.
462
+ * logic only. It does NOT consult `bind:` / `abortOn:` resolver
463
+ * metadata — a candidate that would *write* to a fact in another
464
+ * constraint's abort-binding will not be flagged here. Use
465
+ * `doctor.checkAbortOn()` for that gate.
587
466
  *
588
467
  * **INVARIANT (M11):** `checkAgainst` depends on `flattenPredicate`
589
468
  * emitting `{ path, op, value }` LeafClause shape — if that shape ever
@@ -632,30 +511,31 @@ interface ExistingConstraint {
632
511
  readonly id: string;
633
512
  readonly whenSpec?: unknown;
634
513
  /**
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.
514
+ * Fact paths the constraint's resolver aborts on when changed
515
+ * mid-flight, if exposed by the inspect API. Consulted by
516
+ * {@link doctor.checkAbortOn} to flag candidates that would write to
517
+ * fields under another constraint's abort-binding. Optional — older
518
+ * inspect payloads omit it.
639
519
  */
640
- readonly owns?: readonly string[];
641
- /** Same as {@link owns} but for the bind: side of binding metadata. */
520
+ readonly abortOn?: readonly string[];
521
+ /** Same as {@link abortOn} but for the bind: side of binding metadata. */
642
522
  readonly bind?: readonly string[];
643
523
  }
644
524
  /**
645
- * Returned by {@link doctor.checkOwns}.
525
+ * Returned by {@link doctor.checkAbortOn}.
646
526
  *
647
527
  * `severity` matches the {@link Contradiction} discriminator on
648
528
  * {@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)
529
+ * uniformly: by default, abort-binding collisions are `"warning"`
530
+ * (the engine still has a runtime gate), but a caller can promote them
531
+ * to `"error"` for stricter pre-deploy linting. (M5)
652
532
  */
653
- interface CheckOwnsFinding {
533
+ interface CheckAbortOnFinding {
654
534
  readonly constraintId: string;
655
535
  /** The fact path on the candidate predicate that triggered the finding. */
656
536
  readonly candidatePath: string;
657
- /** The owner side it would collide with: "owns" or "bind". */
658
- readonly source: "owns" | "bind";
537
+ /** The binding side it would collide with: "abortOn" or "bind". */
538
+ readonly source: "abortOn" | "bind";
659
539
  readonly reason: string;
660
540
  /**
661
541
  * Severity discriminator — `"warning"` by default (the engine has
@@ -665,20 +545,21 @@ interface CheckOwnsFinding {
665
545
  readonly severity?: "error" | "warning";
666
546
  }
667
547
  /**
668
- * Result of {@link doctor.checkOwns}.
548
+ * Result of {@link doctor.checkAbortOn}.
669
549
  *
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)
550
+ * AbortOn-/bind- collisions are warnings, not contradictions — the
551
+ * engine itself enforces the runtime binding gate, so a pre-deploy
552
+ * doctor pass treats them as advisory. The
553
+ * {@link CheckAbortOnFinding.severity} discriminator anticipates v2
554
+ * promotion of findings to errors. (M5, F-3)
674
555
  */
675
- interface CheckOwnsResult {
556
+ interface CheckAbortOnResult {
676
557
  /**
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.
558
+ * AbortOn-/bind- collisions surfaced by {@link doctor.checkAbortOn}.
559
+ * Empty when constraints expose no `abortOn:` / `bind:` metadata or
560
+ * the candidate's fact paths don't overlap.
680
561
  */
681
- readonly warnings: readonly CheckOwnsFinding[];
562
+ readonly warnings: readonly CheckAbortOnFinding[];
682
563
  }
683
564
  declare const doctor: {
684
565
  /**
@@ -712,31 +593,32 @@ declare const doctor: {
712
593
  }): CheckAgainstResult;
713
594
  /**
714
595
  * 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.
596
+ * fields in another constraint's `abortOn:` list (or `bind:`-bound by
597
+ * an existing constraint's resolvers). A v1 stub: relies on
598
+ * `inspect()` exposing `abortOn:` / `bind:` on each constraint
599
+ * snapshot. When that metadata is absent, this returns
600
+ * `{ findings: [] }` — no false positives.
719
601
  *
720
602
  * **TODO (v2):** wire the engine's resolver-ownership graph through
721
603
  * `system.inspect()` so this returns real findings without manual
722
- * `owns:` annotations on inspect payloads.
604
+ * `abortOn:` annotations on inspect payloads.
723
605
  *
724
606
  * @example
725
607
  * ```ts
726
- * doctor.checkOwns(
608
+ * doctor.checkAbortOn(
727
609
  * { cartTotal: { $gte: 100 } },
728
610
  * system.inspect(),
729
611
  * );
730
612
  * // → { findings: [
731
613
  * // { constraintId: "applyDiscount", candidatePath: "cartTotal",
732
- * // source: "owns",
733
- * // reason: "Constraint applyDiscount already owns cartTotal." }
614
+ * // source: "abortOn",
615
+ * // reason: "Constraint applyDiscount aborts on cartTotal." }
734
616
  * // ] }
735
617
  * ```
736
618
  */
737
- checkOwns<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
619
+ checkAbortOn<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
738
620
  constraints: readonly ExistingConstraint[];
739
- }): CheckOwnsResult;
621
+ }): CheckAbortOnResult;
740
622
  };
741
623
 
742
624
  /**
@@ -2253,4 +2135,4 @@ declare const Backoff: {
2253
2135
  readonly Exponential: "exponential";
2254
2136
  };
2255
2137
 
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 };
2138
+ export { Backoff, type Branded, type ChainableSchemaType, type CheckAbortOnFinding, type CheckAbortOnResult, type CheckAgainstResult, ClauseResult, type Contradiction, type ContradictionType, CreateSystemOptionsNamed, CreateSystemOptionsSingle, CrossModuleConstraintsDef as CrossModuleConstraintsDefinition, CrossModuleDeps, CrossModuleDerivationsDef as CrossModuleDerivationsDefinition, CrossModuleEffectsDef as CrossModuleEffectsDefinition, DefinitionMeta, type DescribeOptions, EffectsDef as EffectsDefinition, ErrorBoundaryConfig, type ExistingConstraint, type ExtendedSchemaType, FactPredicate, Facts, 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, 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, doctor, elapsedMs, 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, virtualClock };