Add lifecycle telemetry transitions#78
Merged
Merged
Conversation
Co-authored-by: OpenAI Codex (GPT-5) <codex@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds the transition layer that applies deterministic validation outcomes to durable development-loop run/step state, and emits ADR 0012 lifecycle telemetry via centralized OpenTelemetry metric helpers.
Changes:
- Added new lifecycle metric recorders for run completion/duration, step duration/retries, and validation outcome/duration (with cancellation spelling normalization and basic redaction for command attributes).
- Introduced
applyDevelopmentLoopValidationReport,completeDevelopmentLoopRun, andretryDevelopmentLoopSteptransition helpers with idempotent (replay) behavior and “metrics-after-transaction” emission. - Documented the blocking semantics for failed validation and skipped required gates; added PGlite-backed transition tests and metric contract tests.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/observability/metrics.test.ts | Extends metric contract coverage to include lifecycle metrics, sink failure safety, and command redaction. |
| tests/unit/loops/development-run-transitions.test.ts | Adds end-to-end tests for validation application, blocking rules, replay idempotency, trace ID logging, run completion metrics, and retry behavior. |
| src/lib/observability/metrics.ts | Centralizes new lifecycle metric instruments/attributes and adds command-attribute redaction + cancellation spelling normalization. |
| src/lib/loops/development-run-transitions.ts | Adds the new transition layer that persists validation/run/step state and emits lifecycle telemetry post-commit. |
| docs/loop-manifest.md | Documents required/optional gate blocking semantics for validation reports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Preserve persisted validation blocked reasons on replay and distinguish empty validation reports from missing required gates. Co-authored-by: Codex GPT-5 <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #73.
Adds the transition layer that consumes
loopworks.validation_report.v1outcomes from #75 and turns them into durable run/step state changes plus ADR 0012 lifecycle telemetry. The implementation keeps OTel metric names centralized insrc/lib/observability/metrics.ts, preserves existing validation artifacts instead of creating duplicates, and documents the required-skipped-gate blocking rule in the loop manifest guide.What changed
Validation
TDD red evidence captured before production code:
bun test tests/unit/observability/metrics.test.tsfailed on missingrecordDevelopmentLoopStepRetryMetricexport.bun test tests/unit/loops/development-run-transitions.test.tsfailed because@/lib/loops/development-run-transitionsdid not exist.Green checks:
bun test tests/unit/observability/metrics.test.tsbun test tests/unit/loops/development-run-transitions.test.tsbun run buildbun run validatepassed end-to-end: format, lint, agent-docs, markdownlint, typecheck, 231 Vitest tests, Storybook build, and 17 Playwright tests.Reviewer focus
Please scrutinize the transition semantics around required skipped gates, missing required gate results, and idempotent metric emission. Those are the places where incorrect behavior would either advance runs too eagerly or double-count operational telemetry.
Co-authored-by: OpenAI Codex (GPT-5) codex@openai.com