Better enforce core fidelity for canonical backports
I maintainer di solito rispondono entro 1 giorno
@nikmclaughlin ci sta già lavorando.
Dal 1/12/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Our initial intent when backporting abilities from Core WP was to make the package versions as identical as possible to their Core counterparts, including class and file structures. However, I've found that exact matching is impractical given this package's requirements for usable ability declarations (esp. Registrar needing a class wrapper).
As such, I'd like us to codify the process for (1) copying exact ability code from Core as package fixtures, and then (2) generating usable ability code in the package based on those fixtures. While this means accepting some difference between what ships in Core vs. this package, I think that difference is inevitable so it's best to be explicit about, and having the fixtures + codegen tooling + generated artifacts all in one place here gives us a verifiable pipeline for code coming back from Core.
[🤖 Below is an AI write-up of the decision after an exchange related to reviewing #36, which includes more context and a more specific proposal]
Decision: Canonical (core-landed) abilities ship as two artifacts: (1) a byte-exact excerpt fixture pinned to the immutable core release tag it canonizes, and (2) loadable classes that are byte-exact mechanical projections of that fixture, produced by the canonical transform. Hand edits to either are CI-rejected. Coexistence-required edits (namespaces, load guards, provenance meta) live in a fixed wrapper outside the copied region and are excluded from the fidelity claim.
Why not literally copy core's files into the package:
- A byte-identical paste is a redeclaration fatal on any site core also ships (
wp_register_core_abilities(),WP_Abilities_*); the only escapes — guards, renames — are exactly the mutation that destroys byte-identity, so file-level byte-identity can't survive coexistence. - The manifest engine is class-addressed; a procedural paste can't ship, so any realistic form has a wrapper and the enforceable rule is projection identity, not file identity.
- "Copy the core file" is ambiguous once core has multiple eras (6.9 procedural → 7.2 class files; the info trio itself was reworked in changesets r62396…r64729). Pinning the era's release tag disambiguates — which is what the fixture already is.
What #36 surfaced: the hand-port drifted by whitespace from core and passed the gate, because verify:coreify does a semantic token diff that skips whitespace; the fixtures carry byte-exact core text but are trusted, not verified, against the tag they cite.
Work:
reindent(): leave whitespace-only lines empty so reverse output is byte-stable.- Byte gate:
reverse(fixture)≡ package file, andforward(output)≡ fixture, byte-for-byte, scoped to the copied region so wrapper evolution doesn't churn canonical files. - Fixture fidelity: pin core blob SHAs (6.9.0
abilities.php=0320df3b9f38a9fd2d2b73e284a7b14271c545ff) and verify each fixture is a mechanical slice of that tag in CI. - Fix the whitespace drift merged in #36:
src/Info/Get_Site_Info.php:19,$category_sitepadded vs core's$category_site = 'site';. - Document the rule and the post-6.9 era ledger (r62396…r64729) in README/NAME-LIFECYCLE so package–core deltas read as accounted-for history.
- Lingua principale
- PHP
- Stelle
- 4
- Fork
- 4
- Merge medio
- 1g 23h
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di WordPress/abilities
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
WordPress/abilities#53 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Registration gating in `register_all()` applies unevenlyForse già presa @nikmclaughlin l’ha presa oggi. Aperta
WordPress/abilities#54 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di WordPress/abilities
Issue simili
-
🐛 Web Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
omeka/plugin-Commenting#72 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quantum-php/framework#739 ·
I maintainer di solito rispondono entro 1 giorno
-
`mercure()` Twig function: the `lastEventId` option adds query parameters that Mercure hubs 1.0+ ignoreForse già presa @daFish l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100