No description
Find a file
Snider 5c435f4b92 wip: v0.3.3 parity — Tasks 1-7 complete, data/embed tests need fixing
WithService: full name discovery + IPC handler auto-registration via reflect
WithName: explicit service naming
RegisterService: Startable/Stoppable/HandleIPCEvents auto-discovery
MustServiceFor[T]: panics if not found
WithServiceLock: enable/apply split (v0.3.3 parity)
Cli: registered as service via CliRegister, accessed via ServiceFor

@TODO Codex: Fix data_test.go and embed_test.go — embed path resolution
after Options changed from []Option to struct. Mount paths need updating.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-24 20:15:34 +00:00
.claude chore: save LocaleProvider and Locales changes 2026-03-17 01:45:42 +00:00
.core feat: add .core/ build and release configuration 2026-03-06 17:40:40 +00:00
.githooks chore(githooks): fix pre-commit QA 2026-02-05 22:07:14 +00:00
.github/workflows fix: strip module prefix from coverage paths for Codecov 2026-03-21 09:16:24 +00:00
docs docs: rewrite documentation suite against AX spec 2026-03-21 10:05:04 +00:00
testdata feat: inline tests + Fs zero-value fix + coverage 76.9% → 82.3% 2026-03-22 13:30:01 +00:00
.editorconfig chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:52 +00:00
.gitattributes feat: git command, build improvements, and go fmt git-aware (#74) 2026-02-01 10:48:44 +00:00
.gitignore chore: ignore workspace and IDE dirs 2026-03-15 10:21:42 +00:00
.mcp.json chore: save LocaleProvider and Locales changes 2026-03-17 01:45:42 +00:00
app.go feat: App struct with New(Options) + Find() as method 2026-03-24 19:18:59 +00:00
app_test.go feat: App struct with New(Options) + Find() as method 2026-03-24 19:18:59 +00:00
array.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
array_test.go feat: inline tests + Fs zero-value fix + coverage 76.9% → 82.3% 2026-03-22 13:30:01 +00:00
CLAUDE.md docs: rewrite CLAUDE.md for current API, remove stale AGENTS.md 2026-03-21 10:07:05 +00:00
cli.go wip: checkpoint before v0.3.3 parity rewrite 2026-03-24 19:48:12 +00:00
cli_test.go fix: update Cli doc comment + tests for new Options contract 2026-03-24 19:24:17 +00:00
command.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
command_test.go feat: WithService with v0.3.3 name discovery + IPC handler auto-registration 2026-03-24 20:02:53 +00:00
config.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
config_test.go feat: restore functional option pattern for New() 2026-03-24 16:23:33 +00:00
contract.go fix: WithServiceLock enables, New() applies after all opts — v0.3.3 parity 2026-03-24 20:09:06 +00:00
contract_test.go test: lifecycle + HandleIPCEvents end-to-end via WithService 2026-03-24 20:07:45 +00:00
core.go feat: WithService with v0.3.3 name discovery + IPC handler auto-registration 2026-03-24 20:02:53 +00:00
core_test.go feat: WithService with v0.3.3 name discovery + IPC handler auto-registration 2026-03-24 20:02:53 +00:00
data.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
data_test.go wip: v0.3.3 parity — Tasks 1-7 complete, data/embed tests need fixing 2026-03-24 20:15:34 +00:00
drive.go feat: Options struct + Result methods + WithOption convenience 2026-03-24 19:17:12 +00:00
drive_test.go feat: WithService with v0.3.3 name discovery + IPC handler auto-registration 2026-03-24 20:02:53 +00:00
embed.go feat: Options struct + Result methods + WithOption convenience 2026-03-24 19:17:12 +00:00
embed_test.go feat: inline tests + Fs zero-value fix + coverage 76.9% → 82.3% 2026-03-22 13:30:01 +00:00
error.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
error_test.go feat: restore functional option pattern for New() 2026-03-24 16:23:33 +00:00
fs.go feat: Options struct + Result methods + WithOption convenience 2026-03-24 19:17:12 +00:00
fs_test.go feat: restore functional option pattern for New() 2026-03-24 16:23:33 +00:00
go.mod refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
go.sum refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
i18n.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
i18n_test.go feat: WithService with v0.3.3 name discovery + IPC handler auto-registration 2026-03-24 20:02:53 +00:00
info.go feat: add core.Path() + core.Env() fallthrough + PathGlob/PathIsAbs/CleanPath 2026-03-22 09:50:50 +00:00
info_test.go feat: restore functional option pattern for New() 2026-03-24 16:23:33 +00:00
ipc.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
ipc_test.go feat: restore functional option pattern for New() 2026-03-24 16:23:33 +00:00
LICENSE.txt Add initial project structure with core functionality and basic files 2025-10-24 04:55:10 +01:00
lock.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
lock_test.go feat: WithService with v0.3.3 name discovery + IPC handler auto-registration 2026-03-24 20:02:53 +00:00
log.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
log_test.go feat: restore functional option pattern for New() 2026-03-24 16:23:33 +00:00
options.go feat: Options struct + Result methods + WithOption convenience 2026-03-24 19:17:12 +00:00
options_test.go feat: Options struct + Result methods + WithOption convenience 2026-03-24 19:17:12 +00:00
path.go fix: address CodeRabbit review findings 2026-03-22 10:12:52 +00:00
path_test.go merge: resolve main→dev conflict in path_test.go 2026-03-23 17:58:05 +00:00
README.md docs: rewrite documentation suite against AX spec 2026-03-21 10:05:04 +00:00
runtime.go feat: Options struct + Result methods + WithOption convenience 2026-03-24 19:17:12 +00:00
runtime_test.go feat: restore functional option pattern for New() 2026-03-24 16:23:33 +00:00
service.go feat: MustServiceFor[T] + fix service names test for auto-registered cli 2026-03-24 20:10:29 +00:00
service_test.go feat: MustServiceFor[T] + fix service names test for auto-registered cli 2026-03-24 20:10:29 +00:00
string.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
string_test.go feat: inline tests + Fs zero-value fix + coverage 76.9% → 82.3% 2026-03-22 13:30:01 +00:00
task.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
task_test.go feat: restore functional option pattern for New() 2026-03-24 16:23:33 +00:00
utils.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
utils_test.go feat: inline tests + Fs zero-value fix + coverage 76.9% → 82.3% 2026-03-22 13:30:01 +00:00

CoreGO

Dependency injection, service lifecycle, command routing, and message-passing for Go.

Import path:

import "dappco.re/go/core"

CoreGO is the foundation layer for the Core ecosystem. It gives you:

  • one container: Core
  • one input shape: Options
  • one output shape: Result
  • one command tree: Command
  • one message bus: ACTION, QUERY, PERFORM

Why It Exists

Most non-trivial Go systems end up needing the same small set of infrastructure:

  • a place to keep runtime state and shared subsystems
  • a predictable way to start and stop managed components
  • a clean command surface for CLI-style workflows
  • decoupled communication between components without tight imports

CoreGO keeps those pieces small and explicit.

Quick Example

package main

import (
	"context"
	"fmt"

	"dappco.re/go/core"
)

type flushCacheTask struct {
	Name string
}

func main() {
	c := core.New(core.Options{
		{Key: "name", Value: "agent-workbench"},
	})

	c.Service("cache", core.Service{
		OnStart: func() core.Result {
			core.Info("cache started", "app", c.App().Name)
			return core.Result{OK: true}
		},
		OnStop: func() core.Result {
			core.Info("cache stopped", "app", c.App().Name)
			return core.Result{OK: true}
		},
	})

	c.RegisterTask(func(_ *core.Core, task core.Task) core.Result {
		switch t := task.(type) {
		case flushCacheTask:
			return core.Result{Value: "cache flushed for " + t.Name, OK: true}
		}
		return core.Result{}
	})

	c.Command("cache/flush", core.Command{
		Action: func(opts core.Options) core.Result {
			return c.PERFORM(flushCacheTask{
				Name: opts.String("name"),
			})
		},
	})

	if !c.ServiceStartup(context.Background(), nil).OK {
		panic("startup failed")
	}

	r := c.Cli().Run("cache", "flush", "--name=session-store")
	fmt.Println(r.Value)

	_ = c.ServiceShutdown(context.Background())
}

Core Surfaces

Surface Purpose
Core Central container and access point
Service Managed lifecycle component
Command Path-based executable operation
Cli CLI surface over the command tree
Data Embedded filesystem mounts
Drive Named transport handles
Fs Local filesystem operations
Config Runtime settings and feature flags
I18n Locale collection and translation delegation
E, Wrap, ErrorLog, ErrorPanic Structured failures and panic recovery

AX-Friendly Model

CoreGO follows the same design direction as the AX spec:

  • predictable names over compressed names
  • paths as documentation, such as deploy/to/homelab
  • one repeated vocabulary across the framework
  • examples that show how to call real APIs

Install

go get dappco.re/go/core

Requires Go 1.26 or later.

Test

core go test

Or with the standard toolchain:

go test ./...

Docs

The full documentation set lives in docs/.

Path Covers
docs/getting-started.md First runnable CoreGO app
docs/primitives.md Options, Result, Service, Message, Query, Task
docs/services.md Service registry, runtime helpers, service locks
docs/commands.md Path-based commands and CLI execution
docs/messaging.md ACTION, QUERY, QUERYALL, PERFORM, PerformAsync
docs/lifecycle.md Startup, shutdown, context, and task draining
docs/subsystems.md App, Data, Drive, Fs, I18n, Cli
docs/errors.md Structured errors, logging helpers, panic recovery
docs/testing.md Test naming and framework testing patterns

License

EUPL-1.2