docs: approve manual constructor injection

This commit is contained in:
2026-08-20 13:10:02 +03:30
parent 98b615b6fc
commit 2426c1ed33
3 changed files with 31 additions and 7 deletions

View File

@@ -19,6 +19,7 @@ For every Go-related task, always invoke and follow the `golang-how-to` skill, t
## Go baseline after approval
- Keep `main` packages thin under `cmd/`; business code lives under `internal/`.
- Wire dependencies manually with explicit constructors at the composition root. Do not introduce a DI container or code generator unless a later ADR documents measured wiring/lifecycle complexity.
- Use explicit constructors; avoid `init()` side effects and mutable globals.
- Configuration comes from validated environment variables. Logs go to stdout as structured records without credentials, card keys, or sensitive payloads.
- Propagate `context.Context`; bound external calls, queues, batches, and database pools.
@@ -36,4 +37,3 @@ For every Go-related task, always invoke and follow the `golang-how-to` skill, t
## AI boundary (post-MVP)
AvalAI is accessed only from the backend using a server-held API key. Prefer the simplest bounded LLM call/workflow that satisfies the approved use case. Send minimized, sanitized aggregates with explicit budgets/timeouts; persist trace metadata and deterministic inputs, not unnecessary sensitive prompts. AI output is advisory and must cite underlying deterministic metrics.