8888 * identity are that function's to answer, and the refusal it returns is
8989 * reported on the row rather than re-worded here.
9090 * - **A manager problem never costs the row its identity.** The user is
91- * created either way and the failure rides `rows[].code` / `rows[].error`,
92- * exactly like the sibling post-write `INVITE_EMAIL_FAILED`; `rows[].manager`
93- * carries the machine-readable outcome in `rows[].delivery`'s shape. ⛔ Not a
94- * whole-import failure, and ⛔ not a silent skip.
91+ * created either way; `rows[].manager` carries the machine-readable outcome
92+ * in `rows[].delivery`'s shape and `rows[].error` carries the sentence.
93+ * ⛔ Not a whole-import failure, and ⛔ not a silent skip. ⛔ And no
94+ * `rows[].code` — see {@link noteManagerFailure} for why that half is fenced
95+ * out of this lane rather than forgotten.
9596 * - **The pass does not run on `dryRun`.** It is a post-write pass like
9697 * delivery: with nothing created there are no ids to link, and the five
9798 * refusals cannot be evaluated against rows that do not exist. A dry run
@@ -331,23 +332,36 @@ export interface IdentityImportRowResult extends ImportRowResult {
331332/**
332333 * Stamp a row's manager failure.
333334 *
334- * `manager` is ALWAYS set — that is this outcome's own channel. `code`/`error`
335- * is the SHARED row error channel the sibling `INVITE_EMAIL_FAILED` also writes
336- * to, so it is claimed only when free: a row whose invitation already failed
337- * keeps that report and still carries its manager verdict on `manager`,
338- * ⛔ rather than one of the two failures overwriting the other into silence.
335+ * `manager` is ALWAYS set — that is this outcome's own channel, and it is the
336+ * machine-readable one: `'unresolved'` and each refusal `reason` are distinct
337+ * members of {@link ImportManagerOutcome}, so a caller discriminates on one
338+ * field without parsing a sentence.
339+ *
340+ * ⛔ NO `rows[].code` IS STAMPED, and that is a fence rather than an oversight.
341+ * The sibling post-write failure writes `code: 'INVITE_EMAIL_FAILED'`, and a
342+ * matching `MANAGER_UNRESOLVED` / `MANAGER_REFUSED` pair would read as the
343+ * obvious symmetry — but `check:dispatcher-error-vocabulary` refuses a code
344+ * this package's `packages/spec` ledger entry does not register, and
345+ * registering one is a `packages/spec` edit this lane is fenced out of
346+ * (the closed-vocabulary question for this endpoint's refusals is already
347+ * carried by #17995). So the failure rides `error` — the human half — and
348+ * `manager` — the machine half — and the row-level code is left to the seat
349+ * that owns the vocabulary. ⛔ Reaching for an already-registered code whose
350+ * meaning is something else would be the lenient alias Prime Directive #12
351+ * refuses.
352+ *
353+ * `error` is the SHARED row channel that sibling also writes to, so it is
354+ * claimed only when free: a row whose invitation already failed keeps that
355+ * report and still carries its manager verdict on `manager`, ⛔ rather than one
356+ * of the two failures overwriting the other into silence.
339357 */
340358function noteManagerFailure (
341359 row : IdentityImportRowResult ,
342360 outcome : ImportManagerOutcome ,
343- code : string ,
344361 message : string ,
345362) : void {
346363 row . manager = outcome ;
347- if ( row . code === undefined ) {
348- row . code = code ;
349- row . error = message ;
350- }
364+ if ( row . error === undefined ) row . error = message ;
351365}
352366
353367/**
@@ -724,7 +738,6 @@ export async function runAdminImportUsers(
724738 noteManagerFailure (
725739 r ,
726740 'unresolved' ,
727- 'MANAGER_UNRESOLVED' ,
728741 `The ${ MANAGER_COLUMN } cell is neither an email address nor a phone number this deployment `
729742 + 'can read, so it names no identity. This row landed; only its manager link did not.' ,
730743 ) ;
@@ -763,7 +776,6 @@ export async function runAdminImportUsers(
763776 noteManagerFailure (
764777 r ,
765778 'unresolved' ,
766- 'MANAGER_UNRESOLVED' ,
767779 `No user matches this row's ${ MANAGER_COLUMN } key, in this import or already in the `
768780 + 'directory, so the manager link was not written. The rest of this row landed.' ,
769781 ) ;
@@ -786,15 +798,14 @@ export async function runAdminImportUsers(
786798 noteManagerFailure (
787799 r ,
788800 'unresolved' ,
789- 'MANAGER_UNRESOLVED' ,
790801 `The manager link could not be written: ${ ( e as Error ) ?. message ?? String ( e ) } . `
791802 + 'This row itself landed.' ,
792803 ) ;
793804 managerLinks . unresolved ++ ;
794805 continue ;
795806 }
796807 if ( refusal ) {
797- noteManagerFailure ( r , refusal . reason , 'MANAGER_REFUSED' , refusal . message ) ;
808+ noteManagerFailure ( r , refusal . reason , refusal . message ) ;
798809 managerLinks . refused ++ ;
799810 continue ;
800811 }
0 commit comments