refactor(source-fs): drop kebab-parse-code dep — 9 tree-sitter grammars drag 제거 #185

Merged
altair823 merged 1 commits from refactor/source-fs-dep-lightening into main 2026-05-26 12:31:32 +00:00
Owner

요약

kebab-source-fskebab-parse-code 의 9 tree-sitter grammars 전체를 drag 했던 무거운 의존성 제거. 실제 사용 surface 는 4 leaf (code_lang_for_path / is_generated_file / is_oversized / BUILTIN_BLACKLIST) — tree-sitter 미사용 — 따라서 kebab-source-fs::code_meta 신규 module 로 이전 + kebab-parse-code 측 cleanup. dependency edge 완전 제거.

설계: docs/superpowers/specs/2026-05-26-source-fs-dep-lightening-spec.md (4 round APPROVE)
계획: docs/superpowers/plans/2026-05-26-source-fs-dep-lightening-plan.md (4 round ACCEPT)

핵심 변경

  • kebab-source-fs::code_meta 신설 — 4 surface 이전. mixed visibility: BUILTIN_BLACKLIST pub (design §5.2 frozen contract 외부 검증 surface 유지), 3 helper fn pub(crate). lib.rs 의 pub use code_meta::BUILTIN_BLACKLIST; 1 줄 추가 (Option A — 다른 mod visibility 무근거 확장 0).
  • callsite migrationmedia.rs (1) + walker.rs (2 + 주석 3) + connector.rs (2). 잔여 kebab_parse_code 0.
  • kebab-parse-code cleanupskip.rs 삭제 + lang.rs narrow edit (code_lang_for_path body + use std::path::Path; import + 2 tier2 unit test 제거 / module_path_for_python / module_path_for_tsjs + 2 unit test 보존) + lib.rs 헤더 doc rewrite (migration breadcrumb 포함).
  • test 1:1 이동 — 13 test (12 unit + 1 frozen contract integration) → kebab-source-fs::code_meta::tests + kebab-source-fs/tests/code_meta.rs.
  • design §8 graphkebab-source-fs └─> kebab-parse-code edge 제거 + p10-2 이후: lang detect + skip policy 내장 inline note. docs/ARCHITECTURE.md 산문 한 줄 추가. kebab-core::metadata.rs:36 stale dep reference 정정.

OMC review history

Phase A (spec, 3 round):

  • round 1: 20 finding (2 CRITICAL + 5 MAJOR + 6 MINOR + 3 NIT + 4 missing) — tempfile dev-dep 거짓 claim / module_path_for_* 회귀 catch crate 오인 등 발견
  • round 2: 3 NEW MAJOR — tasks/INDEX.md stale 사실 오류 / lib.rs surface 무근거 확장 / §3.7 (d) link cost 부정확
  • round 3: APPROVE — 23 finding 모두 reflected, baseline deferral justified, Phase B maturity ready

Phase B (plan, 4 round):

  • round 1: 1 BLOCKER + 2 MAJOR + 6 MINOR + 2 NIT (critic + verifier) — cargo test code_ingest_smoke substring filter false-positive (silent no-op) / lang.rs use std::path::Path; dead import / design §8 검증 acceptance 누락
  • round 2: 1 NEW CRITICAL — design §8 acceptance grep self-contradictory (산문 inline note kebab-parse-code 와 분리 substring 매치)
  • round 3: 1 NEW CRITICAL (same class 재발) — Step 9 sub-action 가드 (c) unanchored code_lang_for_path 가 헤더 doc breadcrumb 산문 매���
  • round 4: ACCEPT — 23 finding 모두 reflected, anchored regex (^pub use lang::.*) 로 산문 회피, Phase C maturity ready

검증

