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
- Both extend
core.Base with static config = {className: 'Neo.worker.CanvasGroups' | 'Neo.worker.HiddenTick', …} and end in export default Neo.setupClass(…).
- 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.
destroy() clears the timers. CanvasGroups also retires its open channels.
- The App creates both with
Neo.create in construct(), not as new class fields.
- The statics and exported constants stay on the class. The main thread uses them without an instance.
Acceptance Criteria
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
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.CanvasGroupsfrom #19125 andNeo.worker.HiddenTickfrom #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)class CanvasGroups {},export default CanvasGroupsclass HiddenTick {},export default HiddenTickstartBound(30 s), a constructor optioninterval(1 s), a constructor argumentisDeparted, a constructor optionworker, a constructor argumentNeo.setupClass, noNeo.gatekeepsetTimeoutbounds and open channels outlive their ownerSo
Neo.overwritescannot 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, appliesNeo.overwritesthroughapplyOverwrites, generates reactive accessors, and registers the class first-one-wins.core.Base'sstatic configcontract (src/core/Base.mjs): non-reactive configs live on the prototype and are theNeo.overwritessurface. Class fields hold internal state and never share a name with a config (assertFieldsShadowNoConfig).constructanddestroyare the lifecycle.Neo.gatekeepis the lightweight registration for classes that cannot extendcore.Base. Neither class needs that exception.App.mjscreates both as class fields withnew.Manager.mjsandCanvas.mjscallCanvasGroups' statics (resolveCarrier,mint,groupFromWorkerName) and its two exported constants, without an instance.CanvasGroups,CanvasGroupLifetimes,CanvasBootstrapandHiddenTick.The Fix
core.Basewithstatic config = {className: 'Neo.worker.CanvasGroups' | 'Neo.worker.HiddenTick', …}and end inexport default Neo.setupClass(…).startBound,isDeparted,interval,worker. Internal state stays in class fields (groups,pending,retired,windows;timers), with no name shared with a config.destroy()clears the timers.CanvasGroupsalso retires its open channels.Neo.createinconstruct(), not asnewclass fields.Acceptance Criteria
core.Base, are finalized byNeo.setupClass, and resolve atNeo.worker.CanvasGroupsandNeo.worker.HiddenTick.Neo.overwritesentry changes each tunable's default (startBound,interval), with one unit arm per class.destroy()leaves no pending timer, and no open channel forCanvasGroups, with a unit arm per class.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).Neo.worker.CanvasGroupsclass (src/worker/CanvasGroups.mjs:41,:489)core.Base, finalized byNeo.setupClass, and resolves atNeo.worker.CanvasGroups. The statics (error,groupFromWorkerName,mint,resolveCarrier) and the two exported constants are unchanged, so the main thread uses them without an instanceunitTestModeCanvasGroups.spec: "it is registered in the namespace…"startBoundconfig, non-reactive (:52, read at:181)fail(group, 'silent').Neo.overwritesreaches it on the class and on extensions300007);CanvasBootstrap.spec(20);CanvasGroupLifetimes.spec(5000on the App's own instance)isDepartedconfig, non-reactive (:47, read at:396)(windowId) => Boolean. A suppliedwindowIdin no group rejectsNEO_DEAD_PORTwhen it returns true, andNEO_UNROUTABLEotherwisenull, called optionally: an unknown window counts as not departed, soNEO_UNROUTABLECanvasGroups.spec: "late work from a departed window never takes a surviving sibling's port"; the App wiresisWindowDeparted(App.mjs:102)CanvasGroups#isReadyFor(windowId), renamed fromisReady(:244)ready. Its one production consumer isRemoteMethodAccess(src/worker/mixin/RemoteMethodAccess.mjs:168)isReadyis not available:core.Base's reactiveisReadyconfig default is assigned onto the instance and shadows a method of that nameCanvasGroupLifetimes.specCanvasGroups#destroy(), new (:188)NEO_DEAD_PORT(canvas group <g> destroyed before it was ready), and retires every routed and held channel, thensuper.destroy()core.Baseguards a second callNeo.worker.HiddenTickclass with theintervalandworkerconfigs, non-reactive (HiddenTick.mjs:15,:20,:25, read at:61)Neo.worker.HiddenTick.intervalis the tick period andNeo.overwritesreaches it.workeris the worker whose ports carry the ticksintervaldefaults to1000;workertonull, so ticks need one7); ticks arm (10)HiddenTick#destroy(), new (:36)super.destroy()Neo.worker.Appwiring (App.mjs:102–103,:240–244)construct()creates both throughNeo.create:canvasGroupswithisDeparted: me.isWindowDeparted,hiddenTickwithworker: me.destroy()destroys bothnulluntilconstruct()runs.RemoteMethodAccessalready guardsme.canvasGroupsfor workers without oneCanvasGroupLifetimes.spec(drives the App's own instance); canvas e2eOut of Scope
The same census over
src/found four more plain classes, each needing its own disposition:Neo.worker.MessageandNeo.core.Utilregister by hand throughNeo.ns.Utilcannot extendBase, becauseBaseimports it.Neo.main.draggable.ResizeandNeo.functional.util.HtmlTemplateare unregistered.Related
#19125 (merged) · #19103 · #18755 · #16435
Sweeps:
CanvasGroups,HiddenTickandcore.Base. No equivalent.query_raw_memories("plain JS class instead of Neo.setupClass core.Base; CanvasGroups HiddenTick …"), 6 results, only session-init notes and no prior decision.mc-serverexit 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