# Agent Guidelines ## Terminology - Use the canonical domain nouns defined in [docs/terminology.md](docs/terminology.md) across Go identifiers, Kubernetes API fields, UI copy, documentation, and error messages. - Do not introduce synonyms for established concepts (for example, use `trajectory` not `playbook`, `service portal` not `proxy`, and `task`/`run` not `job`). ## Code style ### Naming - Spell identifiers out. Do not abbreviate a word to save characters: `candidateCommit` not `candCommit`, `requestedBy` not `reqBy`, `previousRun` not `prevRun`, `action` not `act`. - An abbreviation is acceptable only when it pays for itself: it is universally understood by Go programmers and already used consistently in this codebase (`ctx`, `err`, `cfg`, `cr`, `req`/`resp` in HTTP handlers, `id`, `url`). - Exception: loop variables may be single characters. `i`, `j`, `k` for integer loops are preferred; `for _, run := range runs` style is also fine. - When extending existing code, match the existing name rather than introducing a second spelling; when adding new code, use the full word. ## Tests - Write tests that verify real behavior and realistic failure modes rather than checking static constants, embedded CSS strings, or hardcoded HTML template copy. - Because Go is a compiled language, tests that merely mirror code structure add no value (the compiler already catches that). - Prefer end-to-end tests over unit tests, reserving unit tests for truly complicated logic (such as a bin-packing algorithm). - Avoid adding test-only constructor seams or heavy fake scaffolding just to unit-test simple wiring fixes.