@arcforge/types 2.0.101 → 2.0.102
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 +1 -1
- package/src/bench/aggregate.ts +1 -1
- package/src/bench/bench.ts +33 -11
- package/src/bench/contribution.ts +2 -2
- package/src/bench/execution.ts +1 -1
- package/src/bench/index.ts +11 -8
- package/src/bench/manifest.ts +6 -6
- package/src/bench/matrix.ts +109 -0
- package/src/bench/workspace.ts +31 -3
- package/src/config.ts +16 -0
- package/src/connect.ts +55 -0
- package/src/define.ts +86 -22
- package/src/index.ts +1 -0
- package/src/prompts.ts +19 -1
- package/src/session/envelope.ts +21 -4
- package/src/session/events/bench.ts +8 -1
- package/src/session/events/capsule.ts +120 -61
- package/src/session/events/cognet.ts +44 -19
- package/src/session/events/kernel.ts +47 -29
- package/src/session/events/runtime.ts +69 -45
- package/src/session/events/span.ts +123 -0
- package/src/session/index.ts +4 -0
- package/src/session/read.ts +173 -0
- package/src/bench/factor.ts +0 -69
|
@@ -20,78 +20,137 @@
|
|
|
20
20
|
* the runtime's lifecycle seams; this map is what the capsule itself emits.
|
|
21
21
|
*/
|
|
22
22
|
import type { Activity } from "./activity"
|
|
23
|
+
import type { AxonErrorJSON } from "../../error"
|
|
24
|
+
import type { AxonCancellableSpan, AxonSpan } from "./span"
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Capsule failures carry AxonErrorJSON, not AxonError.
|
|
28
|
+
*
|
|
29
|
+
* Everywhere else in the system a :failed payload is a live AxonError, and
|
|
30
|
+
* JSON.stringify's toJSON() handles serialization on the way to disk. The
|
|
31
|
+
* capsule is the one boundary where that is a lie: these events are
|
|
32
|
+
* constructed inside a SUBPROCESS and cross a JSONL pipe, so what the host
|
|
33
|
+
* receives is already plain data — a parsed object with isAxonError: true,
|
|
34
|
+
* never an Error instance. Typing it as AxonError would promise a .render()
|
|
35
|
+
* and a live .cause chain that do not survive the pipe.
|
|
36
|
+
*
|
|
37
|
+
* The full structured value still crosses: code, title, description,
|
|
38
|
+
* captured frames with source snippets, and the cause chain. Only the
|
|
39
|
+
* behavior is lost, which is exactly what the JSON shape describes.
|
|
40
|
+
*/
|
|
37
41
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"capsule:
|
|
41
|
-
|
|
42
|
+
export type CapsuleEventMap =
|
|
43
|
+
// ── Lifecycle ────────────────────────────────────────────────────────────
|
|
44
|
+
& AxonSpan<"capsule:boot", {}, {}, { error: AxonErrorJSON }>
|
|
45
|
+
& {
|
|
46
|
+
"capsule:ready": {}
|
|
47
|
+
"capsule:shutdown": {}
|
|
48
|
+
/** Unhandled error inside the subprocess. Exit usually follows. */
|
|
49
|
+
"capsule:crash": { error: AxonErrorJSON }
|
|
50
|
+
/** The capsule subprocess itself exited (not a managed child process). */
|
|
51
|
+
"capsule:exit": { code: number | null; reason?: string }
|
|
52
|
+
/** A wire line failed to parse — the sandbox is speaking garbage. Never dropped silently. */
|
|
53
|
+
"capsule:parse:error": { error: AxonErrorJSON; line?: string }
|
|
42
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Supervision gave up — the capsule is gone and will not come back on
|
|
57
|
+
* its own. Terminal, and deliberately NOT capsule:restart:failed: it
|
|
58
|
+
* also fires when the restart budget is exhausted, which is a
|
|
59
|
+
* supervision verdict rather than one restart going wrong.
|
|
60
|
+
*/
|
|
61
|
+
"capsule:dead": { error: AxonErrorJSON }
|
|
62
|
+
}
|
|
63
|
+
// ── Supervision (host-side) — one crash-and-recover cycle ───────────────
|
|
64
|
+
& AxonSpan<
|
|
65
|
+
"capsule:restart",
|
|
66
|
+
{ restartCount: number },
|
|
67
|
+
{ restartCount: number },
|
|
68
|
+
{ restartCount: number; error: AxonErrorJSON }
|
|
69
|
+
>
|
|
43
70
|
// ── Command execution (one run() = one command id) ──────────────────────
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
71
|
+
& AxonCancellableSpan<
|
|
72
|
+
"capsule:cmd",
|
|
73
|
+
{ id: string },
|
|
74
|
+
{ id: string; result: unknown },
|
|
75
|
+
{ id: string; error: AxonErrorJSON },
|
|
76
|
+
{ id: string; durationMs: number }
|
|
77
|
+
>
|
|
78
|
+
& {
|
|
79
|
+
"capsule:cmd:stdout": { id: string; data: string }
|
|
80
|
+
"capsule:cmd:interrupt:requested": { id: string; reason: "abort" | "timeout" }
|
|
81
|
+
"capsule:cmd:hard-killed": { id: string; graceMs: number }
|
|
82
|
+
}
|
|
52
83
|
// ── Tool call spans (mediated fn calls inside a command) ────────────────
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
84
|
+
& AxonSpan<
|
|
85
|
+
"capsule:fn",
|
|
86
|
+
{ commandId: string; module: string; fn: string; args: unknown[] },
|
|
87
|
+
{ commandId: string; module: string; fn: string; result: unknown },
|
|
88
|
+
{ commandId: string; module: string; fn: string; error: AxonErrorJSON }
|
|
89
|
+
>
|
|
57
90
|
// ── Tool loading ─────────────────────────────────────────────────────────
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
91
|
+
// A dynamic import inside the sandbox: genuinely bracketed, and slow
|
|
92
|
+
// or hanging often enough that the :start half earns its place.
|
|
93
|
+
& AxonSpan<
|
|
94
|
+
"capsule:tool:load",
|
|
95
|
+
{ namespace: string },
|
|
96
|
+
{ namespace: string; fns: string[] },
|
|
97
|
+
{ namespace: string; error: AxonErrorJSON }
|
|
98
|
+
>
|
|
99
|
+
// ── Managed child processes ──────────────────────────────────────────────
|
|
100
|
+
// One spawned process = one span. A non-zero exit is NOT :failed — the
|
|
101
|
+
// process ran exactly as asked and returned a code, which is ordinary
|
|
102
|
+
// and lives in the payload. :failed is reserved for the span itself
|
|
103
|
+
// breaking (the child could not be reaped, the handle was lost), which
|
|
104
|
+
// is why its payload carries no exit code: there isn't one.
|
|
105
|
+
& AxonSpan<
|
|
106
|
+
"capsule:proc",
|
|
107
|
+
{ procId: string; pid: number; command: string; cwd: string; kind: "managed" | "run" },
|
|
108
|
+
{ procId: string; code: number },
|
|
109
|
+
{ procId: string; error: AxonErrorJSON }
|
|
110
|
+
>
|
|
111
|
+
& {
|
|
112
|
+
/**
|
|
113
|
+
* Unloading is a synchronous map delete — a settled fact with no
|
|
114
|
+
* interior, so it stays a bare event rather than a one-tick span.
|
|
115
|
+
*/
|
|
116
|
+
"capsule:tool:unloaded": { namespace: string }
|
|
61
117
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
118
|
+
// ── Trusted host bridge ──────────────────────────────────────────────
|
|
119
|
+
/** Private request transport for the capsule Axon facade. Never durable. */
|
|
120
|
+
"capsule:host:request": { id: string; commandId: string | null; method: string; input: unknown }
|
|
65
121
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
122
|
+
// ── Child process byte streams ───────────────────────────────────────
|
|
123
|
+
"capsule:proc:stdout": { procId: string; data: string }
|
|
124
|
+
"capsule:proc:stderr": { procId: string; data: string }
|
|
125
|
+
/**
|
|
126
|
+
* A process the sandbox asked for was never created — refused by
|
|
127
|
+
* policy, killed before it could spawn, or the spawn itself failed.
|
|
128
|
+
* Outside the span triad on purpose: nothing started, so there is no
|
|
129
|
+
* bracket to close. Same rule as capsule:fn, which opens only once
|
|
130
|
+
* policy admits the call.
|
|
131
|
+
*/
|
|
132
|
+
"capsule:proc:denied": { procId: string; command: string; error: AxonErrorJSON }
|
|
133
|
+
"capsule:proc:stdin:error": { procId: string; error: AxonErrorJSON }
|
|
73
134
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"capsule:policy:decision": { id: string; allow: boolean; durationMs: number }
|
|
80
|
-
"capsule:resource:exceeded": { id: string; limit: string; value: number; max: number }
|
|
135
|
+
// ── Policy ───────────────────────────────────────────────────────────
|
|
136
|
+
"capsule:policy:denied": { id: string; module: string; fn: string; args: unknown[]; rule: string }
|
|
137
|
+
"capsule:policy:escalation": { id: string; module: string; fn: string; args: unknown[]; rule: string }
|
|
138
|
+
/** Host-side: the escalate callback's verdict for a pending escalation. */
|
|
139
|
+
"capsule:policy:decision": { id: string; allow: boolean; durationMs: number }
|
|
81
140
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
141
|
+
// ── Activities (semantic tool emissions) ─────────────────────────────
|
|
142
|
+
/**
|
|
143
|
+
* A tool declared or settled a renderable activity (activity.ts) via
|
|
144
|
+
* the ambient axon.activity(). Correlated to the running command the
|
|
145
|
+
* same way capsule:console is; null only if emitted outside any command.
|
|
146
|
+
*/
|
|
147
|
+
"capsule:activity": Activity & { commandId: string | null }
|
|
89
148
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
149
|
+
// ── Console + state ──────────────────────────────────────────────────
|
|
150
|
+
/** User console output, captured — correlated to the running command, never raw on stdout. */
|
|
151
|
+
"capsule:console": { level: "log" | "info" | "warn" | "error" | "debug"; commandId: string | null; args: unknown[] }
|
|
152
|
+
"capsule:cwd": { cwd: string }
|
|
153
|
+
}
|
|
95
154
|
|
|
96
155
|
export type CapsuleEventName = keyof CapsuleEventMap
|
|
97
156
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AxonError } from "../../error"
|
|
2
2
|
import type { AxonLogEvents } from "./log"
|
|
3
|
+
import type { AxonCancellableSpan, AxonSpan } from "./span"
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Cognet telemetry — the cognition artifact's own observability record.
|
|
@@ -21,26 +22,50 @@ import type { AxonLogEvents } from "./log"
|
|
|
21
22
|
* the cognet layer, ticks and phases are the program's own clock; the
|
|
22
23
|
* kernel neither knows nor cares that a program ticks.
|
|
23
24
|
*/
|
|
24
|
-
export type CognetEventMap =
|
|
25
|
+
export type CognetEventMap =
|
|
26
|
+
& AxonLogEvents<"cognet">
|
|
27
|
+
// ── Artifact lifecycle ───────────────────────────────────────────────────
|
|
28
|
+
//
|
|
29
|
+
// Emitted by the KERNEL, not by the cognet — deliberately the one family
|
|
30
|
+
// in this map the brain does not produce. exec'ing an untrusted artifact
|
|
31
|
+
// is the most failure-prone step in boot, and a cognet that dies inside
|
|
32
|
+
// load() cannot narrate its own failure: whatever bracket it opened would
|
|
33
|
+
// never close. The kernel is the only loader (see Kernel()), so it is the
|
|
34
|
+
// only thing positioned to record both halves honestly.
|
|
35
|
+
& AxonSpan<"cognet:load", { name: string }, { name: string }, { name: string; error: AxonError }>
|
|
36
|
+
& AxonSpan<"cognet:unload", { name: string }, { name: string }, { name: string; error: AxonError }>
|
|
25
37
|
// ── World clock ──────────────────────────────────────────────────────────
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
//
|
|
39
|
+
// Three nested levels, each the four-state form: a tick contains phases,
|
|
40
|
+
// a phase contains systems. :interrupted at every level means the wake
|
|
41
|
+
// was cancelled (Escape/Ctrl+C, engine abort) — cancellation, not a bug,
|
|
42
|
+
// kept distinct from :failed so devtools never conflate the two.
|
|
43
|
+
//
|
|
44
|
+
// The bracket identity is in the payload (tick number, phase name,
|
|
45
|
+
// system name), which is what lets a reader pair a start with its own
|
|
46
|
+
// end when siblings of the same stem appear in one run.
|
|
47
|
+
& AxonCancellableSpan<
|
|
48
|
+
"cognet:tick",
|
|
49
|
+
{ tick: number },
|
|
50
|
+
{ tick: number },
|
|
51
|
+
{ tick: number; error: AxonError },
|
|
52
|
+
{ tick: number }
|
|
53
|
+
>
|
|
54
|
+
& AxonCancellableSpan<
|
|
55
|
+
"cognet:phase",
|
|
56
|
+
{ tick: number; phase: string },
|
|
57
|
+
{ tick: number; phase: string },
|
|
58
|
+
{ tick: number; phase: string; error: AxonError },
|
|
59
|
+
{ tick: number; phase: string }
|
|
60
|
+
>
|
|
61
|
+
& AxonCancellableSpan<
|
|
62
|
+
"cognet:system",
|
|
63
|
+
{ tick: number; phase: string | null; system: string },
|
|
64
|
+
{ tick: number; phase: string | null; system: string },
|
|
65
|
+
{ tick: number; phase: string | null; system: string; error: AxonError },
|
|
66
|
+
{ tick: number; phase: string | null; system: string }
|
|
67
|
+
>
|
|
68
|
+
& {
|
|
44
69
|
// ── World writes ─────────────────────────────────────────────────────────
|
|
45
70
|
"cognet:entity:add": { tick: number; phase: string | null; entity: string }
|
|
46
71
|
"cognet:entity:remove": { tick: number; phase: string | null; entity: string }
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AxonEngineFault, AxonEngineMessage, AxonEngineMeta } from "../../engine"
|
|
2
2
|
import type { AxonLogEvents } from "./log"
|
|
3
|
+
import type { AxonCancellableSpan, AxonSpan } from "./span"
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Kernel telemetry — the machinery's own record, emitted by the kernel and
|
|
@@ -9,36 +10,53 @@ import type { AxonLogEvents } from "./log"
|
|
|
9
10
|
* Session-level: these describe how the machinery ran, never what the model
|
|
10
11
|
* or client sees. runId rides in the event context.
|
|
11
12
|
*/
|
|
12
|
-
export type AxonKernelEventMap =
|
|
13
|
+
export type AxonKernelEventMap =
|
|
14
|
+
& AxonLogEvents<"kernel">
|
|
13
15
|
// ── Run — one wake, exec to quiescence. The process accounting record. ──
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
//
|
|
17
|
+
// :failed deliberately carries NO error payload — the first documented
|
|
18
|
+
// exception to the span standard. err()'s sink already emitted the
|
|
19
|
+
// canonical "axon:error" event at the throw site (see @axon/err/sink.ts),
|
|
20
|
+
// so duplicating the AxonError here would put the same failure in the
|
|
21
|
+
// log twice under two names. This is pure run-accounting: the wake
|
|
22
|
+
// ended, and it ended badly — the error's own record says how.
|
|
23
|
+
& AxonCancellableSpan<
|
|
24
|
+
"kernel:run",
|
|
25
|
+
{},
|
|
26
|
+
{},
|
|
27
|
+
{},
|
|
28
|
+
{ reason: "user" | "shutdown" }
|
|
29
|
+
>
|
|
22
30
|
// ── Engine calls — the billing and latency record ────────────────────────
|
|
23
31
|
// Emitted by the Engine() manager around every call — a program cannot
|
|
24
32
|
// skip them: every token passes this meter by construction.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
//
|
|
34
|
+
// :failed carries AxonEngineFault, not AxonError — the second and last
|
|
35
|
+
// documented exception. A provider fault is a distinct, richer domain
|
|
36
|
+
// shape (code, provider, model, retryable, retryAfterMs) that drives
|
|
37
|
+
// retry policy; flattening it into a generic AxonError would lose the
|
|
38
|
+
// fields the retry loop and the billing view both read.
|
|
39
|
+
& AxonSpan<
|
|
40
|
+
"kernel:engine",
|
|
41
|
+
{ provider: string; model?: string },
|
|
42
|
+
/**
|
|
43
|
+
* The other half of the call kernel:engine:input opened, same spanId —
|
|
44
|
+
* together they tell the whole story: input (what the model saw),
|
|
45
|
+
* output (exactly what it produced, raw, pre-AIR-parse), meta (billing/
|
|
46
|
+
* observability). text/thinking are the same fields AxonEngineResponse
|
|
47
|
+
* already carries in-process; this is that response actually made
|
|
48
|
+
* durable instead of being dropped after the AIR parser consumes it.
|
|
49
|
+
*/
|
|
50
|
+
{ attempts: number; text: string; thinking?: string; stopReason: "end" | "length" | "abort"; meta: AxonEngineMeta },
|
|
51
|
+
{ attempts: number; fault: AxonEngineFault }
|
|
52
|
+
>
|
|
53
|
+
& {
|
|
54
|
+
/**
|
|
55
|
+
* The rendered AIR document handed to the engine for this call — what the
|
|
56
|
+
* model actually saw. Same spanId as the paired kernel:engine:start, so
|
|
57
|
+
* a trace can pull a call's input by shared span without extra plumbing.
|
|
58
|
+
* Devtools-only: never rendered to the user, never part of entry state.
|
|
59
|
+
*/
|
|
60
|
+
"kernel:engine:input": { messages: AxonEngineMessage[]; bytes: number }
|
|
61
|
+
"kernel:engine:retry": { attempt: number; nextAttempt: number; delayMs: number; fault: AxonEngineFault }
|
|
62
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AxonError } from "../../error"
|
|
2
2
|
import type { AxonLogEvents } from "./log"
|
|
3
|
+
import type { AxonSpan } from "./span"
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Runtime + continuity events — the session's own lifecycle record.
|
|
@@ -7,8 +8,8 @@ import type { AxonLogEvents } from "./log"
|
|
|
7
8
|
* Two families in one map:
|
|
8
9
|
* - Runtime facts (boot/shutdown/reload/server): "a runtime attached to this
|
|
9
10
|
* session and did things". A session can span many boots.
|
|
10
|
-
* - Continuity facts (session/capsule
|
|
11
|
-
*
|
|
11
|
+
* - Continuity facts (session/capsule): the small, load-bearing subset
|
|
12
|
+
* hydration reads on resume.
|
|
12
13
|
*
|
|
13
14
|
* No single prefix covers this map (boot:/shutdown:/session:/capsule:/
|
|
14
15
|
* server:), so its log events use "runtime" as the namespace —
|
|
@@ -21,67 +22,90 @@ import type { AxonLogEvents } from "./log"
|
|
|
21
22
|
* own code is running inside — not any one lifecycle prefix above — so it
|
|
22
23
|
* gets its own namespace rather than folding into axon:log:*.
|
|
23
24
|
*/
|
|
24
|
-
export type AxonRuntimeEvent =
|
|
25
|
+
export type AxonRuntimeEvent =
|
|
26
|
+
& AxonLogEvents<"axon">
|
|
25
27
|
// ── Runtime lifecycle ────────────────────────────────────────────────────
|
|
26
|
-
"axon:boot
|
|
27
|
-
"axon:
|
|
28
|
-
"axon:boot:failed": { error: AxonError }
|
|
29
|
-
|
|
30
|
-
"axon:shutdown:start": { reason?: string }
|
|
31
|
-
"axon:shutdown:complete": { durationMs: number }
|
|
32
|
-
"axon:shutdown:failed": { error: AxonError }
|
|
33
|
-
|
|
28
|
+
& AxonSpan<"axon:boot", { version: string; agentRoot: string; mode: "local" | "cloud" }>
|
|
29
|
+
& AxonSpan<"axon:shutdown", { reason?: string }>
|
|
34
30
|
// ── Surface reload (blueprint/tools changed under a live runtime) ───────
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
& AxonSpan<
|
|
32
|
+
"axon:reload",
|
|
33
|
+
{ revision: number },
|
|
34
|
+
{ revision: number; toolCount: number },
|
|
35
|
+
{ revision?: number; error: AxonError }
|
|
36
|
+
>
|
|
39
37
|
// ── Module install/uninstall (registry op, then a reload rides the same
|
|
40
38
|
// hot-swap path above) ─────────────────────────────────────────────
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
& AxonSpan<
|
|
40
|
+
"axon:install",
|
|
41
|
+
{ name: string; version?: string },
|
|
42
|
+
{ name: string; version: string; alreadyInstalled: boolean },
|
|
43
|
+
{ name: string; version?: string; error: AxonError }
|
|
44
|
+
>
|
|
45
|
+
& {
|
|
46
|
+
/**
|
|
47
|
+
* No module by that name in the registry — a typo or an unpublished
|
|
48
|
+
* package. A settled outcome, not a failure: nothing broke, so it must
|
|
49
|
+
* not render as an error. Distinct from :failed, which means the
|
|
50
|
+
* install itself went wrong (network, disk, a bad tarball).
|
|
51
|
+
*
|
|
52
|
+
* Outside the span triad by design — a third settled outcome, the
|
|
53
|
+
* same way :interrupted is for cancellable operations.
|
|
54
|
+
*/
|
|
55
|
+
"axon:install:not-found": { name: string; durationMs: number }
|
|
56
|
+
}
|
|
57
|
+
& AxonSpan<
|
|
58
|
+
"axon:uninstall",
|
|
59
|
+
{ name: string },
|
|
60
|
+
{ name: string },
|
|
61
|
+
{ name: string; error: AxonError }
|
|
62
|
+
>
|
|
56
63
|
// ── Module setup/teardown (boot-time defineModule() setup execution) ─────
|
|
57
64
|
// The determinism ledger: one start/complete (or failed) per module,
|
|
58
65
|
// in blueprint order, carrying the config content hash so two boots of
|
|
59
66
|
// the same blueprint are provably the same wiring.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
& AxonSpan<
|
|
68
|
+
"module:setup",
|
|
69
|
+
{ name: string; configHash: string; options: Record<string, unknown> },
|
|
70
|
+
{ name: string },
|
|
71
|
+
{ name: string; error: AxonError }
|
|
72
|
+
>
|
|
73
|
+
& AxonSpan<
|
|
74
|
+
"module:dispose",
|
|
75
|
+
{ name: string },
|
|
76
|
+
{ name: string },
|
|
77
|
+
{ name: string; error: AxonError }
|
|
78
|
+
>
|
|
79
|
+
& {
|
|
67
80
|
// ── Session continuity ───────────────────────────────────────────────────
|
|
68
|
-
|
|
81
|
+
// NOT a span, and deliberately not named like one. A session outlives
|
|
82
|
+
// the runtime that opened it: `opened` and `closed` can be days and
|
|
83
|
+
// several processes apart, with any number of boots in between, so
|
|
84
|
+
// there is no bracket here for a reader to match or a flame graph to
|
|
85
|
+
// draw. `axon:session:start` collided with the span vocabulary and
|
|
86
|
+
// read as a bracket that never closed — these verbs keep the
|
|
87
|
+
// continuity family honestly outside it.
|
|
88
|
+
"axon:session:opened": {}
|
|
69
89
|
"axon:session:restored": {}
|
|
70
|
-
"axon:session:
|
|
71
|
-
"axon:session:error": { error: AxonError }
|
|
90
|
+
"axon:session:closed": {}
|
|
72
91
|
|
|
73
92
|
// ── Capsule attachment (one capsule per session; telemetry lives in the capsule package) ──
|
|
74
93
|
"capsule:attach": { capsuleId: string; cwd: string }
|
|
75
94
|
"capsule:detach": { capsuleId: string; reason: "shutdown" | "crash" | "reload" }
|
|
76
95
|
|
|
77
|
-
// ── Compression — summaries replacing aged entries ──────────────────────
|
|
78
|
-
"axon:compress": { replaced: number; summaryEntryId: string }
|
|
79
|
-
|
|
80
96
|
// ── Server ───────────────────────────────────────────────────────────────
|
|
81
97
|
"axon:server:request": { method: string; path: string; status: number; durationMs: number }
|
|
82
98
|
|
|
83
99
|
// ── Errors ───────────────────────────────────────────────────────────────
|
|
84
100
|
"axon:error": { event?: string; error: AxonError }
|
|
85
|
-
/**
|
|
86
|
-
|
|
101
|
+
/**
|
|
102
|
+
* A bus handler threw. "axon" names the runtime layer the failure
|
|
103
|
+
* happened in, not any one lifecycle prefix above.
|
|
104
|
+
*
|
|
105
|
+
* Carries the full AxonError (envelope rule 4) — plugins and modules
|
|
106
|
+
* register handlers, so a stringified message would drop the stack at
|
|
107
|
+
* exactly the boundary where "which plugin broke?" is the only question
|
|
108
|
+
* worth answering.
|
|
109
|
+
*/
|
|
110
|
+
"axon:bus:error": { event: string; error: AxonError }
|
|
87
111
|
}
|