Files
Pier_v1/RAG/design-model-box-sample_2/tools/generate_cached_quantity_review.py
T
ahnyongjooandClaude Sonnet 5.5 964a841de1 chore(rebar): Pier_T_rebar 작업 폴더 초기 구성 및 외부 의존 파일 통합
- Code\rebar_pipeline, review_pipeline, pier-program을 정션에서 실제 폴더로 전환
- Code\rhino_mcp 및 CLAUDE_rhino배경.md 추가, .mcp.json은 PYTHONPATH로 새 위치 사용
- pier-program 내부 .git 제거(이력은 backup\pier-program_20261028.bundle에 보관)
- worktree 가이드 반영(CLAUDE.local.md, HANDOFF.md)
- D:\Rhino-MCP 경로 참조를 새 위치로 치환

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-28 11:20:18 +09:00

46 lines
2.3 KiB
Python

"""Replay current-CAD seed evidence through the shared placement and gates."""
import argparse
import copy
import json
import sys
from pathlib import Path
root=Path(__file__).resolve().parents[1]
sys.path.insert(0,str(root/'src/backend' if (root/'src/backend').is_dir() else root))
def run(args):
import server
from authorized_quantity_generation import generate_seed
from haunch_contact_surface import bind
server.require_modeling_rules()
job=json.loads(args.job.read_text());plan=job['result']
cache=json.loads(args.seeds.read_text());authorization=cache['authorization']
source_hashes={r['source_sha256'] for r in plan['drawingEvidence']['cad_fabrication_inventory']['rows']}
if not set(authorization['source_sha256']).issubset(source_hashes):
raise ValueError('seed source hashes differ from current drawing inventory')
bind(plan['concrete_components'],server.component_surface_z_at_xy)
groups=[];failures=[]
for seed in cache['seeds']:
if args.block and seed['rebar_block']!=args.block:continue
try:
g=generate_seed(plan,seed,node=args.node);groups.append(g)
print(json.dumps({'block':g['rebar_block'],'mark':g['mark'],'count':g['count'],
'rhythm':g['quantity_distribution'].get('rhythm'),'pass':True}),flush=True)
except ValueError as error:
failures.append({'block':seed['rebar_block'],'mark':seed['mark'],'error':str(error)})
print(json.dumps(failures[-1]),flush=True)
ids={g['id'] for g in groups}
plan['rebar_groups']=[g for g in plan['rebar_groups'] if g.get('id') not in ids]+groups
plan['quantityDistributionReview']={'group_ids':sorted(ids),'failures':failures,'engineering_approved':False}
with args.output.open('x') as stream:
json.dump({'result':plan,'authorization':authorization,'failures':failures},stream,ensure_ascii=False,allow_nan=False)
print(json.dumps({'generated':len(groups),'failures':len(failures)}),flush=True)
if __name__=='__main__':
parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('job',type=Path);parser.add_argument('seeds',type=Path)
parser.add_argument('--output',type=Path,required=True);parser.add_argument('--node',required=True)
parser.add_argument('--block')
run(parser.parse_args())