apply go-centric architecture optimizations and document them in readme

This commit is contained in:
DBT
2026-02-24 09:25:12 +00:00
parent 3dd918d429
commit 4105eeb0db
7 changed files with 209 additions and 12 deletions

View File

@@ -15,6 +15,24 @@
- **Stability controls**: Sentinel inspection and auto-heal support.
- **Skill extensibility**: built-in skills plus GitHub skill installation and atomic script execution.
## 🧠 Architecture-Level Optimizations (Go)
A recent architecture pass leveraged core Go strengths:
1. **Actor-style process path**
- Process metadata persistence is serialized via async queue (`persistQ`).
2. **Typed Events bus**
- Added generic typed pub/sub bus (`pkg/events/typed_bus.go`).
- Process lifecycle events (start/exit/kill) are now publishable.
3. **Batched log flushing**
- Process logs are flushed by `logWriter` with time/size thresholds to reduce I/O churn.
4. **Context hierarchy + cancellation propagation**
- Background exec now uses `exec.CommandContext` with parent `ctx` propagation.
5. **Atomic runtime config snapshot**
- Added `pkg/runtimecfg/snapshot.go`; gateway startup/reload atomically swaps config snapshot.
These changes improve stability, observability, and maintainability under concurrency.
## 🏁 Quick Start
1. Initialize config and workspace