Skip to content

refactor(config): rename thinking to effort with struct-tag deprecation framework#897

Merged
cpcloud merged 4 commits intomicasa-dev:mainfrom
cpcloud:worktree-fluffy-baking-quail
Apr 2, 2026
Merged

refactor(config): rename thinking to effort with struct-tag deprecation framework#897
cpcloud merged 4 commits intomicasa-dev:mainfrom
cpcloud:worktree-fluffy-baking-quail

Conversation

@cpcloud
Copy link
Copy Markdown
Collaborator

@cpcloud cpcloud commented Apr 2, 2026

Summary

  • Add struct-tag-driven config key deprecation system: a deprecated tag on the new field is the single source of truth, runtime init() derives error maps via reflection
  • Rename thinking to effort in both LLM pipeline configs (ChatLLM, ExtractionLLM), the LLM client, app layer, and CLI wiring
  • Migrate existing cache_ttl_days removal onto the same framework with deprecated_transform hint support
  • Add checkDeprecatedEnvVars() pre-scan with deterministic ordering, transform hints, and validation (duplicate paths, env var collisions)
  • Add gendeprecations code generator producing docs/data/deprecations.json from struct tags
  • Add {{< replaces >}} Hugo shortcode rendering inline deprecation badges with old key name, env var, and optional transform hint
  • Extend go-generate-check pre-push hook to cover internal/config/ and the generated JSON
  • Remove hand-maintained removedKeys and deprecatedPaths maps

@cpcloud cpcloud added the refactor Code restructuring without behavior change label Apr 2, 2026
cpcloud and others added 3 commits April 2, 2026 11:21
Design for struct-tag-driven config key deprecation: a `deprecated`
struct tag on the new field is the single source of truth. A shared
Deprecations() function walks Config{} via reflection; init() derives
removedKeys and deprecatedEnvVars maps. A code generator produces Hugo
data for docs. First use case: rename `thinking` to `effort`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…on framework

Add a struct-tag-driven deprecation system: a `deprecated` tag on the
new config field declares the old TOML key name. A shared Deprecations()
function walks Config{} via reflection; package-level var initialization
derives removedKeys and deprecatedEnvVars maps from it. Both TOML and
env var paths produce hard errors pointing to the replacement.

- Rename Thinking to Effort in ChatLLM, ExtractionLLM, llm.Client,
  app types, and CLI wiring
- Add deprecated:"thinking" tags to both Effort fields
- Migrate cache_ttl_days removal onto the same framework with
  deprecated:"cache_ttl_days" and deprecated_transform:"days_to_duration"
- Remove hand-maintained removedKeys map from validate.go
- Remove empty deprecatedPaths map and rendering logic from show.go
- Add checkDeprecatedEnvVars() pre-scan before canonical env overrides
- Comprehensive tests: tag walker, env var detection, deterministic
  ordering, panic paths, wire-level reasoning_effort assertion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rename in docs

- gendeprecations walks Config struct tags and writes
  docs/data/deprecations.json with old/new paths and transform hints
- {{< replaces >}} Hugo shortcode renders inline badges from hugo.Data
  with old key name, deprecated env var, and optional transform hint
- Replace thinking with effort + replaces badge in chat.llm and
  extraction.llm config tables
- Replace hard-coded cache_ttl_days deprecation text with shortcode
- Extend go-generate-check to cover internal/config and the JSON output
- Add docs/data/*.json to biome includes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cpcloud cpcloud force-pushed the worktree-fluffy-baking-quail branch from a655e7f to 945cd98 Compare April 2, 2026 15:22
Procedural checklist for deprecating config keys using the struct-tag
framework: add deprecated tag, update ExampleTOML, regenerate docs
data, add Hugo shortcode, update references and tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cpcloud cpcloud enabled auto-merge (squash) April 2, 2026 15:50
@cpcloud cpcloud merged commit 908bc21 into micasa-dev:main Apr 2, 2026
27 checks passed
@cpcloud cpcloud deleted the worktree-fluffy-baking-quail branch April 2, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Code restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant