@githolon/testing 0.47.0 → 0.48.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.
- package/package.json +1 -1
- package/vendor/engine/engine.mjs +10 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@githolon/testing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "@githolon/testing — law TDD for Nomos domains: boot the REAL engine plane in-process (the exact machinery every cloud DO, heavy container and web client runs), dispatch directives, assert rows, assert TYPED REFUSALS, fork for what-ifs — fully offline inside vitest.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/vendor/engine/engine.mjs
CHANGED
|
@@ -1004,6 +1004,9 @@ export async function admitIntentOffers(eng, ws, ledger, offers, { receiptFence
|
|
|
1004
1004
|
// BORN: the G3 birth offer-effect's child heads any `.births()` offer in this batch produced (the kernel
|
|
1005
1005
|
// surfaced them on the admit verdict). Accumulated across the batch and relayed out for the host to persist.
|
|
1006
1006
|
const born = [];
|
|
1007
|
+
// ...and their TYPED VERDICTS (born|deferred|failed|unwarranted-cert — typed_birth_outcomes.md §2),
|
|
1008
|
+
// accumulated beside `born` (never in place of; no custody bytes, no pack treatment).
|
|
1009
|
+
const birthOutcomes = [];
|
|
1007
1010
|
const timings = { spans: [], intents: 0, sessions: 0 };
|
|
1008
1011
|
// THE §5.2 SUMMARY CAPTURE on the OFFER LANE (offers are the only source of intents — this lane is the one
|
|
1009
1012
|
// admit, routed workspaces included). A shard (selfLabel set) with scoped reads captures the per-batch
|
|
@@ -1089,6 +1092,7 @@ export async function admitIntentOffers(eng, ws, ledger, offers, { receiptFence
|
|
|
1089
1092
|
rec.admitted.push({ oid, head: res.head });
|
|
1090
1093
|
admittedTotal += 1;
|
|
1091
1094
|
if (Array.isArray(res.born) && res.born.length) born.push(...res.born);
|
|
1095
|
+
if (Array.isArray(res.birthOutcomes) && res.birthOutcomes.length) birthOutcomes.push(...res.birthOutcomes);
|
|
1092
1096
|
if (cap) finishSummaryCapture(eng, ws, summaryCtx, cap, res.head, intentId);
|
|
1093
1097
|
} else {
|
|
1094
1098
|
const error = `${String(res.error || "").slice(0, 300)} — dead-lettered; fix the law (or the payload), then POST /v1/workspaces/${ws}/dead-letters/retry`;
|
|
@@ -1146,7 +1150,7 @@ export async function admitIntentOffers(eng, ws, ledger, offers, { receiptFence
|
|
|
1146
1150
|
// repos). Pack each born child's full chain BEFORE returning so the bytes ride out for the worker to persist
|
|
1147
1151
|
// to the child's own Artifacts repo (the host names nothing — it shuttles kernel-produced bytes keyed by ws).
|
|
1148
1152
|
const bornPacked = born.length ? packBornChildren(eng, born) : born;
|
|
1149
|
-
return { sessions: [...sessions.values()].map((s) => ({ ...s, ...(s.skipped.length ? {} : { skipped: undefined }) })), main: head, deadLetters, timings, ...(summary ? { summary } : {}), ...(bornPacked.length ? { born: bornPacked } : {}), ...(resultPackB64 ? { resultPackB64, resultBase: clientBase } : {}), ...(deferDurability && admittedTotal && head ? { deferred: true, head } : {}) };
|
|
1153
|
+
return { sessions: [...sessions.values()].map((s) => ({ ...s, ...(s.skipped.length ? {} : { skipped: undefined }) })), main: head, deadLetters, timings, ...(summary ? { summary } : {}), ...(bornPacked.length ? { born: bornPacked } : {}), ...(birthOutcomes.length ? { birthOutcomes } : {}), ...(resultPackB64 ? { resultPackB64, resultBase: clientBase } : {}), ...(deferDurability && admittedTotal && head ? { deferred: true, head } : {}) };
|
|
1150
1154
|
}
|
|
1151
1155
|
|
|
1152
1156
|
/**
|
|
@@ -1189,7 +1193,8 @@ export async function authorOn(eng, ws, ledger, domain, directiveId, payload, la
|
|
|
1189
1193
|
// author case → worker relays the bytes and the worker persists them to the child's OWN Artifacts repo. The
|
|
1190
1194
|
// PARENT's main was already pushed above; the child custody is a SEPARATE store the host must ship.
|
|
1191
1195
|
const bornPacked = Array.isArray(res.born) && res.born.length ? packBornChildren(eng, res.born) : res.born;
|
|
1192
|
-
|
|
1196
|
+
// birthOutcomes carries NO custody bytes — pass through verbatim (no packBornChildren treatment).
|
|
1197
|
+
return { ok: true, head: res.head, ...(bornPacked ? { born: bornPacked } : {}), ...(res.birthOutcomes ? { birthOutcomes: res.birthOutcomes } : {}) };
|
|
1193
1198
|
}
|
|
1194
1199
|
|
|
1195
1200
|
/**
|
|
@@ -1485,9 +1490,10 @@ export function author(eng, ws, domain, directiveId, payload, controllerHash, op
|
|
|
1485
1490
|
writeWork(eng, `envelope-${seq}.json`, enc.encode(stringifyBig(envelope)));
|
|
1486
1491
|
v = offerOnce();
|
|
1487
1492
|
}
|
|
1488
|
-
// KEEP `born
|
|
1493
|
+
// KEEP `born` (+ `birthOutcomes`, the typed verdict vector beside it — typed_birth_outcomes.md §2):
|
|
1494
|
+
// the wasm offer ran the G3 birth offer-effect and surfaced the child heads; thread them
|
|
1489
1495
|
// through the normalized shape so the relay (container author case → worker out.born) sees them.
|
|
1490
|
-
const res = v.outcome === "admitted" ? { ok: true, head: v.head, intentOut: v.intentOut, ...(v.born ? { born: v.born } : {}) }
|
|
1496
|
+
const res = v.outcome === "admitted" ? { ok: true, head: v.head, intentOut: v.intentOut, ...(v.born ? { born: v.born } : {}), ...(v.birthOutcomes ? { birthOutcomes: v.birthOutcomes } : {}) }
|
|
1491
1497
|
: v.outcome === "refused" ? { ok: false, error: v.verdict?.reason ?? v.error }
|
|
1492
1498
|
: v; // defensive: a non-verdict shape passes through unchanged
|
|
1493
1499
|
if (defer && res.ok) (eng.pendingProjection ??= new Set()).add(ws);
|