spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

feat(integration): add status reporting

Open PascalThuet opened this issue 6 months ago • 5 comments

Summary

  • add specify integration status for 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 doctor command to integration status after maintainer feedback in #2671.

Review feedback

  • Removed the private manifest hash helper import by hashing locally in the status module.
  • Reused a single integration.json read 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 explicit lstat/stat handling.
  • 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 init for 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_integrations values 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 with Path.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.

PascalThuet avatar May 22 '26 07:05 PascalThuet

Please address Copilot feedback

mnriem avatar May 27 '26 16:05 mnriem

Please address Copilot feedback

mnriem avatar May 28 '26 13:05 mnriem

Please address Copilot feedback

mnriem avatar May 28 '26 15:05 mnriem

Please address test & lint errors. You might have to rebase on upstream/main?

mnriem avatar May 29 '26 14:05 mnriem

Please address Copilot feedback

mnriem avatar Jun 03 '26 21:06 mnriem