LearnNewsExamplesServices
Frontmatter
id17958
titleExtending-classes guide contradicts the engine on subclass configs
stateClosed
labels
bugdocumentationaicore
assigneesneo-opus-grace
createdAtAug 31, 2026, 6:41 PM
updatedAtAug 31, 2026, 8:02 PM
githubUrlhttps://github.com/neomjs/neo/issues/17958
authorneo-opus-grace
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtAug 31, 2026, 8:02 PM

Extending-classes guide contradicts the engine on subclass configs

Closed v13.2.0/archive-v13-2-0-chunk-17 bugdocumentationaicore
neo-opus-grace
neo-opus-grace commented on Aug 31, 2026, 6:41 PM

Context

learn/guides/fundamentals/ExtendingNeoClasses.md — the guide whose entire subject is extending a Neo class — closes its reactive-config section with a statement that is false for the one case the guide exists to teach:

learn/guides/fundamentals/ExtendingNeoClasses.md:54 — "Properties without the underscore are static and do not trigger this reactive behavior."

For a subclass overriding an inherited reactive config, the opposite is true: the non-underscore spelling is the only legal one, and it stays reactive. The underscore spelling does not merely fail to be idiomatic — it throws at class-definition time.

This is not a hypothetical reader. It cost a maintainer review cycle on PR #17956 this session: I filed a Required Action prescribing ui_ on Neo.tab.Container as one of two acceptable spellings. It would have thrown. The PR author (@neo-gpt-emmy) refused that half and was right to; the round-2 disposition records the correction. I reasoned from this guide, and the guide is what was wrong.

Operator precedent: @tobiu raised this exact class of error on 2026-03-17 (Memory Core session 75feb8f8-86e0-40af-b261-bb011d1fd688): *"are you aware that neo THROWS if you use width_ in a class extension, when the base class already contains width_? if you want to change the value, we MUST use width. this is absolutely crucial, and the neo core mentions it multiple times. explore other guide areas for errors too please."* That correction landed in one guide. The sweep of the other guide areas was promised and never finished — this ticket is that unfinished half, five months later, now with a demonstrated cost.

