Skip to content

feat(observability): logging standard covers every process type, not just API calls#3

Merged
nfeuer merged 1 commit into
mainfrom
claude/package-differentiation-analysis-pqwpe9
Jul 5, 2026
Merged

feat(observability): logging standard covers every process type, not just API calls#3
nfeuer merged 1 commit into
mainfrom
claude/package-differentiation-analysis-pqwpe9

Conversation

@nfeuer

@nfeuer nfeuer commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

The kit's logging guidance skewed LLM/API-call-centric: the only itemized field requirements anywhere were tokens/cost/task_type, CLAUDE.template.md's logging principle specified only model calls, and nothing stated what a background job, queue consumer, batch stage, state machine, or the process lifecycle must emit. This PR makes the logging instructions complete and useful for every process type:

  • docs/LOGGING_STANDARD.md (new) — per-process-type event catalog with minimum required fields: requests, external calls (LLM as one case), background jobs (start/progress/terminal with items processed/skipped/failed, overlap detection), queue consumers (per-message outcome, retries, dead-lettering), batch/ETL stages (rows in/out, per-record skip reasons), process lifecycle (startup/shutdown, supervised task exits), state transitions, retries/fallbacks, caches/pools — plus the anti-patterns (failure-only logging, start-without-end, counts-without-reasons, prose events).
  • templates/logging_setup.py — new log_operation context manager: paired <name>_completed/<name>_failed events with duration_ms for any operation, re-raising on error. Makes the universal rule ("every significant operation logs outcome + duration") a one-liner.
  • observability-check skill — telemetry step broadened beyond external calls; new long-running-process legibility step; job/run IDs treated as correlation context; missing-heartbeat failure mode (absence of job_completed is the alert); report block extended.
  • observability-reviewer agent — reads the catalog first; new job/consumer/pipeline lifecycle category; flags success-silent operations (indistinguishable from never-ran).
  • CLAUDE.template.md principle 3 generalized — model-call fields become the additional LLM requirement, not the whole rule.
  • Wiring — bootstrap installs LOGGING_STANDARD.md into new projects; README tree/catalog updated; kit_version 1.1.0 → 1.2.0 so kit-update offers this to adopted projects.

Spec citation

  • No design change — the kit repo has no canonical spec; the kit's own convention docs (LOGGING_STANDARD.md) are the deliverable.

What was tested

  • Ran kit-ci's validation locally: templates/logging_setup.py compiles (py_compile), kit.yaml parses, changed skill/agent files have valid frontmatter.
  • Unit tests: N/A — documentation/template repo.
  • Manual verification: cross-references resolve — LOGGING_STANDARD.md is referenced from observability-check, observability-reviewer, CLAUDE.template.md, logging_setup.py, and the bootstrap install step; reviewer's category count updated to match its new section.
  • Coverage ratchet: N/A

Risk and rollback

Risk: low — documentation, a new additive template helper, and checklist wording; no hooks or gate semantics change. Adopted projects see nothing until they run kit-update.

Rollback: revert the PR.

Docs

  • Narrative docs updated in the same PR (LOGGING_STANDARD.md, README, CLAUDE.template.md)
  • Changelog entry — generated at next release by the release skill
  • No ADR needed — convention documented in LOGGING_STANDARD.md itself

Follow-ups

  • None added or closed

🤖 Generated with Claude Code

https://claude.ai/code/session_01LxEwyqF1KjEPpQKqM5tSrv


Generated by Claude Code

…just API calls

The logging guidance skewed LLM/API-call-centric (tokens, cost, task_type)
while jobs, consumers, pipelines, state machines, and process lifecycle had
no concrete required events. Now:

- docs/LOGGING_STANDARD.md: per-process-type event catalog (requests,
  external calls, background jobs, queue consumers, batch/ETL stages,
  lifecycle, state transitions, retries/fallbacks, caches) with minimum
  fields and anti-patterns (failure-only logging, start-without-end,
  counts-without-reasons)
- templates/logging_setup.py: log_operation context manager — paired
  <name>_completed/<name>_failed with duration_ms for any operation
- observability-check: operation telemetry beyond external calls, job/run
  correlation ids, long-running-process legibility step, missing-heartbeat
  failure mode; report block extended
- observability-reviewer agent: catalog-driven scope, new job/consumer/
  pipeline lifecycle category, success-silence flagged
- CLAUDE.template.md principle 3 generalized to every process type
- bootstrap installs LOGGING_STANDARD.md; kit_version 1.1.0 -> 1.2.0

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LxEwyqF1KjEPpQKqM5tSrv
@nfeuer
nfeuer merged commit ed6bd3c into main Jul 5, 2026
2 checks passed
@nfeuer
nfeuer deleted the claude/package-differentiation-analysis-pqwpe9 branch July 5, 2026 15:48
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.

2 participants