Skip to content

Add php-assumptions support for explicit assumption analysis #265

@coisa

Description

@coisa

Problem

php-assumptions introduces explicit runtime/compile-time assumption checks, but dev-tools currently focuses on generic static checks.

Without explicit assumptions, contracts and invariants may be spread implicitly across code without a central quality check.

Proposal

Evaluate adding php-assumptions support in an optional analysis mode.

Plan:

  • Add a command extension under an analyse entrypoint (new or existing).
  • Ship with safe defaults, allow local config passthrough, and expose list/format controls.
  • Keep it non-blocking unless explicitly enabled.

Goals

  • Encourage explicit assumption-driven testability and API clarity.
  • Keep rule output stable and auditable.
  • Keep runtime overhead contained to opted-in pipelines.

Expected Benefits

  • Better signal for hidden assumptions and undefined expectations.
  • Improved consistency in codebase-wide contract documentation.

Why Not (if skipped)

  • Some teams may already use other assumption frameworks.
  • Misconfigured assumptions can produce noise in legacy repositories.

Non-goals

  • Replacing Rector/PHPStan baseline checks.
  • Enforcing assumptions with strict zero-tolerance from day one.

Acceptance Criteria

  • A clear decision matrix is recorded (on/off per repo profile).
  • Command/docs explain defaults and local override strategy.
  • Output is deterministic and does not mutate behavior outside analysis mode.

Architectural / Isolation Criteria

  • MUST: Keep assumption checks in a dedicated analysis service, not embedded in command wiring.
  • MUST: Respect local configuration precedence over packaged defaults.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions