Skip to content

[T-102a] Experiment model and planner: strategies × seeds × budget, common random numbers, comparability rule #108

Closed

Description

@CodewithJha

Task T-102a · Milestone M4 — Baselines + metrics + experiments · Size S · Priority P0 · Epic #4

Implements FR-EXP-001 · PR-10

Branch feat/t-102a-experiment-model-and-planner-strategies — one task = one branch = one PR (doc 32 §6)

Summary

Implement experiments/planner.py: parse experiment YAML (schemas/experiment.schema.json), expand into campaign specs with campaign_seed = derive_seed(experiment_seed, 'rep', k) shared across strategies (CRN), and enforce the result-comparability rule (doc 33 §6).

Context / motivation

Fair comparisons require identical conditions per seed index across strategies.

Scope

In scope

  • ExperimentDesign model; plan(design) -> list[CampaignSpec]; variant support (e.g. PROBE−diversity via params overrides, d=8 variants via pins/enabled flags).
  • Comparability check: same space_version, oracle_set_version, sut_profile.config_hash, backend version, k2d_model_version.

Implementation guidance

  • Variants are named (id: PROBE-nodiv, strategy: S-PROBE, params: {lambda_div: 0}) so reports can label them.
  • 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).

  • experiments.default_seeds

Acceptance criteria

  • Planner output deterministic; CRN seeds equal across strategies for the same k.
  • Mismatched versions rejected with explicit error.
  • Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
  • Docs, config reference and CHANGELOG Unreleased updated where behaviour, keys or interfaces changed.
  • Definition of Done (doc 32 §3) satisfied.

Tests required

  • tests/unit/experiments/test_planner.py.

Dependencies

Blocked by: #32 (T-020a), #17 (T-002c), #62 (T-011b)

Blocks: #109 (T-102b), #206 (T-104)

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/experiments/planner.py

Independent.

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-102a (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 14 §8 · doc 19 §2 · doc 19 §4 · doc 19 §5 · doc 33 §6

Requirements: FR-EXP-001 · PR-10 (traceability: doc 28)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:experimentsExperiment runner and EXP-xx protocolsmilestone:M4M4 — Baselines + metrics + experimentspriority:P0Critical path / blocks otherssize:S<= 1 daytaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions