From 6c4050486ba0fa13d73605323143c73e4ebc1191 Mon Sep 17 00:00:00 2001 From: Snider Date: Sun, 22 Mar 2026 01:55:36 +0000 Subject: [PATCH] refactor(container): migrate module path to dappco.re/go/core/container Update module path from forge.lthn.ai/core/go-container to dappco.re/go/core/container. Migrate import paths for go-io (v0.2.0), go-log (v0.1.0), and go-i18n (v0.2.0) to their new dappco.re equivalents. cli and config remain at forge.lthn.ai (not yet migrated). Co-Authored-By: Virgil --- CONSUMERS.md | 2 +- cmd/vm/cmd_container.go | 8 ++++---- cmd/vm/cmd_templates.go | 8 ++++---- cmd/vm/cmd_vm.go | 2 +- devenv/claude.go | 4 ++-- devenv/config.go | 2 +- devenv/config_test.go | 2 +- devenv/devops.go | 6 +++--- devenv/devops_test.go | 4 ++-- devenv/images.go | 6 +++--- devenv/images_test.go | 4 ++-- devenv/serve.go | 4 ++-- devenv/serve_test.go | 2 +- devenv/shell.go | 2 +- devenv/ssh_utils.go | 4 ++-- devenv/test.go | 4 ++-- devenv/test_test.go | 2 +- docs/development.md | 4 ++-- docs/index.md | 28 ++++++++++++++-------------- go.mod | 12 ++++++++---- go.sum | 8 ++++++++ hypervisor.go | 2 +- kb/Home.md | 4 ++-- kb/Hypervisors.md | 2 +- linuxkit.go | 4 ++-- linuxkit_test.go | 2 +- sources/cdn.go | 4 ++-- sources/cdn_test.go | 2 +- sources/github.go | 4 ++-- sources/source.go | 4 ++-- state.go | 2 +- templates.go | 4 ++-- 32 files changed, 82 insertions(+), 70 deletions(-) diff --git a/CONSUMERS.md b/CONSUMERS.md index acb1c04..6031a48 100644 --- a/CONSUMERS.md +++ b/CONSUMERS.md @@ -1,6 +1,6 @@ # Consumers of go-container -These modules import `forge.lthn.ai/core/go-container`: +These modules import `dappco.re/go/core/container`: - core - go-devops diff --git a/cmd/vm/cmd_container.go b/cmd/vm/cmd_container.go index 56c3873..2fdbfe8 100644 --- a/cmd/vm/cmd_container.go +++ b/cmd/vm/cmd_container.go @@ -9,11 +9,11 @@ import ( "text/tabwriter" "time" + "dappco.re/go/core/container" + "dappco.re/go/core/i18n" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" "forge.lthn.ai/core/cli/pkg/cli" - "forge.lthn.ai/core/go-container" - "forge.lthn.ai/core/go-i18n" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" ) var ( diff --git a/cmd/vm/cmd_templates.go b/cmd/vm/cmd_templates.go index 510f165..4d14a04 100644 --- a/cmd/vm/cmd_templates.go +++ b/cmd/vm/cmd_templates.go @@ -9,11 +9,11 @@ import ( "strings" "text/tabwriter" + "dappco.re/go/core/container" + "dappco.re/go/core/i18n" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" "forge.lthn.ai/core/cli/pkg/cli" - "forge.lthn.ai/core/go-container" - "forge.lthn.ai/core/go-i18n" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" ) // addVMTemplatesCommand adds the 'templates' command under vm. diff --git a/cmd/vm/cmd_vm.go b/cmd/vm/cmd_vm.go index d5a00fb..5704d19 100644 --- a/cmd/vm/cmd_vm.go +++ b/cmd/vm/cmd_vm.go @@ -2,8 +2,8 @@ package vm import ( + "dappco.re/go/core/i18n" "forge.lthn.ai/core/cli/pkg/cli" - "forge.lthn.ai/core/go-i18n" ) func init() { diff --git a/devenv/claude.go b/devenv/claude.go index 9744bd4..bf3de40 100644 --- a/devenv/claude.go +++ b/devenv/claude.go @@ -8,8 +8,8 @@ import ( "path/filepath" "strings" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" ) // ClaudeOptions configures the Claude sandbox session. diff --git a/devenv/config.go b/devenv/config.go index 9f33dd6..8fefb7e 100644 --- a/devenv/config.go +++ b/devenv/config.go @@ -4,8 +4,8 @@ import ( "os" "path/filepath" + "dappco.re/go/core/io" "forge.lthn.ai/core/config" - "forge.lthn.ai/core/go-io" ) // Config holds global devops configuration from ~/.core/config.yaml. diff --git a/devenv/config_test.go b/devenv/config_test.go index 863d819..5090339 100644 --- a/devenv/config_test.go +++ b/devenv/config_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/io" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/devenv/devops.go b/devenv/devops.go index 82bc891..ea21672 100644 --- a/devenv/devops.go +++ b/devenv/devops.go @@ -9,9 +9,9 @@ import ( "runtime" "time" - "forge.lthn.ai/core/go-container" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + "dappco.re/go/core/container" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" ) const ( diff --git a/devenv/devops_test.go b/devenv/devops_test.go index c0cf745..55f9e79 100644 --- a/devenv/devops_test.go +++ b/devenv/devops_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "forge.lthn.ai/core/go-container" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/container" + "dappco.re/go/core/io" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/devenv/images.go b/devenv/images.go index 04a2ea1..ce5edf6 100644 --- a/devenv/images.go +++ b/devenv/images.go @@ -8,9 +8,9 @@ import ( "path/filepath" "time" - "forge.lthn.ai/core/go-container/sources" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + "dappco.re/go/core/container/sources" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" ) // ImageManager handles image downloads and updates. diff --git a/devenv/images_test.go b/devenv/images_test.go index 795212d..f1b1a83 100644 --- a/devenv/images_test.go +++ b/devenv/images_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "forge.lthn.ai/core/go-container/sources" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/container/sources" + "dappco.re/go/core/io" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/devenv/serve.go b/devenv/serve.go index 022cf52..16bf96d 100644 --- a/devenv/serve.go +++ b/devenv/serve.go @@ -7,8 +7,8 @@ import ( "os/exec" "path/filepath" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" ) // ServeOptions configures the dev server. diff --git a/devenv/serve_test.go b/devenv/serve_test.go index 1c2f61e..5dfd4ee 100644 --- a/devenv/serve_test.go +++ b/devenv/serve_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/io" "github.com/stretchr/testify/assert" ) diff --git a/devenv/shell.go b/devenv/shell.go index 1aac88f..0b10e02 100644 --- a/devenv/shell.go +++ b/devenv/shell.go @@ -6,7 +6,7 @@ import ( "os" "os/exec" - coreerr "forge.lthn.ai/core/go-log" + coreerr "dappco.re/go/core/log" ) // ShellOptions configures the shell connection. diff --git a/devenv/ssh_utils.go b/devenv/ssh_utils.go index f65d5c8..e1afc9c 100644 --- a/devenv/ssh_utils.go +++ b/devenv/ssh_utils.go @@ -8,8 +8,8 @@ import ( "path/filepath" "strings" - coreio "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + coreio "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" ) // ensureHostKey ensures that the host key for the dev environment is in the known hosts file. diff --git a/devenv/test.go b/devenv/test.go index 6de6085..5ec7957 100644 --- a/devenv/test.go +++ b/devenv/test.go @@ -6,8 +6,8 @@ import ( "path/filepath" "strings" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" "gopkg.in/yaml.v3" ) diff --git a/devenv/test_test.go b/devenv/test_test.go index fd1e23a..baa5d8c 100644 --- a/devenv/test_test.go +++ b/devenv/test_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "testing" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/io" ) func TestDetectTestCommand_Good_ComposerJSON(t *testing.T) { diff --git a/docs/development.md b/docs/development.md index 65872e8..0833052 100644 --- a/docs/development.md +++ b/docs/development.md @@ -8,7 +8,7 @@ description: How to build, test, and contribute to go-container. ## Prerequisites - **Go 1.26+** -- The module uses Go 1.26 features. -- **Go workspace** -- This module is part of a Go workspace at `~/Code/go.work`. Local development of sibling modules (go-io, config, go-i18n, cli) requires the workspace file. +- **Go workspace** -- This module is part of a Go workspace at `~/Code/go.work`. Local development of sibling modules (core/io, config, core/i18n, cli) requires the workspace file. Optional (for actually running VMs): @@ -109,7 +109,7 @@ go-container/ - **UK English** in all strings, comments, and documentation (colour, organisation, honour). - **Strict typing** -- All function parameters and return values are typed. No `interface{}` without justification. - **Error wrapping** -- Use `fmt.Errorf("context: %w", err)` for all error returns. -- **`io.Medium` abstraction** -- File system operations go through `io.Medium` (from `go-io`) rather than directly calling `os` functions. This enables testing with mock file systems. The `io.Local` singleton is used for real file system access. +- **`io.Medium` abstraction** -- File system operations go through `io.Medium` (from `core/io`) rather than directly calling `os` functions. This enables testing with mock file systems. The `io.Local` singleton is used for real file system access. - **Compile-time interface checks** -- Use `var _ Interface = (*Impl)(nil)` to verify implementations at compile time (see `sources/cdn.go` and `sources/github.go`). - **Context propagation** -- All operations that might block accept a `context.Context` as their first parameter. diff --git a/docs/index.md b/docs/index.md index eda6006..fc2ef65 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,7 +5,7 @@ description: Container runtime, LinuxKit image builder, and portable development # go-container -`forge.lthn.ai/core/go-container` provides a container runtime built on LinuxKit and lightweight hypervisors. It manages the full lifecycle of LinuxKit virtual machines -- from building images with embedded templates, to running them via QEMU or Hyperkit, to offering a portable development environment with shell access, project mounting, test execution, and Claude AI integration. +`dappco.re/go/core/container` provides a container runtime built on LinuxKit and lightweight hypervisors. It manages the full lifecycle of LinuxKit virtual machines -- from building images with embedded templates, to running them via QEMU or Hyperkit, to offering a portable development environment with shell access, project mounting, test execution, and Claude AI integration. This is **not** a Docker wrapper. It runs real VMs from LinuxKit images (ISO, qcow2, VMDK, raw) using platform-native acceleration (KVM on Linux, HVF on macOS, Hyperkit where available). @@ -13,7 +13,7 @@ This is **not** a Docker wrapper. It runs real VMs from LinuxKit images (ISO, qc ## Module path ``` -forge.lthn.ai/core/go-container +dappco.re/go/core/container ``` Requires **Go 1.26+**. @@ -26,8 +26,8 @@ Requires **Go 1.26+**. ```go import ( "context" - container "forge.lthn.ai/core/go-container" - "forge.lthn.ai/core/go-io" + container "dappco.re/go/core/container" + "dappco.re/go/core/io" ) manager, err := container.NewLinuxKitManager(io.Local) @@ -54,8 +54,8 @@ fmt.Printf("Started container %s (PID %d)\n", c.ID, c.PID) ```go import ( - "forge.lthn.ai/core/go-container/devenv" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/container/devenv" + "dappco.re/go/core/io" ) dev, err := devenv.New(io.Local) @@ -77,7 +77,7 @@ err = dev.Test(ctx, "/path/to/project", devenv.TestOptions{}) ### Build and run from a LinuxKit template ```go -import container "forge.lthn.ai/core/go-container" +import container "dappco.re/go/core/container" // List available templates (built-in + user-defined) templates := container.ListTemplates() @@ -95,24 +95,24 @@ content, err := container.ApplyTemplate("core-dev", map[string]string{ | Package | Import path | Purpose | |---------|-------------|---------| -| `container` (root) | `forge.lthn.ai/core/go-container` | Container struct, Manager interface, hypervisor abstraction, LinuxKit manager, state persistence, template engine | -| `devenv` | `forge.lthn.ai/core/go-container/devenv` | Portable dev environment orchestration: boot, shell, serve, test, Claude sandbox, image management | -| `sources` | `forge.lthn.ai/core/go-container/sources` | Image download backends: CDN and GitHub Releases with progress reporting | -| `cmd/vm` | `forge.lthn.ai/core/go-container/cmd/vm` | CLI commands (`core vm run`, `core vm ps`, `core vm stop`, `core vm logs`, `core vm exec`, `core vm templates`) | +| `container` (root) | `dappco.re/go/core/container` | Container struct, Manager interface, hypervisor abstraction, LinuxKit manager, state persistence, template engine | +| `devenv` | `dappco.re/go/core/container/devenv` | Portable dev environment orchestration: boot, shell, serve, test, Claude sandbox, image management | +| `sources` | `dappco.re/go/core/container/sources` | Image download backends: CDN and GitHub Releases with progress reporting | +| `cmd/vm` | `dappco.re/go/core/container/cmd/vm` | CLI commands (`core vm run`, `core vm ps`, `core vm stop`, `core vm logs`, `core vm exec`, `core vm templates`) | ## Dependencies | Module | Purpose | |--------|---------| -| `forge.lthn.ai/core/go-io` | File system abstraction (`Medium` interface), process utilities | +| `dappco.re/go/core/io` | File system abstraction (`Medium` interface), process utilities | | `forge.lthn.ai/core/config` | Configuration loading (used by `devenv` for `~/.core/config.yaml`) | -| `forge.lthn.ai/core/go-i18n` | Internationalised UI strings (used by `cmd/vm`) | +| `dappco.re/go/core/i18n` | Internationalised UI strings (used by `cmd/vm`) | | `forge.lthn.ai/core/cli` | CLI framework (used by `cmd/vm` for command registration) | | `github.com/stretchr/testify` | Test assertions | | `gopkg.in/yaml.v3` | YAML parsing for test configuration | -The root `container` package has only two direct dependencies: `go-io` and the standard library. The `devenv` and `cmd/vm` packages pull in the heavier dependencies. +The root `container` package has only two direct dependencies: `core/io` and the standard library. The `devenv` and `cmd/vm` packages pull in the heavier dependencies. ## CLI commands diff --git a/go.mod b/go.mod index bc04adf..27b676f 100644 --- a/go.mod +++ b/go.mod @@ -1,20 +1,24 @@ -module forge.lthn.ai/core/go-container +module dappco.re/go/core/container go 1.26.0 require ( + dappco.re/go/core/i18n v0.2.0 + dappco.re/go/core/io v0.2.0 + dappco.re/go/core/log v0.1.0 forge.lthn.ai/core/cli v0.3.7 forge.lthn.ai/core/config v0.1.8 - forge.lthn.ai/core/go-i18n v0.1.7 - forge.lthn.ai/core/go-io v0.1.7 - forge.lthn.ai/core/go-log v0.0.4 github.com/stretchr/testify v1.11.1 gopkg.in/yaml.v3 v3.0.1 ) require ( + dappco.re/go/core v0.5.0 // indirect forge.lthn.ai/core/go v0.3.3 // indirect + forge.lthn.ai/core/go-i18n v0.1.7 // indirect forge.lthn.ai/core/go-inference v0.1.6 // indirect + forge.lthn.ai/core/go-io v0.1.7 // indirect + forge.lthn.ai/core/go-log v0.0.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/charmbracelet/bubbletea v1.3.10 // indirect github.com/charmbracelet/colorprofile v0.4.3 // indirect diff --git a/go.sum b/go.sum index b3757c3..ba97008 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,11 @@ +dappco.re/go/core v0.5.0 h1:P5DJoaCiK5Q+af5UiTdWqUIW4W4qYKzpgGK50thm21U= +dappco.re/go/core v0.5.0/go.mod h1:f2/tBZ3+3IqDrg2F5F598llv0nmb/4gJVCFzM5geE4A= +dappco.re/go/core/i18n v0.2.0 h1:NHzk6RCU93/qVRA3f2jvMr9P1R6FYheR/sHL+TnvKbI= +dappco.re/go/core/i18n v0.2.0/go.mod h1:9eSVJXr3OpIGWQvDynfhqcp27xnLMwlYLgsByU+p7ok= +dappco.re/go/core/io v0.2.0 h1:zuudgIiTsQQ5ipVt97saWdGLROovbEB/zdVyy9/l+I4= +dappco.re/go/core/io v0.2.0/go.mod h1:1QnQV6X9LNgFKfm8SkOtR9LLaj3bDcsOIeJOOyjbL5E= +dappco.re/go/core/log v0.1.0 h1:pa71Vq2TD2aoEUQWFKwNcaJ3GBY8HbaNGqtE688Unyc= +dappco.re/go/core/log v0.1.0/go.mod h1:Nkqb8gsXhZAO8VLpx7B8i1iAmohhzqA20b9Zr8VUcJs= forge.lthn.ai/core/cli v0.3.7 h1:1GrbaGg0wDGHr6+klSbbGyN/9sSbHvFbdySJznymhwg= forge.lthn.ai/core/cli v0.3.7/go.mod h1:DBUppJkA9P45ZFGgI2B8VXw1rAZxamHoI/KG7fRvTNs= forge.lthn.ai/core/config v0.1.8 h1:xP2hys7T94QGVF/OTh84/Zr5Dm/dL/0vzjht8zi+LOg= diff --git a/hypervisor.go b/hypervisor.go index 67e8fa2..087093d 100644 --- a/hypervisor.go +++ b/hypervisor.go @@ -9,7 +9,7 @@ import ( "runtime" "strings" - coreerr "forge.lthn.ai/core/go-log" + coreerr "dappco.re/go/core/log" ) // Hypervisor defines the interface for VM hypervisors. diff --git a/kb/Home.md b/kb/Home.md index 8b71700..59f97a6 100644 --- a/kb/Home.md +++ b/kb/Home.md @@ -1,6 +1,6 @@ # go-container -Module: `forge.lthn.ai/core/go-container` +Module: `dappco.re/go/core/container` Container runtime for managing LinuxKit VMs as lightweight containers. Supports running LinuxKit images (ISO, qcow2, vmdk, raw) via QEMU or Hyperkit hypervisors. Includes a dev environment system for Claude Code agents and development workflows. @@ -55,7 +55,7 @@ Container runtime for managing LinuxKit VMs as lightweight containers. Supports ## Usage ```go -import "forge.lthn.ai/core/go-container" +import "dappco.re/go/core/container" // Auto-detect hypervisor hv, _ := container.DetectHypervisor() diff --git a/kb/Hypervisors.md b/kb/Hypervisors.md index 9f0c711..49e599e 100644 --- a/kb/Hypervisors.md +++ b/kb/Hypervisors.md @@ -1,6 +1,6 @@ # Hypervisors -Module: `forge.lthn.ai/core/go-container` +Module: `dappco.re/go/core/container` ## Interface diff --git a/linuxkit.go b/linuxkit.go index f891bf8..c1cf962 100644 --- a/linuxkit.go +++ b/linuxkit.go @@ -10,8 +10,8 @@ import ( "syscall" "time" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" ) // LinuxKitManager implements the Manager interface for LinuxKit VMs. diff --git a/linuxkit_test.go b/linuxkit_test.go index da748e8..08496c3 100644 --- a/linuxkit_test.go +++ b/linuxkit_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/io" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/sources/cdn.go b/sources/cdn.go index d301aee..9503ce6 100644 --- a/sources/cdn.go +++ b/sources/cdn.go @@ -8,8 +8,8 @@ import ( "os" "path/filepath" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" ) // CDNSource downloads images from a CDN or S3 bucket. diff --git a/sources/cdn_test.go b/sources/cdn_test.go index 7473d45..50fc12b 100644 --- a/sources/cdn_test.go +++ b/sources/cdn_test.go @@ -9,7 +9,7 @@ import ( "path/filepath" "testing" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/io" "github.com/stretchr/testify/assert" ) diff --git a/sources/github.go b/sources/github.go index 2b03e90..0ed5095 100644 --- a/sources/github.go +++ b/sources/github.go @@ -6,8 +6,8 @@ import ( "os/exec" "strings" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" ) // GitHubSource downloads images from GitHub Releases. diff --git a/sources/source.go b/sources/source.go index c03f026..1d86684 100644 --- a/sources/source.go +++ b/sources/source.go @@ -1,10 +1,10 @@ -// Package sources provides image download sources for go-container. +// Package sources provides image download sources for container. package sources import ( "context" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/io" ) // ImageSource defines the interface for downloading dev images. diff --git a/state.go b/state.go index 00139b5..cbe3ad9 100644 --- a/state.go +++ b/state.go @@ -6,7 +6,7 @@ import ( "path/filepath" "sync" - "forge.lthn.ai/core/go-io" + "dappco.re/go/core/io" ) // State manages persistent container state. diff --git a/templates.go b/templates.go index 868ba9c..4777ac2 100644 --- a/templates.go +++ b/templates.go @@ -10,8 +10,8 @@ import ( "slices" "strings" - "forge.lthn.ai/core/go-io" - coreerr "forge.lthn.ai/core/go-log" + "dappco.re/go/core/io" + coreerr "dappco.re/go/core/log" ) //go:embed templates/*.yml