Skip to content

Keep archived nodes out of the @ mention picker #3428

Closed

Description

@malibio

Overview

The @ mention picker offers archived nodes. An archived node shouldn't participate anywhere it isn't explicitly asked for: search, mentions, lists or automation. Semantic search already excludes archived nodes (packages/core/src/ops/search_ops.rs, the include_archived check), but the mention picker doesn't.

Problem Statement

SqliteStore::mention_autocomplete (packages/core/src/db/sqlite_store/search.rs) runs:

SELECT * FROM node WHERE title IS NOT NULL
  AND node_type NOT IN ('collection', 'schema', 'ai-chat')
  AND LOWER(title) LIKE ?1 ESCAPE '\' LIMIT n

There's no lifecycle_status condition, so typing @ plus part of an archived node's title offers that node, and selecting it writes a mention of a node the user archived.

Proposed Solution

Add lifecycle_status = 'active' to the query, so archived nodes are excluded. Keep the existing type exclusions unchanged; they're tracked separately with the schema alignment work.

Acceptance Criteria

  • mention_autocomplete returns no node whose lifecycle_status is archived (test: an active and an archived node with matching titles; only the active one is returned)
  • Unarchiving the node makes it appear again (test)
  • The existing mention autocomplete tests pass (wildcard escaping; dates offered, schemas not)
  • bun run test:changed passes; bun run quality:fix clean

Technical Specifications

Reference Files

  • Query: packages/core/src/db/sqlite_store/search.rs (mention_autocomplete)
  • Service: packages/core/src/services/node_service/query.rs (NodeService::mention_autocomplete)
  • Daemon RPC: packages/daemon/src/services/node_service.rs (mention_autocomplete)
  • Precedent: packages/core/src/ops/search_ops.rs (semantic search's archived filter)

Architecture Impact

No prior ADR covers the picker's lifecycle filtering. This aligns it with the agreed rule that archived nodes don't participate anywhere. That rule will later move into one shared participation check, which will replace this condition along with every other scattered lifecycle_status comparison.

Non-Goals

  • The shared participation check itself
  • Replacing the literal type-exclusion list with a per-type "mentionable" rule

Activity

  1. malibio commented on Oct 1, 2026

    @malibio
    CollaboratorAuthor

    Baseline — Frontend: 298 test files passed (5510 tests), 0 failed.

  2. self-assigned this
    on Oct 1, 2026
  3. added a commit that references this issue on Oct 1, 2026
    ca3986e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions