@arcforge/types 2.0.171 → 2.0.173

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcforge/types",
3
- "version": "2.0.171",
3
+ "version": "2.0.173",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./src/index.ts",
@@ -49,6 +49,21 @@ export type AxonEventContext = {
49
49
  spanId?: string
50
50
  }
51
51
 
52
+ /**
53
+ * The correlation half of the context, as a COMMITTER supplies it.
54
+ *
55
+ * `agentId` and `sessionId` are the session's own identity and are stamped by
56
+ * the writer, so a caller never supplies them. What a caller can know is which
57
+ * request and which logical operation its event belongs to — and those are
58
+ * exactly the two fields that must survive every seam an event crosses.
59
+ *
60
+ * Named here rather than inside the session package because it now travels:
61
+ * a confined agent commits over the supervisor link, and a context that is not
62
+ * part of the wire contract is a context that gets dropped at the boundary.
63
+ * That is not hypothetical — it is the bug this type exists to prevent.
64
+ */
65
+ export type AxonCommitContext = Partial<Pick<AxonEventContext, "runId" | "spanId">>
66
+
52
67
  /**
53
68
  * The envelope. `M` is a registry map (event name → payload shape);
54
69
  * `K` narrows to one event type.
@@ -1,5 +1,6 @@
1
1
  export type {
2
2
  AxonEvent,
3
+ AxonCommitContext,
3
4
  AxonEventContext,
4
5
  AxonEventUnion,
5
6
  AxonIngestedEvent,
package/src/supervisor.ts CHANGED
@@ -2,6 +2,7 @@ import type { AxonEngineRawEvent, AxonEngineRequest } from "./engine"
2
2
  import type { AxonRunResult } from "./kernel/abi"
3
3
  import type { AxonBlueprint } from "./blueprint"
4
4
  import type { AxonEventMap } from "./session/session"
5
+ import type { AxonCommitContext } from "./session/envelope"
5
6
  import type { AxonStimulusEntry } from "./session/events/stdio/stimuli"
6
7
  import type { EscalationCall } from "./policy"
7
8
 
@@ -225,8 +226,16 @@ export type AgentToSupervisor = {
225
226
  * The event NAMES are unchanged (`capsule:*` included) — Fleet folds the
226
227
  * flame graph and the process tree straight out of this stream, so keeping
227
228
  * the vocabulary keeps every existing surface working across the move.
229
+ *
230
+ * `ctx` carries the event's correlation ids across the seam, and is part
231
+ * of this contract rather than of the payload. The agent's kernel mints a
232
+ * spanId per engine call, and start/input/complete are correlated by
233
+ * nothing else — so when this verb could only carry `(type, data)`, moving
234
+ * agents into subprocesses silently un-correlated every span in the
235
+ * system and the Engine view rendered empty for every session. Absent
236
+ * means the committer had no context, never that the wire dropped it.
228
237
  */
229
- commit<K extends keyof AxonEventMap>(type: K, data: AxonEventMap[K]): void
238
+ commit<K extends keyof AxonEventMap>(type: K, data: AxonEventMap[K], ctx?: AxonCommitContext): void
230
239
 
231
240
  /**
232
241
  * Ask a human about one call. Resolves with the verdict.