orchestrata_ultimate.factory.anchors.source
Reference › orchestrata_ultimate › factory › anchors › source
source connects anchors to the arbiter cascade. AnchorSource implements the PinningSource protocol from assumptions.sources: its pinnings method returns one Pinning per RATIFIED anchor in an AnchorRegistry, so ratified anchors become stage-1 candidates alongside the AC, ADR and knowledge-base sources. A PROPOSED anchor contributes nothing, because it is not yet ratified intent (ADR-0012, ADR-0013). The class carries @traces for REQ-033-C1. The scripts.factory_assumptions CLI imports it, and tests/factory/test_anchor_source.py covers it.
At a glance
| Source | src/orchestrata_ultimate/factory/anchors/source.py |
| Lines of code | 37 |
| Classes | 1 |
| Functions | 0 |
| Imports (internal) | orchestrata_ultimate.core.base.traces, orchestrata_ultimate.factory.anchors.models, orchestrata_ultimate.factory.anchors.store, orchestrata_ultimate.factory.assumptions.models |
| Imported by | scripts.factory_assumptions |
| Tests that import it | tests/factory/test_anchor_source.py, tests/scripts/test_factory_assumptions_cli.py |
Class diagram
Dependency diagram
API
Classes
AnchorSource
Decorators: traces(spec='033', reqs=['REQ-033-C1']) · Line 19
Ratified anchors as stage-1 candidate pinnings for the arbiter cascade.
| Method | Signature | Summary |
|---|---|---|
__init__ |
__init__(registry: AnchorRegistry) |
|
pinnings |
pinnings() -> list[Pinning] |
Return one Pinning per RATIFIED anchor in the registry. |
Source
"""``AnchorSource`` -- the B13 arbiter-cascade pinning-source seam (B15a).
Implements the :class:`~orchestrata_ultimate.factory.assumptions.sources.
PinningSource` Protocol so ratified anchors become stage-1 candidate pinnings
for the SPEC-033 arbiter cascade, alongside the AC/ADR/KB sources already
built in B13. Only RATIFIED anchors pin anything: a PROPOSED anchor is not
yet ratified intent (ADR-0012/0013), so it contributes no candidate.
"""
from __future__ import annotations
from orchestrata_ultimate.core.base.traces import traces
from orchestrata_ultimate.factory.anchors.models import AnchorStatus
from orchestrata_ultimate.factory.anchors.store import AnchorRegistry
from orchestrata_ultimate.factory.assumptions.models import Pinning, PinningKind
@traces(spec="033", reqs=["REQ-033-C1"])
class AnchorSource:
"""Ratified anchors as stage-1 candidate pinnings for the arbiter cascade.
Structurally satisfies ``PinningSource`` (a ``pinnings() -> list[Pinning]``
method) without importing the Protocol directly, matching the other
sources in :mod:`orchestrata_ultimate.factory.assumptions.sources`.
"""
def __init__(self, registry: AnchorRegistry):
self.registry = registry
def pinnings(self) -> list[Pinning]:
"""Return one ``Pinning`` per RATIFIED anchor in the registry."""
return [
Pinning(
kind=PinningKind.ANCHOR, ref=anchor.anchor_id, excerpt=anchor.statement
)
for anchor in self.registry.anchors(status=AnchorStatus.RATIFIED)
]