# Refactor Log — Instrumentation + Sentry Logging (Plan 10) **Date:** 2026-05-06 **Spec:** docs/superpowers/specs/2026-05-06-instrumentation-sentry-design.md **Plan:** docs/superpowers/plans/2026-05-06-plan-10-instrumentation-sentry.md **Branch:** feature/instrumentation-sentry ## Tasks - [x] Task 1 — Scaffold refactor log + ADR-014 stub - [x] Task 2 — Tracer interface + ISpan + AttributeValue + SpanOpts - [x] Task 3 — NoopTracer - [x] Task 4 — Logger interface + NoopLogger + Breadcrumb + CaptureContext - [x] Task 5 — withSpan helper - [x] Task 6 — Symbols + index barrel - [x] Task 7 — SentryTracer adapter - [x] Task 8 — SentryLogger adapter (with double-report guard) - [x] Task 9 — pii-fields constants + scrub.beforeSend / scrub.beforeSendTransaction - [x] Task 10 — init-server helper - [x] Task 11 — init-client helper (browser-only) - [x] Task 12 — bindNoopInstrumentation + bindSentryInstrumentation - [x] Task 13 — apps/web-next bindAll() Rule 0 dispatcher - [x] Task 14 — Tests for bindAll() orthogonality (R47) - [x] Task 15 — RecordingTracer in core-testing - [x] Task 16 — RecordingLogger in core-testing - [x] Task 17 — vitest.setup.ts binds Noop by default - [x] Task 18 — Blog feature wiring (pilot) - [x] Task 19 — Auth feature wiring - [x] Task 20 — Marketing-pages feature wiring - [x] Task 21 — Navigation feature wiring - [x] Task 22 — Media feature wiring - [x] Task 23 — defineContractSuite expectSpan helper - [x] Task 24 — Update repo contract suites to assert span shape - [x] Task 25 — apps/web-next instrumentation files + scrubber test - [x] Task 26 — apps/cms instrumentation files + scrubber test - [x] Task 27 — apps/web-tanstack instrumentation files + scrubber test - [x] Task 28 — ESLint boundary rule (R40) + CI grep gate (R31) - [x] Task 29 — turbo.json globalEnv updates - [x] Task 30 — Doc updates (CLAUDE.md, AGENTS.md, vertical-feature-spec.md) - [x] Task 31 — Doc updates (tdd-workflow.md, testing-strategy.md, dependency-flow.md, core-shared/AGENTS.md) - [x] Task 32 — HTML updates (data-flow-explainer §06, di-explainer §08) - [x] Task 33 — ADR-014 final + refactor log final ## Decisions deviated from spec - **PII key-substring list extended (Task 25).** Added `"ipaddress"` to `PII_KEY_SUBSTRINGS` so keys like `ipAddress` trigger full key-level redaction in addition to the existing IPv4/IPv6 string-pattern redaction. The plan's R38 PII-scrubber test expected `result.extra.ipAddress === "[redacted]"`, which the original substring list (without "ipaddress") could not satisfy. Tighter posture than the spec; existing scrub.test.ts continues to pass. - **vertical-feature-spec.md numbering (Task 30).** The plan instructed to add the instrumentation section as "§10". The spec already had 15 sections, so the section was appended as **§16** (rather than renumbering §10–§15) to avoid invalidating every cross-reference in the spec. - **Web-tanstack `vite.config.ts` modifications skipped (Task 27, Step 6).** The app is a placeholder — its `package.json` has `"build": "echo 'placeholder — TanStack Start build configured in later plan'"` and there's no `vite.config.ts`. The `@sentry/vite-plugin` dep is installed but dormant; it will be wired into the build when TanStack Start build is configured. A minimal `src/vite-env.d.ts` shims `ImportMetaEnv` for the client entry's `import.meta.env` reads. - **data-flow-explainer.html section numbering (Task 32).** The plan asked to renumber the verdict from §06 to §07 and slot the new tracing section in as §06 — done. The `