Promote GT-541 to main — RAG grounding + delta-sync workflow (board 529/551)#193
Conversation
Closes the RAG operational loop:
- .github/workflows/rag-index-sync.yml: a reference/**/*.md commit triggers the delta
re-embed (14-rag-index-sync.mjs: HEAD~1..HEAD diff → upsert only changed chunks + prune
stale → receipt), with masked provider credentials (dry-run unless a durable provider
is configured).
- The runtime now GROUNDS before recommending: it queries IKnowledgePort with the request
intent and records trace.groundedBy { corpusVersion, citations }, so a recommendation is
traceable to the exact indexed corpus release. KnowledgeChunk carries corpusVersion (the
pgvector adapter returns rag_chunks.corpus_version). Best-effort — a corpus outage never
blocks the governed run.
Verified: agent-runtime 123/123 (+2 grounding tests); a reference/ commit → 14-rag-index-sync
detects 2 changed files + emits a receipt (delta re-embed).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…529/551) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📊 Bilingual Coverage ImpactPR Changes
Repository Coverage
✅ Good: All EN changes have ES counterparts. Generated by GitHub Actions |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ada5db663f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| node-version: '22' | ||
|
|
||
| - name: RAG delta sync (dry-run unless a durable provider is configured) | ||
| run: node .harness/scripts/ci/14-rag-index-sync.mjs |
There was a problem hiding this comment.
Install pg before enabling live sync
When EVOLITH_RAG_SYNC=true and EVOLITH_RAG_PROVIDER=pgvector, the pgvector adapter lazy-imports pg, but this job runs the script immediately after setup-node with no dependency install, and pg is not declared in the lockfile. On a clean Actions runner the live path fails closed before any upsert, so the new workflow can only dry-run unless the job installs/bundles the Postgres client or injects a client.
Useful? React with 👍 / 👎.
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 2 # HEAD~1..HEAD delta |
There was a problem hiding this comment.
This fetches only enough history for the script's HEAD~1..HEAD diff, so a push containing multiple commits to main/develop is reduced to the last commit. If an earlier commit in the same push changes or deletes a reference/**/*.md file, the path filter still triggers the workflow, but those chunks are never upserted or pruned; fetch and diff the full ${{ github.event.before }}..${{ github.sha }} range instead.
Useful? React with 👍 / 👎.
GT-541 (P2) — closes the RAG operational loop:
.github/workflows/rag-index-sync.yml: areference/**/*.mdcommit triggers the delta re-embed (upsert only changed chunks + prune stale → receipt), masked provider credentials, dry-run unless a durable provider is configured.IKnowledgePortwith the request intent and recordstrace.groundedBy { corpusVersion, citations }, so a recommendation is traceable to the exact indexed corpus release.KnowledgeChunkcarriescorpusVersion(pgvector returnsrag_chunks.corpus_version). Best-effort — a corpus outage never blocks the run.Verified: agent-runtime 123/123 (+2 grounding tests); a
reference/commit → the sync detects 2 changed files + emits a delta receipt. Guard 08 green (551/511). Board 528→529.🤖 Generated with Claude Code