@ai-matrx/content-ir-react 0.5.0 → 0.6.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 — 2026-08-29
4
+
5
+ - **The `raw` gate no longer strips components off unchecked payloads.**
6
+ `applyIrKindRoute`'s `kindState === "raw"` early return (added in 0.3.0 to
7
+ keep non-compliant values away from components) also caught kinds whose
8
+ schema never existed, because the kernel had one word for both. With
9
+ `@ai-matrx/content-ir` 0.4.0 those are distinct states, and only `raw` — a
10
+ value something CHECKED and rejected — is diverted to the generic floor.
11
+ `unverified` falls through to the db-component, compiled-bridge, and
12
+ resolver paths exactly as it did before 0.3.0.
13
+
14
+ This restores the render path for every kind with a component but no
15
+ reconstructable schema (~221 live kinds on 2026-08-29). The 0.3.0 protection
16
+ is unchanged for real validation failures. `broken-instance` now means only
17
+ what its name says. Requires `@ai-matrx/content-ir` >= 0.4.0.
18
+
19
+ Pinned by four new tests, including an end-to-end one that runs the real
20
+ kernel parser into the real route over a nested no-schema payload
21
+ (`__tests__/unverified-outage.test.ts`) and fails if either half regresses.
22
+
23
+ ## 0.5.1 — 2026-08-29
24
+
25
+ - **Body-less warm rows now complete through the canonical cold fetch.**
26
+ `requestComponent` treats a DB resolution with `hasComponentSource=true`
27
+ and `componentSource=null` as incomplete, fetches that kind once, replaces
28
+ the metadata shell with the heavy row, and bumps the per-kind repaint
29
+ version. Hosts no longer need resolver logic to make lazy component bodies
30
+ arrive.
31
+
3
32
  ## 0.5.0 — 2026-08-29
4
33
 
5
34
  - **`hasComponentSource` — the seam that lets component BODIES load lazily.**
package/dist/index.cjs CHANGED
@@ -221,6 +221,35 @@ var ComponentResolver = class {
221
221
  this.version += 1;
222
222
  for (const listener of this.listeners) listener();
223
223
  }
224
+ /**
225
+ * A warm metadata shell is resolved enough for routing, but not for the
226
+ * host's db-component renderer. Its body must still come from the cold
227
+ * single-kind loader.
228
+ */
229
+ needsColdFetch(kind, platform, role) {
230
+ const resolution = this.resolve(kind, platform, role);
231
+ return resolution === null || resolution.resolvedBy === "db" && resolution.hasComponentSource && resolution.componentSource === null;
232
+ }
233
+ /**
234
+ * Cold rows are the authoritative heavy form of warm metadata shells. Keep
235
+ * the same first-row-per-key winner contract, but replace an existing shell
236
+ * so `componentSource` / `propsTransform` can land and repaint the kind.
237
+ */
238
+ ingestColdRows(rows) {
239
+ const winners = /* @__PURE__ */ new Map();
240
+ for (const row of rows) {
241
+ const key = keyOf(row.kind, row.platform, row.role);
242
+ if (!winners.has(key)) winners.set(key, row);
243
+ }
244
+ if (winners.size === 0) return;
245
+ const changedKinds = /* @__PURE__ */ new Set();
246
+ for (const [key, row] of winners) {
247
+ this.db.set(key, row);
248
+ changedKinds.add(row.kind);
249
+ }
250
+ for (const kind of changedKinds) this.bumpKind(kind);
251
+ this.notifyChanged();
252
+ }
224
253
  /**
225
254
  * The eager lightweight single-kind fetch (streaming path): the moment a
226
255
  * cloud kind is identified mid-stream, pull ONLY that kind's resolver rows
@@ -231,7 +260,7 @@ var ComponentResolver = class {
231
260
  requestComponent(kind, platform, role) {
232
261
  const loadForKind = this.options.loadForKind;
233
262
  if (!loadForKind) return;
234
- if (this.resolve(kind, platform, role)) return;
263
+ if (!this.needsColdFetch(kind, platform, role)) return;
235
264
  const missKey = keyOf(kind, platform, role);
236
265
  const flightKey = `${kind}${KEY_SEPARATOR}${platform}`;
237
266
  if (this.coldInFlight.has(flightKey) || this.coldMisses.has(missKey)) {
@@ -240,8 +269,10 @@ var ComponentResolver = class {
240
269
  this.coldInFlight.add(flightKey);
241
270
  void (async () => {
242
271
  try {
243
- this.ingestDbRows(await loadForKind(kind, platform));
244
- if (!this.resolve(kind, platform, role)) this.coldMisses.add(missKey);
272
+ this.ingestColdRows(await loadForKind(kind, platform));
273
+ if (this.needsColdFetch(kind, platform, role)) {
274
+ this.coldMisses.add(missKey);
275
+ }
245
276
  } catch (error) {
246
277
  this.reportError({
247
278
  source: "content-ir",