Files
trex-core/.proofline/criteria/ac-0029.md
T

2.4 KiB

id, status
id status
ac-0029 active

Durable unmanaged-position lifecycle, authority boundary, and operator audit

Criterion

trex-core는 broker-only unmanaged holding을 (instance_key, symbol) keyed durable lifecycle state로 추적해야 한다. State는 quantity, first_seen_at, last_seen_at, quantity_changed_at, resolved_at, lifecycle state와 latest non-secret operator disposition/evidence를 제공해야 한다. reconcile_core_holdings()는 authoritative full-balance snapshot에서만 unresolved active rows의 absence를 resolved로 전이할 수 있으며, marker가 없거나 projected/partial balance인 broker reader는 resolve authority가 없다. 동일 active lifecycle에서 같은 수량 반복 관측은 새 lifecycle alarm/audit를 만들지 않고 last_seen_at만 갱신해야 한다. 운영자 disposition은 explicit evidence-backed command로만 기록되고 audit trail에 append되어야 하며, current state 조회와 audit 조회 모두 inspectable해야 한다. 이 기능은 broker 주문, slot/ledger mutation, warning 자동 삭제 또는 manual-holding cause inference를 수행해서는 안 된다.

Verification

  • Identity/lifecycle: 같은 symbol을 서로 다른 instance_key에서 독립 row로 저장하고, first detect → same-qty repeat → quantity change → authoritative absence resolved → re-detect reopen 순서를 InMemory/PostgreSQL parity tests로 검증한다.
  • Authority boundary: missing marker, False, exception-throwing marker, ownership/projected broker, broker read failure 각각에서 active unmanaged row가 resolved 되지 않음을 검증한다. Explicit authoritative broker만 absence resolution을 수행해야 한다.
  • Runtime wiring: production broker provider/daemon/snapshot scheduler tests에서 주문용 projected broker와 unmanaged reconciliation용 authoritative full-balance reader가 분리 주입되는지 고정한다.
  • Operator audit: CLI/parser/store tests에서 unmanaged list, evidence-required unmanaged record, symbol별 unmanaged audit를 검증하고 audit actor가 caller-supplied arbitrary string이 아니라 trusted local identity에서 결정됨을 확인한다.
  • Safety boundary: any unmanaged lifecycle path에서 broker order submit/cancel, slot create/mutate, synthetic ledger write, warning auto-clear가 발생하지 않음을 existing regression surface와 focused tests로 유지한다.