zz_

app/worker/migrations/0008_ladder_index.sql

zzmq.dev@gmail.com/zz / app / worker / migrations / 0008_ladder_index.sql @ 9b4341e0 Download
Ladder Summary
  • file The file defines a SQLite full‑text search virtual table named **`ladder_index`** using the `fts5` extension. The table stores searchable summaries of “ladder” rungs (only those of kind `file` or `repo`), keyed by the artifact’s name, path, and kind, enabling efficient cross‑repo queries for ecosystem‑wide intelligence. **Exports:** This is a plain SQL migration script; it does not export any functions or classes.
 -- A full-text index over Ladder rung summaries, across every repo --
 -- "ecosystem-wide intelligence" needs to be findable, not just
 -- generated. Keyed by artifacts_name (the DO's own identity, what it
 -- actually has on hand when writing a rung), not slug -- search-time
 -- queries join against repos to resolve slug/visibility, same split
 -- as repos.artifacts_name vs repos.slug everywhere else.
 -- Only "file" and "repo" kind rungs get indexed (see
 -- cloudflareBackend.ts's writeLadder) -- those are the ones holding a
 -- holistic, current-state summary of what something actually does;
 -- "changeset"/"filechange" are historical per-commit entries, not
 -- reusable-code descriptions, and would just churn the index on every
 -- commit.
 CREATE VIRTUAL TABLE ladder_index USING fts5(
  artifacts_name UNINDEXED,
  path UNINDEXED,
  kind UNINDEXED,
  summary
 );