@camstack/server 1.2.162 → 1.2.164

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1069,10 +1069,26 @@ class AddonRegistryService {
1069
1069
  // Forked addons only for now — co-located builtins would publish into the
1070
1070
  // registry directly via a hub-side sink (deferred; no builtin serves a
1071
1071
  // data-plane yet).
1072
- if (!entry || !this.isForkedAddonEntry(entry))
1073
- return;
1074
- if (childRegistry === null || !childRegistry.isChildKnown(this.childIdForAddon(addonId)))
1072
+ //
1073
+ // Each of these three exits means "this addon CANNOT serve a data-plane
1074
+ // right now", and every one of them used to leave the previous registration
1075
+ // standing. The registry then held a `baseUrl` pointing at the port of a
1076
+ // process that no longer exists, and `/addon/:addonId/*` kept reverse-
1077
+ // proxying to it — a 502 per request until the replacement child finished
1078
+ // its handshake, or forever if the addon was removed. `unregisterAddon`
1079
+ // existed for exactly this and had no call site anywhere in the repo.
1080
+ //
1081
+ // Dropping is the safe direction: a data-plane that is absent from the
1082
+ // registry falls through to the control-route path, while a stale one
1083
+ // sends live traffic at a dead socket.
1084
+ if (!(0, system_1.canServeDataPlane)({
1085
+ hasEntry: entry !== undefined,
1086
+ isForked: entry !== undefined && this.isForkedAddonEntry(entry),
1087
+ childKnown: childRegistry !== null && childRegistry.isChildKnown(this.childIdForAddon(addonId)),
1088
+ })) {
1089
+ registry.unregisterAddon(addonId);
1075
1090
  return;
1091
+ }
1076
1092
  const raw = await this.addonCallGateway.callForked(addonId, { target: 'data-planes' });
1077
1093
  const endpoints = parseDataPlaneEndpoints(raw);
1078
1094
  registry.registerAddon(addonId, endpoints);
@@ -2344,6 +2360,11 @@ class AddonRegistryService {
2344
2360
  await this.drainDisposerChain(id);
2345
2361
  }
2346
2362
  this.addonEntries.delete(id);
2363
+ // An addon that is gone from disk will never re-handshake, so nothing
2364
+ // else will ever refresh or drop its data-plane. Without this the
2365
+ // registry keeps proxying `/addon/<id>/*` at a dead port for the rest
2366
+ // of the process lifetime.
2367
+ this.dataPlaneRegistry?.unregisterAddon(id);
2347
2368
  this.logger.info('Removed addon (no longer on disk)', { tags: { addonId: id } });
2348
2369
  }
2349
2370
  }
package/dist/launcher.js CHANGED
@@ -561,6 +561,7 @@ async function launch() {
561
561
  pathSeparator: process.platform === 'win32' ? ';' : ':',
562
562
  dataDir: DATA_DIR,
563
563
  serverNodeModules: nodeModulesDir,
564
+ frameworkRoots: frameworkPaths,
564
565
  seedRoots: (0, package_inventory_js_1.seedNodeModulesRoots)(fs),
565
566
  }), {
566
567
  exists: (dir) => fs.existsSync(path.join(dir, 'package.json')),
@@ -100,8 +100,27 @@ function hostProvidedSearchRoots(input) {
100
100
  .map((p) => p.trim())
101
101
  .filter((p) => p.length > 0);
102
102
  const seedPaths = new Set(input.seedRoots);
103
+ // BOTH deposit directories are active, and calling only one of them so is how
104
+ // this guard spent every boot accusing the healthy layout.
105
+ //
106
+ // `serverNodeModules` is `@camstack/server/node_modules` — the NESTED tree,
107
+ // which resolves that package's own dependencies. The framework packages
108
+ // (`system`, `types`, `sdk`) do NOT live there: they resolve from the closure
109
+ // directory one level up, which the launcher puts on NODE_PATH and logs as
110
+ // "Framework dir on NODE_PATH". With only the nested tree marked active, the
111
+ // closure arrived through NODE_PATH and was classified `unexpected`, so on
112
+ // the live hub of 2026-08-25 the guard called the copies that actually run
113
+ // "UNEXPECTED — remove it" and, left with the baked seeds as the only
114
+ // candidates, declared them "CONFLICTS — could run" against each other.
115
+ //
116
+ // The runtime's own single-copy sweep disagreed in the same boot
117
+ // (`single-copy cleanup — 0 copy(ies) to remove`). Two checkers, one disk,
118
+ // opposite verdicts — and the one that shouts is the one that was wrong. A
119
+ // guard that fires on the healthy state is ignored when it fires on the
120
+ // broken one, which is the failure D45 exists to catch.
121
+ const activePaths = new Set([input.serverNodeModules, ...(input.frameworkRoots ?? [])]);
103
122
  const expectationFor = (dir) => {
104
- if (dir === input.serverNodeModules)
123
+ if (activePaths.has(dir))
105
124
  return 'active';
106
125
  if (seedPaths.has(dir))
107
126
  return 'seed';
@@ -109,6 +128,7 @@ function hostProvidedSearchRoots(input) {
109
128
  };
110
129
  const roots = [
111
130
  { path: input.serverNodeModules, expectation: 'active' },
131
+ ...(input.frameworkRoots ?? []).map((p) => ({ path: p, expectation: expectationFor(p) })),
112
132
  ...fromNodePath.map((p) => ({ path: p, expectation: expectationFor(p) })),
113
133
  { path: path.join(input.dataDir, 'framework', 'node_modules'), expectation: 'unexpected' },
114
134
  { path: path.join(input.dataDir, 'addons'), expectation: 'unexpected' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.162",
3
+ "version": "1.2.164",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -38,11 +38,11 @@
38
38
  "@camstack/addon-auth": "1.2.31",
39
39
  "@camstack/addon-decoder-nodeav": "1.2.27",
40
40
  "@camstack/addon-notifiers": "1.2.32",
41
- "@camstack/addon-pipeline": "1.2.125",
41
+ "@camstack/addon-pipeline": "1.2.126",
42
42
  "@camstack/addon-pipeline-orchestrator": "1.2.105",
43
- "@camstack/addon-post-analysis": "1.2.123",
43
+ "@camstack/addon-post-analysis": "1.2.124",
44
44
  "@camstack/sdk": "1.2.31",
45
- "@camstack/system": "1.2.130",
45
+ "@camstack/system": "1.2.132",
46
46
  "@camstack/types": "1.2.105",
47
47
  "@camstack/ui-library": "1.2.71",
48
48
  "@fastify/compress": "^9.0.0",