feat(b08): 줄 구실 잣대를 자료로 — axis_policy.json · 건설 축 자리와 덜어낼 잣대 미리 세움
- 총칙 뿌리를 코드에서 꺼냄 — `general_provision_roots()` 가 `axis_policy.json` 을 읽음 (기관이 정하는 범위라 코드에 박으면 관리자가 못 고침) - 방침 못박음 — `never_delete: true` · 평평한 목록은 `pum_tables > 0`(「잎」 아님) - 구실 넷에 「지우지 않음」 딱지 — 브레인 승인(2026-09-17) - 건설 축 자리 — `CP`/`CW` · 총칙 뿌리 `01_공통부문/제1장_적용기준.md` · ⬜ 미확정 둘(제8장 건설기계 351표 · 유지관리 제1장 공통 40표 · 안티그래비티 조사 대기) - ⚠ 건설 코드 꼴 경고 — 부문마다 장 번호가 1부터 다시 시작(공통 제1장=적용기준 · 토목 제1장=도로포장) · 장 번호만으로 코드를 지으면 부문이 다른 공종끼리 덮음 계층 근거는 목차표가 아니라 장 파일 46개(`source_file` 칸) - 이름표에 건설 kind 자리 — `pending_merged_tables` (서버가 kind 를 내는 날 옮겨 담을 것) - 시험 둘 더 — 잣대가 자료에 있음 · 어느 구실도 안 지움 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsGw1Dz9HmhuAxGisxmDPF
This commit is contained in:
@@ -28,6 +28,8 @@ from B08_Quantity.B08_Quantity_Build_WorkItemMaster_Keys import ( # noqa: E402
|
||||
axis_role,
|
||||
empty_registry,
|
||||
format_key,
|
||||
general_provision_roots,
|
||||
load_policy,
|
||||
path_names,
|
||||
toc_edition,
|
||||
toc_slot,
|
||||
@@ -197,6 +199,38 @@ def test_구실_가름_규칙() -> None:
|
||||
assert axis_role({"work_item_code": "FP-09-01", "tables": []}, has_children=False) == "empty"
|
||||
|
||||
|
||||
def test_총칙_범위는_코드가_아니라_자료가_정함() -> None:
|
||||
"""⚠ 뿌리를 코드에 박으면 관리자가 못 고친다 — `axis_policy.json` 이 정본."""
|
||||
assert general_provision_roots("forest") == ("FP-01", "FP-02")
|
||||
const = load_policy("const")
|
||||
assert const["key_prefix"] == "CW"
|
||||
assert const["settled"] is False
|
||||
assert const["general_provision_roots"] == ["01_공통부문/제1장_적용기준.md"]
|
||||
assert [p["chapter"] for p in const["general_provision_pending"]] == [
|
||||
"01_공통부문/제8장_건설기계.md",
|
||||
"05_유지관리부문/제1장_공통.md",
|
||||
]
|
||||
# 뿌리를 바꿔 주면 구실도 따라 바뀐다 — 잣대가 자료에 있다는 증거
|
||||
assert (
|
||||
axis_role({"work_item_code": "FP-09-03", "tables": []}, has_children=True, roots=("FP-09",))
|
||||
== "general_provision"
|
||||
)
|
||||
|
||||
|
||||
def test_어느_구실도_지우지_않음() -> None:
|
||||
"""브레인 승인(2026-09-17) — 「덜어내기」가 아니라 「가름만」."""
|
||||
import json as _json
|
||||
from pathlib import Path as _Path
|
||||
|
||||
policy = _json.loads(
|
||||
_Path("resources/data_work_item_master/axis_policy.json").read_text(encoding="utf-8")
|
||||
)
|
||||
assert policy["policy"]["never_delete"] is True
|
||||
assert policy["policy"]["flat_list_filter"] == "pum_tables > 0"
|
||||
assert all(role["keep"] for role in policy["roles"].values())
|
||||
assert list(policy["roles"]) == ["work_item", "group", "general_provision", "empty"]
|
||||
|
||||
|
||||
def test_경로_이름_잇기() -> None:
|
||||
nodes = [
|
||||
{"work_item_code": "A", "parent_code": None, "name": "토공"},
|
||||
|
||||
Reference in New Issue
Block a user