Commit graph

4 commits

Author SHA1 Message Date
Snider
cf25af1a13 fix: AX audit round 4 — semantic naming, Result returns
- Op → Operation, AllOps → AllOperations (no abbreviations)
- Translator.T → Translator.Translate (avoids testing.T confusion)
- Lock.Mu → Lock.Mutex, ServiceRuntime.Opts → .Options
- ErrorLog.Error/Warn return Result instead of error
- ErrorPanic.Reports returns Result instead of ([]CrashReport, error)
- Core.LogError/LogWarn simplified to passthrough

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 16:00:41 +00:00
Snider
b2d0deb99b fix: AX audit round 3 — 8 violations resolved
- core.go: Result{Value: wrapped} → Result{wrapped, false} (explicit failure)
- error.go: fmt.Sprint → Sprint wrapper, removed fmt import
- fs.go: Stat/Open propagate validatePath failures (return vp)
- lock.go: Startables/Stoppables return Result
- task.go: PerformAsync returns Result
- runtime.go: updated to unwrap Result from Startables/Stoppables

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 15:49:33 +00:00
Snider
5d67088080 feat: Service as typed struct, Result without generics
Service is now a proper struct with OnStart/OnStop/OnReload lifecycle
functions — not a registry wrapping any. Packages create Service{} with
typed fields, same pattern as Command and Option.

Result drops generics — Value is any. The struct is the container,
Value is the generic. No more Result[T] ceremony.

Service(name, Service{}) to register, Service(name) to get — both
return Result. ServiceFactory returns Result not (any, error).

NewWithFactories/NewRuntime return Result.

232 tests, 77.8% coverage.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 13:30:22 +00:00
Snider
1ca010e1fb test: rewrite test suite for AX primitives API
164 tests, 41.3% coverage. Tests written against the public API only
(external test package, no _test.go in pkg/core/).

Covers: New(Options), Data, Drive, Config, Service, Error, IPC,
Fs, Cli, Lock, Array, Log, App, Runtime, Task.

Fixes: NewCommand now inits flagset, New() wires Cli root command.

Old tests removed — they referenced With*, RegisterService, and
other patterns that no longer exist.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 08:42:38 +00:00