8 acceptance gate (plan §4 + Step 12 exit gate)

  • cargo test -p kebab-source-fs -j 168 PASS (12 신규 code_meta unit + 1 신규 integration + 기존 모두)
  • cargo clippy -p kebab-parse-code --all-targets -j 1 -- -D warningsclean
  • cargo test -p kebab-parse-code -j 167 PASS (module_path_for_python_strips_src_roots_and_extensions + module_path_for_tsjs_keeps_slashes_and_strips_ext 2 unit 보존)
  • cargo tree -p kebab-source-fs | grep tree-sitter | wc -l0 (G1+G5 달성)
  • cargo test -p kebab-app --test code_ingest_smoke -j 119 PASS / 0 fail (--test flag — BLOCKER #1 정정 후 false-positive 회피)
  • cargo test --workspace --no-fail-fast -j 11313 PASS, 0 fail (baseline 그대로, refactor net 0)
  • cargo clippy --workspace --all-targets -j 1 -- -D warningsclean
  • cargo build --release -p kebab-cli -j 1clean (274 MB binary)

3 idempotent grep (design §8 + ARCHITECTURE 갱신)

  • ! grep -qE '└─>\s*kebab-parse-code\s*\(p10-1A-1' design.md → PASS (옛 tree-edge 부재)
  • grep -c 'p10-2 이후: lang detect + skip policy 내장' design.md → 1
  • grep -c 'kebab-source-fs.*code_meta.*kebab-parse-code 와 분리' ARCHITECTURE.md → 1

rustdoc

  • RUSTDOCFLAGS=\"-D rustdoc::broken-intra-doc-links\" cargo doc -p kebab-core --no-deps -j 1clean

Wire / 변경 없음

  • wire schema: 변경 0
  • CLI / TUI / MCP user-facing surface: 변경 0
  • Cargo workspace.version: bump 불필요 (internal refactor — CLAUDE.md 의 release bump 3 트리거 어느 것도 해당 안 됨)
  • kebab-core 도메인 타입 / 의존 그래프 root: 변경 0
  • README / HANDOFF / tasks/INDEX.md / HOTFIXES.md / 4 frozen task spec: 변경 0
  • Cargo features: 변경 0
  • parser_version cascade: 변경 0

internal Rust crate-API surface 만 변동 (kebab_source_fs::BUILTIN_BLACKLIST 가 새로 reachable, kebab_parse_code::skip::* + kebab_parse_code::lang::code_lang_for_path 가 사라짐). user-facing 0.

시험 항목 (Test Plan)

  • cargo test --workspace --no-fail-fast -j 1 → 1313 PASS 그대로
  • cargo tree -p kebab-source-fs | grep tree-sitter | wc -l → 0
  • cargo test -p kebab-app --test code_ingest_smoke -j 1 → 19 PASS
  • RUSTDOCFLAGS="-D rustdoc::broken-intra-doc-links" cargo doc -p kebab-core --no-deps -j 1 → clean
  • design §8 + ARCHITECTURE.md 3 grep 모두 PASS

Assisted-by: Claude Code

## 요약 `kebab-source-fs` 가 `kebab-parse-code` 의 9 tree-sitter grammars 전체를 drag 했던 무거운 의존성 제거. 실제 사용 surface 는 4 leaf (`code_lang_for_path` / `is_generated_file` / `is_oversized` / `BUILTIN_BLACKLIST`) — tree-sitter 미사용 — 따라서 `kebab-source-fs::code_meta` 신규 module 로 이전 + `kebab-parse-code` 측 cleanup. dependency edge 완전 제거. 설계: docs/superpowers/specs/2026-05-26-source-fs-dep-lightening-spec.md (4 round APPROVE) 계획: docs/superpowers/plans/2026-05-26-source-fs-dep-lightening-plan.md (4 round ACCEPT) ## 핵심 변경 - **`kebab-source-fs::code_meta` 신설** — 4 surface 이전. mixed visibility: `BUILTIN_BLACKLIST` `pub` (design §5.2 frozen contract 외부 검증 surface 유지), 3 helper fn `pub(crate)`. lib.rs 의 `pub use code_meta::BUILTIN_BLACKLIST;` 1 줄 추가 (Option A — 다른 mod visibility 무근거 확장 0). - **callsite migration** — `media.rs` (1) + `walker.rs` (2 + 주석 3) + `connector.rs` (2). 잔여 `kebab_parse_code` 0. - **`kebab-parse-code` cleanup** — `skip.rs` 삭제 + `lang.rs` narrow edit (`code_lang_for_path` body + `use std::path::Path;` import + 2 tier2 unit test 제거 / `module_path_for_python` / `module_path_for_tsjs` + 2 unit test 보존) + `lib.rs` 헤더 doc rewrite (migration breadcrumb 포함). - **test 1:1 이동** — 13 test (12 unit + 1 frozen contract integration) → `kebab-source-fs::code_meta::tests` + `kebab-source-fs/tests/code_meta.rs`. - **design §8 graph** — `kebab-source-fs └─> kebab-parse-code` edge 제거 + `p10-2 이후: lang detect + skip policy 내장` inline note. `docs/ARCHITECTURE.md` 산문 한 줄 추가. `kebab-core::metadata.rs:36` stale dep reference 정정. ## OMC review history **Phase A (spec, 3 round)**: - round 1: 20 finding (2 CRITICAL + 5 MAJOR + 6 MINOR + 3 NIT + 4 missing) — `tempfile` dev-dep 거짓 claim / `module_path_for_*` 회귀 catch crate 오인 등 발견 - round 2: 3 NEW MAJOR — `tasks/INDEX.md` stale 사실 오류 / `lib.rs` surface 무근거 확장 / `§3.7 (d)` link cost 부정확 - round 3: APPROVE — 23 finding 모두 reflected, baseline deferral justified, Phase B maturity ready **Phase B (plan, 4 round)**: - round 1: 1 BLOCKER + 2 MAJOR + 6 MINOR + 2 NIT (critic + verifier) — `cargo test code_ingest_smoke` substring filter false-positive (silent no-op) / `lang.rs` `use std::path::Path;` dead import / design §8 검증 acceptance 누락 - round 2: 1 NEW CRITICAL — design §8 acceptance grep self-contradictory (산문 inline note `kebab-parse-code 와 분리` substring 매치) - round 3: 1 NEW CRITICAL (same class 재발) — Step 9 sub-action 가드 (c) unanchored `code_lang_for_path` 가 헤더 doc breadcrumb 산문 매��� - round 4: ACCEPT — 23 finding 모두 reflected, anchored regex (`^pub use lang::.*`) 로 산문 회피, Phase C maturity ready ## 검증 ### 8 acceptance gate (plan §4 + Step 12 exit gate) - `cargo test -p kebab-source-fs -j 1` → **68 PASS** (12 신규 code_meta unit + 1 신규 integration + 기존 모두) - `cargo clippy -p kebab-parse-code --all-targets -j 1 -- -D warnings` → **clean** - `cargo test -p kebab-parse-code -j 1` → **67 PASS** (`module_path_for_python_strips_src_roots_and_extensions` + `module_path_for_tsjs_keeps_slashes_and_strips_ext` 2 unit 보존) - `cargo tree -p kebab-source-fs | grep tree-sitter | wc -l` → **0** (G1+G5 달성) - `cargo test -p kebab-app --test code_ingest_smoke -j 1` → **19 PASS / 0 fail** (`--test` flag — BLOCKER #1 정정 후 false-positive 회피) - `cargo test --workspace --no-fail-fast -j 1` → **1313 PASS, 0 fail** (baseline 그대로, refactor net 0) - `cargo clippy --workspace --all-targets -j 1 -- -D warnings` → **clean** - `cargo build --release -p kebab-cli -j 1` → **clean** (274 MB binary) ### 3 idempotent grep (design §8 + ARCHITECTURE 갱신) - `! grep -qE '└─>\s*kebab-parse-code\s*\(p10-1A-1' design.md` → PASS (옛 tree-edge 부재) - `grep -c 'p10-2 이후: lang detect + skip policy 내장' design.md` → 1 - `grep -c 'kebab-source-fs.*code_meta.*kebab-parse-code 와 분리' ARCHITECTURE.md` → 1 ### rustdoc - `RUSTDOCFLAGS=\"-D rustdoc::broken-intra-doc-links\" cargo doc -p kebab-core --no-deps -j 1` → **clean** ## Wire / 변경 없음 - wire schema: 변경 0 - CLI / TUI / MCP user-facing surface: 변경 0 - Cargo workspace.version: bump 불필요 (internal refactor — CLAUDE.md 의 release bump 3 트리거 어느 것도 해당 안 됨) - `kebab-core` 도메인 타입 / 의존 그래프 root: 변경 0 - README / HANDOFF / tasks/INDEX.md / HOTFIXES.md / 4 frozen task spec: 변경 0 - Cargo features: 변경 0 - `parser_version` cascade: 변경 0 internal Rust crate-API surface 만 변동 (`kebab_source_fs::BUILTIN_BLACKLIST` 가 새로 reachable, `kebab_parse_code::skip::*` + `kebab_parse_code::lang::code_lang_for_path` 가 사라짐). user-facing 0. ## 시험 항목 (Test Plan) - [ ] `cargo test --workspace --no-fail-fast -j 1` → 1313 PASS 그대로 - [ ] `cargo tree -p kebab-source-fs | grep tree-sitter | wc -l` → 0 - [ ] `cargo test -p kebab-app --test code_ingest_smoke -j 1` → 19 PASS - [ ] `RUSTDOCFLAGS="-D rustdoc::broken-intra-doc-links" cargo doc -p kebab-core --no-deps -j 1` → clean - [ ] design §8 + ARCHITECTURE.md 3 grep 모두 PASS Assisted-by: Claude Code
altair823 added 1 commit 2026-05-26 12:21:44 +00:00
kebab-source-fs 가 kebab-parse-code 의 9 tree-sitter grammars 를 drag 했던 무거운 의존성 제거. 4 surface (code_lang_for_path / is_generated_file / is_oversized / BUILTIN_BLACKLIST) 만 사용하지만 dep 그래프에서 9 grammar 전체 link → kebab-source-fs::code_meta 로 이전 + kebab-parse-code 측 cleanup.

핵심 변경:
- kebab-source-fs::code_meta 신설: 4 surface 이전 (BUILTIN_BLACKLIST `pub` for frozen contract + 3 helper fn `pub(crate)`). lib.rs 의 `pub use code_meta::BUILTIN_BLACKLIST` 1 줄 추가 (Option A — 다른 mod surface 무근거 확장 0).
- callsite migration: media.rs (1) + walker.rs (2) + connector.rs (2) 모두 `kebab_source_fs::code_meta::*` 로 갱신.
- kebab-parse-code 측 cleanup: skip.rs 삭제 + lang.rs narrow edit (code_lang_for_path body + unit test 2 + Path import 삭제, module_path_for_* 보존) + lib.rs 헤더 doc rewrite (migration breadcrumb 포함).
- tests/{lang,skip}.rs 13 test 이동 — 12 unit (`src/code_meta.rs::tests`) + 1 integration (`tests/code_meta.rs` for BUILTIN_BLACKLIST frozen contract).
- design §8 graph: edge 제거 + p10-2 inline note. ARCHITECTURE.md 산문 1 줄 갱신. kebab-core::metadata.rs:36 stale dep reference 정정.

G1+G5: cargo tree -p kebab-source-fs | grep tree-sitter = 0 줄.
G2+G3: workspace test 회귀 0 + 13 test 1:1 이동.
G4: design §8 + ARCHITECTURE.md 갱신.

Wire 영향: 없음 (internal Rust crate-API surface 만, user-facing 0). Cargo workspace.version bump 불필요.

Refs:
- docs/superpowers/specs/2026-05-26-source-fs-dep-lightening-spec.md (v3, 4-round APPROVE)
- docs/superpowers/plans/2026-05-26-source-fs-dep-lightening-plan.md (v4, 4-round ACCEPT)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
claude-reviewer-01 approved these changes 2026-05-26 12:22:26 +00:00
claude-reviewer-01 left a comment
Member

회차 1 — source-fs dep lightening refactor 검토.

OMC team source-fs-dep-lightening 의 3-round spec APPROVE + 4-round plan ACCEPT 의 모든 closure 결과가 본 PR 의 코드에 정확히 reflect. 별도 implementation regression 0.

칭찬 (산문):

  1. mixed visibility 정책의 frozen contract 보전BUILTIN_BLACKLIST pub 유지 (Option A from spec Round 2 closure) + tests/code_meta.rs integration test 가 design §5.2 의 6-entry frozen contract 를 외부 검증 surface 로 보존. round 1 critic 의 MAJOR #1 (pub(crate) 만 사용 시 silent breakage) 결함 완전 회피.

  2. Option A lib.rs surface 최소 확장mod code_meta; (private) + pub use code_meta::BUILTIN_BLACKLIST; 1 줄 추가. 기존 4 mod 의 visibility 무근거 확장 (round 2 spec NEW MAJOR #2 결함) 회피 + 기존 pub use connector::{...} re-export 보존. internal Rust crate-API surface 의 net 변화 = symmetric 이동 (kebab_parse_code::skip::BUILTIN_BLACKLIST → kebab_source_fs::BUILTIN_BLACKLIST). user-facing surface 0.

  3. lang.rs use std::path::Path; dead import 명시적 삭제 — plan round 1 critic MAJOR #1 의 결함 (clippy -D warningsunused_imports 가 partial-apply 시 catch) 가 코드에 정확히 reflect. module_path_for_python / module_path_for_tsjs 둘 다 &str 인자라 Path 미사용 → import 살리면 clippy fail.

  4. tempfile dev-dep 보존kebab-parse-code/tests/repo.rs:4 가 계속 사용한다는 round 1 critic CRITICAL #1 의 발견이 본 PR 의 Cargo.toml 변경 0 으로 정확히 reflect. spec/plan 의 거짓 claim 이 코드 단계까지 도달 안 함.

  5. design §8 graph + ARCHITECTURE.md 갱신의 syntactic precision — tree-edge └─> kebab-parse-code (p10-1A-1 anchor 부재 검증 + p10-2 inline note 추가 + ARCHITECTURE 산문 한 줄. plan round 2 NEW CRITICAL #1 (산문 substring × unanchored regex) closure 의 tree-edge anchor 가 코드 단계에서 정상 통과 (3 idempotent grep 모두 PASS).

  6. e2e fixture --test code_ingest_smoke flag 정확 사용 — plan round 1 verifier BLOCKER #1 (substring filter false-positive 0 tests run) closure 가 본 PR 의 verification 단계에서 정확히 적용. 19 test 실제 실행 + 0 fail. 향후 누군가 workspace 회귀를 줄이고 e2e fixture 만 신뢰해도 silent fail 0.

  7. workspace 회귀 net-zero — 13 test 1:1 이동 (12 unit code_meta::tests + 1 integration tests/code_meta.rs) + module_path_for_* sibling 2 unit 보존. cargo test --workspace --no-fail-fast -j 1 = 1313 PASS, 0 fail. spec round 1 의 estimate 와 일치 (executor 의 baseline polluted 폐기 후 net-zero 원리로 검증 — 합리적 trade-off).

  8. 9 tree-sitter grammars drag 완전 제거cargo tree -p kebab-source-fs | grep tree-sitter | wc -l = 0. G1 (Cargo.toml dep 제거) + G5 (transitive 0) 동시 달성. spec § Goals 의 핵심 약속 정량 verify.

추가 actionable 없음. 1313 workspace test PASS + clippy --workspace clean + release build clean (274 MB) + rustdoc broken-intra-doc-links 0. Wire / Cargo workspace.version / README / HANDOFF / tasks/INDEX.md / HOTFIXES.md / 4 frozen task spec / Cargo features / parser_version cascade 모두 변경 0.

머지 OK. 머지 후 다음 작업 (Lens 1 kebab-normalize + kebab-parse-types 흡수 — 4-6h medium risk) 동일 spec/plan/review/PR 사이클로 진행.

회차 1 — source-fs dep lightening refactor 검토. OMC team `source-fs-dep-lightening` 의 3-round spec APPROVE + 4-round plan ACCEPT 의 모든 closure 결과가 본 PR 의 코드에 정확히 reflect. 별도 implementation regression 0. 칭찬 (산문): 1. **mixed visibility 정책의 frozen contract 보전** — `BUILTIN_BLACKLIST` `pub` 유지 (Option A from spec Round 2 closure) + `tests/code_meta.rs` integration test 가 design §5.2 의 6-entry frozen contract 를 외부 검증 surface 로 보존. round 1 critic 의 MAJOR #1 (`pub(crate)` 만 사용 시 silent breakage) 결함 완전 회피. 2. **Option A lib.rs surface 최소 확장** — `mod code_meta;` (private) + `pub use code_meta::BUILTIN_BLACKLIST;` 1 줄 추가. 기존 4 mod 의 visibility 무근거 확장 (round 2 spec NEW MAJOR #2 결함) 회피 + 기존 `pub use connector::{...}` re-export 보존. internal Rust crate-API surface 의 net 변화 = symmetric 이동 (kebab_parse_code::skip::BUILTIN_BLACKLIST → kebab_source_fs::BUILTIN_BLACKLIST). user-facing surface 0. 3. **lang.rs `use std::path::Path;` dead import 명시적 삭제** — plan round 1 critic MAJOR #1 의 결함 (clippy `-D warnings` 의 `unused_imports` 가 partial-apply 시 catch) 가 코드에 정확히 reflect. `module_path_for_python` / `module_path_for_tsjs` 둘 다 `&str` 인자라 Path 미사용 → import 살리면 clippy fail. 4. **`tempfile` dev-dep 보존** — `kebab-parse-code/tests/repo.rs:4` 가 계속 사용한다는 round 1 critic CRITICAL #1 의 발견이 본 PR 의 Cargo.toml 변경 0 으로 정확히 reflect. spec/plan 의 거짓 claim 이 코드 단계까지 도달 안 함. 5. **design §8 graph + ARCHITECTURE.md 갱신의 syntactic precision** — tree-edge `└─> kebab-parse-code (p10-1A-1` anchor 부재 검증 + p10-2 inline note 추가 + ARCHITECTURE 산문 한 줄. plan round 2 NEW CRITICAL #1 (산문 substring × unanchored regex) closure 의 tree-edge anchor 가 코드 단계에서 정상 통과 (3 idempotent grep 모두 PASS). 6. **e2e fixture `--test code_ingest_smoke` flag 정확 사용** — plan round 1 verifier BLOCKER #1 (substring filter false-positive 0 tests run) closure 가 본 PR 의 verification 단계에서 정확히 적용. 19 test 실제 실행 + 0 fail. 향후 누군가 workspace 회귀를 줄이고 e2e fixture 만 신뢰해도 silent fail 0. 7. **workspace 회귀 net-zero** — 13 test 1:1 이동 (12 unit `code_meta::tests` + 1 integration `tests/code_meta.rs`) + module_path_for_* sibling 2 unit 보존. `cargo test --workspace --no-fail-fast -j 1` = 1313 PASS, 0 fail. spec round 1 의 estimate 와 일치 (executor 의 baseline polluted 폐기 후 net-zero 원리로 검증 — 합리적 trade-off). 8. **9 tree-sitter grammars drag 완전 제거** — `cargo tree -p kebab-source-fs | grep tree-sitter | wc -l = 0`. G1 (Cargo.toml dep 제거) + G5 (transitive 0) 동시 달성. spec § Goals 의 핵심 약속 정량 verify. 추가 actionable 없음. 1313 workspace test PASS + clippy --workspace clean + release build clean (274 MB) + rustdoc broken-intra-doc-links 0. Wire / Cargo workspace.version / README / HANDOFF / tasks/INDEX.md / HOTFIXES.md / 4 frozen task spec / Cargo features / parser_version cascade 모두 변경 0. 머지 OK. 머지 후 다음 작업 (Lens 1 kebab-normalize + kebab-parse-types 흡수 — 4-6h medium risk) 동일 spec/plan/review/PR 사이클로 진행.
altair823 merged commit d4395a306b into main 2026-05-26 12:31:32 +00:00
altair823 deleted branch refactor/source-fs-dep-lightening 2026-05-26 12:31:33 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: altair823-org/kebab#185