docs(adr,architecture): finalize ADRs 0005–0009 + extend reviewer checklist (Step 1.1f)#52
Merged
officialCodeWork merged 1 commit intoMay 24, 2026
Conversation
…cklist (Step 1.1f) Closes the Phase-1 refactor window (Steps 1.1a–1.1f) by promoting the five architecture ADRs drafted in #41 from "Accepted (draft)" to "Accepted with implementation-path backlinks", and by extending the reviewer checklist in docs/architecture/performance.md so every ADR has a checklist item reviewers can apply at PR time. - ADR-0005 (PolicyEngine PDP): linked to packages/policy/ implementation files (engine, types, filter, noop, writer) and the policy coverage linter. - ADR-0006 (two-stage rerank): noted that the current single-method SPI is a placeholder; the two-stage shape lands in Step 2.7. - ADR-0007 (BlobRef tiered storage): linked to BlobRef + Chunk.text in rag_core.types and the Storage SPI resolution surface. - ADR-0008 (cost-aware planner): linked to Cost / PlanNode / QueryPlan / Budget / StageEvent in rag_core.types; planner itself in 2.6, fallback rules in 4.2. - ADR-0009 (vector index strategy + quantization): linked to IndexHint / WriteVolume / Embedding.dtype and the two backend implementations (pgvector, qdrant) that already consume the hint. Reviewer checklist extensions in docs/architecture/performance.md: - BlobRef-safe (ADR-0007) — explicit ADR tag added - Plan + budget aware (ADR-0008) — new - Index-hint + dtype honored (ADR-0009) — new - Two-stage rerank shape (ADR-0006) — new for Step 2.7+ Module-level ADR backlinks added to the two SPI files that were missing them: rag_core.spi.reranker (ADR-0006) and rag_core.spi.storage (ADR-0007). All other relevant modules (rag_core.types, rag_core.spi.vector_store, rag_core.spi.{embedding,retrieval,answer}_cache, rag_policy.*, and the vector backends) already carry ADR references from earlier steps. TRACKER.md sync: marks Step 1.1e ✅ with PR #51, marks Step 1.1f 🚧 on the current branch, advances Phase 1 progress to 7 / 16, and updates the "Next action" line to Step 1.2 (Connectors framework) now that the refactor window is closed. Documentation: - docs/adr/ADR-0005-policy-engine.md — implementation table - docs/adr/ADR-0006-two-stage-rerank.md — implementation-status note - docs/adr/ADR-0007-tiered-storage.md — implementation table - docs/adr/ADR-0008-cost-aware-planner.md — implementation table - docs/adr/ADR-0009-vector-index-strategy.md — implementation table - docs/architecture/performance.md — 4 reviewer-checklist items added, all 5 ADRs cross-linked No behaviour changes; ruff + mypy --strict pass on touched files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
officialCodeWork
added a commit
that referenced
this pull request
May 24, 2026
chore(tracker): sync Step 1.1f → ✅ and log PR #52
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
Closes the Phase-1 refactor window (Steps 1.1a–1.1f) by:
docs/architecture/performance.mdso every one of the five ADRs is covered by an explicit item reviewers can apply at PR time.rag_core.spi.reranker(ADR-0006) andrag_core.spi.storage(ADR-0007). All other relevant modules (rag_core.types,rag_core.spi.vector_store, the three cache SPIs,rag_policy.*, the vector backends) already carried ADR references from earlier steps.After this PR, Step 1.2 (Connectors framework) is the next actionable step.
Per-ADR finalization
fast_rerank(ChunkRef) +precise_rerank(Chunk) +should_early_exitfrom day 1.BlobRefChunk.text: str | BlobRef; resolution via existingStorageSPI.QueryPlan/PlanNode/Cost/Budget/StageEvent; planner mutates plan before dispatch.IndexHintselects index by scale tier;Embedding.dtypeenables int8 / binary quantization.Reviewer checklist extensions
docs/architecture/performance.mdalready had 11 items covering ctx-threading, ACL, logging, queue-bounding, Pydantic discipline, PolicyEngine call sites, hydration discipline, Batcher, p99 budgets, cache-key correctness, and BlobRef-safety. This PR:QueryPlan+RequestContext.budget; nodes carryestimated_cost; emitsStageEventfor the online cost estimator. (ADR-0008)VectorIndexBackendcode acceptsIndexHintatinitialize()and respectsEmbedding.dtypeon read and write. (ADR-0009)Rerankerimplementations (Step 2.7+) ship the three-method cascade, not a singlererank(). (ADR-0006)TRACKER sync
Documentation
docs/adr/ADR-0005-policy-engine.mddocs/adr/ADR-0006-two-stage-rerank.mddocs/adr/ADR-0007-tiered-storage.mdBlobRef,Chunk,Storage); reviewer-rule backlink.docs/adr/ADR-0008-cost-aware-planner.mdCost,PlanNode,QueryPlan,Budget,StageEvent); request-context backlink.docs/adr/ADR-0009-vector-index-strategy.mdIndexHint,WriteVolume,Embedding.dtype, vector SPI split, pgvector + Qdrant backends).docs/architecture/performance.mdpackages/core/src/rag_core/spi/reranker.pypackages/core/src/rag_core/spi/storage.pyTRACKER.mdTest plan
uv run ruff checkpasses on touched Python files.uv run mypy --strictpasses on touched Python files.🤖 Generated with Claude Code