codexwright

Bounded Extensions and Version Negotiation

Generated projects carry two small metadata files next to architecture.json. Both are produced by scaffold() and included in the file proposal.

workflow.extensions.json

{
  "schema_version": "1.0",
  "target_runtime": {"name": "codex_sdk"},
  "deploy_targets": [],
  "eval_metrics": []
}

Validation is deliberately narrow:

src/codexwright/extensions.py owns builder-side loading and validation. The generated runtime duplicates the same small checks instead of importing the builder package, so a generated project stays standalone.

Custom eval metrics

mas eval --dataset tests/eval.json --metric accuracy --metric latency_budget

--metric is repeatable and resolves each name from eval_metrics in workflow.extensions.json. The metric function is called as function(case, output, state) and must return either:

A false result fails the case, and the normalized result is stored per case in the report under metrics. Missing metrics, import errors, a wrong signature and non-bool/dict results are dataset-level failures with explicit errors. Assertions run first; metrics only run for cases whose assertions passed.

There is no built-in LLM judge. An LLM-as-judge is a custom metric whose function calls a model through its own reviewed code.

Trust boundary: custom metrics are project code executed in process with the workflow’s privileges. They are not sandboxed, so only declare metric modules you have read and trust.

Build metadata and version negotiation

scaffold() also writes workflow.build.json:

{
  "schema_version": "1.0",
  "builder": "codexwright",
  "builder_version": "0.5.0",
  "spec_schema_version": "1.0",
  "created_at": "2026-01-01T00:00:00Z"
}

run_workflow.py reads it before running. If the spec schema major/minor does not match the version the runtime supports, the run refuses with a clear error. Older projects without workflow.build.json are treated as legacy: the runtime warns once and continues, and it never rewrites or silently upgrades the file.

mas info

prints builder and spec schema versions, the target runtime, the negotiation result and the extension summary (declared, legacy or invalid). It exits 1 when the build metadata is incompatible or the manifest is invalid.

Failure clustering

mas analyze --report artifacts/eval_20260101T000000Z.json

analyze groups failed and error cases deterministically by status and normalized error text (numbers, decimals and hex IDs are replaced with stable placeholders). Output:

{"schema_version": "1.0", "clusters": [{"key": "failed: Timeout after <n>s", "count": 2, "cases": ["a", "b"]}], "summary": {}}

summary records total cases, failed and error counts, and the cluster count. It exits 0 when the report is analyzed and 1 for a malformed report. This is plain text clustering, not semantic judging.

Limits