Chiusura fase di ristrutturazione e modularizzazione del workflow per favorire sviluppo modulare
This commit is contained in:
@@ -6,7 +6,7 @@ la rende un passo del workflow. Questi test fissano il contratto harness-side:
|
||||
- i candidati rifiutati al gate (memory_promotion_declined, detail "seq:<n>") non
|
||||
vengono riproposti da reusable_promotions/preview_promotions.
|
||||
"""
|
||||
from datetime import datetime
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from tht.decisions import DecisionRecord, append_decision
|
||||
from tht.memory import (
|
||||
@@ -23,7 +23,7 @@ from tht.workflow import load_workflow
|
||||
def test_promotion_decision_types_are_valid():
|
||||
for t in ("memory_promoted", "memory_promotion_declined"):
|
||||
d = DecisionRecord(
|
||||
seq=1, ts=datetime(2026, 1, 1), type=t, subject="fact_x", detail="seq:5"
|
||||
seq=1, ts=datetime(2026, 1, 1, tzinfo=UTC), type=t, subject="fact_x", detail="seq:5"
|
||||
)
|
||||
assert d.type == t
|
||||
|
||||
@@ -36,14 +36,14 @@ def test_promotion_decision_types_min_phase_is_f8():
|
||||
|
||||
def _manifest() -> SessionManifest:
|
||||
return SessionManifest(
|
||||
id="s1", created_at=datetime(2026, 1, 1), question="domanda originale",
|
||||
id="s1", created_at=datetime(2026, 1, 1, tzinfo=UTC), question="domanda originale",
|
||||
database="db", schema="public",
|
||||
)
|
||||
|
||||
|
||||
def test_declined_promotion_seqs_parses_seq_detail():
|
||||
d = DecisionRecord(
|
||||
seq=9, ts=datetime(2026, 1, 1), type="memory_promotion_declined",
|
||||
seq=9, ts=datetime(2026, 1, 1, tzinfo=UTC), type="memory_promotion_declined",
|
||||
subject="fact_x", detail="seq:5",
|
||||
)
|
||||
assert declined_promotion_seqs([d]) == {5}
|
||||
@@ -51,9 +51,9 @@ def test_declined_promotion_seqs_parses_seq_detail():
|
||||
|
||||
def test_declined_promotion_seqs_ignores_malformed_and_other_types():
|
||||
ds = [
|
||||
DecisionRecord(seq=1, ts=datetime(2026, 1, 1),
|
||||
DecisionRecord(seq=1, ts=datetime(2026, 1, 1, tzinfo=UTC),
|
||||
type="memory_promotion_declined", subject="x", detail=""),
|
||||
DecisionRecord(seq=2, ts=datetime(2026, 1, 1),
|
||||
DecisionRecord(seq=2, ts=datetime(2026, 1, 1, tzinfo=UTC),
|
||||
type="table_promoted", subject="x", detail="seq:3"),
|
||||
]
|
||||
assert declined_promotion_seqs(ds) == set()
|
||||
@@ -100,11 +100,11 @@ def test_only_concept_clarified_is_proposed_or_promoted(tmp_path):
|
||||
def test_legacy_table_records_are_not_published_as_memory_vectors():
|
||||
records = [
|
||||
MemoryRecord(
|
||||
id="mem-0001", ts=datetime(2026, 1, 1), session_id="s1",
|
||||
id="mem-0001", ts=datetime(2026, 1, 1, tzinfo=UTC), session_id="s1",
|
||||
decision_seq=1, type="table_promoted", subject="fact_a",
|
||||
),
|
||||
MemoryRecord(
|
||||
id="mem-0002", ts=datetime(2026, 1, 1), session_id="s1",
|
||||
id="mem-0002", ts=datetime(2026, 1, 1, tzinfo=UTC), session_id="s1",
|
||||
decision_seq=2, type="concept_clarified", subject="paziente attivo",
|
||||
detail="flag_attivo = TRUE",
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user