Skip to content

[CI] (3f39e0e) next-js/15-app-router-todo - #4163

Closed
wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-3f39e0e-next-js-15-app-router-todo
Closed

wizard-ci-bot[bot] wants to merge 1 commit into
mainfrom
wizard-ci-3f39e0e-next-js-15-app-router-todo

Conversation

@wizard-ci-bot

@wizard-ci-bot wizard-ci-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown

Automated wizard CI run

Source: wizard-pr
Trigger ID: 3f39e0e
App: next-js/15-app-router-todo
App directory: apps/next-js/15-app-router-todo
Workbench branch: wizard-ci-3f39e0e-next-js-15-app-router-todo
Wizard branch: release-please--branches--main--components--wizard
Context Mill branch: main
PostHog (MCP) branch: master
Timestamp: 2026-09-23T22:07:25.957Z
Duration: 449.9s

YARA Scanner

✓ 174 tool calls scanned, 0 violations detected

No violations: ✓ 174 clean scans

@wizard-ci-bot

wizard-ci-bot Bot commented Sep 23, 2026

Copy link
Copy Markdown
Author

PR Evaluation Report

Summary

This PR integrates PostHog into a Next.js 15 App Router todo application. Client-side initialization is done via instrumentation-client.ts, custom events are captured for todo CRUD operations, error tracking is set up via global-error.tsx and capture_exceptions, and server-side logging uses OpenTelemetry OTLP to send structured logs to PostHog. No user identification or reverse proxy is configured.

Files changed Lines added Lines removed
8 +138 -2

Confidence score: 4/5 👍

  • Likely invalid OpenTelemetry package versions: The versions ^0.222.0 for @opentelemetry/sdk-logs, @opentelemetry/api-logs, @opentelemetry/exporter-logs-otlp-http, and ^2.11.0 for @opentelemetry/resources appear to be hallucinated. These packages were at ~0.53.x and ~1.26.x respectively in late 2024, making these version numbers implausible. This would cause npm install to fail. [CRITICAL]
  • No reverse proxy configured: The next.config.ts has no rewrites to proxy PostHog requests through the app's domain, making client-side events susceptible to ad blockers. [MEDIUM]
  • No identify() call: No user identification is set up anywhere. While this todo app has no auth system, the integration should at minimum prepare for identify or document its absence. [MEDIUM]

File changes

Filename Score Description
instrumentation-client.ts 4/5 Client-side PostHog init with env validation; uses older defaults: '2026-01-30' instead of latest '2026-05-30'
instrumentation.ts 3/5 Server-side OTLP log setup with likely invalid package versions
global-error.tsx 5/5 Proper error boundary with posthog.captureException()
components/todos/todo-list.tsx 5/5 Clean event capture in event handlers with enriched properties
app/api/todos/route.ts 4/5 Server-side log mutations using after() for non-blocking flush
app/api/todos/[id]/route.ts 4/5 Server-side log mutations for update and delete operations
package.json 2/5 posthog-js added correctly, but OpenTelemetry versions are likely invalid
.env.example 5/5 Environment variables properly documented

App sanity check ⚠️

Criteria Result Description
App builds and runs No OpenTelemetry package versions (^0.222.0, ^2.11.0) are almost certainly non-existent, causing npm install to fail
Preserves existing env vars & configs Yes Existing code and configs are untouched; only additions made
No syntax or type errors Yes All TypeScript syntax is valid
Correct imports/exports Yes All imports resolve correctly (posthog-js, next/server, instrumentation exports)
Minimal, focused changes Yes All changes relate directly to PostHog integration
Pre-existing issues None Base app appears well-structured

Issues

  • Hallucinated OpenTelemetry versions: @opentelemetry/sdk-logs@^0.222.0, @opentelemetry/api-logs@^0.222.0, @opentelemetry/exporter-logs-otlp-http@^0.222.0, and @opentelemetry/resources@^2.11.0 are almost certainly non-existent versions. These packages were in the 0.5x.x and 1.2x.x ranges respectively. Fix: use the actual latest versions from npm. [CRITICAL]
  • Outdated defaults date: defaults: '2026-01-30' in instrumentation-client.ts should be '2026-05-30' to use the latest recommended configuration defaults. [LOW]

Other completed criteria

  • Environment variables documented in .env.example
  • Build configuration structure (package.json scripts) is valid apart from version issue
  • Existing app functionality preserved — API routes still work, only PostHog logging added after response

PostHog implementation ⚠️

Criteria Result Description
PostHog SDKs installed Yes posthog-js@^1.434.12 added to dependencies
PostHog client initialized Yes posthog.init() in instrumentation-client.ts with env-based token and host, following Next.js docs pattern
capture() Yes Three meaningful client-side captures: todo_created, todo_completion_changed, todo_deleted
identify() No No identify() call anywhere in the app. No reset() on logout either.
Error tracking Yes global-error.tsx with posthog.captureException(error) and capture_exceptions: true in init config
Reverse proxy No No rewrites in next.config.ts to proxy PostHog requests

Issues

  • No reverse proxy: Next.js rewrites should be configured in next.config.ts to proxy /ingest/* requests to PostHog, preventing ad blockers from intercepting events. See the Next.js proxy docs. [MEDIUM]
  • No user identification: No posthog.identify() or posthog.reset() calls. Even without a current auth system, the todo app should prepare for future user identification or at minimum document the gap. [MEDIUM]

Other completed criteria

  • API key loaded from NEXT_PUBLIC_POSTHOG_PROJECT_TOKEN environment variable (not hardcoded)
  • API host loaded from NEXT_PUBLIC_POSTHOG_HOST environment variable
  • Initialization follows the recommended instrumentation-client.ts pattern from PostHog's Next.js docs
  • Server-side OTLP logging approach is functional (if dependencies install correctly)

PostHog insights and events ✅

Filename PostHog events Description
components/todos/todo-list.tsx todo_created, todo_completion_changed, todo_deleted Client-side captures for all todo CRUD operations with enriched properties
app/global-error.tsx captureException Client-side error boundary capturing unhandled exceptions
instrumentation-client.ts capture_exceptions: true Automatic exception autocapture enabled
instrumentation.ts OTLP log: Todo API mutation completed Server-side structured logs for todo mutations (created/updated/deleted)

Issues

  • No issues with event quality.

Other completed criteria

  • Events represent real user actions (creating, completing, deleting todos)
  • Events enable product insights — can build todo creation funnel, completion rates, deletion patterns
  • Events include relevant properties (has_description, initial_completed, completed status)
  • No PII in event properties
  • Event names follow consistent snake_case convention and are descriptive

Reviewed by wizard workbench PR evaluator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants