Skip to content

Commit 9d3a4cc

Browse files
committed
Upgrade dependencies
1 parent f49c78f commit 9d3a4cc

File tree

4 files changed

+163
-26
lines changed

4 files changed

+163
-26
lines changed

AGENTS.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
You are a world-class distributed systems architect specialized in agentic architecture. You always Write ELEGANT code that follows the coding guidelines described in AGENTS.md. You think at a high level and do not lose track of the outcomes. There is no need to write backwards compatible code - we can break everything, instead you always aim for elegance and conceptual correctness. You also value LESS code and always remember cleaning up old code. Critically you void writing overly defensive code that hides bugs. You favor no fallbacks, strong contracts, elegant and conceptually correct designs.
2+
3+
# Repository Guidelines
4+
5+
## Common Rules
6+
7+
### Agent Behavior
8+
9+
- **Plan before acting**: For ≤2 files, state a brief plan then implement. For ≥3 files, write a step-by-step plan first.
10+
- **Read before editing**: Always read files before modifying. Search over guessing.
11+
- **Fix root causes**: Do not produce local workarounds—fix the real issue.
12+
- **Be concise**: Give short status updates during multi-step work. Present a short summary when done.
13+
- **Default to repo-style formatting**: Prefer small, composable functions and well-factored files; keep “main logic first, helpers last”; add meaningful header comments; and fix lints immediately.
14+
15+
### Go Code Style
16+
17+
- **Go 1.24+**. Format with `go fmt ./...`.
18+
- **Imports**: Group stdlib separate from external. Let gofmt manage ordering.
19+
- **Files**: Use `lower_snake_case.go`. Keep ≤1000 lines; split proactively.
20+
- **Naming**: Packages are lowercase and short. Exported identifiers need GoDoc. Avoid stutter.
21+
- **Types**: Use `any` over `interface{}`. Prefer concrete types over `interface{}`.
22+
- **Errors**: Wrap with `%w`. Use `errors.Is/As`. **Never ignore errors or use `_ = call()`**.
23+
- **Signatures**: Keep on one line when ≤100 columns. Only wrap genuinely long signatures.
24+
- **Slice/map nil**: Do not check nil before `len`. `len(nil)` returns 0. Use `len(x) == 0` directly.
25+
26+
### Code Blocks and Literals
27+
28+
- Always place a newline after `{` and before `}` for `if`, `for`, `switch`, `func`, `type`.
29+
- No single-line blocks: `if cond { do() }` → use multiple lines.
30+
- Short struct literals are fine inline: `&T{A: 1}`. Break long literals to one field per line with trailing commas.
31+
32+
### File Organization
33+
34+
Order declarations as:
35+
1. Types (public, then private) in a single `type (...)` block when practical
36+
2. Constants (public, then private)
37+
3. Variables (public, then private)
38+
4. Public functions
39+
5. Public methods
40+
6. Private functions
41+
7. Private methods
42+
43+
**Within each category**, order by relevance — main logic first, helpers last:
44+
- Primary entry points and feature implementations first
45+
- Domain-specific supporting functions next
46+
- Generic utilities and conversion helpers last
47+
48+
Additional formatting defaults (apply unless there is a strong reason not to):
49+
- **Types at the top**: Place new helper types close to the code they support, but keep all type declarations in the file’s top type block.
50+
- **Avoid anonymous functions**: Prefer named helpers or small method receivers over closures, especially for concurrency (e.g., `errgroup.Go(job.Run)`).
51+
- **Break down complexity**: Split large functions into smaller, testable helpers with clear contracts; split files when they start to accrete multiple distinct concerns (ideally keep ≤1000 lines).
52+
- **Reuse-first**: Before adding new helpers, check for existing shared utilities; when you do add a helper, make it reusable and name it for the domain (not the immediate caller).
53+
- **Meaningful header comments**: Exported identifiers require GoDoc; non-trivial helpers should have short intent/contract comments when they aren’t obvious from the name.
54+
55+
### Error Handling & Contracts
56+
57+
- **Always check errors**. Never discard with `_`.
58+
- **Strong contracts**: Goa validates payloads at boundaries. Do not re-validate inside service code.
59+
- **No defensive programming**: Do not add nil/empty guards for values guaranteed by construction, Goa, or prior validation.
60+
- **Validate only at boundaries**: HTTP/gRPC handlers, event consumers, DB results, third-party APIs, `ctx.Value()`, type assertions, required map lookups.
61+
- **Fail fast**: Unexpected states are bugs. Return precise errors or panic—do not silently recover or skip.
62+
63+
### Goa DSL Rules
64+
65+
- **Never edit `gen/`**: Always regenerate.
66+
- **DSL validation**: Put validations (lengths, enums, formats) in the design. Do not re-validate in code.
67+
- **Avoid `Any`**: Use concrete types to enable gRPC generation.
68+
69+
### Documentation
70+
71+
- Every exported type, function, method, and field must have a GoDoc comment explaining its contract—like Go stdlib documentation.
72+
73+
### Safety & Forbidden Operations
74+
75+
| Action | Policy |
76+
|--------|--------|
77+
| `git clean/stash/reset/checkout` | **FORBIDDEN** |
78+
| `go clean -cache` | **FORBIDDEN** during normal work |
79+
| Edit `gen/` directly | **FORBIDDEN** |
80+
| Changes ≥3 files | Describe plan first |
81+
| New dependencies | Explain why first |
82+
83+
### Testing
84+
85+
- Write table-driven tests in `*_test.go`.
86+
- Name tests `TestXxx`. Keep fast and deterministic.
87+
- Use `testify/assert` for assertions when possible; use `testify/require` only when the test cannot proceed if the assertion fails (e.g., nil checks before dereferencing).
88+
89+
---

