@directive-run/core 1.21.0 → 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.
- package/README.md +2 -2
- package/dist/adapter-utils.d.cts +1 -1
- package/dist/adapter-utils.d.ts +1 -1
- package/dist/chunk-6NCC6RBC.js +3 -0
- package/dist/chunk-6NCC6RBC.js.map +1 -0
- package/dist/{chunk-4OXCKDKS.cjs → chunk-OAPD3HIG.cjs} +3 -3
- package/dist/{chunk-4OXCKDKS.cjs.map → chunk-OAPD3HIG.cjs.map} +1 -1
- package/dist/chunk-QTY2FXZY.cjs +3 -0
- package/dist/chunk-QTY2FXZY.cjs.map +1 -0
- package/dist/{chunk-E53A4NHM.js → chunk-YJEDX2JX.js} +3 -3
- package/dist/{chunk-E53A4NHM.js.map → chunk-YJEDX2JX.js.map} +1 -1
- package/dist/{index-DUbpbGw8.d.ts → index-BgKC_ZT_.d.ts} +1 -1
- package/dist/{index-CvQuu0tu.d.cts → index-DRPkZ8HE.d.cts} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +46 -42
- package/dist/index.d.ts +46 -42
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +1 -1
- package/dist/internals.d.cts +39 -25
- package/dist/internals.d.ts +39 -25
- package/dist/internals.js +1 -1
- package/dist/plugins/index.cjs +2 -2
- package/dist/plugins/index.cjs.map +1 -1
- package/dist/plugins/index.d.cts +159 -3
- package/dist/plugins/index.d.ts +159 -3
- package/dist/plugins/index.js +2 -2
- package/dist/plugins/index.js.map +1 -1
- package/dist/{plugins-4IfhJV32.d.cts → plugins-5Supk7it.d.cts} +78 -30
- package/dist/{plugins-4IfhJV32.d.ts → plugins-5Supk7it.d.ts} +78 -30
- package/dist/{predicate-BW05x5el.d.ts → predicate-C9oMO_ny.d.ts} +1 -1
- package/dist/{predicate-DBTPnlg6.d.cts → predicate-DYb-3Mvl.d.cts} +1 -1
- package/dist/system-5FKUBLLV.cjs +2 -0
- package/dist/{system-SB7JYMRB.cjs.map → system-5FKUBLLV.cjs.map} +1 -1
- package/dist/system-6YWCXQOQ.js +2 -0
- package/dist/{system-SJBP4TO5.js.map → system-6YWCXQOQ.js.map} +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +1 -1
- package/dist/worker.d.ts +1 -1
- package/dist/worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6QAUJFQH.js +0 -3
- package/dist/chunk-6QAUJFQH.js.map +0 -1
- package/dist/chunk-M5PEB553.cjs +0 -3
- package/dist/chunk-M5PEB553.cjs.map +0 -1
- package/dist/system-SB7JYMRB.cjs +0 -2
- 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-
|
|
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-
|
|
3
|
-
import { S as SchemaKindNode } from './predicate-
|
|
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-
|
|
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-
|
|
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
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
|
/**
|
|
@@ -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:` / `
|
|
585
|
-
* a candidate that would *write* to a fact
|
|
586
|
-
* will not be flagged here. Use
|
|
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
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
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
|
|
641
|
-
/** Same as {@link
|
|
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.
|
|
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,
|
|
650
|
-
* still has a runtime gate), but a caller can promote them
|
|
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
|
|
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
|
|
658
|
-
readonly source: "
|
|
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.
|
|
670
|
+
* Result of {@link doctor.checkAbortOn}.
|
|
669
671
|
*
|
|
670
|
-
*
|
|
671
|
-
* itself enforces the runtime binding gate, so a pre-deploy
|
|
672
|
-
* treats them as advisory. The
|
|
673
|
-
* discriminator anticipates v2
|
|
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
|
|
678
|
+
interface CheckAbortOnResult {
|
|
676
679
|
/**
|
|
677
|
-
*
|
|
678
|
-
* when constraints expose no `
|
|
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
|
|
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
|
|
716
|
-
* resolvers. A v1 stub: relies on
|
|
717
|
-
*
|
|
718
|
-
*
|
|
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
|
-
* `
|
|
726
|
+
* `abortOn:` annotations on inspect payloads.
|
|
723
727
|
*
|
|
724
728
|
* @example
|
|
725
729
|
* ```ts
|
|
726
|
-
* doctor.
|
|
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: "
|
|
733
|
-
* // reason: "Constraint applyDiscount
|
|
736
|
+
* // source: "abortOn",
|
|
737
|
+
* // reason: "Constraint applyDiscount aborts on cartTotal." }
|
|
734
738
|
* // ] }
|
|
735
739
|
* ```
|
|
736
740
|
*/
|
|
737
|
-
|
|
741
|
+
checkAbortOn<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
|
|
738
742
|
constraints: readonly ExistingConstraint[];
|
|
739
|
-
}):
|
|
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
|
|
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,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-
|
|
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-
|
|
3
|
-
import { S as SchemaKindNode } from './predicate-
|
|
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-
|
|
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-
|
|
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
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
|
/**
|
|
@@ -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:` / `
|
|
585
|
-
* a candidate that would *write* to a fact
|
|
586
|
-
* will not be flagged here. Use
|
|
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
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
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
|
|
641
|
-
/** Same as {@link
|
|
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.
|
|
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,
|
|
650
|
-
* still has a runtime gate), but a caller can promote them
|
|
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
|
|
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
|
|
658
|
-
readonly source: "
|
|
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.
|
|
670
|
+
* Result of {@link doctor.checkAbortOn}.
|
|
669
671
|
*
|
|
670
|
-
*
|
|
671
|
-
* itself enforces the runtime binding gate, so a pre-deploy
|
|
672
|
-
* treats them as advisory. The
|
|
673
|
-
* discriminator anticipates v2
|
|
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
|
|
678
|
+
interface CheckAbortOnResult {
|
|
676
679
|
/**
|
|
677
|
-
*
|
|
678
|
-
* when constraints expose no `
|
|
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
|
|
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
|
|
716
|
-
* resolvers. A v1 stub: relies on
|
|
717
|
-
*
|
|
718
|
-
*
|
|
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
|
-
* `
|
|
726
|
+
* `abortOn:` annotations on inspect payloads.
|
|
723
727
|
*
|
|
724
728
|
* @example
|
|
725
729
|
* ```ts
|
|
726
|
-
* doctor.
|
|
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: "
|
|
733
|
-
* // reason: "Constraint applyDiscount
|
|
736
|
+
* // source: "abortOn",
|
|
737
|
+
* // reason: "Constraint applyDiscount aborts on cartTotal." }
|
|
734
738
|
* // ] }
|
|
735
739
|
* ```
|
|
736
740
|
*/
|
|
737
|
-
|
|
741
|
+
checkAbortOn<F = Record<string, unknown>>(candidate: FactPredicate<F>, existing: readonly ExistingConstraint[] | {
|
|
738
742
|
constraints: readonly ExistingConstraint[];
|
|
739
|
-
}):
|
|
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
|
|
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 };
|