Files
QuantEngineByItz/spec/RetirementAssetPortfolio.yaml
kjh2064 a1bbeb99a6
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (pull_request) Failing after 4s
Quant Engine CI/CD Pipeline / validate-core (pull_request) Failing after 2m18s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (pull_request) Has been skipped
chore: 최상위 룰 매니페스트 파일을 spec/ 폴더로 정리하고 도구 경로 참조 수정
2026-06-26 11:40:51 +09:00

520 lines
30 KiB
YAML

meta:
title: "은퇴자산 투자 포트폴리오 운용 지침 — Modular Manifest"
version: "2026-05-20-HARNESS_V4"
language: "ko-KR"
timezone: "Asia/Seoul"
currency: "KRW"
target_asset_krw: 500000000
target_deadline: "2026-12-31"
purpose: >
이 파일은 LLM이 투자 판단에 사용할 구조화 명세의 manifest다.
상세 알고리즘은 spec/*.yaml에 분리하고, 보고서 양식은 RetirementAssetPortfolioReportTemplate.yaml에 둔다.
자연어 설명보다 구조화 명세와 수치 공식이 우선한다.
제공 raw 분석 데이터의 1차 LLM 입력은 'GatherTradingData.json'이며,
xlsx는 GAS/Google Sheets 원본·감사·JSON 재생성 소스다.
JSON의 필수 경로와 컬럼은 spec/02_data_contract.yaml 및 tools/validate_data_sample_json.py로 검증한다.
primary_raw_data:
json: "GatherTradingData.json"
source_workbook: "GatherTradingData.xlsx"
role: "provided_raw_analysis_data_json"
required_json_paths: ["data.data_feed", "data.sector_flow", "data.macro", "data.event_risk", "data.core_satellite"]
validation_tool: "tools/validate_data_sample_json.py"
conversion_tool: "tools/convert_xlsx_to_json.py"
mapping_file: "spec/14_raw_workbook_mapping.yaml"
account_snapshot_contract: "spec/15_account_snapshot_contract.yaml"
precedence: "사용자 제공 raw JSON이 공개 웹 조회보다 우선한다. 웹 조회는 누락·충돌·최신성 검산용 보조 소스다."
xlsx_usage: "xlsx는 원본 감사 또는 JSON 재생성 확인에만 직접 사용한다. 일반 LLM 분석에서 xlsx 직접 파싱 금지."
sheet_diet_policy:
canonical_required: ["data_feed", "sector_flow", "macro", "event_risk", "core_satellite"]
retained_support: ["settings", "account_snapshot", "sector_universe", "sector_flow_history", "etf_nav_manual", "universe", "monthly_history", "performance"]
deprecated_sheets: ["positions", "chat_input", "etf_raw", "core_satellite_status", "orbit_gap", "asset_history"]
transient_delete_when_complete: ["cs_chunk_N"]
rule: "orbit_gap·asset_history는 monthly_history로 통합. etf_raw는 in-memory map 전환. core_satellite_status는 ScriptProperties 이전. cs_chunk_N은 병합 완료 후 삭제."
last_cleanup:
completed_at: "2026-05-18T09:50:00+09:00"
removed_sheets: ["cs_chunk_0"]
backup_file: "GatherTradingData.xlsx.20260518_095000.bak"
validation_status: "PASS"
accepted_proposals:
- proposal_id: "2026-05-18_SENIOR_VETERAN_UPGRADE"
source_file: "proposals/2026-05-18_시니어_전문가_고도화_제안_SafeLanding_Factor.yaml"
adopted_scope: "PARTIAL_MANIFEST_ONLY"
adopted_items:
- "Safe Landing Protocol은 spec/01_objective_profile.yaml에 이미 존재하므로 manifest에는 중복 본문을 복사하지 않는다."
- "Factor Exposure Overload Brake는 동일 섹터 외 고베타·고모멘텀 과집중 차단 원칙으로 채택한다."
- "Non-Linear Gap Risk Buffer는 이벤트 3거래일 전~당일 신규 진입 수량 산출 보수화 원칙으로 채택한다."
- "Signal-Price Divergence Guard는 HTS 현재가와 JSON 기준 가격 3% 초과 괴리 시 BUY_BLOCKED 원칙으로 채택한다."
rejected_or_deferred_items:
- "canonical spec 세부 공식 수정은 별도 surgical update로만 수행한다."
- "risk hard stop 완화, 목표 미달에 따른 risk_budget 강제 상향, 중복 SLP 본문 추가는 반영하지 않는다."
duplicate_work_prevention: "이 proposal_id는 manifest 레벨에서 처리 완료. 동일 제안 재검토 시 미반영 세부 spec만 별도 target_file로 제안한다."
completed_at: "2026-05-18T09:40:11+09:00"
backup_file: "은퇴자산포트폴리오_20260518_094011.yaml.bak"
validation_status: "PASS"
source_of_truth_order:
1: "spec/00_execution_contract.yaml — master prohibitions, hard stops, capture ledger, order validation"
2: "spec/risk/aggregate_risk.yaml — Total_Heat and portfolio hard stops"
3: "spec/risk/circuit_breakers.yaml — circuit breakers and trading controls"
4: "spec/risk/market_risk_cash.yaml — market risk score and cash rules"
5: "spec/risk/portfolio_exposure.yaml — cash floor, duplicate exposure, target allocation"
6: "spec/12_field_dictionary.yaml — canonical field names, aliases, units, missing policies"
7: "spec/13_formula_registry.yaml — executable formula contracts for LLM calculation"
7a: "spec/03_formulas/formula_registry.normalized.yaml — normalized formula registry index for governance validation"
7b2: "spec/03_formulas/output_field_owner_ledger.yaml — output field owner ledger for writer precedence validation"
7b: "spec/13b_harness_formulas.yaml — harness V4 formulas: TP_VALIDITY_CHECK_V1, PROFIT_LOCK_STAGE_CLASSIFIER_V1, REGIME_TRIM_WEIGHT_V1"
7c: "spec/factor_lifecycle_registry.yaml — factor lifecycle status core/retired classification"
8: "spec/14_raw_workbook_mapping.yaml — market raw JSON path/column mapping"
9: "spec/15_account_snapshot_contract.yaml — image capture account/holding/cash contract"
9b: "spec/gas_adapter_contract.yaml — Apps Script exported function sheets and arities contract"
10: "spec/19_harness_contract.yaml — deterministic harness contract, lock semantics, sync validation"
10b: "spec/20_harness_output_schema.yaml — mandatory numeric output schema; GAS coverage measurement baseline"
10c: "spec/21_harness_governance_contract.yaml — harness governance 3-layer lock and release hardlocks"
11: "spec/02_data_contract.yaml — source priority, data completeness, freshness, parsing rules"
12: "spec/09_decision_flow.yaml — state-machine decision order"
13: "spec/11_market_regime.yaml — canonical only for market regime classification"
14: "spec/08_scoring_rules.yaml — rule_id based hard filters, scoring, grade thresholds"
15: "spec/10_portfolio_rules.yaml — account routing, exposure, cash and contribution constraints"
16: "spec/strategy/sector_model.yaml — sector and stock scoring model"
17: "spec/strategy/entry_core.yaml — core entry gates"
18: "spec/strategy/leader_scan.yaml — daily leader scan and anti-climax gate"
19: "spec/strategy/staged_entry.yaml — staged entry and pullback reentry"
20: "spec/05_position_sizing.yaml — volatility targeting, Bayesian/Kelly brake, integer quantity"
21: "spec/exit/stop_loss.yaml — stop loss policy"
22: "spec/exit/take_profit.yaml — take profit policy"
23: "spec/exit/proactive_exit_radar.yaml — proactive exit radar"
24: "spec/01_objective_profile.yaml — objective, account constraints, contribution policy"
24b: "spec/property_invariants.yaml — property invariants specification"
24c: "spec/anti_late_entry_contract.yaml — anti late entry contract"
24d: "spec/profit_preservation_contract.yaml — profit preservation contract"
24e: "spec/operating_cadence.yaml — weekly/monthly cadence specification"
25: "spec/07_output_schema.yaml — recommendation grade, tables, HTS output schema"
26: "schemas/output_schema.json — machine-readable output contract for LLM responses"
27: "RetirementAssetPortfolioReportTemplate.yaml — human-readable report templates loaded only when report output is needed"
28: "prompts/*.md — reusable prompt entrypoints for analysis/review"
29: "examples/*.yaml and examples/examples.jsonl — examples are illustrative and never override rules"
30: "tests/*.yaml — consistency checks for future edits"
31: "spec/03_risk_policy.yaml — legacy redirect stub for backward compatibility"
32: "spec/04_strategy_rules.yaml — legacy redirect stub for backward compatibility"
load_sequence:
STEP_1_always:
files:
- "RetirementAssetPortfolio.yaml"
- "spec/00_execution_contract.yaml"
- "spec/risk/aggregate_risk.yaml"
- "spec/risk/circuit_breakers.yaml"
- "spec/risk/market_risk_cash.yaml"
- "spec/risk/portfolio_exposure.yaml"
- "spec/risk/factor_risk.yaml"
- "spec/12_field_dictionary.yaml"
- "spec/13_formula_registry.yaml"
- "spec/03_formulas/formula_registry.normalized.yaml"
- "spec/03_formulas/output_field_owner_ledger.yaml"
- "spec/factor_lifecycle_registry.yaml"
- "spec/13b_harness_formulas.yaml"
- "spec/14_raw_workbook_mapping.yaml"
- "spec/15_account_snapshot_contract.yaml"
- "spec/gas_adapter_contract.yaml"
- "spec/19_harness_contract.yaml"
- "spec/20_harness_output_schema.yaml"
- "spec/21_harness_governance_contract.yaml"
- "spec/40_final_decision_packet_contract.yaml"
- "spec/41_release_dag.yaml"
- "spec/43_quant_factor_taxonomy.yaml"
- "spec/45_number_provenance_contract.yaml"
- "spec/46_low_capability_execution_pack.yaml"
- "spec/47_packaging_policy.yaml"
- "spec/property_invariants.yaml"
- "spec/anti_late_entry_contract.yaml"
- "spec/profit_preservation_contract.yaml"
- "spec/operating_cadence.yaml"
- "spec/formula_lifecycle_index.yaml"
- "spec/release/low_capability_context_aliases.yaml"
- "spec/release/version_retirement_policy.yaml"
- "spec/48_module_io_contract_registry.yaml"
- "spec/49_refactor_methodology_contract.yaml"
- "spec/51_formula_lifecycle_registry.yaml"
- "Temp/final_decision_packet_v4.json"
- "spec/02_data_contract.yaml"
- "spec/01_objective_profile.yaml"
purpose: "위험 차단, 데이터 사용 가능성, 계좌 제약을 먼저 확정한다."
STEP_2_for_buy_sell_decision:
files:
- "spec/09_decision_flow.yaml"
- "spec/11_market_regime.yaml"
- "spec/08_scoring_rules.yaml"
- "spec/10_portfolio_rules.yaml"
- "spec/strategy/sector_model.yaml"
- "spec/strategy/entry_core.yaml"
- "spec/strategy/leader_scan.yaml"
- "spec/strategy/staged_entry.yaml"
- "spec/05_position_sizing.yaml"
- "spec/exit/stop_loss.yaml"
- "spec/exit/take_profit.yaml"
- "spec/exit/proactive_exit_radar.yaml"
purpose: "진입·청산·수량 산출을 결정한다."
STEP_3_for_output:
files:
- "spec/07_output_schema.yaml"
- "schemas/output_schema.json"
- "RetirementAssetPortfolioReportTemplate.yaml"
- "spec/40_final_decision_packet_contract.yaml"
- "spec/46_low_capability_execution_pack.yaml"
- "Temp/final_decision_packet_v4.json"
- "Temp/final_context_for_llm_v4.yaml"
purpose: "JSON 출력 계약, HTS 입력표, 상세 보고서 양식을 확정한다. 사용자 출력 보고서의 모든 상태값·레이블은 spec/07_output_schema.yaml의 korean_display_labels 매핑을 적용해 한글로 표시한다."
STEP_4_for_validation:
files:
- "tests/strategy_tests.yaml"
- "examples/*.yaml"
- "examples/examples.jsonl"
purpose: "규칙 일관성 점검과 예시 대조에 사용한다."
STEP_5_for_prompt_entrypoints:
files:
- "prompts/analysis_prompt.md"
- "prompts/review_prompt.md"
purpose: "반복 분석과 리뷰 작업의 시작 프롬프트로 사용한다."
spec_files:
execution_contract: "spec/00_execution_contract.yaml"
objective_profile: "spec/01_objective_profile.yaml"
data_contract: "spec/02_data_contract.yaml"
field_dictionary: "spec/12_field_dictionary.yaml"
formula_registry: "spec/13_formula_registry.yaml"
formula_registry_normalized: "spec/03_formulas/formula_registry.normalized.yaml"
output_field_owner_ledger: "spec/03_formulas/output_field_owner_ledger.yaml"
formula_registry_manifest: "spec/formulas/manifest.yaml"
formula_domain_manifest: "spec/formulas/domains/manifest.yaml"
formula_domain_risk: "spec/formulas/domains/risk.yaml"
formula_domain_entry: "spec/formulas/domains/entry.yaml"
formula_domain_exit: "spec/formulas/domains/exit.yaml"
formula_domain_cash: "spec/formulas/domains/cash.yaml"
formula_domain_portfolio: "spec/formulas/domains/portfolio.yaml"
formula_domain_reporting: "spec/formulas/domains/reporting.yaml"
formula_domain_fundamental: "spec/formulas/domains/fundamental.yaml"
formula_domain_smart_money: "spec/formulas/domains/smart_money.yaml"
formula_domain_macro: "spec/formulas/domains/macro.yaml"
formula_domain_simulation: "spec/formulas/domains/simulation.yaml"
formula_domain_sector: "spec/formulas/domains/sector.yaml"
formula_domain_execution: "spec/formulas/domains/execution.yaml"
formula_domain_governance: "spec/formulas/domains/governance.yaml"
harness_formula_registry: "spec/13b_harness_formulas.yaml"
raw_workbook_mapping: "spec/14_raw_workbook_mapping.yaml"
account_snapshot_contract: "spec/15_account_snapshot_contract.yaml"
harness_contract: "spec/19_harness_contract.yaml"
harness_governance_contract: "spec/21_harness_governance_contract.yaml"
pipeline_runtime_contract: "spec/22_pipeline_runtime_contract.yaml"
low_capability_llm_pipeline_todo: "spec/23_low_capability_llm_pipeline_todo.yaml"
strategy_hardening_todo_v1: "spec/24_strategy_hardening_todo_v1.yaml"
canonical_metrics_registry: "spec/25_canonical_metrics_registry.yaml"
behavioral_coverage_contract: "spec/26_behavioral_coverage_contract.yaml"
calibration_registry: "spec/calibration_registry.yaml"
formula_golden_cases_v2: "spec/formula_golden_cases_v2.yaml"
formula_golden_cases_v3: "spec/formula_golden_cases_v3.yaml"
formula_golden_cases_v4: "spec/formula_golden_cases_v4.yaml"
formula_golden_cases_nf: "spec/formula_golden_cases_nf.yaml"
canonical_artifact_resolver_v1: "spec/32_canonical_artifact_resolver.yaml"
execution_precedence_lock_v1: "spec/33_execution_precedence_lock.yaml"
architecture_boundaries_v1: "spec/34_architecture_boundaries.yaml"
rule_lifecycle_governance_v3: "spec/35_rule_lifecycle_governance_v3.yaml"
gas_thin_adapter_policy: "spec/39_gas_thin_adapter_policy.yaml"
goal_risk_budget_harness_v1: "spec/36_goal_risk_budget_harness.yaml"
evaluation_dashboard_v1: "spec/37_evaluation_dashboard_contract.yaml"
bch_calibration_runbook: "spec/27_bch_calibration_runbook.yaml"
imputed_data_exposure_contract: "spec/28_imputed_data_exposure_contract.yaml"
backtest_harness_contract: "spec/29_backtest_harness_contract.yaml"
completion_criteria_contract: "spec/30_completion_criteria_contract.yaml"
semiconductor_concentration_policy: "spec/strategy/semiconductor_concentration_policy.yaml"
strategy_execution_lock_policy: "spec/strategy_execution_lock_policy.yaml"
low_capability_llm_response_contract: "spec/31_low_capability_llm_response_contract.yaml"
final_decision_packet_contract_v4: "spec/40_final_decision_packet_contract.yaml"
release_dag_v1: "spec/41_release_dag.yaml"
quant_factor_taxonomy_v1: "spec/43_quant_factor_taxonomy.yaml"
live_replay_separation_v2: "spec/44_live_replay_separation.yaml"
number_provenance_contract_v1: "spec/45_number_provenance_contract.yaml"
low_capability_execution_pack_v1: "spec/46_low_capability_execution_pack.yaml"
packaging_policy_v1: "spec/47_packaging_policy.yaml"
property_invariants: "spec/property_invariants.yaml"
anti_late_entry_contract: "spec/anti_late_entry_contract.yaml"
profit_preservation_contract: "spec/profit_preservation_contract.yaml"
operating_cadence: "spec/operating_cadence.yaml"
formula_lifecycle_index: "spec/formula_lifecycle_index.yaml"
low_capability_context_aliases: "spec/release/low_capability_context_aliases.yaml"
version_retirement_policy: "spec/release/version_retirement_policy.yaml"
repository_entropy_budget_v1: "spec/release/repository_entropy_budget.yaml"
execution_authority_matrix_v2: "spec/execution_authority_matrix_v2.yaml"
entry_freshness_score_v1: "spec/strategy/entry_freshness_score_v1.yaml"
data_gaps_roadmap: "spec/16_data_gaps_roadmap.yaml"
performance_contract: "spec/17_performance_contract.yaml"
settings_contract: "spec/18_settings_contract.yaml"
risk_control_index: "spec/risk/risk_control.yaml"
aggregate_risk: "spec/risk/aggregate_risk.yaml"
circuit_breakers: "spec/risk/circuit_breakers.yaml"
market_risk_cash: "spec/risk/market_risk_cash.yaml"
portfolio_exposure: "spec/risk/portfolio_exposure.yaml"
risk_quality_control: "spec/risk/quality_control.yaml"
factor_risk: "spec/risk/factor_risk.yaml"
sector_model: "spec/strategy/sector_model.yaml"
entry_gates_index: "spec/strategy/entry_gates.yaml"
entry_core: "spec/strategy/entry_core.yaml"
leader_scan: "spec/strategy/leader_scan.yaml"
staged_entry: "spec/strategy/staged_entry.yaml"
strategy_discovery: "spec/strategy/discovery.yaml"
stock_model: "spec/strategy/stock_model.yaml"
action_matrix: "spec/strategy/action_matrix.yaml"
rebalancing_trigger: "spec/strategy/rebalancing_trigger.yaml"
fundamental_quality: "spec/strategy/fundamental_quality.yaml"
fundamental_quality_v2: "spec/strategy/fundamental_quality_v2.yaml"
fundamental_quality_v3: "spec/strategy/fundamental_quality_v3.yaml"
fundamental_and_horizon_gate_v1: "spec/strategy/fundamental_and_horizon_gate_v1.yaml"
horizon_allocation_v1: "spec/strategy/horizon_allocation_v1.yaml"
smart_money_liquidity_gate_v1: "spec/strategy/smart_money_liquidity_gate_v1.yaml"
anti_late_entry_pullback_gate_v4: "spec/strategy/anti_late_entry_pullback_gate_v4.yaml"
pre_distribution_early_warning_v3: "spec/strategy/pre_distribution_early_warning_v3.yaml"
anti_late_entry_pullback_gate_v5: "spec/strategy/anti_late_entry_pullback_gate_v5.yaml"
pre_distribution_early_warning_v4: "spec/strategy/pre_distribution_early_warning_v4.yaml"
macro_event_synchronizer_v2: "spec/strategy/macro_event_synchronizer_v2.yaml"
value_preserving_cash_raise_optimizer_v7: "spec/exit/value_preserving_cash_raise_optimizer_v7.yaml"
predictive_alpha_dialectic_v1: "spec/strategy/predictive_alpha_dialectic_v1.yaml"
field_dictionary_strict: "spec/fields/field_dictionary.yaml"
data_quality_expectations: "spec/data_quality/expectations.yaml"
decision_graph_dag: "spec/routing/decision_graph.yaml"
shadow_ledger_contract: "spec/outputs/shadow_ledger_contract.yaml"
renderer_contract: "spec/render/renderer_contract.yaml"
release_train: "spec/release/release_train.yaml"
predictive_alpha_dialectic_v2: "spec/strategy/predictive_alpha_dialectic_v2.yaml"
routing_trace_v2: "spec/routing_trace_v2.yaml"
market_regime: "spec/11_market_regime.yaml"
scoring_rules: "spec/08_scoring_rules.yaml"
decision_flow: "spec/09_decision_flow.yaml"
portfolio_rules: "spec/10_portfolio_rules.yaml"
position_sizing: "spec/05_position_sizing.yaml"
exit_policy_index: "spec/06_exit_policy.yaml"
stop_loss: "spec/exit/stop_loss.yaml"
take_profit: "spec/exit/take_profit.yaml"
proactive_exit_radar: "spec/exit/proactive_exit_radar.yaml"
event_response: "spec/exit/event_response.yaml"
position_review: "spec/exit/position_review.yaml"
dynamic_value_preservation_sell_v3: "spec/exit/dynamic_value_preservation_sell_v3.yaml"
qualitative_sell_strategy_v1: "spec/exit/qualitative_sell_strategy_v1.yaml"
output_schema: "spec/07_output_schema.yaml"
machine_output_schema: "schemas/output_schema.json"
report_templates: "RetirementAssetPortfolioReportTemplate.yaml"
prompts: "prompts/*.md"
examples: "examples/*.yaml"
examples_jsonl: "examples/examples.jsonl"
tests: "tests/*.yaml"
proposals: "proposals/*.yaml"
factor_lifecycle_registry: "spec/factor_lifecycle_registry.yaml"
# ── H001~H008 신규 하네스 계약 (P5-T01, 2026-06-10) ──────────────────────
decision_trace_replay_contract: "spec/52_decision_trace_replay_contract.yaml"
factor_conflict_matrix: "spec/53_factor_conflict_matrix.yaml"
temporal_data_integrity: "spec/54_temporal_data_integrity.yaml"
execution_simulator_contract: "spec/55_execution_simulator_contract.yaml"
renderer_copy_only_contract: "spec/56_renderer_copy_only_contract.yaml"
shadow_promotion_scorecard: "spec/57_shadow_promotion_scorecard.yaml"
llm_determinism_contract: "spec/58_llm_determinism_contract.yaml"
llm_radar_trust_tiers_v1: "spec/llm_radar_trust_tiers_v1.yaml"
llm_reading_guide_v2: "spec/llm_reading_guide_v2.yaml"
governance:
ownership_map: "spec/ownership_map.yaml"
aliases: "spec/aliases.yaml"
xref_matrix: "spec/xref_matrix.yaml"
future_split_indexes:
risk: "spec/risk/README.md"
strategy: "spec/strategy/README.md"
active_canonical_splits:
risk:
- "spec/risk/aggregate_risk.yaml"
- "spec/risk/circuit_breakers.yaml"
- "spec/risk/market_risk_cash.yaml"
- "spec/risk/portfolio_exposure.yaml"
- "spec/risk/risk_control.yaml"
- "spec/risk/quality_control.yaml"
exit:
- "spec/exit/stop_loss.yaml"
- "spec/exit/take_profit.yaml"
- "spec/exit/proactive_exit_radar.yaml"
- "spec/exit/event_response.yaml"
- "spec/exit/position_review.yaml"
- "spec/exit/dynamic_value_preservation_sell_v3.yaml"
- "spec/exit/qualitative_sell_strategy_v1.yaml"
strategy:
- "spec/strategy/sector_model.yaml"
- "spec/strategy/entry_gates.yaml"
- "spec/strategy/entry_core.yaml"
- "spec/strategy/leader_scan.yaml"
- "spec/strategy/staged_entry.yaml"
- "spec/strategy/discovery.yaml"
- "spec/strategy/stock_model.yaml"
- "spec/strategy/action_matrix.yaml"
- "spec/strategy/rebalancing_trigger.yaml"
- "spec/strategy/fundamental_and_horizon_gate_v1.yaml"
- "spec/strategy/horizon_allocation_v1.yaml"
- "spec/strategy/smart_money_liquidity_gate_v1.yaml"
- "spec/strategy/predictive_alpha_dialectic_v1.yaml"
conflict_resolution:
priority: "상위 source_of_truth_order가 하위 규칙보다 항상 우선한다."
risk_vs_strategy: "리스크 차단 규칙과 매수/증액 규칙이 충돌하면 리스크 차단 규칙만 적용한다."
data_vs_decision: "데이터 완성도·최신성 미달이면 등급·수량·주문 결론을 보류한다."
table_vs_text: "표/수치/공식과 서술형 설명이 충돌하면 표/수치/공식을 우선한다."
examples_vs_rules: "examples는 판단 예시이며 어떤 경우에도 spec 규칙을 override하지 않는다."
tie_rule: "동급 규칙이 충돌하면 보류하고 필요한 추가 데이터와 다음 확인 출처를 출력한다."
secular_leader_vs_safety: >
SECULAR_LEADER_RISK_ON 활성 중 EVENT_SHOCK 또는 RISK_OFF 발동 시
공격 모드 즉시 비활성. 공격 모드는 안전·리스크 차단 모드를 절대 우선하지 않는다.
우선순위: EVENT_SHOCK > RISK_OFF > SECULAR_LEADER_RISK_ON > LEADER_CONCENTRATION > NEUTRAL > RISK_ON.
참조: spec/11_market_regime.yaml.SECULAR_LEADER_RISK_ON.priority_over_lower_states.
goal_protection_vs_orbit_gap: >
Safe Landing Protocol, hard stop, cash_floor, Total_Heat, 데이터 완성도 차단은
orbit_gap 또는 목표 미달 기반 공격 슬롯 확대보다 항상 우선한다.
목표 미달·필요수익률 상승은 risk_budget 상향 또는 데이터 게이트 완화 사유가 아니다.
목표자산 90% 이상 접근 시 spec/01_objective_profile.yaml.safe_landing_protocol을 우선 확인한다.
non_negotiable_principles:
- "spec/00_execution_contract.yaml의 master_prohibitions P1~P5가 모든 규칙보다 우선한다."
- "보유수량 미확인 상태에서 매도수량 숫자 기재 금지."
- "ATR20 미확인 상태에서 정수 매수수량 산출 금지."
- "Total_Heat, cash_floor, hard stop을 우회하는 공격 슬롯 금지."
- "Flow_Rows<20이면 20D 수급 기반 A등급·즉시매수 금지."
- "매수 제안은 지정가·수량·손절가·손절수량·익절가·익절수량 세트가 모두 있을 때만 유효."
- "소수점 매수 금지. 모든 주문 수량은 정수."
- "SECULAR_LEADER_RISK_ON은 spec/11_market_regime.yaml 5개 조건 동시 충족 시에만 활성화된다. 활성 중에도 master_prohibitions P1~P5, Total_Heat hard stop, ATR20, 보유수량 확인, cash_floor 제약은 그대로 적용된다. 이 모드는 safety gate를 열지 않는다."
- "목표자산 90% 이상 접근 시 Safe Landing Protocol이 orbit_gap 공격 슬롯 확대, 위성 비중 확대, 신규 탐색매수보다 우선한다."
- "동일 섹터가 아니어도 고베타·고모멘텀 팩터가 과집중이면 신규 고베타 종목 매수를 보류하고 저변동성·현금·단기채 대안을 우선 검토한다."
- "이벤트 3거래일 전부터 당일까지 신규 진입은 갭 리스크 버퍼를 수량 산출에 반영하지 않으면 정수 수량을 확정하지 않는다."
- "HTS 현재가와 JSON 기준 가격의 괴리율이 3%를 초과하면 BUY_BLOCKED 처리하고 JSON 재생성 또는 가격 출처 재검산을 먼저 요구한다."
surgical_update_policy:
rule: "규칙 변경은 전체 재작성 금지. target_file, target_path, change_type, rationale를 남기는 최소 침습 변경만 허용한다."
required_fields: ["target_file", "target_path", "change_type", "rationale", "before", "after", "validation"]
prohibited_changes:
- "master prohibitions 삭제"
- "risk hard stop 완화"
- "데이터 누락 상태에서 BUY 허용"
- "목표수익률 압박을 이유로 risk_budget 강제 상향"
- "SECULAR_LEADER_RISK_ON 활성을 이유로 master_prohibitions·cash_floor·Total_Heat·ATR20 제약 완화 금지"
completed_update_markers:
required_fields: ["proposal_id", "adopted_scope", "completed_at", "backup_file", "validation_status"]
rule: "외부 제안 반영 후 accepted_proposals에 완료 표기를 남겨 동일 proposal_id 중복 반영을 방지한다."
validation_status_values: ["PENDING", "PASS", "FAIL", "PARTIAL"]
output_contract:
machine_readable_schema: "schemas/output_schema.json"
json_schema_version: "2026-05-15-F6-compat-output"
required_first_outputs:
- "사용 데이터 기준시각과 출처"
- "capture_read_ledger 판독 원장"
- "데이터 완성도 매트릭스"
- "4단계 주문 검산 결과"
- "decision_trace 판단 추적표"
- "리스크/현금/Total_Heat 차단 여부"
- "HTS 입력 가능 주문표 또는 산출금지 사유"
- "학습형 해설은 요청 시 후반부 market_context_learning_note로만 출력"
report_template_file: "RetirementAssetPortfolioReportTemplate.yaml"
bundle_outputs:
full_bundle: "dist/retirement_portfolio_bundle.yaml"
compact_bundle: "dist/retirement_portfolio_compact.yaml"
ultra_compact_bundle: "dist/retirement_portfolio_ultra_compact.yaml"
bundle_selection_policy:
full_bundle: "문서 정합성 리뷰, 리팩토링, 규칙 충돌 점검에 사용한다."
compact_bundle: "일반 분석에서 충분한 컨텍스트가 필요할 때 사용한다."
ultra_compact_bundle: "토큰 비용을 줄여야 하거나 반복 실행용 LLM 입력으로 사용한다. 상세 보고서 양식과 illustrative examples는 포함하지 않는다."
bundle_profiles:
compact:
output: "dist/retirement_portfolio_compact.yaml"
purpose: "분석에 필요한 canonical 핵심 문서만 묶은 축약 LLM 입력용 합본"
files:
- "RetirementAssetPortfolio.yaml"
- "AGENTS.md"
- "spec/00_execution_contract.yaml"
- "spec/02_data_contract.yaml"
- "spec/risk/aggregate_risk.yaml"
- "spec/risk/circuit_breakers.yaml"
- "spec/risk/market_risk_cash.yaml"
- "spec/risk/portfolio_exposure.yaml"
- "spec/12_field_dictionary.yaml"
- "spec/13_formula_registry.yaml"
- "spec/13b_harness_formulas.yaml"
- "spec/14_raw_workbook_mapping.yaml"
- "spec/llm_reading_guide_v2.yaml"
- "spec/15_account_snapshot_contract.yaml"
- "spec/09_decision_flow.yaml"
- "spec/11_market_regime.yaml"
- "spec/08_scoring_rules.yaml"
- "spec/10_portfolio_rules.yaml"
- "spec/strategy/sector_model.yaml"
- "spec/strategy/entry_core.yaml"
- "spec/strategy/leader_scan.yaml"
- "spec/strategy/staged_entry.yaml"
- "spec/05_position_sizing.yaml"
- "spec/exit/stop_loss.yaml"
- "spec/exit/take_profit.yaml"
- "spec/exit/proactive_exit_radar.yaml"
- "spec/40_final_decision_packet_contract.yaml"
- "spec/41_release_dag.yaml"
- "spec/43_quant_factor_taxonomy.yaml"
- "spec/45_number_provenance_contract.yaml"
- "spec/46_low_capability_execution_pack.yaml"
- "spec/47_packaging_policy.yaml"
- "spec/property_invariants.yaml"
- "spec/anti_late_entry_contract.yaml"
- "spec/profit_preservation_contract.yaml"
- "spec/operating_cadence.yaml"
- "spec/formula_lifecycle_index.yaml"
- "spec/release/low_capability_context_aliases.yaml"
- "spec/release/version_retirement_policy.yaml"
- "spec/48_module_io_contract_registry.yaml"
- "spec/49_refactor_methodology_contract.yaml"
- "spec/51_formula_lifecycle_registry.yaml"
- "Temp/final_decision_packet_v4.json"
- "schemas/output_schema.json"
ultra_compact:
output: "dist/retirement_portfolio_ultra_compact.yaml"
purpose: "실행계약, 데이터, 리스크, 상태머신, 수량, 청산, 출력계약만 담은 최소 LLM 입력용 합본"
files:
- "RetirementAssetPortfolio.yaml"
- "AGENTS.md"
- "spec/00_execution_contract.yaml"
- "spec/02_data_contract.yaml"
- "spec/risk/aggregate_risk.yaml"
- "spec/risk/circuit_breakers.yaml"
- "spec/risk/market_risk_cash.yaml"
- "spec/risk/portfolio_exposure.yaml"
- "spec/12_field_dictionary.yaml"
- "spec/13_formula_registry.yaml"
- "spec/13b_harness_formulas.yaml"
- "spec/14_raw_workbook_mapping.yaml"
- "spec/15_account_snapshot_contract.yaml"
- "spec/09_decision_flow.yaml"
- "spec/08_scoring_rules.yaml"
- "spec/05_position_sizing.yaml"
- "spec/exit/stop_loss.yaml"
- "spec/exit/take_profit.yaml"
- "spec/exit/proactive_exit_radar.yaml"
- "spec/40_final_decision_packet_contract.yaml"
- "spec/41_release_dag.yaml"
- "spec/43_quant_factor_taxonomy.yaml"
- "spec/45_number_provenance_contract.yaml"
- "spec/46_low_capability_execution_pack.yaml"
- "spec/47_packaging_policy.yaml"
- "spec/property_invariants.yaml"
- "spec/anti_late_entry_contract.yaml"
- "spec/profit_preservation_contract.yaml"
- "spec/operating_cadence.yaml"
- "spec/formula_lifecycle_index.yaml"
- "spec/release/low_capability_context_aliases.yaml"
- "spec/release/version_retirement_policy.yaml"
- "spec/48_module_io_contract_registry.yaml"
- "spec/49_refactor_methodology_contract.yaml"
- "spec/51_formula_lifecycle_registry.yaml"
- "Temp/final_decision_packet_v4.json"
- "schemas/output_schema.json"