No description
Find a file
Snider ec423cfe46 feat: implement Section 21 — Entitlement permission primitive
c.Entitled("action", quantity) checks permission before execution.
Default: everything permitted (trusted conclave).
Consumer packages replace checker via c.SetEntitlementChecker().

- Entitlement struct: Allowed, Unlimited, Limit, Used, Remaining, Reason
- NearLimit(threshold), UsagePercent() convenience methods
- EntitlementChecker function type — registered by go-entitlements/commerce-matrix
- UsageRecorder for consumption tracking after gated actions succeed
- Enforcement wired into Action.Run() — one gate for all capabilities
- Security audit logging on denials (P11-6)
- 16 AX-7 tests including full SaaS gating pattern simulation

Maps 1:1 to RFC-004 EntitlementResult and RFC-005 PermissionResult.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 16:17:16 +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 fix(rfc): remove all v0.9.0 deferrals — everything is v0.8.0 2026-03-25 16:10:42 +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
action.go feat: implement Section 21 — Entitlement permission primitive 2026-03-25 16:17:16 +00:00
action_test.go fix: remove type Task any — untyped IPC replaced by named Actions 2026-03-25 15:57:36 +00:00
app.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
app_test.go feat: New() returns *Core directly — no Result wrapper needed 2026-03-24 22:09:02 +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 feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
cli_test.go feat: New() returns *Core directly — no Result wrapper needed 2026-03-24 22:09:02 +00:00
command.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
command_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
config.go feat: New() constructors for Config, Fs + simplify contract.go init 2026-03-24 22:09:02 +00:00
config_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
contract.go feat: implement Section 21 — Entitlement permission primitive 2026-03-25 16:17:16 +00:00
contract_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
core.go feat: implement Section 21 — Entitlement permission primitive 2026-03-25 16:17:16 +00:00
core_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
data.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
data_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
drive.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
drive_test.go feat: New() returns *Core directly — no Result wrapper needed 2026-03-24 22:09:02 +00:00
embed.go feat: Options struct + Result methods + WithOption convenience 2026-03-24 22:09:02 +00:00
embed_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
entitlement.go feat: implement Section 21 — Entitlement permission primitive 2026-03-25 16:17:16 +00:00
entitlement_test.go feat: implement Section 21 — Entitlement permission primitive 2026-03-25 16:17:16 +00:00
error.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
error_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
fs.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
fs_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +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: New() returns *Core directly — no Result wrapper needed 2026-03-24 22:09:02 +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: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
ipc.go fix: remove type Task any — untyped IPC replaced by named Actions 2026-03-25 15:57:36 +00:00
ipc_test.go fix: remove type Task any — untyped IPC replaced by named Actions 2026-03-25 15:57:36 +00:00
LICENSE.txt Add initial project structure with core functionality and basic files 2025-10-24 04:55:10 +01:00
llm.txt feat: add llm.txt — agent entry point for CoreGO framework 2026-03-25 10:52:55 +00:00
lock.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
lock_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
log.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
log_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
options.go fix: Result.New handles (value, error) pairs correctly + embed test fixes 2026-03-24 22:09:02 +00:00
options_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
path.go fix: address CodeRabbit review findings 2026-03-22 10:12:52 +00:00
path_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
process.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
process_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
README.md docs: rewrite documentation suite against AX spec 2026-03-21 10:05:04 +00:00
registry.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
registry_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
runtime.go feat: New() returns *Core directly — no Result wrapper needed 2026-03-24 22:09:02 +00:00
runtime_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
service.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
service_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
string.go refactor: flatten polyglot layout to standard Go module 2026-03-21 08:27:14 +00:00
string_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
task.go fix: remove type Task any — untyped IPC replaced by named Actions 2026-03-25 15:57:36 +00:00
task_test.go fix: remove type Task any — untyped IPC replaced by named Actions 2026-03-25 15:57:36 +00:00
utils.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +00:00
utils_test.go feat: implement RFC plans 1-5 — Registry[T], Action/Task, Process, primitives 2026-03-25 15:18:25 +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