feat(search): preserve indexing progress and report snapshot coverage - #9
Merged
Conversation
…ement the SDD graph by ... SDD-Mutation: entry-20260906-113911-s-cpt-ikx
Checkpoint for architecture review. Coverage integration and new behavior validation remain incomplete.
…ndently retryable ... SDD-Mutation: entry-20260906-121218-d-tac-ccm
SDD-Mutation: wip-start-20260906-121310-christopher
Implement 20260906-121218-d-tac-ccm.
hlubek
commented
Sep 6, 2026
Extend 20260906-121218-d-tac-ccm after PR review. Preserve branch authority and validate embedding inputs before admission.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Whole-project indexing can repeatedly exceed a deadline without retaining useful progress. This change makes an entry version the durable unit of progress while allowing concurrent entries to share provider batches. Search must still distinguish an incomplete index from a complete search with no matches.
Ownership decisions
PrepareSearch(ctx, target) errorcallback, then derives coverage from published versions and retrieves against those same snapshots. The MCP path uses this application composition. The consumer owns scheduling, retries and waiting policy. Normal wait-budget expiry returns control without asserting completeness; preparation and lazy-iteration failures remain errors.A consumer's existing mutation finalizer and graph-write/recovery protocol remain the starting point for durable write-triggered scheduling. Queue-state APIs, a second prepare/execute search API, within-entry checkpoints, cross-process batching and an event subsystem are outside this change.
Write-triggered and whole-project discovery share OSS eligibility, hashing and descriptor resolution.
DiscoverSearchEntriesQuery.EntryIDsis nil for all entries and otherwise a nonempty set of valid full IDs. Cursors bind the canonical selection as well as revision and index configuration. Valid absent or ineligible entries produce no requirement; selected unreadable documents and source failures remain errors.AppliedMutation.AffectedEntryIDsresolves document changes, deletions and attachment owners without asking consumers to parse SDD paths. It supplies only a selection. A consumer must establish durable exact-source retention before enqueueing discovery, potentially using a finalized Git revision instead of an earlier workspace revision. Mutations affecting no entries create no discovery job.Review considerations
Start with the composition examples, then review target preparation and coverage and publication visibility. The package Go documentation and mutation finalizer example describe consumer adoption. The approved graph plan records the reasoning; its done signal is deliberately deferred until after the first review round. The branch also includes an existing conceptual event-stream signal from its local base; no event-stream implementation is included.
Compatibility and cost choices worth examining:
Validation
devbox run testpassed for the root and nested example modules; vet, the lint wrapper, targeted race checks and build/view smoke checks passed. Lint retains 50 existing test-package warnings.Application and MCP tests cover local and external-consumer composition, fixed snapshots, causal freshness, explicit failures and incomplete versus complete zero-match results. Publication and batcher tests cover zero chunks, retries, cancellation, shutdown, oversized admission and unpublished-row exclusion.
A real Ollama exercise killed the indexing process after two publications. Restart preserved and skipped those entries, completed healthy siblings despite one injected failure, and eventually published all 17 entries. A final attempt performed no document embedding. Provider measurements, cost benchmarks and reproduction commands are staged as a graph attachment for the deferred completion capture; they are no longer kept as package Markdown.
Review-extension regressions cover selection normalization and cursor compatibility, unreadable versus absent entries, skipped attachment reads, attachment-only/deleted entry mapping, finalized-source scheduling, branch preservation through preparation/coverage/retrieval, and zero provider calls for invalid trailing input. The two package Markdown files are removed; API guidance lives in Go docs and examples.