Live latest-open sweep: checked the latest 20 open issues at 2026-08-31T16:42Z; no equivalent found. Closed-state sweep over ExtendingNeoClasses returns only COMPLETED content tickets (#6917, #6918, #6919, #6927) — none touches this rule. A2A in-flight claim sweep (last 30 messages, all read-states): no overlapping [lane-claim].

The Problem

The rule is enforced in the engine and documented in exactly one guide, and it is not the guide a subclass author reads.

src/Neo.mjs:347, inside Neo.createConfig, throws:

Invalid config in ${target.className}: '${key}_'. The config '${key}' is already defined as reactive by a parent class.
To override the default value, use '${key}' (without the underscore) in your static config.
If you intended to create custom logic, use the 'beforeGet${Key}()', 'beforeSet${Key}()', and 'afterSet${Key}()' hooks instead of redefining the config.

The guard is Neo.hasPropertySetter(proto, key) (src/Neo.mjs:535-548), which walks the whole prototype chain — so it fires for any ancestor, not just the direct parent. Corroborating census: ui_ occurs exactly once repo-wide (src/component/Base.mjs:302), which is what a single-owner rule enforced by a throw looks like in practice.

Where the rule is stated correctly: learn/guides/coreengine/SetupClass.md:50 carries it as a "Crucial Rule" blockquote — accurate and complete. That is the March 2026 fix.

Where a subclass author actually lands: not there. Asking the Knowledge Base the exact question — "When extending a Neo class, can a subclass redeclare an inherited reactive config with the trailing underscore to change its default value?" (type: 'guide') — returns:

Rank Source Score Carries the rule?
1 learn/guides/fundamentals/ExtendingNeoClasses.md 14710 No — states the contradicting blanket rule at :54
2 learn/guides/fundamentals/ConfigSystemDeepDive.md 9151 No
3 learn/Glossary.md 6983 No
4 learn/guides/fundamentals/DeclarativeConfigMerging.md 6217 No
5 learn/guides/coreengine/ConfigSystem.md 6217 No

SetupClass.md does not appear at all. So the agent-facing retrieval path answers this question from the one file that gets it wrong, and never reaches the one file that gets it right. That is the mechanism by which a documented rule still produces a wrong prescription — the fact exists and reaches no decision.

The Architectural Reality

  • The engine contract: Neo.createConfig (src/Neo.mjs:338-352) — reactive configs are declared with a trailing underscore exactly once per prototype chain; Neo.setupClass throws on a second declaration. Subclass default overrides use the bare name and remain fully reactive, because the inherited accessor is found by Neo.hasPropertySetter and the non-reactive defineProperty branch (src/Neo.mjs:944-947) is skipped.
  • The canonical prose: learn/guides/coreengine/SetupClass.md:50. This is the SSOT for the rule; the fix should reference it rather than fork a second wording that can drift.
  • The defective prose: learn/guides/fundamentals/ExtendingNeoClasses.md:30-55 (section 2, "Reactive Configs: The Trailing Underscore"). The section teaches declaring a new reactive config and never shows the override case, then closes with a blanket claim that is false for the override case.
  • Adjacent surfaces that discuss the underscore without the carve-out: learn/guides/fundamentals/ConfigSystemDeepDive.md:27,367 and learn/guides/coreengine/ConfigSystem.md:7-9. These are not false as written — they describe declaration, not override — but they are on the same retrieval path and should point at the canonical rule.

The Fix

  1. learn/guides/fundamentals/ExtendingNeoClasses.md §2 — correct the closing sentence so it scopes the blanket claim to new config declarations, and add the override case the guide is missing: a short subclass example (width: 300 over an inherited width_), the fact that it stays reactive, and the fact that the underscore spelling throws. Link learn/guides/coreengine/SetupClass.md as the canonical statement instead of restating it in full.
  2. learn/guides/fundamentals/ConfigSystemDeepDive.md and learn/guides/coreengine/ConfigSystem.md — add a one-line cross-reference to the canonical rule where the trailing-underscore convention is introduced. No prose fork.
  3. Do not re-word learn/guides/coreengine/SetupClass.md:50. It is correct and it is the SSOT.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
learn/guides/fundamentals/ExtendingNeoClasses.md:54 src/Neo.mjs:347 (throw) Blanket claim scoped to new declarations; override case added with example n/a — prose only this file KB rank-1 for the override question; PR #17956 round-1 misprescription
learn/guides/coreengine/SetupClass.md:50 same Unchanged — canonical SSOT, linked from the above n/a this file Verified present and correct at this SHA
learn/guides/fundamentals/ConfigSystemDeepDive.md:27 · learn/guides/coreengine/ConfigSystem.md:9 same One-line cross-reference added at the underscore introduction n/a this file KB ranks 2 and 5 for the same question

Decision Record impact: none — this documents an existing enforced engine contract; it neither amends nor challenges an ADR.

Acceptance Criteria

  • learn/guides/fundamentals/ExtendingNeoClasses.md no longer states that a non-underscore property is non-reactive without scoping that claim to new declarations.
  • The same guide shows the subclass-override case explicitly: bare-name spelling, still reactive, underscore spelling throws.
  • The guide links learn/guides/coreengine/SetupClass.md as the canonical rule rather than restating it in full (no second wording that can drift).
  • learn/guides/fundamentals/ConfigSystemDeepDive.md and learn/guides/coreengine/ConfigSystem.md each carry a cross-reference to the canonical rule at the point the underscore convention is introduced.
  • learn/guides/coreengine/SetupClass.md:50 is unmodified.
  • POST-MERGE ONLY (the Knowledge Base ingests merged content, so this cannot be witnessed from a branch): verification that the correction reaches the consumer, not just the file — re-run ask_knowledge_base(query: "When extending a Neo class, can a subclass redeclare an inherited reactive config with the trailing underscore to change its default value?", type: 'guide') after ingest and record whether a rank-1..5 source now carries the correct rule. If retrieval still surfaces no correct source, say so rather than closing on the file edit alone — the edit is the act, the retrieval is the effect.
  • No .mjs under src/ is modified. This ticket changes documentation only; the engine behaviour is already correct.

Out of Scope

  • Changing Neo.createConfig, its error text, or any engine behaviour. The engine is right; the docs are wrong.
  • Re-wording learn/guides/coreengine/SetupClass.md:50.
  • A general audit of every guide for every other inaccuracy. The March 2026 "explore other guide areas" direction is broader than one leaf; this ticket closes the specific, cost-demonstrated instance. A broader guide-accuracy sweep, if wanted, is its own ticket.
  • Changing KB chunking, scoring, or ingest configuration. If the AC-6 retrieval check shows the guides are correct but retrieval still fails, that is a separate finding about the retrieval layer, and belongs in its own ticket.
  • The plain_ / ui variant-config overlap on Neo.tab.Container noted during the PR #17956 review. Unrelated seam, separate leaf.

Avoided Traps

  • "Just add the carve-out sentence to every guide that mentions the underscore." That forks the wording four ways and guarantees drift — the exact failure mode that let one guide be corrected in March while the others stayed wrong. One canonical statement, cross-referenced.
  • "The rule is already documented, so this is a no-op." It is documented in a file the retrieval path does not return for the question. A fact that exists and reaches no decision has not been delivered; the KB table above is the measurement, not the assumption.
  • "Close it once the file is edited." The consumer here is agent retrieval as much as human reading, which is why AC-6 asks for a post-ingest retrieval check with an honest negative result permitted. A green file diff is not evidence the next agent gets the right answer.

Related

  • PR #17956 — the review cycle that surfaced this; round-2 disposition records the misprescription and its cause.
  • learn/guides/coreengine/SetupClass.md — canonical rule, product of the March 2026 operator correction.
  • learn/blog/context-engineering-done-right.md:1712 — the only other place in learn/ carrying the correct rule; a blog post is not a reference surface.
  • #17904 — prior instance of the same shape (an engine mechanism real but undocumented and invisible to search).

Origin Session ID: d2731eb8-66b7-4183-a471-4ac34e169d71

Retrieval Hint: query_raw_memories("subclass redeclare reactive config trailing underscore createConfig throws guide") · Memory Core session 75feb8f8-86e0-40af-b261-bb011d1fd688 (2026-03-17 operator correction) · src/Neo.mjs:347