Skip to content

Unreleased core

mozrin edited this page Nov 22, 2026 · 9 revisions

Unreleased core work

This page describes credential-free core work collected at 8cae4d214d473abaf44e88527eba97cd09004f7d on the temporary core WIP branch. It is not available in tagged/integrated source 0.9.1. Coexistence #19, CI #23, consumer testing #9 and geography #21 are accepted through PRs #51–#54. The complete core alone will integrate into develop as 0.10.0 Cirrus. Diagnostics, expanded trust/isolation and controlled live validation remain unfinished.

Canonical identifiers for coexistence

The proposed canonical configuration file/namespace is moztopia-cloudflare, the publishing tag is moztopia-cloudflare-config, and the discovered Blade alias is MoztopiaCloudflare:

php artisan vendor:publish --tag=moztopia-cloudflare-config

In config/moztopia-cloudflare.php, configure the actual controlled ingress addresses:

return [
    'trusted_proxies' => ['192.0.2.10'],
];

Replace the documentation address with your verified peer; the Trusted ingress provenance rules still apply. This tag publishes only the namespaced file, leaving another package's config/cloudflare.php untouched. Do not force-publish common legacy resources in a coinstalled application.

@php($visitor = MoztopiaCloudflare::visitor())

@if ($visitor->region)
    <p>Estimated region: {{ $visitor->region }}</p>
@endif

The existing fully qualified Moztopia\Cloudflare\Facades\Cloudflare facade and injectable Moztopia\Cloudflare\Cloudflare\Cloudflare service remain unchanged. When discovery is disabled, register the provider and use/import the fully qualified facade or explicitly register the chosen alias.

Configuration precedence and compatibility

An explicit array in moztopia-cloudflare.trusted_proxies takes precedence over the legacy cloudflare.trusted_proxies setting. An explicit empty array disables trust even when legacy configuration contains accepted peers. An invalid explicit value fails closed rather than falling back. null, or an absent canonical setting, retains the legacy setting; this is the transitional default. With no configured accepted peers, values remain unknown.

Composer discovery advertises only MoztopiaCloudflare. During provider registration, the legacy Cloudflare alias is offered only when no existing alias or loaded class claims that name. This preserves standalone access, including before application boot, while leaving a coinstalled wrapper’s discovered facade intact in either provider order.

Existing standalone consumers can retain Cloudflare, config/cloudflare.php and the cloudflare-config tag. In coinstalled applications, use the canonical alias/configuration/tag and configure its trust list deliberately; do not assume a shared legacy configuration namespace or publishing tag belongs to this package. A fully qualified facade import resolves class identity but does not resolve configuration-file ownership. The example’s locked package metadata also advertises the canonical alias.

Changing configuration should follow the host's normal cache rebuild procedure. Reads continue to resolve the active request/configuration; existing snapshots remain immutable, and no HTTP request, account credential or proxy mutation is introduced.

Verification scope

Synthetic package tests cover legacy and canonical usage, explicit empty/invalid precedence, warm-container changes, Blade alias usage, discovery manifests in both package orders, manual provider registration in both provider orders, configuration caching and canonical publishing without overwriting a companion file. The companion providers model overlapping API-wrapper responsibilities; real-package checks below establish their narrower observed compatibility. Real consuming-application verification remains required by the Release gates.

Fresh isolated Composer consumers installed Hampel 1.3.0 and GhostCompiler 1.0.6 separately alongside the corrected coexistence source a96c9d23c300d8422023866e8007fc0c103eb93e, Laravel 13.43.0 and PHP 8.5.13. Laravel built its package manifest from the actual installed Composer metadata. Both actual providers passed in both registration orders with Docker networking disabled: the other package retained its discovered global Cloudflare facade/manager, while MoztopiaCloudflare resolved this package’s visitor context. Configuration ownership, explicit-empty trust and canonical publication mappings also passed. Separate standalone checks verified legacy access before application boot and preservation of an already loaded host-owned Cloudflare class. No real API credentials or API calls were used.

An earlier manual-bootstrap probe at fab47bb76ed2065b231a8f002264999083476bd4 did not establish combined Composer-discovery ownership. Strengthened manifest-order regression tests exposed that gap; the corrected source removes the unconditional common discovery alias. The fresh discovery checks above supersede that narrower ownership evidence. These checks do not replace the final real-application/HTTP/worker acceptance gate.

The corrected package suite passes 58 tests / 161 assertions in all six combinations of Laravel 12/Testbench 10 and Laravel 13/Testbench 11 with PHP 8.4.27, 8.5.12 and 8.5.13. Each checkout’s versions ran sequentially to avoid shared Testbench cache interference. Package Pint passes for 39 files. The example passes 29 tests / 634 assertions and Pint for 26 files on PHP 8.5.13 after refreshing installed package discovery from its updated lockfile; both canonical and legacy facades resolve the package service. Two default-network Docker builds failed at the unchanged npm dependency-install step because registry.npmjs.org could not be resolved (EAI_AGAIN). A subsequent clean build using the host’s outbound network passed the asset/type checks, locked dependency installation, discovery and platform checks. Its final runtime remains PHP 8.5.13. That fresh image independently passed the same 29 tests / 634 assertions, Pint and strict Composer validation, with networking disabled for the tests.

Compose startup on this workstation could not allocate appnet because Docker’s predefined address pools are exhausted. The fresh image was instead run temporarily on Docker’s existing default bridge with loopback port 8080; /up, /, /ui and /request returned HTTP 200, and the application pages contained the expected project identity. The temporary verification container was removed. Standard Compose startup on this source remains unverified on this host; no network pruning, daemon change, project configuration change or live Cloudflare ingress is implied by this workaround. This page does not claim a released or integrated version.

Collected CI work

Issue #23 is collected through PR #52 into the temporary core WIP branch. The workflow resolves Laravel 12/Testbench 10 and Laravel 13/Testbench 11 independently for PHP 8.4.27, 8.5.12 and 8.5.13, using official Docker images and verifying the exact runtime. Package changes also check the consuming example; example implementation changes run only the affected example checks. Documentation-only changes skip those builds. PRs targeting WIP branches and pushes to temporary release WIP branches are included in the approved grouped workflow.

The existing example build verifies locked dependencies and TypeScript/assets, runs tests/formatting on PHP 8.5.13 and performs a local loopback HTTP smoke check. The workflow has read-only repository permissions, no persisted checkout credential, no Cloudflare secret/live account and no release/deployment/image-publication step. A final aggregate check rejects failed or cancelled selected jobs.

The workflow passes local actionlint/schema/shell validation, including eight changed-path cases and six aggregate-result cases. GitHub run 44915821698 completed successfully for commit d6bb229449bb53b98e96593492fe38bf058891d0: all six PHP/framework jobs, the example job, selector and aggregate check passed. That CI commit is independent of the unmerged coexistence branch; the combined phase head must be checked again before integration. This workflow is collected in the temporary release WIP branch, and remains absent from tagged source 0.9.1 and integrated develop.

Combined collection evidence — 2026-11-22

Updated CI head 47e81d0943c302c2a4aea6d6618e219fde432fed passed all nine jobs in run 44976031979, and its phase-push run 44976151681 passed. After resolving only the two changelog entries, combined source fd765b34066043e7adae95d0761f34988b5a456c passed all nine jobs in run 44976238430, including actual fresh-image build, example tests/formatting and Compose loopback HTTP verification on GitHub. PR #51 then merged at 0c468599fde6989f884f80ee10cd7a533f049bb3. This successful runner evidence complements the earlier local Docker-network limitations; it does not establish a live Cloudflare ingress or complete the whole core release.

Supported consumer testing

Source 905518bc31f0b8a2c60e79b722b743c61513c82a implements the owner-approved #9 contract through PR #53: native facade mocks share freshly resolved typed injection, snapshots remain final/readonly, and explicit immutable RequestFixture data covers known/missing/malformed/untrusted scenarios without live-state mutation. See Blade and testing for runnable consumer patterns and teardown semantics.

The original final-class failure was reproduced before the correction. All six PHP/framework combinations pass 72 tests / 207 assertions each; package Pint passes for 42 files. The PHP 8.5.13 example passes 33 tests / 646 assertions and Pint for 26 files, including four public-fixture UI cases. Strict package/example Composer validation passes. Actual GitHub run 44977012233 passed all nine jobs at that exact source head, including the fresh example image and Compose HTTP smoke check. These checks do not replace the separate long-lived-worker/real-ingress/final-consumer release gates.

Supplied geography

Source b52f0eeb485f67119f209094ce546096427358bf implements #21 through PR #54: nullable coordinate floats and a metro identifier string, existing constructor positions, explicit trust, independent validation and unknown fallbacks. Visitor and request context defines the types, bounds and product prerequisites. Postal codes remain excluded.

All six PHP/framework combinations pass 108 tests / 269 assertions each; package Pint passes for 43 files. The PHP 8.5.13 example passes 40 tests / 712 assertions, including all enabled catalogs, supplied/zero coordinates, metro identifiers and missing/malformed/untrusted UI cases. Strict Composer validation passes. Actual GitHub run 44978000941 passed all nine jobs at that exact head, including the fresh image and Compose HTTP check.

Chrome DevTools verified actual desktop screenshots and the 390px rendered values/overflow metrics. Its window resize returned Active contents not found, and screenshot calls stalled under viewport emulation; cancelled calls were not claimed successful. The alternate browser controller failed with an internal timeoutMs error. Supplemental browser review therefore ran explicitly in the already available official Playwright 1.65.1 Docker image, using matching tooling installed only inside the container and Chromium 159.0.8154.6 against the actual PHP 8.5.13 example. All 18 combinations of 390/768/1440px, English/Thai/Arabic and light/dark passed rendered-value, direction, overflow, mobile navigation and keyboard-theme checks, plus an Arabic mobile missing-data state. No uncaught page errors were recorded. Five saved screenshots were visually inspected; this is emulated browser coverage, not physical-device or professional translation review.

The machine-readable browser results and representative English phone, Thai tablet, Arabic desktop, Arabic phone, and Arabic missing-data phone captures are stored in this wiki Git repository. They show only synthetic example data. No wiki browser operation was used.

Redacted diagnostics and a local doctor

Source 3ac444e0b892d7d1d0406a908cd873bd0b063594 implements #20 through PR #55: typed ingress/header statuses and immutable redacted reports, plus moztopia-cloudflare:doctor [--json] for effective configuration and explicit isolated samples. No live browser observation, public route, raw metadata logging or hidden network probe is claimed. Diagnostics and doctor defines the consumer API, codes, native translations/overrides and configuration limits.

Local checks pass 143 package tests / 547 assertions in all six supported runtime/framework combinations, package Pint for 54 files, and 41 example tests / 720 assertions with Pint for 26 files on PHP 8.5.13. Strict Composer/actionlint checks pass. The actual workflow run block was exercised for package catalog, package documentation and example catalog changes. Source-archive inspection includes command/report/catalog resources and excludes examples. Actual GitHub run 44982375492 passed all nine jobs at that exact source head, including the fresh PHP 8.5.13 example image, real packaged-command tests and Compose loopback HTTP verification. This is unreleased collection work; expanded trust/worker and live-ingress validation remain separate gates.

Trust boundaries and consecutive requests

Source 13a6099c7352189b24808ab7b78a78c78f212daf implements #22 through PR #56 with no runtime trust-policy change. The new matrix covers exact/CIDR IPv4/IPv6, malformed inputs, forwarded-header spoofing, unsafe unrestricted settings and rewritten-peer limits. Consecutive real kernel and actual Octane Worker requests check every expanded snapshot, warmed DI/facade/Blade reads, fixture independence, retained immutable results, native sandbox configuration resets and recovery after failure. See Trusted ingress for the supported limits.

All six supported PHP/framework combinations pass 195 tests / 2,939 assertions with Docker networking disabled. Root Pint passes 56 repository PHP files, including 26 example files. The PHP 8.5.13 example passes 41 tests / 720 assertions, its Pint passes 26 files, and both Composer manifests validate strictly. Octane 2.25.0 is development-only; refreshing the example's local-package metadata changes no installed dependency versions. Actual GitHub run 44983828721 passed all nine jobs at that exact source head, including fresh example image/Compose HTTP verification. Live-ingress approval/validation remains separate #24.

Maintained by-dolly.

Clone this wiki locally