Skip to content

fix(config): give a deprecation notice from anywhere along a rename chain - #893

Merged
jdx merged 1 commit into
agent/config-derive-bindingfrom
agent/config-chain-notice
Aug 15, 2026
Merged

fix(config): give a deprecation notice from anywhere along a rename chain#893
jdx merged 1 commit into
agent/config-derive-bindingfrom
agent/config-chain-notice

Conversation

@jdx

@jdx jdx commented Aug 15, 2026

Copy link
Copy Markdown
Owner

A bug found by writing the corpus vector for a rule #882 already
stated on the page.

explain walked the chain of renames looking for a deprecation notice — a renamed to b, and b
the one carrying the notice that says to use c — with a comment explaining why. The merge read the
notice off the declaration the user wrote. So:

$ hk config explain threads
threads = 8
  deprecated: Use jobs instead.

$ hk check          # nothing at all

The quieter of the two is the one a CLI actually surfaces, so the user is told to stop using the key
only if they happen to ask about it.

Same shape as most of this stack's findings: one rule, two implementations. Fixed by moving the
walker onto Registry and having both callers ask it, rather than teaching the second one to agree.

The message still names the key that was written — threads is deprecated: Use jobs instead.
because that is the line in the file they would go and edit, not the one the notice happens to be
attached to.

Verification

A test at the merge and the corpus vector that found it. Mutating the walk back to "read the
declaration written" fails both.

AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5; version: unavailable.


Note

Low Risk
Targeted behavior fix in config resolution and explain output; covered by new tests and corpus vectors, with no auth or security surface.

Overview
Unifies deprecation discovery so config explain and config merge behave the same when a notice sits on an intermediate rename (e.g. threadsconcurrencyjobs, with deprecation on concurrency).

The rename-chain walker moves from a private helper in explain to Registry::deprecation. explain and resolve both call it. Merge no longer reads deprecated only off the declaration for the key the user wrote, which meant CLIs could stay silent while config explain still showed a deprecation.

Warnings still use the written key (threads is deprecated: …) so messages point at the line in the file users would edit.

Adds a merge unit test and corpus vector a-notice-anywhere-along-a-chain-is-reported in 04-renames.kdl.

Reviewed by Cursor Bugbot for commit a09162b. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 6df9b02b-0e5e-4011-9b4c-8971d02bf2f0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@greptile-apps

greptile-apps Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR centralizes rename-chain deprecation lookup in Registry so normal resolution and config explain emit consistent notices.

  • Adds Registry::deprecation to walk rename chains safely.
  • Uses the shared lookup while resolving deprecation warnings and explaining settings.
  • Adds unit and corpus coverage for notices attached partway through multi-hop rename chains.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
config/src/registry.rs Adds a bounded registry-level walker that returns the first deprecation notice along a rename chain.
config/src/resolve.rs Uses the shared walker when generating warnings and adds focused multi-hop rename coverage.
config/src/explain.rs Replaces the local deprecation walker with the registry implementation without changing output semantics.
corpus/config/04-renames.kdl Adds conformance coverage for a deprecation notice located midway through a rename chain.

Reviews (4): Last reviewed commit: "fix(config): give a deprecation notice f..." | Re-trigger Greptile

@jdx
jdx force-pushed the agent/config-chain-notice branch from 8db197c to d166168 Compare August 15, 2026 01:40
@jdx
jdx force-pushed the agent/config-chain-notice branch from d166168 to be1433f Compare August 15, 2026 01:45
@github-actions

github-actions Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
markdown ▂▂▃▁▇█▇▇█ 175,733,287 → 175,822,988 +0.05% 16.07 → 15.66ms -2.55%
startup █▆▆▆▇▁▁▄▅ 1,221,955 → 1,221,975 +0.00% 0.96 → 1.00ms +4.85%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

Shadow comparison

Parsing mise use -g node@20 against a shadow of mise's committed spec.
Reported, not gated: the shadow grows as the derive learns to express more, so
what to watch is the ratio rather than either column.

usage clap ratio
instructions, cold parse 72158 5893587 81x
usage: argv -> struct                            1197 ns      1.20 µs
clap: build tree + parse -> struct             504506 ns    504.51 µs
clap: parse -> struct, tree reused              23049 ns     23.05 µs
clap: build tree only                          310199 ns    310.20 µs

a09162b05813 vs b8068da1afb6 · measured on the runner, not pushed to the history.

stack merge was automatically disabled August 15, 2026 10:34

Pull Request is not mergeable

stack merge was automatically disabled August 15, 2026 10:35

Pull Request is not mergeable

…hain

Found by writing the corpus vector for a rule the page already stated. `explain`
walked the chain of renames looking for a notice — `a` renamed to `b`, and `b` the
one that says to use `c` — and the merge read the notice off the declaration the
user wrote. So `config explain threads` told a user to stop using a key that
running the CLI said nothing about, and the quieter of the two is the one a CLI
actually surfaces.

One walker now, on `Registry`, called by both. The message still names the key
that was written, since that is the line in the file they would go and edit.
@jdx
jdx force-pushed the agent/config-chain-notice branch from be1433f to a09162b Compare August 15, 2026 10:45
@jdx
jdx merged commit 228046e into main Aug 15, 2026
8 checks passed
@jdx
jdx deleted the agent/config-chain-notice branch August 15, 2026 11:00
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