diff --git a/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_contract_variables.md b/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_contract_variables.md new file mode 100644 index 00000000..339c13af --- /dev/null +++ b/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_contract_variables.md @@ -0,0 +1,182 @@ +| 파일 | 이름 | 구분 | 변수(키 경로) | 조건·꼴 | 스키마 | +|---|---|---|---|---|---| +| `client_goal.json` | 의뢰인 목표 | 필수 | `parties.plaintiffs[].name` | | | +| `client_goal.json` | 의뢰인 목표 | 필수 | `parties.defendants[].name` | | | +| `client_goal.json` | 의뢰인 목표 | 필수 | `parties.third_parties[].name` | | | +| `client_goal.json` | 의뢰인 목표 | 필수 | `issue_clusters[].cluster_id` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `primary_goal` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `constraints` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `constraints[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `key_facts` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `key_facts[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `parties` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `parties.plaintiffs` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `parties.plaintiffs[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `parties.defendants` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `parties.defendants[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `parties.defendants[].asset_status` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `parties.third_parties` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `parties.third_parties[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `parties.third_parties[].relationship` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `aliases` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `aliases.<이름>` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `aliases.<이름>[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].cluster_label` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].candidate_plaintiffs` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].candidate_plaintiffs[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].candidate_defendants_or_counterparties` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].candidate_defendants_or_counterparties[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].client_requested_relief` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].client_requested_relief[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].desired_relief_keywords` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].desired_relief_keywords[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].legal_sustainability_watchpoints` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].legal_sustainability_watchpoints[]` | | | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.slot_status` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.slot_status[]` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.slot_status[].slot_id` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.slot_status[].slot_kind` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.slot_status[].status` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.slot_status[].note` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.evidence_component_status` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.evidence_component_status[]` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.evidence_component_status[].component_id` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.evidence_component_status[].status` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.evidence_component_status[].note` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.defense_signal_status` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.defense_signal_status[]` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.defense_signal_status[].defense_id` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.defense_signal_status[].raised_by` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.defense_signal_status[].status` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.defense_signal_status[].note` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.calculation_readiness` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.calculation_readiness[]` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.calculation_readiness[].need_basis` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.calculation_readiness[].operand_gaps` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.calculation_readiness[].operand_gaps[]` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.calculation_readiness[].operand_gaps[].operand_label` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.review_items` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.review_items[]` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.review_items[].review_code` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.review_items[].reason` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `client_goal.json` | 의뢰인 목표 | 선택 | `issue_clusters[].domain_profiles.<영역>.review_items[].note` | | platform/schemas/client_goal_domain_profiles.schema.json | +| `evidence_indexed.json` | 증거 목록 | 필수 | `items` | | | +| `evidence_indexed.json` | 증거 목록 | 필수 | `items[].evidence_index` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[]` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].title` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].doc_type` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].key_facts` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].key_facts[]` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].key_dates` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].key_dates[]` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].key_amounts` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].key_amounts[]` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].key_parties` | | | +| `evidence_indexed.json` | 증거 목록 | 선택 | `items[].key_parties[]` | | | +| `value_facts.json` | 값 항목 | 선택 | `records` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[]` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].value_id` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].item_label` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].amount_text` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].amount_value` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].value_type` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].dates` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].dates[]` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].dates[].date_value` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].source_ref` | | | +| `value_facts.json` | 값 항목 | 선택 | `records[].source_ref.evidence_index` | | | +| `value_facts_party_links.json` | 값·당사자 연결 | 필수 | `links[].value_id` | 당사자 이름이 있는 연결에서만 | | +| `value_facts_party_links.json` | 값·당사자 연결 | 선택 | `links` | | | +| `value_facts_party_links.json` | 값·당사자 연결 | 선택 | `links[]` | | | +| `value_facts_party_links.json` | 값·당사자 연결 | 선택 | `links[].party_ref` | | | +| `value_facts_party_links.json` | 값·당사자 연결 | 선택 | `links[].party_label` | | | +| `value_facts_party_links.json` | 값·당사자 연결 | 선택 | `links[].status` | | | +| `routing/party_aliases.json` | 당사자 표기 | 필수 | `alias_candidates[].canonical` | | | +| `routing/party_aliases.json` | 당사자 표기 | 필수 | `alias_candidates[].variant` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `alias_candidates` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `alias_candidates[]` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `aliases` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `aliases.<이름>` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `canonical_parties` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `canonical_parties[]` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `succession_candidates` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `succession_candidates[]` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `succession_candidates[].deceased` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `succession_candidates[].renouncers` | | | +| `routing/party_aliases.json` | 당사자 표기 | 선택 | `succession_candidates[].renouncers[]` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[]` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[].review_code` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[].source_check` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[].severity` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[].review_instruction` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[].concise_basis` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[].source_refs` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[].source_refs.evidence_indexes` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[].source_refs.evidence_indexes[]` | | | +| `quality_gates/stage1_part1_soft_gate_handoff.json` | 1부 검토 넘김 | 선택 | `review_items[].issue_type` | | | +| `BO.json` | 원 기록 | 필수 | `[].BO_ID` | | | +| `BO.json` | 원 기록 | 선택 | `[]` | | | +| `BO.json` | 원 기록 | 선택 | `[].ActionType` | | | +| `BO.json` | 원 기록 | 선택 | `[].JuristicAct` | | | +| `BO.json` | 원 기록 | 선택 | `[].JuristicAct.label` | | | +| `BO.json` | 원 기록 | 선택 | `[].Action` | | | +| `BO.json` | 원 기록 | 선택 | `[].core_field_base` | | | +| `BO.json` | 원 기록 | 선택 | `[].core_field_base.TimeText` | | | +| `BO.json` | 원 기록 | 선택 | `[].core_field_base.BehaviorTime` | | | +| `BO.json` | 원 기록 | 선택 | `[].amount` | | | +| `BO.json` | 원 기록 | 선택 | `[].amount.value_text` | | | +| `BO.json` | 원 기록 | 선택 | `[].amount.numeric_value` | | | +| `BO.json` | 원 기록 | 선택 | `[].value_refs` | | | +| `BO.json` | 원 기록 | 선택 | `[].value_refs[]` | | | +| `quality_gates/stage1_part2_review_handoff.json` | 2부 검토 넘김 | 선택 | `review_items` | | | +| `quality_gates/stage1_part2_review_handoff.json` | 2부 검토 넘김 | 선택 | `review_items[]` | | | +| `quality_gates/stage1_part2_review_handoff.json` | 2부 검토 넘김 | 선택 | `review_items[].source_review_code` | | | +| `quality_gates/stage1_part2_review_handoff.json` | 2부 검토 넘김 | 선택 | `review_items[].template_note` | | | +| `quality_gates/stage1_part2_review_handoff.json` | 2부 검토 넘김 | 선택 | `review_items[].source_domain` | | | +| `quality_gates/stage1_part2_review_handoff.json` | 2부 검토 넘김 | 선택 | `review_items[].source_evidence_indexes` | | | +| `quality_gates/stage1_part2_review_handoff.json` | 2부 검토 넘김 | 선택 | `review_items[].source_evidence_indexes[]` | | | +| `quality_gates/stage1_part2_review_handoff.json` | 2부 검토 넘김 | 선택 | `review_items[].issue_type` | | | +| `legal_effect_structures.json` | 법적 효과 구조 | 선택 | `structure_records` | | platform/schemas/legal_effect_structures.schema.json | +| `legal_effect_structures.json` | 법적 효과 구조 | 선택 | `structure_records[]` | | platform/schemas/legal_effect_structures.schema.json | +| `legal_effect_structures.json` | 법적 효과 구조 | 선택 | `structure_records[].domain_id` | | platform/schemas/legal_effect_structures.schema.json | +| `legal_effect_structures.json` | 법적 효과 구조 | 선택 | `structure_records[].source_bo_ids` | | platform/schemas/legal_effect_structures.schema.json | +| `legal_effect_structures.json` | 법적 효과 구조 | 선택 | `structure_records[].source_bo_ids[]` | | platform/schemas/legal_effect_structures.schema.json | +| `quality_gates/stage1_part3_review_handoff.json` | 3부 검토 넘김 | 선택 | `review_items` | | | +| `quality_gates/stage1_part3_review_handoff.json` | 3부 검토 넘김 | 선택 | `review_items[]` | | | +| `quality_gates/stage1_part3_review_handoff.json` | 3부 검토 넘김 | 선택 | `review_items[].review_code` | | | +| `quality_gates/stage1_part3_review_handoff.json` | 3부 검토 넘김 | 선택 | `review_items[].bo_id` | | | +| `quality_gates/stage1_part3_review_handoff.json` | 3부 검토 넘김 | 선택 | `review_items[].domain_id` | | | +| `quality_gates/stage1_part3_review_handoff.json` | 3부 검토 넘김 | 선택 | `review_items[].issue_type` | | | +| `Fact_Ledger_base.json` | 사실 원장 | 필수 | `[].fact_id` | 사실 번호는 '접두어-숫자' 꼴이어야 한다(예: F-001) | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 필수 | `[].source_bo_id` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 필수 | `[].parties[].value` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[]` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].parties` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].parties[]` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].date` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].action` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].derived_fact` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].evidence_refs` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].evidence_refs[]` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].proof_strength` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].domain_effects` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].domain_effects.<영역>` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].domain_effects.<영역>.module` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].domain_effects.<영역>.module[]` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].calculation_requests` | | platform/schemas/fact_ledger_base.schema.json | +| `Fact_Ledger_base.json` | 사실 원장 | 선택 | `[].amount` | | platform/schemas/fact_ledger_base.schema.json | +| `quality_gates/stage1_part4_review_handoff.json` | 4부 검토 넘김 | 필수 | `review_items[].review_code` | fact_id가 있는 항목에서만 | | +| `quality_gates/stage1_part4_review_handoff.json` | 4부 검토 넘김 | 선택 | `review_items` | | | +| `quality_gates/stage1_part4_review_handoff.json` | 4부 검토 넘김 | 선택 | `review_items[]` | | | +| `quality_gates/stage1_part4_review_handoff.json` | 4부 검토 넘김 | 선택 | `review_items[].fact_id` | | | +| `quality_gates/stage1_part4_review_handoff.json` | 4부 검토 넘김 | 선택 | `review_items[].domain_id` | | | +| `quality_gates/stage1_part4_review_handoff.json` | 4부 검토 넘김 | 선택 | `review_items[].blocks_final_drafting` | | | +| `quality_gates/stage1_part4_review_handoff.json` | 4부 검토 넘김 | 선택 | `review_items[].detail` | | | +| `quality_gates/stage1_part4_review_handoff.json` | 4부 검토 넘김 | 선택 | `review_items[].issue_type` | | | + +파일 12개 · 필수 14 · 선택 164 diff --git a/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_decisions.json b/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_decisions.json new file mode 100644 index 00000000..1a6def2e --- /dev/null +++ b/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_decisions.json @@ -0,0 +1,687 @@ +{ + "description": "stage_1_display_v1.py 가 Stage 1 HTML을 만들 때 읽는 변수 목록(입력 계약 CONTRACT). --print-contract 출력(마크다운 표)을 변환한 것.", + "source": "python3 -I stage_1_display_v1.py --print-contract", + "generator_version": "v1 r4", + "generated": "2026-11-23", + "path_notation": "a.b = 객체 안 키, a[] = 배열 원소, <영역> = 영역 ID 키. part3·part4 handoff 는 감싼 객체를 벗긴 뒤의 경로.", + "kinds": { + "required": "없으면 생성 전에 멈춘다(condition 이 있으면 그 원소에서만 검사)", + "optional": "없으면 그 표시만 빠진다" + }, + "counts": { + "files": 12, + "required": 14, + "optional": 164 + }, + "files": { + "client_goal.json": { + "label": "의뢰인 목표", + "required": [ + { + "path": "parties.plaintiffs[].name" + }, + { + "path": "parties.defendants[].name" + }, + { + "path": "parties.third_parties[].name" + }, + { + "path": "issue_clusters[].cluster_id" + } + ], + "optional": [ + { + "path": "primary_goal" + }, + { + "path": "constraints" + }, + { + "path": "constraints[]" + }, + { + "path": "key_facts" + }, + { + "path": "key_facts[]" + }, + { + "path": "parties" + }, + { + "path": "parties.plaintiffs" + }, + { + "path": "parties.plaintiffs[]" + }, + { + "path": "parties.defendants" + }, + { + "path": "parties.defendants[]" + }, + { + "path": "parties.defendants[].asset_status" + }, + { + "path": "parties.third_parties" + }, + { + "path": "parties.third_parties[]" + }, + { + "path": "parties.third_parties[].relationship" + }, + { + "path": "aliases" + }, + { + "path": "aliases.<이름>" + }, + { + "path": "aliases.<이름>[]" + }, + { + "path": "issue_clusters" + }, + { + "path": "issue_clusters[]" + }, + { + "path": "issue_clusters[].cluster_label" + }, + { + "path": "issue_clusters[].candidate_plaintiffs" + }, + { + "path": "issue_clusters[].candidate_plaintiffs[]" + }, + { + "path": "issue_clusters[].candidate_defendants_or_counterparties" + }, + { + "path": "issue_clusters[].candidate_defendants_or_counterparties[]" + }, + { + "path": "issue_clusters[].client_requested_relief" + }, + { + "path": "issue_clusters[].client_requested_relief[]" + }, + { + "path": "issue_clusters[].desired_relief_keywords" + }, + { + "path": "issue_clusters[].desired_relief_keywords[]" + }, + { + "path": "issue_clusters[].legal_sustainability_watchpoints" + }, + { + "path": "issue_clusters[].legal_sustainability_watchpoints[]" + }, + { + "path": "issue_clusters[].domain_profiles", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.slot_status", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.slot_status[]", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.slot_status[].slot_id", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.slot_status[].slot_kind", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.slot_status[].status", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.slot_status[].note", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.evidence_component_status", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.evidence_component_status[]", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.evidence_component_status[].component_id", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.evidence_component_status[].status", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.evidence_component_status[].note", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.defense_signal_status", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.defense_signal_status[]", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.defense_signal_status[].defense_id", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.defense_signal_status[].raised_by", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.defense_signal_status[].status", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.defense_signal_status[].note", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.calculation_readiness", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.calculation_readiness[]", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.calculation_readiness[].need_basis", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.calculation_readiness[].operand_gaps", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.calculation_readiness[].operand_gaps[]", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.calculation_readiness[].operand_gaps[].operand_label", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.review_items", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.review_items[]", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.review_items[].review_code", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.review_items[].reason", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + }, + { + "path": "issue_clusters[].domain_profiles.<영역>.review_items[].note", + "schema": "platform/schemas/client_goal_domain_profiles.schema.json" + } + ] + }, + "evidence_indexed.json": { + "label": "증거 목록", + "required": [ + { + "path": "items" + }, + { + "path": "items[].evidence_index" + } + ], + "optional": [ + { + "path": "items[]" + }, + { + "path": "items[].title" + }, + { + "path": "items[].doc_type" + }, + { + "path": "items[].key_facts" + }, + { + "path": "items[].key_facts[]" + }, + { + "path": "items[].key_dates" + }, + { + "path": "items[].key_dates[]" + }, + { + "path": "items[].key_amounts" + }, + { + "path": "items[].key_amounts[]" + }, + { + "path": "items[].key_parties" + }, + { + "path": "items[].key_parties[]" + } + ] + }, + "value_facts.json": { + "label": "값 항목", + "required": [], + "optional": [ + { + "path": "records" + }, + { + "path": "records[]" + }, + { + "path": "records[].value_id" + }, + { + "path": "records[].item_label" + }, + { + "path": "records[].amount_text" + }, + { + "path": "records[].amount_value" + }, + { + "path": "records[].value_type" + }, + { + "path": "records[].dates" + }, + { + "path": "records[].dates[]" + }, + { + "path": "records[].dates[].date_value" + }, + { + "path": "records[].source_ref" + }, + { + "path": "records[].source_ref.evidence_index" + } + ] + }, + "value_facts_party_links.json": { + "label": "값·당사자 연결", + "required": [ + { + "path": "links[].value_id", + "condition": "당사자 이름이 있는 연결에서만" + } + ], + "optional": [ + { + "path": "links" + }, + { + "path": "links[]" + }, + { + "path": "links[].party_ref" + }, + { + "path": "links[].party_label" + }, + { + "path": "links[].status" + } + ] + }, + "routing/party_aliases.json": { + "label": "당사자 표기", + "required": [ + { + "path": "alias_candidates[].canonical" + }, + { + "path": "alias_candidates[].variant" + } + ], + "optional": [ + { + "path": "alias_candidates" + }, + { + "path": "alias_candidates[]" + }, + { + "path": "aliases" + }, + { + "path": "aliases.<이름>" + }, + { + "path": "canonical_parties" + }, + { + "path": "canonical_parties[]" + }, + { + "path": "succession_candidates" + }, + { + "path": "succession_candidates[]" + }, + { + "path": "succession_candidates[].deceased" + }, + { + "path": "succession_candidates[].renouncers" + }, + { + "path": "succession_candidates[].renouncers[]" + } + ] + }, + "quality_gates/stage1_part1_soft_gate_handoff.json": { + "label": "1부 검토 넘김", + "required": [], + "optional": [ + { + "path": "review_items" + }, + { + "path": "review_items[]" + }, + { + "path": "review_items[].review_code" + }, + { + "path": "review_items[].source_check" + }, + { + "path": "review_items[].severity" + }, + { + "path": "review_items[].review_instruction" + }, + { + "path": "review_items[].concise_basis" + }, + { + "path": "review_items[].source_refs" + }, + { + "path": "review_items[].source_refs.evidence_indexes" + }, + { + "path": "review_items[].source_refs.evidence_indexes[]" + }, + { + "path": "review_items[].issue_type" + } + ] + }, + "BO.json": { + "label": "원 기록", + "required": [ + { + "path": "[].BO_ID" + } + ], + "optional": [ + { + "path": "[]" + }, + { + "path": "[].ActionType" + }, + { + "path": "[].JuristicAct" + }, + { + "path": "[].JuristicAct.label" + }, + { + "path": "[].Action" + }, + { + "path": "[].core_field_base" + }, + { + "path": "[].core_field_base.TimeText" + }, + { + "path": "[].core_field_base.BehaviorTime" + }, + { + "path": "[].amount" + }, + { + "path": "[].amount.value_text" + }, + { + "path": "[].amount.numeric_value" + }, + { + "path": "[].value_refs" + }, + { + "path": "[].value_refs[]" + } + ] + }, + "quality_gates/stage1_part2_review_handoff.json": { + "label": "2부 검토 넘김", + "required": [], + "optional": [ + { + "path": "review_items" + }, + { + "path": "review_items[]" + }, + { + "path": "review_items[].source_review_code" + }, + { + "path": "review_items[].template_note" + }, + { + "path": "review_items[].source_domain" + }, + { + "path": "review_items[].source_evidence_indexes" + }, + { + "path": "review_items[].source_evidence_indexes[]" + }, + { + "path": "review_items[].issue_type" + } + ] + }, + "legal_effect_structures.json": { + "label": "법적 효과 구조", + "required": [], + "optional": [ + { + "path": "structure_records", + "schema": "platform/schemas/legal_effect_structures.schema.json" + }, + { + "path": "structure_records[]", + "schema": "platform/schemas/legal_effect_structures.schema.json" + }, + { + "path": "structure_records[].domain_id", + "schema": "platform/schemas/legal_effect_structures.schema.json" + }, + { + "path": "structure_records[].source_bo_ids", + "schema": "platform/schemas/legal_effect_structures.schema.json" + }, + { + "path": "structure_records[].source_bo_ids[]", + "schema": "platform/schemas/legal_effect_structures.schema.json" + } + ] + }, + "quality_gates/stage1_part3_review_handoff.json": { + "label": "3부 검토 넘김", + "required": [], + "optional": [ + { + "path": "review_items" + }, + { + "path": "review_items[]" + }, + { + "path": "review_items[].review_code" + }, + { + "path": "review_items[].bo_id" + }, + { + "path": "review_items[].domain_id" + }, + { + "path": "review_items[].issue_type" + } + ] + }, + "Fact_Ledger_base.json": { + "label": "사실 원장", + "required": [ + { + "path": "[].fact_id", + "condition": "사실 번호는 '접두어-숫자' 꼴이어야 한다(예: F-001)", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].source_bo_id", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].parties[].value", + "schema": "platform/schemas/fact_ledger_base.schema.json" + } + ], + "optional": [ + { + "path": "[]", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].parties", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].parties[]", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].date", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].action", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].derived_fact", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].evidence_refs", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].evidence_refs[]", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].proof_strength", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].domain_effects", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].domain_effects.<영역>", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].domain_effects.<영역>.module", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].domain_effects.<영역>.module[]", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].calculation_requests", + "schema": "platform/schemas/fact_ledger_base.schema.json" + }, + { + "path": "[].amount", + "schema": "platform/schemas/fact_ledger_base.schema.json" + } + ] + }, + "quality_gates/stage1_part4_review_handoff.json": { + "label": "4부 검토 넘김", + "required": [ + { + "path": "review_items[].review_code", + "condition": "fact_id가 있는 항목에서만" + } + ], + "optional": [ + { + "path": "review_items" + }, + { + "path": "review_items[]" + }, + { + "path": "review_items[].fact_id" + }, + { + "path": "review_items[].domain_id" + }, + { + "path": "review_items[].blocks_final_drafting" + }, + { + "path": "review_items[].detail" + }, + { + "path": "review_items[].issue_type" + } + ] + } + } +} \ No newline at end of file diff --git a/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_display_v1.py b/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_display_v1.py index e58b377b..83e924e6 100644 --- a/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_display_v1.py +++ b/Case_02_Comparison_Research/YAML_Prompts/2. Stage_2/Default_Agent/Stage_2_Clean/agent_scripts/HITL/stage_1_display_v1.py @@ -5,18 +5,24 @@ LLM 을 부르지 않는다. 입력 JSON 을 읽어 정해진 규칙(어휘표· 입력 (기본값: 이 파일 옆 inputs_v1/) client_goal.json, BO.json, Fact_Ledger_base.json, legal_effect_structures.json, - evidence_indexed.json, quality_gates/stage1_part{1..4}_*handoff.json + evidence_indexed.json, quality_gates/stage1_part{1..4}_*handoff.json, + routing/party_aliases.json, value_facts.json, value_facts_party_links.json (12개 모두 필수, 하나라도 없으면 시작 전에 멈춘다) 레지스트리 (기본값: Stage 1 배포 원본 Default_Agent/domains) 영역 이름(label_ko), 요건·반대사실·증거 슬롯 이름(label), 항변 지도(defense_map) -화면 4개 - 1 보고 요약 2 사건 시간표 3 요건 충족도 4 결정 요청 +화면 5개 + 1 보고 요약 2 당사자 관계도 3 사건 시간표 4 요건 충족도 5 결정 요청 모든 사실·증거는 오른쪽 상세 패널(사실 → 원 기록 → 증거 요지)로 연다. 사용 python3 -I stage_1_display_v1.py [--inputs DIR] [--registry DIR] [--out FILE] 변경 기록 + v1 r4 (2026-11-23) 입력 계약 CONTRACT(필수·선택·이미 아는 키, 스키마 근거)를 두고 시작 전에 검사한다. 필수 키를 어기면 + 파일·위치를 밝혀 멈추고, 계약 밖 키는 멈추지 않고 상세 패널 '원 자료'와 검토 메모로 알린다. --check-contract 추가. + --print-contract 추가(변수 목록을 마크다운 표로 출력, 입력·레지스트리 불필요). + v1 r3 (2026-11-23) 머리 주석을 실제(화면 5개·입력 12개)에 맞춤, 입력 누락을 시작 전에 알림, + 증거 요지 금액은 '원'으로 끝나는 숫자 금액만 통일 표기(면적·이율·지분은 원문, '억·만' 표기는 그대로). v1 r2 (2026-11-22, 독립검증 15건 반영) 결정 카드 질문형·금액 고르기·묶음 처리, 사실 문장 어미 치환, 원 기록 층 중복 생략, 금액 표기 통일, 쟁점 색 재배정, 연도 바로가기, 접근성(대화상자·탭 화살표). """ @@ -247,6 +253,15 @@ def fmt_value(text, value, vtype=None): return fmt_won(value) or t +def ev_amount(x): + """증거 요지 금액. '40,000,000원'처럼 숫자로 쓴 원 금액만 '4,000만 원'으로 통일한다. + '원'으로 끝나지 않는 값(면적·이율·지분)이나 '억·만·천' 단위가 이미 있는 값은 원문 그대로 둔다.""" + t = clean(x) + if not re.fullmatch(r"\d[\d,]*\s*원", t or ""): # 숫자 사이 공백은 두 금액일 수 있어 합치지 않는다 + return t + return fmt_won(re.sub(r"\D", "", t)) or t + + def fmt_date(d): if not d: return "" @@ -278,6 +293,208 @@ def unwrap(d, key): return d.get(key, d) +# --------------------------------------------------------------------------- +# 입력 계약 — 생성기가 읽는 키(필수·선택)와 이미 아는 키. 137종 공통이며 사건 값이 아니다. +# required: (경로, 조건) 경로가 없으면 시작 전에 멈춘다. 조건이 있으면 그 조건을 만족하는 원소에서만 본다. +# optional: 없으면 그 표시만 빠진다(설명용, 검사하지 않음). +# known: 수준별로 이미 아는 키. 그 밖의 키는 멈추지 않고 '원 자료'와 검토 메모로 알린다. +# 경로 표기: a.b = 객체 안 키, a[] = 배열 원소. part3·part4 넘김은 감싼 객체를 벗긴 뒤의 경로다. +# --------------------------------------------------------------------------- +CONTRACT = { + 'client_goal.json': { + "label": '의뢰인 목표', "schema": 'platform/schemas/client_goal_domain_profiles.schema.json (issue_clusters[].domain_profiles 만)', + "required": [('parties.plaintiffs[].name', None), ('parties.defendants[].name', None), ('parties.third_parties[].name', None), ('issue_clusters[].cluster_id', None)], + "optional": ['primary_goal', 'constraints', 'constraints[]', 'key_facts', 'key_facts[]', 'parties', 'parties.plaintiffs', 'parties.plaintiffs[]', 'parties.defendants', 'parties.defendants[]', 'parties.defendants[].asset_status', 'parties.third_parties', 'parties.third_parties[]', 'parties.third_parties[].relationship', 'aliases', 'aliases.<이름>', 'aliases.<이름>[]', 'issue_clusters', 'issue_clusters[]', 'issue_clusters[].cluster_label', 'issue_clusters[].candidate_plaintiffs', 'issue_clusters[].candidate_plaintiffs[]', 'issue_clusters[].candidate_defendants_or_counterparties', 'issue_clusters[].candidate_defendants_or_counterparties[]', 'issue_clusters[].client_requested_relief', 'issue_clusters[].client_requested_relief[]', 'issue_clusters[].desired_relief_keywords', 'issue_clusters[].desired_relief_keywords[]', 'issue_clusters[].legal_sustainability_watchpoints', 'issue_clusters[].legal_sustainability_watchpoints[]', 'issue_clusters[].domain_profiles', 'issue_clusters[].domain_profiles.<영역>', 'issue_clusters[].domain_profiles.<영역>.slot_status', 'issue_clusters[].domain_profiles.<영역>.slot_status[]', 'issue_clusters[].domain_profiles.<영역>.slot_status[].slot_id', 'issue_clusters[].domain_profiles.<영역>.slot_status[].slot_kind', 'issue_clusters[].domain_profiles.<영역>.slot_status[].status', 'issue_clusters[].domain_profiles.<영역>.slot_status[].note', 'issue_clusters[].domain_profiles.<영역>.evidence_component_status', 'issue_clusters[].domain_profiles.<영역>.evidence_component_status[]', 'issue_clusters[].domain_profiles.<영역>.evidence_component_status[].component_id', 'issue_clusters[].domain_profiles.<영역>.evidence_component_status[].status', 'issue_clusters[].domain_profiles.<영역>.evidence_component_status[].note', 'issue_clusters[].domain_profiles.<영역>.defense_signal_status', 'issue_clusters[].domain_profiles.<영역>.defense_signal_status[]', 'issue_clusters[].domain_profiles.<영역>.defense_signal_status[].defense_id', 'issue_clusters[].domain_profiles.<영역>.defense_signal_status[].raised_by', 'issue_clusters[].domain_profiles.<영역>.defense_signal_status[].status', 'issue_clusters[].domain_profiles.<영역>.defense_signal_status[].note', 'issue_clusters[].domain_profiles.<영역>.calculation_readiness', 'issue_clusters[].domain_profiles.<영역>.calculation_readiness[]', 'issue_clusters[].domain_profiles.<영역>.calculation_readiness[].need_basis', 'issue_clusters[].domain_profiles.<영역>.calculation_readiness[].operand_gaps', 'issue_clusters[].domain_profiles.<영역>.calculation_readiness[].operand_gaps[]', 'issue_clusters[].domain_profiles.<영역>.calculation_readiness[].operand_gaps[].operand_label', 'issue_clusters[].domain_profiles.<영역>.review_items', 'issue_clusters[].domain_profiles.<영역>.review_items[]', 'issue_clusters[].domain_profiles.<영역>.review_items[].review_code', 'issue_clusters[].domain_profiles.<영역>.review_items[].reason', 'issue_clusters[].domain_profiles.<영역>.review_items[].note'], + "known": { + '': {'aliases', 'claim_type_candidates', 'constraints', 'current_control_map', 'current_control_map_4axis', 'defendant_qualification', 'domain_screening_ref', 'issue_clusters', 'key_facts', 'parties', 'plaintiff_capacity_matrix', 'primary_goal', 'standing_watchpoints', 'summary_key_incidents'}, + 'issue_clusters[]': {'candidate_defendants_or_counterparties', 'candidate_plaintiffs', 'client_requested_relief', 'cluster_id', 'cluster_label', 'commercial_successor_liability_hint', 'defense_hints', 'desired_relief_keywords', 'domain_profiles', 'fractional_title_issue_hint', 'land_use_gain_hint', 'lease_payment_semantics_hint', 'legal_entitlement_candidates', 'legal_sustainability_watchpoints', 'liability_group_hint', 'notice_lifecycle_hints', 'preferred_plaintiff_selection_basis', 'preferred_plaintiffs_for_complaint', 'preserved_claim_bundle_hint', 'succession_resolution_needed', 'value_compensation_hint'}, + 'parties.plaintiffs[]': {'name', 'type'}, + 'parties.defendants[]': {'asset_status', 'name', 'type'}, + 'parties.third_parties[]': {'name', 'relationship'}, + }, + }, + 'evidence_indexed.json': { + "label": '증거 목록', "schema": None, + "required": [('items', None), ('items[].evidence_index', None)], + "optional": ['items[]', 'items[].title', 'items[].doc_type', 'items[].key_facts', 'items[].key_facts[]', 'items[].key_dates', 'items[].key_dates[]', 'items[].key_amounts', 'items[].key_amounts[]', 'items[].key_parties', 'items[].key_parties[]'], + "known": { + 'items[]': {'admission_components', 'business_transfer_components', 'claim_document_components', 'contract_components', 'defense_assertions', 'defense_components', 'doc_semantic_flags', 'doc_type', 'doc_uid', 'evidence_index', 'key_amounts', 'key_dates', 'key_facts', 'key_parties', 'legal_calculation_object', 'legal_calculation_objects', 'loan_components', 'mixed_contract_payment_semantics', 'multi_event_registry', 'notice_components', 'party_assertion_components', 'property_cluster_id', 'registry_component_ids', 'registry_object_display', 'registry_row_components', 'registry_row_role_map', 'schedule_items', 'secured_debt_components', 'source_pointer', 'succession_document_components', 'title', 'title_normalized', 'valuation_matrix', 'valuation_object', 'valuation_rows'}, + }, + }, + 'value_facts.json': { + "label": '값 항목', "schema": None, + "required": [], + "optional": ['records', 'records[]', 'records[].value_id', 'records[].item_label', 'records[].amount_text', 'records[].amount_value', 'records[].value_type', 'records[].dates', 'records[].dates[]', 'records[].dates[].date_value', 'records[].source_ref', 'records[].source_ref.evidence_index'], + "known": { + 'records[]': {'absence_stated', 'amount_text', 'amount_value', 'bound', 'condition_text', 'currency', 'dates', 'fraction', 'item_label', 'local_id', 'object_label_text', 'object_scope', 'obligation_ref', 'parties', 'per', 'period', 'premise_text', 'provenance', 'recurrence', 'relations', 'right_refs', 'security_terms', 'source_ref', 'stated_by', 'tolerance_text', 'unit', 'value_basis', 'value_id', 'value_kind', 'value_type'}, + }, + }, + 'value_facts_party_links.json': { + "label": '값·당사자 연결', "schema": None, + "required": [('links[].value_id', 'linked')], + "optional": ['links', 'links[]', 'links[].party_ref', 'links[].party_label', 'links[].status'], + "known": { + 'links[]': {'party_label', 'party_ref', 'path', 'reason', 'status', 'value_id'}, + }, + }, + 'routing/party_aliases.json': { + "label": '당사자 표기', "schema": None, + "required": [('alias_candidates[].canonical', None), ('alias_candidates[].variant', None)], + "optional": ['alias_candidates', 'alias_candidates[]', 'aliases', 'aliases.<이름>', 'canonical_parties', 'canonical_parties[]', 'succession_candidates', 'succession_candidates[]', 'succession_candidates[].deceased', 'succession_candidates[].renouncers', 'succession_candidates[].renouncers[]'], + "known": { + }, + }, + 'quality_gates/stage1_part1_soft_gate_handoff.json': { + "label": '1부 검토 넘김', "schema": None, + "required": [], + "optional": ['review_items', 'review_items[]', 'review_items[].review_code', 'review_items[].source_check', 'review_items[].severity', 'review_items[].review_instruction', 'review_items[].concise_basis', 'review_items[].source_refs', 'review_items[].source_refs.evidence_indexes', 'review_items[].source_refs.evidence_indexes[]', 'review_items[].issue_type'], + "known": { + 'review_items[]': {'blocks_final_drafting', 'candidate_use_policy', 'concise_basis', 'created_from', 'domain_hints', 'issue_type', 'lawyer_workflow_role', 'negative_instruction', 'review_code', 'review_id', 'review_instruction', 'severity', 'source_check', 'source_gate', 'source_refs', 'target_stage_hints', 'target_task_hints'}, + }, + }, + 'BO.json': { + "label": '원 기록', "schema": None, + "required": [('[].BO_ID', None)], + "optional": ['[]', '[].ActionType', '[].JuristicAct', '[].JuristicAct.label', '[].Action', '[].core_field_base', '[].core_field_base.TimeText', '[].core_field_base.BehaviorTime', '[].amount', '[].amount.value_text', '[].amount.numeric_value', '[].value_refs', '[].value_refs[]'], + "known": { + '[]': {'Action', 'ActionType', 'BOType', 'BO_ID', 'Evidence', 'EvidenceTitles', 'JuristicAct', 'Legal_Keywords', 'PriorAct', 'Reason', 'ReasonRefs', 'amount', 'core_field_base', 'downstream_seed_refs', 'extensions', 'id', 'provenance', 'source_evidence_indexes', 'value_refs'}, + }, + }, + 'quality_gates/stage1_part2_review_handoff.json': { + "label": '2부 검토 넘김', "schema": None, + "required": [], + "optional": ['review_items', 'review_items[]', 'review_items[].source_review_code', 'review_items[].template_note', 'review_items[].source_domain', 'review_items[].source_evidence_indexes', 'review_items[].source_evidence_indexes[]', 'review_items[].issue_type'], + "known": { + 'review_items[]': {'downstream_owner', 'issue_type', 'review_id', 'severity', 'source_domain', 'source_event_candidate_ids', 'source_evidence_indexes', 'source_field', 'source_meeting_clause_ids', 'source_review_code', 'source_value_fact_ids', 'template_note'}, + }, + }, + 'legal_effect_structures.json': { + "label": '법적 효과 구조', "schema": 'platform/schemas/legal_effect_structures.schema.json', + "required": [], + "optional": ['structure_records', 'structure_records[]', 'structure_records[].domain_id', 'structure_records[].source_bo_ids', 'structure_records[].source_bo_ids[]'], + "known": { + }, + }, + 'quality_gates/stage1_part3_review_handoff.json': { + "label": '3부 검토 넘김', "schema": None, + "required": [], + "optional": ['review_items', 'review_items[]', 'review_items[].review_code', 'review_items[].bo_id', 'review_items[].domain_id', 'review_items[].issue_type'], + "known": { + 'review_items[]': {'attached_to', 'bo_absent', 'bo_id', 'candidate_type_id', 'decided_by', 'default_projection', 'detail', 'domain_id', 'legal_keywords', 'pair_scores', 'resolved_domains', 'review_code', 'severity', 'signal_id', 'source_domain', 'type_id'}, + }, + }, + 'Fact_Ledger_base.json': { + "label": '사실 원장', "schema": 'platform/schemas/fact_ledger_base.schema.json', + "required": [('[].fact_id', None), ('[].source_bo_id', None), ('[].parties[].value', None)], + "optional": ['[]', '[].parties', '[].parties[]', '[].date', '[].action', '[].derived_fact', '[].evidence_refs', '[].evidence_refs[]', '[].proof_strength', '[].domain_effects', '[].domain_effects.<영역>', '[].domain_effects.<영역>.module', '[].domain_effects.<영역>.module[]', '[].calculation_requests', '[].amount'], + "known": { + '[]': {'actio_roles', 'action', 'amount', 'calculation_requests', 'claim_chain_ref', 'commercial_successor_effect', 'credibility', 'date', 'derivation_basis', 'derived_fact', 'domain_effects', 'downstream_module_candidates', 'evidence_refs', 'fact_id', 'legal_calculation_object', 'legal_centrality', 'legal_effect_roles', 'linked_actio_structures', 'linked_structures', 'money_claim_effect', 'must_consider', 'must_not_drop_in_claim_types', 'object_spec', 'parties', 'proof_strength', 'skeleton_validation_codes', 'source_bo_id', 'state_context', 'type'}, + }, + }, + 'quality_gates/stage1_part4_review_handoff.json': { + "label": '4부 검토 넘김', "schema": None, + "required": [('review_items[].review_code', 'fact_id')], + "optional": ['review_items', 'review_items[]', 'review_items[].fact_id', 'review_items[].domain_id', 'review_items[].blocks_final_drafting', 'review_items[].detail', 'review_items[].issue_type'], + "known": { + 'review_items[]': {'actual_missing', 'blocks_final_drafting', 'derived_list', 'detail', 'domain_id', 'excess_domain_ids', 'fact_id', 'gate_id', 'legacy', 'missing_domain_ids', 'projected_row_count', 'review_code', 'severity'}, + }, + }, +} +FORMAT = {("Fact_Ledger_base.json", "[].fact_id"): (r"[^-]+-\d+", "사실 번호는 '접두어-숫자' 꼴이어야 한다(예: F-001)")} +COND = {"linked": lambda r: (r.get("status") == "RESOLVED" and r.get("party_ref")) or r.get("party_label"), + "fact_id": lambda r: r.get("fact_id")} + + +def _segs(path): + return [x for x in re.split(r"\.|(?=\[\])|(?<=\[\])", path) if x] + + +def _at(o, segs, loc=""): + """경로 끝의 값들을 (값, 위치) 로 돌려준다. 중간이 없으면 건너뛴다.""" + if not segs: + yield o, loc + elif segs[0] == "[]": + for i, v in enumerate(o if isinstance(o, list) else []): + yield from _at(v, segs[1:], f"{loc}[{i}]") + elif isinstance(o, dict) and segs[0] in o: + yield from _at(o[segs[0]], segs[1:], f"{loc}.{segs[0]}" if loc else segs[0]) + + +def _input(inp, f): + d = load(inp / f) + w = {"quality_gates/stage1_part3_review_handoff.json": "stage1_part3_review_handoff", + "quality_gates/stage1_part4_review_handoff.json": "stage1_part4_review_handoff"}.get(f) + return unwrap(d, w) if w and isinstance(d, dict) else d + + +def check_contract(inp): + """필수 키 검사. 어긴 곳을 '파일: 위치 — 이유' 목록으로 돌려준다(최대 파일마다 5곳).""" + bad = [] + for f, c in CONTRACT.items(): + d, n = _input(inp, f), 0 + for path, cond in c["required"]: + segs = _segs(path) + for parent, loc in _at(d, segs[:-1]): + if not isinstance(parent, dict) or (cond and not COND[cond](parent)): + continue + key = segs[-1] + at = f"{loc}.{key}" if loc else key + if key not in parent: + why = "키가 없다" + elif (f, path) in FORMAT and not re.fullmatch(FORMAT[(f, path)][0], str(parent[key])): + why = FORMAT[(f, path)][1] + else: + continue + n += 1 + if n <= 5: + bad.append(f"{f}: {at} — {why}") + if n > 5: + bad.append(f"{f}: 그 밖에 {n - 5}곳") + return bad + + +COND_KO = {"linked": "당사자 이름이 있는 연결에서만", "fact_id": "fact_id가 있는 항목에서만"} + + +def print_contract(): + """CONTRACT 의 변수 목록(필수·선택)을 마크다운 표로 stdout 에 쓴다.""" + print("| 파일 | 이름 | 구분 | 변수(키 경로) | 조건·꼴 | 스키마 |") + print("|---|---|---|---|---|---|") + n = Counter() + for f, c in CONTRACT.items(): + rows = [("필수", p, cond) for p, cond in c["required"]] + [("선택", p, None) for p in c["optional"]] + for kind, path, cond in rows: + note = "; ".join(x for x in (COND_KO.get(cond, ""), (FORMAT.get((f, path)) or ("", ""))[1]) if x) + sch = (c["schema"] or "").split(" (")[0] + if f == "client_goal.json" and not path.startswith("issue_clusters[].domain_profiles"): + sch = "" # 이 스키마는 domain_profiles 만 덮는다 + print(f"| `{f}` | {c['label']} | {kind} | `{path}` | {note} | {sch} |") + n[kind] += 1 + print(f"\n파일 {len(CONTRACT)}개 · 필수 {n['필수']} · 선택 {n['선택']}") + + +def _raw(v): + return (v if isinstance(v, str) else json.dumps(v, ensure_ascii=False))[:300] + + +def unknown_keys(inp): + """계약의 known 밖 키를 모은다. 사실·원 기록·증거에 붙은 것은 원소별 키-값도 돌려준다.""" + out = {"fl": {}, "bo": {}, "ev": {}, "count": Counter()} + own = {"Fact_Ledger_base.json": ("fl", "fact_id"), "BO.json": ("bo", "BO_ID"), "evidence_indexed.json": ("ev", "evidence_index")} + for f, c in CONTRACT.items(): + d = _input(inp, f) + for lvl, known in c["known"].items(): + for el, _ in _at(d, _segs(lvl)): + if not isinstance(el, dict): + continue + new = {k: v for k, v in el.items() if k not in known} + for k in new: + out["count"][(f, lvl, k)] += 1 + if new and f in own and el.get(own[f][1]): + out[own[f][0]][el[own[f][1]]] = {k: _raw(v) for k, v in new.items()} + return out + + # --------------------------------------------------------------------------- # 레지스트리 # --------------------------------------------------------------------------- @@ -474,7 +691,8 @@ def fmt_filing(d): # --------------------------------------------------------------------------- # 화면 모델 # --------------------------------------------------------------------------- -def build_model(inp, reg): +def build_model(inp, reg, extra=None): + extra = extra or {"fl": {}, "bo": {}, "ev": {}, "count": Counter()} domain_ko, slot_ko, slot_by_code, defense_ko = load_registry(reg) goal = load(inp / "client_goal.json") bo = {b["BO_ID"]: b for b in load(inp / "BO.json")} @@ -525,8 +743,10 @@ def build_model(inp, reg): "type": DOC_TYPE_KO.get(e.get("doc_type"), clean(e.get("doc_type"))), "facts": [clean(x) for x in e.get("key_facts", []) if clean(x)], "dates": [fmt_date(x) for x in e.get("key_dates", [])], - "amounts": [fmt_won(re.sub(r"\D", "", x)) or clean(x) for x in e.get("key_amounts", [])], + "amounts": [ev_amount(x) for x in e.get("key_amounts", [])], "parties": [clean(x) for x in e.get("key_parties", [])]} + if extra["ev"].get(k): + evidence[k]["raw"] = extra["ev"][k] # 사실별 검토(Part 4 사실 단위) fact_flags = defaultdict(list) @@ -582,6 +802,10 @@ def build_model(inp, reg): "amount": money((b.get("amount") or {}).get("value_text"), (b.get("amount") or {}).get("numeric_value")) if b.get("amount") else ""}, }) + if extra["fl"].get(f["fact_id"]): + facts[-1]["raw"] = extra["fl"][f["fact_id"]] + if extra["bo"].get(f["source_bo_id"]): + facts[-1]["bo"]["raw"] = extra["bo"][f["source_bo_id"]] facts.sort(key=lambda x: (x["sort"], x["no"])) fact_by_bo = {f["source_bo_id"]: f["fact_id"] for f in fl} fx_by_id = {x["id"]: x for x in facts} @@ -706,6 +930,14 @@ def build_model(inp, reg): "area": domain_ko.get(r.get("source_domain"), "") or "공통", "facts": [], "blocking": code in gated.get(r.get("source_domain"), ()), "ev": [e for e in r.get("source_evidence_indexes", []) if e in evidence]}) + if extra["count"]: + by = defaultdict(list) + for (f, lvl, k), n in extra["count"].items(): + by[CONTRACT[f]["label"]].append(f"{k} {n}건") + decisions.append({"group": "check", "kind": "contract", "order": 9, "title": "에이전트가 아직 화면에 정리하지 못한 입력 항목", + "body": "1단계 결과물에 이 화면이 처음 보는 항목이 있습니다. 사실·원 기록·증거에 붙은 것은 상세 패널의 '원 자료'에서 볼 수 있습니다. 소장 내용에 영향이 있는지 확인해 주십시오.", + "items": [f"{lab}: {', '.join(v)}" for lab, v in by.items()], "choices": [], "blocking": False, + "area": "입력 항목", "facts": [], "ev": []}) decisions.sort(key=lambda d: (d["group"] != "urgent", d["order"])) for i, d in enumerate(decisions): d["id"] = f"D{i + 1:03d}" @@ -977,6 +1209,7 @@ $('#dr').addEventListener('keydown',e=>{if(e.key!=='Tab')return;const f=$$('#dr if(e.shiftKey&&document.activeElement===a){e.preventDefault();z.focus()}else if(!e.shiftKey&&document.activeElement===z){e.preventDefault();a.focus()}}); function evName(k){const e=M.evidence[k];return e?`자료 ${e.no} · ${e.title}`:'자료'} function evBtn(e,sub){return ``} +function rawHTML(r,t){return r?`
연결된 자료가 없습니다.
'); @@ -1000,7 +1234,7 @@ function renderDr(){const [kind,id]=trail[trail.length-1]; h+=`원 기록 · 증거에서 처음 뽑은 내용
연결된 자료가 없습니다.
'); + h+=``+rawHTML(b.raw,'원 자료 (화면이 처음 보는 항목)')+`연결된 자료가 없습니다.
'); } else if(kind==='party'){const n=PN[id]; h+=`당사자
증거 원문 요지
${esc(e.type)}
`; if(e.facts.length)h+=`