refactor: rename lib/ to core/ for clearer core-module separation
Rename the top-level lib/ directory to core/ so the project root immediately communicates which code is core platform and which lives in modules/. PHP namespaces (MintyPHP\*) are unchanged — only the Composer PSR-4 path mapping moves from lib/ to core/. Module-internal lib/ directories (modules/*/lib/) are untouched. Updated across the full stack: - composer.json PSR-4 mapping - bootstrap entry points (web/index.php, bin/*, tests/bootstrap.php) - tooling configs (phpstan.neon, phpunit.xml, php-cs-fixer) - 26 architecture contract tests - enforcement-policy, guard-catalog, quality-gates - all documentation (CLAUDE.md, README, 25 docs/, .agents/skills/) - bin/qa-extended.sh search paths - .claude/settings.local.json permission paths Workflow: .agents/runs/CORE-LIB-RENAME-001/ (Analyst → Planner → Executor → Code Review (4 findings fixed) → Security Review → Acceptance Test → Finalizer) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,11 +19,11 @@ Verbindliche Kurzregeln für Architekturentscheidungen.
|
||||
flowchart TD
|
||||
Browser([Browser / API-Client])
|
||||
|
||||
subgraph APP["lib/App/ — Composition Root"]
|
||||
subgraph APP["core/App/ — Composition Root"]
|
||||
DI["AppContainer + Registrars"]
|
||||
end
|
||||
|
||||
subgraph SVC["lib/Service/"]
|
||||
subgraph SVC["core/Service/"]
|
||||
direction LR
|
||||
FAC["Factory"]
|
||||
SERVICE["Service"]
|
||||
@@ -31,7 +31,7 @@ flowchart TD
|
||||
POL["Policy"]
|
||||
end
|
||||
|
||||
subgraph REPO["lib/Repository/"]
|
||||
subgraph REPO["core/Repository/"]
|
||||
REP["Repository"]
|
||||
end
|
||||
|
||||
@@ -73,8 +73,8 @@ flowchart TD
|
||||
## Schichtregeln (MUSS)
|
||||
|
||||
- `pages/**`: Input, Auth/AuthZ, Orchestrierung, Response.
|
||||
- `lib/Service/**`: Fachlogik und Anwendungsfluss.
|
||||
- `lib/Repository/**`: SQL, Filter, Paging, Mapping.
|
||||
- `core/Service/**`: Fachlogik und Anwendungsfluss.
|
||||
- `core/Repository/**`: SQL, Filter, Paging, Mapping.
|
||||
- `templates/**`: Rendering ohne Business-Logik.
|
||||
- Templates konsumieren nur vom Action-Layer vorbereitete View-Daten (`$viewAuth`, Form/ViewModel), keine direkten Permission-Helper.
|
||||
- Service-Auflösung in Actions/Helpers nur über `app(Foo::class)`.
|
||||
@@ -89,11 +89,11 @@ flowchart TD
|
||||
|
||||
## Instanziierungsregeln (MUSS)
|
||||
|
||||
- Composition Root: `web/index.php` + `lib/App/registerContainer.php`
|
||||
- Composition Root: `web/index.php` + `core/App/registerContainer.php`
|
||||
(→ Details: `/docs/explanation-di-container.md`).
|
||||
- `new ...Factory()` nur im Composition Root und in `*Factory.php`.
|
||||
- In `lib/Service/**` außerhalb von `*Factory.php` keine direkten `new ...Factory()`.
|
||||
- In `lib/Service/**` außerhalb von `*Factory.php` keine direkten `new ...Service()`, `new ...Gateway()` oder `new ...Repository()`.
|
||||
- In `core/Service/**` außerhalb von `*Factory.php` keine direkten `new ...Factory()`.
|
||||
- In `core/Service/**` außerhalb von `*Factory.php` keine direkten `new ...Service()`, `new ...Gateway()` oder `new ...Repository()`.
|
||||
- Legacy-Helper (`accessServicesFactory()`, `userServicesFactory()` usw.) sind entfernt und werden nicht mehr genutzt.
|
||||
|
||||
## API- und Security-Regeln (MUSS)
|
||||
@@ -129,8 +129,8 @@ Bei JS-Änderungen zusätzlich Browser-Smoke mit DevTools-Console (keine JS-Erro
|
||||
Struktur-Gates zusätzlich:
|
||||
|
||||
```bash
|
||||
(rg 'new\s+[^\s(]+Factory\(' lib/Service || true) | wc -l
|
||||
(rg --glob '!**/*Factory.php' 'new\s+[^\s(]+(Service|Gateway|Repository)\(' lib/Service || true) | wc -l
|
||||
(rg 'new\s+[^\s(]+Factory\(' core/Service || true) | wc -l
|
||||
(rg --glob '!**/*Factory.php' 'new\s+[^\s(]+(Service|Gateway|Repository)\(' core/Service || true) | wc -l
|
||||
(rg "\b(accessServicesFactory|directoryServicesFactory|userServicesFactory|authServicesFactory|tenantServicesFactory|settingServicesFactory|userRepositoryFactory|authRepositoryFactory|authGatewayFactory)\(" pages lib templates web || true) | wc -l
|
||||
(rg -n 'new\s+[^\s(]+(Service|Gateway|Repository)\(' pages -g '*.php' || true) | wc -l
|
||||
(rg -n '\bDB::' pages -g '*.php' || true) | wc -l
|
||||
@@ -147,6 +147,6 @@ docker compose exec php vendor/bin/phpunit tests/Architecture/CoreStarterkitCont
|
||||
|
||||
## Vertiefung
|
||||
|
||||
- `/docs/reference-lib-standards.md`
|
||||
- `/docs/reference-core-standards.md`
|
||||
- `/docs/explanation-sicherheitsmodell.md`
|
||||
- `/docs/howto-rbac-permissions-playbook.md`
|
||||
|
||||
Reference in New Issue
Block a user