refactor(855-E L3ⓐ): M01 기초 저장 · 검사 · 막힘 세기 = 수식 문서 기준 · 로직 줄 쓰기 = Store_Logic.mirror 한 자리

앞 세션 auto 커밋 cce57c298(Store_Logic 새 길 · /logic 답 머리만 · 판 = 문서 파일 지문 · 개정 = 문서 머리 대조 · 별칭 · 기계 등록 · [신규] · [삭제])에 이어
- Store_Cache: 막힘 세기(blocks · counted)를 문서 파일마다 · 저장 검사 logic_errors = 키 겹침 · 대장(요소 + 문서 키) · 연결 · 문서 막힘(check_logics 로직 줄 검사 걷음) · _docs_of = 문서 전부 · narrow 로직 갈래 걷음 · check_saved(부름 0) 지움
- Store_Save: 기초(로직 파일) 받지 않음(400) · gone · labor_errors(whole) 갈래 걷음
- Store_Logic: 정본 파일에도 새 기초(그 파일 표 키 — 옛 /save 와 같음) · 지움 검사에 조합 · 지운 기초를 부르던 문서 더함(옛 422 그대로) · 쓰는 곳 409 는 Doc.remove 로(옛 자리)
- 시험(옛 /save 로 로직 줄 셈 칸 고침 · /logic 답 셈 칸을 붙든 것 = 죽은 길): 새 test_855_l3_doc_only(로직 파일 없음 + 같이 쓰기 끔 = 켬과 답 같음 · 목록 · 상세 · 저장 · 개정 409 · 판 409 · 별칭 · 신규 · 복사 · 삭제 · 기계 등록)
  · test_m01_cache 셈 칸 /save 검사 셋 · test_794_1 식 고침 /save 422 걷음(셈 칸 고침 = 문서 저장 몫 · /save 는 머리만 씀)
  · test_m01_make 「시험 계산에 돈다」 → 빈 문서로 열림 · test_m01_api · test_m01_text 옛 셈 길 시험은 로직 줄 사본에서 읽음
  · test_854_2_m01_key_book 대장 끊김 = 인력 줄 + 기초 문서 쓰기 · test_794_1b · test_804_7 판 = 문서 파일 · test_802_3 문서 없는 키 = 404(빈 문서 안 지음)
  · test_826_2 좁힌 검사 = 판정만 견줌(기초 흠 글이 문서 꼴) · 로직 갈래 셋 뺌 · test_m01_copy 옛 시트 길 걷고 master_copy 왕복만 · test_854_2_m01_copy_doc 식 복사 → 기본정보 고친 복사
  · test_713_1 · test_796_1 row_print 줄 뺌(row_print 지움)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 08:37:53 +09:00
co-authored by Claude Opus 5.5
parent b78e5f6786
commit 7e6190f8d3
21 changed files with 368 additions and 561 deletions
+9 -2
View File
@@ -6,6 +6,7 @@
from __future__ import annotations
import json
import re
import shutil
import sys
@@ -45,6 +46,12 @@ def client(tmp_path: Path, monkeypatch) -> TestClient:
return TestClient(app)
def _row(file: str, key: str) -> dict:
"""옛 로직 줄(같이 쓰기 사본) — `/logic` 답은 머리만(855 L3 ⓐ) · 옛 글 길 시험 몫."""
rows = json.loads((store.FOLDER / file).read_text(encoding="utf-8"))["줄"]
return next(r for r in rows if r["키"] == key)
def _inputs(key: str) -> dict:
"""그 로직의 일괄 시험 입력 한 벌(`check_master.시험입력`)."""
row = store.cm.master(REAL).logic(key)
@@ -166,7 +173,7 @@ def test_고른_값이_틀리면_그대로_막힘(client: TestClient) -> None:
def test_끝수는_줄이_아니라_소계에_붙는다(client: TestClient) -> None:
got = client.get("/api/m01/logic", params={"key": STACK}).json()
row = dict(got["logic"], 끝수={"대상": "계", "자리": 0, "방법": "버림"})
row = dict(_row(got["file"], STACK), 끝수={"대상": "계", "자리": 0, "방법": "버림"})
body = {"key": STACK, "inputs": _inputs(STACK), "row": row, "file": got["file"]}
cut = client.post("/api/m01/text", json=body).json()
assert cut["ok"] is True
@@ -301,7 +308,7 @@ def test_조각_로직_부르는_줄_990개_세_비목에_다_걸치고_계산_
비목이 안 정해진 로직 부르는 줄은 세 비목에 다 걸쳐 보여야 하나, 이 견본(STACK)은
호표 둘 다 비목이 「노무비」로 정해진 인력 줄이라 한 비목에만 걸림 — 그 좁은 경우 확인."""
got = client.get("/api/m01/logic", params={"key": STACK}).json()
row = dict(got["logic"])
row = dict(_row(got["file"], STACK))
row["호표"] = [dict(row["호표"][0], 요소="LB099999"), dict(row["호표"][1])]
body = {"key": STACK, "inputs": _inputs(STACK), "row": row, "file": got["file"]}
text = client.post("/api/m01/text", json=body)