Files
QuantEngineByItz/spec/56_renderer_copy_only_contract.yaml
T
kjh2064 ee3e799de1 feat: 리밸런싱 엔진 V1 + GAS 버그 수정 (2026-06-13)
주요 변경:
- tools/build_rebalance_engine_v1.py: REBALANCE_ENGINE_V1 신규
  * account_snapshot 직접 합산(_build_snap_position_map) → 소수주 분리 행 병합
  * 레짐 소스 macro.REGIME_PRELIM 최우선 (GAS 와 동일)
- src/gas_adapter_parts/gdf_06_rebalance.gs: runRebalanceSheet_() 신규
  * Logger.log / getSpreadsheet_() 로 run_all 연동 수정
- src/gas_adapter_parts/gdc_01_fetch_fundamentals.gs
  * _mergePositionRecord_(): 소수주 중복 행 합산 신규
  * parseInt → parseFloat (qty, availQty)
- src/gas_adapter_parts/gdf_01_price_metrics.gs
  * 미보유 종목 SELL_READY → WATCH_EXIT_SIGNAL
- spec/41_release_dag.yaml: build_rebalance_sheet 노드 추가 (step_count 63)
- spec/51_formula_lifecycle_registry.yaml: REBALANCE_ENGINE_V1 등록

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 13:20:14 +09:00

70 lines
2.5 KiB
YAML

schema_version: renderer_copy_only_contract.v1
contract_id: H005_REPORT_RENDER_DIFF
harness_file: tools/validate_report_render_diff_v1.py
authority: spec/56_renderer_copy_only_contract.yaml
created_at: '2026-06-10T23:29:00+09:00'
purpose: >
operational_report.md/json의 숫자가 final_decision_packet과 1:1 복사인지 검증한다.
LLM이 보고서 생성 과정에서 어떠한 계산도 수행하지 않았음을 보장한다.
renderer_rules:
- LLM은 packet에서 이미 계산된 값을 copy-only로 렌더링한다
- 수량/가격/비중/점수/순위/평균/합계 계산을 하지 않는다
- 값이 없으면 'DATA_MISSING — 하네스 업데이트 필요'로만 표기한다
- blocked/limited 종목도 산출된 기준가·손절가·익절가·수량을 숨기지 않는다
- 투자 결론은 final_execution_decision과 gate_trace를 번복하지 않는다
- 매도 후보가 2개 이상이면 sell priority table을 먼저 출력한다
- narrative는 gate를 완화하거나 회피하는 표현을 쓰지 않는다
forbidden_patterns:
- pattern: ".*계산.*하면.*"
description: 렌더러가 계산을 수행하는 표현
- pattern: ".*평균을 내면.*"
description: 렌더러가 평균을 계산하는 표현
- pattern: ".*합산하면.*"
description: 렌더러가 합산을 수행하는 표현
- pattern: ".*추정.*하면.*"
description: 렌더러가 값을 추정하는 표현
inputs:
- field: final_decision_packet_active.json
source: Temp/final_decision_packet_active.json
required: true
- field: operational_report.json
source: Temp/operational_report.json
required: true
- field: operational_report.md
source: Temp/operational_report.md
required: false
output_fields:
- name: numeric_diff_count
type: int
description: 패킷과 보고서 간 숫자 불일치 건수
- name: narrative_softening_count
type: int
description: gate를 완화하는 내러티브 표현 건수
- name: forbidden_phrase_count
type: int
description: 금지 패턴 감지 건수
- name: gate
type: str
enum: [PASS, FAIL]
acceptance_criteria:
- numeric_diff_count: 0
- narrative_softening_count: 0
hard_gates:
- gate_id: NUMERIC_SYNC
condition: numeric_diff_count == 0
on_fail: BLOCK_RELEASE
- gate_id: NO_NARRATIVE_SOFTENING
condition: narrative_softening_count == 0
on_fail: BLOCK_RELEASE
owner: pm
lifecycle_state: active
retirement_condition: >
보고서 생성 파이프라인이 전면 재설계될 때까지 유효하다.