Repository navigation
Description
Task
T-038a· Milestone M3 — Oracles + runner + store · Size S · Priority P1 · Epic #3Implements FR-ORC-001 · FR-ORC-002 · FR-ORC-005
Branch
feat/t-038a-o-stab-instability-tip-over— one task = one branch = one PR (doc 32 §6)
Summary
Implement StabilityOracle (O-STAB) exactly as doc 08 §3.6, vectorised over the trace, returning OracleResult with robustness in [−1, 1] and first_violation_t.
Context / motivation
Detects F-INST (low friction + aggressive turns).
Scope
In scope
backend/src/roboprobe/oracles/stability.pywithStabilityOracle.- Entry point in group
roboprobe.oracles. detailsdict with the intermediate quantities (e.g. min distance, t_goal) for the dashboard oracle table.
Out of scope
- Verdict aggregation (T-039a)
Implementation guidance
- Formula (doc 08 §3.6): Violation if
max max(|roll|,|pitch|) > θ_maxormax |ω_meas| > ω_max;r = clip(min(1 − max|roll,pitch|/θ_max, 1 − max|ω|/ω_max)).
All thresholds from OracleThresholds (oracles.stab.theta_max, oracles.stab.omega_max). Vectorised NumPy only — no per-sample Python loops (doc 34 §9).
- 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).
oracles.stab.theta_maxoracles.stab.omega_max
Acceptance criteria
- Golden-trace expectations (T-019) met within 1e-9.
- Property tests: time-shift invariance; monotonicity where applicable (e.g. scaling clearance up never decreases
r_clear). - Threshold overrides honoured.
- Passes the oracle contract suite; 100 % branch coverage of the module.
- 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/oracles/test_stability.pytests/property/oracles/test_stability_props.py
Dependencies
Blocked by: #68 (T-036a), #69 (T-019)
Blocks: #77 (T-039a)
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/oracles/stability.pybackend/tests/unit/oracles/test_stability.py
One module per oracle; all oracle issues can run in parallel once T-036a and T-019 are merged. Entry-point lines in pyproject.toml are append-only.
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-038a (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 08 §3.6 · doc 08 §4 · doc 08 §7 · doc 05 §6 · ADR-0006
Requirements: FR-ORC-001 · FR-ORC-002 · FR-ORC-005 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity