CLAUDE.md was telling agents NOT to use WithService (the actual API). Tests path was wrong (tests/ vs root *_test.go). core.New() example showed deleted DTO pattern. PERFORM listed as current. Missing 6 subsystem accessors. llm.txt had pkg/core/ path (doesn't exist), PERFORM reference, missing 8 key types. Both now match v0.8.0 implementation. Co-Authored-By: Virgil <virgil@lethean.io>
46 lines
1.7 KiB
Text
46 lines
1.7 KiB
Text
# core/go — CoreGO Framework
|
|
|
|
> dappco.re/go/core — Dependency injection, service lifecycle, permission,
|
|
> and message-passing framework for Go. Foundation layer for the Lethean ecosystem.
|
|
|
|
## Entry Points
|
|
|
|
- CLAUDE.md — Agent instructions, build commands, subsystem table
|
|
- docs/RFC.md — API contract specification (21 sections, the authoritative spec)
|
|
|
|
## Package Layout
|
|
|
|
All source files at module root. No pkg/ nesting. Tests are *_test.go alongside source.
|
|
|
|
## Key Types
|
|
|
|
- Core — Central application container (core.New() returns *Core)
|
|
- Option — Single key-value pair {Key: string, Value: any}
|
|
- Options — Collection of Option with typed accessors
|
|
- Result — Universal return type {Value: any, OK: bool}
|
|
- Service — Managed component with lifecycle (Startable/Stoppable return Result)
|
|
- Action — Named callable with panic recovery and entitlement enforcement
|
|
- Task — Composed sequence of Actions (Steps, Async, Input piping)
|
|
- Registry[T] — Thread-safe named collection (universal brick)
|
|
- Process — Managed execution (sugar over Actions)
|
|
- API — Remote streams (protocol handlers, Drive integration)
|
|
- Entitlement — Permission check result (Allowed, Limit, Used, Remaining)
|
|
- Message — IPC broadcast type for ACTION
|
|
- Query — IPC request/response type for QUERY
|
|
|
|
## Service Pattern
|
|
|
|
core.New(
|
|
core.WithService(mypackage.Register),
|
|
)
|
|
|
|
func Register(c *core.Core) core.Result {
|
|
svc := &MyService{ServiceRuntime: core.NewServiceRuntime(c, opts)}
|
|
return core.Result{Value: svc, OK: true}
|
|
}
|
|
|
|
## Conventions
|
|
|
|
Follows RFC-025 Agent Experience (AX) principles.
|
|
Tests: TestFile_Function_{Good,Bad,Ugly} — 100% AX-7 naming.
|
|
See: https://core.help/specs/RFC-025-AGENT-EXPERIENCE/
|