spec-kit
spec-kit copied to clipboard
feat(integration): add status reporting
Summary
- add
specify integration statusfor read-only integration status reporting - report default/installed integrations, multi-install safety, manifest health, and missing/modified managed files
- document the command and cover healthy/unhealthy status cases
Closes #2671
Maintainer feedback
- Renamed the originally proposed
integration doctorcommand tointegration statusafter maintainer feedback in #2671.
Review feedback
- Removed the private manifest hash helper import by hashing locally in the status module.
- Reused a single
integration.jsonread for raw and normalized state. - Avoided repeated project-root resolution during manifest file checks.
- Added JSON coverage for warning/error status branches.
- Documented exit-code semantics for CI/agent consumers.
- Rejected unsafe integration keys before constructing manifest paths.
- Escaped project-controlled values before rendering Rich status output.
- Rejected filename-invalid and Windows-reserved manifest keys.
- Kept reported installed integrations aligned with the raw state used for manifest checks.
- Replaced managed-file
exists()prechecks with explicitlstat/stathandling. - Avoided impossible
integration upgrade <unknown>suggestions for stale unknown integrations. - Clarified raw recorded vs effective installed integrations in JSON status output.
- Kept manifest checks on the effective default when the raw installed list is empty.
- Documented the raw integration-state reader contract.
- Reused initialized status-test project templates to avoid rerunning full
initfor each status case. - Reported multi-install safety as unknown when integration state is missing, unreadable, or records no installed integrations.
- Ignored non-list raw
installed_integrationsvalues when deriving raw status checks. - Reported actual manifest load/check attempts, including shared
speckit, in JSON status output. - Included integration-state read error details in status findings.
- Tightened JSON contract invariants for raw recorded integrations and unknown multi-install safety.
- Hardened status checks around symlink loops, symlink targets outside the project, and stale unknown integration suggestions.
- Clarified project-root resolution fallback, tracked symlink classification, and multi-install remediation messaging.
- Added regression coverage that manifest loads do not depend on
Path.exists()and tracked symlinks are not followed withPath.stat().
Testing
- [x]
uv run --extra test pytest tests/integrations/test_integration_subcommand.py::TestIntegrationStatus -q- 36 passed - [x]
uv run --extra test pytest tests/integrations/test_integration_subcommand.py tests/integrations/test_manifest.py -q- 124 passed - [x]
uvx ruff check src/specify_cli/integration_state.py src/specify_cli/integration_status.py src/specify_cli/__init__.py tests/integrations/test_integration_subcommand.py - [x]
git diff --check
AI Disclosure
- [ ] I did not use AI assistance
- [x] I did use AI assistance
Used OpenAI Codex to inspect the integration state/manifest helpers, implement the status reporting command, add tests/docs, address maintainer and review feedback, run validation, and draft this PR.
Please address Copilot feedback
Please address Copilot feedback
Please address Copilot feedback
Please address test & lint errors. You might have to rebase on upstream/main?
Please address Copilot feedback