Status as of this document: 377 tests / 0 failures, all quality gates green — including PHPStan and a real
composer install. Stage 9 (auth + RBAC): AUDIT-TRAIL34–37. Stage 10 (multi-DB ConnectionManager, read/write split, grammar seam):
38–39, compiled-boot verified. Stage 11 (laravel-flavor preset, compiled routes,
pagination, typed params): zero new findings — the two structural hazards were designed out, with a live-server smoke through the compiled route index.
LombokClarion is a PHP framework (PHP 8.3+, strict_types everywhere) built from
scratch on the opposite philosophy of
Laravel: explicit over magic. No facades in core (opt-in package available), no auto-discovery, no
ActiveRecord in core, a domain layer with zero framework imports, and an
edge/serverless-first design with a cold-start budget enforced at build time.
Structure: Composer monorepo, 15 packages + an end-to-end example app (Widget feature: JSON API + HTML starter-kit pages + charts dashboard).
lombokclarion/* namespace; CLI binary bin/lombokclariondeclare(strict_types=1) in every fileRequestContext$config->mail->smtp->host as generated readonly classes), never config('a.b.c')bootstrap/services.php, routes in routes.php, commands in console.php, migrations in migrations.php (a manifest, not a directory scan)active-record & facades are separate packages with forbidden-layers metadata, enforced by the boundary checkerapp/Http, app/Domain, app/Infrastructure, bootstrap/, …)app/Domain/** has zero LombokClarion\* imports — enforced by bin/check-domain-boundary.php (token-based, no comment false-positives; proven to catch a deliberately planted violation)i18n and phpstan-rules added
in Stages 8/8b), each with a valid PSR-4 composer.jsonContainerCompiler (AOT) → CompiledContainer (zero reflection at request time)RuntimeAdaptertable.column), SchemaBuilder, explicit-manifest MigrationRunner, RawExpression (the only escape hatch, still placeholder-mandatory), Identifier validation@if/@foreach/@extends/@section/@yield/@include), {{ }} auto-escaped by default, {!! !!} explicit opt-out + Safe::mark(), disk compile-cachemigrate, optimize, work, audit:sql, audit:securityoverride()), FakeCommandBus/FakeEventBus, InMemoryRepository, ConsoleTestCase, BenchmarkTestCase, ColdStartTestEncrypted<T> AES-256-GCM, FormRequestactive-record (full Model: CRUD, query builder, $fillable, with() eager-loading) & facades (Facade base + Bus/Event/Hash, explicit setContainer() opt-in), both carrying forbidden-layers: ["app/Domain"]optimize → services.compiled.php (flat closure array, zero reflection at boot)$externallyProvided + instance()ColdStartTest ships by default, fails when the budget is exceeded (~5ms production budget)RuntimeAdapter — only the adapter changes per deployment target; the compiled boot path was proven to serve a real request end-to-endaudit:security (missing CSRF on mutating routes, APP_DEBUG=true in production, missing SecurityHeaders; weak cost params rejected by PasswordHasher at boot)rawExpression requires placeholders == bindingsaudit:sql powered by TokenScanner (PHP tokenizer, not regex): concatenation, variable interpolation inside query strings, sprintf — including multi-line; ignores comments/string literals{!! !!} flagged by audit unless Safe::mark()audit:sql --explain — EXPLAIN QUERY PLAN/ANALYZE, flags sequential scansEagerLoader (hasMany/hasOne/belongsTo, one WHERE IN query per relation) + with()migrationsAreTransactionalByDefault())deploy/db-roles.sql — Postgres template creating lc_app (DML only, incl. default privileges on future tables) and lc_migrate (DDL owner); migrate connects as the latter.btn/.card/.navbar/.table, --lc-* tokens, data-style) — note: the original spec guessed lc-*/data-variant/data-elevation, which don't exist in the librarydata-style comes from Theme (validated at boot) ← THEME_STYLE env var — never hardcoded in a layoutoptimize time + manifest; Cache-Control: immutable; StaticAssetsMiddleware (with path-traversal blocking)/dashboard page renders bar + arc charts from real widget data; JSON embedded with JSON_HEX_* flags (script-breakout safe) + Safe::mark() so the XSS audit stays cleanRetriesQueuedCommand)ResolveTenant, TenantResolver + HeaderTenantResolver, Tenant via RequestContext, TenantAwareConnection (DB-per-tenant, isolation proven)ShouldQueue, QueuedCommandBus (decorator), QueueWorker (identical handler path as inline dispatch), opt-in retry+backoff, failed_jobs, InMemoryQueueStore + DatabaseQueueStore, CLI work --queue/--loop/--sleepPlugin interface (name/capabilities/register) + PluginRegistrar with capability allow-list; registration always explicit; duplicates rejectedLICENSE (MIT) · package.json (validated; npm is only used to refresh vendored assets via npm run assets:update — the runtime stays zero-dependency)CHANGELOG.md (7-stage history) · CONTRIBUTING.md (constitution rules + quality-gate workflow) · SECURITY.md (private reporting; audit false-negatives are security bugs) · CODE_OF_CONDUCT.md · SUPPORT.md.editorconfig · .gitattributes (LF, min.* no-diff, export-ignore tests/docs).github/: ISSUE_TEMPLATE (bug + feature), PULL_REQUEST_TEMPLATE, dependabot.yml (validated), workflows: ci.yml, npm-publish.yml (publish on Release with provenance), pages.yml (auto-build docs site — all three YAML-validated)Dockerfile — stages base (FPM+opcache, runs optimize at build), worker, cloudrun (single-container HTTP)docker-compose.yml — web(nginx)+app+worker+Postgres (YAML validated)deploy/nginx.conf — /assets immutable, only the front controller executesdeploy/lombokclarion-worker.service — systemd unit for the queue worker.dockerignore, .env.example, docs/DEPLOYMENT.md (GitHub/VPS/Docker/GCP/AWS/DO)tests/ — 27 test files (377 tests) + harness.php (standalone runner) + run-all.php + fixtures/viewsexamples/ — 4 runnable single-file demos (micro HTTP, CommandBus, QueryBuilder+EagerLoader, Queue→Worker), all with verified output; examples/README.md lists expected output per fileapp/ + bootstrap/ (Widget: JSON API, HTML pages, charts dashboard)packages/phpstan-rules ships NoRawSqlValuesRule and
DomainBoundaryRule with extension.neon + type: phpstan-extension composer.json.
Now actually executed (PHPStan 2.2.5, phpstan.neon at the repo root, wired into
CI): [OK] No errors across app/, packages/, bootstrap/. Running it for the first
time is what surfaced the audit blind spot recorded as bug #28 — the rules had only ever
been lint-checked, and a rule that has never executed has an unknown status, not a
passing one.deploy/db-roles.sqlpath repository, so composer install resolves the whole graph
offline. The suite runs green (144/144) against Composer's own autoloader with
autoload.php moved aside, and CI now does exactly that on every push. Doing so
immediately exposed bug #31: active-record, facades and i18n were missing from
composer.json and existed only in the sandbox shim's map.phpstan.neon runs at level 0~~ → now level 5, with
treatPhpDocTypesAsCertain: false. The pre-existing backlog was worked off:
real defects fixed (ConfigCompiler match default, the ViewCompiler @extends
docblock parse error, a variadic @param, a redundant loop condition, self::
on a private Model method, a write-only property), and the three PHPStan
stub/inference limitations that remain (Model::find static covariance, the
WorkCommand daemon loop, Container's defensive ReflectionClass catch) each
carry a sited @phpstan-ignore with its reason. CI inherits the level (it
runs analyse -c phpstan.neon, no --level). Level 6 is left as a separate
annotation project.packages/persistence/src/QueryBuilder.php is exempt from rawSqlValue in both
engines (reasoning is inline in phpstan.neon). Neither constant folding nor token
inspection can see through implode()/sprintf() over arrays. The exemption is paid
for by PersistenceTest, not waved away.lombokclarion/i18n) — implementedTranslator: catalogs are plain PHP files registered by hand (manifest, never scanned); :param interpolation; choice() pluralization (one|many, :count auto-available); fallback locale; missing keys returned as-is AND recorded — assertNoMissingKeys() lets CI prove catalogs are completeDetectLocale per-route middleware: ?lang= → Accept-Language (incl. primary-tag match en-US→en) → default, restricted to an explicit allow-list; chosen locale stored in RequestContext (never a hidden global)resources/lang/ ships 24 locale catalogs (en, id, es, fr, de, pt, ru, zh, ja, ko, ar, hi, bn, ur, tr, vi, th, it, nl, pl, ms, sw, fa, uk — covering the world's most-spoken languages) + a looped parity test proving every catalog covers every en key — 7 testslombokclarion/auth) — implementedAuthenticatable (id + password hash only) + AuthManager (attempt/login/logout) on the existing PasswordHasher + RequestContext; the current user lives in RequestContext, there is no static Auth::user()TokenIssuer, base64url id so emails-as-ids round-trip); TokenStore seam for opaque/DB tokens with sha256(token) storage; attempt() hashes on the not-found path to close the user-enumeration timing oracleAuthenticate (per-route, 401, cookie + Bearer) binds the user into RequestContext; Authorize::role()/permission() instance middleware (401 vs 403 distinguished; body discloses nothing)users, roles, permissions, role_user, permission_role) in the hand-written manifest with composite PKs; Gate with hand-registered policies ($gate->define(...)), throws on unknown ability rather than denying — no attribute scanningaudit:security extension: mutating routes lacking Authenticate reported at warning level, --public=METHOD:/path to declare intentional exceptions, --strict to fail on them; login route combines RateLimit(5/min) + CSRF in the example appConnectionManager — implementedConnectionManager with typed ConnectionConfig entries (dsn / provided for compiled-boot $externallyProvided / {database} template); lazy PDO creation, per-name (and per-database) caching, unknown names are hard errorsread()/write() distinct PDOs when configured; without a split, read() returns the identical instance — and no sticky-connection magic, read-your-own-write asks for write() explicitlyGrammar seam (AnsiGrammar ", MySqlGrammar `) through QueryBuilder AND EagerLoader — quoting only, Identifier::validate() unchanged in both; GrammarFactory throws on unknown drivers; QueryBuilder::toSql() for serverless SQL assertions; ConnectionManager::table() pairs PDO+grammar so they can't be mismatchedTenantAwareConnection generalized: delegates through ConnectionManager::forDatabase() (validated {database} substitution — ;/=/.. rejected); Stage 9 static signature keptmigrate --connection=NAME (unknown connection/argument = exit 1, nothing migrated); per-connection migrations table; always the write sidelaravel-flavor preset + compiled routes — implementedLaravelFlavor::enable($container) — the whole magic surface in ONE greppable line: Facade::setContainer (Bus/Hash/Event + new Auth/DB facades), Model::setConnection via the Stage 10 manager's write side, returns [SecurityHeaders] as recommended global middleware (returned, never installed behind your back); disable() is a true undo; forbidden-layers: ["app/Domain"] applies and the suite proves the checker's teeth on this packageoptimize emits storage/routes.compiled.php — a match index only (regex table + O(1) exact-path map, pointing into the live table by index; instance middleware is never serialized); order-sensitive fingerprint makes a stale index a loud boot error naming the fix; Route regex compile is now lazy so the compiled path builds zero regexes per requestQueryBuilder::paginate(page, perPage) → ['data' => rows, 'meta' => page/per_page/total/last_page/from/to]; COUNT and page share wheres/joins; page clamps (URL-shaped input), per_page <= 0 throws (code-shaped input){id:int} narrows the match (non-digits → 404, no "matched but invalid" state) AND casts before the controller; unknown types throw with the known list; vocabulary deliberately just int/stringphp -S serving through the compiled index (200 on /widgets, 404 preserved)lombokclarion/validation — typed rule objects (no pipe-string DSL), validate+canonicalize in one step, whitelist output, all-violations, FormRequest<TDto> explicit map() (zero reflection), ValidationException → Kernel 422 via the RendersResponse seam, messages in all 24 catalogs shipped inside the package (Lang::catalog(), #47)lombokclarion/storage — Storage interface + LocalStorage rooted at storage/app (traversal = hard error at the boundary, generated names, caller-explicit validated extensions), UploadedFile::moveTo() provenance-aware single-shot move, Rule::file(mimes)->maxBytes() content-sniffed via finfo, FormRequest multipart merge (UPLOAD_ERR_NO_FILE = absent)Stages 1–13 of the design specification are implemented. Rationale for the
overall design is documented internally. Distribution is decided and
wired: the monorepo at codinglombok/LombokClarion is canonical, and each
package is mirrored read-only to codinglombok/<pkg> for Packagist under the
lombokclarion/* vendor — see docs/PUBLISHING.md, bin/split-package.sh, and
.github/workflows/split.yml.
php tests/run-all.php # 377 tests
php bin/lombokclarion migrate # or: migrate --connection=reporting
php bin/lombokclarion optimize # compiled container+config+assets
php -S localhost:8080 -t public # open /, /widgets, /dashboard
php bin/lombokclarion audit:sql app --explain
php bin/lombokclarion audit:security
php bin/check-domain-boundary.php
php bin/lombokclarion work --loop
By raw feature surface this is roughly equivalent to earliest-generation Laravel
(~v1–v2); but the design goal differs: the absence of Eloquent/facades in core is a
decision, not a deficiency. Per-file detail lives in README.md; the bug chronology
in docs/AUDIT-TRAIL.md.