Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
eed6473
docs: rewrite README as a full framework guide (concepts, lifecycle, …
hakeemRash Jul 11, 2026
82bc557
build(bundle): pin bundle dependencies to the PHP 8.4 series
Alshatri Jul 16, 2026
7f3888a
Merge branch 'main'
hakeemRash Jul 16, 2026
195b7e7
ci(release): auto-tag new CHANGELOG version on merge to main -> trigg…
hakeemRash Jul 16, 2026
d86341b
ci(release): auto-release on merge to main via workflow_call (no PAT)…
hakeemRash Jul 16, 2026
1218ab1
docs(readme): document master->main branch model and automatic CHANGE…
hakeemRash Jul 16, 2026
a68ce88
ci(security): CODEOWNERS + main branch protection script (required re…
hakeemRash Jul 16, 2026
a796202
feat(edge): host-aware web-server config plugin (nginx SNI stream spl…
hakeemRash Jul 16, 2026
dc335b4
feat(edge): classify .local/.test as local domains β€” exclude from ser…
hakeemRash Jul 17, 2026
9af3885
fix(edge): resolve project registry from global kernel home (not proj…
hakeemRash Jul 17, 2026
87ccd90
feat(edge): project-aware config β€” per-project vhosts (docroot app/pu…
hakeemRash Jul 17, 2026
c84409c
feat(edge): default commands to the CURRENT project (base_path/proj.j…
hakeemRash Jul 17, 2026
0533c81
feat(edge): auto-resolve PHP-FPM socket to match the CLI PHP version …
hakeemRash Jul 17, 2026
f2bef6e
feat(userconfig): resolve config path for non-root sudo users
hakeemRash Jul 17, 2026
5514c5c
Adopt masterβ†’main branch model, automated releases, and main branch p…
hakeemRash Jul 17, 2026
9aad6f6
feat(edge): enhance hosts management with dev mode checks and force o…
hakeemRash Jul 17, 2026
ad7ec07
chore(release): v1.0.13 β€” Edge plugin, PSP_PROJECTS_DIR export, front…
hakeemRash Jul 17, 2026
e6bf46d
Merge remote-tracking branch 'origin/main'
hakeemRash Jul 17, 2026
da9573c
chore(release): bump to v1.0.14 (v1.0.13 tag already exists from an e…
hakeemRash Jul 17, 2026
2960acf
chore(release): reclaim v1.0.13 (stale mis-tagged v1.0.13 release/tag…
hakeemRash Jul 17, 2026
eb31d1e
Release v1.0.13 β€” Edge plugin + launcher/frontend fixes (#24)
hakeemRash Jul 17, 2026
e37a293
chore(release): v1.0.14
hakeemRash Jul 17, 2026
59f925a
chore: align CHANGELOG to released v1.0.13 (drop phantom 1.0.14)
hakeemRash Jul 17, 2026
310c874
fix(edge): serve local .local/.test domains in dev mode (--dev)
hakeemRash Jul 17, 2026
ef0027f
Merge origin/main into master (squash-merge of #24; master already co…
hakeemRash Jul 17, 2026
170f48c
Release v1.0.15 β€” Edge serves local domains in dev (#25)
hakeemRash Jul 17, 2026
4436575
Merge branch 'main' of github.com:AlfaCode-Team/php-service-platform
Alshatri Jul 18, 2026
53696ad
Merge branch 'master' of github.com:AlfaCode-Team/php-service-platform
Alshatri Jul 18, 2026
57b5831
feat(edge): TLS modes, APP_ENV cache profiles and OpenSwoole runtime …
hakeemRash Jul 18, 2026
0a3f640
Merge origin/main into master (PR #26: Edge TLS modes, APP_ENV cache …
hakeemRash Jul 18, 2026
af463d0
feat(tenancy): add control plane support and enhance tenant migration…
hakeemRash Jul 20, 2026
f704871
feat(cli): hkm discover β€” find and register projects on disk
hakeemRash Jul 20, 2026
92b575e
Release v1.0.17 β€” hkm discover: find & register projects on disk (#27)
hakeemRash Jul 20, 2026
fffc4d8
feat(cli): plugins recover + discover restores runtime dirs
hakeemRash Jul 20, 2026
4a33ef4
Merge remote-tracking branch 'origin/main'
hakeemRash Jul 20, 2026
b9fb1dd
Release v1.0.18 β€” plugins recover + discover restores runtime dirs (#28)
hakeemRash Jul 20, 2026
d4b58cb
feat(edge): stream reuse/merge, force strategy, security hardening; r…
hakeemRash Jul 21, 2026
f804f42
Merge remote-tracking branch 'origin/main'
hakeemRash Jul 21, 2026
11f319d
test(edge): make nginx -t check portable across nginx versions
hakeemRash Jul 21, 2026
8875546
test(edge): make nginx -t syntax check runnable as non-root in CI
hakeemRash Jul 21, 2026
624dd4f
chore: auto-wire git hooks to strip AI co-author trailers
hakeemRash Jul 21, 2026
b921a72
chore: drop pulse-engine + module-template modules, patch guzzle, wir…
hakeemRash Jul 21, 2026
b5b2d0e
feat: add issue and pull request templates, contributing guide, secur…
hakeemRash Jul 21, 2026
6d8203a
feat: add issue templates for documentation and plugin proposals
hakeemRash Jul 21, 2026
ed45d09
Merge branch 'main' of github.com:AlfaCode-Team/php-service-platform
hakeemRash Jul 21, 2026
d1c5543
Merge branch 'main' of github.com:AlfaCode-Team/php-service-platform
hakeemRash Jul 21, 2026
6b397df
Merge branch 'main' of github.com:AlfaCode-Team/php-service-platform
hakeemRash Jul 21, 2026
5537430
ci: add CodeQL (JS/TS + Actions) and PHP analysis (composer audit, Se…
hakeemRash Jul 21, 2026
6b846c9
ci: drop custom CodeQL workflow β€” repo uses CodeQL default setup (avo…
hakeemRash Jul 21, 2026
e7818c3
ci(phpstan): add level-5 config + baseline, make analysis a blocking …
hakeemRash Jul 21, 2026
320e924
fix: repair MigrateListCommand parent + OutboxWriter port contract
hakeemRash Jul 21, 2026
fe4bfc2
ci: fix PHPStan (ignore optional Swoole/OpenSwoole coroutine calls) +…
hakeemRash Jul 21, 2026
248d9f9
Merge branch 'main' of github.com:AlfaCode-Team/php-service-platform
hakeemRash Jul 21, 2026
b1d0451
chore(oss): open-source readiness β€” license, composer metadata, .env.…
hakeemRash Jul 21, 2026
45ce8a5
chore: add craftdevscommunity as code owner (required PR reviewers fo…
hakeemRash Jul 21, 2026
1da40e9
Refactor Pageflow stages and consolidate functionality
hakeemRash Jul 22, 2026
5b6b2fc
Depend on alfacode-team/http ^1.0 (dev-master in monorepo, v1.0.0 for…
hakeemRash Jul 22, 2026
36852f6
feat(module): add `hkm module` command for managing first-party kerne…
hakeemRash Jul 22, 2026
7573b25
chore: update subproject commit for http module
hakeemRash Jul 22, 2026
caad9ea
Point http submodule at latest master (dev-master, v1.0.0 release for…
hakeemRash Jul 22, 2026
b13cfa3
refactor(PageflowResponderTest): consolidate stage classes into a sin…
hakeemRash Jul 22, 2026
40e2fef
Refactor code structure for improved readability and maintainability
hakeemRash Jul 22, 2026
81e1194
Merge branch 'main' into master
hakeemRash Jul 22, 2026
cde63b8
docs: update README to enhance clarity and structure, add new sections
hakeemRash Jul 22, 2026
400bce5
Merge branch 'master' of github.com:AlfaCode-Team/hkm-kernel
hakeemRash Jul 22, 2026
9cd205d
Merge #36; rebrand to HKM Kernel, publish docs/guides, README rewrite…
hakeemRash Jul 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ tools/zig-out/
/.claude/
/CLAUDE.md
/.github/copilot-instructions.md
/docs/
# Ignore each entry under docs/ (not the dir itself, so the negation below works):
/docs/*
# ...but publish the curated, reader-facing guides (docs/ai-context stays ignored):
!/docs/guides/


# ── COMPOSER ──────────────────────────────────────────────────
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.0.21] - 2026-07-22

### Changed
- **Rebranded to HKM Kernel.** The CLI banner (`hkm version`) now renders the HKM
block-letter art and reads "HKM Kernel Β· Gated Demand Architecture"; the debug/error
page and CLI exception header are branded **HKM** (was "Sentinel"); the global-kernel
autoload error prefix is now `[HKM]`.
- **README rewritten as a guided document** β€” leads with Purpose, project goals, and an
honest "done vs. cooking" status map, followed by install and usage. Adds the HKM hero
banner and points at the new public guides.

### Added
- **Public architecture guides under `docs/guides/`** β€” a curated, reader-facing set of
layer-by-layer guides (kernel, modules, plugins, security, data access, and more), with
an index. The internal AI-context source stays private.

### Fixed
- **Security-layer docs corrected to match the code.** The guides no longer describe a
kernel `FirewallLayer` / `RateLimiterLayer` (which do not exist) β€” the kernel ships only
`CsrfTokenLayer`; authentication comes from the Auth plugin (`JwtAuthLayer` /
`PersonalAccessTokenLayer`), and rate-limiting / IP-filtering are SecurityFilters route
filters (`throttle` / `shield`).

### Merged
- Integrates edge features, CLI commands, and security updates from #36.

## [1.0.20] - 2026-07-22

### Added
Expand Down
138 changes: 117 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<a href="https://www.php.net/"><img src="https://img.shields.io/badge/PHP-8.4%2B-777bb4" alt="PHP"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/License-MIT-green" alt="License"></a>
<img src="https://img.shields.io/badge/runtime-FPM%20%7C%20OpenSwoole-orange" alt="Runtime">
<img src="https://img.shields.io/badge/status-active%20development-blue" alt="Status">
</p>

It ships as a **native cross-platform CLI** (`hkm`) built with Zig, so you install and
Expand All @@ -22,18 +23,115 @@ upgrade it like a Go/Rust binary β€” no Composer needed to get started.

## Table of contents

1. [Why GDA?](#why-gda)
2. [Install](#install)
3. [The `hkm` CLI](#the-hkm-cli)
4. [Your first project](#your-first-project)
5. [Core concepts](#core-concepts)
6. [The request lifecycle](#the-request-lifecycle)
7. [Building a feature β€” end to end](#building-a-feature--end-to-end)
8. [The five access rules](#the-five-access-rules)
9. [Batteries included (plugins)](#batteries-included-plugins)
10. [Development from source](#development-from-source)
11. [Security defaults](#security-defaults)
12. [License](#license)
1. [Purpose](#purpose)
2. [What we're building toward](#what-were-building-toward)
3. [Project status β€” done vs. cooking](#project-status--done-vs-cooking)
4. [Why GDA?](#why-gda)
5. [Install](#install)
6. [The `hkm` CLI](#the-hkm-cli)
7. [Your first project](#your-first-project)
8. [Core concepts](#core-concepts)
9. [The request lifecycle](#the-request-lifecycle)
10. [Building a feature β€” end to end](#building-a-feature--end-to-end)
11. [The five access rules](#the-five-access-rules)
12. [Batteries included (plugins)](#batteries-included-plugins)
13. [Development from source](#development-from-source)
14. [Security defaults](#security-defaults)
15. [License](#license)

---

## Purpose

**HKM Kernel exists to make secure, cost-predictable PHP services the default β€” not the
reward for discipline.**

Most PHP frameworks boot the whole application, wire every service, and *then* decide what
the request needs. That is convenient, but it means an unauthenticated request that should
cost nothing still pays to construct half your app, and domain boundaries live only in your
head (and your code reviews).

HKM inverts that with the **Gated Demand Architecture**:

- **Security is the gate, not a middleware afterthought.** A `SecurityGateway` runs *before*
any module is wired. A denied request costs *zero* module construction.
- **You pay only for what a route uses.** Modules are resolved from a per-request dependency
graph and wired on demand. Nothing you didn't ask for is loaded.
- **Boundaries are enforced by the runtime, not by convention.** Cross-layer and
cross-module access rules throw real exceptions, not lint warnings.

The goal is a framework where the *fast, secure, well-bounded* way to build something is also
the *easy* way β€” and where you can drop in a first-party plugin (auth, tenancy, mail, OAuth2)
without inheriting a monolith.

> **This is not Laravel, Symfony, or Slim.** It borrows none of their conventions β€” no
> globals, no facades, no runtime auto-discovery. Everything is explicit and injected.

---

## What we're building toward

The north-star goals that guide every decision in this repo:

| Goal | What it means |
|---|---|
| **Zero-cost denial** | A blocked request never constructs a module. Security is measured in the gateway, not the controller. |
| **Per-request minimalism** | The kernel wires exactly the modules a route needs β€” and their transitive dependencies β€” and nothing else. |
| **Runtime-enforced isolation** | One module, one domain. Modules cannot reach into each other's internals; the container throws if they try. |
| **A dependency-free kernel** | The core should carry no vendor coupling. Request/Response/uploads become pure value objects (see *cooking*, below). |
| **Infrastructure independence** | The kernel defines *ports*; the project supplies adapters (MySQL, Redis, S3, SMTP…). Swap them without touching domain code. |
| **Install like a binary** | `hkm` is a native cross-platform launcher β€” no Composer required to get started, upgradeable in place. |
| **Batteries, not a monolith** | Auth, Users, Tenancy, OAuth2, Mail, and more ship as opt-in first-party plugins, each owning exactly one domain. |

---

## Project status β€” done vs. cooking

> **Where things stand today.** HKM is under **active development**. The architecture and the
> core plugins are in daily use, and releases are cut regularly β€” but some subsystems are
> still stabilizing. This section is the honest map.

### βœ… Done & stable

- **The GDA kernel** β€” boot pipeline (10 fail-fast stages), security gateway, on-demand
module loader, request-scoped DI with runtime scope enforcement, HTTP / CLI / Worker
pipelines, domain + integration event system, and the port interfaces.
- **The five access rules**, enforced at runtime via `ModuleContainer::bindInternal()`.
- **Native distribution** β€” `hkm` launcher + `hkm-config` built with Zig; `.deb`, macOS
`.app`, and Windows `.zip` bundles published automatically from `CHANGELOG.md`.
- **First-party plugins** (see [the full table](#batteries-included-plugins)) β€” Auth,
User, Tenancy, OAuth2, Validation, Mail, Storage, Session/Cookie, HttpClient,
SecurityFilters, I18n, View/ViteManifest/Pageflow.
- **Multi-project, multi-tenant hosting** β€” host-based `DomainResolver`, strict per-tenant
DB routing, and a project-over-plugin resource resolution model.
- **Database & migrations** β€” the multi-driver `DatabasePort` (MySQL / PostgreSQL / SQLite /
SQL Server) and the standalone **LetMigrate** engine (fluent schema, seeders, CLI).
- **Frontend federation** β€” per-project surfaces + `hkm ui` to mirror plugin UIs, with a
Pageflow (Inertia-style) SPA bridge.

### 🍳 Still cooking

- **Dependency-free HTTP core.** The kernel's `Request`/`Response`/`UploadedFile` are
*currently* built on `symfony/http-foundation` as a deliberate, temporary choice. They are
being reimplemented as pure value objects so the kernel carries no vendor coupling. The
kernel's own method surface (`$request->input()`, `Response::json()`, …) is the stable API β€”
build against it and the switch will be non-breaking.
- **API surface hardening.** We're at the `1.0.x` line; some plugin contracts and config keys
are still settling. Pin your version and read the [CHANGELOG](CHANGELOG.md) before upgrading.
- **Docs & guides.** The layer deep-dives in [`docs/guides/`](docs/guides/) are being expanded
and turned into a proper documentation site.
- **Test & tooling coverage.** PHPStan (level 5) and the PHPUnit suite are wired as CI gates;
coverage and static-analysis depth are still growing.

### πŸ—ΊοΈ On the roadmap

- Finish the dependency-free kernel and drop the transitional Symfony dependency.
- A public documentation site generated from the layer guides.
- More first-party adapters (queue backends, storage drivers, mail transports).
- Performance benchmarks published per release.

Found a gap or want to help? [Open an issue](https://github.com/AlfaCode-Team/hkm-kernel/issues)
or a discussion.

---

Expand All @@ -54,9 +152,6 @@ The result: predictable performance (you pay only for what a route uses), strong
boundaries that hold at runtime, and infrastructure you can swap without touching business
code.

> **This is not Laravel, Symfony, or Slim.** It borrows none of their conventions. If you're
> coming from those, unlearn the globals and facades β€” everything here is explicit and injected.

### The three worlds

```text
Expand All @@ -65,7 +160,7 @@ code.
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ MODULE / PLUGIN LAYER (bounded domains) β”‚ β”‚
β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚
β”‚ β”‚ β”‚ KERNEL (Sentinel) β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ KERNEL β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ boot Β· security Β· loading Β· DI Β· β”‚ β”‚ β”‚
β”‚ β”‚ β”‚ pipelines Β· events Β· ports β”‚ β”‚ β”‚
β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚
Expand All @@ -82,7 +177,7 @@ code.
## Install

Download the latest build from
[Releases](https://github.com/AlfaCode-Team/php-service-platform/releases/latest).
[Releases](https://github.com/AlfaCode-Team/hkm-kernel/releases/latest).

**Linux (Debian / Ubuntu / Kali)**
```bash
Expand Down Expand Up @@ -119,11 +214,12 @@ so they match your exact PHP.
| `hkm worker [args]` | Run a project's queue worker |
| `hkm list` | List registered projects |
| `hkm plugins [path\|name]` | Analyse a project's enabled plugins/modules |
| `hkm module` | Inspect / update the first-party kernel packages |
| `hkm ui [sync\|list\|link\|clean]` | Federate enabled plugins' UIs into the frontend |
| `hkm doctor` | Diagnose PHP, extensions, and the resolved kernel path |
| `hkm-config` | Set up / repair the full environment (kernel + userdata) |
| `hkm upgrade [--check]` | Check for and install a newer release |
| `hkm version` / `--version` / `-v` | Show the Sentinel banner + version |
| `hkm version` / `--version` / `-v` | Show the banner + version |
| `hkm <command> --dev` | Run any command against the **development** kernel checkout |

### Environment (all auto-detected β€” override only for non-standard layouts)
Expand Down Expand Up @@ -467,8 +563,8 @@ Each plugin ships its own `README.md` β€” e.g. [Auth](plugins/Auth/README.md),
## Development from source

```bash
git clone --recurse-submodules git@github.com:AlfaCode-Team/php-service-platform.git
cd php-service-platform
git clone --recurse-submodules git@github.com:AlfaCode-Team/hkm-kernel.git
cd hkm-kernel
composer install # also wires the git hooks (core.hooksPath=.githooks)
vendor/bin/phpunit # run the test suite

Expand Down Expand Up @@ -511,7 +607,7 @@ Notes:
`workflow_call`.
- You can still cut a release manually at any time by pushing a `v*` tag.

For deep dives, see the layer guides in [`docs/ai-context/`](docs/) and the
For deep dives, see the layer guides in [`docs/guides/`](docs/guides/) and the
[CHANGELOG](CHANGELOG.md).

---
Expand Down
Loading
Loading