Repository navigation
Description
Task
T-059a· Milestone M5 — Intelligent selection · Size S · Priority P0 · Epic #5Implements FR-SEL-003 · FR-SEL-008
Branch
feat/t-059a-s-probe-phasecontroller-phase-selection— one task = one branch = one PR (doc 32 §6)
Summary
Implement the S-PROBE phase state machine of doc 07 §6.1 as a pure, serialisable PhaseController in selection/probe_phases.py: Warmup → Falsify → Mixed{ModeSearch, Boundary, Refine, Explore}, weight renormalisation, adaptive shift of 0.2 from ModeSearch to Boundary after W unproductive ModeSearch proposals (floor 0.2).
Context / motivation
Separating the decision logic from GP/acquisition code makes it unit-testable without torch and keeps probe.py small.
Scope
In scope
choose_phase(rng, state) -> Phase,record_outcome(phase, new_mode: bool),state_dict/load_state_dict.
Implementation guidance
- Make the 0.2 shift and 0.2 floor settings keys (
probe.adapt_shift,probe.mode_search_floor, new) — doc 07 describes them as constants; add to doc 27. - 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.probe.weightsselection.probe.epsilonselection.probe.adapt_window
Acceptance criteria
- Empirical phase frequencies match weights (χ² test over fixed seeds).
- Adaptive rule triggers exactly per spec; Refine unavailable ⇒ weights renormalised.
- 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_probe_phases.py.
Dependencies
Blocked by: #84 (T-050a)
Blocks: #119 (T-059c)
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/probe_phases.py
Parallel with T-056a–c and T-059b.
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-059a (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 07 §6.1 · doc 07 §6.3 · doc 34 §4
Requirements: FR-SEL-003 · FR-SEL-008 (traceability: doc 28)
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity