LearnNewsExamplesServices
Frontmatter
id18384
titleEvaluate and document parser-safe compact JSDoc formatting
stateClosed
labels
documentationenhancementaitestingbuild
assigneesneo-opus-vega
createdAtSep 6, 2026, 3:04 PM
updatedAtSep 15, 2026, 12:48 PM
githubUrlhttps://github.com/neomjs/neo/issues/18384
authorneo-gpt
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 15, 2026, 12:48 PM

Evaluate and document parser-safe compact JSDoc formatting

Closed v13.2.0/archive-v13-2-0-chunk-19 documentationenhancementaitestingbuild
neo-gpt
neo-gpt commented on Sep 6, 2026, 3:04 PM

Context

The operator proposed evaluating compact JSDoc after reviewing the one-line comments introduced in PR #18383. This is a deferred exploration, outside the two priority-zero docking epics; it does not block their completion. The unsafe comments are being corrected in #18383 using the existing multiline convention.

The Problem

Compact comments could reduce visual bulk around simple declarations, but valid JavaScript and a successful JSDoc invocation do not guarantee correct documentation metadata.

A six-case probe against the installed JSDoc CLI, followed by the exact member-processing block from buildScripts/docs/generateDocsJson.mjs, reproduced:

Input Observed result
One-line @member {String[]} cls=['alpha', 'beta'] Generated default becomes empty; JSDoc also treats 'beta'] as description text.
Same one-line array without the space Default still becomes empty.
Multiline array with comma-space Default is recovered, but the trailing array element still leaks into description.
Multiline array without spaces Correct complete default and no leaked description.
One-line @member ... @protected @protected becomes description text; protected access is absent.
The two tags on separate lines Protected access is present.

This is silent metadata loss, not an asserted parser crash. The probe exercised the parser and generator's member block; it did not run or render the entire documentation build.

The Architectural Reality

  • Coding guidelines show multiline blocks and tags on separate lines.
  • buildScripts/docs/docletPipeline/runner.mjs invokes JSDoc; generateDocsJson.mjs extracts array/object defaults from the text after = up to the next newline. A one-line block has no such newline.
  • buildScripts/util/check-jsdoc-types.mjs checks type expressions, not preservation of defaults, descriptions or access tags. It passes the affected valid types.
  • The code-line guard already excludes comment-only lines. Compact JSDoc would reduce source bulk, not earn a reduction in executable code lines or browser bundle size.

The Fix

Evaluate a small grammar and publish an explicit support decision with fixtures in one bounded change. Start with one-tag simple annotations; compare multiline controls, primitive/null defaults, arrays/objects, whitespace and multiple tags. Permit only forms that preserve the complete metadata through the actual docs pipeline. Retaining multiline syntax for unsupported cases is an acceptable outcome; a general parser rewrite is not presumed.

Contract Ledger

Surface Authority Proposed behavior Fallback Docs Evidence
Comment formatting Existing guidelines + measured parser output Explicit supported compact subset, if justified Existing multiline blocks Coding guidelines Compact/multiline equivalence fixtures
Generated member metadata JSDoc and Neo docs generator Preserve name, type, default, description and access Reject or document unsupported form Accepted examples Real parser plus generator output

Acceptance Criteria

  • Record a reproducible compact-versus-multiline matrix through the production parser and relevant generated output.
  • Add regression coverage for empty array defaults, whitespace spilling into descriptions and lost access tags.
  • Document the accepted subset or reason for retaining multiline syntax, including cases that must expand.
  • Any admitted compact form preserves semantic metadata; existing multiline output remains unchanged.

Out of Scope

Repository-wide reformatting, runtime/API changes, Brain work, new dependency/parser architecture, or making this a prerequisite of #18303/#18304.

Avoided Traps

A comma is not the sole cause; removing spaces does not repair newline-dependent extraction. A type-lint pass is not a metadata-equivalence proof. Shorter comments are useful only if readability and documentation meaning survive.

Decision Record impact: none — existing Engine docs tooling and source conventions.

unowned-rationale: Operator-requested deferred exploration; implementation waits until the two priority-zero epics are complete.

Related and freshness

Observed in #18383. #13433 addressed JSDoc type-expression guidance and is closed; this ticket concerns comment layout and metadata fidelity.

Live latest-20-open and exact-title/all-state JSDoc sweeps checked 2026-09-06; no equivalent found. Latest 30 A2A messages across read states show no overlapping claim. Two problem-keyed Memory Core searches returned historical type/config documentation cases, not a compact-format decision. Own-assignment sweep: seven open tickets, no matching documentation-formatting lane.

Origin Session ID: 01a07609-5e09-70f0-bf2c-a27d77d1b7f2

Retrieval Hint: compact JSDoc member array default newline protected description metadata equivalence

tobiu referenced in commit 6efce3e - "docs(guidelines): compact JSDoc survives three forms, and the leak it was blamed for lives in the multiline convention too (#18384) (#18729) on Sep 15, 2026, 12:48 PM
tobiu closed this issue on Sep 15, 2026, 12:48 PM