Skip to content

seed-loader interpolates driver text into errors[].message, which rides on seedApplied of a 200 publish response #8442

Description

@os-zhuang

Filed by the dev on #8333 while landing the P6–P13 producer sweep (PR #8436). Unassigned; nobody is on it. Outside that card's scope: #8333 enumerates eight producers in protocol.ts, and this is a different file reached through one of them.

The measurement

#8333's P9 is applySeedBodies' error field, now withheld. But the same response object carries a second channel, errors[], which the seed loader fills itself — and that one still interpolates the caught driver text.

Reproduced end to end (a sys_metadata outage under a real applySeedBodies call), the returned seedApplied:

{
"success": false,
"inserted": 0,
"updated": 0,
"errors": [
{
"sourceObject": "acct",
"field": "(write)",
"targetObject": "acct",
"targetField": "name",
"attemptedValue": null,
"recordIndex": 0,
"message": "Failed to write acct record #0 (name=): SQLITE_ERROR: no such table: sys_metadata"
}
]
}

Producers, read from source in packages/metadata-protocol/src/seed-loader.ts:

  • line ~1670 — message: `Failed to write ${objectName} record #${recordIndex} (${label}=${keyValue}): ${message}`
  • line ~1177 — the deferred-reference counterpart, `Failed to write deferred reference: … ${err?.message ?? String(err)}`

seedApplied rides on a 200 publish response (publishMetaItem, publishPackageDrafts, and the runtime package door), so no HTTP boundary's 5xx message withhold reaches it — the same argument #8086 made for fixing option C at the producer.

The tension a taker must resolve, and why this is not a mechanical repeat of #8333

errors[] is not the error string. Its entries are structured, per-record authoring feedback — which object, which record index, which field, what value was attempted — and that is exactly what an author fixing a broken seed needs (build-probes.ts tells the user to "check the publish response's seedApplied for the load error"). So the #8333 rule cannot simply be applied: the driver's sentence is the only part that must go, and the located structure must stay.

The likely shape is to keep every structured key and replace only the interpolated tail, with the driver text going to the log — but that is a judgement about an authoring surface and should be measured per producer the way #8333's step 1 was, not assumed.

Related

#8333 (the eight protocol.ts producers, PR #8436) · #8136 · #8086


Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions