@axiastudio/aioc 0.2.7 → 0.2.8
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 +52 -25
- package/dist/run-record-utils.d.ts.map +1 -1
- package/dist/run-record-utils.js +14 -2
- package/package.json +2 -1
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.8`.
|
|
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,11 @@ 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.
|
|
43
48
|
|
|
44
49
|
### Experimental Packages
|
|
45
50
|
|
|
@@ -53,8 +58,8 @@ mapper outside the core runtime package. It derives reduced, redacted,
|
|
|
53
58
|
event-shaped records from `RunRecord` values.
|
|
54
59
|
|
|
55
60
|
`@axiastudio/aioc-export-otel` maps those governance events to OpenTelemetry
|
|
56
|
-
Logs.
|
|
57
|
-
|
|
61
|
+
Logs. These packages remain experimental while real usage validates their
|
|
62
|
+
schemas and operational shape.
|
|
58
63
|
|
|
59
64
|
- Release notes: `CHANGELOG.md`
|
|
60
65
|
- Historical beta contract snapshot: `docs/BETA-CONTRACT.md`
|
|
@@ -157,9 +162,18 @@ The Agent Harness Descriptor is included in the supported `0.2.x` API surface as
|
|
|
157
162
|
## Policy Gate (Minimal)
|
|
158
163
|
|
|
159
164
|
```ts
|
|
160
|
-
import {
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
import {
|
|
166
|
+
Agent,
|
|
167
|
+
allow,
|
|
168
|
+
deny,
|
|
169
|
+
run,
|
|
170
|
+
tool,
|
|
171
|
+
type ToolPolicy,
|
|
172
|
+
} from "@axiastudio/aioc";
|
|
173
|
+
|
|
174
|
+
const toolPolicy: ToolPolicy<{ actor: { groups: string[] } }> = ({
|
|
175
|
+
runContext,
|
|
176
|
+
}) => {
|
|
163
177
|
if (!runContext.context.actor.groups.includes("finance")) {
|
|
164
178
|
return deny("deny_missing_finance_group", {
|
|
165
179
|
resultMode: "tool_result",
|
|
@@ -221,7 +235,13 @@ console.log(calls[0]?.name, calls[0]?.argsHash, calls[0]?.hasOutput);
|
|
|
221
235
|
import { compareRunRecords } from "@axiastudio/aioc";
|
|
222
236
|
|
|
223
237
|
const comparison = compareRunRecords(runRecordA, runRecordB, {
|
|
224
|
-
includeSections: [
|
|
238
|
+
includeSections: [
|
|
239
|
+
"response",
|
|
240
|
+
"toolCalls",
|
|
241
|
+
"policy",
|
|
242
|
+
"guardrails",
|
|
243
|
+
"metadata",
|
|
244
|
+
],
|
|
225
245
|
responseMatchMode: "exact",
|
|
226
246
|
});
|
|
227
247
|
|
|
@@ -251,6 +271,9 @@ console.log(replay.replayStats);
|
|
|
251
271
|
```
|
|
252
272
|
|
|
253
273
|
`replayFromRunRecord(...)` does not bypass policy enforcement: in `strict` and `hybrid`, provide `runOptions.policies` when tool/handoff execution must be authorized.
|
|
274
|
+
Strict and hybrid replay preserve conditional handoff rules from the source
|
|
275
|
+
agent, so enabled handoffs remain visible to the provider as `handoff_to_*`
|
|
276
|
+
tools during replay.
|
|
254
277
|
|
|
255
278
|
## Reference UI Example
|
|
256
279
|
|
|
@@ -274,23 +297,23 @@ tool-policy, and policy-composition. Use run-record and harness examples after
|
|
|
274
297
|
the basics; `example:non-regression`, `example:run-regression`, and
|
|
275
298
|
`example:run-regression-judge` are advanced workflows.
|
|
276
299
|
|
|
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
|
|
300
|
+
| Command | Purpose | Needs API key |
|
|
301
|
+
| -------------------------------------- | ------------------------------------------------------------------ | --------------------------------------------------------- |
|
|
302
|
+
| `npm run example:hello` | Minimal single-agent run | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
303
|
+
| `npm run example:policy` | Minimal denied tool + policy flow | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
304
|
+
| `npm run example:approval-required` | Minimal approval-required tool + policy flow | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
305
|
+
| `npm run example:approval-evidence` | Approval evidence passed through context and reevaluated by policy | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
306
|
+
| `npm run example:tool-policy` | Straight tool + policy flow with allowed execution | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
307
|
+
| `npm run example:policy-composition` | Exact-name tool policy dispatch with fallback deny | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
308
|
+
| `npm run example:harness-rerun` | Replay against a modified harness with a mocked new tool output | Yes (`OPENAI_API_KEY`) |
|
|
309
|
+
| `npm run example:run-record` | Run-record persistence with redaction + audit | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
310
|
+
| `npm run example:rru:01-extract` | Minimal `extractToolCalls(...)` | No |
|
|
311
|
+
| `npm run example:rru:02-compare` | Minimal `compareRunRecords(...)` | No |
|
|
312
|
+
| `npm run example:rru:03-replay-strict` | Minimal strict replay | No |
|
|
313
|
+
| `npm run example:rru:04-replay-hybrid` | Minimal hybrid replay | No |
|
|
314
|
+
| `npm run example:non-regression` | Advanced v1/v2 run-record diff | Yes (`AIOC_EXAMPLE_PROVIDER` + matching provider API key) |
|
|
315
|
+
| `npm run example:run-regression` | Local `runRegressionSuite(...)` over a modified harness | Yes (`OPENAI_API_KEY`) |
|
|
316
|
+
| `npm run example:run-regression-judge` | Local `runRegressionSuite(...)` with an LLM judge | Yes (`OPENAI_API_KEY`) |
|
|
294
317
|
|
|
295
318
|
Notes:
|
|
296
319
|
|
|
@@ -306,13 +329,16 @@ Optional LangChain interoperability examples live in `examples/langchain`.
|
|
|
306
329
|
They use their own `package.json` so LangChain dependencies do not become
|
|
307
330
|
dependencies of the core `@axiastudio/aioc` runtime package.
|
|
308
331
|
|
|
309
|
-
They demonstrate
|
|
332
|
+
They demonstrate three composition patterns:
|
|
310
333
|
|
|
311
334
|
- **aioc-first, LangChain-extended**: aioc owns the governed agent run while
|
|
312
335
|
LangChain provides OSS components behind aioc tools, such as retrieval.
|
|
313
336
|
- **LangGraph-orchestrated, aioc-governed**: LangGraph owns workflow
|
|
314
337
|
orchestration while selected graph nodes call aioc for policy-gated execution
|
|
315
338
|
and portable audit evidence.
|
|
339
|
+
- **LangGraph-orchestrated, aioc-recorded**: LangGraph remains the primary
|
|
340
|
+
orchestrator while a local RFC-0013 prototype emits a graph-level
|
|
341
|
+
`RunRecord` around the compiled graph.
|
|
316
342
|
|
|
317
343
|
## Test Commands
|
|
318
344
|
|
|
@@ -345,6 +371,7 @@ AIOC adopts the following non-negotiable principles:
|
|
|
345
371
|
- `docs/RFC-0009-governance-events-and-exporters.md` (`Experimental`)
|
|
346
372
|
- `docs/RFC-0010-policy-composition-helpers.md` (`Accepted`)
|
|
347
373
|
- `docs/RFC-0011-agent-harness-descriptor.md` (`Accepted`)
|
|
374
|
+
- `docs/RFC-0012-run-regression-suites-and-llm-judging.md` (`Accepted`)
|
|
348
375
|
- `docs/PRIVACY-BASELINE.md`
|
|
349
376
|
|
|
350
377
|
## 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,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAE9E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MA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,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) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axiastudio/aioc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
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'",
|