Skip to content

docs(logger): document three-tier failure-handling model#3701

Merged
bokelley merged 1 commit into
mainfrom
bokelley/logger-three-tier-doc
Apr 30, 2026
Merged

docs(logger): document three-tier failure-handling model#3701
bokelley merged 1 commit into
mainfrom
bokelley/logger-three-tier-doc

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

Extends the logger JSDoc convention added in #3650 with the third tier that emerged across this session's noise cleanup (PRs #3578#3672).

The model

Tier Code When
1 logger.error Unexpected — pages on-call via #aao-errors + PostHog $exception
2 logger.warn Expected third-party state we shrug at (deactivated user, archived channel)
3 logger.warn + createEscalation({ category: 'needs_human_action', dedup_key }) Actionable but not page-worthy — lands in the escalation queue, dedup_key collapses repeats

Why

After the convention doc in #3650, we discovered that "expected failure" splits into "shrug" vs "needs human action eventually." Without the third tier in the JSDoc, a future author has to read PR history to figure out the right pattern for a Slack not_in_channel-style condition.

Example call site for tier 3 lives in slack/client.ts:inviteToChannel (added in #3672).

Test plan

  • Pre-commit (test:unit + test-dynamic-imports + typecheck) — passed
  • Docs-only change to JSDoc; no behavior change

🤖 Generated with Claude Code

Extends the convention added in #3650 with the third tier that emerged
during the alert-noise cleanup:

- Tier 1: logger.error — unexpected, pages on-call
- Tier 2: logger.warn — expected third-party state we accept
- Tier 3: logger.warn + createEscalation({ category, dedup_key }) —
  actionable but not page-worthy, queued for batch triage

Docs-only. Future authors picking between error and warn for a third-party
failure now have a single reference, and the escalation tier (introduced
in #3672) is discoverable from the same JSDoc instead of being implicit
in PR history.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bokelley bokelley enabled auto-merge (squash) April 30, 2026 23:14
@bokelley bokelley merged commit 1587622 into main Apr 30, 2026
13 checks passed
@bokelley bokelley deleted the bokelley/logger-three-tier-doc branch April 30, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant