/improve_plan @thoughts/shared/plans/2026-04-07-dotlightfast-context-indexing.md also…
- User
/improve_plan @thoughts/shared/plans/2026-04-07-dotlightfast-context-indexing.md also ensure better naming and ensure that this will eventually allow us to migrate easily to full dynamic repo style + pinecone embedding for the whole of the repo for data.
- User
improve_plan /improve_plan @thoughts/shared/plans/2026-04-07-dotlightfast-context-indexing.md also ensure better naming and ensure that this will eventually allow us to migrate easily to full dynamic repo style + pinecone embedding for the whole of the repo for data.
Assistant· claude-opus-4-6
Good, I've read the full plan. Now let me spawn parallel research agents to understand the codebase areas it touches.
Assistant· claude-opus-4-6
Let me also read the vector indexing research since it directly informs the migration concern.
Assistant· claude-opus-4-6
Assistant· claude-opus-4-6
Good choices. Before I edit the plan, let me check one thing that could make detection fully DB-only (zero API calls).
Assistant· claude-opus-4-6
Important finding:
githubProviderConfigSchema(packages/app-providers/src/providers/github/auth.ts:66-68) explicitly prohibits storing repo names:NEVER add display names (repoName, orgName, slug, description, visibility) — these change on the provider side without our involvement and become stale.
So detection always requires at least one API call to resolve
providerResourceId→ name. But we can optimize to one call per installation (group integrations byinstallationId).Now, before editing — the spike question:
Assistant· claude-opus-4-6
Now I'll edit the plan in-place. This requires many targeted changes across the entire file. Let me work through it systematically.
Assistant· claude-opus-4-6
Now the desired end state section:
Assistant· claude-opus-4-6
Now update the implementation approach summary:
Assistant· claude-opus-4-6
Now the big Phase 1 schema rewrite:
Assistant· claude-opus-4-6
Now update the table registration:
Assistant· claude-opus-4-6
Now Phase 2 — the big router rewrite with fixed detection logic:
Assistant· claude-opus-4-6
Now update the router registration:
Assistant· claude-opus-4-6
Now update the Phase 2 success criteria:
Assistant· claude-opus-4-6
Now Phase 3 — rename the Inngest function:
Assistant· claude-opus-4-6
Now update the Inngest function internals to use new table names:
Assistant· claude-opus-4-6
Now update the
contentfield references tocachedContentin the Inngest function and other places:Assistant· claude-opus-4-6
Now update the Inngest registration:
Assistant· claude-opus-4-6
Now update Phase 3 success criteria:
Assistant· claude-opus-4-6
Now Phase 4 — Settings UI:
Assistant· claude-opus-4-6
Now update the client component:
Assistant· claude-opus-4-6
Now the loading skeleton:
Assistant· claude-opus-4-6
Phase 4 success criteria:
Assistant· claude-opus-4-6
Now Phase 5 — prompt injection renames:
Assistant· claude-opus-4-6
Now update Phase 5 success criteria:
Assistant· claude-opus-4-6
Now update the testing and unit test sections:
Assistant· claude-opus-4-6
Now update the performance considerations:
Assistant· claude-opus-4-6
Update the references section:
Assistant· claude-opus-4-6
Finally, add the improvement log:
Assistant· claude-opus-4-6
The plan has been updated. Here's a summary of what changed:
Naming — Unified all domain terms to
repoIndex:- Table:
orgContextConfigs→orgRepoIndexes(SQL:lightfast_org_repo_indexes) - Router:
context→repoIndex - Inngest:
contextSync→platformRepoIndexSync(id:platform/repo-index.sync) - Prompt:
answerDotlightfastSection→answerRepoIndexSection - Type:
UserContext.org.dotlightfast→UserContext.org.repoIndex - UI:
/settings/context→/settings/repo-index
Schema for Pinecone migration — Added
lastSyncCommitSha(incremental sync),indexingStatus(lifecycle tracking), renamedcontent→cachedContent(signals it's temporary).Fixed bugs — Removed dead
get-repocall with empty params, fixed detection to group byinstallationId(1 API call per installation, not N), added missing / imports.- Table:
- User
soexplain this implement in a few bullet points
Assistant· claude-opus-4-6
- Users create a
.lightfastrepo on GitHub and connect it as a Source — this repo acts as an org-level context file for the AI agent - On activation, Lightfast fetches the repo's
README.md, caches it in a neworgRepoIndexesDB table, and injects it into the Answer agent's system prompt as a high-priority section - On every push webhook, an Inngest function (
platformRepoIndexSync) automatically re-fetches and updates the cached content — so edits to README.md are reflected in seconds - Settings > Repo Index page lets users see connection status, activate/deactivate indexing, and view last sync time
- Day 1 is README.md only, but the table schema and naming (
repoIndex,cachedContent,lastSyncCommitSha,indexingStatus) are designed so that full multi-file vector indexing via Pinecone can be added later without renaming or restructuring
- Users create a
- User
question, when does this become it's own "pinecone" pipeline?
Assistant· claude-opus-4-6
It doesn't need to — at least not yet. The inflection points:
-
Day 1 (this plan): One file (README.md), raw text cached in DB, injected verbatim into the system prompt. Works because
.lightfastcontent is small and the 4K token budget forhighpriority sections is plenty. -
Pinecone becomes necessary when:
- You index more than README.md — multiple files means content exceeds what fits in a single prompt section, so you need semantic retrieval (query Pinecone → return relevant chunks) instead of dumping everything in
- You want semantic search over org context — "what does our team do about X?" queries the
layer: "repo-index"vectors instead of relying on the full text being in the prompt - You support multi-repo indexing — multiple repos per org means the content volume makes raw injection impossible
-
- User
cool. all good then for now we good with this plan?
Assistant· claude-opus-4-6
Yes, the plan is ready to implement. The naming is future-proof (
repoIndex), the schema has the right columns for the Pinecone migration later, and the detection logic is fixed. Good to go.