@listen-fire/engine-contracts 0.16.0 → 0.16.1
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/dist/catalog.js +14 -2
- package/dist/conformance/listen-arrivals.json +116 -22
- package/dist/function_walk.d.ts +35 -0
- package/dist/function_walk.js +38 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/listen_plan.d.ts +11 -1
- package/dist/listen_plan.js +6 -1
- package/package.json +2 -2
package/dist/catalog.js
CHANGED
|
@@ -647,6 +647,9 @@ exports.schemaFieldDescriptorSchema = zod_1.z.object({
|
|
|
647
647
|
fieldId: zod_1.z.string(),
|
|
648
648
|
displayName: zod_1.z.string(),
|
|
649
649
|
kind: schemaFieldKindSchema,
|
|
650
|
+
/** With `kind: 'enum'`: a CLOSED list. A literal not in it is an error
|
|
651
|
+
* (`MOV_ENUM_UNKNOWN_VALUE`); with `cardinality: 'many'`, each tag of a list
|
|
652
|
+
* is checked. Example: `enumValues: ['cursed', 'heavy'], cardinality: 'many'`. */
|
|
650
653
|
enumValues: zod_1.z.array(zod_1.z.string()).optional(),
|
|
651
654
|
/**
|
|
652
655
|
* OPEN known-values (distinct from `enumValues`, a closed set): live values
|
|
@@ -671,6 +674,12 @@ exports.schemaFieldDescriptorSchema = zod_1.z.object({
|
|
|
671
674
|
* check time (MOV_WRITE_ONLY_PROPERTY) instead of silently yielding null.
|
|
672
675
|
*/
|
|
673
676
|
readable: zod_1.z.boolean().optional(),
|
|
677
|
+
/**
|
|
678
|
+
* For WRITES: `true` says a write must give this field. Says nothing about
|
|
679
|
+
* reads: a field a read may find missing needs `mayBeAbsent`, whatever
|
|
680
|
+
* `required` is. Example: `required: true, mayBeAbsent: true` is a field
|
|
681
|
+
* every create gives but a read can still miss.
|
|
682
|
+
*/
|
|
674
683
|
required: zod_1.z.boolean(),
|
|
675
684
|
/**
|
|
676
685
|
* A read of this type must pin this field in its WHERE with `==`
|
|
@@ -752,8 +761,11 @@ exports.schemaFieldDescriptorSchema = zod_1.z.object({
|
|
|
752
761
|
owned: zod_1.z.object({ name: zod_1.z.string().min(1), allowPattern: zod_1.z.string().optional(), format: zod_1.z.enum(['cron', 'timeZone']).optional() }).optional(),
|
|
753
762
|
/** With `kind: 'record'`: the type of the record it holds, by its type id. */
|
|
754
763
|
record: zod_1.z.object({ typeId: zod_1.z.string().min(1) }).optional(),
|
|
755
|
-
/**
|
|
756
|
-
* the row was created
|
|
764
|
+
/** For READS: `true` says a read may find the field missing (a change's
|
|
765
|
+
* row before, when the row was created; an optional number), so the
|
|
766
|
+
* checker types it as possibly absent and a program tests it first.
|
|
767
|
+
* Absent ⇒ false, however `required` is set. Example:
|
|
768
|
+
* `{ fieldId: 'Hp', kind: 'number', writable: true, required: false, mayBeAbsent: true }`. */
|
|
757
769
|
mayBeAbsent: zod_1.z.boolean().optional(),
|
|
758
770
|
/** With `kind: 'string'` or `'number'`: the module vouches for the value
|
|
759
771
|
* under these names (`claim:email/address`). A brand narrows the type, as
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"about": "Whether an arrival fires a listen, by its plan's filters. Each plan is the checker's answer for its listen's source against `catalog` (both runners check that it still is). Hops judged on arrival are judged, each against the record the arrival carries for it: `landing` for the last hop, `parents` (aligned to the plan's `carries`) for earlier ones; where the record in a hop's place is missing or of another record type, the one of the hop's own record type is read (the k-th, for the k-th hop on an edge name), so a module may carry more records than a path declares, in another order (plan `positioned`), and only with none of that type does the record in its place skip by its type. So is a hop the host resolves by listing (`resolved`) whose edge the plan's `carries` names: the carried record is preferred to the listing, so a host that lists no members judges it all the same; any other resolved hop is the host's scope check, not judged here. Each record states its `recordType`, which must be the record type its hop lands on (`to`): one edge name may hang off several record types (`pay`'s Customer and Invoice each have `Changes`), and a record of another type skips at its hop, the landing judged first; a record that states none is undecided. A hop's checked part is always evaluated; its taken part too, unless `takenApplied` says the module applied it. `now` is the instant WITHIN measures from. The verdict is `{fires: true}`, `{skips: n}` (the hop whose filter fails, outermost 0; with a `reason` when the record carried for that hop is of another record type, so no filter was read), or `{undecided: reason}` (the host logs it and runs nothing). A listen through or onto a union is one plan holding each member's traversal (`members`), judged once: it fires when one member's does, a record of another member's type being that member's to decide; it is undecided when one member cannot tell; it skips when every member does, by a filter when one member's record types matched, else by type, naming every member's. Held by listen-fire's Rust (crates/movement-engine/src/listen_judge.rs, judge_arrival), the engine's TypeScript (judgeArrival, through the wasm) and the hosted product. A read on through a record a field holds (`c.Current.Stage`) reads that field of the landing, then the member of what it holds; a record absent reads its members absent. The checker has the listen test a record present before it reads through it (`exists(c.Current) AND c.Current.Stage == …`), and an operand of AND or OR is read only when the operands before it leave the answer open, so a read the test guards is never read on an absent record. A record may name the fields its module could not read (`unknown`): a part of the filter reading one is undecided, whatever `fields` holds for it, never read as absent; AND, OR and NOT are three-valued, so an OR one side holds holds and an AND one side fails fails, in either order; a hop that fails still decides. A filter may call a pure function: a standard library one is evaluated; a host function, named by its catalog key (`@lf-platform/team/isMember`), is the host's to answer; a field read off its answer (`team.userFor(e)?.Level`, a `field` node) is absent when it answers no record, and compares as any absent value does. The plan puts every term that asks no host first in each AND and OR, and the taken part is read before the checked part's host terms, so a local term that decides the verdict asks nothing. A case's `answers` are what the host answered, each the question (`plugin`, `args`) with its `value`, or `unreachable` and why. A host function no answer is given for makes the verdict `{asks: [{plugin, args}]}`: the first question the judge reached, asked only once every term before it passed; the host answers it and judges again. One the host could not answer is `{undecided: reason, unreachable: plugin}`, kept unjudged and retried.",
|
|
2
|
+
"about": "Whether an arrival fires a listen, by its plan's filters. Each plan is the checker's answer for its listen's source against `catalog` (both runners check that it still is). Hops judged on arrival are judged, each against the record the arrival carries for it: `landing` for the last hop, `parents` (aligned to the plan's `carries`) for earlier ones; where the record in a hop's place is missing or of another record type, the one of the hop's own record type is read (the k-th, for the k-th hop on an edge name), so a module may carry more records than a path declares, in another order (plan `positioned`), and only with none of that type does the record in its place skip by its type. So is a hop the host resolves by listing (`resolved`) whose edge the plan's `carries` names: the carried record is preferred to the listing, so a host that lists no members judges it all the same; any other resolved hop is the host's scope check, not judged here: the host lists that hop's members, keeps those that match, and hands the judge only an arrival under one of them, saying so (`scoped`, as listen-fire does). An arrival not `scoped` on such a plan is undecided, since the judge cannot see that hop's record (plan `twins`: a hit by the cursed sword and one by its uncursed twin look alike), unless another hop fails it. Each record states its `recordType`, which must be the record type its hop lands on (`to`): one edge name may hang off several record types (`pay`'s Customer and Invoice each have `Changes`), and a record of another type skips at its hop, the landing judged first; a record that states none is undecided. A hop's checked part is always evaluated; its taken part too, unless `takenApplied` says the module applied it. `now` is the instant WITHIN measures from. The verdict is `{fires: true}`, `{skips: n}` (the hop whose filter fails, outermost 0; with a `reason` when the record carried for that hop is of another record type, so no filter was read), or `{undecided: reason}` (the host logs it and runs nothing). A listen through or onto a union is one plan holding each member's traversal (`members`), judged once: it fires when one member's does, a record of another member's type being that member's to decide; it is undecided when one member cannot tell; it skips when every member does, by a filter when one member's record types matched, else by type, naming every member's. Held by listen-fire's Rust (crates/movement-engine/src/listen_judge.rs, judge_arrival), the engine's TypeScript (judgeArrival, through the wasm) and the hosted product. A read on through a record a field holds (`c.Current.Stage`) reads that field of the landing, then the member of what it holds; a record absent reads its members absent. The checker has the listen test a record present before it reads through it (`exists(c.Current) AND c.Current.Stage == …`), and an operand of AND or OR is read only when the operands before it leave the answer open, so a read the test guards is never read on an absent record. A record may name the fields its module could not read (`unknown`): a part of the filter reading one is undecided, whatever `fields` holds for it, never read as absent; AND, OR and NOT are three-valued, so an OR one side holds holds and an AND one side fails fails, in either order; a hop that fails still decides. A filter may call a pure function: a standard library one is evaluated; a host function, named by its catalog key (`@lf-platform/team/isMember`), is the host's to answer; a field read off its answer (`team.userFor(e)?.Level`, a `field` node) is absent when it answers no record, and compares as any absent value does. The plan puts every term that asks no host first in each AND and OR, and the taken part is read before the checked part's host terms, so a local term that decides the verdict asks nothing. A case's `answers` are what the host answered, each the question (`plugin`, `args`) with its `value`, or `unreachable` and why. A host function no answer is given for makes the verdict `{asks: [{plugin, args}]}`: the first question the judge reached, asked only once every term before it passed; the host answers it and judges again. One the host could not answer is `{undecided: reason, unreachable: plugin}`, kept unjudged and retried.",
|
|
3
3
|
"catalog": {
|
|
4
4
|
"adapters": {
|
|
5
5
|
"chat": {
|
|
@@ -762,6 +762,59 @@
|
|
|
762
762
|
"writableRoots": {}
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
+
},
|
|
766
|
+
"world": {
|
|
767
|
+
"canFire": false,
|
|
768
|
+
"constructionArgs": [],
|
|
769
|
+
"schemas": {
|
|
770
|
+
"": {
|
|
771
|
+
"positions": {
|
|
772
|
+
"Thing": {
|
|
773
|
+
"properties": {
|
|
774
|
+
"Id": "text",
|
|
775
|
+
"Name": "text",
|
|
776
|
+
"Tag": "text"
|
|
777
|
+
},
|
|
778
|
+
"edges": {
|
|
779
|
+
"HitsDealt": {
|
|
780
|
+
"target": "Hit",
|
|
781
|
+
"readable": false,
|
|
782
|
+
"listenable": true,
|
|
783
|
+
"identity": "Id",
|
|
784
|
+
"delivery": "scope"
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
"propertyCapabilities": {
|
|
788
|
+
"Tag": {
|
|
789
|
+
"filterOperators": [
|
|
790
|
+
"eq"
|
|
791
|
+
]
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
"Hit": {
|
|
796
|
+
"properties": {
|
|
797
|
+
"Id": "text",
|
|
798
|
+
"Damage": "number"
|
|
799
|
+
},
|
|
800
|
+
"edges": {}
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
"collections": {
|
|
804
|
+
"Things": {
|
|
805
|
+
"target": "Thing",
|
|
806
|
+
"membersChange": {
|
|
807
|
+
"relistEverySeconds": 300
|
|
808
|
+
},
|
|
809
|
+
"capability": {
|
|
810
|
+
"filter": "native",
|
|
811
|
+
"supportsLimit": false
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
},
|
|
815
|
+
"writableRoots": {}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
765
818
|
}
|
|
766
819
|
},
|
|
767
820
|
"credentials": {},
|
|
@@ -1152,6 +1205,43 @@
|
|
|
1152
1205
|
"movement": "changed"
|
|
1153
1206
|
}
|
|
1154
1207
|
},
|
|
1208
|
+
"twins": {
|
|
1209
|
+
"source": "import { world as world_module } from adapters; world = connect world_module\nfunction struck(h: <world-[:Hit]->>) { return h.Damage }\nlisten to world-[t:Things WHERE t.Tag == \"cursed\"]->-[h:HitsDealt]-> fire struck\n",
|
|
1210
|
+
"plan": {
|
|
1211
|
+
"adapter": "world",
|
|
1212
|
+
"connection": "world",
|
|
1213
|
+
"hops": [
|
|
1214
|
+
{
|
|
1215
|
+
"alias": "t",
|
|
1216
|
+
"edge": "Things",
|
|
1217
|
+
"from": "",
|
|
1218
|
+
"judged": "resolved",
|
|
1219
|
+
"taken": {
|
|
1220
|
+
"left": {
|
|
1221
|
+
"fieldOnly": true,
|
|
1222
|
+
"propertyTypeId": "Tag",
|
|
1223
|
+
"type": "edge_property"
|
|
1224
|
+
},
|
|
1225
|
+
"op": "eq",
|
|
1226
|
+
"right": {
|
|
1227
|
+
"type": "static",
|
|
1228
|
+
"value": "cursed"
|
|
1229
|
+
},
|
|
1230
|
+
"type": "compare"
|
|
1231
|
+
},
|
|
1232
|
+
"to": "Thing"
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
"alias": "h",
|
|
1236
|
+
"edge": "HitsDealt",
|
|
1237
|
+
"from": "Thing",
|
|
1238
|
+
"judged": "arrival",
|
|
1239
|
+
"to": "Hit"
|
|
1240
|
+
}
|
|
1241
|
+
],
|
|
1242
|
+
"movement": "struck"
|
|
1243
|
+
}
|
|
1244
|
+
},
|
|
1155
1245
|
"invoices": {
|
|
1156
1246
|
"source": "import { gmail as gmail_module } from adapters; mail = connect gmail_module\nfunction filed(e: <mail-[:Message]->>) { return e.Subject }\nlisten to mail-[e:Messages WHERE e.Query == \"from:acme\" AND e.Subject CONTAINS \"invoice\"]-> fire filed\n",
|
|
1157
1247
|
"plan": {
|
|
@@ -2306,7 +2396,8 @@
|
|
|
2306
2396
|
"cases": [
|
|
2307
2397
|
{"case": "a press on a lunch poll fires", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}, {"recordType": "Message", "fields": {"Topic": "lunch-poll", "Posted At": "2026-10-30T10:00:00Z"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2308
2398
|
{"case": "a press on a poll older than 3d skips at Messages", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}, {"recordType": "Message", "fields": {"Topic": "lunch-poll", "Posted At": "2026-10-27T09:00:00Z"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2309
|
-
{"case": "a change of another kind skips at Changes", "plan": "changes", "arrival": {"edge": "Changes", "key": "c2", "landing": {"recordType": "Change", "fields": {"Id": "c2", "Kind": "updated"}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 2}},
|
|
2399
|
+
{"case": "a change of another kind skips at Changes", "plan": "changes", "arrival": {"edge": "Changes", "key": "c2", "landing": {"recordType": "Change", "fields": {"Id": "c2", "Kind": "updated"}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 2}},
|
|
2400
|
+
{"case": "a change of another kind skips at Changes though its host did not say it scoped the arrival: a hop that fails decides", "plan": "changes", "arrival": {"edge": "Changes", "key": "c2", "landing": {"recordType": "Change", "fields": {"Id": "c2", "Kind": "updated"}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 2}},
|
|
2310
2401
|
{"case": "a press carrying no message is undecided", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the arrival carries no Messages record, which this listen's filter on it reads"}},
|
|
2311
2402
|
{"case": "a press carrying null for its message is undecided", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}, null]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the arrival carries no Messages record, which this listen's filter on it reads"}},
|
|
2312
2403
|
{"case": "a pushed press its module did not filter, in another channel, skips at Channels", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "random"}}, {"recordType": "Message", "fields": {"Topic": "lunch-poll", "Posted At": "2026-10-30T10:00:00Z"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 0}},
|
|
@@ -2315,7 +2406,10 @@
|
|
|
2315
2406
|
{"case": "a press its module filtered is still checked: an old poll skips at Messages", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "random"}}, {"recordType": "Message", "fields": {"Topic": "lunch-poll", "Posted At": "2026-10-27T09:00:00Z"}}], "takenApplied": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2316
2407
|
{"case": "a later hop that fails decides over a parent the arrival lacks", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1", "Value": "skip"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 2}},
|
|
2317
2408
|
{"case": "an arrival on another edge skips at the last hop", "plan": "lunch", "arrival": {"edge": "Reactions", "landing": {"recordType": "Interaction", "fields": {"Id": "r1"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}, {"recordType": "Message", "fields": {"Topic": "lunch-poll", "Posted At": "2026-10-30T10:00:00Z"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 2}},
|
|
2318
|
-
{"case": "a created change fires: the hops the host resolves are not judged here", "plan": "changes", "arrival": {"edge": "Changes", "key": "c1", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2409
|
+
{"case": "a created change fires: the hops the host resolves are not judged here", "plan": "changes", "arrival": {"edge": "Changes", "key": "c1", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2410
|
+
{"case": "a hit dealt by the cursed sword, its host not saying it kept the arrival to the cursed things it lists, is undecided: the arrival does not carry the sword", "plan": "twins", "arrival": {"edge": "HitsDealt", "key": "sword-cursed", "landing": {"recordType": "Hit", "fields": {"Id": "hit-sword-cursed", "Damage": 7}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the listen that fires struck filters `Things` by a WHERE its module's arrivals do not carry the record for: only a host that lists those members, and keeps this arrival to the ones that match, can judge it, and this one did not say it did (`scoped`)"}},
|
|
2411
|
+
{"case": "a hit dealt by its uncursed twin is undecided alike, never fired: the judge cannot tell the twins apart", "plan": "twins", "arrival": {"edge": "HitsDealt", "key": "sword-plain", "landing": {"recordType": "Hit", "fields": {"Id": "hit-sword-plain", "Damage": 7}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the listen that fires struck filters `Things` by a WHERE its module's arrivals do not carry the record for: only a host that lists those members, and keeps this arrival to the ones that match, can judge it, and this one did not say it did (`scoped`)"}},
|
|
2412
|
+
{"case": "a hit dealt by the cursed sword fires once its host says it kept the arrival to the things it lists (scoped): the host, listing Things WHERE Tag == \"cursed\", hands the judge no hit by the twin", "plan": "twins", "arrival": {"edge": "HitsDealt", "key": "sword-cursed", "landing": {"recordType": "Hit", "fields": {"Id": "hit-sword-cursed", "Damage": 7}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2319
2413
|
{"case": "a press whose value is its message's topic fires", "plan": "echo", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1", "Value": "lunch-poll"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}, {"recordType": "Message", "fields": {"Topic": "lunch-poll"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2320
2414
|
{"case": "a press whose value is not its message's topic skips at Interactions", "plan": "echo", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1", "Value": "standup"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}, {"recordType": "Message", "fields": {"Topic": "lunch-poll"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 2}},
|
|
2321
2415
|
{"case": "a press whose filter reads a message it does not carry is undecided", "plan": "echo", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1", "Value": "lunch-poll"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the arrival carries no Messages record, which this listen's filter on it reads"}},
|
|
@@ -2344,30 +2438,30 @@
|
|
|
2344
2438
|
{"case": "a change that does not say its record type is undecided", "plan": "customers", "arrival": {"edge": "Changes", "key": "cus_1", "landing": {"fields": {"Id": "evt_1", "Kind": "created"}}, "parents": [{"recordType": "Customer", "fields": {"Id": "cus_1", "Name": "Acme"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the arrival pay reported on Changes does not say its record type, so it cannot be told from another record type's Changes (this listen's lands on CustomerChange)"}},
|
|
2345
2439
|
{"case": "a change whose carried customer does not say its record type is undecided", "plan": "customers", "arrival": {"edge": "Changes", "key": "cus_1", "landing": {"recordType": "CustomerChange", "fields": {"Id": "evt_1", "Kind": "created"}}, "parents": [{"fields": {"Id": "cus_1", "Name": "Acme"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the arrival pay reported on Changes carries a Customers record that does not say its record type (this listen's Customers lands on Customer)"}},
|
|
2346
2440
|
{"case": "an untyped change that fails a WHERE still skips", "plan": "customers", "arrival": {"edge": "Changes", "key": "cus_1", "landing": {"fields": {"Id": "evt_1", "Kind": "deleted"}}, "parents": [{"recordType": "Customer", "fields": {"Id": "cus_1", "Name": "Acme"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2347
|
-
{"case": "a row moved from Applied to Interview fires the listen reading through the rows a change holds; the Candidates change lands as the table's un-narrowed Change", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "7:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2348
|
-
{"case": "a row created at Interview fires: it held nothing before", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "8:recBO", "Kind": "created", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2349
|
-
{"case": "a row edited while it stays at Interview does not", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "9:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada L.", "Stage": "Interview"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2350
|
-
{"case": "a row moved to Rejected does not", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "10:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Rejected"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2351
|
-
{"case": "a row deleted holds nothing now, and does not", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "11:recADA", "Kind": "deleted"}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2352
|
-
{"case": "a NOT over a field its module could not read stays undecided: the row moved to Interview, what it held before not read", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "20:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}, "unknown": ["Previous"]}}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "rows could not read Previous of the arrival on Changes, which this listen's filter reads"}},
|
|
2353
|
-
{"case": "a field whose name holds a dot is not a read through a held row", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "12:recADA", "Kind": "updated", "Current.Stage": "Interview", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2441
|
+
{"case": "a row moved from Applied to Interview fires the listen reading through the rows a change holds; the Candidates change lands as the table's un-narrowed Change", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "7:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2442
|
+
{"case": "a row created at Interview fires: it held nothing before", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "8:recBO", "Kind": "created", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2443
|
+
{"case": "a row edited while it stays at Interview does not", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "9:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada L.", "Stage": "Interview"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2444
|
+
{"case": "a row moved to Rejected does not", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "10:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Rejected"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2445
|
+
{"case": "a row deleted holds nothing now, and does not", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "11:recADA", "Kind": "deleted"}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2446
|
+
{"case": "a NOT over a field its module could not read stays undecided: the row moved to Interview, what it held before not read", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "20:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}, "unknown": ["Previous"]}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "rows could not read Previous of the arrival on Changes, which this listen's filter reads"}},
|
|
2447
|
+
{"case": "a field whose name holds a dot is not a read through a held row", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "12:recADA", "Kind": "updated", "Current.Stage": "Interview", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2354
2448
|
{"case": "a press whose channel name its module could not read is undecided, never skipped", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}}, "parents": [{"recordType": "Channel", "fields": {"Id": "C1"}, "unknown": ["Name"]}, {"recordType": "Message", "fields": {"Topic": "lunch-poll", "Posted At": "2026-10-30T10:00:00Z"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "chat could not read Name of the Channels record the arrival carries, which this listen's filter reads"}},
|
|
2355
2449
|
{"case": "a value a field holds is not read when its module says it could not read the field", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}, "unknown": ["Name"]}, {"recordType": "Message", "fields": {"Topic": "lunch-poll", "Posted At": "2026-10-30T10:00:00Z"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "chat could not read Name of the Channels record the arrival carries, which this listen's filter reads"}},
|
|
2356
2450
|
{"case": "a field its module could not read that no filter reads changes nothing", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}, "unknown": ["By"]}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}, {"recordType": "Message", "fields": {"Topic": "lunch-poll", "Posted At": "2026-10-30T10:00:00Z"}, "unknown": ["Mentions App"]}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2357
2451
|
{"case": "a press whose own value its module could not read is undecided at Interactions", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}, "unknown": ["Value"]}, "parents": [{"recordType": "Channel", "fields": {"Name": "office"}}, {"recordType": "Message", "fields": {"Topic": "lunch-poll", "Posted At": "2026-10-30T10:00:00Z"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "chat could not read Value of the arrival on Interactions, which this listen's filter reads"}},
|
|
2358
2452
|
{"case": "a hop that fails decides over a field its module could not read", "plan": "lunch", "arrival": {"edge": "Interactions", "landing": {"recordType": "Interaction", "fields": {"Id": "t1"}}, "parents": [{"recordType": "Channel", "fields": {"Id": "C1"}, "unknown": ["Name"]}, {"recordType": "Message", "fields": {"Topic": "standup", "Posted At": "2026-10-30T10:00:00Z"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2359
|
-
{"case": "a deleted row (neither row held) does not fire: the listen tests each row before it reads through it", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "14:recADA", "Kind": "deleted"}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2360
|
-
{"case": "a field change: a row moved from Applied to Interview changed Stage", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "15:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2361
|
-
{"case": "a field change: a row edited with Stage unchanged did not", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "16:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada L.", "Stage": "Applied"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2362
|
-
{"case": "a field change: a row created holding Stage changed it, as in 0.12", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "17:recADA", "Kind": "created", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2363
|
-
{"case": "a field change: a row created without Stage did not", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "18:recADA", "Kind": "created", "Current": {"Id": "recADA", "Name": "Ada"}}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2364
|
-
{"case": "a field change: a row deleted (neither row held) did not", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "19:recADA", "Kind": "deleted"}}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2365
|
-
{"case": "a read through a held row its module could not read is undecided", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "13:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}, "unknown": ["Previous"]}}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "rows could not read Previous of the arrival on Changes, which this listen's filter reads"}},
|
|
2366
|
-
{"case": "an OR one side holds fires though its other side could not be read, that side first", "plan": "either", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "1:recA"}, "unknown": ["Kind"]}}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2367
|
-
{"case": "an OR one side holds fires though its other side could not be read, that side second", "plan": "either", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Kind": "created"}, "unknown": ["Id"]}}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2368
|
-
{"case": "an OR no side holds, one side unread, is undecided", "plan": "either", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "2:recB"}, "unknown": ["Kind"]}}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "rows could not read Kind of the arrival on Changes, which this listen's filter reads"}},
|
|
2369
|
-
{"case": "an AND one side fails fails though its other side could not be read, in either order", "plan": "neither", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Kind": "created"}, "unknown": ["Id"]}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2370
|
-
{"case": "an AND one side fails fails though its other side could not be read, the unread field the other", "plan": "neither", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "z"}, "unknown": ["Kind"]}}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2453
|
+
{"case": "a deleted row (neither row held) does not fire: the listen tests each row before it reads through it", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "14:recADA", "Kind": "deleted"}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2454
|
+
{"case": "a field change: a row moved from Applied to Interview changed Stage", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "15:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2455
|
+
{"case": "a field change: a row edited with Stage unchanged did not", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "16:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada L.", "Stage": "Applied"}, "Previous": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2456
|
+
{"case": "a field change: a row created holding Stage changed it, as in 0.12", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "17:recADA", "Kind": "created", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Applied"}}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2457
|
+
{"case": "a field change: a row created without Stage did not", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "18:recADA", "Kind": "created", "Current": {"Id": "recADA", "Name": "Ada"}}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2458
|
+
{"case": "a field change: a row deleted (neither row held) did not", "plan": "restaged", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "19:recADA", "Kind": "deleted"}}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2459
|
+
{"case": "a read through a held row its module could not read is undecided", "plan": "moved", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "13:recADA", "Kind": "updated", "Current": {"Id": "recADA", "Name": "Ada", "Stage": "Interview"}}, "unknown": ["Previous"]}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "rows could not read Previous of the arrival on Changes, which this listen's filter reads"}},
|
|
2460
|
+
{"case": "an OR one side holds fires though its other side could not be read, that side first", "plan": "either", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "1:recA"}, "unknown": ["Kind"]}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2461
|
+
{"case": "an OR one side holds fires though its other side could not be read, that side second", "plan": "either", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Kind": "created"}, "unknown": ["Id"]}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2462
|
+
{"case": "an OR no side holds, one side unread, is undecided", "plan": "either", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "2:recB"}, "unknown": ["Kind"]}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "rows could not read Kind of the arrival on Changes, which this listen's filter reads"}},
|
|
2463
|
+
{"case": "an AND one side fails fails though its other side could not be read, in either order", "plan": "neither", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Kind": "created"}, "unknown": ["Id"]}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2464
|
+
{"case": "an AND one side fails fails though its other side could not be read, the unread field the other", "plan": "neither", "arrival": {"edge": "Changes", "key": "tblCAND01", "landing": {"recordType": "Change", "fields": {"Id": "z"}, "unknown": ["Kind"]}, "scoped": true}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2371
2465
|
{"case": "a listen through a union: a note under a Person fires, judged by the Person's traversal", "plan": "subjects", "arrival": {"edge": "Notes", "key": "p1", "landing": {"recordType": "Note", "fields": {"Id": "n1", "Text": "hi"}}, "parents": [{"recordType": "Person", "fields": {"Name": "Acme"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2372
2466
|
{"case": "a listen through a union: a note under a Company fires the same listen, judged by the Company's", "plan": "subjects", "arrival": {"edge": "Notes", "key": "c1", "landing": {"recordType": "Note", "fields": {"Id": "n2", "Text": "hi"}}, "parents": [{"recordType": "Company", "fields": {"Name": "Acme"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2373
2467
|
{"case": "a listen through a union: a note under a Company of another name skips at Subjects by the filter, not by type", "plan": "subjects", "arrival": {"edge": "Notes", "key": "c2", "landing": {"recordType": "Note", "fields": {"Id": "n3", "Text": "hi"}}, "parents": [{"recordType": "Company", "fields": {"Name": "Other"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 0}},
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Span } from '@listen-fire/movement-lang';
|
|
3
|
+
import type { Expression } from './expression/expression';
|
|
4
|
+
export interface WalkHop {
|
|
5
|
+
edge: string;
|
|
6
|
+
/** `incoming` for a hop written `<-[:E]-`; absent for an outgoing one. */
|
|
7
|
+
direction?: 'incoming';
|
|
8
|
+
/** The record type the hop leaves: empty off the connection (one of its
|
|
9
|
+
* root collections), as a plan's; absent where the walk stands on several
|
|
10
|
+
* record types at once (on through a union's members). */
|
|
11
|
+
from?: string;
|
|
12
|
+
/** The record type, or the union, it lands on; absent where it lands on
|
|
13
|
+
* several. */
|
|
14
|
+
to?: string;
|
|
15
|
+
alias?: string;
|
|
16
|
+
/** Its WHERE, whole. */
|
|
17
|
+
filter?: Expression;
|
|
18
|
+
}
|
|
19
|
+
export interface FunctionWalk {
|
|
20
|
+
/** The function it is written in, by its name in the program. */
|
|
21
|
+
movement: string;
|
|
22
|
+
/** The connection it starts from, by its name in the program. */
|
|
23
|
+
connection: string;
|
|
24
|
+
/** That connection's module. */
|
|
25
|
+
adapter: string;
|
|
26
|
+
/** Outermost first, up to its last edge. */
|
|
27
|
+
hops: WalkHop[];
|
|
28
|
+
/** A wait (`await x-[:E]->`): answered by what arrives on its last edge,
|
|
29
|
+
* its WHERE judged by the host, never sent. Absent for a read. */
|
|
30
|
+
awaited?: true;
|
|
31
|
+
/** The expression or statement head it is written in. */
|
|
32
|
+
span: Span;
|
|
33
|
+
}
|
|
34
|
+
export declare const walkHopSchema: z.ZodType<WalkHop>;
|
|
35
|
+
export declare const functionWalkSchema: z.ZodType<FunctionWalk>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// The walks each function of a program makes from a connection, as its check
|
|
3
|
+
// answers them (`walks`, crates/movement-checker/src/walk_list.rs): which
|
|
4
|
+
// lookups a host's modules will be asked, read as a listen's plan is read,
|
|
5
|
+
// never by scanning the source. A walk is the checker's own, so one written
|
|
6
|
+
// in `exists(…)`, in a call's argument, in a hop's WHERE or in a closure is
|
|
7
|
+
// listed, and text in a string never is.
|
|
8
|
+
//
|
|
9
|
+
// Each hop is written as a listen plan's (`PlanHop`): its edge, the record
|
|
10
|
+
// types it leaves and lands on, its alias, and its WHERE whole. The engine
|
|
11
|
+
// hands that WHERE to the module only when it is pure (`isPurePredicate`: it
|
|
12
|
+
// calls no function and walks no edge), and checks it on what comes back
|
|
13
|
+
// otherwise.
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.functionWalkSchema = exports.walkHopSchema = void 0;
|
|
16
|
+
const zod_1 = require("zod");
|
|
17
|
+
const expression_1 = require("./expression/expression");
|
|
18
|
+
const locSchema = zod_1.z.object({ line: zod_1.z.number(), col: zod_1.z.number() }).strict();
|
|
19
|
+
exports.walkHopSchema = zod_1.z
|
|
20
|
+
.object({
|
|
21
|
+
edge: zod_1.z.string(),
|
|
22
|
+
direction: zod_1.z.literal('incoming').optional(),
|
|
23
|
+
from: zod_1.z.string().optional(),
|
|
24
|
+
to: zod_1.z.string().optional(),
|
|
25
|
+
alias: zod_1.z.string().optional(),
|
|
26
|
+
filter: expression_1.listenFilterSchema.optional(),
|
|
27
|
+
})
|
|
28
|
+
.strict();
|
|
29
|
+
exports.functionWalkSchema = zod_1.z
|
|
30
|
+
.object({
|
|
31
|
+
movement: zod_1.z.string(),
|
|
32
|
+
connection: zod_1.z.string(),
|
|
33
|
+
adapter: zod_1.z.string(),
|
|
34
|
+
hops: zod_1.z.array(exports.walkHopSchema).min(1),
|
|
35
|
+
awaited: zod_1.z.literal(true).optional(),
|
|
36
|
+
span: zod_1.z.object({ start: locSchema, end: locSchema }).strict(),
|
|
37
|
+
})
|
|
38
|
+
.strict();
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from './expression/expression';
|
|
|
8
8
|
export * from './expression/schemas';
|
|
9
9
|
export type { FilterOperator, TraversalStep } from './expression/schemas';
|
|
10
10
|
export * from './file_ref';
|
|
11
|
+
export * from './function_walk';
|
|
11
12
|
export * from './guids';
|
|
12
13
|
export * from './handbook_section';
|
|
13
14
|
export * from './host_families';
|
package/dist/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __exportStar(require("./event"), exports);
|
|
|
33
33
|
__exportStar(require("./expression/expression"), exports);
|
|
34
34
|
__exportStar(require("./expression/schemas"), exports);
|
|
35
35
|
__exportStar(require("./file_ref"), exports);
|
|
36
|
+
__exportStar(require("./function_walk"), exports);
|
|
36
37
|
__exportStar(require("./guids"), exports);
|
|
37
38
|
__exportStar(require("./handbook_section"), exports);
|
|
38
39
|
__exportStar(require("./host_families"), exports);
|
package/dist/listen_plan.d.ts
CHANGED
|
@@ -2,7 +2,11 @@ import { z } from 'zod';
|
|
|
2
2
|
import type { Expression } from './expression/expression';
|
|
3
3
|
/** How the host honours a hop's filter: nothing to judge; judged on each
|
|
4
4
|
* arrival against the record it carries (the last hop always is); or by
|
|
5
|
-
* listing the hop's members and keeping those that match.
|
|
5
|
+
* listing the hop's members and keeping those that match (`resolved`). A
|
|
6
|
+
* `resolved` hop promises only that its members can be listed again
|
|
7
|
+
* cheaply: the judge judges it on an arrival that carries its record
|
|
8
|
+
* (`carries`), and otherwise the host does, handing the judge only the
|
|
9
|
+
* arrivals under the members it kept (`PlanArrival.scoped`). */
|
|
6
10
|
export declare const hopJudgedSchema: z.ZodEnum<{
|
|
7
11
|
arrival: "arrival";
|
|
8
12
|
none: "none";
|
|
@@ -91,6 +95,12 @@ export interface PlanArrival {
|
|
|
91
95
|
/** Its module applied the plan's taken parts (a filtered poll or
|
|
92
96
|
* subscription). Absent or false, the judge evaluates them too. */
|
|
93
97
|
takenApplied?: boolean;
|
|
98
|
+
/** Its host kept it to the records the plan's `resolved` hops list: it
|
|
99
|
+
* listed each such hop's members, kept those that match, and hands the
|
|
100
|
+
* judge only an arrival under one of them, as listen-fire does. Absent or
|
|
101
|
+
* false, a `resolved` hop whose record the arrival does not carry cannot
|
|
102
|
+
* be judged, and the arrival is undecided. */
|
|
103
|
+
scoped?: boolean;
|
|
94
104
|
}
|
|
95
105
|
/** A record an arrival carries, its landing or a parent: the record type its
|
|
96
106
|
* module says it is, as the catalog names it, and its fields. One edge name
|
package/dist/listen_plan.js
CHANGED
|
@@ -16,7 +16,11 @@ const zod_1 = require("zod");
|
|
|
16
16
|
const expression_1 = require("./expression/expression");
|
|
17
17
|
/** How the host honours a hop's filter: nothing to judge; judged on each
|
|
18
18
|
* arrival against the record it carries (the last hop always is); or by
|
|
19
|
-
* listing the hop's members and keeping those that match.
|
|
19
|
+
* listing the hop's members and keeping those that match (`resolved`). A
|
|
20
|
+
* `resolved` hop promises only that its members can be listed again
|
|
21
|
+
* cheaply: the judge judges it on an arrival that carries its record
|
|
22
|
+
* (`carries`), and otherwise the host does, handing the judge only the
|
|
23
|
+
* arrivals under the members it kept (`PlanArrival.scoped`). */
|
|
20
24
|
exports.hopJudgedSchema = zod_1.z.enum(['none', 'arrival', 'resolved']);
|
|
21
25
|
/** The single-typed traversals a host watches a listen by: the plan itself,
|
|
22
26
|
* or, for a listen over a union, one per member, each a plan of that
|
|
@@ -78,6 +82,7 @@ exports.planArrivalSchema = zod_1.z
|
|
|
78
82
|
landing: arrivedRecordSchema,
|
|
79
83
|
parents: zod_1.z.array(arrivedRecordSchema.nullable()).optional(),
|
|
80
84
|
takenApplied: zod_1.z.boolean().optional(),
|
|
85
|
+
scoped: zod_1.z.boolean().optional(),
|
|
81
86
|
})
|
|
82
87
|
.strict();
|
|
83
88
|
exports.verdictSchema = zod_1.z.union([
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@listen-fire/engine-contracts",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.1",
|
|
5
5
|
"description": "The contracts the movement engine speaks: the tenant id, the host families and entry-point inputs, the parked state, file descriptors, the adapter protocol, the adapter contract and its manifest, the catalog's schema types and positions, the Expression vocabulary, plugins as data and the model names. Runtime-neutral: no Node import, no ambient types.",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=22.23.4 <23"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"type": "commonjs",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"zod": "4.1.12",
|
|
33
|
-
"@listen-fire/movement-lang": "^0.16.
|
|
33
|
+
"@listen-fire/movement-lang": "^0.16.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "20.16.5",
|