@arcforge/kernel 2.0.209 → 2.0.210
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 +8 -8
- package/src/engine.ts +30 -4
- package/src/kernel.ts +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcforge/kernel",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.210",
|
|
4
4
|
"description": "The Axon kernel — ring 0. Owns resources and execution, enforces policy, and is the only constructor of the unprivileged capsule.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"deploy": "echo \"This package is published ONLY by apps/tui/scripts/release.ts, which pins workspace:* deps to concrete versions first. Publishing it directly ships an unresolvable dependency.\" && exit 1"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@arcforge/air": "2.0.
|
|
19
|
-
"@arcforge/engines": "2.0.
|
|
20
|
-
"@arcforge/err": "2.0.
|
|
21
|
-
"@arcforge/session": "2.0.
|
|
22
|
-
"@arcforge/types": "2.0.
|
|
23
|
-
"@arcforge/cloud": "2.0.
|
|
24
|
-
"@arcforge/capsule": "2.0.
|
|
18
|
+
"@arcforge/air": "2.0.210",
|
|
19
|
+
"@arcforge/engines": "2.0.210",
|
|
20
|
+
"@arcforge/err": "2.0.210",
|
|
21
|
+
"@arcforge/session": "2.0.210",
|
|
22
|
+
"@arcforge/types": "2.0.210",
|
|
23
|
+
"@arcforge/cloud": "2.0.210",
|
|
24
|
+
"@arcforge/capsule": "2.0.210"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/bun": "latest",
|
package/src/engine.ts
CHANGED
|
@@ -30,7 +30,14 @@ type EngineOpts = {
|
|
|
30
30
|
* never entered the log, so the model was asked to fix a shape it could
|
|
31
31
|
* not see. Absent only where no reply exists to quote.
|
|
32
32
|
*/
|
|
33
|
-
fault(input: {
|
|
33
|
+
fault(input: {
|
|
34
|
+
code: string
|
|
35
|
+
message: string
|
|
36
|
+
excerpt?: string
|
|
37
|
+
rejected?: string
|
|
38
|
+
attempt?: number
|
|
39
|
+
details?: Record<string, string | number | boolean>
|
|
40
|
+
}): Promise<void>
|
|
34
41
|
/**
|
|
35
42
|
* The resolved inference roles, when the cognet declared any.
|
|
36
43
|
*
|
|
@@ -1089,6 +1096,7 @@ export function Engine(opts: EngineOpts) {
|
|
|
1089
1096
|
message: lastFault,
|
|
1090
1097
|
rejected: step.value?.text,
|
|
1091
1098
|
attempt: attempt + 1,
|
|
1099
|
+
details: { texts: texts, scripts: scripts, yielded: yielded, crossed: crossed },
|
|
1092
1100
|
})
|
|
1093
1101
|
|
|
1094
1102
|
// NOTHING further is yielded. `drain()` stopped the moment the
|
|
@@ -1107,7 +1115,13 @@ export function Engine(opts: EngineOpts) {
|
|
|
1107
1115
|
if (violations.length === 0 && (texts > 1 || scripts > 1)) {
|
|
1108
1116
|
lastFault = describeTooManyBlocks(texts, scripts)
|
|
1109
1117
|
lastFailure = "shape"
|
|
1110
|
-
await opts.fault({
|
|
1118
|
+
await opts.fault({
|
|
1119
|
+
code: "OUTPUT_TOO_MANY_BLOCKS",
|
|
1120
|
+
message: lastFault,
|
|
1121
|
+
rejected: step.value?.text,
|
|
1122
|
+
attempt: attempt + 1,
|
|
1123
|
+
details: { texts: texts, scripts: scripts, yielded: yielded, crossed: crossed },
|
|
1124
|
+
})
|
|
1111
1125
|
attemptCall = await reframe(call, lastFault)
|
|
1112
1126
|
continue
|
|
1113
1127
|
}
|
|
@@ -1165,7 +1179,13 @@ export function Engine(opts: EngineOpts) {
|
|
|
1165
1179
|
if (violations.length === 0 && !acted && truncated) {
|
|
1166
1180
|
lastFault = describeTruncatedBlock(truncated, step.value?.text)
|
|
1167
1181
|
lastFailure = "empty"
|
|
1168
|
-
await opts.fault({
|
|
1182
|
+
await opts.fault({
|
|
1183
|
+
code: "OUTPUT_TRUNCATED",
|
|
1184
|
+
message: lastFault,
|
|
1185
|
+
rejected: step.value?.text,
|
|
1186
|
+
attempt: attempt + 1,
|
|
1187
|
+
details: { texts: texts, scripts: scripts, yielded: yielded, truncated: truncated },
|
|
1188
|
+
})
|
|
1169
1189
|
attemptCall = await reframe(call, lastFault)
|
|
1170
1190
|
continue
|
|
1171
1191
|
}
|
|
@@ -1178,7 +1198,13 @@ export function Engine(opts: EngineOpts) {
|
|
|
1178
1198
|
attempt >= budget,
|
|
1179
1199
|
)
|
|
1180
1200
|
lastFailure = "empty"
|
|
1181
|
-
await opts.fault({
|
|
1201
|
+
await opts.fault({
|
|
1202
|
+
code: "OUTPUT_EMPTY",
|
|
1203
|
+
message: lastFault,
|
|
1204
|
+
rejected: step.value?.text,
|
|
1205
|
+
attempt: attempt + 1,
|
|
1206
|
+
details: { texts: texts, scripts: scripts, yielded: yielded, responseChars: (step.value?.text ?? "").length },
|
|
1207
|
+
})
|
|
1182
1208
|
attemptCall = await reframe(call, lastFault)
|
|
1183
1209
|
continue
|
|
1184
1210
|
}
|
package/src/kernel.ts
CHANGED
|
@@ -628,7 +628,14 @@ export async function Kernel(opts: KernelOpts) {
|
|
|
628
628
|
* one thing for a host to recognise and hide.
|
|
629
629
|
*/
|
|
630
630
|
async function recordFault(
|
|
631
|
-
fault: {
|
|
631
|
+
fault: {
|
|
632
|
+
code: string
|
|
633
|
+
message: string
|
|
634
|
+
excerpt?: string
|
|
635
|
+
rejected?: string
|
|
636
|
+
attempt?: number
|
|
637
|
+
details?: Record<string, string | number | boolean>
|
|
638
|
+
},
|
|
632
639
|
run: { runId: string } | undefined,
|
|
633
640
|
): Promise<unknown> {
|
|
634
641
|
// The rejected reply first, so the timeline reads in the order it
|
|
@@ -655,7 +662,11 @@ export async function Kernel(opts: KernelOpts) {
|
|
|
655
662
|
type: "format-violation",
|
|
656
663
|
lang: "md",
|
|
657
664
|
content: fault.message,
|
|
658
|
-
attributes: {
|
|
665
|
+
attributes: {
|
|
666
|
+
code: fault.code,
|
|
667
|
+
...(fault.excerpt ? { excerpt: fault.excerpt } : {}),
|
|
668
|
+
...(fault.details ? Object.fromEntries(Object.entries(fault.details).map(([key, value]) => [key, String(value)])) : {}),
|
|
669
|
+
},
|
|
659
670
|
}, run)
|
|
660
671
|
}
|
|
661
672
|
|