orchestrata_ultimate.factory.assumptions.dor
Reference › orchestrata_ultimate › factory › assumptions › dor
dor holds the assumption-ledger slice of the Definition-of-Ready check (AC-033-C1-02). check_dor returns a DorResult: ready is true only when every assumption in the ledger has status PINNED, and blocking lists the assumptions that are not. The full DoR construction procedure (REQ-033-C5, row B23) lives in the dor_procedure package. The scripts.factory_assumptions CLI and tests/factory/test_dor.py import it.
At a glance
| Source | src/orchestrata_ultimate/factory/assumptions/dor.py |
| Lines of code | 38 |
| Classes | 1 |
| Functions | 1 |
| Imports (internal) | orchestrata_ultimate.core.base.traces, orchestrata_ultimate.factory.assumptions.ledger, orchestrata_ultimate.factory.assumptions.models |
| Imported by | scripts.factory_assumptions |
| Tests that import it | tests/factory/test_detector_c1_bridge.py, tests/factory/test_dor.py |
Class diagram
Dependency diagram
API
Classes
DorResult (dataclass)
Decorators: dataclass(frozen=True) · Line 17
Result of :func:check_dor.
| Attribute | Type | Default |
|---|---|---|
ready |
bool |
|
blocking |
list[tuple[str, str, str]] |
Functions
| Function | Signature | Summary |
|---|---|---|
check_dor traces |
check_dor(ledger: AssumptionLedger) -> DorResult |
DoR is ready iff every assumption in ledger is PINNED. |
Source
"""Definition-of-Ready check for the assumption ledger (AC-033-C1-02).
This is only the assumption-ledger slice of DoR — the full construction
procedure (SPEC-033 REQ-033-C5) is task B23, out of scope here.
"""
from __future__ import annotations
from dataclasses import dataclass
from orchestrata_ultimate.core.base.traces import traces
from orchestrata_ultimate.factory.assumptions.ledger import AssumptionLedger
from orchestrata_ultimate.factory.assumptions.models import AssumptionStatus
@dataclass(frozen=True)
class DorResult:
"""Result of :func:`check_dor`.
``blocking`` carries ``(assumption_id, design_node, status)`` for every
non-``PINNED`` assumption — the spec's required failure shape (AC-033-C1-02
names both the assumption and its design node).
"""
ready: bool
blocking: list[tuple[str, str, str]]
@traces(spec="033", reqs=["REQ-033-C1"])
def check_dor(ledger: AssumptionLedger) -> DorResult:
"""DoR is ready iff every assumption in ``ledger`` is ``PINNED``."""
blocking: list[tuple[str, str, str]] = []
for assumption in ledger.assumptions():
if assumption.status != AssumptionStatus.PINNED:
blocking.append(
(assumption.id, assumption.design_node, assumption.status.value)
)
return DorResult(ready=not blocking, blocking=blocking)