Skip to content

chore: upgrade kotatsu, adopt renamed codec entries and KOTATSU_ANNOTATE - #590

Merged
16bit-ykiko merged 2 commits into
mainfrom
chore/upgrade-kotatsu
Aug 12, 2026
Merged

chore: upgrade kotatsu, adopt renamed codec entries and KOTATSU_ANNOTATE#590
16bit-ykiko merged 2 commits into
mainfrom
chore/upgrade-kotatsu

Conversation

@16bit-ykiko

Copy link
Copy Markdown
Member

What changed

Bumps the kotatsu pin from c516e3a (#181) to 340a32a (#196) and migrates every call site to the new API surface:

  • Codec entry points now follow kotatsu's payload-based naming: json::to_jsonjson::to_string, json::from_json/json::parsejson::from_string, toml::parse<T>(text)toml::from_string<T>(text), toml::from_toml<Config>(text, out)toml::from_string<Config>(text, out). bincode::to_bytes/from_bytes are unchanged. No flatbuffers migration — clice has no codec::fbs call sites; the codec just stays enabled.
  • Annotations: the old kota::meta::defaulted<T> / annotation<T, attrs::skip> wrappers were removed upstream, so Config/ProjectConfig/TrackerConfig/ConfigRule, the three feature options structs, and the cache-metadata struct in workspace.cpp now use the KOTATSU_ANNOTATE(defaulted = true, ...) / KOTATSU_ANNOTATE(skip = true) macro. The macro expands to the same annotation<T, spec<Tag>> wrapper, so field access (.value, aggregate inheritance) and decode semantics are unchanged.
  • Every user-facing config option now carries a description = "..." attribute (validated against actual usage; options that are declared but not consumed yet are marked "not yet implemented"). The internal cache struct keeps defaulted only.
  • .clang-format: ports kotatsu's StatementMacros: KOTATSU_ANNOTATE (keeps <T> field; on its own line) and BreakAdjacentStringLiterals: true (stacks long description literals). The latter reflows adjacent string literals in ~10 test files — content-identical, formatting only.

Tests

All four suites locally on Debug: unit 1167/1167 (7 skipped), integration 340 passed / 2 skipped, smoke 3/3, snap 395 passed / 68 skipped. Unit suite re-run after the final doc-string fixes.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d1d6aaa1-ea39-42f9-ad71-ec5c387f15b2

📥 Commits

Reviewing files that changed from the base of the PR and between 1a3246e and 9738f31.

📒 Files selected for processing (1)
  • cmake/package.cmake
🚧 Files skipped from review as they are similar to previous changes (1)
  • cmake/package.cmake

📝 Walkthrough

Walkthrough

The pull request migrates JSON and TOML operations to Kotatsu string-based codec APIs, replaces defaulted<T> configuration fields with annotated native fields, updates the Kotatsu dependency pin, and reformats adjacent string literals across source and test files.

Changes

Kotatsu migration and formatting

Layer / File(s) Summary
Annotated configuration contracts
src/feature/feature.h, src/server/state/config.h, src/server/state/workspace.cpp
Configuration fields now use native types with KOTATSU_ANNOTATE defaults, descriptions, and skip metadata.
Codec API migration
src/driver/inspect.cc, src/server/..., src/support/..., benchmarks/scan_benchmark.cpp, tests/unit/server/config_tests.cpp, cmake/package.cmake
JSON and TOML parsing and serialization now use from_string and to_string. The Kotatsu dependency pin also changes.
Formatting and source fixtures
.clang-format, src/..., tests/unit/...
Adjacent string literals, diagnostics, logs, command strings, source fixtures, and Markdown expectations are reformatted without changing their values or behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • clice-io/clice#435: Shares Kotatsu codec migration in benchmark and configuration test code.
  • clice-io/clice#449: Shares Kotatsu API migration in benchmark and serialization call sites.
  • clice-io/clice#576: Shares configuration option changes in feature.h, config.h, and inspect.cc.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the Kotatsu upgrade, renamed codec APIs, and KOTATSU_ANNOTATE migration.
Description check ✅ Passed The description covers the changes and provides detailed local test results; the optional Related issue section is not needed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/upgrade-kotatsu

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/server/state/config.h`:
- Around line 44-112: Update all stale defaulted<T> member accesses to use
native direct field access instead of .value. In src/server/state/config.h lines
44-112, adjust ProjectConfig and TrackerConfig accesses in production code and
tests; in src/feature/feature.h lines 89-128 and 233-258, adjust
CodeCompletionOptions, HoverOptions, and InlayHintsOptions accesses. Replace
both reads and writes while preserving existing fallback and configuration
behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fe717f8f-e1ca-4677-a62d-34ecbb758a9c

📥 Commits

Reviewing files that changed from the base of the PR and between 604b5b1 and 1a3246e.

📒 Files selected for processing (33)
  • .clang-format
  • benchmarks/scan_benchmark.cpp
  • cmake/package.cmake
  • src/command/command.cpp
  • src/driver/inspect.cc
  • src/feature/feature.h
  • src/semantic/resolver.cpp
  • src/server/compiler/compiler.cpp
  • src/server/compiler/indexer.cpp
  • src/server/protocol/serialize.h
  • src/server/service/feature_router.cpp
  • src/server/service/format.cpp
  • src/server/state/config.cpp
  • src/server/state/config.h
  • src/server/state/session_store.cpp
  • src/server/state/workspace.cpp
  • src/server/transport/agentic.h
  • src/server/transport/lsp_client.cpp
  • src/server/transport/master_server.cpp
  • src/server/worker/stateful_worker.cpp
  • src/server/worker/worker_pool.cpp
  • src/support/cache_store.cpp
  • src/support/glob_pattern.cpp
  • src/syntax/annotation.cpp
  • src/syntax/dependency_graph.cpp
  • tests/unit/command/command_tests.cpp
  • tests/unit/server/compile_graph_integration_tests.cpp
  • tests/unit/server/compiler_tests.cpp
  • tests/unit/server/config_tests.cpp
  • tests/unit/server/module_worker_tests.cpp
  • tests/unit/server/pch_worker_tests.cpp
  • tests/unit/server/stateful_worker_tests.cpp
  • tests/unit/support/markup_tests.cpp

Comment thread src/server/state/config.h
@16bit-ykiko
16bit-ykiko merged commit 7500095 into main Aug 12, 2026
32 checks passed
@16bit-ykiko
16bit-ykiko deleted the chore/upgrade-kotatsu branch August 12, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant