@niscorp/tide 0.1.6 → 0.1.8
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/CHANGELOG.md +29 -0
- package/DESIGN.md +7 -6
- package/DOCS.md +38 -10
- package/README.md +5 -1
- package/dist/agent.cjs +12 -14
- package/dist/agent.cjs.map +1 -1
- package/dist/agent.d.cts +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -4
- package/dist/agent.js.map +1 -1
- package/dist/{chunk-4CUQXWVY.js → chunk-7KHOAJNL.js} +3 -4
- package/dist/chunk-7KHOAJNL.js.map +1 -0
- package/dist/{chunk-UEG3UZDG.js → chunk-ZEEJLISU.js} +13 -17
- package/dist/chunk-ZEEJLISU.js.map +1 -0
- package/dist/index.cjs +21 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -5
- package/dist/index.d.ts +29 -5
- package/dist/index.js +13 -56
- package/dist/index.js.map +1 -1
- package/dist/migrations/index.cjs +156 -0
- package/dist/migrations/index.cjs.map +1 -0
- package/dist/migrations/index.d.cts +198 -0
- package/dist/migrations/index.d.ts +198 -0
- package/dist/migrations/index.js +21 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/postgres.cjs +12 -10
- package/dist/postgres.cjs.map +1 -1
- package/dist/postgres.js +6 -3
- package/dist/postgres.js.map +1 -1
- package/dist/{reflex.schema-DeiyN5eN.d.cts → reflex.schema-DW1znJfS.d.cts} +29 -5
- package/dist/{reflex.schema-DeiyN5eN.d.ts → reflex.schema-DW1znJfS.d.ts} +29 -5
- package/dist/testing.cjs +0 -6
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.js +0 -6
- package/dist/testing.js.map +1 -1
- package/package.json +15 -5
- package/dist/chunk-4CUQXWVY.js.map +0 -1
- package/dist/chunk-UEG3UZDG.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { F as FactInput, L as LoadReport, a as Fact, A as AdvanceReport, P as PreviewReport, R as Run, T as TaskState, b as Task, c as Retention, d as TideConfig, e as TideStore, f as ReflexState } from './types-lAPfp7JD.cjs';
|
|
2
2
|
export { g as AttemptOutcome, C as COMPARISON_OPS, h as ClaimSpec, i as Comparison, E as EffectHandler, j as EffectRegistry, k as FactInputSchema, l as FactKind, m as FactKindSchema, M as Mutation, N as NewFact, O as Order, n as PRIMARY_KEY, o as PreviewCtx, p as PreviewUnit, Q as QuerySpec, q as RemoveSpec, r as Row, s as RunState, S as SelectCtx, t as SelectFn, u as TableName, v as TideCtx, w as TideEvent, x as TideTables, y as TransformFn, U as UNIQUE_BY, z as UniqueKey, W as Where } from './types-lAPfp7JD.cjs';
|
|
3
|
-
import { R as Reflex, a as ReflexInput, b as ReflexDraft, T as Timer } from './reflex.schema-
|
|
4
|
-
export { D as DRAFT_TRIGGERS, c as DraftChoice, d as DraftField, e as DraftTrigger, E as EffectRef, f as EffectRefSchema, g as ReflexDraftSchema, h as ReflexSchema, S as Selection, i as SelectionSchema, j as TimerSchema, k as TimerTriggerSchema, l as draftSchemaOf } from './reflex.schema-
|
|
3
|
+
import { R as Reflex, a as ReflexInput, b as ReflexDraft, T as Timer } from './reflex.schema-DW1znJfS.cjs';
|
|
4
|
+
export { D as DRAFT_TRIGGERS, c as DraftChoice, d as DraftField, e as DraftTrigger, E as EffectRef, f as EffectRefSchema, g as ReflexDraftSchema, h as ReflexSchema, S as Selection, i as SelectionSchema, j as TimerSchema, k as TimerTriggerSchema, l as draftSchemaOf } from './reflex.schema-DW1znJfS.cjs';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
declare const WEEKDAYS: readonly ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
@@ -26,7 +26,15 @@ declare const ClockRecurringSchema: z.ZodObject<{
|
|
|
26
26
|
fri: "fri";
|
|
27
27
|
sat: "sat";
|
|
28
28
|
sun: "sun";
|
|
29
|
-
}>, z.
|
|
29
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
30
|
+
mon: "mon";
|
|
31
|
+
tue: "tue";
|
|
32
|
+
wed: "wed";
|
|
33
|
+
thu: "thu";
|
|
34
|
+
fri: "fri";
|
|
35
|
+
sat: "sat";
|
|
36
|
+
sun: "sun";
|
|
37
|
+
}>>, z.ZodString]>>;
|
|
30
38
|
at: z.ZodString;
|
|
31
39
|
tz: z.ZodString;
|
|
32
40
|
}, z.core.$strict>;
|
|
@@ -50,7 +58,15 @@ declare const ClockTriggerSchema: z.ZodObject<{
|
|
|
50
58
|
fri: "fri";
|
|
51
59
|
sat: "sat";
|
|
52
60
|
sun: "sun";
|
|
53
|
-
}>, z.
|
|
61
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
62
|
+
mon: "mon";
|
|
63
|
+
tue: "tue";
|
|
64
|
+
wed: "wed";
|
|
65
|
+
thu: "thu";
|
|
66
|
+
fri: "fri";
|
|
67
|
+
sat: "sat";
|
|
68
|
+
sun: "sun";
|
|
69
|
+
}>>, z.ZodString]>>;
|
|
54
70
|
at: z.ZodString;
|
|
55
71
|
tz: z.ZodString;
|
|
56
72
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -102,7 +118,15 @@ declare const TriggerSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
102
118
|
fri: "fri";
|
|
103
119
|
sat: "sat";
|
|
104
120
|
sun: "sun";
|
|
105
|
-
}>, z.
|
|
121
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
122
|
+
mon: "mon";
|
|
123
|
+
tue: "tue";
|
|
124
|
+
wed: "wed";
|
|
125
|
+
thu: "thu";
|
|
126
|
+
fri: "fri";
|
|
127
|
+
sat: "sat";
|
|
128
|
+
sun: "sun";
|
|
129
|
+
}>>, z.ZodString]>>;
|
|
106
130
|
at: z.ZodString;
|
|
107
131
|
tz: z.ZodString;
|
|
108
132
|
}, z.core.$strict>, z.ZodObject<{
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { F as FactInput, L as LoadReport, a as Fact, A as AdvanceReport, P as PreviewReport, R as Run, T as TaskState, b as Task, c as Retention, d as TideConfig, e as TideStore, f as ReflexState } from './types-lAPfp7JD.js';
|
|
2
2
|
export { g as AttemptOutcome, C as COMPARISON_OPS, h as ClaimSpec, i as Comparison, E as EffectHandler, j as EffectRegistry, k as FactInputSchema, l as FactKind, m as FactKindSchema, M as Mutation, N as NewFact, O as Order, n as PRIMARY_KEY, o as PreviewCtx, p as PreviewUnit, Q as QuerySpec, q as RemoveSpec, r as Row, s as RunState, S as SelectCtx, t as SelectFn, u as TableName, v as TideCtx, w as TideEvent, x as TideTables, y as TransformFn, U as UNIQUE_BY, z as UniqueKey, W as Where } from './types-lAPfp7JD.js';
|
|
3
|
-
import { R as Reflex, a as ReflexInput, b as ReflexDraft, T as Timer } from './reflex.schema-
|
|
4
|
-
export { D as DRAFT_TRIGGERS, c as DraftChoice, d as DraftField, e as DraftTrigger, E as EffectRef, f as EffectRefSchema, g as ReflexDraftSchema, h as ReflexSchema, S as Selection, i as SelectionSchema, j as TimerSchema, k as TimerTriggerSchema, l as draftSchemaOf } from './reflex.schema-
|
|
3
|
+
import { R as Reflex, a as ReflexInput, b as ReflexDraft, T as Timer } from './reflex.schema-DW1znJfS.js';
|
|
4
|
+
export { D as DRAFT_TRIGGERS, c as DraftChoice, d as DraftField, e as DraftTrigger, E as EffectRef, f as EffectRefSchema, g as ReflexDraftSchema, h as ReflexSchema, S as Selection, i as SelectionSchema, j as TimerSchema, k as TimerTriggerSchema, l as draftSchemaOf } from './reflex.schema-DW1znJfS.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
7
|
declare const WEEKDAYS: readonly ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
@@ -26,7 +26,15 @@ declare const ClockRecurringSchema: z.ZodObject<{
|
|
|
26
26
|
fri: "fri";
|
|
27
27
|
sat: "sat";
|
|
28
28
|
sun: "sun";
|
|
29
|
-
}>, z.
|
|
29
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
30
|
+
mon: "mon";
|
|
31
|
+
tue: "tue";
|
|
32
|
+
wed: "wed";
|
|
33
|
+
thu: "thu";
|
|
34
|
+
fri: "fri";
|
|
35
|
+
sat: "sat";
|
|
36
|
+
sun: "sun";
|
|
37
|
+
}>>, z.ZodString]>>;
|
|
30
38
|
at: z.ZodString;
|
|
31
39
|
tz: z.ZodString;
|
|
32
40
|
}, z.core.$strict>;
|
|
@@ -50,7 +58,15 @@ declare const ClockTriggerSchema: z.ZodObject<{
|
|
|
50
58
|
fri: "fri";
|
|
51
59
|
sat: "sat";
|
|
52
60
|
sun: "sun";
|
|
53
|
-
}>, z.
|
|
61
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
62
|
+
mon: "mon";
|
|
63
|
+
tue: "tue";
|
|
64
|
+
wed: "wed";
|
|
65
|
+
thu: "thu";
|
|
66
|
+
fri: "fri";
|
|
67
|
+
sat: "sat";
|
|
68
|
+
sun: "sun";
|
|
69
|
+
}>>, z.ZodString]>>;
|
|
54
70
|
at: z.ZodString;
|
|
55
71
|
tz: z.ZodString;
|
|
56
72
|
}, z.core.$strict>, z.ZodObject<{
|
|
@@ -102,7 +118,15 @@ declare const TriggerSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
102
118
|
fri: "fri";
|
|
103
119
|
sat: "sat";
|
|
104
120
|
sun: "sun";
|
|
105
|
-
}>, z.
|
|
121
|
+
}>, z.ZodArray<z.ZodEnum<{
|
|
122
|
+
mon: "mon";
|
|
123
|
+
tue: "tue";
|
|
124
|
+
wed: "wed";
|
|
125
|
+
thu: "thu";
|
|
126
|
+
fri: "fri";
|
|
127
|
+
sat: "sat";
|
|
128
|
+
sun: "sun";
|
|
129
|
+
}>>, z.ZodString]>>;
|
|
106
130
|
at: z.ZodString;
|
|
107
131
|
tz: z.ZodString;
|
|
108
132
|
}, z.core.$strict>, z.ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { UNIQUE_BY, PRIMARY_KEY, COMPARISON_OPS } from './chunk-
|
|
2
|
-
export { COMPARISON_OPS, PRIMARY_KEY, UNIQUE_BY } from './chunk-
|
|
3
|
-
import { isRecurring, ReflexSchema, FactInputSchema, clockOf, factOf, WEEKDAYS, isManual } from './chunk-
|
|
4
|
-
export { ClockOnceSchema, ClockRecurringSchema, ClockTriggerSchema, ClockUnitSchema, DRAFT_TRIGGERS, EffectRefSchema, FactInputSchema, FactKindSchema, ManualTriggerSchema, OpSchema, PolicySchema, ReflexDraftSchema, ReflexSchema, RetrySchema, RunTriggerSchema, SelectionSchema, SignalTriggerSchema, TimerSchema, TimerTriggerSchema, TriggerSchema, WEEKDAYS, WriteTriggerSchema, draftSchemaOf } from './chunk-
|
|
1
|
+
import { UNIQUE_BY, PRIMARY_KEY, COMPARISON_OPS } from './chunk-7KHOAJNL.js';
|
|
2
|
+
export { COMPARISON_OPS, PRIMARY_KEY, UNIQUE_BY } from './chunk-7KHOAJNL.js';
|
|
3
|
+
import { isRecurring, ReflexSchema, FactInputSchema, clockOf, factOf, WEEKDAYS, isManual } from './chunk-ZEEJLISU.js';
|
|
4
|
+
export { ClockOnceSchema, ClockRecurringSchema, ClockTriggerSchema, ClockUnitSchema, DRAFT_TRIGGERS, EffectRefSchema, FactInputSchema, FactKindSchema, ManualTriggerSchema, OpSchema, PolicySchema, ReflexDraftSchema, ReflexSchema, RetrySchema, RunTriggerSchema, SelectionSchema, SignalTriggerSchema, TimerSchema, TimerTriggerSchema, TriggerSchema, WEEKDAYS, WriteTriggerSchema, draftSchemaOf } from './chunk-ZEEJLISU.js';
|
|
5
5
|
|
|
6
6
|
// src/errors.ts
|
|
7
7
|
var TideError = class extends Error {
|
|
@@ -226,7 +226,7 @@ var ordinalOf = (day) => day.year * 1e4 + day.month * 100 + day.day;
|
|
|
226
226
|
var pad2 = (value) => String(value).padStart(2, "0");
|
|
227
227
|
var isDueOn = (clock, day) => {
|
|
228
228
|
if (clock.every === "day") return true;
|
|
229
|
-
if (clock.every === "week") return weekdayOf(day) === clock.on;
|
|
229
|
+
if (clock.every === "week") return Array.isArray(clock.on) ? clock.on.some((one) => one === weekdayOf(day)) : weekdayOf(day) === clock.on;
|
|
230
230
|
if (clock.every === "month")
|
|
231
231
|
return typeof clock.on === "number" && day.day === Math.min(clock.on, daysInMonth(day.year, day.month));
|
|
232
232
|
if (typeof clock.on !== "string") return false;
|
|
@@ -278,8 +278,6 @@ var openRun = async (deps, loaded, input) => {
|
|
|
278
278
|
const base = {
|
|
279
279
|
reflexId: reflex.id,
|
|
280
280
|
version,
|
|
281
|
-
// Written down so the ledger is scopeable by an ordinary host rule
|
|
282
|
-
// rather than by parsing reflex ids. Opaque to tide.
|
|
283
281
|
as: reflex.as,
|
|
284
282
|
cause: input.cause,
|
|
285
283
|
occurrence: input.occurrence,
|
|
@@ -302,8 +300,6 @@ var openRun = async (deps, loaded, input) => {
|
|
|
302
300
|
...base,
|
|
303
301
|
state: "skipped",
|
|
304
302
|
settledAt: input.now,
|
|
305
|
-
// Nothing waits on it and nothing announces it: a run that never
|
|
306
|
-
// started has no settlement to report.
|
|
307
303
|
drained: true,
|
|
308
304
|
note: `overlap: the previous run (${unsettled.id}) is still unsettled`
|
|
309
305
|
});
|
|
@@ -383,8 +379,6 @@ var matchFacts = async (deps, now, limit) => {
|
|
|
383
379
|
now,
|
|
384
380
|
occurrence: fact.occurrence,
|
|
385
381
|
factIds: [fact.id],
|
|
386
|
-
// A write, a signal or another reflex's settlement happened once and
|
|
387
|
-
// will not happen again; a human pressing the button twice will.
|
|
388
382
|
repeat: fact.kind === "manual"
|
|
389
383
|
});
|
|
390
384
|
if (run !== void 0) report.runsCreated += 1;
|
|
@@ -520,8 +514,6 @@ var commitFanout = async (deps, run, tasks, selected, now) => deps.store.transac
|
|
|
520
514
|
{
|
|
521
515
|
selected,
|
|
522
516
|
total: written,
|
|
523
|
-
// A zero-task run settles immediately and still announces itself —
|
|
524
|
-
// "nothing was due" is an answer a digest may legitimately want.
|
|
525
517
|
state: settledNow ? "settled" : "fanned",
|
|
526
518
|
settledAt: settledNow ? now : void 0
|
|
527
519
|
}
|
|
@@ -532,12 +524,9 @@ var taskOf = (unit, run, loaded, now) => ({
|
|
|
532
524
|
runId: run.id,
|
|
533
525
|
reflexId: loaded.reflex.id,
|
|
534
526
|
unit: unit.unit,
|
|
535
|
-
// UNIQUE(runId, unit) — the idempotency grain, written BEFORE the effect
|
|
536
|
-
// runs. There is no path to the effect that skips this row.
|
|
537
527
|
cause: run.cause,
|
|
538
528
|
env: unit.env,
|
|
539
|
-
// Carried
|
|
540
|
-
// ceiling for work that is still in flight.
|
|
529
|
+
// Carried on the task: a swept run must not reset the chain ceiling.
|
|
541
530
|
depth: run.depth,
|
|
542
531
|
state: "pending",
|
|
543
532
|
attempt: 0,
|
|
@@ -624,22 +613,13 @@ var claimTasks = async (deps, now, limit, token) => {
|
|
|
624
613
|
where: {
|
|
625
614
|
state: { in: ["pending", "retrying", "claimed"] },
|
|
626
615
|
notBefore: { lte: now },
|
|
627
|
-
// Either it was never claimed, or the claim has lapsed. Expressed as
|
|
628
|
-
// one predicate because a second query would be a second decision.
|
|
629
616
|
claimedUntil: { lte: now }
|
|
630
617
|
},
|
|
631
|
-
// `unit`
|
|
632
|
-
//
|
|
633
|
-
// order was whatever the storage engine felt like — insertion order in a
|
|
634
|
-
// Map, heap order in Postgres. Two stores answering differently is the
|
|
635
|
-
// thing the contract exists to prevent, and a headless check asserting on
|
|
636
|
-
// the order effects ran in deserves the same answer everywhere.
|
|
618
|
+
// `unit` breaks ties: one fan-out's tasks share `notBefore` and `createdAt`,
|
|
619
|
+
// and two stores must order them the same way.
|
|
637
620
|
order: [{ by: "notBefore" }, { by: "createdAt" }, { by: "unit" }],
|
|
638
621
|
limit,
|
|
639
622
|
set: { state: "claimed", token, claimedUntil: now + deps.leaseMs, attempt: { inc: 1 } },
|
|
640
|
-
// `order: 'serial'` — at most one live claim per reflex, counting what
|
|
641
|
-
// another claim already holds. Inside the claim, because a caller that
|
|
642
|
-
// looks first and claims second loses the race to its own second tick.
|
|
643
623
|
onePer: serialReflexIds.length === 0 ? void 0 : { column: "reflexId", held: { state: "claimed", claimedUntil: { gt: now } }, only: serialReflexIds }
|
|
644
624
|
});
|
|
645
625
|
};
|
|
@@ -675,21 +655,8 @@ var executeTasks = async (deps, now, limit) => {
|
|
|
675
655
|
depth: task.depth,
|
|
676
656
|
now,
|
|
677
657
|
actor: deps.actorFor(reflex.as),
|
|
678
|
-
//
|
|
679
|
-
//
|
|
680
|
-
// `emit` used to accept anything: a handler could emit `kind: 'manual'`
|
|
681
|
-
// and fire a DISARMED reflex, because manual facts are checked before
|
|
682
|
-
// enablement on purpose — arming gates triggers, not people. A handler
|
|
683
|
-
// is not a person. `run` is tide's own bookkeeping and is minted by the
|
|
684
|
-
// settler, so it is refused for the same reason.
|
|
685
|
-
//
|
|
686
|
-
// A malformed emit THROWS, inside the handler, so the attempt fails
|
|
687
|
-
// visibly. The alternative is a fact that stores, matches nothing and
|
|
688
|
-
// vanishes — a chain that silently stops one hop in.
|
|
689
|
-
//
|
|
690
|
-
// Depth is stamped from the task below — the handler never sets it,
|
|
691
|
-
// because a handler that could choose its own depth could escape the
|
|
692
|
-
// chain ceiling.
|
|
658
|
+
// `write` and `signal` only: a `manual` fact fires a disabled reflex, and
|
|
659
|
+
// `run` facts are minted by the settler alone.
|
|
693
660
|
emit: (fact) => {
|
|
694
661
|
if (fact.kind !== "write" && fact.kind !== "signal")
|
|
695
662
|
throw new TideError("invalid_fact", `${reflex.id}: an effect may emit \`write\` or \`signal\` facts, not \`${fact.kind}\``);
|
|
@@ -731,8 +698,7 @@ var executeTasks = async (deps, now, limit) => {
|
|
|
731
698
|
notBefore: next.state === "retrying" ? next.notBefore : task.notBefore,
|
|
732
699
|
output,
|
|
733
700
|
error,
|
|
734
|
-
// A
|
|
735
|
-
// emit-then-throw handler would double-mint facts and fire the chain twice.
|
|
701
|
+
// A failed attempt's emits are dropped: its retry would mint them again.
|
|
736
702
|
emits: outcome === "ok" ? emits : [],
|
|
737
703
|
at: now
|
|
738
704
|
});
|
|
@@ -819,8 +785,6 @@ var settleRuns = async (deps, now) => {
|
|
|
819
785
|
at: now,
|
|
820
786
|
depth: run.depth + 1,
|
|
821
787
|
cause: `run:${run.id}`,
|
|
822
|
-
// A settlement is news about THIS reflex's work — counts of rows it
|
|
823
|
-
// selected. Another tenant's digest has no business waking on it.
|
|
824
788
|
as: run.as
|
|
825
789
|
}, deps.maxChainFacts);
|
|
826
790
|
announceFact(deps.emit, admission);
|
|
@@ -1064,8 +1028,6 @@ var createTide = (config) => {
|
|
|
1064
1028
|
if (!loaded.has(reflexId)) throw new TideError("unknown_reflex", `no reflex "${reflexId}" is loaded`);
|
|
1065
1029
|
return ingest(
|
|
1066
1030
|
{ kind: "manual", target: reflexId, payload: options.input, by: options.by ?? "operator", at: options.now },
|
|
1067
|
-
// Carried so the ledger reads consistently. Matching a manual fact does
|
|
1068
|
-
// not depend on it — `target` names one reflex, which is narrower.
|
|
1069
1031
|
{ as: loaded.get(reflexId)?.reflex.as }
|
|
1070
1032
|
);
|
|
1071
1033
|
};
|
|
@@ -1125,19 +1087,14 @@ var createTide = (config) => {
|
|
|
1125
1087
|
},
|
|
1126
1088
|
fact: (id) => one("fact", id),
|
|
1127
1089
|
causeChain,
|
|
1128
|
-
//
|
|
1129
|
-
//
|
|
1130
|
-
// parked it has not changed and never will.
|
|
1090
|
+
// `released` as well: with `parked` alone cleared, the depth check would
|
|
1091
|
+
// park the fact again on the next advance.
|
|
1131
1092
|
releaseParked: async (factId) => {
|
|
1132
1093
|
const fact = await one("fact", factId);
|
|
1133
1094
|
if (fact?.parked === void 0) return false;
|
|
1134
1095
|
return config.store.cas("fact", factId, {}, { parked: void 0, released: true });
|
|
1135
1096
|
}
|
|
1136
1097
|
},
|
|
1137
|
-
// RETENTION, and the one place the ledger shrinks. Runs cascade to their
|
|
1138
|
-
// tasks in the store: a run and its members are one fact about the world,
|
|
1139
|
-
// and keeping half destroys the UNIQUE(runId, unit) row that IS the "this
|
|
1140
|
-
// unit already ran" record.
|
|
1141
1098
|
sweep: async (now, retention) => {
|
|
1142
1099
|
let removed = 0;
|
|
1143
1100
|
if (retention.facts !== void 0)
|