Skip to content

[T-036a] Oracle base class, oracle registry and InfraCheck (validity gate) #68

Closed

Description

@CodewithJha

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

Implements FR-ORC-001 · FR-ORC-003

Branch feat/t-036a-oracle-base-class-oracle-registry — one task = one branch = one PR (doc 32 §6)

Summary

Implement oracles/base.py (Oracle ABC with id, failure_class, severity, PLUGIN_API_VERSION, evaluate(trace, task) -> OracleResult), oracles/registry.py (entry-point group roboprobe.oracles) and oracles/infra.py (InfraCheck, doc 08 §3.8).

Context / motivation

Infrastructure problems must never be counted as robot failures (doc 08 §1 principle 4). InfraCheck runs first and yields INVALID/F-INFRA.

Scope

In scope

  • clip(z) helper and shared vectorised utilities (oracles/_signals.py).
  • InfraCheck rules: backend infra_error; trace duration < min(5 s, T_max) while not at goal; sampling gap > max_gap_s; mean RTF < min_rtf; Nav2 not ACTIVE within startup_timeout_s; spawn pose error > spawn_tolerance_m.
  • Oracle contract suite tests/contract/oracles/ (robustness ∈ [−1,1]; purity — no I/O, enforced by patching open/socket).

Implementation guidance

  • Thresholds come from core.settings.OracleThresholds (doc 27 §4.6), passed in the constructor. No module-level numeric literals except mathematical constants.
  • 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.infra.max_gap_s
  • oracles.infra.min_rtf
  • oracles.infra.startup_timeout_s
  • oracles.infra.spawn_tolerance_m

Acceptance criteria

  • InfraCheck flags each condition with a distinct reason code.
  • Oracle contract suite exists and runs against registered oracles.
  • Registry rejects plugin API mismatch.
  • 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_infra.py, tests/contract/oracles/test_oracle_contract.py.

Dependencies

Blocked by: #15 (T-002a), #19 (T-003a), #48 (T-035a)

Blocks: #70 (T-036b), #71 (T-036c), #72 (T-037a), #73 (T-037b), #74 (T-037c), #75 (T-038a), #76 (T-038b), #205 (T-098)

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/base.py
  • backend/src/roboprobe/oracles/registry.py
  • backend/src/roboprobe/oracles/infra.py
  • backend/src/roboprobe/oracles/_signals.py
  • backend/tests/contract/oracles/**

Interface task for the oracle stream; individual oracles follow in parallel.

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-036a (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 §6 · doc 08 §1 · doc 08 §3.8 · doc 08 §4 · doc 18 §4.3 · ADR-0006

Requirements: FR-ORC-001 · FR-ORC-003 (traceability: doc 28)

External:

Activity

  1. added
    area:oracleVerdict oracles / safety properties
    priority:P0Critical path / blocks others
    milestone:M3M3 — Oracles + runner + store
    taskChild task of a milestone epic
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:oracleVerdict oracles / safety propertiesmilestone:M3M3 — Oracles + runner + storepriority: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