Skip to content

feat: runtime-agnostic conformance harness with thin adapter protocol#82

Merged
sgriffiths merged 3 commits into
mainfrom
feat/conformance-adapters
Jul 3, 2026
Merged

feat: runtime-agnostic conformance harness with thin adapter protocol#82
sgriffiths merged 3 commits into
mainfrom
feat/conformance-adapters

Conversation

@aswhitehouse

Copy link
Copy Markdown
Collaborator

Summary

Resolves the conformance suite's biggest gap: it could only certify the Python reference runtime. The suite is now a true multi-runtime certification tool built on a thin adapter architecture.

  • spec/conformance/PROTOCOL.md — versioned adapter contract. Any runtime plugs in as an executable speaking JSON over stdin/stdout: --capabilities returns a manifest; otherwise one case in → one result envelope out. Includes a capability registry and the honesty rule: a runtime must not declare a capability it doesn't enforce, and must refuse specs using features it can't honour.
  • spec/conformance/harness/harness.py — single runtime-agnostic driver: case discovery, assertion engine, subprocess adapter invocation, capability-based skipping (PASS / FAIL / UNSUPPORTED), and markdown + JSON matrix reporting.
  • spec/conformance/adapters/ — thin wrappers (~100 lines each) for the Python reference runtime and the npm runtime. The old conformance_runner.py is now a deprecation shim.

npm runtime parity

Running the suite against the npm runtime immediately exposed real gaps, all fixed here:

  • Full OA result envelope (input, prompt, engine, raw_output, chain) — previously returned a different, undocumented shape
  • depends_on chain semantics matching the reference runtime (accumulating merge, chain key, cycle detection — a dependency cycle previously caused infinite recursion)
  • Required-input validation (CHAIN_INPUT_MISSING), legacy per-task prompt maps, caller prompt overrides, response_format: text
  • Injectable invokeFn for embedding/testing; deep-copied inputs at every task boundary (IIS immutability, now cross-runtime)
  • Unsupported feature guard: specs declaring tools: / sandbox: / behavioural_contract: are refused with UNSUPPORTED_FEATURE rather than silently degraded

Conformance matrix

Runtime Pass Fail Unsupported
python-reference 1.5.0 29 0 0
npm 1.5.1 27 0 2 (output-schema-validation, contracts)

New CI job builds both runtimes, runs both adapters, and uploads the matrix as an artifact.

Note: the npm TaskResult envelope change (providerengine, new fields) is breaking for library consumers — next npm publish should be 1.6.0.

Test plan

  • python -m spec.conformance.harness.harness --adapter python --adapter node — both green
  • Full pytest suite: 444 passed, 3 skipped
  • ruff check + format, mypy, tsc all clean
  • Deprecated shim (python -m spec.conformance.runner.conformance_runner) still works
  • npm CLI refuses examples/sandboxed-agent/spec.yaml with UNSUPPORTED_FEATURE

Made with Cursor

@aswhitehouse
aswhitehouse requested a review from sgriffiths as a code owner June 11, 2026 02:38
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open-agent-spec Ready Ready Preview, Comment Jul 3, 2026 1:47am

Request Review

Replace the Python-bound conformance runner with an adapter architecture
so any OA runtime can be certified against the same suite:

- PROTOCOL.md: versioned adapter contract (JSON over stdin/stdout),
  capability registry, and honesty rule (no silent feature degradation)
- harness/: single driver for discovery, assertions, capability
  skipping, and markdown/JSON conformance matrix reporting
- adapters/: thin wrappers for the Python reference runtime and the
  npm runtime; old conformance_runner.py becomes a deprecation shim
- npm runner parity: full result envelope (input/prompt/engine/
  raw_output/chain), chain cycle detection, required-input validation,
  legacy prompt maps, prompt overrides, response_format: text,
  injectable invokeFn, deep-copied inputs at task boundaries
- npm guard: refuse specs declaring tools:/sandbox:/behavioural_contract
  with UNSUPPORTED_FEATURE instead of silently ignoring them
- capability tags (requires:) on non-core cases; CI job runs both
  adapters and uploads the conformance matrix artifact

Matrix: python-reference 29/29 pass; npm 27 pass + 2 honest UNSUPPORTED.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

@sgriffiths sgriffiths left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you look at these comments

Comment thread npm/src/runner.ts Outdated
Comment thread npm/src/runner.ts Outdated
Comment thread npm/src/runner.ts Outdated
…reading

Three fixes from PR review:

- npm extractJson now mirrors the reference runtime exactly: strip a
  leading markdown fence, then JSON-parse the whole text — arrays and
  scalars are returned as parsed, and the divergent "first {...} block"
  heuristic is gone
- cycle detection in BOTH runtimes now uses a recursion stack (added on
  descent, removed on backtrack) instead of a globally-visited set,
  which falsely rejected legal diamond DAGs (D→[B,C], B→A, C→A)
- npm dependency runs now thread the delegation visited-set instead of
  passing a fresh Set, so DELEGATION_CYCLE_ERROR fires at the same
  point as the Python runtime

Locked in with three new conformance cases (json-array, json-scalar,
diamond-graph) that both runtimes pass, plus Python regression tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

@sgriffiths sgriffiths left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sgriffiths
sgriffiths merged commit 31b3d49 into main Jul 3, 2026
4 checks passed
@sgriffiths sgriffiths mentioned this pull request Jul 5, 2026
sgriffiths pushed a commit that referenced this pull request Jul 11, 2026
…p proposal

Reverts the two doc downgrades from 2999cde that were based on a
pre-#82 branch view. The conformance harness (spec.conformance.harness.harness)
and the node adapter have been on main since #82, and CI runs both runtimes,
so the original wording was correct against main:

- AGENTS.md: restore the both-runtime conformance command
  (harness.harness --adapter python --adapter node).
- README.md: restore "certified identical across runtimes".

The skill-wrapper engine-swap docs from 2999cde are kept.

Also flips the markdown-interop proposal to Status: Accepted, since
merging the README positioning accepts it.

Addresses review feedback from @aswhitehouse on #86.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdPprn1xTRiR1rGZf4jUfP
sgriffiths pushed a commit that referenced this pull request Jul 11, 2026
…p proposal

Reverts the two doc downgrades from 2999cde that were based on a
pre-#82 branch view. The conformance harness (spec.conformance.harness.harness)
and the node adapter have been on main since #82, and CI runs both runtimes,
so the original wording was correct against main:

- AGENTS.md: restore the both-runtime conformance command
  (harness.harness --adapter python --adapter node).
- README.md: restore "certified identical across runtimes".

The skill-wrapper engine-swap docs from 2999cde are kept.

Also flips the markdown-interop proposal to Status: Accepted, since
merging the README positioning accepts it.

Addresses review feedback from @aswhitehouse on #86.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XdPprn1xTRiR1rGZf4jUfP
sgriffiths pushed a commit that referenced this pull request Jul 12, 2026
…p proposal

Reverts the two doc downgrades from the previous commit, which were based on
a pre-#82 branch view. The conformance harness (spec.conformance.harness.harness)
and the node adapter have been on main since #82, and CI runs both runtimes,
so the original wording was correct against main:

- AGENTS.md: restore the both-runtime conformance command
  (harness.harness --adapter python --adapter node).
- README.md: restore "certified identical across runtimes".

The skill-wrapper engine-swap docs are kept.

Also flips the markdown-interop proposal to Status: Accepted, since merging
the README positioning accepts it.

Addresses review feedback from @aswhitehouse on #86.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants