From 5d316650e2c4378ffb8e69591f37fc6e6a7a6876 Mon Sep 17 00:00:00 2001 From: Snider Date: Wed, 25 Mar 2026 20:01:01 +0000 Subject: [PATCH] =?UTF-8?q?feat(rfc):=20add=20Current=20State=20+=20File?= =?UTF-8?q?=20Layout=20=E2=80=94=20save=20future=20session=20research?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Current State: every file with specific migration action - File Layout: annotated tree showing what exists and what changes - Factory signature, lifecycle returns, singleton removal documented - Future session reads this and knows exactly what to change Co-Authored-By: Virgil --- docs/RFC.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/RFC.md b/docs/RFC.md index c6daadc..15ff2da 100644 --- a/docs/RFC.md +++ b/docs/RFC.md @@ -24,6 +24,30 @@ go-process provides: c.Action("process.run", s.handleRun) Without go-process registered, `c.Process().Run()` returns `Result{OK: false}`. Permission-by-registration. +### Current State (2026-03-25) + +The codebase is PRE-migration. The RFC describes the v0.8.0 target. What exists today: + +- `service.go` — `NewService(opts) func(*Core) (any, error)` — **old factory signature**. Change to `Register(c *Core) core.Result` +- `OnStartup() error` / `OnShutdown() error` — **Change** to return `core.Result` +- `process.SetDefault(svc)` global singleton — **Remove**. Service registers in Core conclave +- Own ID generation `fmt.Sprintf("proc-%d", ...)` — **Replace** with `core.ID()` +- Custom `map[string]*ManagedProcess` — **Replace** with `core.Registry[*ManagedProcess]` +- No named Actions registered — **Add** `process.run/start/kill/list/get` during OnStartup + +### File Layout + +``` +service.go — main service (factory, lifecycle, process execution) +registry.go — daemon registry (PID files, health, restart) +daemon.go — DaemonEntry, managed daemon lifecycle +health.go — health check endpoints +pidfile.go — PID file management +buffer.go — output buffering +actions.go — WILL CONTAIN Action handlers after migration +global.go — global Default() singleton — DELETE after migration +``` + --- ## 2. Registration