feat(memory): memory_promoted/memory_promotion_declined decision types (F8 emits)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""L1: gate di promozione memorie (F8) — tipi di decisione + filtro candidati.
|
||||
|
||||
La promozione era solo CLI facoltativa (mai innescata): il gate reviewer_memory_promote
|
||||
la rende un passo del workflow. Questi test fissano il contratto harness-side:
|
||||
- i due nuovi decision type esistono e sono ammessi dalla Fase 8 (workflow.yaml emits)
|
||||
- i candidati rifiutati al gate (memory_promotion_declined, detail "seq:<n>") non
|
||||
vengono riproposti da reusable_promotions/preview_promotions.
|
||||
"""
|
||||
from datetime import datetime
|
||||
|
||||
from tht.decisions import DecisionRecord
|
||||
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"
|
||||
)
|
||||
assert d.type == t
|
||||
|
||||
|
||||
def test_promotion_decision_types_min_phase_is_f8():
|
||||
wf = load_workflow()
|
||||
assert wf.decision_min_phase("memory_promoted") == 8
|
||||
assert wf.decision_min_phase("memory_promotion_declined") == 8
|
||||
@@ -34,6 +34,11 @@ DecisionType = Literal[
|
||||
"phase_skipped",
|
||||
"datamart_requested",
|
||||
"datamart_declined",
|
||||
# F8: promozione memorie riusabili al gate reviewer_memory_promote. subject =
|
||||
# subject della decisione originale, detail = "seq:<decision_seq>" (usato da
|
||||
# declined_promotion_seqs per non riproporre i candidati rifiutati).
|
||||
"memory_promoted",
|
||||
"memory_promotion_declined",
|
||||
# D15: marker di ritrazione. subject = "phase:N", retracts = decision_seq ritirata.
|
||||
# Resta nel log di audit (append-only); effective_decisions() la esclude dalla vista.
|
||||
"decision_retracted",
|
||||
|
||||
@@ -68,7 +68,7 @@ phases:
|
||||
- decision_exists: datamart_requested
|
||||
- decision_exists: datamart_declined
|
||||
artifacts_out: []
|
||||
emits: [datamart_requested, datamart_declined]
|
||||
emits: [datamart_requested, datamart_declined, memory_promoted, memory_promotion_declined]
|
||||
|
||||
decision_min_phase: auto
|
||||
max_phase: auto
|
||||
|
||||
Reference in New Issue
Block a user