Skip to content

[codex] Centralize observability metric helpers#72

Merged
ncolesummers merged 1 commit into
mainfrom
codex/63-o11y-helpers
Jul 4, 2026
Merged

[codex] Centralize observability metric helpers#72
ncolesummers merged 1 commit into
mainfrom
codex/63-o11y-helpers

Conversation

@ncolesummers

Copy link
Copy Markdown
Owner

Pull Request

Issue

Closes #63

Summary

  • Centralizes ADR 0012 metric and durable observability event vocabulary under src/lib/observability/.
  • Routes development_loop_run_created through one helper that writes the durable audit row and maps to loopworks.run.started.
  • Emits OTel only after the durable run transaction resolves, with best-effort handling so telemetry failures do not roll back workflow persistence.
  • Adds guardrail tests that block direct metric names, durable metricName writes, and direct OTel API usage outside observability helpers.

Type of change

  • Feature
  • Bug fix
  • Accessibility
  • Documentation
  • Tests/tooling

Red evidence

  • Failing tests or checks added before implementation:
    • bun run test tests/unit/observability/metrics.test.ts failed on missing helper exports and direct metricName / metric-name usage in src/lib/loops/development-run.ts.
    • Follow-up red check failed when tests required after-transaction OTel emission instead of immediate helper emission.

Green validation

  • bun run format:check
  • bun run lint
  • bun run agent-docs:check
  • bun run markdownlint
  • bun run typecheck
  • bun run test
  • bun run storybook:build
  • bun run test:e2e
  • bun run validate

Docs and ADRs

  • Docs updated or not needed
  • ADR updated/added or not needed
  • Agent docs synced if any AGENTS.md changed

UI and Storybook review

  • Relevant Storybook states covered or not needed
  • Light/dark and accessibility review completed or not needed
  • Human verification completed before commit

Agent review notes

  • Subagents used: read-only observability explorer and two read-only adversarial QA/security reviewers.
  • Adversarial QA/security findings: reconciled transaction ordering, best-effort OTel failure handling, metric namespace guardrails, and span-helper coverage.
  • Reviewer focus areas: confirm the after-transaction OTel emission contract, durable event vocabulary mapping, and AST guardrail scope.

Prepared by Codex using GPT-5.

Refs #63

Centralize ADR 0012 metric and durable event guardrails, route development-loop run creation through observability helpers, and keep OTel emission after the durable transaction resolves.

Validation:
- bun run validate

Co-authored-by: OpenAI Codex GPT-5 <codex@openai.com>
@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
loopworks Ready Ready Preview, Comment Jul 4, 2026 4:44am

Request Review

@ncolesummers ncolesummers marked this pull request as ready for review July 4, 2026 04:47
Copilot AI review requested due to automatic review settings July 4, 2026 04:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ncolesummers ncolesummers merged commit a4a88d5 into main Jul 4, 2026
3 checks passed
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.

Central observability helpers and metric vocabulary guardrails

3 participants