Repository navigation
Description
Task
T-050a· Milestone M3 — Oracles + runner + store · Size S · Priority P0 · Epic #3Implements FR-SEL-005 · FR-SEL-006 · FR-SEL-007 · PR-19
Branch
feat/t-050a-strategy-abc-template-method-dedupe— one task = one branch = one PR (doc 32 §6)
Summary
Implement selection/base.py (Strategy ABC exactly per doc 05 §4 with PLUGIN_API_VERSION) using the Template Method pattern: public propose() enforces the five contract rules around a protected _propose_impl(); selection/registry.py loads strategies from entry-point group roboprobe.strategies.
Context / motivation
Enforcing bounds, feasibility, de-duplication, INVALID filtering and determinism once in the base class means individual strategies cannot violate the contract (doc 34 §4).
Scope
In scope
StrategyContext(space, budget, seed, batch_size, params).- Post-processing: clip/validate in-bounds, constraint check (re-propose up to N times, then raise
StrategyError), dedupe vs pending/history (normalised L∞ > 1e-6; batch pairwise > 1e-3), rationale defaults. - Pre-processing: drop INVALID observations, derive per-call RNG from
(seed, len(history)). state_dict/load_state_dictdefaults (JSON-serialisable).
Implementation guidance
- Strategy-specific params models (pydantic) are declared by each strategy class (
Params: ClassVar[type[BaseModel]]) and validated in the constructor — enables/metaexposure (T-060). - Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Configuration keys
From the configuration reference (doc 27). Keys marked (new) must be added to the typed settings models and appear in the generated reference (T-003c).
selection.acq.dedupe_tol
Acceptance criteria
- Signatures match doc 05 §4.
- A deliberately bad dummy strategy (out of bounds, duplicates) is corrected or rejected by the base class (tests).
- Registry lists built-in strategy ids.
- Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
tests/unit/selection/test_base.py,test_registry.py.
Dependencies
Blocked by: #36 (T-023), #35 (T-022), #38 (T-025)
Blocks: #85 (T-041a), #100 (T-050b), #98 (T-051a), #101 (T-051b), #102 (T-051c), #103 (T-052), #110 (T-055a), #117 (T-059a), #118 (T-059b)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
backend/src/roboprobe/selection/base.pybackend/src/roboprobe/selection/registry.py
Interface task for the selection stream — merge early.
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-050a (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 05 §4 · doc 07 §2 · doc 34 §4 · ADR-0016
Requirements: FR-SEL-005 · FR-SEL-006 · FR-SEL-007 · PR-19 (traceability: doc 28)
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity
ScenarioSpace.with_pins) #38branin_falsify,multi_mode_6d) and benchmark backend #103