Skip to content

feat: Core Contracts and Module Interface Formalization#209

Merged
djm81 merged 4 commits intodevfrom
feature/arch-04-core-contracts-interfaces
Feb 8, 2026
Merged

feat: Core Contracts and Module Interface Formalization#209
djm81 merged 4 commits intodevfrom
feature/arch-04-core-contracts-interfaces

Conversation

@djm81
Copy link
Collaborator

@djm81 djm81 commented Feb 8, 2026

Description

Implements OpenSpec change arch-04-core-contracts-interfaces with contract-first module interfaces, core/module isolation checks, schema-versioned module metadata, and documentation updates.

Fixes #206

Cross-repo reference #206

New Features #206

Contract References

  • src/specfact_cli/contracts/module_interface.py (ModuleIOContract)
  • src/specfact_cli/models/validation.py (ValidationReport)
  • src/specfact_cli/registry/module_packages.py (_check_protocol_compliance, _check_schema_compatibility)
  • src/specfact_cli/modules/{backlog,sync,plan,generate,enforce}/src/commands.py (module IO contract operations)

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 📚 Documentation update
  • 🔒 Contract enforcement (adding/updating @icontract decorators)
  • 🧪 Test enhancement (scenario tests, property-based tests)
  • 🔧 Refactoring (code improvement without functionality change)

How Has This Been Tested?

Automated Testing

  • hatch run pytest tests/unit/contracts/test_module_io_contract.py -v
  • hatch run pytest tests/unit/test_core_module_isolation.py -v
  • hatch run pytest tests/unit/models/test_project_bundle_schema.py -v
  • hatch run pytest tests/unit/models/test_module_package_metadata.py -v
  • hatch run pytest tests/unit/registry/test_module_protocol_validation.py -v
  • hatch run pytest tests/unit/modules/ -k test_module_io_contract -v
  • hatch run contract-test
  • hatch test --cover -v (1 flaky failure observed in full-suite run; targeted rerun passed)
  • openspec validate arch-04-core-contracts-interfaces --strict

Deliverables

  • ModuleIOContract protocol and ValidationReport model
  • AST-based core-module isolation test + CI workflow enforcement step
  • ProjectBundle schema_version field
  • Module package metadata extensions (schema_version, protocol_operations)
  • Module discovery protocol/schema compatibility checks and logging
  • Module IO contract functions for backlog/sync/plan/generate/enforce
  • New docs: ProjectBundle schema + module contracts; architecture/nav/README updates

- Create ModuleIOContract protocol with four core operations

- Add static analysis enforcement preventing core->module imports

- Add ProjectBundle schema versioning (schema_version field)

- Update 5 modules to implement ModuleIOContract

- Add protocol compliance tracking in module discovery

- Create docs for ProjectBundle schema and module contracts

- Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@djm81 djm81 moved this from Todo to In Progress in SpecFact CLI Feb 8, 2026
@djm81 djm81 self-assigned this Feb 8, 2026
@djm81 djm81 added enhancement New feature or request change-proposal Proposal for a new change labels Feb 8, 2026
@djm81 djm81 linked an issue Feb 8, 2026 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Feb 8, 2026

SpecFact CLI Validation Report

All validations passed!
Duration: 26.58s
Checks: 4 total (3 passed) (1 skipped)

@djm81
Copy link
Collaborator Author

djm81 commented Feb 8, 2026

Full pipeline run skipped due to technical slowness. Local verification of all lints, type-checks, tests, etc. was successful.

@djm81 djm81 merged commit 04aba4b into dev Feb 8, 2026
2 of 12 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in SpecFact CLI Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change-proposal Proposal for a new change enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Core Contracts and Module Interface Formalization

1 participant