From 5d4af2f31109165d66def39fed8119fde351cd44 Mon Sep 17 00:00:00 2001 From: Fedor Korotkov Date: Wed, 6 May 2026 10:22:10 -0400 Subject: [PATCH] Add agent guidance and fix lint --- AGENTS.md | 30 ++++++++++++++++++++++++++ internal/tests/exec_ssh_server_test.go | 4 ---- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..1f1d8b2 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,30 @@ +# AGENTS.md + +## Project map + +- Orchard is a Go orchestration system for Tart-backed VMs. +- `internal/controller/` owns the API surface, scheduling, SSH server, and exec/session coordination. +- `internal/worker/` owns worker-side RPC handling and VM lifecycle integration. +- `pkg/client/` and `pkg/resource/v1/` are the public client/resource packages. +- `api/openapi.yaml` documents the REST API. +- `rpc/` contains protobuf definitions plus generated Go output. + +## Local workflow + +- Format Go changes with `gofmt`. +- Run targeted tests while iterating, then prefer `go test ./...` before shipping when the host environment supports it. +- Lint with the repository configuration in `.golangci.yml`, for example: + - `golangci-lint run` + - or `go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest run` +- Some integration tests require macOS VM support and may not be portable to every development host; when possible, add synthetic coverage for controller/worker behavior as well. + +## Generated code + +- If you change files under `rpc/*.proto`, run `buf generate` from the repository root and commit the regenerated outputs. +- Keep API behavior changes aligned with `api/openapi.yaml`. + +## Change guidance + +- Prefer small, behavior-focused changes that keep controller and worker protocol expectations in sync. +- When touching `/exec`, port-forwarding, or reconnectable session behavior, cover both lifecycle cleanup and concurrent access paths. +- Preserve public API compatibility unless the change explicitly calls for an API revision. diff --git a/internal/tests/exec_ssh_server_test.go b/internal/tests/exec_ssh_server_test.go index 586713b..63155f2 100644 --- a/internal/tests/exec_ssh_server_test.go +++ b/internal/tests/exec_ssh_server_test.go @@ -25,10 +25,6 @@ type execSSHServer struct { wg sync.WaitGroup } -func startExecSSHServer(t *testing.T, rejectFirstConnections int32) *execSSHServer { - return startExecSSHServerWithSessionGate(t, rejectFirstConnections, nil) -} - func startExecSSHServerWithSessionGate( t *testing.T, rejectFirstConnections int32,