improve schema for scalability and maintainability - #6
Merged
Conversation
### **The Solution: Separation of Concerns**
**1️⃣ Schema stays LEAN** — vitals.schema.json
**2️⃣ Governance lives in manifest** — vitals.schema-manifest.yml
```yaml
domain: vitals
current_version: "2.1.1"
compatibility_class: PATCH
breaking_changes_from:
"2.0.0":
- field: creatinine
migration: "Publishers must compute creatinine..."
```
✅ Explicitly documents breaking changes, migration guides, upgrade paths
**3️⃣ Release notes in changelog** — CHANGELOG.md
```markdown
## [2.1.1] - 2026-05-10
### Compatibility
PATCH (documentation-only)
```
✅ Humans read this for release notes; CI validates consistency
### **What's New**
| File | Purpose |
|------|---------|
| SCHEMA-VERSIONING.md | Quick reference for consumers/publishers |
| schema-design-strategy.md | Full design rationale & patterns |
| vitals.schema-manifest.yml | Governance metadata (version, breaking changes, compatibility) |
### **How Consumers Use It**
```python
# 1. Extract version from payload
version = payload['version'] # "2.1.1"
# 2. Load version-specific schema from Git tag
schema = git_show(f'v{version}:schemas/vitals/vitals.schema.json')
# 3. Validate payload
ajv.validate(payload, schema)
# 4. Check upgrade safety (if upgrading)
manifest = yaml.load(open('schemas/vitals/vitals.schema-manifest.yml'))
if manifest['breaking_changes_from']['2.0.0']:
print("⚠️ Upgrade requires code changes")
```
### **For Multi-Domain Scalability** (Future)
Each domain gets:
- `schemas/domain/domain.schema.json` (clean payload schema)
- `schemas/domain/domain.schema-manifest.yml` (governance)
- `schemas/domain/DOMAIN-CHANGELOG.md` (release notes)
All domains share:
- VERSION (global SemVer)
- CHANGELOG.md (unified releases)
- compatibility_guard.py (validates all domains)
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.
The Solution: Separation of Concerns
1️⃣ Schema stays LEAN — vitals.schema.json
2️⃣ Governance lives in manifest — vitals.schema-manifest.yml
✅ Explicitly documents breaking changes, migration guides, upgrade paths
3️⃣ Release notes in changelog — CHANGELOG.md
✅ Humans read this for release notes; CI validates consistency
What's New
How Consumers Use It
For Multi-Domain Scalability (Future)
Each domain gets:
schemas/domain/domain.schema.json(clean payload schema)schemas/domain/domain.schema-manifest.yml(governance)schemas/domain/DOMAIN-CHANGELOG.md(release notes)All domains share: