Skip to content

Characterize registerMetadataEndpointsInner (2,328 lines, 20% of rest-server.ts) — read and propose, do not split blind #8851

Description

@qq9340100

Filed by the domain:cli seat on the 2026-08-15 maintainer ruling on #5949 (「接受你的建议」, recorded at #5949 comment 5301726968). Card 2 of the two extractions that ruling authorised.

⚠️This is NOT the ADR-0076 D11 decomposition. That was ruled closed (option B). This card exists because this one method is the single place in the file where size is itself the defect.

The justification — prism ③, comprehension rather than collision

RestServer registers routes through 18 registerXxxEndpoints methods, and 17 of them are domain-sized (36–951 lines) and internally delineated. One is not:

methodlines
registerMetadataEndpointsInner2,328
registerDataActionEndpoints951
registerFormEndpoints575
(15 others)36–430

2,328 lines is 20% of the file in one method, with no internal delineation. An agent changing anything inside it must hold the whole thing — and this repo dispatches agents at this code constantly.

That is a different problem from the one option B closed. B ruled that the file's domain delineation is adequate. This method has no delineation to be adequate.

Scope — ⛔ read and propose. Do NOT split.

The deliverable is an analysis comment on this card, not a refactor PR:

  1. What is in it — the endpoints it registers, grouped by whatever cohesion actually exists (or a finding that there is none).
  2. Where the seams are, if any — and whether they are real seams or an arbitrary cut that would make things worse.
  3. A proposed split with its cost, or an honest recommendation that it should not be split and why.

Do not open a refactor PR from this card. It has no internal delineation, so it cannot be moved as a unit before it is understood — splitting it on a first read is exactly how a 2,328-line method becomes three tangled 800-line ones. pr: null with a thorough analysis is the expected and complete delivery.

⚠️ If the analysis concludes it should be split, that is a follow-up card and it needs its own dispatch — which will also need checking against option B, since a split large enough to matter starts to look like the programme B closed.

Premise to verify

Measured on origin/main @ 04d03c3a0: the method spans roughly lines 4686–7013. Re-locate by symbol — the file has taken merges since, and stated line numbers have misled this lane three times today.

Not claimed

Refs: #5949 (the ruling and the four-prism analysis), ADR-0076 D11.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions