feat: benchmark manifest schema and selection mechanism - #128
Open
randomparity wants to merge 19 commits into
Open
feat: benchmark manifest schema and selection mechanism#128randomparity wants to merge 19 commits into
randomparity wants to merge 19 commits into
Conversation
Spec, ADR 0019 (Python for benchmark infra), and implementation plan for issue #119. The manifest schema, deterministic selection, per-task validation, and issue materialization mechanisms encode the v1 benchmark protocol.
Address review finding: clarify that huggingface_hub/pyarrow version pinning belongs to #120's environment lock, not the ADR or manifest. The protocol pins dataset/evaluator revisions, not library versions.
Add Docker error-handling contract, materialization idempotency, agent-visible isolation boundary, cleanup-on-failure, license source clarification, manifest digest timing, JSONL malformed-row handling, and topology digest definition.
Clarify: contract mismatch is fatal, cleanup failures are warnings, missing license uses license-missing exclusion, instance_id is required JSONL field, repo creation is pre-run prerequisite, topology digest timing and failure semantics.
If fewer than two groups qualify, selection stops and reports the shortfall. Discretionary replacement is forbidden per the protocol.
A git apply --check failure is a validation finding (exit 1), not an infrastructure failure — the patch does not apply cleanly at this revision.
Address spec review cap findings: target Python 3.12 for runner safety, UTC for ledger filenames, note serial-execution requirement for selection and materialization.
Add: field presence checks, validate_fn stub example, validate_task CLI exit codes, Docker availability pre-check, cleanup tests, partial-failure semantics, materialization error tests, network resilience notes.
Fix validate_fn stub to raise ValidationError. Add test_patch type check, duplicate-repo test, exit-code test, malformed JSON test, Docker pre-check acceptance.
Add ruff.toml (py312, line-length 100), py-test and py-lint Justfile recipes wired into commit-check and verify, ruff to CI brew install, and benchmarks/ package init. unittest discovers test_*.py; exit 5 (no tests) tolerated during incremental builds.
Add __pycache__ and *.pyc to .gitignore (Python bytecode contains host paths). Pinned protocol values and canonical-JSON SHA-256 digest function for the v1 benchmark manifest.
Pure-Python validator checking protocol pins, group/task counts, repository disjointness, SHA format, license allowlist, GitHub URL format, field presence, and digest match. CLI exits 0/1/2. 30 tests covering valid manifest and each violation.
Enumerate SWE-bench_Verified test split by ascending instance_id, filter by license eligibility, enumerate 3-task combinations per repo in lexical order, test candidate common revisions, select first two repository-disjoint qualifying groups. validate_fn seam for testing. 43 tests covering filtering, ordering, selection, and ledger completeness.
Clone, apply gold patch, check Docker availability, run pre-patch failure and post-patch pass checks via stubbable subprocess runner. ValidationError distinguishes infrastructure faults from validation findings. CLI exits 0/1/2. 10 tests covering all paths.
Normalize SWE-bench_Verified rows to canonical JSONL (parse JSON-string FAIL_TO_PASS/PASS_TO_PASS, handle missing issue_url, malformed JSON). Lazy-imports huggingface_hub and pyarrow. 7 tests.
Fix gold patch not passed to git apply (critical). Add repo format validation to prevent command injection. Add gh auth and repo existence pre-checks. Add idempotency via existing-issue detection. Add author identity exclusion framework per protocol.
Simplification pass: hoist 'import re' from function-level to module-level in select_tasks.py and validate_task.py.
Owner
Author
Review — issue #119
Review arms run:
Suppressed: 0. Deferrals: 0. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds the machine-readable task-manifest schema and the deterministic selection,
validation, and materialization mechanisms that encode the v1 benchmark protocol
(
docs/benchmarks/adept-workflow-v1.md).Components
benchmarks/manifest.py— pinned protocol constants (dataset/evaluator revisions, supported licenses, required fields) and canonical-JSON SHA-256 digest computation.benchmarks/validate_manifest.py— pure-Python validator with 16 constraint checks (protocol pins, group/task counts, repository disjointness, SHA format, license allowlist, GitHub URL format, field presence, digest match). CLI exits 0/1/2.benchmarks/select_tasks.py— deterministic selection: enumerate SWE-bench_Verified test split by ascending instance_id, filter by license/author eligibility, enumerate 3-task combinations per repo in lexical order, test candidate common revisions, select first two repository-disjoint qualifying groups.validate_fnseam for testing.benchmarks/validate_task.py— per-task validation: clone, apply gold patch via stdin, check Docker availability, run pre-patch failure and post-patch pass checks. Repo format validation prevents command injection.benchmarks/materialize_issues.py— create benchmark-owned GitHub issues feat: import the skills tree, without the companion or prose assertions #1/docs: design first-party replacements for the superpowers-derived skills #2/docs: plan the companion strip and migration realignment #3 per group with exact labels. Idempotency via existing-issue detection. Dry-run mode. Topology digest.benchmarks/fetch_dataset.py— normalize SWE-bench_Verified rows to canonical JSONL. Lazy-importshuggingface_hubandpyarrow.Toolchain
ruff.toml— Python 3.12 target, line length 100, lint rules E/F/W/I/UP/B.py-test(unittest discovery) andpy-lint(ruff check + format) recipes wired intocommit-checkandverify.ruffadded to Homebrew install line..gitignore—__pycache__/and*.pyc(Python bytecode contains host paths).Design records
Testing
68 unittest tests across 7 test modules. No network, no Docker, no GitHub API — all external interactions are stubbed via callable parameters.
just verifygreen (all shell gates, Python tests, ruff lint, format, records, public-safety, plugin-check, actions-check).Review
ADR, spec, and plan adversarially reviewed via
$gauntlet(ADR approved; spec 5-iteration review; plan 2-iteration review). Branch diff reviewed via$trial-loop(approved, 3 iterations, 5 findings fixed). Security scan via$detect-evil(clean — repo name validation, noshell=True, pinned revisions).Closes #119