@listen-fire/engine-contracts 0.14.1 → 0.14.2
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.
|
@@ -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).
|
|
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.",
|
|
3
3
|
"catalog": {
|
|
4
4
|
"adapters": {
|
|
5
5
|
"chat": {
|
|
@@ -103,6 +103,138 @@
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
|
+
"air": {
|
|
107
|
+
"canFire": false,
|
|
108
|
+
"constructionArgs": [],
|
|
109
|
+
"schemas": {
|
|
110
|
+
"": {
|
|
111
|
+
"positions": {
|
|
112
|
+
"Base": {
|
|
113
|
+
"properties": {
|
|
114
|
+
"Name": "text"
|
|
115
|
+
},
|
|
116
|
+
"edges": {
|
|
117
|
+
"Tables": {
|
|
118
|
+
"target": "Table",
|
|
119
|
+
"membersChange": "pushed",
|
|
120
|
+
"capability": {
|
|
121
|
+
"filter": "native",
|
|
122
|
+
"supportsLimit": false
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"propertyCapabilities": {
|
|
127
|
+
"Name": {
|
|
128
|
+
"filterOperators": [
|
|
129
|
+
"eq"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"Table": {
|
|
135
|
+
"properties": {
|
|
136
|
+
"Name": "text"
|
|
137
|
+
},
|
|
138
|
+
"edges": {
|
|
139
|
+
"Changes": {
|
|
140
|
+
"target": "Change",
|
|
141
|
+
"readable": false,
|
|
142
|
+
"listenable": true,
|
|
143
|
+
"identity": "Id",
|
|
144
|
+
"delivery": "scope",
|
|
145
|
+
"carries": [
|
|
146
|
+
"Bases",
|
|
147
|
+
"Tables"
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"propertyCapabilities": {
|
|
152
|
+
"Name": {
|
|
153
|
+
"filterOperators": [
|
|
154
|
+
"eq"
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"Change": {
|
|
160
|
+
"properties": {
|
|
161
|
+
"Id": "text",
|
|
162
|
+
"Kind": "text"
|
|
163
|
+
},
|
|
164
|
+
"edges": {}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"collections": {
|
|
168
|
+
"Bases": {
|
|
169
|
+
"target": "Base",
|
|
170
|
+
"membersChange": {
|
|
171
|
+
"relistEverySeconds": 300
|
|
172
|
+
},
|
|
173
|
+
"capability": {
|
|
174
|
+
"filter": "native",
|
|
175
|
+
"supportsLimit": false
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"writableRoots": {}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"hiring": {
|
|
184
|
+
"canFire": false,
|
|
185
|
+
"constructionArgs": [],
|
|
186
|
+
"schemas": {
|
|
187
|
+
"": {
|
|
188
|
+
"positions": {
|
|
189
|
+
"Table": {
|
|
190
|
+
"properties": {
|
|
191
|
+
"Name": "text"
|
|
192
|
+
},
|
|
193
|
+
"edges": {
|
|
194
|
+
"Changes": {
|
|
195
|
+
"target": "Change",
|
|
196
|
+
"readable": false,
|
|
197
|
+
"listenable": true,
|
|
198
|
+
"identity": "Id",
|
|
199
|
+
"delivery": "connection",
|
|
200
|
+
"carries": [
|
|
201
|
+
"Tables"
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"propertyCapabilities": {
|
|
206
|
+
"Name": {
|
|
207
|
+
"filterOperators": [
|
|
208
|
+
"eq"
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"Change": {
|
|
214
|
+
"properties": {
|
|
215
|
+
"Id": "text",
|
|
216
|
+
"Kind": "text"
|
|
217
|
+
},
|
|
218
|
+
"edges": {}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"collections": {
|
|
222
|
+
"Tables": {
|
|
223
|
+
"target": "Table",
|
|
224
|
+
"membersChange": "pushed",
|
|
225
|
+
"listenable": true,
|
|
226
|
+
"identity": "Id",
|
|
227
|
+
"delivery": "connection",
|
|
228
|
+
"capability": {
|
|
229
|
+
"filter": "native",
|
|
230
|
+
"supportsLimit": false
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"writableRoots": {}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
},
|
|
106
238
|
"at": {
|
|
107
239
|
"canFire": false,
|
|
108
240
|
"constructionArgs": [],
|
|
@@ -730,6 +862,107 @@
|
|
|
730
862
|
"movement": "echo"
|
|
731
863
|
}
|
|
732
864
|
},
|
|
865
|
+
"carried": {
|
|
866
|
+
"source": "import { air as air_module } from adapters; air = connect air_module\nfunction changed(x: <air-[:Change]->>) { return x.Kind }\nlisten to air-[b:Bases WHERE b.Name == \"Hiring\"]->-[t:Tables WHERE t.Name == \"Deals\"]->-[x:Changes]-> fire changed\n",
|
|
867
|
+
"plan": {
|
|
868
|
+
"adapter": "air",
|
|
869
|
+
"carries": [
|
|
870
|
+
"Bases",
|
|
871
|
+
"Tables"
|
|
872
|
+
],
|
|
873
|
+
"connection": "air",
|
|
874
|
+
"hops": [
|
|
875
|
+
{
|
|
876
|
+
"alias": "b",
|
|
877
|
+
"edge": "Bases",
|
|
878
|
+
"from": "",
|
|
879
|
+
"judged": "resolved",
|
|
880
|
+
"taken": {
|
|
881
|
+
"left": {
|
|
882
|
+
"fieldOnly": true,
|
|
883
|
+
"propertyTypeId": "Name",
|
|
884
|
+
"type": "edge_property"
|
|
885
|
+
},
|
|
886
|
+
"op": "eq",
|
|
887
|
+
"right": {
|
|
888
|
+
"type": "static",
|
|
889
|
+
"value": "Hiring"
|
|
890
|
+
},
|
|
891
|
+
"type": "compare"
|
|
892
|
+
},
|
|
893
|
+
"to": "Base"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"alias": "t",
|
|
897
|
+
"edge": "Tables",
|
|
898
|
+
"from": "Base",
|
|
899
|
+
"judged": "resolved",
|
|
900
|
+
"taken": {
|
|
901
|
+
"left": {
|
|
902
|
+
"fieldOnly": true,
|
|
903
|
+
"propertyTypeId": "Name",
|
|
904
|
+
"type": "edge_property"
|
|
905
|
+
},
|
|
906
|
+
"op": "eq",
|
|
907
|
+
"right": {
|
|
908
|
+
"type": "static",
|
|
909
|
+
"value": "Deals"
|
|
910
|
+
},
|
|
911
|
+
"type": "compare"
|
|
912
|
+
},
|
|
913
|
+
"to": "Table"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"alias": "x",
|
|
917
|
+
"edge": "Changes",
|
|
918
|
+
"from": "Table",
|
|
919
|
+
"judged": "arrival",
|
|
920
|
+
"to": "Change"
|
|
921
|
+
}
|
|
922
|
+
],
|
|
923
|
+
"movement": "changed"
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
"positioned": {
|
|
927
|
+
"source": "import { hiring as hiring_module } from adapters; hiring = connect hiring_module\nfunction changed(x: <hiring-[:Change]->>) { return x.Kind }\nlisten to hiring-[t:Tables WHERE t.Name == \"Deals\"]->-[x:Changes]-> fire changed\n",
|
|
928
|
+
"plan": {
|
|
929
|
+
"adapter": "hiring",
|
|
930
|
+
"carries": [
|
|
931
|
+
"Tables"
|
|
932
|
+
],
|
|
933
|
+
"connection": "hiring",
|
|
934
|
+
"hops": [
|
|
935
|
+
{
|
|
936
|
+
"alias": "t",
|
|
937
|
+
"edge": "Tables",
|
|
938
|
+
"from": "",
|
|
939
|
+
"judged": "arrival",
|
|
940
|
+
"taken": {
|
|
941
|
+
"left": {
|
|
942
|
+
"fieldOnly": true,
|
|
943
|
+
"propertyTypeId": "Name",
|
|
944
|
+
"type": "edge_property"
|
|
945
|
+
},
|
|
946
|
+
"op": "eq",
|
|
947
|
+
"right": {
|
|
948
|
+
"type": "static",
|
|
949
|
+
"value": "Deals"
|
|
950
|
+
},
|
|
951
|
+
"type": "compare"
|
|
952
|
+
},
|
|
953
|
+
"to": "Table"
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
"alias": "x",
|
|
957
|
+
"edge": "Changes",
|
|
958
|
+
"from": "Table",
|
|
959
|
+
"judged": "arrival",
|
|
960
|
+
"to": "Change"
|
|
961
|
+
}
|
|
962
|
+
],
|
|
963
|
+
"movement": "changed"
|
|
964
|
+
}
|
|
965
|
+
},
|
|
733
966
|
"changes": {
|
|
734
967
|
"source": "import { at as at_module } from adapters; at = connect at_module\nfunction changed(x: <at-[:Change]->>) { return x.Kind }\nlisten to at-[b:Bases WHERE b.Name == \"Finance\"]->-[t:Tables WHERE t.Name == \"Expenses\"]->-[x:Changes WHERE x.Kind == \"created\"]-> fire changed\n",
|
|
735
968
|
"plan": {
|
|
@@ -1813,6 +2046,16 @@
|
|
|
1813
2046
|
{"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}},
|
|
1814
2047
|
{"case": "a listen through a union: a note the filter on Notes refuses skips at Notes", "plan": "subjects", "arrival": {"edge": "Notes", "key": "p1", "landing": {"recordType": "Note", "fields": {"Id": "n4", "Text": "skip"}}, "parents": [{"recordType": "Person", "fields": {"Name": "Acme"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
1815
2048
|
{"case": "a listen through a union: a note under a record of no member's type skips by type, naming every member", "plan": "subjects", "arrival": {"edge": "Notes", "key": "l1", "landing": {"recordType": "Note", "fields": {"Id": "n5", "Text": "hi"}}, "parents": [{"recordType": "Lead", "fields": {"Name": "Acme"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 0, "reason": "the Subjects record it carries has record type Lead, not Person or Company, which this listen's Subjects lands on"}},
|
|
1816
|
-
{"case": "a listen through a union: a note whose subject states no record type is undecided, once, naming every member", "plan": "subjects", "arrival": {"edge": "Notes", "key": "p1", "landing": {"recordType": "Note", "fields": {"Id": "n6", "Text": "hi"}}, "parents": [{"fields": {"Name": "Acme"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the arrival crm reported on Notes carries a Subjects record that does not say its record type (this listen's Subjects lands on Person or Company)"}}
|
|
2049
|
+
{"case": "a listen through a union: a note whose subject states no record type is undecided, once, naming every member", "plan": "subjects", "arrival": {"edge": "Notes", "key": "p1", "landing": {"recordType": "Note", "fields": {"Id": "n6", "Text": "hi"}}, "parents": [{"fields": {"Name": "Acme"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the arrival crm reported on Notes carries a Subjects record that does not say its record type (this listen's Subjects lands on Person or Company)"}},
|
|
2050
|
+
{"case": "a change carrying its base and table fires: a hop the host lists is judged on the record the arrival carries for it", "plan": "carried", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [{"recordType": "Base", "fields": {"Name": "Hiring"}}, {"recordType": "Table", "fields": {"Name": "Deals"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2051
|
+
{"case": "a change carrying a base of another name skips at Bases, whether or not the host listed it", "plan": "carried", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [{"recordType": "Base", "fields": {"Name": "Finance"}}, {"recordType": "Table", "fields": {"Name": "Deals"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 0}},
|
|
2052
|
+
{"case": "a change carrying a table of another name skips at Tables", "plan": "carried", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [{"recordType": "Base", "fields": {"Name": "Hiring"}}, {"recordType": "Table", "fields": {"Name": "Expenses"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 1}},
|
|
2053
|
+
{"case": "a change whose table name its module could not read is undecided", "plan": "carried", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [{"recordType": "Base", "fields": {"Name": "Hiring"}}, {"recordType": "Table", "fields": {"Id": "tblDEALS"}, "unknown": ["Name"]}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "air could not read Name of the Tables record the arrival carries, which this listen's filter reads"}},
|
|
2054
|
+
{"case": "a change carrying no base, though its edge carries one, is undecided", "plan": "carried", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [null, {"recordType": "Table", "fields": {"Name": "Deals"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"undecided": "the arrival carries no Bases record, which this listen's filter on it reads"}},
|
|
2055
|
+
{"case": "a change on a connection positioned at its base carries its base too: the Tables hop reads the Table it carries, by its record type", "plan": "positioned", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [{"recordType": "Base", "fields": {"Name": "Hiring"}}, {"recordType": "Table", "fields": {"Name": "Deals"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2056
|
+
{"case": "a change on a connection positioned at its base, from another table, skips at Tables", "plan": "positioned", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [{"recordType": "Base", "fields": {"Name": "Hiring"}}, {"recordType": "Table", "fields": {"Name": "Roles"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 0}},
|
|
2057
|
+
{"case": "a change on a connection positioned at its base carrying its table first fires the same", "plan": "positioned", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [{"recordType": "Table", "fields": {"Name": "Deals"}}, {"recordType": "Base", "fields": {"Name": "Hiring"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2058
|
+
{"case": "a change carrying its table before its base is judged the same: each hop reads the record of its own type", "plan": "carried", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [{"recordType": "Table", "fields": {"Name": "Deals"}}, {"recordType": "Base", "fields": {"Name": "Hiring"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"fires": true}},
|
|
2059
|
+
{"case": "a change carrying its table before its base, from another base, skips at Bases", "plan": "carried", "arrival": {"edge": "Changes", "key": "tblDEALS", "landing": {"recordType": "Change", "fields": {"Id": "c1", "Kind": "created"}}, "parents": [{"recordType": "Table", "fields": {"Name": "Deals"}}, {"recordType": "Base", "fields": {"Name": "Finance"}}]}, "now": "2026-10-31T10:00:00Z", "verdict": {"skips": 0}}
|
|
1817
2060
|
]
|
|
1818
2061
|
}
|
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.14.
|
|
4
|
+
"version": "0.14.2",
|
|
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.14.
|
|
33
|
+
"@listen-fire/movement-lang": "^0.14.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "20.16.5",
|