The Zero-Legacy PHP Framework Proven on Every Save
Built from the ground up — zero Symfony packages, zero third-party runtime libraries, zero mutable static state, and zero magic global facades.
Persistent-runtime first, with unified kongo prove certificates, least-privilege #[ReadOnlyDb] route capabilities, Live 2.5 & Bridge, built-in /_kongono Dev Studio & /_ops, optional Oshie / Chie / Hantei companions, and a 26-tool MCP Server.
Expressive PHP 8.5, Zero Magic Underneath
Declarative attributes, strict readonly DTOs, Live 2.5 hypermedia & React/Vue/Svelte Bridge, zero-N+1 data ergonomics, Hybrid RRF search, and global-free testing out of the box.
<?php
declare(strict_types=1);
namespace App\Http;
use Kongono\Http\Response;
use Kongono\Http\Routing\{CacheControl, Feature, Get, Idempotent, Middleware, Post, Prefix};
use Kongono\Security\Attributes\{Authenticated, Can, MaxQueries, NoOutboundHttp, ReadOnlyDb};
use Kongono\Security\Middleware\BearerAuthMiddleware;
use Kongono\Security\Principal;
#[Prefix('/api/notes')]
final readonly class NoteController
{
#[Get('/', name: 'notes.index')]
#[ReadOnlyDb]
#[NoOutboundHttp]
#[MaxQueries(3)]
#[CacheControl(maxAge: 60, public: true, staleWhileRevalidate: 30)]
public function index(): Response { /* DB writes, egress & N+1 blocked pre-execution */ }
#[Post('/', name: 'notes.create')]
#[Middleware(BearerAuthMiddleware::class)] // Supports revocable SHA-256 PersonalAccessToken
#[Authenticated]
#[Can('notes.write')]
#[Idempotent(ttlSeconds: 3600)]
public function create(CreateNoteInput $input, Principal $actor): Response
{
return Response::json(['author' => $actor->id, 'title' => $input->title], 201);
}
#[Get('/insights', name: 'notes.insights')]
#[Feature('beta_insights')]
public function insights(): Response { /* fail-closed 404 unless enabled */ }
}
// app/invariants.php — Executable architecture & security policies checked by `kongo prove`
use Kongono\Cli\Policy\Invariant;
use Kongono\Security\Attributes\Authenticated;
return [
Invariant::routesMatching('/api/admin/*', 'KGN-POLICY-ADMIN')
->mustHaveAttribute(Authenticated::class)
->describe('Admin API endpoints require authentication.'),
Invariant::routesMatching('/webhooks/*', 'KGN-POLICY-WEBHOOK')
->mustVerifyWebhookSignature()
->describe('Inbound webhooks must verify cryptographic signatures.'),
];
// CLI verification loop (zero Node.js, runs in milliseconds):
// $ php vendor/bin/kongo prove -> Grade A+ (100/100 PASS across 5 pillars)
// $ php vendor/bin/kongo diagnose --fix -> 17-rule static & full-stack contract auto-fixer
// $ php vendor/bin/kongo watch -> Continuous save loop (diagnose + policy + PHPUnit)
// $ php vendor/bin/kongo incident:test REF -> Turn scrubbed prod 5xx into a PHPUnit 13 test
<!-- Kongono Live 2.5: zero-build, strict-CSP reactive hypermedia (keyed morph + zero-eval AST) -->
<form kgn-post="/tasks" kgn-target="#task-list" kgn-swap="morph" k-persist="draft-task">
<input name="title" value="@old('title')" required>
@error('title') <span class="err">{{ $message }}</span> @enderror
<button type="submit">Add Task</button>
</form>
<!-- Hybrid React / Vue / Svelte island inside a .kgn.html template -->
@island('PriceChart', ['series' => $metrics])
// Or serve Live fragments, Bridge SPA pages, and JSON from one handler:
return Response::adaptive($request,
html: fn() => $views->render('tasks/index', ['tasks' => $tasks]),
fragment: fn() => Response::fragment($views->render('partials/task-list', ['tasks' => $tasks])),
bridge: fn() => Response::page('Tasks/Index', ['tasks' => $tasks]),
json: fn() => Response::json(['tasks' => $tasks]),
);
<?php
declare(strict_types=1);
use Kongono\Validation\Attributes\{ArrayOf, Between, Confirmed, Date, Email, Ip, Min, NotIn, Required, RequiredIf, Uuid};
use Kongono\Validation\ValidatableDtoInterface;
enum Plan: string { case Free = 'free'; case Pro = 'pro'; }
final readonly class SignupInput implements ValidatableDtoInterface
{
/** @param list<string> $tags */
public function __construct(
#[Required, Uuid] public string $requestId,
#[Required, Email] public string $email,
public Plan $plan,
#[RequiredIf('plan', 'pro'), Min(2)] public ?string $companyName = null,
#[NotIn(['admin', 'root'])] public string $handle = 'member',
#[Date] public ?string $launchDate = null,
#[Ip] public ?string $allowlistIp = null,
#[ArrayOf('string', min: 1, max: 5)] public array $tags = ['php85'],
#[Required, Min(12)] public string $password = '',
#[Required, Confirmed('password')] public string $passwordConfirmation = '',
) {}
public function validate(): array { return []; /* cross-field rules */ }
}
use Kongono\Database\BatchLoader;
use Kongono\Database\Testing\Factory;
// Parameterized SQL with soft deletes, tenant isolation & pagination
$posts = $db->table('posts')
->forTenant($tenant)
->withoutTrashed()
->orderBy('created_at', 'DESC')
->paginate(page: 1, perPage: 25);
// Zero-N+1 eager relation loading without ActiveRecord magic
$commentsByPost = BatchLoader::hasMany($db, 'comments', 'post_id', $postIds);
$authorsById = BatchLoader::belongsTo($db, 'users', 'id', $authorIds);
// Soft delete & restore explicitly
$db->table('posts')->where('id', '=', $id)->softDelete();
$db->table('posts')->where('id', '=', $id)->restore();
// Typed immutable test/seed factories
$factory = Factory::for(UserDto::class, fn(int $n) => ['email' => "user{$n}@example.test", 'role' => 'member']);
$admins = $factory->state(['role' => 'admin'])->count(3)->make();
use Kongono\Core\Clock\FrozenClock;
use Kongono\Database\Testing\DatabaseTestHelper;
use Kongono\Http\Testing\{TestClient, TestUpload};
use Kongono\Security\Egress\SafeHttpClient;
// Zero global state: explicit FrozenClock, SSRF-enforcing HTTP fake & SAVEPOINT rollback
$clock = FrozenClock::at('2026-11-22T12:00:00Z');
$fakeHttp = SafeHttpClient::fake(['https://api.partner.test/*' => ['status' => 200, 'body' => '{"ok":true}']]);
DatabaseTestHelper::inRollbackTransaction($db, function () use ($app, $admin): void {
$client = (new TestClient($app))->actingAs($admin)->withStatefulCookies()->followRedirects();
$client->postMultipart('/avatars', files: ['avatar' => TestUpload::fakePng('me.png')])
->assertCreated()
->assertJsonPath('status', 'stored');
});
Everything You Need — Zero Legacy Baggage
Self-verifying proofs, least-privilege route capabilities, built-in /_kongono Dev Studio & /_ops, reactive Live 2.5 & Bridge frontends, zero-dependency LSP, optional Oshie/Chie/Hantei companions, and a 26-tool MCP server.
One-Command Readiness Certificate
kongo prove runs 5 proof engines in one shot (17-rule contract diagnose --fix, app/invariants.php policies, prove:isolation, worker leak/N+1 perf, and PHP 8.5 codemod hygiene), plus kongo watch and kongo lsp.
Built-In Dev Studio & Operations
Zero-build Hot Reload, Built-In Dev Mailbox (sandboxed HTML preview & secret scrubbing, zero Mailpit/Docker), Read-Only Schema Explorer, Proof Center, 5W1H Dev X-Ray vs. Zero-Leak Prod KGN-* refs, and capability-gated /_ops.
Least-Privilege Routes & Incident Replay
Enforce #[ReadOnlyDb], #[NoOutboundHttp], #[MaxQueries], and #[MaxAiCost] pre-execution. Capture scrubbed 5xx incidents with $app->recordIncidents() and turn them into PHPUnit 13 tests via kongo incident:test.
Interactive AI Tutor & Grader
13 built-in lessons + 6 verifiable hands-on exercises (kongo oshie --exercise), offline v1.19 RAG retrieval, live CLI & SSE streaming, AGENTS.md grounding, and live DevInspector trace awareness.
Self-Verifying AI Builder
Inspects code, live DB schema & v1.19 docs via AgentPrincipal, applies surgical patches (action: "patch"), supports --interactive diff approval and --continue, and auto-repairs across PHPStan + PHPUnit + audit gates.
AI Debugger, Watcher & PR Reviewer
Tool-equipped root-cause diagnosis (CLI, /_kongono traces, /_ops DLQ jobs, hantei watch), closed-loop hantei fix, CI SARIF 2.1.0 hantei review, and PHPUnit 13 test generation — all secret-scrubbed.
Model Context Protocol & Agent Evals
Run kongo mcp (pre-wired in .vscode/mcp.json) so Cursor, Claude Code, Codex, and Antigravity run kongono_prove_all, kongono_search_docs, kongono_katachi_registry, kongono_impact, and kongono_shadow_diff, plus kongo eval --agent-bench.
Zero-Build Hypermedia or React/Vue/Svelte
Ship strict-CSP keyed DOM morphing, zero-eval() signals, kgn-oob, k-persist offline queues, and kgn-sortable — or drop into React/Vue/Svelte via Response::page() and @island.
Auth, Queues, Hybrid RAG & SDKs
SessionAuth, revocable PATs, Passkeys, TOTP, PostgreSQL SKIP LOCKED + Lua Redis queues, durable Workflows, streaming S3/Local storage, FTS + pgvector Hybrid RRF, and TS/Swift/Kotlin/Dart SDK generation.
Coming from Laravel or Symfony?
Kongono gives you batteries-included productivity while keeping zero legacy debt and strict persistent-runtime safety.
| Capability | Traditional PHP Frameworks | Kongono v1.19 (PHP 8.5+) |
|---|---|---|
| Runtime Dependencies | 50–90+ transitive packages (Symfony core + polyfills) | 8 packages total (Kongono + 7 PSR interfaces, 0 Symfony) |
| Persistent Runtimes | Bolt-on resetters (Octane) to patch static/global state | 0 mutable statics: explicit OperationScope + Container::resetScope() + kongo perf leak prover |
| Verification & Diagnostics | Manual code review + noisy stack traces + separate linters | kongo prove (5 pillars), diagnose --fix, #[ReadOnlyDb]/#[MaxQueries], kongo lsp, & Incident Time-Machine |
| Frontend & Dev Loop | Livewire/Inertia + Vite + Docker Mailpit + separate installs | Zero-build Live 2.5 + Bridge + built-in Hot Reload, Dev Mailbox, Schema Explorer, & kongo watch |
| Data, Queues & Ops | ActiveRecord magic + Horizon/Pulse/Telescope installs | Explicit QueryBuilder (RLS, soft deletes), BatchLoader, Hybrid RRF, built-in /_ops & /_kongono |
| Auth, Testing & AI/MCP | Sanctum/Fortify + global fakes + ad-hoc AI glue | Native SessionAuth, PATs, Passkeys, global-free TestClient/FrozenClock, eval --redteam/--agent-bench, & 26-tool MCP |