Commit graph

4 commits

Author SHA1 Message Date
Snider
5be20af4b0 feat: eliminate fmt, string concat — add core.Println, use Concat/Path everywhere
New primitive: core.Println() wraps fmt.Println.

Replaced across all test + example files:
- fmt.Println → Println (17 example files)
- fmt.Sprintf → Concat + Sprint
- dir + "/file" → Path(dir, "file") (path security)
- "str" + var → Concat("str", var) (AX consistency)

"fmt" import is now zero across all test files.
String concat with + is zero across all test files.

Remaining 9 stdlib imports (all Go infrastructure):
testing, context, time, sync, embed, io/fs, bytes, gzip, base64

558 tests, 84.5% coverage.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 19:42:39 +00:00
Snider
1cafdff227 feat: zero os/errors/filepath/json/exec/runtime in tests — full dogfood
Eliminated ALL disallowed imports from test files:
- os.WriteFile → Fs.Write()
- os.ReadFile → Fs.Read()
- os.ReadDir → Fs.List()
- os.MkdirAll → Fs.EnsureDir()
- os.MkdirTemp → Fs.TempDir()
- os.DirFS → core.DirFS()
- os.UserHomeDir → Env("DIR_HOME")
- os.Exit/Args/Environ → removed subprocess tests (RunE covers behaviour)
- Added Fs.TempDir() and core.DirFS() primitives

558 tests, 84.6% coverage. Core's tests now exclusively use Core's
own primitives. The quality gate from RFC-025 Principle 9 has zero
violations in Core's own codebase.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 19:23:11 +00:00
Snider
9cba5a8048 fix: dogfood core.Path() — eliminate path/filepath from all tests
Replaced all filepath.Join() with core.Path() across fs_test.go,
fs_example_test.go, core_test.go, path_test.go.

core.Path() IS the path traversal security boundary. Agents using
filepath.Join bypass it. Tests now demonstrate the Core way.

"path/filepath" import is now zero across all test files.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 18:58:16 +00:00
Snider
8b905f3a4a feat: per-file example tests — action, registry, fs, api, string, path, service, error, array
33 new examples across 8 dedicated files. Removed phantom CleanPath
(in RFC spec but never implemented — spec drift caught by examples).

545 tests total, 84.8% coverage. Every major primitive has compilable
examples that serve as test, documentation seed, and godoc content.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 18:29:24 +00:00