Skip to content

feat: improve trace correctness and diagnostics - #44

Merged
Harsh-2002 merged 1 commit into
mainfrom
codex/trace-diagnostics
Aug 11, 2026
Merged

feat: improve trace correctness and diagnostics#44
Harsh-2002 merged 1 commit into
mainfrom
codex/trace-diagnostics

Conversation

@Harsh-2002

Copy link
Copy Markdown
Owner

Summary

  • aggregate trace-list status, duration, outliers, span/error/cold-start counts across complete traces, including externally parented W3C traces
  • add stable opaque cursor pagination, composite indexes, exact any-span function filtering, and REST/MCP/CLI contract parity
  • replace duplicate trace layouts with one causal expandable waterfall, linked structured logs, mobile stacking, keyboard controls, and 44px touch targets
  • add Vue Test Utils/jsdom component coverage and require npm test in CI
  • update tracing API, CLI, MCP, embedded docs, and sandbox E2E coverage

Validation

  • make test
  • make lint
  • cd frontend && npm test && npm run lint && npm run build
  • npm audit --audit-level=moderate (0 vulnerabilities)
  • go test -race ./backend/internal/database ./backend/internal/server/handlers
  • make build-all
  • test/tracing-test.sh with ORVA_REQUIRE_SANDBOX=1: 16/16 checks
  • test/e2e/tests/test_traces.py: 22/22 checks
  • canonical docs and MCP/frontend/CLI embedded copies are byte-identical
  • Impeccable detector: no findings; manual audit 20/20 with no P1 accessibility or responsive findings

Notes

  • no release tag or production deployment is included
  • merge only after consolidated CI and CodeQL are green

Entire-Checkpoint: 01KZRGJ3E1SZJ0HNFEQWZ40RZ8

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1afd8c67ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +396 to +405
WITH execution_rollup AS (
SELECT trace_id,
MIN(julianday(replace(started_at, ' +0000 UTC', 'Z'))) AS start_jd,
MAX(julianday(replace(started_at, ' +0000 UTC', 'Z')) + COALESCE(duration_ms, 0) / 86400000.0) AS end_jd,
COUNT(*) AS execution_count,
SUM(CASE WHEN status = 'error' THEN 1 ELSE 0 END) AS error_count,
SUM(CASE WHEN cold_start = 1 THEN 1 ELSE 0 END) AS cold_start_count,
MAX(is_outlier) AS has_outlier
FROM executions
WHERE trace_id IS NOT NULL

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bound trace aggregation before grouping retained history

On instances with substantial execution history, every trace-list request—including a small limit or recent since filter—must aggregate all retained executions and user_spans first, because those predicates are only applied outside these rollup CTEs. The query also scans executions again for local_roots, and wrapping started_at in julianday(replace(...)) prevents the new raw timestamp index from bounding that work. This makes /api/v1/traces increasingly expensive as invocation volume grows; select candidate trace IDs before the rollups where semantics permit, or maintain indexed per-trace summaries.

Useful? React with 👍 / 👎.

Comment on lines +84 to +86
return (logs || []).filter((entry) =>
entry.span_id === row.span_id ||
(row.type === 'system' && entry.execution_id === row.execution_id),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Associate structured logs with selected user spans

When a user selects a code span and switches to “Selected span,” this predicate always hides its logs: runtime log entries carry the execution's system span ID, while the user-span ID is generated server-side only after orva.trace.span() finishes, and the execution-ID fallback is explicitly limited to system rows. Consequently, logs emitted inside any user-defined span produce an empty selected view; propagate the active user-span ID into logging or associate these entries by execution and the user span's time interval.

Useful? React with 👍 / 👎.

@Harsh-2002
Harsh-2002 merged commit 8a3831e into main Aug 11, 2026
31 checks passed
@Harsh-2002
Harsh-2002 deleted the codex/trace-diagnostics branch August 11, 2026 13:45
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