Skip to content

[architecture] Extract dependency-health with read-only analysis and explicit upgrade boundaries #381

Open

Description

@coisa

Proposal / validation gate: this issue records an extraction design for maintainer validation. Repository/package names are candidates. Approve the boundary and migration plan before implementation; this task does not authorize creating repositories, implementing the extraction, releases or consumer rollout.

Problem and proposal

Propose php-fast-forward/dependency-health / fast-forward/dependency-health around DependenciesCommand and Config/ComposerDependencyAnalyserConfig.php. Current behavior composes ShipMonk dependency analyser and Rector Swiss Knife constraints/outdated operations; it should not require formatting/testing/docs to inspect a dependency graph.

Scope

Own declared-versus-used dependency checks, intentional shadow-dependency policy, outdated/breakpoint reporting and explicitly selected dependency-upgrade operations, plus workflow/CLI/skill when useful. Not a generic Rector owner: source refactoring belongs to code-standards. Composer metadata bootstrap belongs to repository-metadata. Static source analysis remains #14, not duplicated here.

Concrete tasks / acceptance

  • Characterize current raise/open constraints commands and --upgrade side effects. Publish explicit read-only check/plan versus apply/update contracts; do not inherit implicit writes as harmless analysis.
  • Preserve [dependencies] Handle intentional shadow dependencies without hiding accidental ones #233 intentional-shadow exceptions without hiding accidental dependencies; fixtures cover direct/dev/transitive/shadow/unused and invalid manifests.
  • Distinguish outdated threshold policy (CI uses -1) from tool failure and security advisory results; do not infer safety from outdated counts or suppress unrelated failures.
  • Separate application constraints/lock resolution from external tool runtime; failures report exact affected manifest without dumping credentials.
  • Define JSON/artifact/result identity and integration with DevTools aggregate exit status, test workflows and optional PR feedback.
  • Test no-write checks, reviewed upgrade diffs and rollback, local/isolated runtime and unsupported manifests. Do not update consumer dependencies merely by adopting the package.

Alternatives

Keep within DevTools temporarily until output contract is stable; do not put all source static analysis, mutation testing and formatting in this package. A separate package is justified by Composer graph/policy ownership, not the fact a command invokes Rector Swiss Knife.

Delivery and migration gates

Architectural / Isolation Criteria

  • MUST: Core logic MUST live in dedicated services; commands/controllers only orchestrate.
  • MUST: Separate input resolution, domain transformations and rendering; keep CLI/framework I/O out of reusable behavior.
  • MUST: Support reuse/extensibility without major refactoring and deterministic, testable exits/output.
  • MUST: Separate gathering/transformation from writes/publishing; repeated execution MUST be idempotent or explicitly bounded.
  • MUST: Update README, command/config docs, skill references and synchronized consumer examples with the actual new ownership.

Repository-split decision gate

Before implementation, compare independent consumers, current code size, dependency/release cadence and maintenance cost with keeping this responsibility as a bounded module under the nearest domain or DevTools. A separate repository is a candidate, not mandatory. If reuse/lifecycle does not justify it, document the smaller grouping and avoid artificial fragmentation. Validate the recommendation with the maintainer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions