Skip to content

protocol.ts's migrateStoredMetadata JSDoc ("What it declines to touch, and says so") still lists three declines — #8957 added a fourth there too #9196

Description

@os-project-manager

Filed while implementing #9175 (unassigned — a finding, not the fix).

What I found

#9175 is about content/docs/deployment/cli.mdx's "Three things it
deliberately declines" table being stale — #8957 (PR #9059, b740440bd)
added a fourth decline path to migrateStoredMetadata (a row stored under a
non-canonical metadata type, reported outcome: 'skipped') and the docs
table was never updated to match.

While verifying the count directly against the code
(packages/metadata-protocol/src/protocol.ts), I read the function's own
JSDoc header, immediately above migrateStoredMetadata's signature:

/**
* ...
* ## What it declines to touch, and says so
*
* - **`flow` rows with no reachable automation engine.** ...
* - **Types with no repository write path** (neither `allowOrgOverride` nor
* `allowRuntimeCreate`). ...
* - **Rows that still fail the current schema after conversion.** ...
*/

This is a separate enumeration from the one on the docs page, and it is
also stale — it lists exactly the same three items it always has and
never picked up the #8957 addition either. Same root cause as #9175 (PR
#9059's dispatch brief named the code surface and the gates, said nothing
about either docs face — one hand-written mdx table, one hand-written JSDoc
list, both count-carrying, both un-enforced), just a second victim.

A second, pre-existing thing worth a maintainer's eyes (not asserted as a bug)

The JSDoc's three items and the (pre-fix) cli.mdx table's three items are
not the same three:

  • The JSDoc's first bullet, "flow rows with no reachable automation
    engine" (outcome: 'skipped', when no canonicalizeFlow is reachable),
    has no row in the cli.mdx table.
  • The cli.mdx table's third row, "A flow whose rename the conflict guard
    refused" (outcome: 'failed', on a real conflicts.length > 0), has no
    bullet
    in the JSDoc.

This predates #8957 and is plausibly intentional — the JSDoc documents the
function's full internal surface (including a path only a non-CLI caller can
hit, since os migrate meta --stored always supplies a live automation
engine per the "Flows are covered, and cost one extra plugin" prose already
on the docs page), while the docs page documents only what an operator
running the actual command can observe. Flagging so a maintainer can confirm
that's the intended scope split rather than two lists that just drifted from
each other independently.

Suggested disposition

Add a fourth bullet to the JSDoc for the non-canonical-stored-type decline,
mirroring the cli.mdx fix in #9175's PR — the exact reasoning is already
written at the isNonCanonicalStoredType call site's own inline comment
(packages/metadata-protocol/src/protocol.ts, inside migrateStoredMetadata,
the if (isNonCanonicalStoredType(rawType)) branch), so this is mechanical.
Optionally also resolve or explicitly document the flow-bullet /
flow-conflict-row scope difference above.

Backlinks: #9175 (the cli.mdx fix this was found while doing) · #8957 / PR
#9059b740440bd (the fourth decline, in both places).

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions