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
f8e1459bd1
fix: AX audit — eloquent Result literals, renamed abbreviations, error propagation
...
- Result{x, true} positional literals replace verbose Result{Value: x, OK: true}
- Result{err, false} replaces bare Result{} where errors were swallowed
- ErrCode → ErrorCode, LogPan → LogPanic (no abbreviations)
- NewBuilder()/NewReader() wrappers in string.go, removed strings import from embed.go
- fmt.Errorf in log.go replaced with NewError(fmt.Sprint(...))
- 14 files, 66 audit violations resolved
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 15:36:33 +00:00
Snider
2d6415b3aa
feat: embed.go and data.go return Result throughout
...
Mount, MountEmbed, Open, ReadFile, ReadString, Sub, GetAsset,
GetAssetBytes, ScanAssets, GeneratePack, Extract → all return Result.
Data.ReadFile, ReadString, List, ListNames, Extract → Result.
Data.New uses Mount's Result internally.
Internal helpers (WalkDir callback, copyFile) stay error — they're
not public API.
231 tests, 77.4% coverage.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 14:13:47 +00:00
Snider
f1d6c2a174
feat: Join() reclaimed for strings — ErrorJoin for errors
...
core.Join("/", "deploy", "to", "homelab") → "deploy/to/homelab"
core.Join(".", "cmd", "deploy", "description") → "cmd.deploy.description"
Join builds via Concat — same hook point for security/validation.
errors.Join wrapper renamed to ErrorJoin.
JoinPath now delegates to Join("/", ...).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 12:42:10 +00:00
Snider
c61a2d3dfe
test: 214 tests, 79% coverage — GeneratePack with real files, SetOutput, crash reports
...
Hit compress/compressFile via GeneratePack with actual asset files on disk.
Added SetOutput log test. Crash report test covers Reports() graceful nil.
Remaining 0%: getAllFiles (group dir scan), appendReport (unexported filePath).
Both are internal plumbing — public API is fully covered.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 12:10:41 +00:00
Snider
b2d07e7883
test: 200 tests, 50.2% coverage — Data, I18n, Fs, Log, Embed, Runtime
...
New tests: Data List/ListNames/Extract, I18n with mock Translator,
Fs full surface (EnsureDir, IsDir, IsFile, Exists, List, Stat, Open,
Create, Append, ReadStream, WriteStream, Delete, DeleteAll, Rename),
Log all levels + Security + Username + Default + LogErr + LogPan,
Embed ScanAssets + GeneratePack + MountEmbed, Runtime ServiceName,
Core LogError/LogWarn/Must helpers.
Fixes: NewCommand inits flagset, New() wires Cli root command + app.
Remaining 0% (excluding CLI/App): compress, getAllFiles (internal),
Reports/appendReport (needs ErrorPanic filePath), SetOutput (trivial).
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 10:49:33 +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