Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
60c612a
fix(codegen): coordinate union names across shared packages
raphael Aug 21, 2026
21d0e99
docs(codegen): define generated package ownership
raphael Aug 21, 2026
2863cc9
docs(codegen): widen ownership to generation lifetime
raphael Aug 21, 2026
0103f6a
test(codegen): pin generated package ownership contracts
raphael Aug 21, 2026
050ead6
docs(codegen): distinguish reproduced union failures
raphael Aug 21, 2026
dac45fe
test(codegen): verify generated transport coverage
raphael Aug 21, 2026
055b842
docs(codegen): order catalog before identity refactor
raphael Aug 21, 2026
15f86ce
feat(codegen): add generation-owned type catalog
raphael Aug 21, 2026
7353f34
fix(codegen): freeze generated package names
raphael Aug 21, 2026
8bda1ae
fix(codegen): hide package scope until freeze
raphael Aug 21, 2026
bec6060
docs(codegen): record frozen catalog contract
raphael Aug 21, 2026
4957dde
feat(codegen): add generation planning lifecycle
raphael Aug 21, 2026
a120d8e
docs(codegen): describe generation invariants
raphael Aug 21, 2026
c1b12f8
docs(codegen): record generation lifecycle completion
raphael Aug 21, 2026
81b8bc3
refactor(codegen): make service emission package-owned
raphael Aug 21, 2026
4ca1f70
codegen: complete generated package ownership
raphael Aug 21, 2026
5469ad1
codegen: freeze aliases and method type names
raphael Aug 21, 2026
14b1a3c
codegen: make service aliases generation-owned
raphael Aug 21, 2026
1bf62f5
codegen: prioritize required import aliases
raphael Aug 21, 2026
839791a
docs(codegen): record package-owned service completion
raphael Aug 21, 2026
595f50a
codegen: freeze service names across transports
raphael Aug 21, 2026
8dc8ea8
fix(codegen): key recursive traversal by declaration origin
raphael Aug 21, 2026
c6a0e1e
codegen: freeze generated transport aliases
raphael Aug 21, 2026
393e910
codegen: catalog protobuf wire declarations
raphael Aug 21, 2026
ddfc047
fix(codegen): own transport wire contracts
raphael Aug 21, 2026
da3907d
docs(codegen): define retained generation plans
raphael Aug 21, 2026
cf6e0a5
refactor(codegen): own names and fresh run lifecycle
raphael Aug 21, 2026
84bed41
fix(codegen): make generation state exact and run-owned
raphael Aug 21, 2026
3bf68c4
fix(codegen): retain complete service generation plans
raphael Aug 22, 2026
0b90825
fix(grpc): require a complete oneof branch
raphael Aug 22, 2026
f797d9c
fix(codegen): retain exact HTTP and JSON-RPC plans
raphael Aug 22, 2026
c0690e3
fix(codegen): preserve exact protobuf Go names
raphael Aug 22, 2026
1bf4653
refactor(grpc): retain one transport plan
raphael Aug 22, 2026
5cbdda8
fix(codegen): complete generated contract planning
raphael Aug 24, 2026
1729d97
fix(codegen): preserve released generator entry points
raphael Aug 24, 2026
6ae2349
chore: satisfy repository checks
raphael Aug 24, 2026
be08c8e
fix(codegen): keep planned output paths portable
raphael Aug 24, 2026
4c9eac4
fix(codegen): support Windows tool output
raphael Aug 24, 2026
5d25a4e
fix(cli): honor JSON contracts in generated commands
raphael Aug 24, 2026
0a23906
fix(openapi): keep JSON and YAML values equivalent
raphael Aug 24, 2026
b12e1e4
fix(http): decode whole-query maps as generated clients send them
raphael Aug 24, 2026
970710e
fix(http): close empty WebSocket result streams cleanly
raphael Aug 24, 2026
91277e9
docs(codegen): describe released generator compatibility
raphael Aug 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,36 @@ No commented-out code—delete dead code.

### Codegen Implementation

- **Critical — finish work during generation**: Use the complete design, generation plan,
and Go templates to decide everything that is known before the generated
program runs. Select branches, names, types, imports, field paths, helper
calls, and emitted files while generating source. Templates must write only
the selected code. Do not make generated programs inspect generated type
shapes, parse generator-made names, carry generator mode flags, or execute
branches whose answer was already known. Runtime code should contain only
logic that depends on actual runtime values. When a runtime value is truly
required, keep that input narrow and specialize all surrounding code during
generation.
- **Use NameScope helpers** for type references: `GoTypeRef`, `GoFullTypeRef`, `GoTypeName`. Never concatenate strings for types.
- Let Goa decide pointer/value semantics. Do not force `pointer=true` except in transport validation.
- **Keep helper visibility minimal**: If logic is shared only inside one codegen area, keep it package-private or move it under an `internal` package. Do not export helpers from a parent package just to share them across sibling generators.
- **Avoid pass-through wrappers**: When two helper functions differ only by forwarding arguments or hard-coding `nil`, collapse them into a single implementation instead of adding an extra layer.
- **Generated packages own names**: When several services or plugins write to
one Go package, collect every package-level name before rendering and then
make those names final. A declaration and every HTTP, gRPC, or JSON-RPC use
of it must read the same name record. Do not give each service or plugin a
separate name scope for the same package, and do not add declarations after
names become final.
- **Keep identity typed and explicit**: Do not hide a declaration's kind,
package, or use in a decorated name or a made-up string map key. Do not
change an expression's `Hash` behavior to solve a generation problem. Pass a
typed identifier where the generated declaration is named.
- **Trace the complete lifecycle**: Before changing relocated types, union
naming, generation roots, plugins, or file merging, follow the declaration
from the evaluated design through service analysis, its generated Go
package, the emitted service code, HTTP and gRPC uses, plugin changes, and
the final file merge. A service-only rendering test is not enough.
See [`codegen/ARCHITECTURE.md`](codegen/ARCHITECTURE.md).

### Documentation

Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ PROTOC_DEST=$(GOBIN_DIR)/$(PROTOC_BIN)
# Only list test and build dependencies
# Standard dependencies are installed via go get
DEPEND=\
google.golang.org/protobuf/cmd/protoc-gen-go@latest \
google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.12 \
google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.6.2

all: lint test integration-test

Expand Down Expand Up @@ -177,4 +177,3 @@ release-plugins:
git tag v$(MAJOR).$(MINOR).$(BUILD) && \
git push origin v$(MAJOR) && \
git push origin v$(MAJOR).$(MINOR).$(BUILD)

946 changes: 946 additions & 0 deletions codegen/ARCHITECTURE.md

Large diffs are not rendered by default.

Loading
Loading