chore(p10-1d-followup): reviewer nit cleanup — C extractor tests + HOTFIXES + cpp snapshot #157

Merged
altair823 merged 3 commits from chore/p10-1d-followup-nits into main 2026-05-21 22:47:40 +00:00
Owner

Summary

PR #156 (p10-1d) code-reviewer 의 3 non-blocking nit 묶음 cleanup. 4번째 nit (9 chunkers 의 shared helper) 은 별 phase. version bump 없음.

  • nit #1 (6beff35): crates/kebab-parse-code/src/c.rs 에 17 in-file unit tests 추가 (cpp.rs 의 15-test 패턴 따라). function_definition 의 pointer-return / static / extern / inline + struct_specifier / enum_specifier / union_specifier (named) + anonymous struct/enum/union → glue + typedef-struct → glue + preprocessor → glue + multiple functions + empty file → <module> + preprocessor-only file → <module> + mixed + deterministic. 4 match arms + 2 post-pass path 모두 커버.
  • nit #2 (b81574a): tasks/HOTFIXES.md 에 2026-05-21 dated entry — typedef struct { ... } Foo; 의 anonymous inner struct 가 glue 로 떨어져 named typedef alias 가 symbol 으로 안 잡힘. spec body line 22 (named struct → unit) 와의 tension 명시 + dogfood-driven 재검토 next-step. 본 PR 의 spec (tasks/p10/p10-1d-c-cpp-ast-chunker.md) Risks/notes 에도 cross-link.
  • nit #3 (840c6c4): crates/kebab-chunk/tests/code_cpp_ast_snapshot.rs 가 실 CppAstExtractor 를 거치는 snapshot test 추가. hand-built fixed_doc() tests 도 유지 (chunker-only 빠른 검증용). 실 extractor 가 sample.cpp 에서 14 blocks 추출 (8 named symbol units + 6 glue) — Task E 의 plan 가정 (~9 chunks) 와 근사. kebab-chunkkebab-parse-code dev-dep 추가 (precedent: kebab-parse-md).

Test plan

  • cargo test -p kebab-parse-code — 63 unit + integration tests PASS (17 new C extractor tests 포함)
  • cargo test -p kebab-chunk — 모든 integration test suite PASS (실 extractor snapshot 2 tests 포함)
  • cargo clippy -p kebab-parse-code --all-targets -- -D warnings clean
  • cargo clippy -p kebab-chunk --all-targets -- -D warnings clean
  • post-merge dogfood: 없음 (behavior change 없음, test coverage + docs only)

Branch

chore/p10-1d-followup-nits (head: 840c6c4). 3 commits, review-friendly 분리.

Critical issue (informational, not part of this PR)

PR #155 (p10-3) 머지 시점에 reviewer-required Option B1 fix 가 main 에 없음 (2a39513 commit 이 실제로 존재 안 함). PR #156 의 commit 1034de2 가 그 fix 를 verbatim 으로 land. v0.16.0 release 부터 fallback path 의 reingest 가 Unchanged. v0.15.0 사용자는 0.16.0 으로 업그레이드 권장.

🤖 Generated with Claude Code

## Summary PR #156 (p10-1d) code-reviewer 의 3 non-blocking nit 묶음 cleanup. 4번째 nit (9 chunkers 의 shared helper) 은 별 phase. version bump 없음. - **nit #1** (`6beff35`): `crates/kebab-parse-code/src/c.rs` 에 17 in-file unit tests 추가 (cpp.rs 의 15-test 패턴 따라). function_definition 의 pointer-return / static / extern / inline + struct_specifier / enum_specifier / union_specifier (named) + anonymous struct/enum/union → glue + typedef-struct → glue + preprocessor → glue + multiple functions + empty file → `<module>` + preprocessor-only file → `<module>` + mixed + deterministic. 4 match arms + 2 post-pass path 모두 커버. - **nit #2** (`b81574a`): `tasks/HOTFIXES.md` 에 2026-05-21 dated entry — `typedef struct { ... } Foo;` 의 anonymous inner struct 가 glue 로 떨어져 named typedef alias 가 symbol 으로 안 잡힘. spec body line 22 (named struct → unit) 와의 tension 명시 + dogfood-driven 재검토 next-step. 본 PR 의 spec (`tasks/p10/p10-1d-c-cpp-ast-chunker.md`) Risks/notes 에도 cross-link. - **nit #3** (`840c6c4`): `crates/kebab-chunk/tests/code_cpp_ast_snapshot.rs` 가 실 `CppAstExtractor` 를 거치는 snapshot test 추가. hand-built `fixed_doc()` tests 도 유지 (chunker-only 빠른 검증용). 실 extractor 가 `sample.cpp` 에서 14 blocks 추출 (8 named symbol units + 6 glue) — Task E 의 plan 가정 (~9 chunks) 와 근사. `kebab-chunk` 에 `kebab-parse-code` dev-dep 추가 (precedent: `kebab-parse-md`). ## Test plan - [x] `cargo test -p kebab-parse-code` — 63 unit + integration tests PASS (17 new C extractor tests 포함) - [x] `cargo test -p kebab-chunk` — 모든 integration test suite PASS (실 extractor snapshot 2 tests 포함) - [x] `cargo clippy -p kebab-parse-code --all-targets -- -D warnings` clean - [x] `cargo clippy -p kebab-chunk --all-targets -- -D warnings` clean - [ ] post-merge dogfood: 없음 (behavior change 없음, test coverage + docs only) ## Branch `chore/p10-1d-followup-nits` (head: `840c6c4`). 3 commits, review-friendly 분리. ## Critical issue (informational, not part of this PR) PR #155 (p10-3) 머지 시점에 reviewer-required Option B1 fix 가 main 에 없음 (`2a39513` commit 이 실제로 존재 안 함). PR #156 의 commit `1034de2` 가 그 fix 를 verbatim 으로 land. v0.16.0 release 부터 fallback path 의 reingest 가 Unchanged. v0.15.0 사용자는 0.16.0 으로 업그레이드 권장. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
altair823 added 3 commits 2026-05-21 22:45:18 +00:00
Mirrors the cpp.rs 15-test pattern. Covers function_definition (incl.
pointer-return, static/extern/inline), struct_specifier / enum_specifier /
union_specifier (named), anonymous struct/enum/union → glue, typedef-wrapped
struct → glue (per spec risks note), preprocessor directives → glue, empty
file → <module> post-pass, preprocessor-only → <module>, mixed fn + glue →
<top-level> present, determinism (20 runs). 17 tests total.

Reviewer nit #1 (PR #156 code-reviewer).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR #156 reviewer nit #2. Documents the tension between spec body
("struct_specifier (named, top-level) → 1 unit") and the actual behavior
for the C idiom `typedef struct { ... } Foo;` — the inner struct_specifier
is anonymous, so the extractor falls into glue. Workaround: dogfood-driven
revisit if frequent pain point emerges.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reviewer nit #3: the hand-built fixed_doc() only verified chunker 1:1
mapping. New tests invoke CppAstExtractor against tests/fixtures/sample.cpp
and snapshot the real extractor → chunker pipeline (14 blocks emitted
covering namespace::chunk::Class, ctor/dtor/operator/template/free-fn
convention, glue <top-level> blocks between units).

Adds kebab-parse-code as a dev-dep of kebab-chunk (same precedent as
kebab-parse-md). Both the existing hand-built test AND the new
extractor-driven tests are kept — the former for fast chunker-only
validation, the latter for end-to-end regression detection.

Added tests:
- code_cpp_ast_extractor_snapshot: asserts all 8 named symbol units are present
- code_cpp_ast_extractor_chunks_deterministic: chunker output is stable

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
altair823 merged commit c6207d196e into main 2026-05-21 22:47:40 +00:00
altair823 deleted branch chore/p10-1d-followup-nits 2026-05-21 22:47:42 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: altair823-org/kebab#157