chore: snapshot of work since 2026-10-05 (Stage 1 v.8, S2_00 v7.4/v7.5 handoff, S2_10 rewrite research v.2, 청구취지·요건사실 corpora)
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>
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
"""요건에 연결된 근거 미확인과 법 적용시점 설명만 보충한다. 전체 출처목록은 옮기지 않는다."""
|
||||
from pathlib import Path
|
||||
import json,re
|
||||
D=Path(__file__).resolve().parent
|
||||
rows=sum([json.loads((D/f'batch_{i}.json').read_text()) for i in range(4)],[])
|
||||
marker='## 적용시점·근거상태 보충 (원문 §12.1·§12.2)'
|
||||
def clean(s):
|
||||
s=re.sub(r'\[([^\]]+)\]\(https?://[^)]+\)',r'\1',s)
|
||||
s=re.sub(r'https?://[^\s|<>`]+','',s)
|
||||
return s.strip().replace('`','')
|
||||
def sec(s,n):
|
||||
m=re.search(r'^### 12\.'+str(n)+r'[^\n]*\n(.*?)(?=^### |\Z)',s,re.S|re.M)
|
||||
return m[1] if m else ''
|
||||
def tables(s):
|
||||
lines=s.splitlines();i=0
|
||||
while i<len(lines):
|
||||
if lines[i].startswith('|') and i+1<len(lines) and re.match(r'^\|[ :|-]+\|$',lines[i+1]):
|
||||
h=[v.strip() for v in lines[i].strip().strip('|').split('|')];i+=2;rs=[]
|
||||
while i<len(lines) and lines[i].startswith('|'):
|
||||
rs.append([v.strip() for v in lines[i].strip().strip('|').split('|')]);i+=1
|
||||
yield h,rs
|
||||
else:i+=1
|
||||
review=[]
|
||||
for x in rows:
|
||||
src=Path(x['source']).read_text();p=Path(x['output']);out=p.read_text().split(marker)[0].rstrip();extra=[];uncertain=[]
|
||||
# Amendment, transitional conditions, and exceptions affect which rule is selected.
|
||||
for h,rs in tables(sec(src,1)):
|
||||
for c in rs:
|
||||
if len(c)!=len(h):continue
|
||||
if '기준일' in h:
|
||||
text=' — '.join(clean(v) for v in c);extra.append(text);continue
|
||||
idx=[i for i,v in enumerate(h) if re.search(r'경과|시행|판본',v)]
|
||||
if not idx:continue
|
||||
texts=[c[i] for i in idx]
|
||||
meaningful=[]
|
||||
for v in texts:
|
||||
if v.startswith('해당 없음'):continue
|
||||
v=re.sub(r'(?:이 문서의 결론을 바꾸는 경과규정은 확인되지 않음|경과규정은 이 조문의 결론에 영향을 주지 않는다\.)','',v).strip()
|
||||
if re.search(r'경과규정.{0,8}(?:없음|없다|해당 없음)|해당 없음.*경과',v) and not re.search('이전|이후|신설|삭제|개정|종전|소급|적용례',v):continue
|
||||
if re.search(r'부칙|경과|이전|이후|시행 전|시행 후|소급|신설|삭제|이동|종전|준용|적용례|적용 시점|개정 전|개정 후|개정법|위헌|헌법불합치|UNKNOWN|UNVERIFIED|미확인|미대조',v):meaningful.append(v)
|
||||
if not meaningful:continue
|
||||
ident=[c[i] for i,v in enumerate(h) if re.search(r'법령|조문|조항|권위 ID',v) and not re.search(r'시행|URL|국가법령|내용',v)]
|
||||
if not ident:ident=[c[0]]
|
||||
context=[c[i] for i,v in enumerate(h) if re.search(r'내용|쓰임|용도|적용 요건',v)]
|
||||
text=' / '.join(clean(v) for v in ident)+': '+'; '.join(clean(v) for v in meaningful+context)
|
||||
if text not in out:extra.append(text)
|
||||
# Non-table legal paragraphs: only explicit transitional/temporal rules, no inventory lead-in.
|
||||
for para in re.split(r'\n\s*\n',sec(src,1)):
|
||||
if para.strip().startswith(('|','#')):continue
|
||||
if re.search(r'경과규정|경과조치|소급|적용례|시행 전|시행 후|종전 제|조문.*이동',para) and not re.search(r'아래.*표|URL|전부.*조문|조회.*방식|경과규정 열',para):
|
||||
text=clean(para)
|
||||
if text and text not in out:extra.append(text)
|
||||
for h,rs in tables(sec(src,2)):
|
||||
if 'fulltext_verified' not in h:continue
|
||||
ix=h.index('fulltext_verified');ti=next((i for i,v in enumerate(h) if '적용 요건' in v),None)
|
||||
if ti is None:continue
|
||||
for c in rs:
|
||||
if len(c)!=len(h) or not re.search(r'아니오|false|미확인|미실시',c[ix],re.I):continue
|
||||
target=c[ti];identifier=clean(c[0]);ids=re.findall(r'\d{2,4}(?:다카|다|마|므|스|그|헌마|헌바)\d+',identifier)
|
||||
if '본문 근거로 쓰지' in target or not any(v in out for v in ids):continue
|
||||
if target in ['해당 없음','9.2']:continue
|
||||
status=next((clean(c[i]) for i,v in enumerate(h) if v=='상태'),'원문 미기재')
|
||||
uncertain.append(f'| {clean(target)} | {identifier} | UNVERIFIED — 원문 전문확인: {clean(c[ix])}; 원문 법리 평가: {status} |')
|
||||
extra=list(dict.fromkeys(extra));uncertain=list(dict.fromkeys(uncertain))
|
||||
if extra or uncertain:
|
||||
out+='\n\n'+marker+'\n\n'
|
||||
if extra:
|
||||
out+='다음은 원문에 기재된 적용시점·경과조건이다. 각 조건을 해당 요건·부수급부와 결합하며, 원문의 기준일을 현재 법률 검증일로 바꾸지 않는다.\n\n'+'\n\n'.join('- '+v.replace('\n',' ') for v in extra)+'\n'
|
||||
if uncertain:
|
||||
out+='\n원문의 법리 평가와 개별 근거의 전문 확인 여부를 구별한다. 아래 연결은 판례목록이 아니라 해당 요건에 붙는 미검증 표지다.\n\n| 적용 요건·항 | 근거 식별자 | 보존한 검증 한계 |\n|---|---|---|\n'+'\n'.join(uncertain)+'\n'
|
||||
if x['case'] in ['계약금청구','분담금청구']:
|
||||
out+='\n**적용 확인 필요 — 원문 간 불일치(UNVERIFIED).** 계약금청구 원문 §12.1은 2019년 개정 이율의 경과조건을 시행일 전 소장 송달로 설명하지만, 분담금청구 원문 §12.1은 시행 당시 제1심 변론종결 여부와 발생분의 날짜로 나눈다. 위 보충은 각 원문의 기재를 보존한 것이며 어느 설명이 정확한지 새로 확정하지 않았다. 구체 사건의 이율·기산구간을 정할 때 대통령령 제29768호 부칙의 적용 조건을 확인해야 한다.\n'
|
||||
p.write_text(out.rstrip()+'\n')
|
||||
review.append({'case':x['case'],'applicability_notes':extra,'authority_caveat_count':len(uncertain)})
|
||||
(D/'applicability_restoration.json').write_text(json.dumps(review,ensure_ascii=False,indent=2))
|
||||
print(json.dumps({'documents_with_temporal_notes':sum(bool(r['applicability_notes']) for r in review),'temporal_notes':sum(len(r['applicability_notes']) for r in review),'authority_caveats':sum(r['authority_caveat_count'] for r in review)},ensure_ascii=False))
|
||||
Reference in New Issue
Block a user