Skip to content

feat(verification): scaffold spec-vs-implementation matrix v0 - #15

Closed
jakepresent wants to merge 7 commits into
mainfrom
jakepresent/verification-matrix-v0
Closed

feat(verification): scaffold spec-vs-implementation matrix v0#15
jakepresent wants to merge 7 commits into
mainfrom
jakepresent/verification-matrix-v0

Conversation

@jakepresent

Copy link
Copy Markdown
Collaborator

Scaffolds docs/verification/ with the v0 spec-vs-implementation matrix.

What this is

The matrix answers one question per row: does the system actually do what we claim it does? It feeds the on-every-release regression and triages into build / cut / push-back decisions when the answer is no.

See docs/verification/README.md for schema and status definitions.

What's in v0

  • README.md - schema, status values, how to add a row, weekly review cadence
  • matrix.md - 12 rows seeded from the existing tests/regression/risks/travel_planner_*.md failure-mode lists, reversed into capability claims (7 quality + 5 safety)
  • matrix.json - same data, machine-readable, for the regression harness to consume

Status

This is a draft PR intentionally. v0 is structural - the schema and seed rows are in, but:

  • Spec IDs (TP-Q-001 etc.) are placeholders pending the canonical scheme from @changliu2
  • All rows start in gap-build because no regression has run yet
  • evidence column is empty across the board - populates as the harness lands and PRs reference rows
  • Target dates assume the May 8 / May 15 / May 22 ladder from the Verification pillar task list

Followups (not in this PR)

  • Re-key spec IDs to canonical scheme when locked
  • First population pass against canonical specs (target May 8)
  • Wire the regression harness to consume matrix.json (target May 8 PR open)
  • Lock weekly triage cadence with @changliu2 (target May 8)

Part of the Verification pillar deliverables.

Jake Present and others added 2 commits May 5, 2026 16:47
Adds docs/verification/ with README, matrix.md, and matrix.json
seeded from the existing travel_planner quality and safety risk
specs. All rows start in 'gap-build' status with placeholder spec
IDs; will re-key once the canonical spec scheme is locked.

Part of the Verification pillar deliverables: the matrix tracks
claim-level coverage and feeds the on-every-release regression.
Adds 14 framework rows (AE-*) seeded from docs/adaptive-eval-spec.md
covering pipeline stages 1-5, CLI surface, target shapes, and the
LiteLLM cross-cutting claim. Existing 12 travel-planner rows preserved
verbatim under a new Scenario Coverage section with a v0->v1 caveat
about rewriting them into 'judge flags X' form once the harness exists.

README updated to lead with the framework-vs-scenario row distinction.
matrix.json bumped to schema_version 0.2 with a per-row 'type' field
(framework | scenario) and a top-level row_types description block.

All spec IDs remain placeholders pending canonical schemes from Chang.
jakepresent and others added 4 commits May 7, 2026 16:01
Loads matrix.json, dispatches each row to a registered verifier,
emits PASS / FAIL / NOT_IMPLEMENTED report.

v0 covers deterministic artifact-shape claims:
- AE-PIPE-S1..S5 (per-stage artifact existence + shape)
- AE-PIPE-ART (suite-level vs run-level artifact split)
- AE-CLI-RUN (artifacts/results/<suite>/<run>/ layout)

Run against existing travel-planner-langgraph-v1 demo-1 run:
  6 PASS / 1 FAIL (metrics.json missing) / 19 NOT_IMPLEMENTED.

The metrics.json FAIL is a real signal - either the run did not
reach Stage 5, or the spec misstates what Stage 5 produces. Worth
investigating as a build/cut/push-back triage on AE-PIPE-S5.
…ources

verify.py grows from 7 to 14 framework verifiers. New verifiers scan
the source tree for production-spec / arch-doc claims about the code
surface (CLI flags, target Session classes, LiteLLM routing) instead
of run artifacts.

New verifiers:
- AE-CLI-FORCE: --force-stage flag in p2m/cli.py
- AE-CLI-RESULTS: results list/status/compare subcommands
- AE-TGT-MODEL: HostedSession class
- AE-TGT-CALLABLE: CallableSession class
- AE-TGT-HTTP: HTTPEndpointSession class
- AE-TGT-OTEL: OTelTracedSession + SpanCollector
- AE-X-LITELLM: model_client routes through litellm

matrix.json notes field now cites the architecture design doc
(Aaron Aspinwall, 2026-04-30, aligned with adaptive-eval-spec.md
v1.2.0-draft) and the Adaptive Eval Production Spec consensus doc
as the authoritative sources, since the spec markdown is not in
this repo.

Result against travel-planner-langgraph-v1/baseline:
  13 PASS / 1 FAIL / 12 NOT_IMPLEMENTED out of 26 rows.

The lone FAIL is AE-PIPE-S5: matrix and arch doc both claim
Stage 5 metrics writes metrics.json. p2m/stages/ has no metrics
module; STAGES registry has 7 stages, none named metrics; judge.py
does not write metrics.json. Metrics are computed on demand by
'p2m results status' from scores.jsonl. Triage call between
build (add the metrics stage to match the spec) and cut (amend
spec since on-demand computation works). Lean build, since the
spec explicitly persists metrics.json and CI consumers will want
a stable file.
Chang's PR #28 lands the P0 engineering CI lane (11-cell smoke matrix,
blocks on P2M bugs, warns on external errors). Chang explicitly carved
out the P1 science lane in PR description and Teams chat:

  'science quality - did our PR regress on the science efficacy
  inadvertently - trickier to measure and require large runs to gain
  statistical significance/ensure not spurious'

This matrix + verify.py is the foundation for that follow-up PR. The
scenario rows (TP-*) will eventually be grounded in the 11-cell example
matrix Chang set up (travel_planner_*, phoenix_auto_trace/*, pipes/*).
Replaces 12 placeholder TP-* rows (scraped from
tests/regression/risks/travel_planner_*.md) with 14 grounded
scenario rows from Chang's May 7 P0 scoping in Teams chat:

  'our P0 scenario will just have 2 agent scenarios - health
  assistant and travel planner - but to probe our system breadth
  (frameworks/endpoints) and scalability (100, 1k, 10k seeds, etc.)'

New scenario rows:
- 2 behavior rows (P2M-AGENT-HEALTH, P2M-AGENT-TRAVEL)
- 9 framework breadth rows (langgraph, neurosan,
  phoenix-multinode + 5 phoenix-* endpoint variants, simulated)
  - all derived from PR #28's example matrix
- 3 scalability rows (P2M-SCALE-100/1K/10K)

Each row has a 'source' field pointing to the canonical config
file or the chat clarification. Total rows 26 -> 28 (frameworks
unchanged at 14, scenarios go 12 -> 14).

Run state vs travel-planner-langgraph-v1/baseline:
  13 PASS / 1 FAIL / 14 NOT_IMPLEMENTED out of 28 rows.
@changliu2

changliu2 commented May 7, 2026

Copy link
Copy Markdown
Collaborator

@jakepresent — suggestion for 1.3 Target shapes: split AE-TGT-OTEL into two rows so the matrix actually pins the two distinct customer integration patterns we ship demos for. Source of truth for the framework list is examples/phoenix_auto_trace/.

spec_id claim status evidence owner target_date
AE-TGT-OTEL-PHX Phoenix/OpenInference auto-instrumentation (from phoenix.otel import register; register(auto_instrument=True)) feeds OTel traces to the judge for the 14 Azure-routable supported frameworks shipped as runnable demos: autogen, crewai, dspy, haystack, instructor, langchain, langgraph, litellm, llamaindex, openai, openai_agents, openai_router, pydantic_ai, smolagents (P0; LangGraph as the verified anchor) gap-build examples/phoenix_auto_trace/travel_*.py + eval_*.yaml; CI evidence will land via #28 once that merges jakepresent 2026-05-22
AE-TGT-OTEL-CUSTOM Custom OTel SDK instrumentation — manual tracer.start_as_current_span(...) spans following OpenInference semantic conventions — is captured by the same target.trace block; verified end-to-end against the multi-agent NeurOSan-style example (P0) gap-build examples/travel_planner_neurosan/agent.py + eval_config.yaml jakepresent 2026-05-22

The remaining 7 demos in phoenix_auto_trace/ (anthropic, bedrock, google_adk, google_genai, groq, mistralai, portkey) target non-Azure providers — fine to leave out of the P0 PHX row since the eval credentials we standardize on are Azure. Our 3P budget request is still pending. They could become a P2 row if/when we want to certify multi-provider OTel ingest.

One implementation caveat to know about while drafting these rows: target.trace.backend is currently a free-form string with no enum validation (p2m/core/config_model.py:94), and the runtime treats every value identically — OTelTracedSession labels itself "trace_backend": "otel" regardless of YAML (p2m/core/otel_session.py:99-105). So both demos express as trace.backend: phoenix in YAML today; the PHX/CUSTOM distinction lives in customer code (auto-instrument vs hand-rolled spans), not the config value. Worth wording the row claims around the integration pattern, not the backend string, so the spec doesn't drift if we later validate backend as an enum.

@changliu2

Copy link
Copy Markdown
Collaborator

@jakepresent — yes, lock in the current scheme as canonical. The structure you picked is already stable on the right axis (architectural subsystems, not spec-doc section numbers), so re-keying against a hypothetical docs/adaptive-eval-spec.md later would actually be a regression — section numbers churn, subsystems don't.

Canonical ID convention (please add this to docs/verification/README.md, e.g. as a ## ID convention section):

Framework rowsAE-{SUBSYSTEM}-{IDENTIFIER}

  • AE-PIPE-S{1..5} — pipeline stage claims (S1=Policy, S2=Seeds, S3=Rollout, S4=Judge, S5=Metrics)
  • AE-PIPE-{TOPIC} — non-stage pipeline claims (e.g. AE-PIPE-ART for artifact layout)
  • AE-CLI-{COMMAND} — CLI surface (e.g. AE-CLI-RUN, AE-CLI-FORCE, AE-CLI-RESULTS)
  • AE-TGT-{SHAPE} — target shapes (e.g. AE-TGT-MODEL, AE-TGT-CALLABLE, AE-TGT-HTTP, AE-TGT-OTEL-PHX, AE-TGT-OTEL-CUSTOM)
  • AE-X-{TOPIC} — cross-cutting concerns (e.g. AE-X-LITELLM)

Scenario rows{SCENARIO}-{CATEGORY}-{NNN}

  • {SCENARIO} — short scenario prefix (TP = travel planner; future scenarios pick their own 2–3 letter prefix and register it in README.md)
  • {CATEGORY} — single-letter category (Q = quality, S = safety; add letters as new categories appear)
  • {NNN} — zero-padded sequential number, never recycled (deleted rows stay deleted; new rows get the next number)

Stability rules:

  • IDs survive row deletion (gap-cut) — never recycled to new rows.
  • IDs are intentionally not anchored to spec-doc section numbers. docs/adaptive-eval-spec.md doesn't exist yet, and even when it lands, section numbers will renumber more often than subsystem boundaries shift.
  • When you rename a row's claim text, keep the same ID. The ID identifies the verification slot, not its current wording.

Cleanup that goes with this (please bundle into the same PR if it's quick, or follow-up otherwise):

  • Drop the "placeholder pending canonical schemes from @changliu2" caveats from matrix.md (top), docs/verification/README.md (final paragraph), and the PR body.
  • Drop the docs/adaptive-eval-spec.md reference at the top of matrix.md — that doc doesn't exist; it would be a forward-looking link without a target. Replace with: "Framework rows seeded from the implementation surface in p2m/ (pipeline stages, CLI commands, target shapes); scenario rows seeded from tests/regression/risks/travel_planner_*.md."

…it OTel row, refresh README/matrix.md

Two changes from Chang's review on PR #15:

1. Split AE-TGT-OTEL into two rows reflecting the two distinct
   integration patterns we ship demos for:
   - AE-TGT-OTEL-PHX: Phoenix/OpenInference auto-instrumentation
     across 14 Azure-routable supported frameworks
   - AE-TGT-OTEL-CUSTOM: custom OTel SDK instrumentation following
     OpenInference semantic conventions, anchored on the NeurOSan
     multi-agent example
   Both verifiers added to verify.py.

2. Lock the existing spec_id scheme as canonical (architectural
   subsystems, not spec-doc section numbers). Document the ID
   convention in docs/verification/README.md as a new section, with
   stability rules (IDs survive row deletion, no recycling).

Cleanup bundled in:
- Drop 'placeholders pending canonical schemes' caveats from
  matrix.md and README.md.
- Replace docs/adaptive-eval-spec.md reference with the actual
  source (implementation surface in p2m/, Aaron's arch doc,
  production spec).
- Rebuild matrix.md to reflect the locked scheme + the regrounded
  P2M-* scenario rows from the previous commit.

Run state vs travel-planner-langgraph-v1/baseline:
  14 PASS / 1 FAIL / 14 NOT_IMPLEMENTED out of 29 rows.

The PHX verifier passes today with 5/14 framework demos present
(LangGraph anchor + 4 others). Missing demos surface as gap-build
in the detail string.
@jakepresent

Copy link
Copy Markdown
Collaborator Author

Closing as stale after the release/rename work. The verification-matrix slice was useful planning context, but it is no longer current against the public ASSERT tree. We can reopen a fresh scoped PR if the verification matrix becomes active again.

@jakepresent jakepresent closed this Jun 4, 2026
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