Declare layer.yaml, add a Python engine over a local SQLite store, and cover deterministic assessment, the §13 gap register, stance-map inventory, claim guardrails, and the gate-house review path with tests. Assistant: grok Assistant-Session: 01a04ceb-150e-7e80-a542-ec8b1372e164
40 lines
868 B
Python
40 lines
868 B
Python
from __future__ import annotations
|
|
|
|
from datetime import datetime, timezone
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
from maturity_engine.engine import Engine
|
|
from maturity_engine.models import Evidence
|
|
|
|
INSTANT = datetime(2026, 8, 29, 12, 0, tzinfo=timezone.utc)
|
|
|
|
|
|
@pytest.fixture
|
|
def engine(tmp_path: Path) -> Engine:
|
|
inst = Engine.open(tmp_path / "maturity.sqlite")
|
|
inst.bootstrap(at=INSTANT)
|
|
yield inst
|
|
inst.close()
|
|
|
|
|
|
def evidence(
|
|
engine: Engine,
|
|
subject: str,
|
|
kind: str,
|
|
*,
|
|
at: datetime = INSTANT,
|
|
until: datetime | None = None,
|
|
by: str = "fixture",
|
|
) -> Evidence:
|
|
return Evidence(
|
|
id=engine.evidence_id(subject, kind, at),
|
|
subject=subject,
|
|
kind=kind,
|
|
submitted_by=by,
|
|
submitted_at=at,
|
|
valid_from=at,
|
|
valid_until=until,
|
|
payload={"kind": kind},
|
|
)
|