Commit 7e20f7e
fix(astro): SDK preflight check + implicit-mode default to opt out of inherited public_paths
Kychon's v1.2.0 re-test surfaced two issues neither the helper nor the
gateway-side work caught:
1. SDK version mismatch surfaced as a misleading error.
The helper emits `class: 'ssr'` (gateway v1.52+ field). `@run402/sdk`
versions older than 2.18.0 don't include `class` in their local
`FUNCTION_SPEC_FIELDS` allowlist, so `validateKnownFields` rejects
the spec LOCALLY before any network call with the message
"Unknown ReleaseSpec field: functions.replace.<name>.class". The
error looks gateway-shaped (phase: "validate") but doesn't carry a
trace_id — that's because there's never been a request.
Fix: bumped peerDep `@run402/sdk` from `>=2.3` to `>=2.18.0`, and
added a runtime preflight (`assertSdkSupportsClassField`) that reads
`@run402/sdk/package.json` via createRequire and throws a precise
`Run402AstroSdkVersionError` with the installed vs required versions
and an actionable suggestedFix
(`npm install @run402/sdk@latest run402@latest`).
2. Inherited explicit public_paths blocked the deploy AFTER the class
field landed.
The gateway's `resolvePublicPathMode` carries the prior release's
public-paths mode forward when the new release doesn't declare one
(`stable-host-resolver`'s `inheritedDirectPublicEntries`). Kychon's
prior release used `mode: "explicit"` with many declared paths
including `.well-known/kychon.json`; the slice's new (minimal) site
dir didn't carry those exact assets, triggering
`site.public_paths.inherited./.well-known/kychon.json` missing-asset
rejections.
Fix: default `site.public_paths: { mode: "implicit" }` — opts the
new release out of the explicit-mode carry-forward. Astro's natural
build shape is filename-URL congruent, so implicit reachability is
semantically correct. The gateway emits a `PUBLIC_PATH_MODE_WIDENS_TO_IMPLICIT`
warning (severity: warn, requires_confirmation: true) so the
transition is auditable. Callers who need explicit per-path control
pass `cacheClass`, which still produces a fully-declared explicit map.
Verification:
- 243 astro unit tests pass.
- 30 SSR-astro e2e assertions pass.
- End-to-end smoke against api.run402.com on Kychon's actual project
(`prj_1776162950442_0031`) reached plan.diff with class:'ssr'
accepted and only expected destructive-removal + mode-widen
confirmation warnings.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fbdf977 commit 7e20f7e
3 files changed
Lines changed: 134 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
255 | 264 | | |
256 | | - | |
| 265 | + | |
257 | 266 | | |
258 | | - | |
| 267 | + | |
259 | 268 | | |
260 | 269 | | |
261 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
| |||
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
81 | 177 | | |
82 | 178 | | |
83 | 179 | | |
| |||
232 | 328 | | |
233 | 329 | | |
234 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
235 | 339 | | |
236 | 340 | | |
237 | 341 | | |
| |||
242 | 346 | | |
243 | 347 | | |
244 | 348 | | |
245 | | - | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
246 | 366 | | |
247 | 367 | | |
248 | 368 | | |
| |||
0 commit comments