Skip to content

feat: module-migration-02 bundle extraction#332

Merged
djm81 merged 18 commits intodevfrom
feature/module-migration-02-bundle-extraction
Mar 2, 2026
Merged

feat: module-migration-02 bundle extraction#332
djm81 merged 18 commits intodevfrom
feature/module-migration-02-bundle-extraction

Conversation

@djm81
Copy link
Collaborator

@djm81 djm81 commented Feb 28, 2026

Description

Implements module-migration-02-bundle-extraction on the dedicated feature worktree and updates docs/spec artifacts accordingly.

Summary of scope:

  • Migrates/extracts CLI module compatibility paths and bundle-related wiring for the migration wave.
  • Fixes shim/monkeypatch compatibility regressions for plan and repro command paths.
  • Fixes runtime console refresh logic to avoid repeated deprecation-warning amplification.
  • Adds/updates migration tests (unit/integration/e2e) for bundle extraction and module compatibility.
  • Updates OpenSpec artifacts (tasks.md, proposal notes, TDD evidence, import audit) and docs/changelog/version files included in this change set.

Fixes #N/A

New Features #N/A

Contract References: No new public contract surfaces introduced in this PR; behavior validated through existing contract-first test layers and scenario coverage.

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 contract-test-full

Test Quality

  • CLI commands tested with typer test client
  • Edge cases covered with Hypothesis property tests
  • Error handling tested with invalid inputs
  • Rich console output verified manually or with snapshots

How Has This Been Tested?

Contract-First Approach: Regression fixes were validated against the failing command scenarios (plan init interactive flow, repro setup install/warn branches), then validated with full scenario suite.

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
  • Property-based tests cover edge cases
  • Scenario tests cover user workflows
  • All existing tests still pass

Test Environment

  • Python version: 3.12
  • OS: Ubuntu (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 warnings (basedpyright, ruff, pylint)
  • All tests pass locally
  • I have added tests that prove my fix/feature works
  • Any dependent changes have been merged

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 (CLI/module migration work).

@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 self-assigned this Feb 28, 2026
@djm81 djm81 added module-system Module system and registry marketplace Module marketplace features labels Feb 28, 2026
@djm81 djm81 linked an issue Feb 28, 2026 that may be closed by this pull request
djm81 added 6 commits March 1, 2026 00:06
…ation

- Prefer src/<name>/main.py over app.py when SPECFACT_REPO_ROOT is set so
  policy init uses worktree templates.py (SPECFACT_POLICY_TEMPLATES_DIR).
- Policy engine module-package.yaml: version 0.1.5 and re-signed checksum.
- conftest: set SPECFACT_REPO_ROOT, SPECFACT_POLICY_TEMPLATES_DIR; add
  bundle package roots when specfact-cli-modules present.
- Policy engine integration tests: rely on conftest env, clear registry
  and re-register before invoke so loader uses worktree.
- test_reexport_shims: filter deprecation warning for legacy analyze import.

Made-with: Cursor
- backlog and policy_engine __init__.py: import specfact_backlog only in
  __getattr__ (cached), not at module load. Allows loading .src.adapters.*
  for bridge registration without requiring specfact_backlog installed.
- Re-sign backlog and policy_engine module-package.yaml after init changes.
- openspec: update module-migration-02 tasks.md.

Made-with: Cursor
- Apply deferred import (only in __getattr__, cached) to analyze, contract,
  drift, enforce, generate, import_cmd, migrate, patch_mode, plan, project,
  repro, sdd, spec, sync, validate. Matches backlog and policy_engine.
- Prevents ImportError when tests import specfact_cli.modules.<name>.src.*
  without specfact_backlog/specfact_govern/specfact_project/specfact_spec
  installed (e.g. CI). Fixes 78 collection errors.
- Re-sign all affected module-package.yaml manifests.

Made-with: Cursor
@djm81 djm81 added the enhancement New feature or request label Mar 1, 2026
@djm81 djm81 merged commit 039da8b into dev Mar 2, 2026
10 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in SpecFact CLI Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request marketplace Module marketplace features module-system Module system and registry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Change] Bundle Extraction and Marketplace Publishing

1 participant