Skip to content

Queue unembedded embedding roots when the embedding service starts #4252

Closed

Description

@mstomar125

Overview

Decisions, specs and plans are embedding roots since the change that made semantic search find them. A database that already holds decisions does not get them embedded: nothing marks an existing decision stale, restarting the daemon queues nothing, and there is no sweep for unembedded roots. An untouched decision stays unsearchable by meaning until it is edited or its source is re-imported with replace.

Problem Statement

  • The change is merged; its description measured this on a scratch database: the existing decision, spec and plan nodes are not embedded and nothing re-queues them.
  • Any root that missed embedding for another reason (an interrupted run, a model that was not ready, a type that became embeddable) has the same gap, because the only way back in is an edit.

Proposed Solution

Not a migration: a general sweep. When the embedding service starts and the model is ready, find root nodes of embeddable types that have no embedding and no stale marker, and queue them (the store already has requeue_root_embeddings and get_stale_embedding_root_ids). It heals every cause at once and carries no version check or upgrade step, which the project's no-migration rule requires.

The alternative is to accept the gap: there are no users yet, and a development database can be reset. That is a decision for the architect; this issue is written for the sweep.

Acceptance

  • On start, unembedded roots of embeddable types are queued exactly once and get embedded.
  • A root that already has an embedding or a stale marker is not queued again.
  • A test on a scratch database, with no model loaded (the queue is observed, not run).

🤖 Generated with Claude Code

Activity

  1. self-assigned this
    on Nov 5, 2026
  2. mstomar125 commented on Nov 6, 2026

    @mstomar125
    ContributorAuthor

    Picking this up (sweep drain).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions