Skip to content

fix(registry): gate baked registry accessor in release builds - #11594

Merged
jdx merged 1 commit into
mainfrom
agent/fix-baked-registry-warning
Aug 1, 2026
Merged

jdx merged 1 commit into
mainfrom
agent/fix-baked-registry-warning

Conversation

@jdx

@jdx jdx commented Aug 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • compile baked_registry() only when debug assertions are enabled
  • align the helper with its sole consumer, the debug-only render-help command

Root cause

Release builds exclude render-help but still compiled its dedicated registry accessor, causing a dead_code warning.

Impact

Release builds no longer emit the unused baked_registry warning. Runtime registry behavior is unchanged.

Validation

  • mise run lint-fix
  • cargo check --release --all-features
  • cargo check --all-features
  • git diff --check

AI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.


Note

Low Risk
Compile-time cfg only; no change to release runtime registry behavior.

Overview
Adds #[cfg(debug_assertions)] around baked_registry() so release builds no longer compile that helper.

The function is only used by the debug-only render-help flow (idiomatic version files table). REGISTRY and BAKED_REGISTRY are unchanged; this is a compile-time cleanup to silence dead_code in cargo check --release.

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

Summary by CodeRabbit

  • Performance
    • Reduced release-build overhead by excluding development-only registry data from production builds.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 03a00d28-674e-4189-ac01-aa91778d764c

📥 Commits

Reviewing files that changed from the base of the PR and between 4bd4185 and 02302df.

📒 Files selected for processing (1)
  • src/registry.rs

📝 Walkthrough

Walkthrough

The baked-registry accessor in src/registry.rs now compiles only in debug builds through #[cfg(debug_assertions)].

Changes

Debug registry compilation

Layer / File(s) Summary
Gate baked registry accessor
src/registry.rs
The baked-registry accessor is conditionally compiled when debug assertions are enabled.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: risu729

Poem

A rabbit checks the registry gate,
Debug builds hop in through the crate.
Release builds pass by,
With no baked code nearby,
One small attribute keeps things straight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes gating the baked registry accessor out of release builds, which matches the main change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR conditionally compiles the dedicated baked-registry accessor only in debug builds, matching its sole consumer and removing a release-build dead-code warning.

  • Adds #[cfg(debug_assertions)] to baked_registry().
  • Leaves the production REGISTRY path and baked registry data unchanged.

Confidence Score: 5/5

The PR appears safe to merge because the accessor and all of its consumers share the same debug-only compilation boundary.

The only call to baked_registry() is within the debug-gated render_help module, while release registry behavior continues to use the unchanged always-compiled REGISTRY path.

Important Files Changed

Filename Overview
src/registry.rs The accessor now uses the same debug-only compilation boundary as its sole caller; production registry behavior remains available through the unchanged REGISTRY static.

Reviews (1): Last reviewed commit: "fix(registry): gate baked registry acces..." | Re-trigger Greptile

@jdx
jdx enabled auto-merge (squash) August 1, 2026 20:14
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ▂▁▂▁▅▆▄▃█▇▆▇▄▅▆▆█ 84,800,951 → 84,831,827 +0.04% 20.13 → 18.77ms -6.77%
hook-env ▄▁▆▅▆▆▅▄▇█▇▇▅▆▆▆█ 87,123,100 → 87,191,719 +0.08% 20.55 → 19.07ms -7.20%
ls ▂▁▄▅▆▅▃▃▇▆▆▆▅▆▅▆█ 76,712,060 → 76,800,031 +0.11% 17.17 → 16.23ms -5.51%
registry ▁█▄▂▃▃▆▅▄▄██▇███▅ 50,433,521 → 50,323,032 -0.22% 12.34 → 11.08ms -10.20%
startup ▁▁▇▆▇▇█▇█▇████▇██ 16,102,016 → 16,100,362 -0.01% 8.81 → 8.51ms -3.39%

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.

02302df959cb vs 4bd4185b65ce · measured on the runner, not pushed to the history.

@jdx
jdx merged commit 874ac4b into main Aug 1, 2026
30 checks passed
@jdx
jdx deleted the agent/fix-baked-registry-warning branch August 1, 2026 20:31
This was referenced Aug 1, 2026
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