chore(schemas): track generated JSON Schemas + add drift CI gate#47
Merged
Merged
Conversation
The .gitignore had `dist/` excluding everything under dist/, which silently neutered the `!dist/schemas/*.json` re-includes — git cannot re-include a path whose parent directory is fully excluded. As a result, 10 schemas generated since Step 0.2 (BlobRef, Budget, ChunkRef, Cost, IndexHint, PiiPolicy, PlanNode, QueryPlan, RequestContext, StageEvent) were missing from the repo even though the project intends to commit them for a schema-drift CI gate. Fix: - .gitignore: dist/ -> dist/*, so !dist/schemas/ and the two top-level schema files take effect. - Commit the 10 previously-invisible schemas (regenerated via `rag_core.gen_schemas`). - Add scripts/check_schema_drift.py + `task lint:schemas` to enforce regeneration locally. - Add a `schema-drift` CI job that runs the generator and fails if `git status --porcelain` shows anything modified or untracked under the tracked schema artifacts. Wired into the required `CI passed` gate. Documentation: - docs/guides/schema-drift-gate.md — overview, usage, gitignore rationale, CI wiring, extension points. - docs/README.md updated with the new guide entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 24, 2026
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
.gitignoresodist/schemas/is actually committed. The baredist/rule silently neutered the!dist/schemas/*.jsonre-includes — git cannot re-include a path whose parent directory is fully excluded. Pattern changed todist/*so the re-includes take effect.BlobRef,Budget,ChunkRef,Cost,IndexHint,PiiPolicy,PlanNode,QueryPlan,RequestContext,StageEvent.schema-driftjob in.github/workflows/ci.yml) that regenerates the schemas and fails on any uncommitted change or new file. Also exposed astask lint:schemasfor local use. Wired into the requiredCI passedcheck.Why now
Phase 1 refactor steps (1.1a–1.1f) are adding new domain types every step. Without the gate, each one ships JSON schemas that are silently ignored — which defeats the whole point of committing them for downstream consumers and IaC drift tracking.
How the gate works
task schemasregeneratesdist/schemas/*.jsonfromrag_coretypes.scripts/check_schema_drift.pyrunsgit status --porcelainagainst the tracked schema artifacts and exits non-zero if anything is modified, staged, or untracked.uv sync --all-packages; a PR that touches arag_coretype without regenerating fails theschema-driftjob.Verified locally: after the commit,
python scripts/check_schema_drift.pyexits 0.Documentation
docs/guides/schema-drift-gate.md— overview, usage,.gitignorerationale, CI wiring, extension points.docs/README.md— new guide entry underguides/.Test plan
schema-driftjob passes on this PRtask lint:schemasexits 0 on a clean checkoutrag_coretype without regenerating fails the gate (sanity check on first 1.1d-onward step)🤖 Generated with Claude Code