@axiastudio/aioc 0.2.7 → 0.2.9
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/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Its core job is to make agent execution boundaries explicit, testable, auditable
|
|
|
23
23
|
|
|
24
24
|
## Release Status
|
|
25
25
|
|
|
26
|
-
Current stable release: `0.2.
|
|
26
|
+
Current stable release: `0.2.9`.
|
|
27
27
|
The stable line started with `0.1.0`.
|
|
28
28
|
The core runtime surface is compatibility-managed. Breaking changes to the stable surface should ship only with explicit migration guidance and release notes.
|
|
29
29
|
|
|
@@ -40,6 +40,14 @@ AIOC `0.2.3` adds RFC-0010 policy composition helpers for exact-name tool and ha
|
|
|
40
40
|
AIOC `0.2.4` adds experimental governance-event packages and an OpenTelemetry Logs exporter for reduced, operational observability events derived from `RunRecord` values.
|
|
41
41
|
AIOC `0.2.5` makes replay history-faithful by recording the initial input scope in `RunRecord` and replaying from it by default.
|
|
42
42
|
AIOC `0.2.6` adds descriptor-level conditional agent handoffs with boolean `where` gates that filter handoff tools before provider requests.
|
|
43
|
+
AIOC `0.2.7` adds run-regression suite utilities and the experimental
|
|
44
|
+
`@axiastudio/aioc-regression-judge` companion package for bounded LLM judge
|
|
45
|
+
inputs and structured judge results.
|
|
46
|
+
AIOC `0.2.8` fixes replay agent cloning so strict and hybrid replay preserve
|
|
47
|
+
conditional handoff rules and expose enabled `handoff_to_*` tools.
|
|
48
|
+
AIOC `0.2.9` captures `RunRecord.contextSnapshot` as a cloned initial run
|
|
49
|
+
context, so replay starts from the state that entered the run while apps keep
|
|
50
|
+
owning final mutable state persistence.
|
|
43
51
|
|
|
44
52
|
### Experimental Packages
|
|
45
53
|
|
|
@@ -53,8 +61,8 @@ mapper outside the core runtime package. It derives reduced, redacted,
|
|
|
53
61
|
event-shaped records from `RunRecord` values.
|
|
54
62
|
|
|
55
63
|
`@axiastudio/aioc-export-otel` maps those governance events to OpenTelemetry
|
|
56
|
-
Logs.
|
|
57
|
-
|
|
64
|
+
Logs. These packages remain experimental while real usage validates their
|
|
65
|
+
schemas and operational shape.
|
|
58
66
|
|
|
59
67
|
- Release notes: `CHANGELOG.md`
|
|
60
68
|
- Historical beta contract snapshot: `docs/BETA-CONTRACT.md`
|
|
@@ -157,9 +165,18 @@ The Agent Harness Descriptor is included in the supported `0.2.x` API surface as
|
|
|
157
165
|
## Policy Gate (Minimal)
|
|
158
166
|
|
|
159
167
|
```ts
|
|
160
|
-
import {
|
|
161
|
-
|
|
162
|
-
|
|
168
|
+
import {
|
|
169
|
+
Agent,
|
|
170
|
+
allow,
|
|
171
|
+
deny,
|
|
172
|
+
run,
|
|
173
|
+
tool,
|
|
174
|
+
type ToolPolicy,
|
|
175
|
+
} from "@axiastudio/aioc";
|
|
176
|
+
|
|
177
|
+
const toolPolicy: ToolPolicy<{ actor: { groups: string[] } }> = ({
|
|
178
|
+
runContext,
|
|
179
|
+
}) => {
|
|
163
180
|
if (!runContext.context.actor.groups.includes("finance")) {
|
|
164
181
|
return deny("deny_missing_finance_group", {
|
|
165
182
|
resultMode: "tool_result",
|
|
@@ -202,6 +219,7 @@ Privacy notes:
|
|
|
202
219
|
|
|
203
220
|
- `record.includePromptText` defaults to `false`; keep it disabled unless needed.
|
|
204
221
|
- `record.contextRedactor` should be considered mandatory for production persistence.
|
|
222
|
+
- `contextSnapshot` captures the initial run context, not final mutable app state.
|
|
205
223
|
- sink adapters should implement encryption, access controls, retention, and deletion.
|
|
206
224
|
|
|
207
225
|
## RunRecord Utilities (Minimal)
|
|
@@ -221,7 +239,13 @@ console.log(calls[0]?.name, calls[0]?.argsHash, calls[0]?.hasOutput);
|
|
|
221
239
|
import { compareRunRecords } from "@axiastudio/aioc";
|
|
222
240
|
|
|
223
241
|
const comparison = compareRunRecords(runRecordA, runRecordB, {
|
|
224
|
-
includeSections: [
|
|
242
|
+
includeSections: [
|
|
243
|
+
"response",
|
|
244
|
+
"toolCalls",
|
|
245
|
+
"policy",
|
|
246
|
+
"guardrails",
|
|
247
|
+
"metadata",
|
|
248
|
+
],
|
|
225
249
|
responseMatchMode: "exact",
|
|
226
250
|
});
|
|
227
251
|
|
|
@@ -251,6 +275,9 @@ console.log(replay.replayStats);
|
|
|
251
275
|
```
|
|
252
276
|
|
|
253
277
|
`replayFromRunRecord(...)` does not bypass policy enforcement: in `strict` and `hybrid`, provide `runOptions.policies` when tool/handoff execution must be authorized.
|
|
278
|
+
Strict and hybrid replay preserve conditional handoff rules from the source
|
|
279
|
+
agent, so enabled handoffs remain visible to the provider as `handoff_to_*`
|
|
280
|
+
tools during replay.
|
|
254
281
|
|
|
255
282
|
## Reference UI Example
|
|
256
283
|
|
|
@@ -274,23 +301,23 @@ tool-policy, and policy-composition. Use run-record and harness examples after
|
|
|
274
301
|
the basics; `example:non-regression`, `example:run-regression`, and
|
|
275
302
|
`example:run-regression-judge` are advanced workflows.
|
|
276
303
|
|
|
277
|
-
| Command
|
|
278
|
-
|
|
279
|
-
| `npm run example:hello`
|
|
280
|
-
| `npm run example:policy`
|
|
281
|
-
| `npm run example:approval-required`
|
|
282
|
-
| `npm run example:approval-evidence`
|
|
283
|
-
| `npm run example:tool-policy`
|
|
284
|
-
| `npm run example:policy-composition`
|
|
285
|
-
| `npm run example:harness-rerun`
|
|
286
|
-
| `npm run example:run-record`
|
|
287
|
-
| `npm run example:rru:01-extract`
|
|
288
|
-
| `npm run example:rru:02-compare`
|
|
289
|
-
| `npm run example:rru:03-replay-strict` | Minimal strict replay
|
|
290
|
-
| `npm run example:rru:04-replay-hybrid` | Minimal hybrid replay
|
|
291
|
-
| `npm run example:non-regression`
|
|
292
|
-
| `npm run example:run-regression`
|
|
293
|
-
| `npm run example:run-regression-judge` | Local `runRegressionSuite(...)` with an LLM judge
|
|
304
|
+
| Command | Purpose | Needs API key |
|
|
305
|
+
| -------------------------------------- | ------------------------------------------------------------------ | --------------------------------------------------------- |
|
|
306
|
+
| `npm run example:hello` | Minimal single-agent run | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
307
|
+
| `npm run example:policy` | Minimal denied tool + policy flow | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
308
|
+
| `npm run example:approval-required` | Minimal approval-required tool + policy flow | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
309
|
+
| `npm run example:approval-evidence` | Approval evidence passed through context and reevaluated by policy | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
310
|
+
| `npm run example:tool-policy` | Straight tool + policy flow with allowed execution | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
311
|
+
| `npm run example:policy-composition` | Exact-name tool policy dispatch with fallback deny | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
312
|
+
| `npm run example:harness-rerun` | Replay against a modified harness with a mocked new tool output | Yes (`OPENAI_API_KEY`) |
|
|
313
|
+
| `npm run example:run-record` | Run-record persistence with redaction + audit | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
314
|
+
| `npm run example:rru:01-extract` | Minimal `extractToolCalls(...)` | No |
|
|
315
|
+
| `npm run example:rru:02-compare` | Minimal `compareRunRecords(...)` | No |
|
|
316
|
+
| `npm run example:rru:03-replay-strict` | Minimal strict replay | No |
|
|
317
|
+
| `npm run example:rru:04-replay-hybrid` | Minimal hybrid replay | No |
|
|
318
|
+
| `npm run example:non-regression` | Advanced v1/v2 run-record diff | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
319
|
+
| `npm run example:run-regression` | Local `runRegressionSuite(...)` over a modified harness | Yes (`OPENAI_API_KEY`) |
|
|
320
|
+
| `npm run example:run-regression-judge` | Local `runRegressionSuite(...)` with an LLM judge | Yes (`OPENAI_API_KEY`) |
|
|
294
321
|
|
|
295
322
|
Notes:
|
|
296
323
|
|
|
@@ -306,13 +333,16 @@ Optional LangChain interoperability examples live in `examples/langchain`.
|
|
|
306
333
|
They use their own `package.json` so LangChain dependencies do not become
|
|
307
334
|
dependencies of the core `@axiastudio/aioc` runtime package.
|
|
308
335
|
|
|
309
|
-
They demonstrate
|
|
336
|
+
They demonstrate three composition patterns:
|
|
310
337
|
|
|
311
338
|
- **aioc-first, LangChain-extended**: aioc owns the governed agent run while
|
|
312
339
|
LangChain provides OSS components behind aioc tools, such as retrieval.
|
|
313
340
|
- **LangGraph-orchestrated, aioc-governed**: LangGraph owns workflow
|
|
314
341
|
orchestration while selected graph nodes call aioc for policy-gated execution
|
|
315
342
|
and portable audit evidence.
|
|
343
|
+
- **LangGraph-orchestrated, aioc-recorded**: LangGraph remains the primary
|
|
344
|
+
orchestrator while a local RFC-0013 prototype emits a graph-level
|
|
345
|
+
`RunRecord` around the compiled graph.
|
|
316
346
|
|
|
317
347
|
## Test Commands
|
|
318
348
|
|
|
@@ -345,6 +375,7 @@ AIOC adopts the following non-negotiable principles:
|
|
|
345
375
|
- `docs/RFC-0009-governance-events-and-exporters.md` (`Experimental`)
|
|
346
376
|
- `docs/RFC-0010-policy-composition-helpers.md` (`Accepted`)
|
|
347
377
|
- `docs/RFC-0011-agent-harness-descriptor.md` (`Accepted`)
|
|
378
|
+
- `docs/RFC-0012-run-regression-suites-and-llm-judging.md` (`Accepted`)
|
|
348
379
|
- `docs/PRIVACY-BASELINE.md`
|
|
349
380
|
|
|
350
381
|
## Historical Snapshots
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-record-utils.d.ts","sourceRoot":"","sources":["../src/run-record-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"run-record-utils.d.ts","sourceRoot":"","sources":["../src/run-record-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqB,MAAM,SAAS,CAAC;AAGnD,OAAO,KAAK,EAAE,SAAS,EAAmC,MAAM,cAAc,CAAC;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB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E,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,iBAAiB,CAAC;CAChC;AAED,MAAM,WAAW,wBAAwB,CAAC,QAAQ,GAAG,OAAO;IAC1D,eAAe,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,KAAK,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChE,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC3D,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,iBAAiB,CAAC,EAAE,4BAA4B,CAAC;CAClD;AAED,MAAM,WAAW,yBAAyB,CAAC,QAAQ,GAAG,OAAO;IAC3D,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC5B,eAAe,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IACtC,WAAW,EAAE,WAAW,CAAC;CAC1B;AAqVD,wBAAsB,mBAAmB,CAAC,QAAQ,GAAG,OAAO,EAC1D,KAAK,EAAE,wBAAwB,CAAC,QAAQ,CAAC,GACxC,OAAO,CAAC,yBAAyB,CAAC,QAAQ,CAAC,CAAC,CAmE9C"}
|
package/dist/run-record-utils.js
CHANGED
|
@@ -424,9 +424,21 @@ function cloneAgentWithReplayedTools(sourceAgent, mode, queues, replayStats, onM
|
|
|
424
424
|
},
|
|
425
425
|
};
|
|
426
426
|
});
|
|
427
|
-
const
|
|
427
|
+
const wrappedHandoffRules = sourceAgent.handoffRules.map((handoffRule) => {
|
|
428
|
+
const clonedHandoffAgent = cloneAgentWithReplayedTools(handoffRule.agent, mode, queues, replayStats, onMissingToolCall, cache);
|
|
429
|
+
if (handoffRule.enabled) {
|
|
430
|
+
return {
|
|
431
|
+
agent: clonedHandoffAgent,
|
|
432
|
+
enabled: handoffRule.enabled,
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
return {
|
|
436
|
+
agent: clonedHandoffAgent,
|
|
437
|
+
};
|
|
438
|
+
});
|
|
428
439
|
cloned.tools = wrappedTools;
|
|
429
|
-
cloned.
|
|
440
|
+
cloned.handoffRules = wrappedHandoffRules;
|
|
441
|
+
cloned.handoffs = wrappedHandoffRules.map((rule) => rule.agent);
|
|
430
442
|
return cloned;
|
|
431
443
|
}
|
|
432
444
|
async function resolveReplayAgent(input) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-recorder-runtime.d.ts","sourceRoot":"","sources":["../src/run-recorder-runtime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-recorder-runtime.d.ts","sourceRoot":"","sources":["../src/run-recorder-runtime.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EAGxB,gBAAgB,EAEhB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,oBAAoB,EACpB,WAAW,CACZ,CAAC;AACF,MAAM,MAAM,8BAA8B,GAAG,IAAI,CAC/C,uBAAuB,EACvB,WAAW,CACZ,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAC5C,oBAAoB,EACpB,WAAW,GAAG,YAAY,GAAG,YAAY,CAC1C,GAAG;IACF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAChD,wBAAwB,EACtB,WAAW,GACX,gBAAgB,GAChB,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,CAAC,eAAe,CAA8B;IAC9D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAC9D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAiC;IACpE,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA8B;IAC9D,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAkC;IACtE,OAAO,CAAC,mBAAmB,CAAM;IACjC,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO;WAsBM,MAAM,CAAC,QAAQ,GAAG,OAAO,EACpC,OAAO,EAAE,wBAAwB,CAAC,QAAQ,CAAC,GAC1C,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAuBjC,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,gBAAgB,GAAI,UAAU,2BAA2B,KAAG,IAAI,CAK9D;IAEF,mBAAmB,GAAI,UAAU,iBAAiB,KAAG,IAAI,CAEvD;IAEF,mBAAmB,GAAI,UAAU,8BAA8B,KAAG,IAAI,CAKpE;IAEF,gBAAgB,GAAI,UAAU,2BAA2B,KAAG,IAAI,CAW9D;IAEF,oBAAoB,GAClB,aAAa,+BAA+B,KAC3C,IAAI,CAgCL;IAEF,eAAe,GAAI,SAAS,MAAM,KAAG,IAAI,CAEvC;IAEI,aAAa,CAAC,OAAO,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE,UAAU,CACd,OAAO,EAAE,0BAA0B,EACnC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,IAAI,CAAC;YAIF,IAAI;CA+CnB"}
|
|
@@ -5,6 +5,7 @@ const node_crypto_1 = require("node:crypto");
|
|
|
5
5
|
const node_fs_1 = require("node:fs");
|
|
6
6
|
const node_path_1 = require("node:path");
|
|
7
7
|
const canonical_json_1 = require("./canonical-json");
|
|
8
|
+
const json_1 = require("./json");
|
|
8
9
|
const REQUEST_FINGERPRINT_SCHEMA_VERSION = "request-fingerprint.v1";
|
|
9
10
|
function resolveRuntimeVersion() {
|
|
10
11
|
const envVersion = process.env.AIOC_RUNTIME_VERSION?.trim() ??
|
|
@@ -57,19 +58,31 @@ function resolveRunRecordWriter(options) {
|
|
|
57
58
|
}
|
|
58
59
|
return sink.write;
|
|
59
60
|
}
|
|
61
|
+
function cloneContextSnapshot(context) {
|
|
62
|
+
if (context === null || typeof context !== "object") {
|
|
63
|
+
return context;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
return structuredClone(context);
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return (0, json_1.toJsonValue)(context);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
60
72
|
async function resolveContextSnapshot(context, options) {
|
|
73
|
+
const initialContextSnapshot = cloneContextSnapshot(context);
|
|
61
74
|
if (!options?.contextRedactor) {
|
|
62
75
|
return {
|
|
63
|
-
contextSnapshot:
|
|
76
|
+
contextSnapshot: initialContextSnapshot,
|
|
64
77
|
contextRedacted: false,
|
|
65
78
|
};
|
|
66
79
|
}
|
|
67
80
|
try {
|
|
68
|
-
return await options.contextRedactor(
|
|
81
|
+
return await options.contextRedactor(initialContextSnapshot);
|
|
69
82
|
}
|
|
70
83
|
catch {
|
|
71
84
|
return {
|
|
72
|
-
contextSnapshot:
|
|
85
|
+
contextSnapshot: initialContextSnapshot,
|
|
73
86
|
contextRedacted: false,
|
|
74
87
|
};
|
|
75
88
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axiastudio/aioc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"example:non-regression": "tsx examples/core/non-regression/v1-v2-runrecord-diff.ts",
|
|
38
38
|
"example:run-regression": "tsx examples/core/run-regression/age-adapted-suite.ts",
|
|
39
39
|
"example:run-regression-judge": "npm run regression-judge:build && tsx packages/aioc-regression-judge/examples/age-adapted-suite-with-judge.ts",
|
|
40
|
+
"example:self-harness": "npm run regression-judge:build && tsx examples/self-harness/phase-1.ts",
|
|
40
41
|
"inspect:samples": "tsx scripts/generate-aioc-inspect-samples.ts",
|
|
41
42
|
"docs:sync": "node scripts/sync-aioc-docs.mjs",
|
|
42
43
|
"docs:dev": "npm run docs:sync && cd apps/aioc-docs && zsh -lc 'npm run dev'",
|