Skip to content

[T-037a] O-PROG (stuck / no progress) oracle (oracles/progress.py) #72

Closed

Description

@CodewithJha

Task T-037a · Milestone M3 — Oracles + runner + store · Size S · Priority P1 · Epic #3

Implements FR-ORC-001 · FR-ORC-002 · FR-ORC-005

Branch feat/t-037a-o-prog-stuck-no-progress — one task = one branch = one PR (doc 32 §6)

Summary

Implement ProgressOracle (O-PROG) exactly as doc 08 §3.3, vectorised over the trace, returning OracleResult with robustness in [−1, 1] and first_violation_t.

Context / motivation

Detects F-STUCK (blocked aisle, phantom obstacles — GT-D).

Scope

In scope

  • backend/src/roboprobe/oracles/progress.py with ProgressOracle.
  • Entry point in group roboprobe.oracles.
  • details dict 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.3): Δ(t) = ‖p_gt(t) − p_gt(t−W)‖; violation if ∃t ≥ W with nav active ∧ ¬at_goal ∧ Δ < δ_min; r = clip((min Δ − δ_min)/δ_norm) over active, not-at-goal times. Use interpolation for t − W on irregular sampling.

All thresholds from OracleThresholds (oracles.prog.window_s, oracles.prog.delta_min, oracles.prog.delta_norm). 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.prog.window_s
  • oracles.prog.delta_min
  • oracles.prog.delta_norm

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 Unreleased updated where behaviour, keys or interfaces changed.
  • Definition of Done (doc 32 §3) satisfied.

Tests required

  • tests/unit/oracles/test_progress.py
  • tests/property/oracles/test_progress_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/progress.py
  • backend/tests/unit/oracles/test_progress.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-037a (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.3 · 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

No one assigned

    Labels

    area:oracleVerdict oracles / safety propertiesmilestone:M3M3 — Oracles + runner + storepriority:P1Required for milestone exitsize:S<= 1 daytaskChild task of a milestone epictype:featureNew functionality

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions