Case_02_Comparison_Research - Stage 1 v.8: Part 1~4 YAMLs with R1~R3 patches, F-1/F-2 fixes, 피고과식별방지 prompt (defendant_qualification), dated backups, 실행검사/실패분석 reports - Stage 2 S2_00: v7.4 handoff (Task_S2_00_handoff, 경량화 전략서 + §2 개정) and v7.5 defendant qualification gate (피고관련작업_개정_S2_00.md), copies v.7/v.10/v.11, dated backups, 실행보고서/실패분석/결과물 리스트 - Stage 2 S2_10: v6/v7/v8 failure analyses, 재작성전략 10_06/10_08, case_kind_registry.json, 연구조사보고서_S2_10_재작성용.md (v.1), _추가.md (multi-claim methodology) and merged _v.2.md (claims[] 1~4, join PRELIMINARY/SELECTIVE/INDEPENDENT, V1~V6), S2_10_Test run outputs, 실행검사 v.10/v.11 - Stage_2 MEMORY.md / CLAUDE.md / work-history notes, AGENTS.md and README_KO.md updates Other corpora and tooling - Default_Agent_청구취지기재방법: 청구취지 규칙문서 전체 모음(원문·사건종류별·raw) and tmp drafts - 요건사실론: 사건종류별 문서(raw·filtered), plans, rf_draft - 판례모음, STT_앱구성_연구, API Crowdness 조사, update_numbers.py Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
31 lines
2.3 KiB
Python
31 lines
2.3 KiB
Python
from pathlib import Path
|
|
import re,json,xml.etree.ElementTree as ET
|
|
w=Path('tmp/규칙문서재작성_수표금청구_20260928_01'); p=w/'청구취지작성규칙_수표금청구_beta_0.8.md'; d=p.read_text();s=(w/'source.snapshot.txt').read_text();units=json.loads((w/'preservation.json').read_text())
|
|
ids=lambda t:set(re.findall(r'\b(?:Q|RULE|LEAF|FORM|CHECK|STOP-[HRCV]|L|P)-\d+\b',t))
|
|
urls=lambda t:set(re.findall(r'https?://[^\s|]+',t))
|
|
print('Missing IDs:',sorted(ids(s)-ids(d))); print('Missing URLs:',sorted(urls(s)-urls(d)))
|
|
print('Fences:',d.count('```'));print('Sections:',re.findall(r'^## .*',d,re.M))
|
|
forms=re.split(r'^#### (?=FORM-)',d,flags=re.M)[1:]
|
|
fields=['선택 기준','작성 전에 연결할 정보','법적 전제','미확인 처리','주문 문장','조립','사용 금지 조건','근거','검토']
|
|
print('Forms/fields:',len(forms),[(x[:7],f) for x in forms for f in fields if '**'+f+':**' not in x])
|
|
print('Source code-block exact retention:',len(re.findall(r'```\n(.*?)```',s,re.S)),all(x in d for x in re.findall(r'```\n(.*?)```',s,re.S)))
|
|
# determine moved/reworded units requiring direct semantic disposition
|
|
miss=[u for u in units if u['content'] not in d]
|
|
(w/'review_nonliteral_units.json').write_text(json.dumps(miss,ensure_ascii=False,indent=2))
|
|
print('Nonliteral units:',len(miss))
|
|
for n in sorted(set(u['source_lines'][0] for u in miss)):
|
|
print(n,'; '.join(u['content'] for u in miss if u['source_lines'][0]==n))
|
|
# build requirement ledger with exact paths and text, including all element attributes
|
|
rt=ET.fromstring((w/'format.snapshot.txt').read_text());req=[]
|
|
def walk(e,path,location):
|
|
if e.tag=='section':location='§'+e.attrib['number']
|
|
if e.tag=='appendix':location='부록 '+e.attrib['id']
|
|
if e.attrib: req.append({'id':f'F{len(req)+1:03d}','xpath':path,'requirement':dict(e.attrib),'target':location,'method':'구조·속성 직접 대조','result':'대조 중'})
|
|
if (e.text or '').strip(): req.append({'id':f'F{len(req)+1:03d}','xpath':path+'/text()','requirement':e.text.strip(),'target':location,'method':'의미·구조 직접 대조','result':'대조 중'})
|
|
counts={}
|
|
for c in e:
|
|
counts[c.tag]=counts.get(c.tag,0)+1;walk(c,path+'/'+c.tag+f'[{counts[c.tag]}]',location)
|
|
walk(rt,'/output_format','문서 전체')
|
|
(w/'format_requirements.json').write_text(json.dumps(req,ensure_ascii=False,indent=2))
|
|
print('Requirements',len(req))
|