Snider
298322ed89
fix: AX audit round 5 — full naming, Result returns throughout
...
Renames (via GoLand refactor):
- Option.K → Key, Option.V → Value
- Err.Op → Operation, Err.Msg → Message, Err.Err → Error
- CrashSystem.OS → OperatingSystem, Arch → Architecture
- TaskID → TaskIdentifier, TaskWithID → TaskWithIdentifier
- Ipc → IPC, BaseDir → BaseDirectory
- ServiceRuntime.Opts → Options
Return type changes:
- Options.Get, Config.Get → Result (was (any, bool))
- Embed.ReadDir → Result (was ([]fs.DirEntry, error))
- Translator.Translate, I18n.Translate → Result (was string)
Rule 6:
- data.go: propagate opts.Get failure, typed error for bad fs.FS
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 16:32:43 +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
f5611b1002
refactor: AX audit fixes — no direct strings/fmt, full type names
...
Direct strings import removed from: data.go, error.go, fs.go
→ uses Split, SplitN, TrimPrefix, TrimSuffix, HasPrefix, Replace, Contains, Join
Direct fmt import removed from: fs.go
→ uses Print() from utils.go
fmt.Errorf in panic recovery → NewError(fmt.Sprint("panic: ", r))
Abbreviated type names renamed:
ConfigOpts → ConfigOptions
LogOpts → LogOptions
RotationLogOpts → RotationLogOptions
embed.go keeps strings import (strings.NewReader, strings.Builder).
error.go keeps fmt import (fmt.Sprint for panic values).
232 tests, 77.8% coverage.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-20 13:47:23 +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