LearnNewsExamplesConnect
Frontmatter
assigneeszuhairkhalid229
createdAtNov 15, 2026, 10:46 AM
updatedAtNov 15, 2026, 4:08 PM
githubUrlhttps://github.com/neomjs/neo/issues/21017
authorneo-gemini-julia
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[]
closedAtNov 15, 2026, 4:08 PM

Align Neo.core.Config#initDescriptor JSDoc with Config.prototype

Closed v14.0.0/archive-v14-0-0-chunk-2 bugdocumentationhelp wantedgood first issueaicore
neo-gemini-julia
neo-gemini-julia commented on Nov 15, 2026, 10:46 AM

Context

Surfaced during review of #21014 (implementing #21010 under Epic #20498 / responsibility map #20527) per .agents/skills/pr-review/references/pr-review-guide.md §2.5 ("Verified inherited debt beyond a safe repair gets a real issue in this review, whatever the verdict"). When authoring the new Config Descriptors reference section against src/core/Config.mjs, #21014 transcribed two stale @param defaults from Neo.core.Config#initDescriptor (lines 90–97) that contradict Config.prototype and runtime behavior.

Ownership: unowned-rationale: Ready for a contributor; maintainers provide planning and review.

The Problem

In src/core/Config.mjs, the @member JSDoc blocks (lines 40–63) and Object.defineProperties(Config.prototype, ...) (lines 237–242) were updated when prototype-level defaults (cloneOnGet: null, mergeStrategy: 'replace') replaced earlier descriptor defaults (#6934), but initDescriptor's method JSDoc (lines 89–98) was never updated to match:

  1. descriptor.cloneOnGet (line 94): Currently reads: @param {string} [descriptor.cloneOnGet] - The clone strategy for get. Defaults to 'shallow' if clone is 'deep' or 'shallow', and 'none' if clone is 'none'. At runtime, Config.prototype.cloneOnGet is null (lines 49, 239) and initDescriptor (lines 108–112) never derives cloneOnGet from clone. In the generated getter (src/Neo.mjs:387–409), Date values are always cloned (new Date(value.valueOf())); when cloneOnGet is explicitly set ('deep', 'shallow', or 'none'), that strategy governs ('none' skips the fallback array copy); when cloneOnGet remains null, Array values are shallow-sliced (value.slice()) regardless of clone while plain objects are returned without copying.
  2. descriptor.merge (line 96): Currently reads: @param {string} [descriptor.merge='deep'] - The merge strategy. At runtime, Config.prototype.mergeStrategy defaults to 'replace' (lines 60, 62, 241), NOT 'deep', and descriptor.merge accepts {Function|String} ('replace', 'shallow', 'deep', 'deepArrays', or a custom (defaultValue, instanceValue) => merged function in Neo.mergeConfig, src/Neo.mjs:713–738).
  3. Summary key list (line 90) & class header wording (line 10):
    • line 90 says Extracts clone, mergeStrategy and isEqual from the descriptor, omitting cloneOnGet and naming the target field mergeStrategy instead of the input descriptor key merge (initDescriptor({clone, cloneOnGet, isEqual, merge})).
    • line 10 refers to "the Neo.mjs framework" instead of "the Neo.mjs runtime engine" (category-drift terminology).

The Architectural Reality

  • Design authority: src/core/Config.mjs @member JSDoc (lines 46–63) and Config.prototype (lines 237–242): "The cloning strategy to use when getting a value. Supported values: 'deep', 'shallow', 'none'. @member {String} cloneOnGet=null" and "Defaults to 'replace'. Can be overridden via a descriptor merge property. Supported values: 'deep', 'deepArrays', 'replace', 'shallow'. @member {Function|String} mergeStrategy='replace'".
  • src/core/Config.mjs:99–125: initDescriptor({clone, cloneOnGet, isEqual, merge}) defines own properties on me only when truthy and differing from Config.prototype (clone, cloneOnGet, isEqual, and merge → me.mergeStrategy).
  • src/Neo.mjs:387–409: generated reactive getter checks value instanceof Date, then else if (config.cloneOnGet) ('deep' / 'shallow', with 'none' truthy so it bypasses the legacy branch), then else if (Array.isArray(value)) { value = value.slice() }.
  • src/Neo.mjs:713–738, 1029–1033 & src/core/Base.mjs:767–773: Neo.mergeConfig(defaultValue, instanceValue, strategy) supports 'shallow', 'deep', 'deepArrays', custom Function, and falls back to 'replace' (return instanceValue).

Decision Record impact: none.

The Fix

Update JSDoc comments only in src/core/Config.mjs (zero runtime behavior change):

  1. line 10: Replace within the Neo.mjs framework. with within the Neo.mjs runtime engine.
  2. line 90: Update the summary sentence to accurately name the extracted descriptor keys (clone, cloneOnGet, isEqual, and merge, storing merge on mergeStrategy).
  3. lines 93–97: Align @param types ({String} / {Function|String} matching the @member tags above) and defaults:
    • [descriptor.clone='deep'] — supported values 'deep', 'shallow', 'none'.
    • [descriptor.cloneOnGet=null] — supported values 'deep', 'shallow', 'none'; when null (unset), Date values are cloned and Array values are shallow-sliced on read while plain objects return as-is (src/Neo.mjs getter).
    • [descriptor.isEqual=Neo.isEqual] — equality comparison function.
    • [descriptor.merge='replace'] — {Function|String} merge strategy ('replace', 'shallow', 'deep', 'deepArrays', or a (defaultValue, instanceValue) function).

Acceptance Criteria

  • AC-1: src/core/Config.mjs initDescriptor JSDoc (lines 89–98) lists the exact descriptor keys (clone, cloneOnGet, isEqual, merge, value) and accurate defaults (clone='deep', cloneOnGet=null, isEqual=Neo.isEqual, merge='replace') with {Function|String} on descriptor.merge, matching Config.prototype (lines 237–242) and src/Neo.mjs.
  • AC-2: src/core/Config.mjs class JSDoc (line 10) replaces Neo.mjs framework with Neo.mjs runtime engine.
  • AC-3: Zero runtime lines in src/core/Config.mjs change, and existing Config unit tests (npx playwright test test/playwright/unit/config/ --config=test/playwright/playwright.config.unit.mjs) pass.

Out of Scope

  • Changing runtime cloneOnGet, clone, or mergeStrategy behavior in src/core/Config.mjs, src/Neo.mjs, or src/core/Base.mjs.
  • Guide edits in learn/guides/fundamentals/ConfigSystemDeepDive.md (owned by #21010 / PR #21014).

Avoided Traps

  • Changing Config.prototype defaults to match the stale JSDoc: cloneOnGet: null and mergeStrategy: 'replace' are load-bearing across the engine (changing default mergeStrategy to 'deep' or cloning every plain object on get would break reference identity and regress hot getters). Only the stale JSDoc in src/core/Config.mjs changes.

Related

Sweeps

  • Live latest-open + closed sweep: checked latest 20 open (#20903–#21016, backlog band: 52 open — red; no existing open ticket owns src/core/Config.mjs JSDoc) + closed searches ("Config initDescriptor JSDoc", "Config.mjs cloneOnGet", "initDescriptor"; read #1156 and #6934 bodies/Out of Scope) at 2026-11-15T09:44Z; no equivalent or prior exclusion found
  • A2A in-flight claim sweep: checked newest 30 messages (status: 'all') at 2026-11-15T09:44Z; zero claims on src/core/Config.mjs
  • MC sweep: "src/core/Config.mjs initDescriptor stale JSDoc cloneOnGet merge default replace", 5 results (4e171c29, 99e77576, 0bcc057b, 1218a36f, 7a3d82ab) + ask_knowledge_base(type='ticket'), no prior ticket or exclusion found
  • Own-assignment sweep: 3 open (#20999, #20987, #20671), none overlapping
  • Structure-map gate: N/A (JSDoc-only in src/core/Config.mjs)

Origin Session ID: 2f084437-cc03-4b7b-aace-a27bff4aa3f9 Retrieval Hint: "Neo.core.Config initDescriptor stale JSDoc cloneOnGet null merge replace Config.prototype"

zuhairkhalid229
zuhairkhalid229 Nov 15, 2026, 1:01 PM

/claim

I'd like to take this. Plan: JSDoc-only edits in src/core/Config.mjs per the Fix section (line 10 wording, the line 90 summary, and the initDescriptor @param types and defaults matching Config.prototype), no runtime lines changed, then run the Config unit tests from AC-3.

  • 2026-11-15T12:02:12Z @github-actions assigned to @zuhairkhalid229

@github-actions - 2026-11-15T12:02:13Z

Thanks for claiming this, @zuhairkhalid229, and welcome! Assigned to you — you can start now.

Your claim reserves this issue for 3 days (any comment here resets the clock; we still merge the first approve-worthy PR if another lands first or a claim goes quiet).

An automatic reply. How claims work [QUARANTINED_URL: github.com]

zuhairkhalid229 cross-referenced by PR #21026 on Nov 15, 2026, 3:33 PM
tobiu referenced in commit 5f40e95 - "docs(core): align Config#initDescriptor JSDoc with Config.prototype (#21017) (#21026) on Nov 15, 2026, 4:08 PM
tobiu closed this issue on Nov 15, 2026, 4:08 PM