agent/pkg/lib/task/code/review/conventions.md
Snider 21f234aa7c refactor: flatten go/ subdir, migrate to dappco.re/go/agent, restore process service
- Module path: dappco.re/go/agent
- Core import: dappco.re/go/core v0.4.7
- Process service re-enabled with new Core API
- Plugin bumped to v0.11.0
- Directory flattened from go/ to root

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-21 11:10:44 +00:00

817 B

Core Conventions Checklist

Error Handling

  • coreerr.E("pkg.Method", "msg", err) — always 3 args
  • Never fmt.Errorf or errors.New
  • Import as coreerr "forge.lthn.ai/core/go-log"

File I/O

  • coreio.Local.Read/Write/EnsureDir — never os.ReadFile/WriteFile
  • WriteMode(path, content, 0600) for sensitive files (keys, hashes)
  • Import as coreio "forge.lthn.ai/core/go-io"

Safety

  • Check err != nil BEFORE resp.StatusCode
  • Type assertions use comma-ok: v, ok := x.(Type)
  • No hardcoded paths (/Users/, /home/, host-uk)
  • No tokens/secrets in error messages or logs

Style

  • UK English in comments (colour, organisation, initialise)
  • SPDX-License-Identifier: EUPL-1.2 on every file
  • Test naming: _Good, _Bad, _Ugly