LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtSep 24, 2026, 3:04 PM
updatedAtSep 24, 2026, 4:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/19160
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtSep 24, 2026, 4:18 PM

CanvasGroups and HiddenTick bypass the Neo class system

Closed v13.2.0/archive-v13-2-0-chunk-23 enhancementairefactoringcore
neo-opus-ada
neo-opus-ada commented on Sep 24, 2026, 3:04 PM

Context

@tobiu, after merging #19125 without a round, since the PR was large: "anti-pattern, the class should extend core.Base and use configs. not extendable and neo overwrites won't work otherwise. the same for src/worker/HiddenTick.mjs … it does not even use Neo.gatekeep."

Both classes are mine: Neo.worker.CanvasGroups from #19125 and Neo.worker.HiddenTick from #18755.

The Problem

Both are plain JavaScript classes. Their JSDoc claims @class Neo.worker.*, but neither class exists in the Neo namespace:

CanvasGroups (src/worker/CanvasGroups.mjs) HiddenTick (src/worker/HiddenTick.mjs)
Declared class CanvasGroups {}, export default CanvasGroups class HiddenTick {}, export default HiddenTick
Tunable startBound (30 s), a constructor option interval (1 s), a constructor argument
Collaborator isDeparted, a constructor option worker, a constructor argument
Registered no Neo.setupClass, no Neo.gatekeep neither
Teardown none: per-group setTimeout bounds and open channels outlive their owner none: per-window timers outlive their owner

So Neo.overwrites cannot change either tunable. A subclass cannot use the config system, and nothing reaches the classes by namespace.

The Architectural Reality

  • Neo.setupClass (src/Neo.mjs) merges static configs down the chain, applies Neo.overwrites through applyOverwrites, generates reactive accessors, and registers the class first-one-wins.
  • core.Base's static config contract (src/core/Base.mjs): non-reactive configs live on the prototype and are the Neo.overwrites surface. Class fields hold internal state and never share a name with a config (assertFieldsShadowNoConfig). construct and destroy are the lifecycle.
  • Neo.gatekeep is the lightweight registration for classes that cannot extend core.Base. Neither class needs that exception.
  • Consumers:
    • App.mjs creates both as class fields with new.
    • Manager.mjs and Canvas.mjs call CanvasGroups' statics (resolveCarrier, mint, groupFromWorkerName) and its two exported constants, without an instance.
    • Specs: CanvasGroups, CanvasGroupLifetimes, CanvasBootstrap and HiddenTick.

The Fix

  1. Both extend core.Base with static config = {className: 'Neo.worker.CanvasGroups' | 'Neo.worker.HiddenTick', …} and end in export default Neo.setupClass(…).
  2. Tunables and collaborators become non-reactive configs: startBound, isDeparted, interval, worker. Internal state stays in class fields (groups, pending, retired, windows; timers), with no name shared with a config.
  3. destroy() clears the timers. CanvasGroups also retires its open channels.
  4. The App creates both with Neo.create in construct(), not as new class fields.
  5. The statics and exported constants stay on the class. The main thread uses them without an instance.

Acceptance Criteria

  • Both classes extend core.Base, are finalized by Neo.setupClass, and resolve at Neo.worker.CanvasGroups and Neo.worker.HiddenTick.
  • A Neo.overwrites entry changes each tunable's default (startBound, interval), with one unit arm per class.
  • destroy() leaves no pending timer, and no open channel for CanvasGroups, with a unit arm per class.
  • The App creates both through Neo.create, and the existing behavior specs pass unchanged in what they assert, plus the canvas e2e specs.

Contract Ledger

Anchored at 0eb8de351f (PR #19161).

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
Neo.worker.CanvasGroups class (src/worker/CanvasGroups.mjs:41, :489) @tobiu on #19125 · Fix 1 Extends core.Base, finalized by Neo.setupClass, and resolves at Neo.worker.CanvasGroups. The statics (error, groupFromWorkerName, mint, resolveCarrier) and the two exported constants are unchanged, so the main thread uses them without an instance First one wins: a second registration returns the existing class, and throws in unitTestMode JSDoc CanvasGroups.spec: "it is registered in the namespace…"
startBound config, non-reactive (:52, read at :181) Fix 2 The milliseconds a booting group may stay silent before fail(group, 'silent'). Neo.overwrites reaches it on the class and on extensions Default 30000 JSDoc overwrites arm (an extension set to 7); CanvasBootstrap.spec (20); CanvasGroupLifetimes.spec (5000 on the App's own instance)
isDeparted config, non-reactive (:47, read at :396) Fix 2 (windowId) => Boolean. A supplied windowId in no group rejects NEO_DEAD_PORT when it returns true, and NEO_UNROUTABLE otherwise Default null, called optionally: an unknown window counts as not departed, so NEO_UNROUTABLE JSDoc CanvasGroups.spec: "late work from a departed window never takes a surviving sibling's port"; the App wires isWindowDeparted (App.mjs:102)
CanvasGroups#isReadyFor(windowId), renamed from isReady (:244) Delta on #19161 Returns whether the window's group is ready. Its one production consumer is RemoteMethodAccess (src/worker/mixin/RemoteMethodAccess.mjs:168) The name isReady is not available: core.Base's reactive isReady config default is assigned onto the instance and shadows a method of that name JSDoc (says why) readiness arms; CanvasGroupLifetimes.spec
CanvasGroups#destroy(), new (:188) Fix 3 Clears every silent-start timer, rejects every pending wait as NEO_DEAD_PORT (canvas group <g> destroyed before it was ready), and retires every routed and held channel, then super.destroy() Runs once: core.Base guards a second call JSDoc "destroy() clears every silent-start bound…" (stubbed timers); mutation check in the PR
Neo.worker.HiddenTick class with the interval and worker configs, non-reactive (HiddenTick.mjs:15, :20, :25, read at :61) Fix 1, 2 Registered at Neo.worker.HiddenTick. interval is the tick period and Neo.overwrites reaches it. worker is the worker whose ports carry the ticks interval defaults to 1000; worker to null, so ticks need one JSDoc overwrites arm (7); ticks arm (10)
HiddenTick#destroy(), new (:36) Fix 3 Clears every running interval, then super.destroy() — JSDoc "destroy() stops every window's tick" (counts live intervals)
Neo.worker.App wiring (App.mjs:102–103, :240–244) Fix 4 construct() creates both through Neo.create: canvasGroups with isDeparted: me.isWindowDeparted, hiddenTick with worker: me. destroy() destroys both Both fields are null until construct() runs. RemoteMethodAccess already guards me.canvasGroups for workers without one JSDoc CanvasGroupLifetimes.spec (drives the App's own instance); canvas e2e

Out of Scope

The same census over src/ found four more plain classes, each needing its own disposition:

  • Neo.worker.Message and Neo.core.Util register by hand through Neo.ns. Util cannot extend Base, because Base imports it.
  • Neo.main.draggable.Resize and Neo.functional.util.HtmlTemplate are unregistered.

Related

#19125 (merged) · #19103 · #18755 · #16435

Sweeps:

  • Live latest-open sweep at 2026-09-24T13:03:49Z: 20 open issues, plus a keyword search for CanvasGroups, HiddenTick and core.Base. No equivalent.
  • MC sweep: query_raw_memories("plain JS class instead of Neo.setupClass core.Base; CanvasGroups HiddenTick …"), 6 results, only session-init notes and no prior decision.
  • Own-assignment sweep: 5 open, none overlapping.
  • A2A: Memory Core was intermittently unavailable (Vega's mc-server exit defect). The check is covered by the issue sweep and the operator's own direction.

Origin Session ID: 101d2ce9-9f43-4f5a-9ae2-3c75bf8f6fcf

Authored by ⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code

tobiu referenced in commit e2477c5 - "refactor(worker): CanvasGroups and HiddenTick are Neo classes (#19160) (#19161) on Sep 24, 2026, 4:18 PM
tobiu closed this issue on Sep 24, 2026, 4:18 PM