Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

env:
GO_VERSION: '1.25'
GO_VERSION: '1.27.4'

jobs:
test:
Expand Down Expand Up @@ -86,6 +86,10 @@ jobs:
REDIS_HOST: localhost
REDIS_PORT: 6379

- name: Test independent Go agent modules
# Nested modules are excluded from the root go test ./... invocation.
run: make test-agent-packages

- name: Enforce source coverage floor
run: |
coverage=$(go tool cover -func=coverage.out | awk '/^total:/ {gsub(/%/, "", $3); print $3}')
Expand All @@ -103,6 +107,7 @@ jobs:
"./pkg/core FuzzDeepCopy" \
"./pkg/core FuzzGraphRouting" \
"./pkg/core FuzzGraphConstruction" \
"./pkg/agentspec FuzzManifest" \
"./pkg/tools FuzzToolArguments" \
"./pkg/tools FuzzPathResolution" \
"./pkg/tools FuzzCommandPolicy" \
Expand Down Expand Up @@ -156,7 +161,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.13.1
version: v2.15.0
args: --timeout=10m

security:
Expand All @@ -179,8 +184,11 @@ jobs:
cache: false

- name: Run Gosec Security Scanner
# Permit pinned scanners to select their required build toolchain.
env:
GOTOOLCHAIN: auto
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install github.com/securego/gosec/v2/cmd/gosec@v2.30.0
# Gosec reports findings with exit 1, which is indistinguishable from
# an analyzer-only error on some runner/toolchain combinations. Always
# emit SARIF, then make the actual release decision from its findings.
Expand Down Expand Up @@ -308,6 +316,9 @@ jobs:
runs-on: ubuntu-latest
needs: [test, lint, build]
timeout-minutes: 15
env:
# Bake requires Dockerfiles to remain inside the authorized build context.
DEPLOY_DIR: ${{ github.workspace }}/.ci-docker-deploy

steps:
- name: Checkout code
Expand Down Expand Up @@ -379,8 +390,8 @@ jobs:
run: |
set -euo pipefail
go run ./cmd/golanggraph multi-agent generate docker "$RUNNER_TEMP/multi-agent.yaml" \
--output "$RUNNER_TEMP/deploy"
docker compose -f "$RUNNER_TEMP/deploy/docker-compose.yml" -p golanggraph-ci \
--output "$DEPLOY_DIR"
docker compose -f "$DEPLOY_DIR/docker-compose.yml" -p golanggraph-ci \
up --detach --build

- name: Verify live health and agent endpoints
Expand All @@ -401,12 +412,12 @@ jobs:

- name: Print container logs on failure
if: failure()
run: docker compose -f "$RUNNER_TEMP/deploy/docker-compose.yml" -p golanggraph-ci logs
run: docker compose -f "$DEPLOY_DIR/docker-compose.yml" -p golanggraph-ci logs

- name: Remove disposable Compose deployment and image
if: always()
run: |
docker compose -f "$RUNNER_TEMP/deploy/docker-compose.yml" -p golanggraph-ci down --volumes --rmi local || true
docker compose -f "$DEPLOY_DIR/docker-compose.yml" -p golanggraph-ci down --volumes --rmi local || true

kubernetes-e2e:
name: Kubernetes End-to-End
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:
cancel-in-progress: true

env:
GO_VERSION: '1.25'
GO_VERSION: '1.27.4'

jobs:
build:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true

env:
GO_VERSION: '1.25'
GO_VERSION: '1.27.4'

jobs:
pre-commit:
Expand Down Expand Up @@ -113,8 +113,10 @@ jobs:
go mod tidy

- name: Run Gosec Security Scanner
env:
GOTOOLCHAIN: auto
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install github.com/securego/gosec/v2/cmd/gosec@v2.30.0
# Enforce the scanner's SARIF findings explicitly. This preserves a
# strict gate even when GoSec exits non-zero after a successful scan.
gosec -no-fail -concurrency=1 -exclude=G301,G306,G304,G204,G104,G302 -exclude-dir=examples -exclude-dir=cmd/examples -fmt sarif -out gosec-results.sarif ./...
Expand Down Expand Up @@ -193,8 +195,10 @@ jobs:
go mod tidy

- name: Check for vulnerabilities
env:
GOTOOLCHAIN: auto
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
go install golang.org/x/vuln/cmd/govulncheck@v1.9.0
govulncheck ./...

- name: Check for outdated dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ concurrency:
cancel-in-progress: true

env:
GO_VERSION: '1.25'
GO_VERSION: '1.27.4'
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

Expand Down Expand Up @@ -68,12 +68,12 @@ jobs:
- name: Run linting
uses: golangci/golangci-lint-action@v9
with:
version: v2.13.1
version: v2.15.0
args: --timeout=5m

