Go 1.25+
Igor requires Go 1.25 or later. Check your version:
go versionInstall or update Go from: https://go.dev/dl/
TinyGo (for building agents)
Required for compiling agents to WASM:
# macOS
brew tap tinygo-org/tools
brew install tinygo
# Linux
wget https://github.com/tinygo-org/tinygo/releases/download/v0.40.1/tinygo_0.40.1_amd64.deb
sudo dpkg -i tinygo_0.40.1_amd64.debVerify installation:
tinygo versiongolangci-lint (code quality)
Install linter:
# macOS
brew install golangci-lint
# Linux
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \
sh -s -- -b $(go env GOPATH)/binVerify installation:
golangci-lint --versiongoimports (import formatting)
Install import formatter:
go install golang.org/x/tools/cmd/goimports@latestEnsure $(go env GOPATH)/bin is in your PATH.
After cloning the repository, install Git hooks:
./scripts/install-hooks.shThis installs pre-commit hooks that enforce code quality before each commit.
Pre-commit hooks automatically run:
- Code formatting check (
make fmt-check) - Static analysis (
make vet) - Linting (
make lint) - Tests (
make test)
If any check fails, the commit is rejected. Fix issues before committing.
To bypass hooks (not recommended):
git commit --no-verifyOnly bypass for work-in-progress commits on feature branches.
Build the node runtime:
make buildOutput: bin/igord
Build the example agent:
make agentOutput: agents/research/example/agent.wasm
Run an agent with default budget:
make run-agentOr manually:
./bin/igord --run-agent agents/research/example/agent.wasm --budget 10.0Format code:
make fmtCheck formatting without modifying:
make fmt-checkRun linters:
make lintRun go vet:
make vetRun all checks:
make checkRun tests:
make testRun tests with coverage:
go test -cover ./...Remove binaries and checkpoints:
make cleanRun make help to see all available targets:
make helpOutput:
Igor v0 Development Commands
Usage:
make <target>
Targets:
help Show this help message
build Build igord binary
clean Remove build artifacts
test Run tests
lint Run golangci-lint
vet Run go vet
fmt Format code with gofmt and goimports
fmt-check Check if code is formatted correctly
tidy Tidy go.mod and go.sum
agent Build example agent WASM
run-agent Build and run example agent locally
check Run all checks (formatting, vet, lint)
all Clean, build, test, and run all checks
Igor uses standard Go formatting:
gofmtfor code formattinggoimportsfor import organization- 80-character line length preferred (not enforced)
Run make fmt before committing.
Igor uses golangci-lint with the following enabled linters:
govet- Official Go static analysisstaticcheck- Advanced correctness checkserrcheck- Unchecked error detectionineffassign- Ineffectual assignment detectiongosimple- Code simplification suggestionsunused- Unused code detectionrevive- General code qualitygocyclo- Cyclomatic complexity (max: 20)
Run make lint to check code quality.
- Always check errors
- Use
fmt.Errorfwith%wfor error wrapping - Log errors with context
- Fail loudly on invariant violations
Use structured logging with slog:
logger.Info("Operation completed",
"agent_id", agentID,
"duration_ms", elapsed.Milliseconds(),
)- Document exported functions and types
- Explain non-obvious logic
- Avoid redundant comments
- Use godoc conventions
igor/
├── cmd/igord/ # Node runtime entry point
├── internal/ # Internal packages (not importable)
│ ├── agent/ # Agent instance management
│ ├── authority/ # Lease-based authority epochs
│ ├── config/ # Configuration
│ ├── eventlog/ # Per-tick observation event log
│ ├── hostcall/ # igor host module (clock, rand, log, wallet)
│ ├── inspector/ # Checkpoint inspector
│ ├── logging/ # Structured logging
│ ├── migration/ # Migration coordination
│ ├── p2p/ # P2P networking
│ ├── pricing/ # Price feed and node pricing
│ ├── registry/ # Agent registry
│ ├── replay/ # Deterministic replay verification
│ ├── runner/ # Tick loop runner and escalation
│ ├── runtime/ # WASM execution engine (wazero)
│ ├── settlement/ # Payment settlement
│ ├── simulator/ # Local single-process simulator
│ ├── storage/ # Checkpoint storage
│ ├── timeline/ # Timeline utilities
│ └── wasmutil/ # Shared WASM capture/resume helpers
├── pkg/ # Public packages (importable)
│ ├── budget/ # Budget types and conversions
│ ├── identity/ # Agent Ed25519 keypair management
│ ├── lineage/ # Signed checkpoint lineage
│ ├── manifest/ # Agent manifest schema
│ ├── protocol/ # P2P message types
│ └── receipt/ # Payment receipt signing
├── sdk/igor/ # Agent SDK (lifecycle, hostcall wrappers)
├── agents/
│ ├── example/ # Survivor example agent
│ └── reconciliation/ # Bridge reconciliation demo agent
├── docs/ # Documentation
└── bin/ # Compiled binaries (gitignored)
internal/ - Private implementation packages. Cannot be imported by external code.
pkg/ - Public API packages. Can be imported by agents or external tools.
cmd/ - Entry points for binaries.
Run quality checks:
make checkThis runs:
make fmt-check- Verify formattingmake vet- Run static analysismake lint- Run linters
Fix any issues before committing.
Follow conventional commits format:
<type>(<scope>): <subject>
<body>
Types:
feat- New featurefix- Bug fixdocs- Documentation onlychore- Tooling, dependenciesrefactor- Code restructuringtest- Test additions
Examples:
feat(migration): add multi-hop migration support
fix(agent): correct budget calculation rounding
docs(architecture): clarify checkpoint format
chore(deps): update libp2p to v0.48
Write tests for:
- Core logic in
internal/packages - Protocol message encoding/decoding
- Storage provider implementations
- Migration flows
Place tests alongside code:
internal/agent/
instance.go
instance_test.go
Run tests before committing:
make testIf linter fails:
- Check which linter reported the issue
- Read the error message carefully
- Fix the issue or suppress if false positive
- Re-run
make lint
Suppress false positives with //nolint comments:
//nolint:errcheck // Intentionally ignoring error
_ = stream.Close()If imports are not organizing correctly:
# Manual fix
goimports -w .If build fails after pulling changes:
make clean
make tidy
make buildIf TinyGo compilation fails:
# Check TinyGo version
tinygo version
# Clean and rebuild
cd agents/example
make clean
make buildInstall Go extension:
code --install-extension golang.go
Configure settings (.vscode/settings.json):
{
"go.lintTool": "golangci-lint",
"go.lintOnSave": "workspace",
"editor.formatOnSave": true,
"go.formatTool": "goimports"
}Use vim-go plugin with:
let g:go_fmt_command = "goimports"
let g:go_metalinter_command = "golangci-lint"- Preferences → Tools → File Watchers
- Add
goimportsfile watcher - Enable golangci-lint inspection
Profile CPU usage:
go test -cpuprofile=cpu.prof -bench=.
go tool pprof cpu.profProfile memory:
go test -memprofile=mem.prof -bench=.
go tool pprof mem.profUse delve debugger:
# Install
go install github.com/go-delve/delve/cmd/dlv@latest
# Debug igord
dlv exec ./bin/igord -- --run-agent agents/research/example/agent.wasmAdd debug output in agent code:
import "fmt"
func agent_tick() {
fmt.Printf("[debug] Counter: %d\n", state.Counter)
// ...
}Output appears in igord logs.
Igor provides scripts for repository management using GitHub CLI (gh).
Check authentication status:
make gh-check
# Or: ./scripts/verify-gh-auth.shAuthenticate if needed:
gh auth loginConfigure repository description and topics (once pushed to GitHub):
make gh-metadata
# Or: ./scripts/configure-repo-metadata.shThis sets:
- Repository description
- Topic tags (autonomous-agents, wasm-runtime, libp2p, etc.)
- Discoverability metadata
View recommended branch protection settings:
./scripts/suggest-branch-protection.shPrints suggested gh commands without applying them automatically.
Prepare a draft release:
make gh-release VERSION=v0.1.0-genesis
# Or: ./scripts/prepare-release.sh v0.1.0-genesisThis creates a draft GitHub release with:
- Release notes from template
- Marked as pre-release
- Ready for review and publication
# View repository
gh repo view
# View in browser
gh repo view --web
# List releases
gh release list
# View issues
gh issue list
# Create issue
gh issue createSee gh help for complete command reference.
Before submitting PR:
-
make checkpasses -
make testpasses - New tests added for new functionality
- Documentation updated
- Commit messages follow conventions
- No unrelated changes included
Reviews focus on:
- Correctness - Does it work as intended?
- Invariants - Are system guarantees maintained?
- Clarity - Is code understandable?
- Testing - Is it adequately tested?
Performance optimization is secondary to correctness.
- docs/philosophy/OVERVIEW.md - Project overview and design philosophy
- docs/runtime/ARCHITECTURE.md - Technical architecture
- docs/runtime/AGENT_LIFECYCLE.md - Agent development guide
- TASKS.md - Development roadmap