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
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

## Checklist

- [ ] I have run `make check`
- [ ] I have run `task check`
- [ ] I have run `task examples:all`
- [ ] I have run `make tidy` if I added or removed dependencies
- [ ] I have run `task tidy` if I added or removed dependencies
- [ ] Commit messages follow [conventional commits](https://www.conventionalcommits.org) (e.g. `feat:`, `fix:`, `docs:`)
- [ ] I have added/updated tests for my changes
- [ ] Documentation is updated if needed
42 changes: 36 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# - PR to main: full checks + Codecov upload
# - workflow_dispatch: same + Codecov upload (on-demand coverage report)
# - Push / merge to main: no workflow (already validated on the PR)
# (Secret scanning: run `make secrets-scan` locally.)
# (Secret scanning: run `task secrets-scan` locally.)
name: CI

on:
Expand All @@ -11,7 +11,7 @@ on:
workflow_dispatch:

jobs:
ci:
sdk:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -21,19 +21,23 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum

# v2 is built with Go >= 1.26; v1.x binaries refuse modules targeting go 1.26+
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest

- name: Install Task
run: go install github.com/go-task/task/v3/cmd/task@latest

- name: Lint
run: make lint
run: task lint

- name: Test
run: make test
run: task test

- name: Code coverage
run: make test-coverage
run: task test-coverage

- name: Upload coverage to Codecov
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
Expand All @@ -44,7 +48,31 @@ jobs:
files: ./coverage.out

- name: Build
run: make build
run: task build

# agctl CLI is its own module (cmd/go.mod). Runs the same lint/test/build gates
# that used to be covered when cmd was part of the SDK module.
agctl:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: cmd/go.mod
cache-dependency-path: cmd/go.sum

- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest

- name: Install Task
run: go install github.com/go-task/task/v3/cmd/task@latest

- name: Check (lint + test + build)
working-directory: cmd
run: task check

eval-harness:
runs-on: ubuntu-latest
Expand All @@ -56,6 +84,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -90,6 +119,7 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Install Task
run: go install github.com/go-task/task/v3/cmd/task@latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Release: GoReleaser builds agentctl for multiple platforms, creates GitHub Release
# Release: GoReleaser builds agctl for multiple platforms, creates GitHub Release
# Trigger: push a tag (v0.0.1, v1.0.0, etc.)
# See RELEASING.md for maintainer checklist
name: Release
Expand Down
19 changes: 11 additions & 8 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# GoReleaser config — builds agentctl for multiple platforms, creates GitHub Release
# GoReleaser config — builds agctl for multiple platforms, creates GitHub Release
# See https://goreleaser.com/customization/

version: 2

project_name: agent-sdk-go

builds:
- id: agentctl
main: ./cmd
binary: agentctl
# agctl is a separate Go module in ./cmd (its go.mod replaces the SDK with ../),
# so the build runs inside that directory.
- id: agctl
dir: ./cmd
main: .
binary: agctl
ldflags:
- -s -w
- -X=main.version={{.Tag}}
Expand All @@ -23,11 +26,11 @@ builds:
- CGO_ENABLED=0

archives:
- id: agentctl
format: tar.gz
- id: agctl
formats: [tar.gz]
format_overrides:
- goos: windows
format: zip
formats: [zip]

checksum:
name_template: "checksums.txt"
Expand All @@ -42,7 +45,7 @@ release:
go get github.com/agenticenv/agent-sdk-go@{{ .Tag }}
```

### Install agentctl (CLI)
### Install agctl (CLI)

Download the archive for your platform from the **Assets** below (Linux, macOS, Windows — amd64 and arm64). Then extract and add to your `PATH`.

Expand Down
31 changes: 16 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ Before contributing, ensure you have:
| Requirement | Version / Notes |
|-------------|-----------------|
| **Go** | **Minimum `go 1.26.0`** (see the `go` line in `go.mod`; use that version or newer). |
| **Task** | Task runner for all dev commands (`task build`, `task check`, `task lint`, ...). Install: `go install github.com/go-task/task/v3/cmd/task@latest` or see [taskfile.dev/installation](https://taskfile.dev/installation/) |
| **Temporal server** | Required only for Temporal runtime examples, CLI, and Temporal-specific tests — see [Temporal setup](temporal-setup.md). Unit tests and in-process runtime examples run without it. |
| **golangci-lint** | Required for `make lint` — install **v2** with Go **≥** the `go` line in `go.mod`: `go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest` |
| **gofmt** | `make lint` runs `gofmt -s` check first; run `make fmt` to apply `gofmt -s -w` project-wide |
| **misspell** | `make spell` or `make lint` — typos via `misspell` |
| **golangci-lint** | Required for `task lint` — install **v2** with Go **≥** the `go` line in `go.mod`: `go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest` |
| **gofmt** | `task lint` runs `gofmt -s` check first; run `task fmt` to apply `gofmt -s -w` project-wide |
| **misspell** | `task spell` or `task lint` — typos via `misspell` |

## Temporal setup

Expand Down Expand Up @@ -59,10 +60,10 @@ Keep your branch short and descriptive. Sync with `main` before opening a PR: `g
### 3. Run checks before a PR

```bash
make check
task check
```

Runs `fmt-check`, spell check, `make lint`, `make test`, `make build`, and `make secrets-scan` — same core gates as the main CI job (coverage is CI-only; use `make test-coverage` locally if you want a report). `make test` includes eval-harness Go tests; the full Promptfoo/DeepEval suite runs in CI and via `make eval-harness` (see below).
Runs `fmt-check`, spell check, `task lint`, `task test`, `task build`, and `task secrets-scan` — same core gates as the main CI job (coverage is CI-only; use `task test-coverage` locally if you want a report). `task test` includes eval-harness Go tests; the full Promptfoo/DeepEval suite runs in CI and via `task eval-harness` (see below).

Also run the full example suite on any code change to catch regressions unit tests may miss:

Expand All @@ -75,17 +76,17 @@ Requires Task, Docker, and LLM credentials — see [examples/README.md](examples
If you change **agent behavior** (e.g. `pkg/agent`, `pkg/memory`, telemetry, tools, runtime) or **`eval-harness/`**, run:

```bash
make eval-harness
task eval-harness
```

Behavioral regression tests use mock LLM/tools and assert on run output — SDK changes can break them even when eval-harness files are untouched. Requires Node.js and Python 3.10+ — see [eval-harness/README.md](eval-harness/README.md). CI runs this automatically on PRs (`eval-harness` job).

**CI runs automatically** on pull requests to `main` (open a PR or push updates to an existing PR to re-run checks). Pushes or merges to `main` do not trigger CI; use **workflow_dispatch** in GitHub Actions for an on-demand run. Run `make check` locally before opening a PR; CI must pass on the PR before merge.
**CI runs automatically** on pull requests to `main` (open a PR or push updates to an existing PR to re-run checks). Pushes or merges to `main` do not trigger CI; use **workflow_dispatch** in GitHub Actions for an on-demand run. Run `task check` locally before opening a PR; CI must pass on the PR before merge.

To run only tests (e.g. while iterating):

```bash
make test
task test
```

Or a specific package:
Expand All @@ -94,20 +95,20 @@ Or a specific package:
go test ./pkg/agent/... -count=1 -v
```

### 4. Run linters (included in `make check`)
### 4. Run linters (included in `task check`)

```bash
make lint
task lint
```

This runs `gofmt -s` check, `misspell`, `go vet`, and `golangci-lint`. Use when debugging a lint failure without re-running the full `make check`.
This runs `gofmt -s` check, `misspell`, `go vet`, and `golangci-lint`. Use when debugging a lint failure without re-running the full `task check`.

**golangci-lint vs Go version:** If you see `the Go language version used to build golangci-lint is lower than the targeted Go version`, your `golangci-lint` binary is too old for this module (Go 1.26+ requires **golangci-lint v2**). Reinstall: `go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest`, ensure `$(go env GOPATH)/bin` is on `PATH` ahead of any older install, then run `golangci-lint version` — it should report **v2.x** and a Go build **≥ 1.26**.

### 5. Generate coverage

```bash
make test-coverage
task test-coverage
# Open coverage.html in a browser
```

Expand Down Expand Up @@ -172,15 +173,15 @@ Using the SDK and ran into issues, unclear docs, or confusing behavior? **Raise
## What Contributors Must Follow

1. **Code quality**
- Run `make check` before submitting a PR (format, spell, lint, test, build, secrets scan). PRs must pass.
- Run `task check` before submitting a PR (format, spell, lint, test, build, secrets scan). PRs must pass.
- Run `task examples:all` before submitting a PR to verify nothing in the example suite breaks (any code change — not only example edits). Requires Task, Docker, and LLM credentials — see [examples/README.md](examples/README.md).
- New examples that support batch runs must be added to **`taskfiles/examples.yml`** (see §6).
- Run `make tidy` before committing if you add or remove dependencies.
- Run `task tidy` before committing if you add or remove dependencies.

2. **Tests**
- Add tests for new features and bug fixes.
- Unit tests go in `*_test.go` files alongside the code.
- Agent behavior changes (`pkg/agent`, `pkg/memory`, telemetry, tools, runtime) or **`eval-harness/`** edits — run `make eval-harness` before submitting a PR.
- Agent behavior changes (`pkg/agent`, `pkg/memory`, telemetry, tools, runtime) or **`eval-harness/`** edits — run `task eval-harness` before submitting a PR.

3. **Commits**
- Use [conventional commits](https://www.conventionalcommits.org) — these drive the release changelog:
Expand Down
119 changes: 0 additions & 119 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ Evaluate agent quality with Promptfoo and DeepEval — locally or in CI. See [ev
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup, workflow, and guidelines.
Project policies: [SECURITY.md](SECURITY.md) · [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)

Quick commands: `make check` | `make test` | `make lint` | `make fmt` | `make tidy` | `make test-coverage`
Quick commands (requires [Task](https://taskfile.dev)): `task check` | `task test` | `task lint` | `task fmt` | `task tidy` | `task test-coverage`

Coverage reports (PR and default branch) are on **[Codecov](https://app.codecov.io/gh/agenticenv/agent-sdk-go)**. Run `make test-coverage` locally to produce `coverage.out` and `coverage.html`.
Coverage reports (PR and default branch) are on **[Codecov](https://app.codecov.io/gh/agenticenv/agent-sdk-go)**. Run `task test-coverage` locally to produce `coverage.out` and `coverage.html`.

## License

Expand Down
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Only users with **push access** to the repository can create tags and trigger re

1. **You create and push a tag** (e.g. `v0.0.1`, `v1.0.0`, `v2.0.3`)
2. **GitHub Actions runs** the Release workflow via [GoReleaser](https://goreleaser.com)
3. **Builds** `agentctl` for Linux, macOS, and Windows (amd64 and arm64 where supported), embedding **`agentctl -version`** as the git tag (`ldflags -X main.version={{.Tag}}` in `.goreleaser.yaml`)
3. **Builds** `agctl` (its own module in `cmd/`) for Linux, macOS, and Windows (amd64 and arm64 where supported), embedding **`agctl -version`** as the git tag (`ldflags -X main.version={{.Tag}}` in `.goreleaser.yaml`)
4. **Creates a GitHub Release** with archives (tar.gz / zip) and a checksums file

## Checklist before tagging

- [ ] CI is green on `main` (lint, test, build pass — see [Actions](https://github.com/agenticenv/agent-sdk-go/actions))
- [ ] `make lint` and `make test` pass locally (or rely on CI)
- [ ] `task lint` and `task test` pass locally (or rely on CI)
- [ ] Commit messages follow [conventional commits](https://www.conventionalcommits.org) for categorized changelog (feat:, fix:, docs:, etc.)
- [ ] Version follows [semver](https://semver.org):
- **Patch** (0.0.1 → 0.0.2): bug fixes, no API changes
Expand Down
Loading
Loading