Mined the egirl->cocotte lineage + the prose agentic configs. Per-language standards (py/rust/gd) and general conventions: service_architecture, multi_agent_workflow, error_handling_logging, mcp_server_patterns, naming_conventions, tenancy_patterns (draft), database_patterns. Captures the canonical/latest where versions diverged. 14/14 lint:yaml-valid. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
28 lines
1.3 KiB
YAML
28 lines
1.3 KiB
YAML
apiVersion: conventions/v1
|
|
version: 0.1.0
|
|
updated: "2026-06-29"
|
|
name: error_handling_logging
|
|
title: Error handling & structured logging (cross-language)
|
|
scope: general
|
|
status: active
|
|
summary: Typed errors with cause chaining, no silent swallows, structured logging (never stdout in libraries), specific exception types. The shared spirit across TS/Py/Rust/GD.
|
|
appliesTo: ["**/*"]
|
|
rules:
|
|
- id: typed_errors
|
|
level: must
|
|
text: "Domain-specific typed errors (TS Error subclasses, Py exception classes, Rust thiserror enums, GD explicit failure paths). Never a bare string thrown."
|
|
- id: cause_chaining
|
|
level: must
|
|
text: "Errors carry context up the stack: TS `{ cause }`, Py `raise ... from exc`, Rust `#[from]`/source."
|
|
- id: no_silent_swallow
|
|
level: must
|
|
text: "No empty catch / `except: pass` / discarded Result. Handle, rethrow, or log+rethrow — never swallow."
|
|
- id: structured_logging
|
|
level: must
|
|
text: "Structured logger, not stdout, in libraries (no console.log / print() / println!). MCP/stdio processes log to stderr only."
|
|
- id: lazy_log_format
|
|
level: should
|
|
text: "Python: lazy %-formatting in log calls (logger.info('x=%s', x)), not f-strings."
|
|
- id: observable_failures
|
|
level: should
|
|
text: "Failures are observable (logged with context / push_error in GD), never silent returns."
|