Skip to content

Commit 11c38dd

Browse files
committed
fix(hud,landing): narrow fallback imports + bump next to 16.2.3
Combined Wave 0 polish items from the #1465/#1485 review cycle: 1. Narrow `except Exception` → `except ImportError` in the 3 lib fallback import blocks (qual-1465 HIGH-1). Real logic bugs (SyntaxError, NameError, AttributeError) inside lib modules now surface immediately instead of being silently swallowed by a catch-all. 2. Drop inline stub functions for `format_rate_limits` and `_get_fresh_version` (qual-1465 HIGH-2). Eliminates the signature drift between canonical lib definitions and in-file fallback stubs observed on the integrator branch (Wave 1-A `plugin_json_file` kwarg drift). The outer main() try/except still catches any runtime failure and emits the minimal "◕‿◕ CodingBuddy" safe output via the BUDDY_FACE constant. 3. Hoist `hud_velocity` + `hud_cache_savings` imports to module top as `_format_velocity_segment` / `_format_cache_savings` (perf-1485 H1). Eliminates ~0.47μs sys.modules lookup per render. Integrator branch only — no-op on refactor/wave branches where the inline imports don't exist yet. 4. Bump next to 16.2.3 for GHSA-q4gf-8mx6-v5v3 (landing-security-check). Aligns eslint-config-next and updates setup.test.ts assertion. Refs: qual-1465 HIGH-1/2, perf-1485 H1, GHSA-q4gf-8mx6-v5v3
1 parent de622cc commit 11c38dd

4 files changed

Lines changed: 197 additions & 21 deletions

File tree

apps/landing-page/__tests__/setup.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe('Next.js 16 Project Setup', () => {
88
});
99

1010
test('Next.js 16.x is installed and locked', () => {
11-
expect(pkg.dependencies.next).toBe('16.1.6');
11+
expect(pkg.dependencies.next).toBe('16.2.3');
1212
});
1313

1414
test('React 19.x is installed and locked', () => {

apps/landing-page/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"class-variance-authority": "^0.7.1",
3333
"clsx": "^2.1.1",
3434
"lucide-react": "^0.563.0",
35-
"next": "16.1.6",
35+
"next": "16.2.3",
3636
"next-intl": "^4.8.2",
3737
"next-themes": "^0.4.6",
3838
"prism-react-renderer": "^2.4.1",
@@ -56,7 +56,7 @@
5656
"axe-core": "^4.11.1",
5757
"babel-plugin-react-compiler": "1.0.0",
5858
"eslint": "^9",
59-
"eslint-config-next": "16.1.6",
59+
"eslint-config-next": "16.2.3",
6060
"happy-dom": "^20.8.8",
6161
"jest-axe": "^10.0.0",
6262
"madge": "^8.0.0",

packages/claude-code-plugin/hooks/codingbuddy-hud.py

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,40 @@
2323
sys.path.insert(0, _LIB_DIR)
2424

2525
# === test_hud.py compatibility re-exports — DO NOT REMOVE without coordinated test update ===
26-
# Defensive fallback: statusLine is a hot path invoked by Claude Code on
27-
# every render. If any lib module is temporarily broken (e.g. mid-wave
28-
# refactor), fall back to minimal inline implementations so the status
29-
# bar still renders instead of crashing the Claude Code subprocess.
26+
# Narrow the fallback to ImportError only: real logic bugs in lib modules
27+
# (SyntaxError, NameError, AttributeError) must surface immediately instead
28+
# of being silently swallowed by a catch-all. If a lib module fails to import
29+
# entirely, the outer main() try/except at the bottom of this file still
30+
# emits the minimal safe output via the BUDDY_FACE constant.
3031
try:
3132
from hud_buddy import BUDDY_FACE # canonical SSoT via tiny_actor_presets
32-
except Exception: # pragma: no cover - defensive
33-
BUDDY_FACE = "\u25d5\u203f\u25d5" # ◕‿◕
33+
except ImportError: # pragma: no cover - defensive
34+
BUDDY_FACE = "◕‿◕" # minimal constant for safe-output path
3435

3536
try:
36-
from hud_rate_limits import format_rate_limits
37-
except Exception: # pragma: no cover - defensive
38-
def format_rate_limits(stdin_data: dict) -> str: # type: ignore[misc]
39-
return ""
37+
from hud_rate_limits import format_rate_limits # noqa: F401 re-exported for test_hud.py
38+
except ImportError: # pragma: no cover - defensive
39+
pass # main() catch-all handles absence
4040

4141
try:
4242
from hud_version import get_fresh_version as _get_fresh_version # backcompat alias
43-
except Exception: # pragma: no cover - defensive
44-
def _get_fresh_version( # type: ignore[misc]
45-
hud_state: dict, *, plugins_file: str = ""
46-
) -> str:
47-
return hud_state.get("version", "")
43+
except ImportError: # pragma: no cover - defensive
44+
pass # main() catch-all handles absence
45+
46+
# Wave 2-B velocity + Wave 2-C cache savings hot-path suffixes for the cost segment.
47+
# Hoisted to module top per perf-1485 H1 so format_status_line avoids a
48+
# sys.modules lookup on every render (~0.47μs saved per call).
49+
try:
50+
from hud_velocity import format_velocity_segment as _format_velocity_segment
51+
except ImportError: # pragma: no cover - defensive
52+
def _format_velocity_segment(stdin_data, hud_state=None): # type: ignore[misc]
53+
return ""
54+
55+
try:
56+
from hud_cache_savings import format_cache_savings as _format_cache_savings
57+
except ImportError: # pragma: no cover - defensive
58+
def _format_cache_savings(stdin_data): # type: ignore[misc]
59+
return ""
4860

4961
# Agent eye glyphs from .ai-rules agent definitions.
5062
AGENT_GLYPHS = {

yarn.lock

Lines changed: 167 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,13 @@ __metadata:
15611561
languageName: node
15621562
linkType: hard
15631563

1564+
"@next/env@npm:16.2.3":
1565+
version: 16.2.3
1566+
resolution: "@next/env@npm:16.2.3"
1567+
checksum: 10c0/56c3fee8ea226efe59ef065e054380f872c00c45c9fe4475eaa45f80773c3c1adc3ead3ccdd77447d3c1aeb4b3004aaaa033dd4a100d3e572fd01b83f992dde8
1568+
languageName: node
1569+
linkType: hard
1570+
15641571
"@next/eslint-plugin-next@npm:16.1.6":
15651572
version: 16.1.6
15661573
resolution: "@next/eslint-plugin-next@npm:16.1.6"
@@ -1570,62 +1577,127 @@ __metadata:
15701577
languageName: node
15711578
linkType: hard
15721579

1580+
"@next/eslint-plugin-next@npm:16.2.3":
1581+
version: 16.2.3
1582+
resolution: "@next/eslint-plugin-next@npm:16.2.3"
1583+
dependencies:
1584+
fast-glob: "npm:3.3.1"
1585+
checksum: 10c0/be881aa89e0840ab60455b07a2bb9ec0d686c664a0d91e8ca815797a65ca71d7bd79d186b0df5b6892c2bf57bd07fa05421cd93e2812dfeaedfad5ed9fd1023e
1586+
languageName: node
1587+
linkType: hard
1588+
15731589
"@next/swc-darwin-arm64@npm:16.1.6":
15741590
version: 16.1.6
15751591
resolution: "@next/swc-darwin-arm64@npm:16.1.6"
15761592
conditions: os=darwin & cpu=arm64
15771593
languageName: node
15781594
linkType: hard
15791595

1596+
"@next/swc-darwin-arm64@npm:16.2.3":
1597+
version: 16.2.3
1598+
resolution: "@next/swc-darwin-arm64@npm:16.2.3"
1599+
conditions: os=darwin & cpu=arm64
1600+
languageName: node
1601+
linkType: hard
1602+
15801603
"@next/swc-darwin-x64@npm:16.1.6":
15811604
version: 16.1.6
15821605
resolution: "@next/swc-darwin-x64@npm:16.1.6"
15831606
conditions: os=darwin & cpu=x64
15841607
languageName: node
15851608
linkType: hard
15861609

1610+
"@next/swc-darwin-x64@npm:16.2.3":
1611+
version: 16.2.3
1612+
resolution: "@next/swc-darwin-x64@npm:16.2.3"
1613+
conditions: os=darwin & cpu=x64
1614+
languageName: node
1615+
linkType: hard
1616+
15871617
"@next/swc-linux-arm64-gnu@npm:16.1.6":
15881618
version: 16.1.6
15891619
resolution: "@next/swc-linux-arm64-gnu@npm:16.1.6"
15901620
conditions: os=linux & cpu=arm64 & libc=glibc
15911621
languageName: node
15921622
linkType: hard
15931623

1624+
"@next/swc-linux-arm64-gnu@npm:16.2.3":
1625+
version: 16.2.3
1626+
resolution: "@next/swc-linux-arm64-gnu@npm:16.2.3"
1627+
conditions: os=linux & cpu=arm64 & libc=glibc
1628+
languageName: node
1629+
linkType: hard
1630+
15941631
"@next/swc-linux-arm64-musl@npm:16.1.6":
15951632
version: 16.1.6
15961633
resolution: "@next/swc-linux-arm64-musl@npm:16.1.6"
15971634
conditions: os=linux & cpu=arm64 & libc=musl
15981635
languageName: node
15991636
linkType: hard
16001637

1638+
"@next/swc-linux-arm64-musl@npm:16.2.3":
1639+
version: 16.2.3
1640+
resolution: "@next/swc-linux-arm64-musl@npm:16.2.3"
1641+
conditions: os=linux & cpu=arm64 & libc=musl
1642+
languageName: node
1643+
linkType: hard
1644+
16011645
"@next/swc-linux-x64-gnu@npm:16.1.6":
16021646
version: 16.1.6
16031647
resolution: "@next/swc-linux-x64-gnu@npm:16.1.6"
16041648
conditions: os=linux & cpu=x64 & libc=glibc
16051649
languageName: node
16061650
linkType: hard
16071651

1652+
"@next/swc-linux-x64-gnu@npm:16.2.3":
1653+
version: 16.2.3
1654+
resolution: "@next/swc-linux-x64-gnu@npm:16.2.3"
1655+
conditions: os=linux & cpu=x64 & libc=glibc
1656+
languageName: node
1657+
linkType: hard
1658+
16081659
"@next/swc-linux-x64-musl@npm:16.1.6":
16091660
version: 16.1.6
16101661
resolution: "@next/swc-linux-x64-musl@npm:16.1.6"
16111662
conditions: os=linux & cpu=x64 & libc=musl
16121663
languageName: node
16131664
linkType: hard
16141665

1666+
"@next/swc-linux-x64-musl@npm:16.2.3":
1667+
version: 16.2.3
1668+
resolution: "@next/swc-linux-x64-musl@npm:16.2.3"
1669+
conditions: os=linux & cpu=x64 & libc=musl
1670+
languageName: node
1671+
linkType: hard
1672+
16151673
"@next/swc-win32-arm64-msvc@npm:16.1.6":
16161674
version: 16.1.6
16171675
resolution: "@next/swc-win32-arm64-msvc@npm:16.1.6"
16181676
conditions: os=win32 & cpu=arm64
16191677
languageName: node
16201678
linkType: hard
16211679

1680+
"@next/swc-win32-arm64-msvc@npm:16.2.3":
1681+
version: 16.2.3
1682+
resolution: "@next/swc-win32-arm64-msvc@npm:16.2.3"
1683+
conditions: os=win32 & cpu=arm64
1684+
languageName: node
1685+
linkType: hard
1686+
16221687
"@next/swc-win32-x64-msvc@npm:16.1.6":
16231688
version: 16.1.6
16241689
resolution: "@next/swc-win32-x64-msvc@npm:16.1.6"
16251690
conditions: os=win32 & cpu=x64
16261691
languageName: node
16271692
linkType: hard
16281693

1694+
"@next/swc-win32-x64-msvc@npm:16.2.3":
1695+
version: 16.2.3
1696+
resolution: "@next/swc-win32-x64-msvc@npm:16.2.3"
1697+
conditions: os=win32 & cpu=x64
1698+
languageName: node
1699+
linkType: hard
1700+
16291701
"@nodelib/fs.scandir@npm:2.1.5":
16301702
version: 2.1.5
16311703
resolution: "@nodelib/fs.scandir@npm:2.1.5"
@@ -5276,6 +5348,15 @@ __metadata:
52765348
languageName: node
52775349
linkType: hard
52785350

5351+
"baseline-browser-mapping@npm:^2.9.19":
5352+
version: 2.10.17
5353+
resolution: "baseline-browser-mapping@npm:2.10.17"
5354+
bin:
5355+
baseline-browser-mapping: dist/cli.cjs
5356+
checksum: 10c0/e792a92a6b206521681e3ab3a72770023f74a3274450bfe11ba55a075ba26f5820d5d2d02d92e25224b8d01e327b78fbf3e116bdc6ac74b3d9c52f5e3f4a048a
5357+
languageName: node
5358+
linkType: hard
5359+
52795360
"better-sqlite3@npm:^11.9.1":
52805361
version: 11.10.0
52815362
resolution: "better-sqlite3@npm:11.10.0"
@@ -7028,6 +7109,29 @@ __metadata:
70287109
languageName: node
70297110
linkType: hard
70307111

7112+
"eslint-config-next@npm:16.2.3":
7113+
version: 16.2.3
7114+
resolution: "eslint-config-next@npm:16.2.3"
7115+
dependencies:
7116+
"@next/eslint-plugin-next": "npm:16.2.3"
7117+
eslint-import-resolver-node: "npm:^0.3.6"
7118+
eslint-import-resolver-typescript: "npm:^3.5.2"
7119+
eslint-plugin-import: "npm:^2.32.0"
7120+
eslint-plugin-jsx-a11y: "npm:^6.10.0"
7121+
eslint-plugin-react: "npm:^7.37.0"
7122+
eslint-plugin-react-hooks: "npm:^7.0.0"
7123+
globals: "npm:16.4.0"
7124+
typescript-eslint: "npm:^8.46.0"
7125+
peerDependencies:
7126+
eslint: ">=9.0.0"
7127+
typescript: ">=3.3.1"
7128+
peerDependenciesMeta:
7129+
typescript:
7130+
optional: true
7131+
checksum: 10c0/c6fd3accadb53c636f034baf4363d22847bf824c8ca1ecfa8047a4eee7882d156e75f60f37098357c7ae07e646dfaa23a176336abd3c74aa9a2df61aee984653
7132+
languageName: node
7133+
linkType: hard
7134+
70317135
"eslint-config-prettier@npm:10.1.8":
70327136
version: 10.1.8
70337137
resolution: "eslint-config-prettier@npm:10.1.8"
@@ -8942,12 +9046,12 @@ __metadata:
89429046
class-variance-authority: "npm:^0.7.1"
89439047
clsx: "npm:^2.1.1"
89449048
eslint: "npm:^9"
8945-
eslint-config-next: "npm:16.1.6"
9049+
eslint-config-next: "npm:16.2.3"
89469050
happy-dom: "npm:^20.8.8"
89479051
jest-axe: "npm:^10.0.0"
89489052
lucide-react: "npm:^0.563.0"
89499053
madge: "npm:^8.0.0"
8950-
next: "npm:16.1.6"
9054+
next: "npm:16.2.3"
89519055
next-intl: "npm:^4.8.2"
89529056
next-themes: "npm:^0.4.6"
89539057
prettier: "npm:^3.4.2"
@@ -9858,6 +9962,66 @@ __metadata:
98589962
languageName: node
98599963
linkType: hard
98609964

9965+
"next@npm:16.2.3":
9966+
version: 16.2.3
9967+
resolution: "next@npm:16.2.3"
9968+
dependencies:
9969+
"@next/env": "npm:16.2.3"
9970+
"@next/swc-darwin-arm64": "npm:16.2.3"
9971+
"@next/swc-darwin-x64": "npm:16.2.3"
9972+
"@next/swc-linux-arm64-gnu": "npm:16.2.3"
9973+
"@next/swc-linux-arm64-musl": "npm:16.2.3"
9974+
"@next/swc-linux-x64-gnu": "npm:16.2.3"
9975+
"@next/swc-linux-x64-musl": "npm:16.2.3"
9976+
"@next/swc-win32-arm64-msvc": "npm:16.2.3"
9977+
"@next/swc-win32-x64-msvc": "npm:16.2.3"
9978+
"@swc/helpers": "npm:0.5.15"
9979+
baseline-browser-mapping: "npm:^2.9.19"
9980+
caniuse-lite: "npm:^1.0.30001579"
9981+
postcss: "npm:8.4.31"
9982+
sharp: "npm:^0.34.5"
9983+
styled-jsx: "npm:5.1.6"
9984+
peerDependencies:
9985+
"@opentelemetry/api": ^1.1.0
9986+
"@playwright/test": ^1.51.1
9987+
babel-plugin-react-compiler: "*"
9988+
react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
9989+
react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
9990+
sass: ^1.3.0
9991+
dependenciesMeta:
9992+
"@next/swc-darwin-arm64":
9993+
optional: true
9994+
"@next/swc-darwin-x64":
9995+
optional: true
9996+
"@next/swc-linux-arm64-gnu":
9997+
optional: true
9998+
"@next/swc-linux-arm64-musl":
9999+
optional: true
10000+
"@next/swc-linux-x64-gnu":
10001+
optional: true
10002+
"@next/swc-linux-x64-musl":
10003+
optional: true
10004+
"@next/swc-win32-arm64-msvc":
10005+
optional: true
10006+
"@next/swc-win32-x64-msvc":
10007+
optional: true
10008+
sharp:
10009+
optional: true
10010+
peerDependenciesMeta:
10011+
"@opentelemetry/api":
10012+
optional: true
10013+
"@playwright/test":
10014+
optional: true
10015+
babel-plugin-react-compiler:
10016+
optional: true
10017+
sass:
10018+
optional: true
10019+
bin:
10020+
next: dist/bin/next
10021+
checksum: 10c0/8a9d27fc773d69f7f471cf1a23bde2ab2950e0411ef3e0d5c1664ed9654e94c3304eae1c4283ec0fa4e70e7b3f4416913350e118e0c18e8b055693dc5d021883
10022+
languageName: node
10023+
linkType: hard
10024+
986110025
"node-abi@npm:^3.3.0":
986210026
version: 3.89.0
986310027
resolution: "node-abi@npm:3.89.0"
@@ -11302,7 +11466,7 @@ __metadata:
1130211466
languageName: node
1130311467
linkType: hard
1130411468

11305-
"sharp@npm:^0.34.4":
11469+
"sharp@npm:^0.34.4, sharp@npm:^0.34.5":
1130611470
version: 0.34.5
1130711471
resolution: "sharp@npm:0.34.5"
1130811472
dependencies:

0 commit comments

Comments
 (0)