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,26 @@
|
||||
"""Final storage integrity only; does not repeat semantic/format audit."""
|
||||
from pathlib import Path
|
||||
import json,hashlib,subprocess
|
||||
ROOT=Path.cwd()
|
||||
def sha(p):return hashlib.sha256(p.read_bytes()).hexdigest()
|
||||
for key in ['지료청구','진료비치료비의료비청구']:
|
||||
w=ROOT/f'tmp/규칙문서재작성_{key}_20260913_batch5'
|
||||
snap=json.loads((w/'snapshot.json').read_text());draft=w/'draft.md';out=Path(snap['output'])
|
||||
for p,h in [(Path(snap['source']),snap['source_sha']),(ROOT/'case_kind_registry.json',snap['registry_sha']),(ROOT/'1. 베타 0.5 다듬기/output_format_v1.txt',snap['format_sha'])]:
|
||||
if sha(p)!=h:raise RuntimeError('Input changed: '+str(p))
|
||||
data=draft.read_bytes();text=data.decode('utf8')
|
||||
if out.exists():
|
||||
status='동일 최종본 존재' if out.read_bytes()==data else '기존 최종본 덮어쓰기 승인 필요'
|
||||
else:
|
||||
patch='*** Begin Patch\n*** Add File: '+str(out.relative_to(ROOT))+'\n'+''.join('+'+l+'\n' for l in text.splitlines())+'*** End Patch\n'
|
||||
subprocess.run(['apply_patch',patch],check=True,capture_output=True);status='재작성·단일 검증·개선 반영 후 신규 저장'
|
||||
target=draft if status=='기존 최종본 덮어쓰기 승인 필요' else out
|
||||
saved=target.read_bytes();decoded=saved.decode('utf8')
|
||||
if target==out and saved!=data:raise RuntimeError('Saved bytes differ')
|
||||
if decoded.splitlines()[0]!=snap['title']:raise RuntimeError('Title mismatch after save')
|
||||
r={'key':key,'display':snap['display'],'status':status,'path':str(target),'lines':len(decoded.splitlines()),'bytes':len(saved),'sha256':sha(target),'source_unchanged':True,'work_directory':str(w),'verification_rounds':1}
|
||||
result=json.dumps(r,ensure_ascii=False,indent=2)
|
||||
rp=w/'storage_result.json'
|
||||
if rp.exists():raise RuntimeError('Do not repeat publishing')
|
||||
subprocess.run(['apply_patch','*** Begin Patch\n*** Add File: '+str(rp.relative_to(ROOT))+'\n'+''.join('+'+l+'\n' for l in result.splitlines())+'*** End Patch\n'],check=True,capture_output=True)
|
||||
print(result)
|
||||
Reference in New Issue
Block a user