Skip to content

feat: Schema Extension System for Modular ProjectBundle Extensions (arch-07)#265

Merged
djm81 merged 7 commits intodevfrom
feature/arch-07-schema-extension-system
Feb 16, 2026
Merged

feat: Schema Extension System for Modular ProjectBundle Extensions (arch-07)#265
djm81 merged 7 commits intodevfrom
feature/arch-07-schema-extension-system

Conversation

@djm81
Copy link
Copy Markdown
Collaborator

@djm81 djm81 commented Feb 16, 2026

Description

Schema extension system (arch-07) for modular ProjectBundle extensions: modules can extend Feature and ProjectBundle with namespaced custom fields without modifying core models. Adds extensions dict, get_extension/set_extension accessors, optional schema_extensions in module-package.yaml, and ExtensionRegistry with collision detection. Includes docs, quality gate fixes (format, type-check), and version 0.33.0.

Fixes #213

New Features #213

Contract References: @icontract and @beartype on Feature.get_extension/set_extension, ProjectBundle.get_extension/set_extension, SchemaExtension validation, ExtensionRegistry.register/get_extensions/list_all.

Type of Change

Please check all that apply:

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔒 Contract enforcement (adding/updating @icontract decorators)
  • 🧪 Test enhancement (scenario tests, property-based tests)
  • 🔧 Refactoring (code improvement without functionality change)

Contract-First Testing Evidence

Required for all changes affecting CLI commands or public APIs:

Contract Validation

  • Runtime contracts added/updated (@icontract decorators on public APIs)
  • Type checking enforced (@beartype decorators applied)
  • CrossHair exploration completed: hatch run contract-test-exploration
  • Contract violations reviewed and addressed

Test Execution

  • Contract validation: hatch run contract-test-contracts
  • Contract exploration: hatch run contract-test-exploration
  • Scenario tests: hatch run contract-test-scenarios
  • Full test suite: hatch run smart-test / hatch test --cover -v

Test Quality

  • CLI commands tested with typer test client
  • Edge cases covered (namespace validation, collision, serialization)
  • Error handling tested with invalid inputs
  • Rich console output verified manually or with snapshots

How Has This Been Tested?

Contract-First Approach: New unit tests in tests/unit/models/test_schema_extensions.py, tests/unit/models/test_module_package_metadata.py, tests/unit/specfact_cli/registry/test_extension_registry.py; TDD evidence in openspec/changes/arch-07-schema-extension-system/TDD_EVIDENCE.md.

Manual Testing

  • Tested CLI commands manually
  • Verified rich console output
  • Tested with different input scenarios
  • Checked error messages for clarity

Automated Testing

  • Contract validation passes
  • Scenario tests cover extension field and registry behavior
  • All existing tests still pass (merge with dev verified)

Test Environment

  • Python version: 3.11
  • OS: Linux

Checklist

  • My code follows the style guidelines (PEP 8, ruff format, isort)
  • I have performed a self-review of my code
  • I have added/updated contracts (@icontract, @beartype)
  • I have added/updated docstrings (Google style)
  • I have made corresponding changes to documentation
  • My changes generate no new errors (basedpyright 0 errors; existing warnings unchanged)
  • All tests pass locally
  • I have added tests that prove my fix/feature works
  • Any dependent changes have been merged (merged origin/dev)

Quality Gates Status

  • Type checking ✅ (hatch run type-check)
  • Linting ✅ (hatch run lint)
  • Contract validation ✅ (hatch run contract-test-contracts)
  • Contract exploration ✅ (hatch run contract-test-exploration)
  • Scenario tests ✅ (hatch run contract-test-scenarios)

Screenshots/Recordings (if applicable)

N/A — model and registry changes; no CLI UI change.


OpenSpec Change: arch-07-schema-extension-system

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architecture Architecture and design changes enhancement New feature or request module-system Module system and registry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Schema Extension System for Modular ProjectBundle Extensions

1 participant