Skip to content

Commit b6606cd

Browse files
committed
docs(core): repair four copy-fails in PHASE2_IMPLEMENTATION.md
The sandbox example wrote `blockedHosts`, a key `SandboxConfigSchema` does not declare: `safeParse` succeeds and silently strips it, so a reader who copies that security block blocks nothing and is told nothing. Both the schema and `sandbox-runtime.ts` spell it `deniedHosts`. The `Integration with Kernel` block passed `kernel.logger` to five constructors; that field is `private` on `ObjectKernel` and `protected` on `KernelBase`, with no public getter, so the block never compiled. Build the `ObjectLogger` those constructors take with `createLogger` instead. Drop the auto-recovery / auto-restart-with-backoff claims: `health-monitor.ts` reports and does not act, and the keys that configured a restart were retired under ADR-0049. Also repair the hot-reload feature bullet, the `npm test` line in a pnpm workspace, and the dead MICROKERNEL_IMPROVEMENT_PLAN.md link. Claude-Session: https://claude.ai/code/session_01CqmCgU5RGDoJYhHUMVp2af Co-authored-by: Claude <noreply@anthropic.com>
1 parent f8eaf67 commit b6606cd

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

‎packages/core/PHASE2_IMPLEMENTATION.md‎

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ Phase 2 implements the core runtime features for advanced plugin lifecycle manag
1010

1111
### 1. Health Monitor (`health-monitor.ts`)
1212

13-
The Health Monitor provides real-time health checking and auto-recovery for plugins.
13+
The Health Monitor provides real-time health checking for plugins. It REPORTS what it
14+
finds; acting on a report — restarting, replacing or quarantining a plugin — belongs to
15+
the host that owns the plugin's lifetime.
1416

1517
**Features:**
1618
- Configurable health check intervals
1719
- Automatic failure detection with thresholds
18-
- Auto-restart with backoff strategies (fixed, linear, exponential)
20+
- Status and report polling (`getHealthStatus` / `getHealthReport`) for the host to act on
1921
- Health status tracking (healthy, degraded, unhealthy, failed, recovering, unknown)
2022
- Metrics collection (uptime, memory, CPU, connections, error rate)
2123

@@ -52,8 +54,7 @@ The Hot Reload Manager enables zero-downtime plugin updates with state preservat
5254

5355
**Features:**
5456
- State preservation strategies (memory, disk, distributed, none)
55-
- File watching integration points
56-
- Debounced reload scheduling
57+
- Debounced reload scheduling (`scheduleReload`) — the host runs the watcher
5758
- Graceful shutdown with configurable timeout
5859
- Before/after reload hooks
5960
- State checksum verification
@@ -213,7 +214,7 @@ The Sandbox Runtime provides isolated execution environments with resource limit
213214
**Features:**
214215
- Multiple isolation levels (none, minimal, standard, strict, paranoid)
215216
- File system access control (allowed/denied paths)
216-
- Network access control (allowed/blocked hosts)
217+
- Network access control (allowed/denied hosts)
217218
- Process spawning control
218219
- Environment variable access control
219220
- Resource limit enforcement (memory, CPU, connections)
@@ -238,7 +239,7 @@ const context = sandbox.createSandbox('my-plugin', {
238239
network: {
239240
mode: 'restricted',
240241
allowedHosts: ['api.example.com'],
241-
blockedHosts: ['malicious.com'],
242+
deniedHosts: ['malicious.com'],
242243
maxConnections: 10,
243244
},
244245
process: {
@@ -312,6 +313,7 @@ These components are designed to integrate with the existing ObjectKernel:
312313
```typescript
313314
import {
314315
ObjectKernel,
316+
createLogger,
315317
PluginHealthMonitor,
316318
HotReloadManager,
317319
DependencyResolver,
@@ -321,12 +323,17 @@ import {
321323

322324
const kernel = new ObjectKernel({ logger: { level: 'info' } });
323325

326+
// The kernel's own logger is private and has no public getter, so build the
327+
// `ObjectLogger` these five constructors take from the same config rather than
328+
// reaching into the kernel.
329+
const logger = createLogger({ level: 'info' });
330+
324331
// Initialize Phase 2 components
325-
const healthMonitor = new PluginHealthMonitor(kernel.logger);
326-
const hotReload = new HotReloadManager(kernel.logger);
327-
const depResolver = new DependencyResolver(kernel.logger);
328-
const permManager = new PluginPermissionManager(kernel.logger);
329-
const sandbox = new PluginSandboxRuntime(kernel.logger);
332+
const healthMonitor = new PluginHealthMonitor(logger);
333+
const hotReload = new HotReloadManager(logger);
334+
const depResolver = new DependencyResolver(logger);
335+
const permManager = new PluginPermissionManager(logger);
336+
const sandbox = new PluginSandboxRuntime(logger);
330337

331338
// Register plugins with enhanced features
332339
// ... plugin registration code ...
@@ -346,7 +353,7 @@ Comprehensive unit tests are provided for all components:
346353
Run tests with:
347354

348355
```bash
349-
npm test
356+
pnpm --filter @objectstack/core test
350357
```
351358

352359
## Performance Considerations
@@ -376,6 +383,5 @@ Phase 3 and beyond will add:
376383

377384
## References
378385

379-
- [MICROKERNEL_IMPROVEMENT_PLAN.md](../../MICROKERNEL_IMPROVEMENT_PLAN.md)
380386
- [ARCHITECTURE.md](../../ARCHITECTURE.md)
381387
- [Protocol Definitions](../spec/src/system/)

0 commit comments

Comments
 (0)