[RAG Projection] Add revision-aware derived indexing and rebuilds - #6
Merged
Conversation
Implement bounded revision-aware projection, truthful failure and checkpoint behavior, destructive rebuild support, deterministic tests, clean import and artifact checks, and the standalone caller integration guide.\n\nRefs #3
There was a problem hiding this comment.
Pull request overview
This PR introduces a new generic_rag.projection module that orchestrates deterministic, revision-aware document projection (chunking → embedding → replace/delete) and a destructive rebuild workflow (reset → replace-all), while keeping all resources caller-owned via Borrowed and maintaining the package’s provider-neutral boundary.
Changes:
- Add revision-aware projection orchestration APIs (
project_documents,rebuild_projection) with content-free failure translation and truthful receipts/manifests. - Extend contracts and ports to support bounded chunking/limits/state snapshots/results, plus a
VectorIndexResetterport for corpus resets. - Add extensive deterministic test coverage and update docs/module index/CI/artifact checks for the new module.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/generic_rag/projection.py |
New projection orchestration module with incremental + rebuild workflows and deterministic planning/receipt behavior. |
src/generic_rag/contracts.py |
Add projection request/manifest/state/result value contracts and related validation. |
src/generic_rag/ports.py |
Add VectorIndexResetter protocol to support destructive corpus resets. |
tests/test_projection.py |
New end-to-end determinism/lifecycle/failure tests for projection workflows. |
tests/test_projection_contracts.py |
Add contract tests for new projection value types and state/result invariants. |
tests/test_ports.py |
Extend port export/protocol tests to cover VectorIndexResetter. |
tests/test_package_boundaries.py |
Include projection module in boundary/export/dependency checks and strengthen isolated import probing. |
tests/support/clean_import_probe.py |
Add --source-root support and verify imported modules originate from the expected source tree. |
tests/support/verify_artifacts.py |
Update expected artifact inventory to include generic_rag/projection.py. |
README.md |
Update README to document projection workflows and the new module boundary. |
docs/projection.md |
New projection lifecycle/behavior guide with state matrix and deterministic identity details. |
docs/api.md |
Extend API reference for projection values, ports, and workflows. |
docs/lifecycle.md |
Document projection call scope and reinforce Borrowed ownership semantics. |
docs/security-and-privacy.md |
Update privacy/security boundary to include projection adapter effects and limits. |
PYTHON_MODULE_INDEX.md |
Add the projection module to the module index with updated parity and responsibilities. |
.github/workflows/ci.yml |
Add generic_rag.projection to CI isolated-import checks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Document that only compatible present state is projected and that incompatible snapshots raise before collaborator effects.\n\nRefs #3
6 tasks
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.
Summary
Boundary
This child implements projection only. The package remains standalone, synchronous, provider-neutral, runtime-dependency-free, and unaware of story-writing-agents, storage engines, vendors, credentials, or application lifecycle. Retrieval, fusion, and user/agent query composition remain Issue #4; the package root remains empty.
Applications authorize documents before constructing a complete
ProjectionRequest, inject their own adapters throughBorrowed, persist a successful manifest as application-owned state, useproject_documentsfor compatible incremental updates, and reserverebuild_projectionfor explicit destructive bootstrap or recovery.Verification
Refs #3