Skip to content

Epic: The WordPress anti-patterns that review still catches by hand fail the architecture checks #69

Closed
14 of 14 issues completed

Description

@schlessera

Outcome

The WordPress anti-patterns and lifecycle mistakes that docs/design-principles.md names, and that review still has to catch by hand today, fail the checks instead: output echoed outside views, raw values printed unescaped, collaborators pulled from globals, work in service constructors, services nobody declares, unsatisfiable or misordered dependencies, registration actions that never fire, unprefixed names in WordPress's shared spaces, static access to the plugin from inside the object graph, and type names that encode their kind rather than their concept (#94).

Why now

The original review found manual gaps and an unescaped raw backend sample. Those original 13 child tasks are now closed; #79/#114 fixed the sample. The completion-audit gap was filed as #162 and is now fixed by #165. The principle-13 table names serviceIdsPrefixed for declared service-map keys; prefixedNames continues to cover WordPress registration names. Runtime-filter-added IDs and the value of VIEW_OVERRIDE_DIRECTORY remain explicit manual boundaries, outside this epic's declared-ID criterion.

Shared context

Constraints and non-goals

Breakdown

The original 13 native children (#77–#86, #91, #92 and #94) are closed. The added #162 is also closed through #165. All 14 native children are closed. Its check reads the configured SERVICE_PREFIX, reports invalid declarations without resolving them, and covers valid, invalid, empty-prefix and generated-prefix roots; the catalogue/table update has landed.

Definition of done

  • Every sub-issue is closed.
  • The "Reviewed by hand" column of docs/architecture-rules.md no longer lists "collaborators pulled from globals" or "HTML echoed from business logic" for principle 7, nor "prefixes of service identifiers" for principle 13.

Verification

For each child implementation, run composer test:architecture, composer test and composer lint in the reference CI environments (PHP 8.3 for lint; PHP 7.4 and 8.3 for tests). composer lint already runs test:phpstan-rules. Assert each new check's diagnostic against a failing fixture and verify its permitted counterpart passes; do not weaken a gate to make the tree pass. At epic completion, verify every native child is closed and review the catalogue/principle rows against the definition of done.

Completion audit (main 61a9b00)

  • All 14 native children are closed.
  • docs/architecture-rules.md:130 no longer leaves globals or output from business logic to manual review; noGlobalState and outputOnlyThroughViews cover them.
  • docs/architecture-rules.md:136 names serviceIdsPrefixed, and :176-200 documents declared-ID coverage and the runtime-filter boundary. CompositionRootContract.php:181-213 implements the check.
  • Isolated PHP 8.3.36 verification: composer test:architecture passes (214 tests, 584 assertions); composer lint passes, including 132 PHPStan rule tests.

Impact on generated plugins

Tests and tool configuration only, plus the sample-view escaping fix. Generated plugins inherit the checks.

Updated 2026-10-23: Confirmed all 13 original children closed, but retained the unmet service-ID-prefix completion criterion. Filed/attached #162; updated sample/public-API status. Architecture tests/lint pass, but this epic remains open with 13/14 children closed.

Updated 2026-10-23: Verified all 14 native children closed and #165 implements the declared-ID prefix check, generated-prefix fixtures and catalogue update. Both definition-of-done bullets now hold; architecture tests (214/584) and lint pass on current main/PHP 8.3. Close the completed epic.

Sub-issues

Sub-issues

14 of 14 Issues completed
Loading 14 sub-issues

Activity

  1. added
    type: test
    area: tests
    area: tooling
    priority: p3
    epic
    on Oct 23, 2026
  2. schlessera commented on Oct 23, 2026

    @schlessera
    MemberAuthor

    Triage (2026-10-23): Reconciled 13 open native children including #94, reflected the maintainer’s context-object investigation direction in #93, and added reference-CI verification. Existing rulings in #86/#91/#92/#94 are preserved; no new policy is approved.

  3. schlessera commented on Oct 23, 2026

    @schlessera
    MemberAuthor

    Triage (2026-10-23): Confirmed all 13 original children closed, but retained the unmet service-ID-prefix completion criterion. Filed/attached #162; updated sample/public-API status. Architecture tests/lint pass, but this epic remains open with 13/14 children closed.

  4. schlessera commented on Oct 23, 2026

    @schlessera
    MemberAuthor

    Triage (2026-10-23): Verified all 14 native children closed and #165 implements the declared-ID prefix check, generated-prefix fixtures and catalogue update. Both definition-of-done bullets now hold; architecture tests (214/584) and lint pass on current main/PHP 8.3. Close the completed epic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testsarea: toolingepicpriority: p3type: test

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions