@nanobpm/urban 0.64.0 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/context/binding/backend.d.ts +58 -0
  2. package/dist/context/binding/backend.js +15 -0
  3. package/dist/context/binding/descriptor.d.ts +51 -0
  4. package/dist/context/binding/descriptor.js +62 -0
  5. package/dist/context/binding/git-backend.d.ts +65 -0
  6. package/dist/context/binding/git-backend.js +318 -0
  7. package/dist/context/binding/identity.d.ts +42 -0
  8. package/dist/context/binding/identity.js +159 -0
  9. package/dist/context/binding/index.d.ts +5 -1
  10. package/dist/context/binding/index.js +14 -1
  11. package/dist/context/binding/resolver.d.ts +61 -0
  12. package/dist/context/binding/resolver.js +125 -0
  13. package/dist/runtime/core/manifest.d.ts +24 -1
  14. package/dist/runtime/core/modules/instance-tracking.d.ts +14 -0
  15. package/dist/runtime/core/modules/instance-tracking.js +108 -11
  16. package/dist/runtime/core/validate.js +15 -0
  17. package/package.json +1 -1
  18. package/src/context/binding/backend.ts +79 -0
  19. package/src/context/binding/descriptor.test.ts +51 -0
  20. package/src/context/binding/descriptor.ts +108 -0
  21. package/src/context/binding/git-backend.ts +368 -0
  22. package/src/context/binding/identity.test.ts +165 -0
  23. package/src/context/binding/identity.ts +206 -0
  24. package/src/context/binding/index.ts +46 -2
  25. package/src/context/binding/resolver.test.ts +713 -0
  26. package/src/context/binding/resolver.ts +176 -0
  27. package/src/runtime/core/manifest.ts +22 -1
  28. package/src/runtime/core/modules/instance-tracking.test.ts +192 -6
  29. package/src/runtime/core/modules/instance-tracking.ts +115 -11
  30. package/src/runtime/core/validate.test.ts +46 -0
  31. package/src/runtime/core/validate.ts +15 -0
@@ -166,6 +166,52 @@ test("an instanceTracking binding missing table/keyField/onTerminated.set is fla
166
166
  assert.ok(issues.some((i) => i.path === "instanceTracking[0].onTerminated.set"));
167
167
  });
168
168
 
169
+ test("an instanceTracking binding with a well-formed onWaitingHuman.set has no issues", () => {
170
+ const issues = collectManifestIssues({
171
+ ...valid,
172
+ instanceTracking: [
173
+ {
174
+ table: "plans",
175
+ keyField: "process_key",
176
+ statusField: "status",
177
+ terminalStatuses: ["abandoned"],
178
+ onTerminated: { set: { status: "abandoned" } },
179
+ onWaitingHuman: { set: { status: "awaiting_operator" } },
180
+ },
181
+ ],
182
+ });
183
+ assert.deepEqual(issues, []);
184
+ });
185
+
186
+ test("an instanceTracking onWaitingHuman with an empty set patch is flagged", () => {
187
+ const issues = collectManifestIssues({
188
+ ...valid,
189
+ instanceTracking: [
190
+ {
191
+ table: "plans",
192
+ keyField: "process_key",
193
+ onTerminated: { set: { status: "abandoned" } },
194
+ onWaitingHuman: { set: {} },
195
+ },
196
+ ],
197
+ });
198
+ assert.ok(issues.some((i) => i.path === "instanceTracking[0].onWaitingHuman.set"));
199
+ });
200
+
201
+ test("an instanceTracking binding omitting onWaitingHuman is valid (the edge is opt-in)", () => {
202
+ const issues = collectManifestIssues({
203
+ ...valid,
204
+ instanceTracking: [
205
+ {
206
+ table: "plans",
207
+ keyField: "process_key",
208
+ onTerminated: { set: { status: "abandoned" } },
209
+ },
210
+ ],
211
+ });
212
+ assert.deepEqual(issues, []);
213
+ });
214
+
169
215
  test("instanceTracking activeStatuses without statusField is flagged", () => {
170
216
  const issues = collectManifestIssues({
171
217
  ...valid,
@@ -201,6 +201,21 @@ export function collectManifestIssues(m: unknown): ValidationIssue[] {
201
201
  message: "missing onTerminated.set patch (a non-empty column → value map)",
202
202
  });
203
203
  }
204
+ // `onWaitingHuman` (issue #355) is the optional wait-on-human edge — the twin of
205
+ // `onTerminated`. It is optional (a binding may reconcile only the terminal edge), but when
206
+ // present its `set` must be a non-empty column → value patch for the same reason
207
+ // `onTerminated.set` must be: a reconciler with nothing to write is inert and almost
208
+ // certainly a mistake.
209
+ if (b?.onWaitingHuman !== undefined) {
210
+ const onWaitingHuman = isRecord(b.onWaitingHuman) ? b.onWaitingHuman : undefined;
211
+ const waitingSet = isRecord(onWaitingHuman?.set) ? onWaitingHuman.set : undefined;
212
+ if (!waitingSet || Object.keys(waitingSet).length === 0) {
213
+ issues.push({
214
+ path: `instanceTracking[${i}].onWaitingHuman.set`,
215
+ message: "missing onWaitingHuman.set patch (a non-empty column → value map)",
216
+ });
217
+ }
218
+ }
204
219
  // `activeStatuses` (fail-closed allow-list) and `terminalStatuses` (fail-open exclusion) are
205
220
  // both consumed as arrays of status strings. A malformed value — a bare string, or an array
206
221
  // holding a non-string/empty entry — would misbehave at runtime (`new Set("abandoned")`