gapi

module
v0.1.0-proto2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2026 License: MPL-2.0

README ΒΆ

GAPI (GoPPydae Agent Programming Interface) - Agent Runtime Library

GAPI is the core runtime library and SDK for the GoPPydae ecosystem. It provides the low-level mechanism for spawning, supervising, and securing agents on a single machine. It is designed to be embedded into larger orchestrators (like Goblin).

Note: This repository contains the GAPI library. For the production daemon, see Goblin.

✨ Key Features

  • πŸ”’ Security: Ed25519 signing + BLAKE3 hashing + source-to-binary verification
  • ⏰ Timer Agents: Systemd-style scheduling, cron expressions, named schedules
  • πŸ“Š Resource Limits: CPU and memory constraints via cgroups v2 (rootless supported)
  • πŸ”Œ Socket Activation: On-demand agent startup for TCP/UDP services
  • 🐍 Dual ADK: Write agents in Python or Go with identical behavior
  • πŸ› οΈ Developer Tools: Agent templates, watch mode, verification chain
  • πŸ”„ CI/CD Ready: Automated cross-ADK testing in GitHub Actions

πŸš€ Quick Start

# Install Reference Tools
nix develop -c mage build

# Create agent
gapictl agent new my_service

# Run with Reference Daemon (gapid)
# (Useful for local dev/testing without a cluster)
./bin/gapid

πŸ“ Simple Example

# agents/python/services/hello.py.service
ID = "hello"
TYPE = "service"

def start():
    print("Hello from GAPI!")
    while True:
        time.sleep(60)

That's it! No classes, no inheritance, no boilerplate.

πŸ“š Documentation

πŸ› οΈ Development

# Run tests
nix develop -c mage test

# Run cross-ADK tests
nix develop -c go test ./test/adk/

See agents/README.md for agent development guide.

πŸ“„ License

Mozilla Public License 2.0 (MPL-2.0)

Directories ΒΆ

Path Synopsis
adk
go
cmd
gapictl command
gapid command
core
adk
logging
Package logging is the one place log handlers are built.
Package logging is the one place log handlers are built.
mounts
Package mounts bootstraps the virtual filesystem hierarchy during Phase 0 of a PID-1 boot (GAPI-DIV-027), before cgroups or the event bus exist.
Package mounts bootstraps the virtual filesystem hierarchy during Phase 0 of a PID-1 boot (GAPI-DIV-027), before cgroups or the event bus exist.
pid1
Package pid1 installs the explicit PID-1 signal semantics (GAPI-DIV-027).
Package pid1 installs the explicit PID-1 signal semantics (GAPI-DIV-027).
procsig
Package procsig delivers signals to agent processes guarded by their start epoch (DDR-5, GAPI-DIV-016): a signal aimed at a dead process whose PID was recycled must never hit the new occupant.
Package procsig delivers signals to agent processes guarded by their start epoch (DDR-5, GAPI-DIV-016): a signal aimed at a dead process whose PID was recycled must never hit the new occupant.
shutdown
Package shutdown is the PID-1 teardown executor (GAPI-DIV-027): a correct init shutdown is StopAll -> sync -> reverse umount -> reboot(2), replacing the naive grace + SIGKILL pattern.
Package shutdown is the PID-1 teardown executor (GAPI-DIV-027): a correct init shutdown is StopAll -> sync -> reverse umount -> reboot(2), replacing the naive grace + SIGKILL pattern.
subreaper
Package subreaper implements the PID-1 orphan-reaping obligation (GAPI-DIV-027): the supervisor registers as a child subreaper so orphaned descendants reparent to it instead of pid 1, and a reap loop collects their exit statuses - zombie accumulation is a kernel obligation, not an optimization.
Package subreaper implements the PID-1 orphan-reaping obligation (GAPI-DIV-027): the supervisor registers as a child subreaper so orphaned descendants reparent to it instead of pid 1, and a reap loop collects their exit statuses - zombie accumulation is a kernel obligation, not an optimization.
tui
watchdog
Package watchdog keeps a hardware (or software) watchdog timer fed (GAPI-DIV-027): if the supervisor hangs, the kicks stop and the device resets the machine.
Package watchdog keeps a hardware (or software) watchdog timer fed (GAPI-DIV-027): if the supervisor hangs, the kicks stop and the device resets the machine.
examples
standalone command
internal
db
ident
Package ident mints the UUIDv7 identifiers used for kernel events, lifecycle runs, and capability tokens (operator decision 2026-07-28: all ids are UUIDv7 where reasonable).
Package ident mints the UUIDv7 identifiers used for kernel events, lifecycle runs, and capability tokens (operator decision 2026-07-28: all ids are UUIDv7 where reasonable).
logattr
Package logattr holds gapi's typed log attribute constructors: each pins one key to one value type, so a dropped value, swapped pair, or wrong type is a compile error instead of a quietly wrong JSON field (go-manifesto section 8).
Package logattr holds gapi's typed log attribute constructors: each pins one key to one value type, so a dropped value, swapped pair, or wrong type is a compile error instead of a quietly wrong JSON field (go-manifesto section 8).
safeio
Package safeio centralizes every variable-path file open in gapi.
Package safeio centralizes every variable-path file open in gapi.
toposort
Package toposort is the one dependency-ordering implementation shared by the agent registry and the agent manager (review R5: centralize; R14: soft-dependency semantics).
Package toposort is the one dependency-ordering implementation shared by the agent registry and the agent manager (review R5: centralize; R14: soft-dependency semantics).
pkg
cli
test
adk
adk/fixtures/go command
adk/fixtures/go/capabilities_agent command
Capabilities agent with capability detection
Capabilities agent with capability detection
adk/fixtures/go/hash_agent command
Hash agent for testing schema hashing
Hash agent for testing schema hashing
adk/fixtures/go/lifecycle_agent command
Lifecycle agent demonstrating full lifecycle support
Lifecycle agent demonstrating full lifecycle support
adk/fixtures/go/simple_service command
Simple service agent for cross-ADK testing
Simple service agent for cross-ADK testing
pid1/fixtures/orphanmaker command
Orphanmaker is the PID-1 e2e fixture agent: on start it double-forks so a grandchild is orphaned onto the container's init (gapid), which must reap it - the kernel obligation the harness asserts.
Orphanmaker is the PID-1 e2e fixture agent: on start it double-forks so a grandchild is orphaned onto the container's init (gapid), which must reap it - the kernel obligation the harness asserts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL