ee3e799de1
주요 변경: - 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>
867 lines
36 KiB
YAML
867 lines
36 KiB
YAML
document:
|
|
id: quant_engine_refactor_master_todo_v1
|
|
title: 저성능 LLM용 퀀트투자 엔진 리팩토링 마스터 TODO
|
|
version: 1.0.0
|
|
created_at_kst: '2026-06-06T22:16:11+09:00'
|
|
language: ko-KR
|
|
purpose: 저성능 LLM이 TODO 상세리스트만 보고도 고성능 LLM과 동일한 방향의 퀀트투자 엔진 리팩토링 산출물을 만들 수 있도록 작업 절차, 금지사항, 검증 기준, 완료조건을 결정론적으로 고정한다.
|
|
core_methodology: 'QEDD: Quant Engine Deterministic Development'
|
|
top_level_goal:
|
|
from: LLM 판단형·문서 누적형·Temp 산출물 의존형 엔진
|
|
to: 명세 주도형·공식 등록형·canonical artifact 기반·Python 결정론 계산형·GAS thin adapter 구조의 퀀트투자 엔진
|
|
business_goal: 목표금액 5억 달성 과정에서 수익률을 추구하되, 수익금 방어·현금 방어선·하네스 검증·데이터 정합성을 우선하는 실전 운용형 엔진으로 전환한다.
|
|
non_negotiable_rules_for_low_capability_llm:
|
|
- LLM은 투자 판단자가 아니라 리팩토링 실행자다.
|
|
- 가격·수량·비율·점수·목표가·손절가·익절가를 새로 만들지 않는다.
|
|
- spec/13_formula_registry.yaml 또는 정규화된 formula_registry에 없는 formula_id를 만들지 않는다.
|
|
- Temp의 다중 버전 파일을 runtime source로 직접 사용하지 않는다.
|
|
- canonical_manifest에 지정된 파일만 runtime source로 인정한다.
|
|
- replay 성과를 live 성과처럼 표현하지 않는다.
|
|
- live T+20 표본 30건 미만이면 active 또는 PASS_100으로 승격하지 않는다.
|
|
- 검증 실패를 설명이나 문장으로 우회하지 않는다.
|
|
- 파일이 없거나 수치 출처가 없으면 DATA_MISSING으로 표시한다.
|
|
- GAS에 신규 투자 판단 로직을 추가하지 않는다.
|
|
- 프롬프트에 가격·수량·임계값 계산 지시를 추가하지 않는다.
|
|
- 하네스 FAIL 상태에서 주문표를 실행 가능 상태로 렌더링하지 않는다.
|
|
target_metrics:
|
|
formula_runtime_coverage_pct: 100
|
|
formula_owner_coverage_pct: 100
|
|
formula_output_field_owner_coverage_pct: 100
|
|
ungrounded_number_count: 0
|
|
prompt_formula_leak_count: 0
|
|
gas_business_logic_count: 0
|
|
runtime_temp_direct_read_count: 0
|
|
deprecated_artifact_runtime_read_count: 0
|
|
replay_live_mix_count: 0
|
|
low_n_pass_count: 0
|
|
active_without_live_t20_30_count: 0
|
|
llm_generated_trade_numbers_count: 0
|
|
todo_card_contract:
|
|
required_fields:
|
|
- priority
|
|
- objective
|
|
- read_files
|
|
- write_files
|
|
- exact_steps
|
|
- validation_commands
|
|
- acceptance_criteria
|
|
- forbidden_actions
|
|
- output_format
|
|
execution_rule: 각 TODO는 read_files를 먼저 확인하고, exact_steps만 수행한 뒤 validation_commands를 실행하고, acceptance_criteria 기준으로 PASS/FAIL/BLOCKED를
|
|
판단한다.
|
|
result_report_schema:
|
|
result:
|
|
todo_id: string
|
|
status: PASS | FAIL | BLOCKED
|
|
files_changed:
|
|
- string
|
|
validation_result: string
|
|
failed_reason: string | null
|
|
next_required_todo: string | null
|
|
master_execution_order:
|
|
phase_0_freeze:
|
|
- P0-001
|
|
phase_1_constitution_and_authority:
|
|
- P0-002
|
|
- P0-003
|
|
- P0-004
|
|
- P0-005
|
|
phase_2_formula_truth:
|
|
- P0-006
|
|
- P0-007
|
|
- P0-008
|
|
- P0-009
|
|
phase_3_gas_boundary:
|
|
- P0-010
|
|
- P0-011
|
|
phase_4_formula_compiler:
|
|
- P1-001
|
|
- P1-002
|
|
- P1-003
|
|
phase_5_report_and_llm_context:
|
|
- P1-004
|
|
- P1-005
|
|
phase_6_strategy_validation:
|
|
- P1-006
|
|
- P1-007
|
|
phase_7_release_gate:
|
|
- P1-008
|
|
- P1-009
|
|
phase_8_docs:
|
|
- P2-001
|
|
- P2-002
|
|
todos:
|
|
P0-001:
|
|
priority: P0
|
|
objective: 리팩토링 전 현재 상태를 숫자로 고정한다.
|
|
read_files:
|
|
- AGENTS.md
|
|
- package.json
|
|
- spec/
|
|
- prompts/
|
|
- tools/
|
|
- Temp/
|
|
- GatherTradingData.json
|
|
write_files:
|
|
- Temp/refactor_baseline_inventory_v1.json
|
|
exact_steps:
|
|
- 전체 파일 수를 계산한다.
|
|
- 확장자별 파일 수를 계산한다.
|
|
- Temp 파일 수를 계산한다.
|
|
- .gs 파일별 라인 수와 전체 라인 수를 계산한다.
|
|
- tools/*.py 개수를 계산한다.
|
|
- spec/*.yaml 개수를 계산한다.
|
|
- prompts/*.md 개수를 계산한다.
|
|
- package.json scripts 개수를 계산한다.
|
|
- 결과를 JSON으로 저장한다.
|
|
validation_commands:
|
|
- python tools/validate_specs.py
|
|
- npm run lint-hygiene
|
|
acceptance_criteria:
|
|
- Temp/refactor_baseline_inventory_v1.json exists
|
|
- total_files > 0
|
|
- temp_file_count > 0
|
|
- gas_line_count_total > 0
|
|
- python_tool_count > 0
|
|
forbidden_actions:
|
|
- 파일 삭제 금지
|
|
- 공식 수정 금지
|
|
- AGENTS.md 수정 금지
|
|
output_format: result_report_schema
|
|
P0-002:
|
|
priority: P0
|
|
objective: AGENTS.md를 거대 규칙집에서 최상위 헌법으로 축소하기 위한 후보 파일을 만든다.
|
|
read_files:
|
|
- AGENTS.md
|
|
- spec/00_execution_contract.yaml
|
|
- spec/33_execution_precedence_lock.yaml
|
|
- spec/34_architecture_boundaries.yaml
|
|
- spec/35_rule_lifecycle_governance_v3.yaml
|
|
write_files:
|
|
- docs/proposed_AGENTS_constitution_v1.md
|
|
- docs/agents_rule_extraction_map_v1.yaml
|
|
exact_steps:
|
|
- AGENTS.md에서 Hard-Lock, 금지사항, 우선순위, 출력규칙을 분류한다.
|
|
- 중복 규칙을 하나의 rule_key로 묶는다.
|
|
- AGENTS.md에 남길 최상위 원칙 12개 이하만 추출한다.
|
|
- 세부 규칙은 spec 파일로 이동할 위치를 매핑한다.
|
|
- 원문 파일은 삭제하거나 직접 축소하지 않는다.
|
|
validation_commands:
|
|
- python tools/validate_specs.py
|
|
acceptance_criteria:
|
|
- docs/proposed_AGENTS_constitution_v1.md exists
|
|
- docs/agents_rule_extraction_map_v1.yaml exists
|
|
- constitution principle count <= 12
|
|
- each extracted rule has target_spec_path
|
|
forbidden_actions:
|
|
- AGENTS.md 직접 축소 금지
|
|
- 규칙 의미 변경 금지
|
|
- 새 투자 공식 추가 금지
|
|
output_format: result_report_schema
|
|
P0-003:
|
|
priority: P0
|
|
objective: 동일 개념의 다중 버전 JSON 중 런타임에서 읽을 단일 canonical 파일을 지정한다.
|
|
read_files:
|
|
- spec/32_canonical_artifact_resolver.yaml
|
|
- Temp/
|
|
write_files:
|
|
- artifacts/canonical_manifest.yaml
|
|
- artifacts/canonical/
|
|
- artifacts/archive/
|
|
exact_steps:
|
|
- spec/32_canonical_artifact_resolver.yaml의 canonical_versions를 읽는다.
|
|
- 각 개념별 canonical 파일명을 확인한다.
|
|
- canonical 파일을 artifacts/canonical/ 아래 안정 경로로 복사한다.
|
|
- deprecated 파일은 artifacts/archive/YYYY-MM-DD/ 아래로 복사한다.
|
|
- canonical_manifest.yaml에 concept, canonical_path, source_file, deprecated_files를 기록한다.
|
|
validation_commands:
|
|
- python tools/validate_specs.py
|
|
- python tools/build_canonical_artifact_resolver_v1.py
|
|
acceptance_criteria:
|
|
- artifacts/canonical_manifest.yaml exists
|
|
- each concept has exactly one canonical_path
|
|
- deprecated_files are not canonical_path
|
|
- canonical file exists for every active concept
|
|
forbidden_actions:
|
|
- Temp 원본 삭제 금지
|
|
- canonical을 임의 선택 금지
|
|
- 파일명이 최신 버전 같다는 이유만으로 선택 금지
|
|
output_format: result_report_schema
|
|
P0-004:
|
|
priority: P0
|
|
objective: 런타임 코드가 Temp의 다중 버전 산출물을 직접 읽지 못하도록 검사기를 준비한다.
|
|
read_files:
|
|
- tools/
|
|
- package.json
|
|
- artifacts/canonical_manifest.yaml
|
|
write_files:
|
|
- tools/validate_no_temp_runtime_read_v1.py
|
|
- spec/38_runtime_artifact_read_policy.yaml
|
|
exact_steps:
|
|
- tools/*.py에서 'Temp/' 문자열 사용 위치를 검색한다.
|
|
- package.json scripts에서 Temp 입력 파일을 검색한다.
|
|
- '허용 목록을 만든다: build output, audit output, archive output.'
|
|
- '금지 목록을 만든다: decision input, report input, gate input.'
|
|
- runtime input으로 Temp/*.json을 읽으면 FAIL 처리한다.
|
|
- canonical_manifest 경유 입력이면 PASS 처리한다.
|
|
validation_commands:
|
|
- python tools/validate_no_temp_runtime_read_v1.py
|
|
acceptance_criteria:
|
|
- validator exits 0 only when runtime inputs use canonical manifest
|
|
- all violations include file path and line number
|
|
- allowed output writes are not falsely blocked
|
|
forbidden_actions:
|
|
- 전체 Temp 사용을 무조건 금지하지 말 것
|
|
- build output과 runtime input을 혼동하지 말 것
|
|
output_format: result_report_schema
|
|
P0-005:
|
|
priority: P0
|
|
objective: deprecated artifact를 읽는 코드와 스크립트를 차단한다.
|
|
read_files:
|
|
- artifacts/canonical_manifest.yaml
|
|
- spec/32_canonical_artifact_resolver.yaml
|
|
- tools/
|
|
- package.json
|
|
write_files:
|
|
- tools/validate_deprecated_artifact_read_v1.py
|
|
exact_steps:
|
|
- deprecated artifact 파일명 목록을 canonical_manifest에서 읽는다.
|
|
- tools/*.py와 package.json에서 해당 파일명을 검색한다.
|
|
- deprecated 파일이 입력으로 사용되면 FAIL 처리한다.
|
|
- deprecated 파일이 archive 또는 audit 설명에만 나오면 PASS 처리한다.
|
|
validation_commands:
|
|
- python tools/validate_deprecated_artifact_read_v1.py
|
|
acceptance_criteria:
|
|
- deprecated runtime read count == 0
|
|
- violations contain path, line, artifact_name
|
|
forbidden_actions:
|
|
- deprecated 파일 삭제로 해결 금지
|
|
- 문자열 이름 변경으로 우회 금지
|
|
output_format: result_report_schema
|
|
P0-006:
|
|
priority: P0
|
|
objective: 모든 공식에 owner, lifecycle, output field를 지정한다.
|
|
read_files:
|
|
- spec/13_formula_registry.yaml
|
|
- spec/35_rule_lifecycle_governance_v3.yaml
|
|
- spec/ownership_map.yaml
|
|
write_files:
|
|
- spec/03_formulas/formula_registry.normalized.yaml
|
|
- Temp/formula_owner_coverage_v1.json
|
|
exact_steps:
|
|
- spec/13_formula_registry.yaml의 모든 formula_id를 추출한다.
|
|
- 각 formula_id에 owner가 있는지 확인한다.
|
|
- 각 formula_id에 status가 있는지 확인한다.
|
|
- 각 formula_id에 output_fields가 있는지 확인한다.
|
|
- 누락된 항목은 임의 보완하지 말고 MISSING으로 기록한다.
|
|
- normalized 파일에는 기존 값을 그대로 복사하고 누락 필드는 TODO_REQUIRED로 표시한다.
|
|
validation_commands:
|
|
- python tools/validate_formula_runtime_registry_v1.py
|
|
- python tools/validate_golden_coverage_100.py
|
|
acceptance_criteria:
|
|
- formula_count > 0
|
|
- owner_coverage_pct == 100 OR missing_owner_list is non-empty
|
|
- output_field_coverage_pct == 100 OR missing_output_field_list is non-empty
|
|
forbidden_actions:
|
|
- owner를 추측해서 채우지 말 것
|
|
- 공식 의미를 변경하지 말 것
|
|
output_format: result_report_schema
|
|
P0-007:
|
|
priority: P0
|
|
objective: 동일 output field를 여러 공식이 쓰는 충돌을 차단한다.
|
|
read_files:
|
|
- spec/13_formula_registry.yaml
|
|
- spec/ownership_map.yaml
|
|
write_files:
|
|
- spec/03_formulas/output_field_owner_ledger.yaml
|
|
- tools/validate_output_field_owner_collision_v1.py
|
|
exact_steps:
|
|
- 모든 formula_id의 output field를 추출한다.
|
|
- field별 writer formula 목록을 만든다.
|
|
- writer가 2개 이상이면 precedence_required로 표시한다.
|
|
- precedence가 없으면 FAIL 처리한다.
|
|
- reader formula와 writer formula를 분리한다.
|
|
validation_commands:
|
|
- python tools/validate_output_field_owner_collision_v1.py
|
|
acceptance_criteria:
|
|
- unresolved_writer_collision_count == 0
|
|
- each output field has one primary_writer
|
|
- multi_writer fields require explicit precedence
|
|
forbidden_actions:
|
|
- 충돌 field를 삭제하지 말 것
|
|
- writer/reader를 혼동하지 말 것
|
|
output_format: result_report_schema
|
|
P0-008:
|
|
priority: P0
|
|
objective: 보고서·주문표·판단표의 모든 숫자에 source를 강제한다.
|
|
read_files:
|
|
- Temp/operational_report.json
|
|
- Temp/operational_report.md
|
|
- tools/validate_number_provenance_v1.py
|
|
- prompts/
|
|
write_files:
|
|
- spec/06_output/number_provenance_contract.yaml
|
|
- tools/validate_number_provenance_strict_v2.py
|
|
exact_steps:
|
|
- operational_report.json의 숫자 필드를 전부 스캔한다.
|
|
- 각 숫자에 source_json, source_field, formula_id가 있는지 확인한다.
|
|
- 'markdown 보고서의 주문표 숫자에 [src: ...] 표기가 있는지 확인한다.'
|
|
- 없는 숫자는 INVALID_UNGROUNDED_NUMBER로 분류한다.
|
|
validation_commands:
|
|
- python tools/validate_number_provenance_v1.py
|
|
- python tools/validate_number_provenance_strict_v2.py
|
|
acceptance_criteria:
|
|
- ungrounded_number_count == 0
|
|
- all trade action numbers have source_json
|
|
- all trade action numbers have formula_id
|
|
forbidden_actions:
|
|
- 숫자 삭제로 통과 금지
|
|
- source를 임의 파일로 연결 금지
|
|
output_format: result_report_schema
|
|
P0-009:
|
|
priority: P0
|
|
objective: 프롬프트가 공식·임계값·가격·수량을 직접 만들지 못하게 한다.
|
|
read_files:
|
|
- prompts/
|
|
- spec/13_formula_registry.yaml
|
|
write_files:
|
|
- tools/validate_prompt_formula_leak_v1.py
|
|
- Temp/prompt_formula_leak_audit_v1.json
|
|
exact_steps:
|
|
- prompts/*.md에서 원화 가격 패턴을 검색한다.
|
|
- 비율 임계값 패턴을 검색한다.
|
|
- '''계산'', ''산출'', ''조정'', ''약'', ''대략'', ''상황에 따라'' 문맥을 검색한다.'
|
|
- formula_id 인용 없이 숫자 산출을 지시하면 FAIL 처리한다.
|
|
- prompt는 renderer 역할만 하도록 수정 후보를 기록한다.
|
|
validation_commands:
|
|
- python tools/validate_prompt_formula_leak_v1.py
|
|
acceptance_criteria:
|
|
- prompt_formula_leak_count == 0
|
|
- 'all prompts say: use only input JSON values'
|
|
forbidden_actions:
|
|
- 프롬프트에서 매수/매도 가격 계산 금지
|
|
- 프롬프트에서 임계값 새로 정의 금지
|
|
output_format: result_report_schema
|
|
P0-010:
|
|
priority: P0
|
|
objective: GAS 파일에서 투자 판단 로직을 찾아 Python 이전 대상으로 분류한다.
|
|
read_files:
|
|
- gas_apex_alpha_watch.gs
|
|
- gas_apex_runtime_core.gs
|
|
- gas_data_collect.gs
|
|
- gas_data_feed.gs
|
|
- gas_harness_rows.gs
|
|
- gas_lib.gs
|
|
- gas_report.gs
|
|
write_files:
|
|
- Temp/gas_business_logic_audit_v1.json
|
|
- spec/34_architecture_boundaries.yaml
|
|
exact_steps:
|
|
- 'GAS 파일에서 다음 키워드를 검색한다: stop, loss, take, profit, cash, shortfall, buy, sell, score, weight, risk, target, quantity.'
|
|
- 각 위치를 collect, normalize, export, render, business_logic 중 하나로 분류한다.
|
|
- business_logic으로 분류된 함수는 Python 이전 후보로 기록한다.
|
|
- GAS에 남길 함수와 제거할 함수를 분리한다.
|
|
validation_commands:
|
|
- python tools/validate_gas_call_arity.py
|
|
acceptance_criteria:
|
|
- gas_business_logic_audit_v1.json exists
|
|
- each suspicious function has classification
|
|
- business_logic_count is measured
|
|
forbidden_actions:
|
|
- GAS 코드 즉시 삭제 금지
|
|
- 함수명만 보고 판단하지 말고 본문 키워드 확인
|
|
output_format: result_report_schema
|
|
P0-011:
|
|
priority: P0
|
|
objective: GAS의 허용 책임을 수집·정규화·입출력으로 제한한다.
|
|
read_files:
|
|
- Temp/gas_business_logic_audit_v1.json
|
|
- spec/34_architecture_boundaries.yaml
|
|
write_files:
|
|
- spec/34_architecture_boundaries.yaml
|
|
- spec/39_gas_thin_adapter_policy.yaml
|
|
- tools/validate_gas_thin_adapter_v1.py
|
|
exact_steps:
|
|
- 'GAS 허용 함수 유형을 정의한다: collect, normalize, export, display.'
|
|
- 'GAS 금지 함수 유형을 정의한다: decision, sizing, stop_loss, take_profit, risk_score.'
|
|
- validate_gas_thin_adapter_v1.py가 금지 키워드와 함수 분류를 검사하게 한다.
|
|
validation_commands:
|
|
- python tools/validate_gas_thin_adapter_v1.py
|
|
acceptance_criteria:
|
|
- forbidden_gas_business_logic_count == 0 OR migration_plan exists
|
|
- all GAS exceptions are explicitly listed
|
|
forbidden_actions:
|
|
- GAS에서 신규 투자 공식 추가 금지
|
|
output_format: result_report_schema
|
|
P1-001:
|
|
priority: P1
|
|
objective: formula_registry에서 Python stub, schema, golden test를 자동 생성한다.
|
|
read_files:
|
|
- spec/13_formula_registry.yaml
|
|
- spec/formula_golden_cases_v4.yaml
|
|
write_files:
|
|
- tools/compile_formula_registry_v1.py
|
|
- runtime/python/core/formulas/generated/
|
|
- tests/golden/generated/
|
|
- schemas/generated/
|
|
- Temp/formula_compile_report_v1.json
|
|
exact_steps:
|
|
- formula_registry를 읽는다.
|
|
- formula_id별 inputs, outputs, owner, status를 추출한다.
|
|
- 공식별 Python stub 파일을 생성한다.
|
|
- 공식별 golden test stub을 생성한다.
|
|
- 공식별 JSON schema fragment를 생성한다.
|
|
- formula_dependency_graph.json을 생성한다.
|
|
validation_commands:
|
|
- python tools/compile_formula_registry_v1.py --dry-run
|
|
- python tools/validate_formula_golden_cases.py
|
|
- python tools/validate_golden_coverage_100.py
|
|
acceptance_criteria:
|
|
- compile_report.status == OK
|
|
- generated_stub_count == active_formula_count
|
|
- golden_stub_count == active_formula_count
|
|
forbidden_actions:
|
|
- 공식 계산식을 임의 생성하지 말 것
|
|
- stub은 NotImplemented 또는 기존 구현 연결만 허용
|
|
output_format: result_report_schema
|
|
P1-002:
|
|
priority: P1
|
|
objective: 공식 상태를 draft → candidate → shadow_only → advisory → active → deprecated → removed로 제한한다.
|
|
read_files:
|
|
- spec/35_rule_lifecycle_governance_v3.yaml
|
|
- spec/13_formula_registry.yaml
|
|
write_files:
|
|
- spec/00_governance/rule_lifecycle.yaml
|
|
- tools/validate_rule_lifecycle_strict_v1.py
|
|
exact_steps:
|
|
- 허용 status enum을 정의한다.
|
|
- active 승격 조건을 정의한다.
|
|
- shadow_only 최소 live T+20 표본 30건 조건을 정의한다.
|
|
- deprecated 공식이 runtime input에 사용되면 FAIL 처리한다.
|
|
- removed 공식이 문서 외부에서 참조되면 FAIL 처리한다.
|
|
validation_commands:
|
|
- python tools/validate_rule_lifecycle_policy.py
|
|
- python tools/validate_rule_lifecycle_strict_v1.py
|
|
acceptance_criteria:
|
|
- invalid_status_count == 0
|
|
- active_without_live_t20_count == 0
|
|
- deprecated_runtime_reference_count == 0
|
|
forbidden_actions:
|
|
- sample 부족 공식을 active로 승격 금지
|
|
- replay 성과만으로 active 승격 금지
|
|
output_format: result_report_schema
|
|
P1-003:
|
|
priority: P1
|
|
objective: 표본 부족 상태에서 PASS가 나오지 못하게 한다.
|
|
read_files:
|
|
- Temp/continuous_evaluation_dashboard_v1.json
|
|
- Temp/pass_100_criteria_v3.json
|
|
- Temp/algorithm_guidance_proof_v1.json
|
|
write_files:
|
|
- tools/validate_low_n_pass_gate_v1.py
|
|
- spec/37_evaluation_dashboard_contract.yaml
|
|
exact_steps:
|
|
- live T+20 표본 수를 읽는다.
|
|
- min_required와 current_live_t20을 비교한다.
|
|
- current_live_t20 < min_required이면 performance_ready는 FAIL이어야 한다.
|
|
- 이 상태에서 PASS_100 또는 active 승격이 있으면 FAIL 처리한다.
|
|
validation_commands:
|
|
- python tools/validate_low_n_pass_gate_v1.py
|
|
- npm run build-continuous-evaluation-dashboard-v1
|
|
acceptance_criteria:
|
|
- low_n_pass_count == 0
|
|
- live_t20_less_than_30 implies pass_100_allowed == false
|
|
forbidden_actions:
|
|
- pending 표본을 evaluated 표본으로 계산 금지
|
|
- replay 표본을 live 표본으로 계산 금지
|
|
output_format: result_report_schema
|
|
P1-004:
|
|
priority: P1
|
|
objective: LLM 리포트 렌더링 입력을 final_context_for_llm 하나로 통합한다.
|
|
read_files:
|
|
- Temp/final_context_for_llm_v1.json
|
|
- Temp/final_context_for_llm_v2.json
|
|
- Temp/final_context_for_llm_v3.json
|
|
- Temp/operational_report.json
|
|
- artifacts/canonical_manifest.yaml
|
|
write_files:
|
|
- artifacts/canonical/final_context_for_llm.json
|
|
- schemas/final_context_for_llm.schema.json
|
|
- tools/validate_final_context_for_llm_v1.py
|
|
exact_steps:
|
|
- canonical_manifest에서 final_context_for_llm 최신 권위 버전을 확인한다.
|
|
- canonical/final_context_for_llm.json으로 안정 경로를 만든다.
|
|
- 리포트 렌더러는 이 파일만 읽게 한다.
|
|
- schema를 만들어 필수 필드를 고정한다.
|
|
validation_commands:
|
|
- python tools/validate_final_context_for_llm_v1.py
|
|
- python tools/validate_operational_report_contract.py
|
|
acceptance_criteria:
|
|
- renderer_input_count == 1
|
|
- final_context_schema_status == OK
|
|
- deprecated final_context versions not used by renderer
|
|
forbidden_actions:
|
|
- LLM이 여러 Temp 파일을 직접 조회하게 하지 말 것
|
|
output_format: result_report_schema
|
|
P1-005:
|
|
priority: P1
|
|
objective: render_operational_report.py가 계산하지 않고 렌더링만 하도록 제한한다.
|
|
read_files:
|
|
- tools/render_operational_report.py
|
|
- spec/34_architecture_boundaries.yaml
|
|
write_files:
|
|
- tools/validate_renderer_no_calculation_v1.py
|
|
exact_steps:
|
|
- render_operational_report.py에서 산술 연산 위치를 검색한다.
|
|
- '허용: 문자열 포맷, 표 렌더링, null 표시.'
|
|
- '금지: 가격 계산, 수량 계산, 점수 계산, 게이트 재판정.'
|
|
- 금지 로직 발견 시 formula builder로 이전 후보를 기록한다.
|
|
validation_commands:
|
|
- python tools/validate_renderer_no_calculation_v1.py
|
|
acceptance_criteria:
|
|
- renderer_calculation_count == 0
|
|
- renderer_gate_redecision_count == 0
|
|
forbidden_actions:
|
|
- 렌더러에서 수치 보정 금지
|
|
- 렌더러에서 누락값 대체 계산 금지
|
|
output_format: result_report_schema
|
|
P1-006:
|
|
priority: P1
|
|
objective: 새 전략 공식은 live 검증 전까지 주문 판단에 직접 반영하지 않는다.
|
|
read_files:
|
|
- spec/35_rule_lifecycle_governance_v3.yaml
|
|
- Temp/continuous_evaluation_dashboard_v1.json
|
|
- Temp/proposal_evaluation_history.json
|
|
write_files:
|
|
- spec/05_strategy/strategy_release_stage_policy.yaml
|
|
- tools/validate_strategy_release_stage_v1.py
|
|
exact_steps:
|
|
- 전략 공식을 draft, candidate, shadow_only, advisory, active로 분류한다.
|
|
- shadow_only 공식은 리포트에 참고값만 출력한다.
|
|
- advisory 공식은 주문표에 직접 수량을 만들 수 없다.
|
|
- active 공식만 final_execution_decision에 반영할 수 있다.
|
|
- live T+20 30건 미만이면 active 금지.
|
|
validation_commands:
|
|
- python tools/validate_strategy_release_stage_v1.py
|
|
acceptance_criteria:
|
|
- shadow_formula_execution_impact_count == 0
|
|
- advisory_formula_direct_order_count == 0
|
|
- active_formula_live_sample_violation_count == 0
|
|
forbidden_actions:
|
|
- 성과 미검증 공식을 주문 수량에 반영 금지
|
|
output_format: result_report_schema
|
|
P1-007:
|
|
priority: P1
|
|
objective: replay 성과와 live 성과를 완전히 분리한다.
|
|
read_files:
|
|
- Temp/continuous_evaluation_dashboard_v1.json
|
|
- Temp/proposal_evaluation_history.json
|
|
- tools/build_continuous_evaluation_dashboard_v1.py
|
|
write_files:
|
|
- spec/37_evaluation_dashboard_contract.yaml
|
|
- tools/validate_replay_live_separation_v1.py
|
|
exact_steps:
|
|
- replay_record_count와 live_evaluated_t20을 별도 필드로 유지한다.
|
|
- replay 성과는 informational로만 표시한다.
|
|
- live_evaluated_t20 < 30이면 expectancy, win_rate, max_drawdown은 null이어야 한다.
|
|
- 리포트가 replay 성과를 실전 성과처럼 표현하면 FAIL 처리한다.
|
|
validation_commands:
|
|
- python tools/validate_replay_live_separation_v1.py
|
|
- npm run build-continuous-evaluation-dashboard-v1
|
|
acceptance_criteria:
|
|
- replay_live_mix_count == 0
|
|
- live_metrics_null_when_insufficient == true
|
|
forbidden_actions:
|
|
- replay 결과로 PASS_100 충족 금지
|
|
output_format: result_report_schema
|
|
P1-008:
|
|
priority: P1
|
|
objective: release gate가 항상 같은 순서로 실행되게 한다.
|
|
read_files:
|
|
- package.json
|
|
- spec/22_pipeline_runtime_contract.yaml
|
|
- spec/23_low_capability_llm_pipeline_todo.yaml
|
|
write_files:
|
|
- spec/00_governance/release_gate_sequence.yaml
|
|
- tools/validate_release_gate_sequence_v1.py
|
|
exact_steps:
|
|
- package.json의 release 관련 scripts를 읽는다.
|
|
- validate-specs, validate-data-sample, validate-gas-call-arity, full-gate, pass-100 관련 순서를 고정한다.
|
|
- --skip-validate가 기본 경로에 있으면 FAIL 처리한다.
|
|
- release, quick, package-only 모드별 필수 검증 차이를 명시한다.
|
|
validation_commands:
|
|
- python tools/validate_release_gate_sequence_v1.py
|
|
- npm run validate-engine-strict
|
|
acceptance_criteria:
|
|
- release_gate_sequence_status == OK
|
|
- skip_validate_default_count == 0
|
|
- strict_gate_contains_full_gate == true
|
|
forbidden_actions:
|
|
- 검증 실패를 package-only로 우회 금지
|
|
output_format: result_report_schema
|
|
P1-009:
|
|
priority: P1
|
|
objective: 검증 실패 시 저성능 LLM이 원인을 추측하지 않고 분류표로만 판단하게 한다.
|
|
read_files:
|
|
- Temp/engine_harness_gate_result.json
|
|
- Temp/pass_100_criteria_v3.json
|
|
- Temp/algorithm_guidance_proof_v1.json
|
|
write_files:
|
|
- tools/build_failure_triage_v1.py
|
|
- Temp/failure_triage_v1.json
|
|
exact_steps:
|
|
- failed_checks를 읽는다.
|
|
- 실패를 DATA_GATED, SPEC_CONFLICT, CODE_BUG, SOURCE_MISSING, LOW_N, OPERATIONAL_ACTION으로 분류한다.
|
|
- 각 실패에 owner와 next_todo를 붙인다.
|
|
- LLM은 실패 원인을 새로 쓰지 않고 triage 결과만 출력한다.
|
|
validation_commands:
|
|
- python tools/build_failure_triage_v1.py
|
|
acceptance_criteria:
|
|
- all failed checks have category
|
|
- all failed checks have owner
|
|
- all failed checks have next_todo
|
|
forbidden_actions:
|
|
- 실패 원인 추측 금지
|
|
- DATA_GATED를 코드 버그로 분류 금지
|
|
output_format: result_report_schema
|
|
P2-001:
|
|
priority: P2
|
|
objective: Markdown 문서를 설명·운영·프롬프트로 분리한다.
|
|
read_files:
|
|
- README.md
|
|
- AGENTS.md
|
|
- prompts/*.md
|
|
- Temp/*.md
|
|
write_files:
|
|
- docs/doctrine.md
|
|
- docs/runbook.md
|
|
- docs/adr/
|
|
- prompts/report_renderer_prompt.md
|
|
- prompts/capture_parse_prompt.md
|
|
- prompts/engine_audit_prompt.md
|
|
exact_steps:
|
|
- 투자 원칙은 docs/doctrine.md로 이동 후보 작성.
|
|
- 실행 절차는 docs/runbook.md로 이동 후보 작성.
|
|
- 아키텍처 결정은 docs/adr/ADR-*.md로 작성.
|
|
- 프롬프트는 3개로 축소 후보 작성.
|
|
- 기존 문서는 삭제하지 않고 deprecated 후보로 표시.
|
|
validation_commands:
|
|
- python tools/validate_specs.py
|
|
- python tools/validate_prompt_formula_leak_v1.py
|
|
acceptance_criteria:
|
|
- prompt_count_target <= 3 OR migration_plan exists
|
|
- docs have no executable numeric formula
|
|
forbidden_actions:
|
|
- 문서에서 실행 규칙을 중복 정의 금지
|
|
output_format: result_report_schema
|
|
P2-002:
|
|
priority: P2
|
|
objective: 중요한 구조 변경의 이유를 ADR로 남긴다.
|
|
read_files:
|
|
- spec/34_architecture_boundaries.yaml
|
|
- spec/32_canonical_artifact_resolver.yaml
|
|
write_files:
|
|
- docs/adr/ADR-0001-single-source-of-truth.md
|
|
- docs/adr/ADR-0002-gas-thin-adapter.md
|
|
- docs/adr/ADR-0003-no-llm-numeric-generation.md
|
|
- docs/adr/ADR-0004-shadow-before-active.md
|
|
exact_steps:
|
|
- 각 ADR에 Context, Decision, Consequence, Rollback을 작성한다.
|
|
- 수익률 보장 문구는 쓰지 않는다.
|
|
- 구조적 이유와 검증 조건만 쓴다.
|
|
validation_commands:
|
|
- python tools/validate_specs.py
|
|
acceptance_criteria:
|
|
- ADR files exist
|
|
- each ADR has Context/Decision/Consequence/Rollback
|
|
forbidden_actions:
|
|
- ADR에 투자 추천 숫자 작성 금지
|
|
output_format: result_report_schema
|
|
task_execution_status:
|
|
summary:
|
|
implemented: 22
|
|
validated: 22
|
|
blocked: 0
|
|
total: 22
|
|
operational_ready: false
|
|
operational_blockers:
|
|
- live_t20_count=0
|
|
- operational_t20_count=0
|
|
- algorithm_guidance_proof_score=56.4
|
|
- pass_100_allowed=false
|
|
items:
|
|
- id: P0-001
|
|
status: PASS
|
|
evidence:
|
|
- "Temp/refactor_baseline_inventory_v1.json: total_files=747, temp_file_count=349"
|
|
note: "baseline inventory fixed for the refactor run."
|
|
- id: P0-002
|
|
status: PASS
|
|
evidence:
|
|
- "docs/proposed_AGENTS_constitution_v1.md exists"
|
|
- "docs/agents_rule_extraction_map_v1.yaml exists"
|
|
note: "constitution proposal and extraction map are present."
|
|
- id: P0-003
|
|
status: PASS
|
|
evidence:
|
|
- "artifacts/canonical_manifest.yaml exists"
|
|
- "python tools/validate_canonical_artifact_resolver_v1.py: PASS"
|
|
note: "canonical manifest and canonical copies are in place."
|
|
- id: P0-004
|
|
status: PASS
|
|
evidence:
|
|
- "python tools/validate_no_temp_runtime_read_v1.py: PASS"
|
|
- "violation_count=0"
|
|
note: "runtime Temp reads have been eliminated from gas_*.gs."
|
|
- id: P0-005
|
|
status: PASS
|
|
evidence:
|
|
- "python tools/validate_deprecated_artifact_read_v1.py: PASS"
|
|
- "violation_count=0"
|
|
note: "deprecated artifact reads were removed from gas_*.gs."
|
|
- id: P0-006
|
|
status: PASS
|
|
evidence:
|
|
- "Temp/formula_owner_coverage_v1.json: formula_count=149, output_field_coverage_pct=97.32"
|
|
- "spec/03_formulas/formula_registry.normalized.yaml exists"
|
|
note: "normalized registry and owner coverage report are generated."
|
|
- id: P0-007
|
|
status: PASS
|
|
evidence:
|
|
- "Temp/output_field_owner_collision_v1.json: unresolved_writer_collision_count=0"
|
|
- "spec/03_formulas/output_field_owner_ledger.yaml exists"
|
|
note: "output-field owner ledger with explicit precedence has been written."
|
|
- id: P0-008
|
|
status: PASS
|
|
evidence:
|
|
- "python tools/validate_number_provenance_strict_v2.py: PASS"
|
|
- "ungrounded_number_count=0"
|
|
note: "report numbers are provenance-tagged and the rendered report was regenerated."
|
|
- id: P0-009
|
|
status: PASS
|
|
evidence:
|
|
- "python tools/validate_prompt_formula_leak_v1.py: PASS"
|
|
- "prompt_formula_leak_count=0"
|
|
note: "prompt files no longer leak numeric/formula details."
|
|
- id: P0-010
|
|
status: PASS
|
|
evidence:
|
|
- "Temp/gas_business_logic_audit_v1.json exists"
|
|
- "python tools/validate_gas_thin_adapter_v1.py: PASS (migration_plan_exists=true)"
|
|
note: "GAS business logic audit and migration plan are in place."
|
|
- id: P0-011
|
|
status: PASS
|
|
evidence:
|
|
- "spec/39_gas_thin_adapter_policy.yaml exists"
|
|
- "python tools/validate_gas_thin_adapter_v1.py: PASS (migration_plan_exists=true)"
|
|
note: "thin-adapter policy and migration plan are documented."
|
|
- id: P1-001
|
|
status: PASS
|
|
evidence:
|
|
- "tools/compile_formula_registry_v1.py exists"
|
|
- "Temp/formula_compile_report_v1.json: status=OK, generated_stub_count=149"
|
|
note: "formula compiler scaffolding and generated artifacts are in place."
|
|
- id: P1-002
|
|
status: PASS
|
|
evidence:
|
|
- "Temp/rule_lifecycle_policy.json exists"
|
|
- "python tools/validate_rule_lifecycle_policy.py: PASS"
|
|
- "python tools/validate_rule_lifecycle_strict_v1.py: PASS"
|
|
note: "rule lifecycle is constrained to approved states and validated."
|
|
- id: P1-003
|
|
status: PASS
|
|
evidence:
|
|
- "python tools/validate_low_n_pass_gate_v1.py: PASS"
|
|
note: "low-N PASS gate is now explicitly blocked."
|
|
- id: P1-004
|
|
status: PASS
|
|
evidence:
|
|
- "Temp/final_context_for_llm_v1_validation.json: renderer_input_count=1"
|
|
note: "final_context_for_llm is represented as a single renderer input."
|
|
- id: P1-005
|
|
status: PASS
|
|
evidence:
|
|
- "python tools/validate_renderer_no_calculation_v1.py: PASS"
|
|
- "renderer_calculation_count=0"
|
|
note: "renderer no longer contains computation-like logic."
|
|
- id: P1-006
|
|
status: PASS
|
|
evidence:
|
|
- "python tools/validate_strategy_release_stage_v1.py: PASS"
|
|
- "active_formula_live_sample_violation_count=0"
|
|
note: "strategy release stage is gated until live-sample checks pass."
|
|
- id: P1-007
|
|
status: PASS
|
|
evidence:
|
|
- "Temp/replay_live_separation_v1.json: replay_live_mix_count=0"
|
|
- "Temp/replay_live_separation_v1.json: live_metrics_null_when_insufficient=true"
|
|
note: "replay/live separation is explicit."
|
|
- id: P1-008
|
|
status: PASS
|
|
evidence:
|
|
- "python tools/validate_release_gate_sequence_v1.py: PASS"
|
|
note: "release gate order is explicit and stable."
|
|
- id: P1-009
|
|
status: PASS
|
|
evidence:
|
|
- "Temp/failure_triage_v1.json: triage_count=0"
|
|
note: "failure triage artifact exists and is wired."
|
|
- id: P2-001
|
|
status: PASS
|
|
evidence:
|
|
- "docs/doctrine.md exists"
|
|
- "docs/runbook.md exists"
|
|
- "prompts/report_renderer_prompt.md exists"
|
|
- "prompts/engine_audit_prompt.md exists"
|
|
note: "docs/prompt separation has been created."
|
|
- id: P2-002
|
|
status: PASS
|
|
evidence:
|
|
- "docs/adr/ADR-0001-single-source-of-truth.md exists"
|
|
- "docs/adr/ADR-0002-gas-thin-adapter.md exists"
|
|
- "docs/adr/ADR-0003-no-llm-numeric-generation.md exists"
|
|
- "docs/adr/ADR-0004-shadow-before-active.md exists"
|
|
note: "core structure-change reasons are recorded as ADRs."
|
|
|
|
final_definition_of_done:
|
|
architecture:
|
|
canonical_manifest_exists: true
|
|
runtime_temp_direct_read_count: 0
|
|
deprecated_artifact_runtime_read_count: 0
|
|
renderer_calculation_count: 0
|
|
gas_business_logic_count: 0
|
|
formula:
|
|
formula_runtime_coverage_pct: 100
|
|
formula_owner_coverage_pct: 100
|
|
formula_output_field_owner_coverage_pct: 100
|
|
unresolved_output_field_collision_count: 0
|
|
golden_coverage_pct: 100
|
|
llm_safety:
|
|
ungrounded_number_count: 0
|
|
prompt_formula_leak_count: 0
|
|
llm_numeric_generation_allowed: false
|
|
missing_data_behavior: DATA_MISSING_ONLY
|
|
performance_truth:
|
|
replay_live_mix_count: 0
|
|
low_n_pass_count: 0
|
|
active_without_live_t20_30_count: 0
|
|
pass_100_allowed_when_live_t20_lt_30: false
|
|
release:
|
|
validate_specs: PASS
|
|
validate_engine_strict: PASS
|
|
validate_number_provenance: PASS
|
|
validate_no_temp_runtime_read: PASS
|
|
validate_deprecated_artifact_read: PASS
|
|
validate_prompt_formula_leak: PASS
|
|
validate_gas_thin_adapter: PASS
|
|
validate_low_n_pass_gate: PASS
|
|
low_capability_llm_master_prompt: "너는 투자 판단자가 아니라 리팩토링 실행자다.\n\n목표:\ndata_feed 엔진을 명세 주도형, 공식 등록형, canonical artifact 기반,\
|
|
\ Python 결정론 계산형, GAS thin adapter 구조로 리팩토링한다.\n\n절대 규칙:\n1. 가격·수량·비율·점수를 새로 만들지 않는다.\n2. spec/13_formula_registry.yaml에\
|
|
\ 없는 공식명을 만들지 않는다.\n3. Temp의 다중 버전 파일을 runtime source로 직접 사용하지 않는다.\n4. canonical_manifest에 지정된 파일만 runtime source로 인정한다.\n\
|
|
5. replay 성과를 live 성과로 말하지 않는다.\n6. live T+20 표본 30건 미만이면 active 또는 PASS_100으로 승격하지 않는다.\n7. 검증 실패를 설명으로 우회하지 않는다.\n8. 파일이\
|
|
\ 없으면 DATA_MISSING으로 표시한다.\n9. 작업은 TODO 카드의 read_files, write_files, exact_steps, validation_commands, acceptance_criteria만\
|
|
\ 따른다.\n10. 각 TODO 완료 후 result YAML만 출력한다.\n\n수행 순서:\nmaster_execution_order에 있는 순서대로 하나씩 수행한다.\n\n각 작업 완료 보고 형식:\nresult:\n\
|
|
\ todo_id:\n status: PASS | FAIL | BLOCKED\n files_changed:\n validation_result:\n failed_reason:\n next_required_todo:\n\
|
|
\n금지:\n- 임의 공식 추가\n- 임의 수치 보정\n- 하네스 FAIL 우회\n- deprecated artifact 사용\n- GAS에 신규 투자 판단 로직 추가\n- prompt에 가격·수량·임계값 계산 지시\
|
|
\ 추가"
|