Repository navigation
Preserve unified trace ordering and import OTel observations - #67635
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
|
🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills... |
|
✅ PR Code Quality Reviewer completed the code quality review. Unable to emit PR review because this run cannot execute safeoutputs via bash; needed allowlist entry: tools.bash: - safeoutputs.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. No ADR enforcement needed for PR #67635: the PR does not carry the 'implementation' label and has 0 new lines in default business logic directories (threshold: 100). No custom .design-gate.yml present.
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
There was a problem hiding this comment.
🟡 Changes recommended
An explicitly null OTLP event clock incorrectly inherits an observation clock, fabricating ordering evidence.
1 open finding
What changed in this PR
This PR preserves source-local trace ordering while adding local OpenTelemetry observations to unified sessions.
Changes:
- Adds anchor-based, nanosecond-aware multi-source ordering.
- Imports and safely summarizes OTLP spans, events, and logs.
- Updates validation, schemas, documentation, embedding, and tests.
| File | Description |
|---|---|
docs/src/content/docs/specs/unified-agent-session-specification.md |
Documents ordering and OTel behavior. |
docs/public/schemas/unified-session.schema.json |
Adds nanosecond timestamp units. |
actions/setup/session_parsers.go |
Embeds new parser modules. |
actions/setup/js/unified_session.test.cjs |
Updates ordering expectations. |
actions/setup/js/unified_session.cjs |
Integrates ordering and OTel collection. |
actions/setup/js/unified_session_render.cjs |
Adds metadata-only OTel rendering. |
actions/setup/js/unified_session_otel.test.cjs |
Tests OTel collection and safety. |
actions/setup/js/unified_session_otel.cjs |
Expands OTLP observations. |
actions/setup/js/unified_session_order.test.cjs |
Tests ordering and precision. |
actions/setup/js/unified_session_order.cjs |
Implements anchored source merging. |
actions/setup/js/types/unified_session.d.ts |
Adds nanosecond typing. |
actions/setup/js/scripts/validate_session.cjs |
Validates source-preserving ordering. |
actions/setup/js/scripts/session_schemas.test.cjs |
Updates schema-ordering tests. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
REQUEST_CHANGES
The new ordering logic is headed in the right direction, but the validator now changes how existing v1 unified-session artifacts are interpreted when timestampUnit is absent. Because the file-format version stays at 1 and the schema still makes that field optional, this is a backward-compatibility break rather than a harmless refinement.
Blocking theme
actions/setup/js/scripts/validate_session.cjs: missingtimestampUnitnow silently falls back to milliseconds, which can mis-read older seconds-based source timestamps and produce falsenot timestamp orderedfailures.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 60.8 AIC · ⌖ 5.7 AIC · ⊞ 21.2K
Comment /review to run again
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: c99246f
|
…e-ordering Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Summary
The unified trace previously moved untimed events to the end and globally sorted recorded timestamps, which could separate tool lifecycle observations or reverse their source-local order when clocks regressed. It also omitted the local OpenTelemetry mirror.
Ordering trade-off
Source-local sequence takes precedence over regressing wall-clock timestamps. Anchors are used only for merging and are not persisted as observed times. OTel collection reads available local mirrors only; it does not query a backend or invent missing spans. The merge remains in-memory with a stable global sort.
Validation
make fmt,make fmt-cjs, andmake lint-cjspassed.make agent-report-progresspassed for the implementation;BASE_REF=HEAD make agent-report-progresspassed for the follow-up test-only changes.