-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Ring standards contain 13 occurrences of panic() used as positive examples (✅ or unmarked) across 7 files. Agents copy these patterns and generate Must* helpers with panic() in business code — even though the rules explicitly forbid it.
The root cause: code examples contradict the rules. Agents prioritize concrete examples over abstract rules.
Reported by: @alexgarzao (thread)
Affected files
Standards with panic examples (bootstrap)
dev-team/docs/standards/golang/bootstrap.md— lines 371, 671dev-team/docs/standards/golang/core.md— lines 396, 402dev-team/docs/standards/golang/security.md— lines 103, 375dev-team/docs/standards/sre.md— line 307platforms/opencode/standards/sre.md— line 307pm-team/skills/shared-patterns/code-example-standards.md— line 110
quality.md — example marked as ✅ REQUIRED
dev-team/docs/standards/golang/quality.md— line 95
logger.Fatalf (equivalent — calls os.Exit)
dev-team/docs/standards/golang/multi-tenant.md— line 2064
Proposal
Full proposal with before/after diffs for all 14 files (~50 edits):
https://alfarrabio.lerian.net/ring-zero-panic-proposal.md
Summary of changes (6 blocks)
- Replace all 13
panic()examples →return error(7 standard files) - Rewrite panic detection table in
domain.md(close the "main/init is ok" loophole) - Expand anti-rationalization + pressure resistance tables in
backend-engineer-golang.md - Update
CLAUDE.mdwith Zero Panic Policy - Add post-generation self-check to
dev-implementationanddev-cycle - Update
qa-analyst.md(fuzz checks)
Zero Panic Policy (tl;dr)
panic()is FORBIDDEN everywhere — including main, init, and bootstrapMust*helpers that panic are FORBIDDEN — return(T, error)insteadlog.Fatal()is FORBIDDEN — return error and let the caller decideregexp.MustCompile()is the ONLY exception (compile-time constant)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request