|
| 1 | +// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. |
| 2 | + |
| 3 | +import type { SemanticMigration } from '../../types.js'; |
| 4 | + |
| 5 | +export const entry: SemanticMigration = { |
| 6 | + id: 'standard-error-code-batch-members-retired', |
| 7 | + surface: |
| 8 | + '`error.code` values `BATCH_PARTIAL_FAILURE`, `BATCH_COMPLETE_FAILURE` and ' |
| 9 | + + '`TRANSACTION_FAILED` — three `StandardErrorCode` members retired from the closed ' |
| 10 | + + 'catalog (ADR-0112 amendment 2026-08-18), so constructing or parsing an ApiError ' |
| 11 | + + 'with any of them now refuses at the vocabulary boundary', |
| 12 | + replacement: |
| 13 | + 'branch on the codes the batch surface actually speaks: a rolled-back atomic batch ' |
| 14 | + + 'marks each row `errors[0].code = ROLLED_BACK`, rows the abort never reached ' |
| 15 | + + '`NOT_ATTEMPTED`, and the causal row keeps its own error — all per row, at HTTP ' |
| 16 | + + '200, both codes ledger-registered. Delete any branch on the three retired ' |
| 17 | + + 'spellings outright: it never fired, because nothing ever emitted them', |
| 18 | + reason: |
| 19 | + 'ADR-0049 enforce-or-remove applied to the error vocabulary. No producer has ever ' |
| 20 | + + 'emitted any of the three — measured on #9266: outside the enum declaration the ' |
| 21 | + + 'only occurrences in the whole repo were two spec tests using them as arbitrary ' |
| 22 | + + 'fixture strings, and `git log -S` shows they never had a producer since ADR-0112 ' |
| 23 | + + 'introduced the vocabulary. A catalog member no producer can speak teaches an AI ' |
| 24 | + + 'author a branch that can never fire; after removal the wrong spelling fails ' |
| 25 | + + 'parse at authoring time instead. This is a WIRE vocabulary, not stored metadata ' |
| 26 | + + '— no `sys_metadata` row exists for the D2 chain to rewrite, so (like ' |
| 27 | + + '`driver-sql-upsert-cross-row-identity-merge-refused`) this entry is the ' |
| 28 | + + 'notification channel. No mechanical rewrite exists: a dead branch has no ' |
| 29 | + + 'correct mechanical target — the per-row codes carry strictly more information ' |
| 30 | + + 'than the envelope code the branch expected. Maintainer ruling 2026-08-18: ' |
| 31 | + + '「9266 同意 A」. #9266, ADR-0112, ADR-0049.', |
| 32 | + acceptanceCriteria: |
| 33 | + 'No consumer branches on the three retired spellings; batch failure handling reads ' |
| 34 | + + 'the per-row `results[].errors[].code` (`ROLLED_BACK` / `NOT_ATTEMPTED`) instead ' |
| 35 | + + 'of an envelope-level code; constructing an ApiError with a retired spelling ' |
| 36 | + + 'fails `StandardErrorCode`/`ApiErrorSchema` parse rather than passing silently.', |
| 37 | +}; |
0 commit comments