426e9eeabd
Benchmark Bridge Tests / benchmark (bunx @biomejs/biome check packages/lifeops-bench/src, benchmark-lint) (push) Waiting to run
Benchmark Bridge Tests / benchmark (bunx vitest run --config packages/lifeops-bench/vitest.config.ts --root packages/lifeops-bench --passWithNoTests, benchmark-tests) (push) Waiting to run
Build Agent Image / build-and-push (push) Waiting to run
Chat shell gestures / Chat shell gesture + parity e2e (push) Waiting to run
ci / test (push) Waiting to run
ci / lint-and-format (push) Waiting to run
ci / build (push) Waiting to run
ci / dev-startup (push) Waiting to run
Cloud Gateway Discord / Test (push) Waiting to run
Cloud Gateway Webhook / Test (push) Waiting to run
Cloud Tests / lint-and-types (push) Waiting to run
Cloud Tests / unit-tests (push) Waiting to run
Cloud Tests / integration-tests (push) Waiting to run
Cloud Tests / e2e-tests (push) Blocked by required conditions
CodeQL Advanced / Analyze (javascript-typescript) (push) Waiting to run
Deploy Apps Worker (Product 2) / Determine environment (push) Waiting to run
Deploy Apps Worker (Product 2) / Deploy apps worker to apps-control host (${{ needs.determine-env.outputs.environment }}) (push) Blocked by required conditions
Deploy Eliza Provisioning Worker / Determine environment (push) Waiting to run
Deploy Eliza Provisioning Worker / Deploy worker to Hetzner host (${{ needs.determine-env.outputs.environment }} @ ${{ needs.determine-env.outputs.deployment_sha }}) (push) Blocked by required conditions
Dev Smoke / Classify changed paths (push) Waiting to run
Dev Smoke / bun run dev onboarding chat (push) Blocked by required conditions
Dev Smoke / Vite HMR dependency-level smoke (push) Blocked by required conditions
Electrobun Submodule Guard / electrobun gitlink is fetchable (push) Waiting to run
gitleaks / gitleaks (push) Waiting to run
Markdown Links / Relative Markdown Links (push) Waiting to run
Publish @elizaos/example-code / check_npm (push) Waiting to run
Publish @elizaos/example-code / publish_npm (push) Blocked by required conditions
Publish @elizaos/plugin-elizacloud / verify_version (push) Waiting to run
Publish @elizaos/plugin-elizacloud / publish_npm (push) Blocked by required conditions
Quality (Extended) / Homepage Build (PR smoke) (push) Waiting to run
Quality (Extended) / Comment-only diff guard (push) Waiting to run
Quality (Extended) / Format + Type Safety Ratchet (push) Waiting to run
Quality (Extended) / Develop Gate (secret scan + UI determinism) (push) Waiting to run
Quality (Extended) / Develop Gate (lint) (push) Waiting to run
Sandbox Live Smoke / Sandbox live smoke (push) Waiting to run
Snap Build & Test / Build Snap (amd64) (push) Waiting to run
Snap Build & Test / Build Snap (arm64) (push) Waiting to run
supply-chain / sbom (push) Waiting to run
supply-chain / vulnerability-scan (push) Waiting to run
Build, Push & Deploy to Phala Cloud / build-and-push (push) Waiting to run
Test Packaging / Validate Packaging Configs (push) Waiting to run
Test Packaging / PyPI on Python ${{ matrix.python }} (push) Waiting to run
Test Packaging / Pack & Test JS Tarballs (push) Waiting to run
Test Packaging / elizaos CLI global-install smoke (node + bun) (push) Waiting to run
UI Fixture E2E / ui-fixture-e2e (push) Waiting to run
UI Fixture E2E / fixture-e2e (push) Waiting to run
UI Story Gate / story-gate (push) Waiting to run
vault-ci / test (macos-latest) (push) Waiting to run
vault-ci / test (ubuntu-latest) (push) Waiting to run
vault-ci / test (windows-latest) (push) Waiting to run
vault-ci / app-core wiring tests (push) Waiting to run
verify-patches / verify patches/CHECKSUMS.sha256 (push) Waiting to run
Voice Benchmark Smoke / voice-emotion fixture smoke (push) Waiting to run
Voice Benchmark Smoke / voiceagentbench fixture smoke (push) Waiting to run
Voice Benchmark Smoke / voicebench-quality unit smoke (push) Waiting to run
Voice Benchmark Smoke / voicebench TypeScript unit (no audio) (push) Waiting to run
Voice Benchmark Smoke / voice bench smoke summary (push) Blocked by required conditions
Windows CI / windows ([bun run --cwd packages/app-core test bun run --cwd packages/elizaos test bun run --cwd packages/cloud/shared test], app-and-cli) (push) Waiting to run
Windows CI / windows ([bun run --cwd packages/scenario-runner test bun run --cwd packages/vault test bun run --cwd packages/security test bun run --cwd plugins/plugin-coding-tools test], framework-packages) (push) Waiting to run
Windows CI / windows ([bun run --cwd plugins/plugin-elizacloud test bun run --cwd plugins/plugin-discord test bun run --cwd plugins/plugin-anthropic test bun run --cwd plugins/plugin-openai test bun run --cwd plugins/plugin-app-control test bun run --cwd plugins/pl… (push) Waiting to run
Windows CI / windows ([node packages/scripts/run-turbo.mjs run build --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/agent --concurrency=4 node packages/scripts/run-bash-linux-only.mjs scripts/verify-riscv64-buildpaths.sh node packages/scripts/run… (push) Waiting to run
Windows CI / windows ([node packages/scripts/run-turbo.mjs run typecheck --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/cloud-shared --concurrency=4 bun run --cwd packages/core test bun run --cwd packages/shared test], core-runtime, 75) (push) Waiting to run
Test Packaging / Build & Test PyPI Package (push) Waiting to run
Voice Workbench / headless workbench (mocked backends) (push) Has been cancelled
Voice Workbench / real acoustic lane (nightly, provisioned only) (push) Has been cancelled
198 lines
6.8 KiB
Python
198 lines
6.8 KiB
Python
"""Pin docs/RESULTS_MATRIX.md to the benchmark registry and adapter discovery.
|
|
|
|
#11374: the results matrix is a human-readable artifact, but its registered and
|
|
adapter-only rows must be owned by tests just like orchestrator/ci_coverage.py.
|
|
This keeps a registry addition/removal from silently drifting the committed
|
|
scoreboard.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
BENCHMARKS_ROOT = Path(__file__).resolve().parent.parent
|
|
PACKAGES_ROOT = BENCHMARKS_ROOT.parent
|
|
sys.path.insert(0, str(BENCHMARKS_ROOT))
|
|
sys.path.insert(0, str(PACKAGES_ROOT))
|
|
|
|
from benchmarks.orchestrator.adapters import discover_adapters # noqa: E402
|
|
from benchmarks.orchestrator.ci_coverage import ci_lane_for # noqa: E402
|
|
from benchmarks.registry import get_benchmark_registry # noqa: E402
|
|
|
|
MATRIX_PATH = BENCHMARKS_ROOT / "docs" / "RESULTS_MATRIX.md"
|
|
CERTIFICATION_PATH = BENCHMARKS_ROOT / "docs" / "CERTIFICATION.md"
|
|
MATRIX_COLUMNS = ("benchmark", "lane", "eliza", "hermes", "openclaw", "smithers")
|
|
CERTIFICATION_COLUMNS = ("benchmark", "eliza", "hermes", "openclaw", "smithers")
|
|
NON_SCORE_CELLS = {"not-run", "gated", "incompatible"}
|
|
SCORE_RE = re.compile(r"^(?:0|1)(?:\.\d+)?$")
|
|
|
|
|
|
def _markdown_text(path: Path) -> str:
|
|
return path.read_text(encoding="utf-8")
|
|
|
|
|
|
def _strip_cell(cell: str) -> str:
|
|
return re.sub(r"[*`]", "", cell.strip()).strip()
|
|
|
|
|
|
def _split_table_row(line: str) -> tuple[str, ...]:
|
|
return tuple(_strip_cell(cell) for cell in line.strip().strip("|").split("|"))
|
|
|
|
|
|
def _is_separator(row: tuple[str, ...]) -> bool:
|
|
return bool(row) and all(re.fullmatch(r":?-{3,}:?", cell.strip()) for cell in row)
|
|
|
|
|
|
def _table_after_heading(text: str, heading_re: str) -> list[tuple[str, ...]]:
|
|
heading_match = re.search(heading_re, text, flags=re.MULTILINE)
|
|
assert heading_match, f"heading not found: {heading_re}"
|
|
|
|
rows: list[tuple[str, ...]] = []
|
|
in_table = False
|
|
for line in text[heading_match.end() :].splitlines():
|
|
if line.startswith("|"):
|
|
in_table = True
|
|
row = _split_table_row(line)
|
|
if not _is_separator(row):
|
|
rows.append(row)
|
|
continue
|
|
if in_table:
|
|
break
|
|
|
|
assert rows, f"table not found after heading: {heading_re}"
|
|
return rows
|
|
|
|
|
|
def _section_count(text: str, heading_re: str) -> int:
|
|
match = re.search(heading_re, text, flags=re.MULTILINE)
|
|
assert match, f"heading not found: {heading_re}"
|
|
return int(match.group("count"))
|
|
|
|
|
|
def _rows_by_benchmark(
|
|
text: str,
|
|
heading_re: str,
|
|
expected_columns: tuple[str, ...],
|
|
) -> dict[str, tuple[str, ...]]:
|
|
rows = _table_after_heading(text, heading_re)
|
|
header = rows[0]
|
|
assert header == expected_columns
|
|
|
|
parsed: dict[str, tuple[str, ...]] = {}
|
|
for row in rows[1:]:
|
|
assert len(row) == len(expected_columns), f"malformed row: {row!r}"
|
|
benchmark_id = row[0]
|
|
assert benchmark_id not in parsed, f"duplicate matrix row: {benchmark_id}"
|
|
parsed[benchmark_id] = row
|
|
return parsed
|
|
|
|
|
|
def _registered_registry_ids() -> frozenset[str]:
|
|
return frozenset(entry.id for entry in get_benchmark_registry(PACKAGES_ROOT))
|
|
|
|
|
|
def _adapter_only_ids(registry_ids: frozenset[str]) -> frozenset[str]:
|
|
adapter_ids = frozenset(discover_adapters(PACKAGES_ROOT).adapters)
|
|
return adapter_ids - registry_ids
|
|
|
|
|
|
def _certified_scores() -> dict[str, tuple[str, str, str, str]]:
|
|
rows = _rows_by_benchmark(
|
|
_markdown_text(CERTIFICATION_PATH),
|
|
r"^## Posted 4-harness results\b.*$",
|
|
CERTIFICATION_COLUMNS,
|
|
)
|
|
return {benchmark_id: row[1:] for benchmark_id, row in rows.items()}
|
|
|
|
|
|
def _assert_score_cells_are_honest(
|
|
benchmark_id: str,
|
|
score_cells: tuple[str, ...],
|
|
certified_scores: dict[str, tuple[str, str, str, str]],
|
|
) -> None:
|
|
if any(SCORE_RE.fullmatch(cell) for cell in score_cells):
|
|
assert benchmark_id in certified_scores, (
|
|
f"{benchmark_id} has numeric matrix score(s) {score_cells} but is "
|
|
"not backed by the Posted 4-harness results table in CERTIFICATION.md"
|
|
)
|
|
assert score_cells == certified_scores[benchmark_id], (
|
|
f"{benchmark_id} matrix scores {score_cells} do not match "
|
|
f"CERTIFICATION.md {certified_scores[benchmark_id]}"
|
|
)
|
|
return
|
|
|
|
unexpected = sorted(set(score_cells) - NON_SCORE_CELLS)
|
|
assert not unexpected, f"{benchmark_id} has unsupported matrix cell(s): {unexpected}"
|
|
|
|
|
|
def test_registered_results_matrix_rows_match_registry_exactly() -> None:
|
|
text = _markdown_text(MATRIX_PATH)
|
|
registry_ids = _registered_registry_ids()
|
|
registered_rows = _rows_by_benchmark(
|
|
text,
|
|
r"^## Registered benchmarks \((?P<count>\d+)\)$",
|
|
MATRIX_COLUMNS,
|
|
)
|
|
|
|
assert _section_count(text, r"^## Registered benchmarks \((?P<count>\d+)\)$") == len(
|
|
registry_ids
|
|
)
|
|
assert set(registered_rows) == set(registry_ids)
|
|
|
|
|
|
def test_registered_results_matrix_lanes_match_ci_coverage() -> None:
|
|
text = _markdown_text(MATRIX_PATH)
|
|
registered_rows = _rows_by_benchmark(
|
|
text,
|
|
r"^## Registered benchmarks \((?P<count>\d+)\)$",
|
|
MATRIX_COLUMNS,
|
|
)
|
|
|
|
for benchmark_id, row in registered_rows.items():
|
|
assert row[1] == ci_lane_for(benchmark_id), (
|
|
f"{benchmark_id} lane {row[1]!r} does not match "
|
|
f"ci_coverage.py {ci_lane_for(benchmark_id)!r}"
|
|
)
|
|
|
|
|
|
def test_registered_results_matrix_scores_match_certification_or_are_explicitly_unrun() -> None:
|
|
text = _markdown_text(MATRIX_PATH)
|
|
registered_rows = _rows_by_benchmark(
|
|
text,
|
|
r"^## Registered benchmarks \((?P<count>\d+)\)$",
|
|
MATRIX_COLUMNS,
|
|
)
|
|
certified_scores = _certified_scores()
|
|
|
|
for benchmark_id, row in registered_rows.items():
|
|
_assert_score_cells_are_honest(benchmark_id, row[2:], certified_scores)
|
|
|
|
|
|
def test_adapter_only_results_matrix_rows_match_discovery_minus_registry() -> None:
|
|
text = _markdown_text(MATRIX_PATH)
|
|
registry_ids = _registered_registry_ids()
|
|
adapter_only_ids = _adapter_only_ids(registry_ids)
|
|
adapter_rows = _rows_by_benchmark(
|
|
text,
|
|
r"^## Adapter-discovered / non-registry \((?P<count>\d+)\)$",
|
|
MATRIX_COLUMNS,
|
|
)
|
|
|
|
assert _section_count(
|
|
text, r"^## Adapter-discovered / non-registry \((?P<count>\d+)\)$"
|
|
) == len(adapter_only_ids)
|
|
assert set(adapter_rows) == set(adapter_only_ids)
|
|
|
|
for benchmark_id, row in adapter_rows.items():
|
|
assert row[1] == ci_lane_for(benchmark_id), (
|
|
f"{benchmark_id} lane {row[1]!r} does not match "
|
|
f"ci_coverage.py {ci_lane_for(benchmark_id)!r}"
|
|
)
|
|
unexpected = sorted(set(row[2:]) - NON_SCORE_CELLS)
|
|
assert not unexpected, (
|
|
f"{benchmark_id} is adapter-only and must not carry numeric score "
|
|
f"cells in RESULTS_MATRIX.md: {unexpected}"
|
|
)
|