LearnNewsExamplesServices
Frontmatter
id13373
titleNeural Link create_instance — general instance-creation primitive
stateClosed
labels
enhancementaiarchitecturemodel-experience
assigneesneo-gpt
createdAtJun 15, 2026, 7:50 PM
updatedAtJun 17, 2026, 8:52 AM
githubUrlhttps://github.com/neomjs/neo/issues/13373
authorneo-opus-grace
commentsCount2
parentIssue13376
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 16, 2026, 2:35 AM
milestonev13.1

Neural Link create_instance — general instance-creation primitive

Closed v13.1.0/archive-v13-1-0-chunk-3 enhancementaiarchitecturemodel-experience
neo-opus-grace
neo-opus-grace commented on Jun 15, 2026, 7:50 PM

Context

Operator design steer (2026-06-15), surfaced while resolving the "create a grid via NL tools only" challenge. The agent-facing creation primitive today is component-only and indirect: there is no create_component MCP tool in the agent projection; creation goes through call_method(parentId,'add',[config]) (the ln op = ComponentService.createComponent), which can only create a component parented to a container. An agent cannot create a standalone non-component instance — a Neo.data.Store, a Neo.data.Model, a Neo.controller.* — through Neural Link.

Operator: "create_component => maybe create_instance as a replacement is superior. e.g. create a new store."

Release classification: post-release (Agent Harness product line; boardless).

The Problem

create_component (and its ln / call_method(add) implementation) conflates two concerns: instantiation and parenting-into-a-container. Container-add is the only creation route, so:

  • A standalone Store (no parent container) can't be created via NL — yet stores are first-class possession targets (inspect_store, list_stores, get_record already read them).
  • A Model, Controller, StateProvider, or any non-Neo.component.Base instance is uncreatable.
  • The "create a grid" proof had to route through a container add; it works for components but does not generalize.

A general create_instanceinstantiate any Neo class by className/ntype + config, return its id, optionally attach it — is the superior primitive. Component-in-container creation becomes a special case (instantiate + add to a parent); standalone instances (Store/Model/Controller) become possible.

The Architectural Reality

  • ai/services/neural-link/ComponentService.mjscreateComponent({parentId, config})ConnectionService.call(sessionId,'call_method',{id:parentId, method:'add', args:[config], undoKind:'ln'}). Component+parent only.
  • ai/mcp/server/neural-link/toolService.mjsln: ComponentService.createComponent (operationId ln); write-tier, not in the read-only agent projection.
  • Neo instantiation primitive: Neo.create(className|ntype, config) (App-Worker side) returns a live instance with an id — the natural backing call.
  • Undo integration: NL mutations carry undoKind (#9848 transaction/undo stack; #13221/#13286/#13306 undo/redo slices) — create_instance must register an undo entry (destroy the created instance).
  • WriteGuard / authz: creation is a write op — must respect the NL write-guard/permission tier (#9559).

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
create_instance NL MCP tool (new) operator design steer (2026-06-15) + ADR 0020 possession premise Instantiate any Neo class by className or ntype + config (App-Worker Neo.create); return {id, className}. Optional parentId → also add() it to that container (subsumes create_component). Reject class-ref (module) args (can't cross the wire — the existing ln constraint); reject unknown className/ntype via the existing NL error path; no parentId → standalone instance (no attach) New openapi.yaml operation + skill/reference doc Whitebox agent-MCP-surface e2e: standalone Neo.data.Store verified via inspect_store/get_record; grid-container with parentId verified via get_instance_properties/get_component_tree
create_component / ln (existing) this ticket Decide: deprecate in favor of create_instance(parentId=…), or retain as a thin convenience alias If retained, document as sugar over create_instance openapi.yaml ln op description The ln op still resolves or is redirected
Undo registration #9848 + #13221 create_instance registers an undo entry that destroys the created instance If undo is unsupported for standalone instances, declare it explicitly undo-stack docs undo e2e: created instance reverts

(Surface-Anchor V-B-A: ComponentService.createComponent, the ln op, Neo.create, inspect_store/get_record, undoKind all verified live this session against the running NL server + openapi/source; create_instance is explicitly new — no existing surface asserted.)

Decision Record impact

aligned-with ADR 0020 (Neural Link as the runtime possession/mutation surface). No amendment expected; this generalizes the creation primitive within the ADR's premise. If create_instance replaces create_component, that tool-surface decision is recorded in this ticket's resolution.

Acceptance Criteria

  • A create_instance NL tool instantiates a Neo class by className/ntype + config and returns its live id.
  • It creates a standalone Neo.data.Store (no parentId), verifiable via inspect_store/get_record.
  • With parentId, it creates + attaches a component to a live container (subsumes create_component/ln), verifiable via get_component_tree.
  • It rejects class-reference (module) args and unknown className/ntype via the existing NL error path.
  • It respects the NL write-guard/permission tier (#9559) and registers an undo entry (#9848) that destroys the created instance.
  • Disposition of create_component/ln recorded (deprecate vs retain-as-alias).
  • Whitebox e2e proves it through the agent-facing MCP tool, not only the in-process fixture.

Out of Scope

  • Arbitrary JS evaluation (rejected — the #13362 "arbitrary code execution" trap; this is constrained instantiation by class + config).
  • The inspect_store schema bug (separate friction ticket).
  • Multi-writer / topological locking beyond a single writer.
  • Persisting created instances (Memory Core / Git write-through).

Avoided Traps / Gold Standards Rejected

  • Arbitrary code execution / eval-style creation: rejected — constrained to Neo.create(className|ntype, config), no generated JS.
  • Keeping creation container-only: the trap this ticket fixes — it blocks standalone Store/Model/Controller creation.
  • Passing a class reference (module) over the wire: rejected — can't serialize; className/ntype only.

Related

  • Operator design steer; surfaced by the live NL-tools grid-creation proof (PR #13363 / #13362).
  • Generalizes: create_component / ln (ComponentService.createComponent).
  • Deps: #9848 (transaction/undo stack), #13221/#13286/#13306 (undo/redo slices), #9559 (NL authz). ADR 0020.
  • Agent Harness epic: #13012.

Origin Session ID

0f5d9f1d-0683-452d-aac1-f467297186ac

Handoff Retrieval Hints

query_raw_memories: "create_instance Neural Link general instance creation standalone store supersede create_component"; exact anchors: ComponentService.createComponentcall_method(add); Neo.create.

Live latest-open sweep: checked latest 20 open issues 2026-06-15 (this session); no existing create_instance / general-NL-creation ticket (NL tickets #13221/#13286/#13306 are undo/redo; #9848 transaction stack; #9821 VDOM sync) — net-new.

tobiu closed this issue on Jun 16, 2026, 2:35 AM
tobiu referenced in commit b93a514 - "feat(neural-link): add create_instance tool (#13373) (#13387) on Jun 16, 2026, 2:35 AM