-- PR-DocSrv-Hierarchical-Decomposition-1 (c1: schema) -- 계층 분해 트리 컬럼 (단일 statement = runner single-statement 제약 OK, 다중 ADD COLUMN action). -- parent_id : 트리 부모. DB FK 미설정(cascade 모호성 + single-statement 회피). 무결성은 builder(G2)+replace(G5) 검증 쿼리로 강제. -- level : authoritative depth (0=root/doc, 증가). -- node_type : nullable hint(chapter/section/clause...). retrieval/replace 활성 조건에 절대 미사용. -- is_leaf : authoritative leaf 마커 (replace predicate 가 이것만 신뢰). -- in_corpus : 검색 코퍼스 편입 여부. 기본 true → 기존 legacy 행은 검색 유지. 신규 hier 행은 false 로 적재. -- plan: ~/.claude/plans/hierarchical-decomposition-tiered-nesting-marmot.md ALTER TABLE document_chunks ADD COLUMN IF NOT EXISTS parent_id bigint NULL, ADD COLUMN IF NOT EXISTS level smallint NULL, ADD COLUMN IF NOT EXISTS node_type text NULL, ADD COLUMN IF NOT EXISTS is_leaf boolean NOT NULL DEFAULT false, ADD COLUMN IF NOT EXISTS in_corpus boolean NOT NULL DEFAULT true;