Skip to content

Beta Contract Audit (Pre-Beta)

Generated from the repository source of truth. Source file: /docs/BETA-CONTRACT-AUDIT.md.

  • Date: 2026-03-03
  • Contract: docs/BETA-CONTRACT.md
  • Target: 0.1.0-beta.1 freeze readiness

Contract alignment is green on frozen runtime behavior and public surface.

Frozen behaviorImplementation referenceTest coverageStatus
Model proposals are never execution permissionssrc/run.ts (evaluateToolPolicy, evaluateHandoffPolicy, execution only after decision === "allow")src/tests/unit/policy.unit.ts, src/tests/unit/handoff.unit.ts, src/tests/regression/policy-default-deny.regression.tsOK
Tools/handoffs are default-deny unless explicit allowsrc/run.ts (missing policy => policy_not_configured)src/tests/unit/policy.unit.ts, src/tests/unit/handoff.unit.tsOK
Missing/thrown/invalid policy map to deterministic deny reasonssrc/run.ts (policy_not_configured, policy_error, invalid_policy_result)src/tests/unit/policy.unit.ts, src/tests/unit/handoff.unit.tsOK
run(...) defaults to non-stream mode when stream is omittedsrc/run.ts (only options.stream === true returns StreamedRunResult)src/tests/unit/run.unit.tsOK
Tool/handoff outputs use normalized envelopesrc/run.ts (toAllowedToolResultEnvelope, toDeniedToolResultEnvelope)src/tests/unit/policy.unit.ts, src/tests/unit/handoff.unit.ts, src/tests/unit/run-record.unit.tsOK
Run record emission is best-effort and does not alter runtime success/failuresrc/run-recorder-runtime.ts (emit swallows sink errors)src/tests/unit/run-record.unit.ts (sink failure case)OK
Frozen surfaceImplementation referenceStatus
Agent<TContext> fields (name, handoffDescription, instructions, promptVersion, model, modelSettings, tools, handoffs, outputGuardrails)src/agent.tsOK
RunContext<TContext> shape/usagesrc/run-context.ts, src/run.tsOK
run(...) overloads + options (context, maxTurns, logger, policies, record) + outputssrc/run.ts, src/types.tsOK
Policy contracts and helpers (PolicyResult, ToolPolicyInput, HandoffPolicyInput, allow, deny)src/policy.tsOK
Frozen error classessrc/errors.tsOK
RunRecord / RunRecordOptions surfacesrc/run-record.tsOK
  1. This audit is scoped to frozen contract items only; non-frozen areas remain intentionally flexible (logger schema details, examples structure, provider payload internals).
  2. The handoff allow envelope path is now explicitly asserted in unit tests (src/tests/unit/handoff.unit.ts).
  3. Continuous verification for pre-beta candidates is enforced by GitHub Actions (.github/workflows/ci.yml) running npm run test:ci on push, pull_request, and manual dispatch.