[RAG Runtime] Deliver a dependency-free generic RAG package - #7
Merged
Conversation
Deliver the standalone provider-neutral contract package, packaging boundary, CI, tests, documentation, and module index. Refs #2
4 tasks
7 tasks
Implements and documents the final generic-rag retrieval leaf. Closes #4.
There was a problem hiding this comment.
Pull request overview
This PR finalizes the standalone, dependency-free generic-rag Python package by delivering the full projection + retrieval runtime surface (contracts, ports, integrity helpers, retrieval workflows), plus the accompanying verification tests, CI checks, and public documentation needed for independent consumers.
Changes:
- Add deterministic projection-integrity helpers and bounded semantic + hybrid retrieval workflows (rank-only fusion, current-revision filtering, score-free hits).
- Expand contract/boundary verification with extensive unit tests and artifact/import probes to enforce “no deps / no side effects / exact exports / exact module inventory”.
- Publish end-to-end documentation (API reference + lifecycle/security guides) and formalize packaging/CI metadata for clean wheel/sdist installs.
Reviewed changes
Copilot reviewed 41 out of 42 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/test_retrieval_contracts.py |
Adds contract tests for retrieval values (limits/query/hit/result invariants). |
tests/test_projection_integrity.py |
Adds golden + validation tests for extracted integrity hashing/token logic. |
tests/test_ports.py |
Adds contract tests for injected collaborator protocols and Borrowed semantics. |
tests/test_package_boundaries.py |
Enforces export surface, module inventory, dependency graph, and clean-import boundaries. |
tests/test_errors.py |
Verifies the public error hierarchy and __all__ surface. |
tests/test_contract_values.py |
Validates immutable value-object contracts (documents/fragments/embeddings). |
tests/support/verify_artifacts.py |
Verifies wheel/sdist contents, metadata, and safety constraints. |
tests/support/clean_import_probe.py |
Implements isolated-process import probe to detect forbidden side effects/imports. |
src/generic_rag/retrieval.py |
Implements bounded semantic retrieval + deterministic hybrid fusion (RRF rank-only). |
src/generic_rag/py.typed |
Marks the package as typed (PEP 561). |
src/generic_rag/projection_integrity.py |
Extracts deterministic integrity derivation/validation used by projection + retrieval. |
src/generic_rag/ports.py |
Defines the injected provider protocols and caller-owned Borrowed[T] wrapper. |
src/generic_rag/errors.py |
Defines the public error categories and exported surface. |
src/generic_rag/__init__.py |
Keeps the package root importable with an intentionally empty facade/export list. |
README.md |
Provides installation, host integration guidance, and verification commands. |
PYTHON_MODULE_INDEX.md |
Records the 7-module inventory, responsibilities, and dependency direction. |
pyproject.toml |
Defines packaging metadata, dependency groups, and tool configuration (ruff/mypy). |
GITHUB_WORKFLOW.md |
Documents the repo’s GitHub planning/traceability workflow policy. |
docs/security-and-privacy.md |
Documents the security/privacy boundary and host responsibilities. |
docs/retrieval.md |
Documents retrieval workflows, fusion semantics, outcomes, and a runnable example. |
docs/projection.md |
Documents projection lifecycle/state matrix and integrity algorithm usage. |
docs/lifecycle.md |
Documents explicit resource ownership and Borrowed lifecycle guarantees. |
docs/api.md |
Publishes the supported import surface, contracts, ports, and workflows. |
DEPENDENCY_POLICY.md |
Establishes the project’s dependency rules and lock-file expectations. |
COMMIT_POLICY.md |
Establishes commit hygiene and messaging requirements. |
AGENTS.md |
Documents the repository engineering workflow used by agents/contributors. |
AGENT_TASK_RUNBOOK.md |
Provides the step-by-step runbook for GitHub-tracked task execution. |
.github/workflows/ci.yml |
Adds CI to run tests/lint/type/build/import and artifact verification. |
.codex/repository-engineering-kit.lock.json |
Locks the repo-engineering kit installation details and managed assets. |
.codex/agents/test_engineer.toml |
Adds role guidance for test engineering in this repo. |
.codex/agents/runtime_implementer.toml |
Adds role guidance for production implementation in this repo. |
.codex/agents/requirements_analyst.toml |
Adds role guidance for requirements analysis in this repo. |
.codex/agents/regression_diagnostician.toml |
Adds role guidance for regression diagnosis in this repo. |
.codex/agents/modularity_maintainer/PYTHON_MODULARITY_POLICY.md |
Adds the Python modularity policy used to govern module boundaries/indexing. |
.codex/agents/modularity_maintainer.toml |
Adds role guidance for modularity/index ownership in this repo. |
.codex/agents/documentation_maintainer.toml |
Adds role guidance for documentation maintenance in this repo. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Integration status
Boundary
This parent branch delivers the independently installable, Python 3.11+, runtime-dependency-free
generic-ragpackage. It remains provider-neutral and has no story-writing-agents, SQLite/MySQL, vendor, credential, network, dynamic-loading, authorization, citation, or authoritative application-data dependency. Hosts explicitly inject and own every provider/resource and must reauthorize/revalidate/cite retrieved source data before user or agent use.Verification
Closes #1