go.mod

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
module goa.design/clue
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
66
github.com/aws/smithy-go v1.24.0
77
github.com/go-logr/logr v1.4.3
88
github.com/stretchr/testify v1.11.1
9-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.64.0
10-
go.opentelemetry.io/otel v1.39.0
11-
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.39.0
12-
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.39.0
13-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0
14-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0
15-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0
9+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.65.0
10+
go.opentelemetry.io/otel v1.40.0
11+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.40.0
12+
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.40.0
13+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.40.0
14+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.40.0
15+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.40.0
1616
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.39.0
1717
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.39.0
18-
go.opentelemetry.io/otel/metric v1.39.0
19-
go.opentelemetry.io/otel/sdk v1.39.0
20-
go.opentelemetry.io/otel/sdk/metric v1.39.0
21-
go.opentelemetry.io/otel/trace v1.39.0
22-
goa.design/goa/v3 v3.24.3
23-
golang.org/x/term v0.39.0
24-
golang.org/x/tools v0.41.0
25-
google.golang.org/genproto v0.0.0-20250908214217-97024824d090
26-
google.golang.org/grpc v1.78.0
18+
go.opentelemetry.io/otel/metric v1.40.0
19+
go.opentelemetry.io/otel/sdk v1.40.0
20+
go.opentelemetry.io/otel/sdk/metric v1.40.0
21+
go.opentelemetry.io/otel/trace v1.40.0
22+
goa.design/goa/v3 v3.25.1
23+
golang.org/x/term v0.40.0
24+
golang.org/x/tools v0.42.0
25+
google.golang.org/genproto v0.0.0-20260217215200-42d3e9bedb6d
26+
google.golang.org/grpc v1.79.1
2727
google.golang.org/protobuf v1.36.11
2828
)
2929

@@ -33,22 +33,22 @@ require (
3333
github.com/davecgh/go-spew v1.1.1 // indirect
3434
github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598 // indirect
3535
github.com/felixge/httpsnoop v1.0.4 // indirect
36-
github.com/go-chi/chi/v5 v5.2.4 // indirect
36+
github.com/go-chi/chi/v5 v5.2.5 // indirect
3737
github.com/go-logr/stdr v1.2.2 // indirect
3838
github.com/gohugoio/hashstructure v0.6.0 // indirect
3939
github.com/google/uuid v1.6.0 // indirect
4040
github.com/gorilla/websocket v1.5.3 // indirect
41-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
41+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.28.0 // indirect
4242
github.com/manveru/faker v0.0.0-20171103152722-9fbc68a78c4d // indirect
4343
github.com/pmezard/go-difflib v1.0.0 // indirect
4444
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
4545
go.opentelemetry.io/proto/otlp v1.9.0 // indirect
46-
golang.org/x/mod v0.32.0 // indirect
47-
golang.org/x/net v0.49.0 // indirect
46+
golang.org/x/mod v0.33.0 // indirect
47+
golang.org/x/net v0.50.0 // indirect
4848
golang.org/x/sync v0.19.0 // indirect
49-
golang.org/x/sys v0.40.0 // indirect
50-
golang.org/x/text v0.33.0 // indirect
51-
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
52-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 // indirect
49+
golang.org/x/sys v0.41.0 // indirect
50+
golang.org/x/text v0.34.0 // indirect
51+
google.golang.org/genproto/googleapis/api v0.0.0-20260217215200-42d3e9bedb6d // indirect
52+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260217215200-42d3e9bedb6d // indirect
5353
gopkg.in/yaml.v3 v3.0.1 // indirect
5454
)

0 commit comments

Comments
 (0)