Skip to content

Remove entity-type slash commands (/ai-chat, /person, user-defined types) to match the primitives-plus-task rule #2152

Closed

Description

@malibio

Background

core#2133 established the rule: slash commands are for content primitives (text, headers, checkboxes, code, quotes, ordered lists, rules, tables) plus task. Entity types — core and user-defined alike — are not slash-creatable. That decision is recorded in code comments by PR core#2151.

Three surfaces predate the rule and still contradict it. core#2151 documented them as known exceptions explicitly marked as not precedent, but did not change them. This issue tracks removing them.

The replacement creation path already exists

Per @malibio, all of these types are creatable via the sidenav. Verified:

navigation-sidebar.svelte:576–591 lists both builtInSchemas and customSchemas as clickable items → handleSchemaClick (:247) opens a type view tab → query-node-viewer.svelte renders a create button (:627) wired to handleCreateInstance (:535), which calls createSchemaInstance(typeId) and mints a node of that type.

So removing entity-type slash commands strands nothing: person, project, ai-chat (in SIDENAV_CORE_TYPES, stores/schemas.svelte.ts:24) and every user-defined type all reach creation through sidenav → type view → create instance. This removes the main risk and makes all three items below straightforwardly implementable.

Scope

1. /ai-chat

aiChatNodePlugin (core-plugins.ts:631). Set slashCommands: [].

Keep the rest of the plugin registration — ai-chat needs its viewer, reference component, and the deletableViaBackspace: false / acceptsContentMerge: false guards that stop a start-of-node Backspace from destroying a conversation stored in properties.messages.

2. /person

personNodePlugin (core-plugins.ts:662). Set slashCommands: [].

Keep the inline node component (design/components/person-node.svelte) and the hardcoded schema form. Unlike project, person renders inline rather than as an entity row; removing the slash command does not change that.

3. User-defined schema types

createPluginFromSchema (schema-plugin-loader.ts:126–140) unconditionally generates a slash command for every user-defined schema type — define a Venue schema, get /venue. Stop generating it.

  • Five assertions in packages/desktop-app/src/tests/plugins/schema-plugin-loader.test.ts (lines 98, 118, 146, 155, 165) cover the generated command and need to invert.
  • Check whether PLUGIN_PRIORITIES.CUSTOM_ENTITY becomes dead once these commands are gone; delete it if so (no #[allow]-style suppression, no deprecation — remove it).
  • The plugin registration itself still matters for reference components and viewer fallback; only the slashCommands array should empty out.

Acceptance Criteria

  • /ai-chat removed (slashCommands: [], plugin otherwise intact)
  • /person removed (slashCommands: [], inline component and schema form intact)
  • createPluginFromSchema no longer generates slash commands for user-defined types
  • The five affected assertions in schema-plugin-loader.test.ts inverted
  • PLUGIN_PRIORITIES.CUSTOM_ENTITY removed if unused
  • Sidenav → type view → create instance verified working for person, ai-chat, and a user-defined type after the removals
  • Known-exceptions paragraph in core-plugins.ts deleted once all three are retired
  • No remaining entity type carries a slash command — slashCommands non-empty only for primitives + task

Related

  • core#2133 — where the rule was decided
  • core#2151 — records the rule and documents these three exceptions

Activity

  1. malibio commented on Aug 18, 2026

    @malibio
    CollaboratorAuthor

    Ordering dependency: #2153 (an "AI Chats" sidebar section with a "+ New chat" button) should land before the /ai-chat removal here.

    Correcting something I wrote in this issue's body: I listed ai-chat among the types reachable via SIDENAV_CORE_TYPES, but it is not in that set (stores/schemas.svelte.ts:24 holds only task, project, skill, person, agent-guidance). So unlike person, project and the user-defined types — which do reach creation through sidenav → type view → create instance — ai-chat has no sidebar presence today, and /ai-chat is currently its only user-facing creation path.

    Removing /ai-chat before #2153 lands would leave no way to start a conversation. Items 2 and 3 here (/person, user-defined types) are unaffected and can proceed independently.

  2. malibio commented on Aug 18, 2026

    @malibio
    CollaboratorAuthor

    Scope note from @malibio: queries and schema authoring are deferred — both involve complex nested properties, and neither is needed for this issue.

    Concretely, that means nothing here changes:

    • query — query nodes are materialized from the type view when a user filters, sorts, or renames (query-node-viewer.svelte:316), not created from a slash command. Untouched by this issue.
    • Schema type authoring — there is no UI for creating new schema types today; schema-authoring.ts exports only createSchemaInstance, and the schema editor UI is separately deferred (SchemaNodeViewer for Schema Editing (DEFERRED - Backend Complete) #195). Untouched here.

    What this issue depends on is instance creation of existing types (sidenav → type view → create instance), which is unaffected by either deferral. Item 3 (user-defined schema types) remains safe to implement: customSchemas is an unfiltered !s.isCore list (stores/schemas.svelte.ts:36), so every user-defined type already appears in the sidenav and reaches the create-instance button, regardless of how the type itself was authored.

    Full creation-path audit across all 18 core types plus user-defined types found exactly one gap — ai-chat, which #2153 closes. Everything else is covered: primitives keep their slash commands, entity types reach the sidenav type view, collection has its own "+ New collection" button, query is derived, and database-settings is internal (NON_CONTENT_NODE_TYPES).

  3. malibio commented on Aug 18, 2026

    @malibio
    CollaboratorAuthor

    Precedent worth following: /query was already removed this exact way, and it is a working example of the pattern this issue prescribes.

    queryNodePlugin (core-plugins.ts:520) carries slashCommands: [] with the rationale inline:

    No manual /query slash command: it created definition-less query nodes (no targetType/filters) that cannot render. Query nodes are now materialized from a type's default view, or created by AI/MCP. The node, viewer, and reference registrations below are intentionally retained so existing and AI/MCP-created query nodes are unaffected.

    That is precisely the shape prescribed here for /ai-chat and /person: empty the slashCommands array, keep the node/viewer/reference registrations intact, and move creation to a surface that supplies the context the type needs. It also independently supports the rule from #2133 — a slash command mid-outline could not supply a query's targetType/filters, just as it cannot supply an entity's properties.

    Implementers should use queryNodePlugin as the reference implementation rather than inventing the approach, and mirror its comment style so each retired command explains itself in place.

  4. malibio commented on Aug 18, 2026

    @malibio
    CollaboratorAuthor

    Scope clarification from @malibio: the agentic method is the primary way of creating new types, and the UI experience for nested/complex properties is not yet defined.

    That has two consequences worth recording here:

    1. This issue is not blocked on defining that experience. The sidenav create-instance path is the secondary route and already works for flat types; the agent (create_schema / create_node) is the primary one and is well-developed — see the schema-authoring rules in packages/agent/src/skill_rules.rs:50-62 and skill_pipeline.rs, including validation-retry handling and a rule that user-supplied values with no matching field are recorded under a new key rather than silently dropped.

    2. A nested-property gap in createSchemaInstance is out of scope, not a latent bug. It creates instances with properties: {} and lets the schema-driven form fill fields in, which is correct for flat types. Whether that generalizes to nested schemas is part of the undefined UI experience, to be settled when that work is scoped — not a prerequisite for removing slash commands. Deliberately not filing a separate issue for it.

    Nothing in this issue's acceptance criteria changes.

  5. mstomar125 commented on Aug 20, 2026

    @mstomar125
    Contributor

    Done via #2181 (merged as cbe3eebe).

    Summary

    • aiChatNodePlugin and personNodePlugin (core-plugins.ts): slashCommands: []. Everything else (viewer, reference, schema form, deletableViaBackspace/acceptsContentMerge guards) left intact.
    • createPluginFromSchema (schema-plugin-loader.ts): no longer generates a slash command for user-defined schema types. The plugin registration itself is unchanged (still needed for reference/viewer fallback).
    • PLUGIN_PRIORITIES removed entirely from schema-plugin-loader.ts — CUSTOM_ENTITY was its only consumer, and CORE/USER_COMMAND had zero references anywhere else in the repo.
    • The 5 affected schema-plugin-loader.test.ts assertions inverted to assert no slash command is generated.
    • Deleted the resolved "known exceptions" paragraph from core-plugins.ts's slash-command doc comment.

    Regression caught by adversarial review, fixed before merge

    Removing createPluginFromSchema's slash command also removed the only place that carried hasTitleTemplate/titleTemplate into the plugin registry for user-defined types — and a sibling PR merged to main mid-flight (#2179, resolveDisplayTitle) started depending on exactly that data via findSlashCommand(nodeType)?.hasTitleTemplate. Combined, every title_template-driven custom entity would have shown a blank/stale title across outline rows, query list/kanban/table views, the collections sidebar, and tab titles. Fixed by moving hasTitleTemplate/titleTemplate onto PluginDefinition as top-level fields (not slash-command-gated) with new PluginRegistry.hasTitleTemplate()/getTitleTemplate() accessors, and updating every consumer. Two rounds of adversarial review; round 2 also caught and fixed an ASCII-only Unicode-title bug in node-row.svelte, an empty-string edge case in getTitleTemplate(), and removed now-dead code in base-node-viewer.svelte (the custom-entity-slash-command conversion branch, unreachable once no first-party plugin's slash command targets an entity-row type).

    Verification

    Stood up an isolated nodespaced + dev-proxy + vite stack and drove the real app with Playwright: the slash-command dropdown now offers exactly the 11 primitive+task commands (no AI Chat, no Person); sidenav → Schema Types → Person → + New created a new person node; the sidebar's dedicated "AI Chats" section → + New chat opened the chat viewer; sidenav → Schema Types → a fresh user-defined Venue schema → + New created a new venue node. Full frontend suite (227 files / ~4800 tests) green; quality:fix clean (ESLint/tsc/svelte-check/cargo fmt+clippy).

    Acceptance criteria

    • /ai-chat removed (slashCommands: [], plugin otherwise intact)
    • /person removed (slashCommands: [], inline component and schema form intact)
    • createPluginFromSchema no longer generates slash commands for user-defined types
    • The five affected assertions in schema-plugin-loader.test.ts inverted
    • PLUGIN_PRIORITIES.CUSTOM_ENTITY removed (whole PLUGIN_PRIORITIES object was dead, removed)
    • Sidenav → type view → create instance verified working for person, ai-chat (dedicated sidebar section), and a user-defined type — exercised via Playwright against a real daemon
    • Known-exceptions paragraph in core-plugins.ts deleted
    • No remaining entity type carries a slash command — slashCommands non-empty only for primitives + task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions