Repository navigation
feat(core): add the shared adapter registry and extension-point contracts - #341
Merged
Merged
Conversation
27 tasks
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.
Purpose
Add
src/harness/adapters.py, the shared vocabulary that the track migrations (#318, #338, #316) build on. Each track keeps its own call signature, because a fetch, a search, an extraction and a browser episode return different things; this module defines only what every track shares.flowchart LR R["Registry[T]<br/>one per extension point"] --> M["MethodAdapter<br/>name, capabilities,<br/>identity, validate"] R --> B["BenchmarkAdapter<br/>cases, inputs, score,<br/>populations"] R --> T["TrackStages<br/>run · score · report · check ·<br/>package · publish · export"] M -. "track adds" .-> MC["fetch / search / extract / episode"]Decisions
Registrytype for methods, benchmarks and tracks. Command choices, validation sets and contract tests derive fromnames(); a second hardcoded name list is not allowed.Capabilitiesis how shared code branches: declared flags and values, never instance names.MethodAdapterandBenchmarkAdapterareProtocols, so existing classes (Web FetchProvider, Web SearchAdapter, Web Extract benchmark modules) conform by adding methods rather than by changing base classes.TrackStagesfixes the seven stage verbs; extra preparation commands cannot shadow a fixed verb.No caller changes in this PR; the migrations adopt it track by track.
Verification
uv run --frozen --extra test python -m pytest tests/test_adapters.py(5 passed),ruff checkandruff format --checkclean.Part of #318 and #338.