Skip to content

Complete the minimal 1.0 API additions - #33

Merged
hokoo merged 6 commits into
masterfrom
codex/1.0-api-batch-4
Sep 11, 2026
Merged

hokoo merged 6 commits into
masterfrom
codex/1.0-api-batch-4

Conversation

@hokoo

@hokoo hokoo commented Sep 10, 2026 •

Copy link
Copy Markdown
Owner

Linked issue

Closes #2
Closes #3
Closes #4

Intent

Complete the three approved minimal API additions after the immutable 0.7.0
baseline: initialize from an existing WP_Post, expose slug accessors, and expose
menu-order accessors. T12 API freeze and any further surface changes remain out
of scope.

Behavior

  • Before: initialization accepted only a weakly typed integer ID/new-post input;
    slug and menu order had no symmetric interface/trait accessors.
  • After: initialization accepts exactly int|WP_Post|null; supplied post objects
    retain identity and use the existing validation/meta/hook lifecycle without an
    insert or lookup. Typed chainable slug and menu-order accessors mutate the
    corresponding WP_Post fields in memory and persist through savePost().
  • Migration or recovery: trait consumers receive both accessor pairs
    automatically. Manual interface implementations/overrides must implement the
    documented signatures. Numeric strings, floats, and booleans previously
    accepted by weak int coercion must be converted explicitly. No stored-data
    migration is required.
  • Out of scope: slug sanitization/permalink policy, menu-order range/reordering
    policy, autosave, T12 visibility/interface freeze, and RC publication.

SemVer impact

  • none — no package release required by this change alone
  • PATCH — backward-compatible bug or security fix
  • MINOR — feature/deprecation, or a pre-1.0 compatibility change
  • MAJOR — incompatible change starting with 1.0

Rationale: this is the approved pre-1.0 public API expansion and includes an
explicitly documented initialization-input compatibility change.

Compatibility and security

  • Public/protected API, signatures, visibility, return values, or chainability
  • Exception types or machine-readable error context
  • WordPress hook names, arguments, ordering, timing, or defaults
  • Existing metadata or JSON persistence and migration
  • Composer dependencies or production archive contents
  • PHP/WordPress support bounds or current-version compatibility
  • Security, permissions, external input, secrets, or diagnostic output
  • None of these surfaces is affected

Risk and compatibility details: wppaLoadPostException remains the mismatch
contract and preserves ID/model context; invalid non-union inputs now fail with
TypeError before side effects. Existing hook/meta/JSON behavior is shared and
regression-tested. Slug normalization/uniqueness remains owned by Core and is
observed after reload. Any signed integer menu order is accepted without a new
query/reordering promise. PHP 7.4 syntax and WordPress 6.0 remain supported.
The package boundary and secret/artifact scan are clean.

Verification evidence

Check Result Evidence or reason
make check Pass 59 tests, 354 assertions; Composer strict validation and PHP lint pass
make coverage Pass 180/180 source lines and 43/43 methods (100%)
make test.package-install Pass Clean production archive/install; all public symbols autoload
make smoke Pass Existing localdev create/save/reload/meta/param/publish lifecycle
make test.integration.minimum Pass WP 6.0 / PHP 7.4.33; minimum-20260910T233033Z-47568-5574; 16 lifecycle groups; zero fixtures; empty diagnostics
make test.integration.latest Pass WP 7.1 / PHP 8.4.25; latest-20260910T233211Z-49057-3120; 16 lifecycle groups; zero fixtures; empty diagnostics
git diff --check Pass master...dca2940 clean
Other targeted check Pass Direct PHP 7.4 unit 59/354; independent E3 contract/regression QA PASS with no findings or missing AC/DoD

Documentation

  • README.md
  • VERSIONING.md
  • docs/LOCAL-DEVELOPMENT.md
  • docs/TESTING.md
  • docs/RELEASING.md
  • CONTRIBUTING.md or repository templates
  • Public code/API documentation
  • Other documentation named below
  • No documentation change is required

Documentation rationale: README covers consumer usage and save/reload semantics;
VERSIONING records the compatibility surface and manual-implementer migration;
TESTING records the expanded real-WordPress lifecycle; docs/plan-1.0.md records
every task transition and exact evidence.

Changelog

  • Added a user-oriented entry under Unreleased in CHANGELOG.md
  • No changelog entry is valid for this pull request

Changelog entry or concrete no-changelog rationale: Unreleased now records
object initialization, typed slug/menu-order accessors, and upgrade notes for
constructor inputs and manual interface implementations.

Final review

  • The branch is focused and excludes unrelated changes.
  • Tests assert behavior and failure paths, not only coverage percentage.
  • No credentials, private .env values, generated dependencies, local
    WordPress files, coverage reports, or integration artifacts are included.
  • Published tags and release artifacts are unchanged.
  • Remaining risks, follow-ups, and checks not run are stated above.
  • Required CI checks are green, or the PR remains a draft pending them.

Final synchronized run
34543321838
passed all five required checks. T9–T11 issues stay in review until this PR
merges.

@hokoo
hokoo merged commit 48b2923 into master Sep 11, 2026
5 checks passed
@hokoo
hokoo deleted the codex/1.0-api-batch-4 branch September 11, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add menu-order accessors Add slug accessors Allow initialization from a WP_Post object

1 participant