Add agent guidance and fix lint

This commit is contained in:
Fedor Korotkov 2026-05-06 10:22:10 -04:00
parent 2e8a6d7a58
commit 5d4af2f311
2 changed files with 30 additions and 4 deletions

30
AGENTS.md Normal file
View File

@ -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.

View File

@ -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,