Files
QuantEngineByItz/spec/54_temporal_data_integrity.yaml
T
kjh2064 4b1a33ba48 WBS-7.11 2차 확장: spec-코드 동기화 태깅 12→20개 (7.5%→12.5%)
이미 harness_file:/python_tool:/validator: 필드로 1:1 코드 매핑을
스스로 명시하고 있던 H001~H008 결정론적 하네스 계약 7개(spec/52~58)와
spec/32(canonical_artifact_resolver), spec/37(evaluation_dashboard_contract)에
has_code_implementation/code_path를 추가했다. 모든 대상 파일의 code_path
실존을 사전 확인했다.

governance/rules/00~05, spec/40·45·46·gas_adapter_contract 등 다중 구현체에
걸친 계약은 단일 code_path로 환원하면 거짓 1:1 매핑이 되므로 의도적으로
제외했다(WBS-7.11 핵심 원칙 유지).
2026-06-22 01:36:55 +09:00

62 lines
2.0 KiB
YAML

schema_version: temporal_data_integrity.v1
contract_id: H003_ANTI_BACKFILL_LOOKAHEAD
harness_file: tools/validate_no_lookahead_bias_v1.py
has_code_implementation: true
code_path: "tools/validate_no_lookahead_bias_v1.py"
authority: spec/54_temporal_data_integrity.yaml
created_at: '2026-06-10T23:29:00+09:00'
purpose: >
백필 데이터와 실시간 데이터의 timestamp/freshness 혼입을 차단한다.
feature_timestamp가 decision_timestamp를 초과하는 lookahead는 즉시 차단한다.
definitions:
lookahead_bias: >
feature 계산에 사용된 데이터의 as_of_date가
해당 결정이 내려진 decision_timestamp보다 미래인 경우
backfill_contamination: >
과거 결정 평가 시 그 시점에 없던 데이터가 소급 적용된 경우
inputs:
- field: computed_harness_v1.json
source: Temp/computed_harness_v1.json
required: true
- field: GatherTradingData.json
source: GatherTradingData.json
required: true
output_fields:
- name: lookahead_violation_count
type: int
description: feature_timestamp > decision_timestamp 건수
- name: backfilled_after_decision_count
type: int
description: 결정 이후 소급 backfill된 데이터 건수
- name: freshness_violation_tickers
type: list[str]
description: freshness 위반 종목 목록
- name: gate
type: str
enum: [PASS, FAIL]
acceptance_criteria:
- feature_timestamp_lte_decision_timestamp: true
- backfilled_after_decision_count: 0
hard_gates:
- gate_id: NO_LOOKAHEAD
condition: lookahead_violation_count == 0
on_fail: BLOCK_RELEASE
- gate_id: NO_BACKFILL_CONTAMINATION
condition: backfilled_after_decision_count == 0
on_fail: BLOCK_RELEASE
data_freshness_sla:
price_data_max_age_hours: 1
fundamental_data_max_age_days: 30
macro_data_max_age_hours: 24
owner: data_engineer
lifecycle_state: active
retirement_condition: >
실시간 스트리밍 파이프라인으로 전환 시 해당 파이프라인 계약으로 교체한다.