- name: Run security scan
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
go install github.com/securego/gosec/v2/cmd/gosec@v2.30.0
# Enforce the scanner's SARIF findings explicitly. This preserves a
# strict gate even when GoSec exits non-zero after a successful scan.
gosec -no-fail -concurrency=1 -exclude=G301,G306,G304,G204,G104,G302 -exclude-dir=examples -exclude-dir=cmd/examples -fmt sarif -out results.sarif ./...
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ repos:
- id: gosec-check
name: Gosec Security Check
description: Run gosec security scanner
entry: bash -c 'export PATH=$PATH:$(go env GOPATH)/bin; which gosec > /dev/null || go install github.com/securego/gosec/v2/cmd/gosec@latest; gosec -concurrency=1 -exclude=G301,G306,G304,G204,G104,G302 -exclude-dir=examples -exclude-dir=cmd/examples ./...'
entry: go run github.com/securego/gosec/v2/cmd/gosec@v2.30.0 -concurrency=1 -exclude=G301,G306,G304,G204,G104,G302 -exclude-dir=examples -exclude-dir=cmd/examples ./...
language: system
files: \.go$
pass_filenames: false

- id: golangci-lint-local
name: golangci-lint (Local)
description: Run golangci-lint with proper PATH
entry: bash -c 'export PATH=$PATH:$(go env GOPATH)/bin; which golangci-lint > /dev/null || go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.1; golangci-lint run --timeout=5m ./pkg/...'
description: Run the pinned golangci-lint release
entry: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0 run --timeout=5m ./pkg/...
language: system
files: \.go$
pass_filenames: false
Expand Down
6 changes: 3 additions & 3 deletions .secrets.baseline

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.25.13-alpine AS builder
FROM golang:1.27.4-alpine AS builder

# Set working directory
WORKDIR /app
Expand Down
27 changes: 13 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ test-examples: ## Test all examples
@echo "$(BLUE)Testing examples...$(NC)"
go test -v $(EXAMPLES_PATH)

.PHONY: test-agent-packages
test-agent-packages: ## Test the Go agent contract, runtime and independent modules
GOWORK=off go test -race -timeout $(TEST_TIMEOUT) ./pkg/agentspec/... ./pkg/agentruntime/...
@for module in agents/designer agents/storymaker agents/habitat examples/11-agent-packages; do \
(cd "$$module" && GOWORK=off go test -race -timeout $(TEST_TIMEOUT) ./...) || exit $$?; \
done

.PHONY: demo-agent-packages
demo-agent-packages: ## Compose the packaged designer and storyteller without a model server
cd examples/11-agent-packages && GOWORK=off go run .

.PHONY: test-cli
test-cli: ## Test CLI functionality
@echo "$(BLUE)Testing CLI functionality...$(NC)"
Expand Down Expand Up @@ -190,13 +201,7 @@ docker-logs: ## Show Docker container logs
.PHONY: lint
lint: ## Run linter
@echo "$(BLUE)Running linter...$(NC)"
@if command -v golangci-lint &> /dev/null; then \
golangci-lint run; \
else \
echo "$(YELLOW)golangci-lint not found. Installing...$(NC)"; \
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest; \
golangci-lint run; \
fi
go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.15.0 run

.PHONY: fmt
fmt: ## Format code
Expand All @@ -217,13 +222,7 @@ mod-tidy: ## Tidy go modules
.PHONY: security
security: ## Run security scan
@echo "$(BLUE)Running security scan...$(NC)"
@if command -v gosec &> /dev/null; then \
gosec $(PKG_PATH); \
else \
echo "$(YELLOW)gosec not found. Installing...$(NC)"; \
go install github.com/securego/gosec/v2/cmd/gosec@latest; \
gosec $(PKG_PATH); \
fi
go run github.com/securego/gosec/v2/cmd/gosec@v2.30.0 $(PKG_PATH)

##@ Pre-commit

Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,23 @@ don't hesitate to contribute !
go get github.com/UnicoLab/GoLangGraph
```

### Experimental Go-native agent packages

Build reusable agents as ordinary Go modules containing typed contracts, embedded
prompts, tools, Go handlers and declared child agents. The GoLangGraph adapter
supplies persistent isolated threads, dependency validation, request deduplication
and execution traces. A CLI scaffolds modules and inspects their manifests.

```bash
make demo-agent-packages # Reusable habitat → designer + storyteller composition
make test-agent-packages # Contract, runtime and all independent modules
```

See the [agent package guide](docs/AGENT_PACKAGES.md) and
[consumer example](examples/11-agent-packages/README.md) for authoring,
distribution, live-model use and current limits. The packages are a local
experimental implementation; module releases have not been published.

## 🏃 Quick Start

### Prerequisites
Expand Down
21 changes: 21 additions & 0 deletions agents/designer/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 GoLangGraph Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
20 changes: 20 additions & 0 deletions agents/designer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Designer agent package

A Go-native adaptation of the ideation example's habitat designer. Import this
module and register the result of `designer.Package()` with the host runtime.
Its entry point is `designer.AgentID`; the public types are `designer.Input` and
`designer.Output`.

The package carries an embedded prompt, a default model profile, generated
schemas and the `material_palette` tool. The host supplies model connections and
thread storage. The package does not import the graph engine or the storyteller.

```sh
go test -race ./...
```

The default model profile is configurable by the host. Live-model capabilities
are not certified by the offline tests. See the
[consumer example](../../examples/11-agent-packages/README.md) and
[distribution guide](../../docs/AGENT_PACKAGES.md). Local replaces must be replaced
with a released SDK dependency before this module is published.
Loading
Loading