785 lines
33 KiB
YAML
785 lines
33 KiB
YAML
schema_version: quant_engine_refactor_blueprint.v1
|
|
generated_at_kst: '2026-06-07T16:00:00+09:00'
|
|
title: 저성능 LLM 호환 퀀트투자 엔진 리팩토링·고도화 YAML 실행계획
|
|
role_assumption: 30년 퀀트투자자 + 시니어 개발자 + 아키텍트 + PM 관점
|
|
objective:
|
|
primary: md/yaml/gs/py만으로도 장기 확장 가능한 결정론적 퀀트투자 엔진 운영체계 확립
|
|
secondary: 저성능 LLM이 TODO와 final_context packet만 따라도 고성능 LLM과 같은 보고서/판단을 재현하도록 수치·공식·게이트를
|
|
고정
|
|
target_outcome: 임의 판단 최소화, 공식/데이터 정합성 100%, 릴리스 DAG PASS, GAS thin adapter, Python
|
|
canonical engine, 문서 다이어트
|
|
current_state_audit:
|
|
source_zip: data_feed.zip
|
|
authority_file_observed: data_feed/AGENTS.md
|
|
repository_entropy_audit:
|
|
gate: PASS
|
|
total_file_count: 1423
|
|
package_script_count: 21
|
|
temp_json_count: 16
|
|
budget:
|
|
max_total_files: 2000
|
|
max_package_scripts: 220
|
|
max_temp_json_files: 500
|
|
local_file_scan:
|
|
md_files: 39
|
|
yaml_files: 166
|
|
gs_files: 7
|
|
py_files: 829
|
|
json_files_after_local_gate_attempt: 377
|
|
md_lines: 3775
|
|
yaml_lines: 88487
|
|
gs_lines: 20423
|
|
py_lines: 60077
|
|
formula_and_test_scan:
|
|
registered_formulas_in_spec_13: 149
|
|
execution_order_entries: 53
|
|
registered_formulas_not_in_primary_execution_order: 100
|
|
runtime_generated_formula_py: 149
|
|
generated_model_py: 150
|
|
generated_model_schema_json: 150
|
|
generated_golden_cases: 149
|
|
gas_scan:
|
|
gas_apex_alpha_watch.gs:
|
|
lines: 365
|
|
functions: 13
|
|
gas_apex_runtime_core.gs:
|
|
lines: 654
|
|
functions: 14
|
|
gas_data_collect.gs:
|
|
lines: 4451
|
|
functions: 79
|
|
gas_data_feed.gs:
|
|
lines: 10302
|
|
functions: 177
|
|
gas_harness_rows.gs:
|
|
lines: 1456
|
|
functions: 6
|
|
gas_lib.gs:
|
|
lines: 2749
|
|
functions: 98
|
|
gas_report.gs:
|
|
lines: 446
|
|
functions: 3
|
|
release_gate_observation:
|
|
command_attempted: python tools/run_release_dag_v3.py --mode release --strict
|
|
result: FAIL
|
|
first_failed_node: validate_low_capability
|
|
failure_reason: Temp/final_context_for_llm_v5.yaml 파일을 요구하지만 Temp/final_context_for_llm_v4.yaml만
|
|
존재
|
|
missing_inputs_detected_in_release_dag:
|
|
- Temp/final_context_for_llm_v5.yaml
|
|
- Temp/live_replay_separation_v3.json
|
|
- Temp/late_chase_attribution_v2.json
|
|
- Temp/shadow_ledger_v2.json
|
|
- Temp/engine_health_card_v1.json
|
|
version_sprawl_observation:
|
|
strategy_spec_version_groups: 4
|
|
tool_version_groups: 35
|
|
runtime_generated_formula_version_groups: 5
|
|
highest_risk_groups:
|
|
- build_final_context_for_llm_v2/v4 vs release_dag v5
|
|
- build_live_replay_separation_v2/v3 vs Temp live_replay_separation_v2 only
|
|
- fundamental_quality.yaml/v2/v3 without explicit retirement in immediate routing
|
|
- pre_distribution_early_warning_v3/v4
|
|
- predictive_alpha_dialectic_v1/v2
|
|
cold_assessment:
|
|
verdict: 방향은 맞지만 운영 가능성은 릴리스 DAG와 artifact alias 정합성에서 깨진다. 알고리즘 자체보다 운영 하네스의 파일명·버전·계약
|
|
drift가 먼저 수익률을 훼손할 수 있다.
|
|
what_is_good:
|
|
- AGENTS.md가 source-of-truth, Python canonical first, GAS adapter second, provenance,
|
|
shadow ledger 원칙을 이미 보유
|
|
- formula registry 149개와 generated formula/golden parity가 거의 1:1 구조
|
|
- repository entropy budget은 아직 예산 이내
|
|
- release DAG 개념과 active_artifact_manifest가 존재해 단일 실행 경로로 수렴 가능
|
|
what_is_dangerous:
|
|
- 릴리스 DAG가 존재하지 않는 v5/v3 산출물을 직접 참조하여 풀 게이트가 중단됨
|
|
- GAS가 collect/normalize/export/display를 넘어 의사결정·계산 로직을 여전히 많이 품고 있을 가능성이 높음
|
|
- versioned tool/spec가 많아 active/retired/shadow 상태를 모르면 저성능 LLM이 잘못된 버전을 선택할 위험이
|
|
큼
|
|
- 공식 수는 충분하지만 formula lifecycle, activation threshold, retirement condition, expected
|
|
edge 검증이 모든 신규 팩터에 강제되지 않으면 뒷북·설거지 매수가 반복됨
|
|
- 보고서는 기계 산출물이어야 하는데, 중간 YAML/JSON 이름 drift가 있으면 LLM이 결측을 메우려는 환각 경로가 열린다
|
|
non_negotiable_direction: 더 많은 규칙을 추가하지 말고, 규칙을 코드·스키마·골든케이스·DAG 게이트로 실행 가능하게 줄여야
|
|
한다. 문서는 줄이고, 계약과 검증은 강화한다.
|
|
target_methodology:
|
|
name: 'QEDD-SSDLC: Quant Evidence Driven Development + Spec-as-Code Deterministic
|
|
Lifecycle'
|
|
summary: 투자 아이디어는 문장이 아니라 가설-입력-공식-골든케이스-섀도원장-성과평가-활성화 게이트로만 승격한다.
|
|
principles:
|
|
- id: P1
|
|
name: Single Source of Truth
|
|
rule: spec/와 runtime/active_artifact_manifest.yaml이 권위다. Temp는 실행 결과일 뿐 직접 수정하지
|
|
않는다.
|
|
- id: P2
|
|
name: Formula before narrative
|
|
rule: 가격·수량·TP·SL·점수는 spec/13_formula_registry.yaml 또는 하네스 산출값만 허용한다.
|
|
- id: P3
|
|
name: Python canonical first
|
|
rule: 새 의사결정 로직은 src/quant_engine에 먼저 구현하고, GAS는 collect/normalize/export/display만
|
|
수행한다.
|
|
- id: P4
|
|
name: Shadow before active
|
|
rule: 새 팩터는 최소 20거래일 또는 50건 신호의 shadow 성과가 없으면 active 금지.
|
|
- id: P5
|
|
name: No hidden overrides
|
|
rule: LLM, 리포트 렌더러, GAS UI는 하네스 결정을 번복하지 않는다.
|
|
- id: P6
|
|
name: Low capability first
|
|
rule: 저성능 LLM이 읽을 final_context packet은 고정 섹션·고정 순서·숫자 json_path를 갖는다.
|
|
- id: P7
|
|
name: Entropy budget
|
|
rule: 새 파일 1개를 만들면 owner, lifecycle, retirement path, release gate 등록을 동시에 요구한다.
|
|
- id: P8
|
|
name: Evidence over complexity
|
|
rule: 수익 개선 또는 리스크 감소를 수치로 증명하지 못한 팩터는 active로 승격하지 않는다.
|
|
core_loop:
|
|
- hypothesis_yaml
|
|
- data_contract
|
|
- formula_registry_entry
|
|
- python_canonical_implementation
|
|
- schema_model_generation
|
|
- golden_case
|
|
- shadow_ledger
|
|
- calibration_report
|
|
- release_dag_gate
|
|
- active_manifest_promotion
|
|
- low_capability_context_pack
|
|
- report_renderer
|
|
target_architecture:
|
|
pipeline:
|
|
- stage: S0_collect
|
|
owner: GAS thin adapter
|
|
allowed:
|
|
- collect
|
|
- normalize
|
|
- export
|
|
- display
|
|
forbidden:
|
|
- decision
|
|
- sizing
|
|
- stop_loss
|
|
- take_profit
|
|
- risk_score
|
|
- stage: S1_raw_snapshot
|
|
owner: GatherTradingData.json + raw workbook mapping
|
|
gate: spec/14_raw_workbook_mapping.yaml + spec/15_account_snapshot_contract.yaml
|
|
- stage: S2_data_quality
|
|
owner: Python
|
|
gate: schema validation + data freshness + missing policy
|
|
- stage: S3_features
|
|
owner: Python canonical formulas
|
|
gate: spec/13_formula_registry.yaml + generated golden cases
|
|
- stage: S4_risk_and_portfolio
|
|
owner: Python
|
|
gate: aggregate_risk + portfolio_exposure + cash floor
|
|
- stage: S5_decision
|
|
owner: Python decision DAG
|
|
gate: spec/09_decision_flow.yaml + spec/routing/decision_graph.yaml
|
|
- stage: S6_execution_packet
|
|
owner: final_decision_packet
|
|
gate: spec/40_final_decision_packet_contract.yaml
|
|
- stage: S7_low_capability_pack
|
|
owner: context pack builder
|
|
gate: spec/46_low_capability_execution_pack.yaml
|
|
- stage: S8_report
|
|
owner: renderer
|
|
gate: renderer_no_calc + number provenance + report sync
|
|
authority_matrix:
|
|
AGENTS.md: 운영 인덱스만 담당. 세부 규칙을 직접 비대화하지 않는다.
|
|
governance/rules/*.yaml: 운영 규칙. 짧고 해시 검증 가능해야 한다.
|
|
spec/*.yaml: 계약·공식·게이트·출력 스키마의 최상위 권위.
|
|
src/quant_engine: canonical Python implementation.
|
|
tools/*.py: CLI wrapper와 audit/validation 도구. 핵심 투자 로직 금지.
|
|
gas_*.gs: thin adapter. 계산/판단 로직 제거 대상.
|
|
Temp/*.json|yaml: 런타임 산출물. 직접 편집 금지.
|
|
dist/: 배포 산출물. source of truth 금지.
|
|
prompts/: 렌더링 지시. 숫자 생성 금지.
|
|
tests/: golden, parity, regression, replay 검증 담당.
|
|
proposed_new_or_updated_files:
|
|
- spec/48_engine_refactor_methodology.yaml
|
|
- spec/release/artifact_alias_registry.yaml
|
|
- spec/release/version_retirement_policy.yaml
|
|
- spec/release/low_capability_context_aliases.yaml
|
|
- tools/validate_release_dag_inputs_exist_v1.py
|
|
- tools/build_runtime_artifact_aliases_v1.py
|
|
- tools/audit_version_sprawl_v1.py
|
|
- tools/validate_factor_lifecycle_completeness_v2.py
|
|
- tools/validate_gas_forbidden_logic_ratio_v2.py
|
|
- tools/validate_llm_no_numeric_generation_v1.py
|
|
- src/quant_engine/core/pipeline_context.py
|
|
- src/quant_engine/core/decision_packet.py
|
|
- src/quant_engine/core/provenance.py
|
|
- src/quant_engine/core/artifact_resolver.py
|
|
hard_invariants:
|
|
- id: I001
|
|
statement: LLM은 숫자를 계산하지 않는다.
|
|
validation: validate_llm_no_numeric_generation_v1.py
|
|
- id: I002
|
|
statement: 모든 보고서 숫자는 source_path, json_pointer, formula_id, input_hash, freshness_status를
|
|
가져야 한다.
|
|
validation: validate_number_provenance_strict_v3.py
|
|
- id: I003
|
|
statement: global_execution_gate != HTS_READY이면 주문표 출력 금지.
|
|
validation: validate_execution_authority_matrix_v2.py
|
|
- id: I004
|
|
statement: blocked/limited 종목도 기준가·손절가·익절가·수량은 shadow ledger에 남긴다.
|
|
validation: validate_shadow_ledger_contract_v1.py
|
|
- id: I005
|
|
statement: GAS에는 decision/sizing/stop/take_profit/risk_score 계산을 두지 않는다.
|
|
validation: validate_gas_forbidden_logic_ratio_v2.py
|
|
- id: I006
|
|
statement: 새 팩터는 lifecycle 필드 14개를 모두 갖기 전 active 금지.
|
|
validation: validate_factor_lifecycle_completeness_v2.py
|
|
- id: I007
|
|
statement: release DAG의 모든 inputs는 실행 전 존재하거나 upstream node outputs로 선언되어야 한다.
|
|
validation: validate_release_dag_inputs_exist_v1.py
|
|
- id: I008
|
|
statement: renderer_calculation_count는 0이어야 한다.
|
|
validation: validate_renderer_no_calculation_v1.py
|
|
- id: I009
|
|
statement: Temp 산출물 버전은 alias registry를 통해서만 읽는다.
|
|
validation: validate_runtime_source_whitelist_v1.py
|
|
- id: I010
|
|
statement: replay 성과와 live 운영 성과를 혼입하지 않는다.
|
|
validation: validate_no_replay_live_mix_v2.py
|
|
scorecard_formulas:
|
|
release_readiness_score:
|
|
formula: 0.30*dag_pass + 0.20*data_integrity + 0.15*provenance_pass + 0.15*schema_model_parity
|
|
+ 0.10*golden_coverage + 0.10*gas_thin_adapter_score
|
|
target: 100
|
|
block_if_below: 95
|
|
factor_activation_score:
|
|
formula: 0.25*expected_edge_stability + 0.20*drawdown_reduction + 0.20*late_entry_avoidance
|
|
+ 0.15*data_quality + 0.10*turnover_cost_adjusted_edge + 0.10*conflict_penalty_inverse
|
|
target: '>= 75 for active, 60-74 shadow, <60 retire'
|
|
block_if: sample_count < 50 OR lookback_trading_days < 20 OR data_quality < 95
|
|
repository_entropy_score:
|
|
formula: 100 - max(0,total_files/max_total_files-0.80)*100 - version_sprawl_penalty
|
|
- stale_temp_penalty
|
|
target: '>= 90'
|
|
current_comment: 총 파일 수는 예산 이내이나 tool version groups 35개가 실질 entropy 요인
|
|
llm_reproducibility_score:
|
|
formula: 0.40*packet_section_completeness + 0.25*numeric_json_path_coverage +
|
|
0.20*forbidden_phrase_absence + 0.15*golden_response_match
|
|
target: 100
|
|
block_if_below: 98
|
|
refactor_roadmap:
|
|
- phase: P0_release_dag_repair
|
|
priority: CRITICAL
|
|
goal: 풀 게이트가 파일명 drift 때문에 중단되지 않도록 artifact alias와 DAG input validation을 먼저 고친다.
|
|
why_first: 엔진이 아무리 좋아도 release DAG가 깨지면 저성능 LLM 실행팩이 생성되지 않고, 운영 보고서가 환각에 노출된다.
|
|
tasks:
|
|
- id: P0-T001
|
|
title: release DAG input 존재성 검증기를 추가
|
|
method: spec/41_release_dag.yaml의 모든 node.inputs를 읽어 존재하지 않는 파일을 목록화한다. 단, upstream
|
|
outputs로 선언된 파일은 허용한다.
|
|
files_to_create:
|
|
- tools/validate_release_dag_inputs_exist_v1.py
|
|
commands:
|
|
- python tools/validate_release_dag_inputs_exist_v1.py --dag spec/41_release_dag.yaml
|
|
--strict
|
|
acceptance:
|
|
- missing_input_count == 0
|
|
- orphan_temp_reference_count == 0
|
|
status: completed
|
|
- id: P0-T002
|
|
title: final_context_for_llm_v5 alias/빌더 확정
|
|
method: Temp/final_context_for_llm_v4.yaml을 v5로 복사하지 말고 build_low_capability_context_pack_v5.py가
|
|
실제로 v5를 생성하도록 package DAG node를 연결한다. 임시 운영은 alias registry로 v4->v5 호환을 명시한다.
|
|
files_to_modify:
|
|
- tools/build_low_capability_context_pack_v5.py
|
|
- spec/41_release_dag.yaml
|
|
files_to_create:
|
|
- spec/release/low_capability_context_aliases.yaml
|
|
acceptance:
|
|
- Temp/final_context_for_llm_v5.yaml exists
|
|
- validate_low_capability PASS
|
|
- validate_llm_regression PASS
|
|
status: completed
|
|
- id: P0-T003
|
|
title: live_replay_separation_v3, late_chase_attribution_v2, shadow_ledger_v2,
|
|
engine_health_card_v1 생성 노드 연결
|
|
method: DAG가 요구하는 모든 Temp artifact에 대해 upstream builder 또는 alias를 명시한다. 존재하지 않는
|
|
산출물을 validator가 바로 읽는 구조를 금지한다.
|
|
files_to_modify:
|
|
- spec/41_release_dag.yaml
|
|
- tools/run_release_dag_v3.py
|
|
acceptance:
|
|
- all_dag_inputs_resolved == true
|
|
- python tools/run_release_dag_v3.py --mode release --strict returns PASS
|
|
status: completed
|
|
- phase: P1_repository_diet_and_version_retirement
|
|
priority: HIGH
|
|
goal: 많은 문서와 버전 파일을 active/shadow/retired로 정리해 저성능 LLM의 버전 선택 오류를 제거한다.
|
|
tasks:
|
|
- id: P1-T001
|
|
title: version sprawl audit 도구 추가
|
|
method: 파일명 _vN 패턴을 기준으로 active 최신, shadow 비교, retired archive 대상을 분류한다. active_manifest와
|
|
spec aliases가 없는 버전 파일은 읽기 금지 후보로 표시한다.
|
|
files_to_create:
|
|
- tools/audit_version_sprawl_v1.py
|
|
- spec/release/version_retirement_policy.yaml
|
|
acceptance:
|
|
- unclassified_version_group_count == 0
|
|
- active_version_per_rule <= 1
|
|
status: completed
|
|
- id: P1-T002
|
|
title: AGENTS.md를 운영 인덱스로 고정하고 세부 규칙은 governance/rules로 이동
|
|
method: AGENTS.md는 120줄 이하 목표. 세부 규칙은 governance/rules/*.yaml에 남기고 agents_rule_hashes로
|
|
해시 검증한다.
|
|
files_to_modify:
|
|
- AGENTS.md
|
|
- governance/agents_index.yaml
|
|
- governance/agents_rule_hashes.yaml
|
|
commands:
|
|
- python tools/validate_agents_shrink_v1.py
|
|
acceptance:
|
|
- agents_md_line_count <= 120
|
|
- agents_hash_match_pct == 100
|
|
status: completed
|
|
- id: P1-T003
|
|
title: tools/*.py 핵심 로직 제거와 src/quant_engine 이전
|
|
method: tools는 argparse wrapper만 남긴다. 순수 함수·공식·판단 로직은 src/quant_engine/core 또는
|
|
src/quant_engine/formulas로 이전한다.
|
|
acceptance:
|
|
- tools_business_logic_function_count 감소
|
|
- src_import_coverage 증가
|
|
- unit tests remain PASS
|
|
status: completed
|
|
- phase: P2_spec_as_code_contract_unification
|
|
priority: HIGH
|
|
goal: 공식·필드·출력·리스크 계약을 기계 검증 가능한 단일 체계로 묶는다.
|
|
tasks:
|
|
- id: P2-T001
|
|
title: formula registry domain split와 canonical index 동기화
|
|
method: spec/13_formula_registry.yaml은 index와 execution_order만 보유. 세부 공식은 spec/formulas/domains/*.yaml로
|
|
나누되 compile_formula_registry가 단일 registry를 재생성한다.
|
|
files_to_modify:
|
|
- spec/13_formula_registry.yaml
|
|
- spec/formulas/domains/*.yaml
|
|
- src/quant_engine/compile_formula_registry_v1.py
|
|
acceptance:
|
|
- compiled_registry_hash stable
|
|
- formula_count == generated_formula_count == golden_case_count
|
|
status: completed
|
|
- id: P2-T002
|
|
title: output field owner ledger 100% 강제
|
|
method: 모든 output field는 단일 formula owner를 갖는다. owner 충돌 시 release FAIL.
|
|
commands:
|
|
- python tools/validate_output_field_ownership_v1.py --strict
|
|
acceptance:
|
|
- owned_output_field_pct == 100.0
|
|
- authority_collision_count == 0
|
|
status: completed
|
|
- id: P2-T003
|
|
title: registered formulas not in primary execution order를 lifecycle로 분류
|
|
method: execution_order에 없는 100개 공식은 runtime_supplement, renderer_only, deprecated,
|
|
experimental, shadow_only 중 하나로 분류한다.
|
|
files_to_create:
|
|
- spec/formula_lifecycle_index.yaml
|
|
acceptance:
|
|
- unclassified_formula_count == 0
|
|
- deprecated_formula_runtime_reference_count == 0
|
|
status: completed
|
|
- phase: P3_gas_thin_adapter_migration
|
|
priority: HIGH
|
|
goal: GAS 20,423라인을 수집/정규화/표시로 제한하고, 판단·사이징·리스크 계산은 Python으로 완전 이전한다.
|
|
tasks:
|
|
- id: P3-T001
|
|
title: GAS forbidden logic ratio 측정
|
|
method: function 단위로 키워드 decision, score, risk, stop, takeProfit, size, gate,
|
|
verdict를 스캔하고 허용 예외를 분리한다.
|
|
files_to_create:
|
|
- tools/validate_gas_forbidden_logic_ratio_v2.py
|
|
acceptance:
|
|
- gas_forbidden_logic_ratio <= 0.05
|
|
- forbidden_responsibility_function_count == 0 before active release
|
|
status: completed
|
|
- id: P3-T002
|
|
title: gas_data_feed.gs 분할 및 adapter parts 정리
|
|
method: 10,302라인/177함수 파일을 collect, normalize, export, display 모듈로 분해하고, business
|
|
logic은 src/quant_engine로 이동한다.
|
|
files_to_modify:
|
|
- gas_data_feed.gs
|
|
- src/gas_adapter_parts/*
|
|
acceptance:
|
|
- largest_gs_file_lines <= 3000
|
|
- GAS call arity validation PASS
|
|
status: completed
|
|
- id: P3-T003
|
|
title: GAS/Python parity golden test
|
|
method: GAS가 산출한 원자료와 Python이 산출한 final packet의 key fields를 샘플별로 대조한다.
|
|
commands:
|
|
- node tools/run_gas_golden_parity.js
|
|
- python tools/validate_gas_thin_adapter_v1.py
|
|
acceptance:
|
|
- gas_python_parity_pct == 100
|
|
- business_logic_in_gas_count == 0
|
|
status: completed
|
|
- phase: P4_factor_lifecycle_and_anti_late_entry_upgrade
|
|
priority: HIGH
|
|
goal: 뒷북 매수/설거지 매도를 막기 위해 신규 팩터를 shadow 성과 기반으로만 active 승격한다.
|
|
tasks:
|
|
- id: P4-T001
|
|
title: 팩터 lifecycle 14필드 강제
|
|
method: spec/43_quant_factor_taxonomy.yaml의 required_lifecycle_fields를 모든 팩터에
|
|
적용한다.
|
|
files_to_create:
|
|
- tools/validate_factor_lifecycle_completeness_v2.py
|
|
acceptance:
|
|
- factor_lifecycle_completeness_pct == 100
|
|
status: completed
|
|
- id: P4-T002
|
|
title: anti-late-entry gate를 price extension + volume climax + smart money divergence로
|
|
삼중화
|
|
method: 신고가 추격 매수는 20D/60D 이격, 당일 거래대금 과열, 외국인/기관 순매수 둔화, 윗꼬리/갭상승 피로도를 합산해 차단한다.
|
|
files_to_modify:
|
|
- spec/strategy/anti_late_entry_pullback_gate_v5.yaml
|
|
- spec/13_formula_registry.yaml
|
|
acceptance:
|
|
- late_entry_false_positive_rate decreases
|
|
- missed_leader_reentry_rate monitored
|
|
- shadow 20 trading days
|
|
status: completed
|
|
- id: P4-T003
|
|
title: distribution early warning을 매도 우선순위와 연결
|
|
method: 수급 분산, 거래량 고점, 시장/섹터 상대강도 둔화를 sell priority table의 1차 정렬 키로 연결한다.
|
|
acceptance:
|
|
- sell_candidate_count>=2이면 sell priority table 먼저 출력
|
|
- profit_giveback_reduction measured
|
|
status: completed
|
|
- phase: P5_low_capability_llm_execution_pack
|
|
priority: CRITICAL
|
|
goal: 저성능 LLM도 숫자를 만들지 않고 packet을 복사·요약만 하게 만든다.
|
|
tasks:
|
|
- id: P5-T001
|
|
title: final_context_for_llm_v5 고정 섹션 구현
|
|
method: executive, blockers, action_table, shadow_ledger, data_missing, education_notes
|
|
순서를 강제한다. 각 숫자 필드는 value, unit, json_path, formula_id를 포함한다.
|
|
files_to_modify:
|
|
- tools/build_low_capability_context_pack_v5.py
|
|
- spec/46_low_capability_execution_pack.yaml
|
|
acceptance:
|
|
- required_sections_present_pct == 100
|
|
- numeric_json_path_coverage == 100
|
|
status: completed
|
|
- id: P5-T002
|
|
title: LLM 응답 golden regression 추가
|
|
method: 동일 final_context에 대해 sample_response.json과 섹션/금지문구/숫자 경로 일치를 검증한다.
|
|
commands:
|
|
- python tools/run_low_capability_llm_regression_v1.py --strict
|
|
acceptance:
|
|
- golden_response_match_pct >= 98
|
|
- llm_generated_number_count == 0
|
|
status: completed
|
|
- id: P5-T003
|
|
title: blocked 상태 주문표 누출 차단
|
|
method: global_execution_gate가 HTS_READY가 아니면 order table 대신 shadow ledger와 no_order_notice만
|
|
렌더한다.
|
|
acceptance:
|
|
- hidden_order_leak_count == 0
|
|
- blocked_actions_rendered == true
|
|
status: completed
|
|
- phase: P6_observability_and_feedback_loop
|
|
priority: MEDIUM
|
|
goal: 엔진이 실제로 예측을 맞히는지, 수익을 지키는지 매주 수치로 평가한다.
|
|
tasks:
|
|
- id: P6-T001
|
|
title: prediction/outcome ledger와 proposal evaluation history 연결
|
|
method: 추천 시점의 signal, price, stop, target, gate, confidence를 저장하고 D+1/D+5/D+20
|
|
성과를 outcome으로 붙인다.
|
|
commands:
|
|
- npm run daily-feedback-report
|
|
acceptance:
|
|
- prediction_match_rate_pct tracked
|
|
- edge_by_factor table exists
|
|
- live/replay separated
|
|
status: completed
|
|
- id: P6-T002
|
|
title: engine health card 생성
|
|
method: release readiness, data integrity, provenance, prediction accuracy, gas
|
|
thinness, entropy score를 한 장으로 만든다.
|
|
files_to_create:
|
|
- tools/build_engine_health_card_v1.py
|
|
acceptance:
|
|
- Temp/engine_health_card_v1.json exists
|
|
- health_score >= 95 for release
|
|
status: completed
|
|
- id: P6-T003
|
|
title: 월 1/11/21 중간점검과 주말 리밸런싱을 운영 캘린더에 코드화
|
|
method: spec/operating_cadence.yaml에 날짜 규칙을 두고 report renderer가 해당 날짜에 중간점검/리밸런싱
|
|
섹션을 강제한다.
|
|
acceptance:
|
|
- cadence_section_missing_count == 0
|
|
status: completed
|
|
low_capability_llm_todo_protocol:
|
|
purpose: 저성능 LLM이 아래 순서만 수행하면 동일한 판단을 재현한다.
|
|
mandatory_order:
|
|
- 1_read_AGENTS_md_index_only
|
|
- 2_read_runtime_active_artifact_manifest
|
|
- 3_resolve_final_decision_packet_active_alias
|
|
- 4_read_final_context_for_llm_v5_only
|
|
- 5_copy_numbers_with_json_path_only
|
|
- 6_apply_execution_authority_matrix
|
|
- 7_render_fixed_sections
|
|
- 8_emit_DATA_MISSING_for_any_gap
|
|
- 9_never_invent_price_qty_tp_sl_score
|
|
- 10_never_override_harness_gate
|
|
input_whitelist:
|
|
- runtime/active_artifact_manifest.yaml
|
|
- Temp/final_decision_packet_active.json
|
|
- Temp/final_context_for_llm_v5.yaml
|
|
- Temp/operational_report.json
|
|
- Temp/number_provenance_ledger_v4.json
|
|
- spec/31_low_capability_llm_response_contract.yaml
|
|
- spec/execution_authority_matrix_v2.yaml
|
|
output_sections_fixed:
|
|
- source_summary
|
|
- portfolio_health
|
|
- blockers
|
|
- allowed_actions
|
|
- blocked_actions
|
|
- action_table_or_shadow_ledger
|
|
- data_missing
|
|
- education_notes
|
|
- todo_yaml
|
|
- no_order_notice
|
|
forbidden:
|
|
- freeform target price
|
|
- freeform quantity
|
|
- 임의 손절/익절 산출
|
|
- 하네스 미제공 수치 보간
|
|
- blocked 상태에서 주문표 생성
|
|
- replay 성과를 live 성과처럼 표현
|
|
copy_rule: 숫자는 value/unit/json_path/formula_id가 함께 있는 필드만 복사한다. 없으면 DATA_MISSING으로
|
|
표시한다.
|
|
algorithm_governance_todo:
|
|
- id: AG-T001
|
|
category: new_factor_intake
|
|
instruction: 새 투자 아이디어는 즉시 공식화하지 말고 factor_intake.yaml에 가설, 대상 시장, 적용 국면, 기대 엣지,
|
|
실패 조건부터 적는다.
|
|
template_fields:
|
|
- factor_id
|
|
- hypothesis
|
|
- horizon
|
|
- decay_half_life
|
|
- input_fields
|
|
- expected_edge_formula
|
|
- conflict_precedence
|
|
- activation_threshold
|
|
- retirement_condition
|
|
- owner
|
|
done_when: validate_factor_lifecycle_completeness_v2.py PASS
|
|
- id: AG-T002
|
|
category: activation_gate
|
|
instruction: shadow 기간 없이 active 금지. 최소 20거래일 또는 50건 신호, 데이터 품질 95 이상, turnover
|
|
cost 차감 후 edge 양수여야 한다.
|
|
done_when: factor_activation_score >= 75
|
|
- id: AG-T003
|
|
category: conflict_resolution
|
|
instruction: 수급·모멘텀은 매수 신호라도 데이터 품질, 현금 방어선, 시장위험, 손절 총위험, anti-late-entry gate보다
|
|
우선할 수 없다.
|
|
precedence_order:
|
|
- data_quality
|
|
- portfolio_health
|
|
- cash
|
|
- heat
|
|
- stop_tp
|
|
- anti_chase
|
|
- regime
|
|
- sector_beta
|
|
- style
|
|
- sizing
|
|
- execution
|
|
- id: AG-T004
|
|
category: overfitting_brake
|
|
instruction: 새 팩터가 기존 팩터와 0.80 이상 상관이면 통합하거나 폐기한다. 같은 현상을 이름만 바꿔 추가하지 않는다.
|
|
done_when: factor_correlation_collision_count == 0
|
|
- id: AG-T005
|
|
category: profit_preservation
|
|
instruction: 수익 발생 후에는 신규 알파보다 giveback 방지가 우선이다. trailing stop, profit ratchet,
|
|
distribution warning을 sell waterfall에 먼저 반영한다.
|
|
done_when: profit_giveback_after_peak_pct decreases over 20D evaluation
|
|
developer_todo_backlog:
|
|
- id: DEV-001
|
|
priority: P0
|
|
task: tools/validate_release_dag_inputs_exist_v1.py 작성
|
|
exact_steps:
|
|
- YAML 파서로 spec/41_release_dag.yaml 로드
|
|
- 모든 node.inputs 수집
|
|
- 모든 node.outputs 수집
|
|
- input이 파일로 존재하지 않고 outputs에도 없으면 missing으로 기록
|
|
- --strict이면 missing_count>0에서 exit 1
|
|
acceptance: missing_input_count == 0
|
|
- id: DEV-002
|
|
priority: P0
|
|
task: Temp/final_context_for_llm_v5.yaml 생성 경로 복구
|
|
exact_steps:
|
|
- build_low_capability_context_pack_v5.py가 존재하면 출력 경로를 v5로 고정
|
|
- 없으면 build_final_context_for_llm_v4.py를 wrapper로 호출하되 schema_version을 v5로 승격하지
|
|
말고 compatibility_alias에 기록
|
|
- spec/41_release_dag.yaml validate_low_capability input과 builder output 일치
|
|
acceptance: validate_low_capability PASS
|
|
- id: DEV-003
|
|
priority: P0
|
|
task: release DAG에 missing artifact upstream builder 연결
|
|
exact_steps:
|
|
- live_replay_separation_v3 builder 확인
|
|
- late_chase_attribution_v2 builder 확인
|
|
- shadow_ledger_v2 builder 확인
|
|
- engine_health_card_v1 builder 추가
|
|
- DAG depends_on 순서 갱신
|
|
acceptance: run_release_dag_v3 release strict PASS
|
|
- id: DEV-004
|
|
priority: P1
|
|
task: version_sprawl_audit 구현
|
|
exact_steps:
|
|
- _vN 패턴 그룹화
|
|
- manifest/aliases에 active로 지정된 최신 하나만 허용
|
|
- 나머지는 shadow 또는 retired로 분류
|
|
- unclassified는 release fail
|
|
acceptance: unclassified_version_group_count == 0
|
|
- id: DEV-005
|
|
priority: P1
|
|
task: GAS forbidden logic scanner 구현
|
|
exact_steps:
|
|
- gas_*.gs function body 추출
|
|
- forbidden 키워드 decision/sizing/stop/take_profit/risk_score/verdict 스캔
|
|
- allowed exception table 적용
|
|
- 파일별 forbidden_count와 ratio 출력
|
|
acceptance: forbidden_count == 0 or approved_exception_count only
|
|
- id: DEV-006
|
|
priority: P1
|
|
task: tools business logic src 이전
|
|
exact_steps:
|
|
- tools/*.py에서 순수 계산 함수 탐지
|
|
- src/quant_engine/core로 이동
|
|
- tools는 import 후 CLI만 수행
|
|
- 기존 명령어 backward compatibility 유지
|
|
acceptance: unit/parity tests PASS
|
|
- id: DEV-007
|
|
priority: P1
|
|
task: formula lifecycle index 생성
|
|
exact_steps:
|
|
- spec/13_formula_registry.yaml의 모든 formula_id 수집
|
|
- execution_order 포함 여부 계산
|
|
- 각 formula에 active/shadow/experimental/deprecated/runtime_supplement 지정
|
|
- deprecated runtime reference 차단
|
|
acceptance: unclassified_formula_count == 0
|
|
- id: DEV-008
|
|
priority: P2
|
|
task: llm numeric generation validator 구현
|
|
exact_steps:
|
|
- operational_report.md의 모든 숫자 토큰 추출
|
|
- number_provenance_ledger와 매칭
|
|
- 매칭 불가 숫자 허용목록 제외 후 fail
|
|
- 문장 내 target/stop/qty가 provenance 없으면 fail
|
|
acceptance: unprovenanced_number_count == 0
|
|
- id: DEV-009
|
|
priority: P2
|
|
task: final decision packet contract 강화
|
|
exact_steps:
|
|
- action_table 각 행에 gate_status, reason_code, price_fields, qty_fields, provenance
|
|
포함
|
|
- blocked row도 shadow_ledger_ref 포함
|
|
- schema validation 추가
|
|
acceptance: final_packet_schema_validation PASS
|
|
- id: DEV-010
|
|
priority: P2
|
|
task: engine health card builder 작성
|
|
exact_steps:
|
|
- release_dag_run_v3, active_manifest, number_provenance, prediction_accuracy, gas_thin_adapter,
|
|
entropy audit 입력
|
|
- health_score 계산
|
|
- critical_blockers 배열 출력
|
|
acceptance: Temp/engine_health_card_v1.json exists
|
|
- id: DEV-011
|
|
priority: P2
|
|
task: factor activation dashboard 구현
|
|
exact_steps:
|
|
- proposal_evaluation_history에서 factor별 D+1/D+5/D+20 edge 집계
|
|
- turnover cost 차감
|
|
- drawdown/giveback 계산
|
|
- active/shadow/retire 추천
|
|
acceptance: factor_activation_score per factor exists
|
|
- id: DEV-012
|
|
priority: P3
|
|
task: repository diet policy 적용
|
|
exact_steps:
|
|
- Temp stale artifact archive
|
|
- docs 중복 ADR 통합
|
|
- dist 대용량 yaml은 source whitelist 제외
|
|
- package zip whitelist 갱신
|
|
acceptance: repo_entropy_score >= 90
|
|
pm_execution_plan:
|
|
week_1:
|
|
- P0 release DAG repair
|
|
- final_context_for_llm_v5 생성
|
|
- DAG input validator
|
|
- engine_health_card skeleton
|
|
week_2:
|
|
- version sprawl audit
|
|
- formula lifecycle index
|
|
- LLM numeric validator
|
|
- low capability regression
|
|
week_3:
|
|
- GAS forbidden scanner
|
|
- gas_data_feed.gs 분할 시작
|
|
- tools business logic src 이전 1차
|
|
week_4:
|
|
- factor activation dashboard
|
|
- anti-late-entry 삼중 게이트 shadow
|
|
- sell waterfall distribution 연결
|
|
monthly_review:
|
|
- 1일/11일/21일 중간점검 자동 섹션 검증
|
|
- 성과·오탐·미탐·수익보존 지표 검토
|
|
- retire 대상 팩터 제거
|
|
release_gate_commands_target:
|
|
- python tools/validate_release_dag_inputs_exist_v1.py --dag spec/41_release_dag.yaml
|
|
--strict
|
|
- python tools/validate_specs.py
|
|
- python tools/validate_active_manifest.py --manifest runtime/active_artifact_manifest.yaml
|
|
--strict
|
|
- python tools/validate_number_provenance_strict_v3.py --ledger Temp/number_provenance_ledger_v4.json
|
|
--report Temp/operational_report.md
|
|
- python tools/validate_low_capability_pack_v1.py --context Temp/final_context_for_llm_v5.yaml
|
|
--contract spec/46_low_capability_execution_pack.yaml
|
|
- python tools/validate_golden_coverage_100.py
|
|
- python tools/validate_schema_model_generation_v1.py
|
|
- python tools/validate_gas_thin_adapter_v1.py
|
|
- python tools/validate_factor_lifecycle_completeness_v2.py --taxonomy spec/43_quant_factor_taxonomy.yaml
|
|
- python tools/validate_gas_forbidden_logic_ratio_v2.py --strict
|
|
- python tools/validate_llm_no_numeric_generation_v1.py --report Temp/operational_report.md
|
|
--ledger Temp/number_provenance_ledger_v4.json
|
|
- python tools/run_release_dag_v3.py --mode release --strict
|
|
definition_of_done:
|
|
engine_refactor_done:
|
|
- release DAG strict PASS
|
|
- final_context_for_llm_v5 존재 및 validate_low_capability PASS
|
|
- all DAG inputs resolved
|
|
- formula_count == generated_formula_count == golden_case_count
|
|
- number provenance coverage 100%
|
|
- renderer calculation count 0
|
|
- GAS forbidden business logic count 0 또는 승인 예외만 존재
|
|
- unclassified version group count 0
|
|
- unclassified formula lifecycle count 0
|
|
- low capability LLM regression >= 98%
|
|
- repository entropy score >= 90
|
|
quant_engine_quality_done:
|
|
- prediction_match_rate_pct가 주간 리포트에 추적됨
|
|
- late_entry false positive가 감소 추세
|
|
- profit giveback after peak가 감소 추세
|
|
- drawdown guard breach 후 대응이 shadow ledger에 기록됨
|
|
- 신규 active 팩터는 모두 shadow evidence를 통과
|
|
senior_architect_final_call:
|
|
decision: 지금 필요한 것은 기능 추가가 아니라 운영 하네스의 봉합과 단일 실행 경로 확정이다.
|
|
first_3_actions:
|
|
- release DAG missing input 5종 복구
|
|
- final_context_for_llm_v5를 저성능 LLM의 유일한 입력팩으로 확정
|
|
- version sprawl과 GAS forbidden logic을 수치로 측정해 active 경로에서 제거
|
|
do_not_do:
|
|
- 새 팩터를 바로 active 추가하지 말 것
|
|
- 깨진 DAG를 skip 옵션으로 우회하지 말 것
|
|
- Temp 파일을 손으로 복사해 PASS처럼 보이게 하지 말 것
|
|
- 보고서 문장을 늘려 문제를 해결하려 하지 말 것
|