Repository navigation
chore: remove dead/redundant code + fix stale docs - #86
Conversation
Found via an adversarially-verified dead-code audit; all changes behavior-neutral (telemetry-gate golden diff unchanged, harness tests 20/20, plugin validate ✔). Dead / redundant code: - jwt.getEndpointFromToken: the `getEndpointFromToken(t) || getEndpointFromTokenAllowExpired(t)` pattern (transfer.js) always equals the right operand — both read the same `telemetry_endpoint` claim; the left's expiry gate was already defeated by the fallback. Replaced both sites with getEndpointFromTokenAllowExpired and deleted the now-unused getEndpointFromToken (+ export + import). - config.isColorEnabled: dead export — its only consumer went away when the banners became plain (no ANSI). Removed the function + export. - license-activation: the `force` param on ensureFreshLicense/shouldRefresh was always false after the 401/403 retry ladder was removed, which also made the STALE_MS branch redundant (subsumed by the cooldown check). Dropped `force`, collapsed shouldRefresh, and removed LICENSE_REFRESH_STALE_MS (+ export). Verified identical decisions for all force=false inputs. Stale docs/comments (described removed client-side org-scoping): - README "Repo-Scoped Filtering": rewrote the opening paragraph — the org comes from the license JWT, not a client-fetched/persisted allow-list. - repo-scope.js module JSDoc: match on the JWT-validated org, not signin-time membership capture. - credstore.signOut comment: clarify allowed_github_orgs delete is legacy cleanup. Deferred (need their own reviewed pass): duplicate-helper consolidation (readStdin, atomic JSON write, timestamp, findGitRoot/findRepoRoot, etc.). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
WalkthroughThis PR shifts telemetry org-eligibility gating from a stored GitHub org allow-list (captured at sign-in) to reliance on the ChangesJWT-driven org scoping and refresh simplification
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Cleanup from an adversarially-verified dead-code audit. Every change is behavior-neutral — the telemetry-gate golden diff is unchanged, harness tests pass 20/20, and
claude plugin validatepasses.Dead / redundant code removed
jwt.getEndpointFromToken—getEndpointFromToken(t) || getEndpointFromTokenAllowExpired(t)(transfer.js, 2 sites) always equals the right operand: both read the sametelemetry_endpointclaim, and the left call's expiry gate was already defeated by the||fallback. Replaced both sites withgetEndpointFromTokenAllowExpired; deleted the now-unusedgetEndpointFromToken(+ export + import).config.isColorEnabled— dead export; its only consumer disappeared when the banners became plain (no ANSI, since thesystemMessagerenderer prints escapes literally). Removed function + export.license-activationforceparam +LICENSE_REFRESH_STALE_MS—forcewas alwaysfalseafter the 401/403 retry ladder was removed, which made theSTALE_MSbranch redundant (subsumed by the 60s cooldown check). Droppedforce, collapsedshouldRefresh, removedLICENSE_REFRESH_STALE_MS(+ export). Verified identical decisions across allforce=falseinputs.Stale docs/comments fixed
These still described the removed client-side org-scoping:
repo-scope.jsmodule JSDoc → matches on the JWT-validated org, not signin-time membership capture.credstore.signOutcomment → clarifies theallowed_github_orgsdelete is legacy-key cleanup.Deferred
Duplicate-helper consolidation (readStdin, atomic JSON write, timestamp helpers,
findGitRoot/findRepoRoot, JWT-expiry helpers, etc.) — real but larger "extract shared helper" refactors that deserve their own reviewed pass with a golden-diff check.Verification
shouldRefreshdecision table verified unchanged for allforce=falseinputs.node --test skillmeter/test/harness.test.js→ 20/20;claude plugin validate skillmeter→ ✔.🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Bug Fixes