Skip to content

The goast doc-comment styler's port was never finished: five items absent, ~90 lines of reflection still there, and an unknown production fails green #938

Open

Description

@David-Noble-at-work

noblefactor-ops#232, the lint tooling
schedule, the way #932 and #838 are.

Found 2026-09-23 while scoping #937, which moves doc-comment-styling.md here from noblefactor-ops.

The document is half instruction, and the instructions were not finished

doc-comment-styling.md is not only a design. It ends with a section titled "Porting to
devlore-cli"
, written before the March 2026 move, carrying two lists: What ports as-is and What
changes during the port
. The move happened; the lists did not.

What landed: the production model core — itemProduction, listProduction, ParseConsumes,
fuzzy slot filling (fuzzy.go, slotassign.go) — and the schema fields production, consumes and
condition in doctaxonomy.SchemaElement.

Listed under "What ports as-is", and absent. Checked by name across cmd/star/:

Item State
resizeProduction absent
regionProduction absent
BoxStyle and its 17-style catalog absent
RegisterProduction / ProductionFactory (the production registry) absent
MultiCommentProduction absent

Listed under "What changes during the port", and not done:

  • "The reflection code (schemasFromConfig, schemasFromMap, schemaFromConfigVal — ~90 lines of
    reflect.ValueOf / FieldByName) is deleted."
    It is still there:
    cmd/star/provider/goast/astrewrite.go:20, :36, :64.
  • "Style field becomes FormStyles struct" with a custom UnmarshalYAML handling the bare-string
    and per-form map shapes. FormStyles exists nowhere, and SchemaElement has no Style field at
    all.

The part that bites: it fails green

NewProduction (production.go:327-368) is a hard-coded switch:

switch prod {
case "item":
    return &itemProduction{consumes: c}, nil
case "list":
    return &listProduction{consumes: c}, nil
default:
    return &itemProduction{consumes: c}, nil
}

The registry the document specifies is a two-branch switch with a default that silently returns
an item production
. A schema element declaring production: resize does not fail — it quietly gets
the wrong production and the comment is restyled wrongly. That is the same shape as
noblefactor-ops#231 (a gate reporting a confident wrong verdict when its tools are missing) and #932
(an empty file set returning pass): the failure mode is a wrong answer, not an error.

Consequence today: the delineator half of the styler — banners, boxes, resize, regions — does not
exist. star lint go-style --fix does summaries and bodies; the schema vocabulary for everything else
is inert, and declaring it is silently ignored.

Work

Not settled here. What the design must decide:

  • The registry, or keep the switch and make it fail closed? The minimum honest fix is the
    default branch returning an error for an unknown production. The document's answer is a registry
    with init() registration, which is a larger change and buys extensibility this may or may not
    want.
  • Which of the five absent items are actually wanted. BoxStyle's 17 named styles are a
    catalogue of delineator forms; whether the house style guide needs all of them is a separate
    question from whether the mechanism should exist.
  • The reflection deletion. CommentSchema and SchemaElement already carry yaml: tags and
    unmarshal directly, per the document, so the ~90 lines may be removable without the rest of the
    port. That is the smallest independent slice and probably the first one.
  • Whether doc-comment-styling.md's port section is then deleted or kept as a record. Three star design documents describe code that ships here and is documented nowhere #937 moves
    it with a note marking it unexecuted and dated; when this closes, that note is what changes.

Related

#937 (moves the document here, with the note) · #837 (the lint provider feature) ·
noblefactor-ops#232 (the lint tooling
schedule) · noblefactor-ops#130 ("a
diverged second copy is how the next person builds the wrong thing"
— the reason the note exists)

Activity

  1. David-Noble-at-work commented on Nov 9, 2026

    @David-Noble-at-work
    ContributorAuthor

    star github triage sweep added this issue to Triage: devlore, for the rules it breaks:

    • severity: a Bug whose Severity is blank; a bug is Critical, High, Medium or Low
    • no-evidence: no Evidence of completion section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions