Skip to content

Commit 80744d9

Browse files
committed
feat(library): add proxy diagnostics and components config split
1 parent b11b434 commit 80744d9

14 files changed

Lines changed: 407 additions & 58 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,13 @@ elprobe run <package>
202202
installed packages no longer reports false dependency failures.
203203
- Added package proxy inspection and guarded operations:
204204
- `/easylibrary packages proxies [package]`;
205+
- `/easylibrary packages proxies doctor [package]`;
205206
- `/easylibrary packages proxies prepare <package> confirm`;
206207
- `/easylibrary packages proxies reconcile confirm`;
207208
- `/easylibrary packages proxies cleanup confirm`.
209+
- Proxy diagnostics now print a mount summary plus per-package recovery hints
210+
for missing/incomplete proxies, stale metadata, parked manifests, standalone
211+
shadows and plugin-loader allow/block-list problems.
208212

209213
### Runtime diagnostics absorbed into 3.0-dev
210214

@@ -297,9 +301,16 @@ elprobe run <package>
297301
- Standalone library-installer settings now read from
298302
`config/library-installer.yml` when present and fall back to `config.yml`
299303
values when absent.
300-
- Added split config templates for package manager and library installer.
301-
- Config doctor, migrate, repair and reload now operate on both supported areas:
302-
`package-manager` and `library-installer`.
304+
- Core component settings now read from `config/components.yml` when present
305+
and fall back to the legacy `components.yml` file when absent.
306+
- Fresh servers without a legacy `components.yml` now generate component
307+
settings under `config/components.yml`.
308+
- Added split config templates for package manager, library installer and
309+
components.
310+
- Config doctor, migrate, repair and reload now operate on the supported areas:
311+
`package-manager`, `library-installer` and `components`.
312+
- Component config reload is intentionally diagnostic only for the current
313+
session; component toggles and command overrides take effect on the next boot.
303314

304315
### Runtime compatibility hardening
305316

@@ -339,7 +350,8 @@ elprobe run <package>
339350
- Package install/update/remove/rollback flows prepare the next boot.
340351
- Proxy folders under `plugins/` are still required when PMMP plugin identity
341352
must satisfy `depend`, `softdepend`, `/pl` and `getPlugin()`.
342-
- Config Split currently covers `package-manager` and `library-installer`.
353+
- Config Split currently covers `package-manager`, `library-installer` and
354+
`components`.
343355
- Legacy embedded source has been removed from the EasyLibrary core. Remaining
344356
3.0-dev hardening should focus on package lifecycle, docs/wiki and release
345357
validation.

README.md

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Libraries: 13 / standalone: 0 / package-backed: 13 / not installed: 0
6767
Problems: 0
6868
Command provider: package-backed
6969
Command backend: libcommand-rich
70-
Config: package-manager=split / library-installer=split
70+
Config: package-manager=split / library-installer=split / components=split
7171
```
7272

7373
If the server still reports `legacy` config, migrate supported config blocks once:
@@ -78,7 +78,7 @@ If the server still reports `legacy` config, migrate supported config blocks onc
7878
/easylibrary config doctor
7979
```
8080

81-
The migration writes supported files such as `plugin_data/EasyLibrary/config/package-manager.yml` and `plugin_data/EasyLibrary/config/library-installer.yml`, then leaves the old `config.yml` blocks untouched as fallback.
81+
The migration writes supported files such as `plugin_data/EasyLibrary/config/package-manager.yml`, `plugin_data/EasyLibrary/config/library-installer.yml` and `plugin_data/EasyLibrary/config/components.yml`, then leaves the old `config.yml` blocks and legacy `components.yml` untouched as fallback.
8282

8383
### Installing internal packages
8484

@@ -118,7 +118,7 @@ elprobe run libplaceholder
118118

119119
### Safe config operations
120120

121-
Config Split currently supports `package-manager` and `library-installer`:
121+
Config Split currently supports `package-manager`, `library-installer` and `components`:
122122

123123
```txt
124124
/easylibrary config doctor
@@ -127,7 +127,7 @@ Config Split currently supports `package-manager` and `library-installer`:
127127
/easylibrary config repair [confirm]
128128
```
129129

130-
`config reload` reloads config files only. It does not hot-swap package-backed plugins, regenerate PMMP dependency graphs, change loaded permissions or remount proxies. Changes to `plugin-loader`, `runtime-autoload`, `plugin.yml`, dependencies, permissions and load order still require restart.
130+
`config reload` reloads config files only. It does not hot-swap package-backed plugins, regenerate PMMP dependency graphs, change loaded permissions, remount proxies, enable/disable active components or re-register command overrides. Changes to `plugin-loader`, `runtime-autoload`, `components`, `plugin.yml`, dependencies, permissions and load order still require restart.
131131

132132
### Plugin developer rule of thumb
133133

@@ -255,6 +255,7 @@ The preferred 3.x command path is `/easylibrary packages`. The old `/easylibrary
255255
| Return to local package version | `/easylibrary packages rollback <package> [version] [confirm]` |
256256
| Clean temporary downloads/staging | `/easylibrary packages cleanup [confirm]` |
257257
| Inspect package proxy mounts | `/easylibrary packages proxies [package]` |
258+
| Diagnose package proxy mounts | `/easylibrary packages proxies doctor [package]` |
258259
| Prepare one proxy | `/easylibrary packages proxies prepare <package> confirm` |
259260
| Reconcile managed proxies | `/easylibrary packages proxies reconcile confirm` |
260261
| Repair state, lock and proxy metadata | `/easylibrary packages repair <package\|all> [confirm]` |
@@ -274,6 +275,7 @@ The preferred 3.x command path is `/easylibrary packages`. The old `/easylibrary
274275
/easylibrary packages rollback <package> [version] [confirm]
275276
/easylibrary packages cleanup [confirm]
276277
/easylibrary packages proxies [package]
278+
/easylibrary packages proxies doctor [package]
277279
/easylibrary packages proxies prepare <package> confirm
278280
/easylibrary packages proxies reconcile confirm
279281
/easylibrary packages proxies cleanup confirm
@@ -291,24 +293,25 @@ Current asset-ready internal packages in this wave include `libpacket`, `libcomm
291293

292294
Installing a package is still separate from replacing a standalone plugin. EasyLibrary 3.0-dev prepares a hidden package-backed proxy under `plugins/.easylibrary-<Plugin>.easylibplugin/`, while the real package code stays under `plugin_data/EasyLibrary/packages/`. If the matching standalone plugin is present, the proxy is parked and the standalone wins for that server session.
293295

294-
### Modular package-manager config
296+
### Modular config split
295297

296-
EasyLibrary 3.0-dev includes the first Config Split foundation. Package-manager and standalone library-installer settings can now be read from:
298+
EasyLibrary 3.0-dev includes the Config Split foundation. Package-manager, standalone library-installer and core component settings can now be read from:
297299

298300
```txt
299301
plugin_data/EasyLibrary/config/package-manager.yml
300302
plugin_data/EasyLibrary/config/library-installer.yml
303+
plugin_data/EasyLibrary/config/components.yml
301304
```
302305

303-
When one of those files exists, its values override the matching `package-manager.*` or `library-installer.*` entries from the legacy `plugin_data/EasyLibrary/config.yml`. If a split file does not exist, the old `config.yml` path continues to work exactly as before. No config file is moved or migrated automatically in this phase.
306+
When `package-manager.yml` or `library-installer.yml` exists, its values override the matching `package-manager.*` or `library-installer.*` entries from the legacy `plugin_data/EasyLibrary/config.yml`. When `components.yml` exists under `config/`, it overrides the legacy `plugin_data/EasyLibrary/components.yml`. Existing legacy files are left in place as fallback.
304307

305308
Use `/easylibrary doctor` to confirm which config sources are active. The doctor reports `split`, `legacy` or `defaults` for supported areas. For a more detailed migration check, run `/easylibrary config doctor`; it prints each split path, split value detection, legacy value detection and any warnings about empty or mismatched split files.
306309

307-
Use `/easylibrary config migrate` for a dry-run plan that creates supported split files from legacy `config.yml` blocks. Repeat with `confirm` to write missing split files. The command intentionally leaves `config.yml` unchanged, so rollback is just removing the split file and restarting if behavior changed.
310+
Use `/easylibrary config migrate` for a dry-run plan that creates supported split files from legacy sources. `package-manager` and `library-installer` are copied from `config.yml`; `components` is copied from `components.yml`. Repeat with `confirm` to write missing split files. The command intentionally leaves legacy files unchanged, so rollback is just removing the split file and restarting if behavior changed.
308311

309-
Use `/easylibrary config repair` when a supported split file is missing, empty or not recognized but `config.yml` still has a valid block for that area. It is dry-run by default; with `confirm`, it writes only the split file and still leaves `config.yml` untouched. It does not try to reconcile divergent values yet.
312+
Use `/easylibrary config repair` when a supported split file is missing, empty or not recognized but the legacy source still has valid values for that area. It is dry-run by default; with `confirm`, it writes only the split file and still leaves legacy files untouched. It does not try to reconcile divergent values yet.
310313

311-
Use `/easylibrary config reload` for a safe config-file reload. It reloads `config.yml`, rereads split config files through a fresh resolver and reports restart boundaries. It does not unload, mount or hot-swap package-backed plugins; changes to `package-manager.plugin-loader`, `package-manager.runtime-autoload`, plugin dependencies, permissions or load order still require a restart to affect the current PMMP session.
314+
Use `/easylibrary config reload` for a safe config-file reload. It reloads `config.yml`, rereads split config files through a fresh resolver and reports restart boundaries. It does not unload, mount or hot-swap package-backed plugins; changes to `package-manager.plugin-loader`, `package-manager.runtime-autoload`, `components`, plugin dependencies, permissions or load order still require a restart to affect the current PMMP session.
312315

313316
The modular files use each legacy block's contents without the outer area key. For `package-manager.yml`:
314317

@@ -341,6 +344,16 @@ backup-before-install: true
341344
restart-required: true
342345
```
343346

347+
For `components.yml`:
348+
349+
```yaml
350+
logger: true
351+
commands:
352+
overwrite_defaults: true
353+
vendor:
354+
Cache: true
355+
```
356+
344357
For controlled smoke tests, remove one matching standalone plugin at a time and restart. The package should move from `installed-shadowed-by-standalone` to `active`, `/easylibrary packages doctor` should report no problems, and `elprobe run <package>` should report `functional=yes`.
345358

346359
Package installs are guarded by the same safety rules as the standalone installer:
@@ -367,6 +380,8 @@ The package-backed loader has now validated the base wave (`libserializer`, `lib
367380

368381
`/easylibrary packages doctor` validates package paths, installed manifests, sha256 metadata, proxy marker data and stale restart markers. If a package is already active through the package-backed proxy, stale restart-required entries are cleared automatically.
369382

383+
`/easylibrary packages proxies doctor [package]` focuses only on generated package-backed proxy mounts. It prints mount summaries, active/parked/missing manifest counts and per-package recovery hints such as `proxies prepare`, `packages repair`, `packages switch` or config allow-list fixes.
384+
370385
`/easylibrary packages repair <package|all>` is dry-run by default. With `confirm`, it can rewrite missing package lock entries from installed state, normalize stale state metadata, clear restart markers for active package-backed plugins and regenerate managed proxy mounts.
371386

372387
`/easylibrary packages update <package> [channel]` is also dry-run by default. It only stages a different registered target version for an already installed package; it does not move the currently loaded package directory while the server is running, and the updated package becomes active after restart.
@@ -417,6 +432,7 @@ The standalone installer remains available for compatibility. The preferred 3.x
417432
/easylibrary packages rollback <package> [version] [confirm]
418433
/easylibrary packages cleanup [confirm]
419434
/easylibrary packages proxies [package]
435+
/easylibrary packages proxies doctor [package]
420436
/easylibrary packages proxies prepare <package> confirm
421437
/easylibrary packages proxies reconcile confirm
422438
/easylibrary packages proxies cleanup confirm

changelogs/3.0.md

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,35 @@ Failed to load some plugins, stopping server to protect server integrity
10291029
| `parked-standalone-present` | standalone exists and wins. |
10301030
| `armed-switch-pending` | operator confirmed migration and must remove standalone before boot. |
10311031

1032+
### Proxy doctor
1033+
1034+
Proxy recovery now has a dedicated read-only diagnostic mode:
1035+
1036+
```text
1037+
/easylibrary packages proxies doctor
1038+
/easylibrary packages proxies doctor libplaceholder
1039+
```
1040+
1041+
The normal `proxies` command still lists generated mounts. The `doctor` action
1042+
adds operator guidance:
1043+
1044+
- installed proxy mount counts;
1045+
- complete, active, parked, missing and blocked proxy totals;
1046+
- per-package mount and package paths;
1047+
- package status problems related to proxy markers or package state;
1048+
- the next recovery command to run.
1049+
1050+
Example recovery hints:
1051+
1052+
```text
1053+
/easylibrary packages proxies prepare libplaceholder confirm
1054+
/easylibrary packages repair libplaceholder confirm
1055+
/easylibrary packages switch libplaceholder
1056+
```
1057+
1058+
This keeps proxy troubleshooting inside EasyLibrary instead of forcing admins
1059+
to inspect hidden folders or marker JSON by hand.
1060+
10321061
### Migration flows
10331062

10341063
Standalone to package:
@@ -1326,7 +1355,7 @@ It keeps server/system information and adds EasyLibrary context:
13261355
Packages: 13/13 installed, 13 active, 0 pending, 0 shadowed
13271356
Official libs: 13 package-backed, 0 standalone, 0 not installed
13281357
Command backend: libcommand-rich
1329-
Config: package-manager=split / library-installer=split
1358+
Config: package-manager=split / library-installer=split / components=split
13301359
```
13311360

13321361
It also fixed the PHP 8.2 float-to-int deprecation from the old uptime
@@ -1341,16 +1370,25 @@ Supported split files:
13411370
```text
13421371
plugin_data/EasyLibrary/config/package-manager.yml
13431372
plugin_data/EasyLibrary/config/library-installer.yml
1373+
plugin_data/EasyLibrary/config/components.yml
13441374
```
13451375

1346-
Read order:
1376+
Read order for `package-manager` and `library-installer`:
13471377

13481378
```text
13491379
1. config/<area>.yml
13501380
2. config.yml legacy block
13511381
3. built-in defaults
13521382
```
13531383

1384+
Read order for `components`:
1385+
1386+
```text
1387+
1. config/components.yml
1388+
2. components.yml legacy file
1389+
3. built-in defaults
1390+
```
1391+
13541392
Commands:
13551393

13561394
```text
@@ -1364,7 +1402,9 @@ Commands:
13641402

13651403
The old `config.yml` was becoming too large. Package manager, runtime autoload,
13661404
plugin loader, installer and future notification settings all need separate
1367-
space.
1405+
space. Component settings were already separate, but lived beside `config.yml`
1406+
as `components.yml`; moving them under `config/` keeps operational config in a
1407+
single predictable directory.
13681408

13691409
Config Split starts moving large areas into:
13701410

@@ -1374,6 +1414,11 @@ plugin_data/EasyLibrary/config/
13741414

13751415
without breaking old servers that still use `config.yml`.
13761416

1417+
For components, existing servers keep using `components.yml` until
1418+
`/easylibrary config migrate confirm` creates `config/components.yml`. Fresh
1419+
servers without a legacy component file write component defaults directly under
1420+
`config/components.yml`.
1421+
13771422
### Example `package-manager.yml`
13781423

13791424
```yaml
@@ -1396,6 +1441,16 @@ backup-before-install: true
13961441
restart-required: true
13971442
```
13981443

1444+
### Example `components.yml`
1445+
1446+
```yaml
1447+
logger: true
1448+
commands:
1449+
overwrite_defaults: true
1450+
vendor:
1451+
Cache: true
1452+
```
1453+
13991454
### Migration flow
14001455

14011456
Dry-run:
@@ -1417,10 +1472,10 @@ Validate:
14171472
/easylibrary doctor
14181473
```
14191474

1420-
Expected after migrating both supported areas:
1475+
Expected after migrating all supported areas:
14211476

14221477
```text
1423-
Config: package-manager=split / library-installer=split
1478+
Config: package-manager=split / library-installer=split / components=split
14241479
```
14251480

14261481
### Repair flow
@@ -1434,6 +1489,12 @@ Repair is conservative. It can recreate a missing split file or replace an
14341489
empty/unrecognized split file from a usable legacy block. It does not merge
14351490
divergent values yet.
14361491

1492+
Reload is still bounded. `/easylibrary config reload` can refresh values for
1493+
future command reads, but it does not hot-swap package-backed plugins, remount
1494+
proxies, enable/disable active components or re-register `/plugins` and
1495+
`/version` overrides. Component config changes should be followed by a restart
1496+
when they affect runtime behavior.
1497+
14371498
### Reload flow
14381499

14391500
```text

docs/getting-started.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ If `config doctor` reports `legacy`, migrate supported split configs:
3232
/easylibrary config migrate confirm
3333
```
3434

35+
The current split areas are `package-manager`, `library-installer` and
36+
`components`. Existing legacy files are kept as rollback fallback.
37+
3538
## Use from another plugin
3639

3740
If your plugin requires EasyLibrary to boot:

docs/migration.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ if($provider === null || !$provider->isEnabled()){
8282

8383
## Safe rollback
8484

85-
Because config migration does not delete `config.yml`, rollback is simple:
85+
Because config migration does not delete `config.yml` or `components.yml`,
86+
rollback is simple:
8687

8788
1. Stop the server.
88-
2. Remove or move the relevant split file, such as `plugin_data/EasyLibrary/config/package-manager.yml` or `plugin_data/EasyLibrary/config/library-installer.yml`.
89+
2. Remove or move the relevant split file, such as `plugin_data/EasyLibrary/config/package-manager.yml`, `plugin_data/EasyLibrary/config/library-installer.yml` or `plugin_data/EasyLibrary/config/components.yml`.
8990
3. Start the server.
9091
4. Confirm `/easylibrary config doctor` reports `legacy` for that area.
9192

docs/smoke-tests.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Passing baseline:
8888
Problems: 0
8989
Command provider: package-backed
9090
Command backend: libcommand-rich
91-
Config: package-manager=split / library-installer=split
91+
Config: package-manager=split / library-installer=split / components=split
9292
```
9393

9494
For a full package-backed server, `/easylibrary packages doctor` should report:
@@ -503,7 +503,7 @@ Purpose:
503503

504504
```text
505505
Prove split config files can be created, repaired and reloaded without deleting
506-
legacy config.yml values.
506+
legacy config.yml or components.yml values.
507507
```
508508

509509
Steps:
@@ -523,14 +523,18 @@ Expected after migration:
523523
```text
524524
Package manager: split / split file: yes / split values: yes / legacy values: yes
525525
Library installer: split / split file: yes / split values: yes / legacy values: yes
526+
Components: split / split file: yes / split values: yes / legacy values: yes
526527
Legacy values still exist in config.yml; split config takes precedence.
528+
Legacy components values still exist in components.yml; split config takes precedence.
527529
```
528530

529531
Pass criteria:
530532

531533
- `config/package-manager.yml` exists.
532534
- `config/library-installer.yml` exists.
535+
- `config/components.yml` exists.
533536
- `config.yml` remains untouched.
537+
- `components.yml` remains untouched when it existed before migration.
534538
- `config reload` explains restart boundaries.
535539
- Doctor still reports `Problems: 0`.
536540

0 commit comments

Comments
 (0)