feat(obs): Phase-0 oauth+approve trace wire (additive, un-deployed)#429
Draft
Victor "David" Medina (Victor-David-Medina) wants to merge 2 commits into
Draft
feat(obs): Phase-0 oauth+approve trace wire (additive, un-deployed)#429Victor "David" Medina (Victor-David-Medina) wants to merge 2 commits into
Victor "David" Medina (Victor-David-Medina) wants to merge 2 commits into
Conversation
Wire the Phase-0 OAUTH -> APPROVE trace into relaylaunch-console as a dependency-free, failure-isolated logger shim. NO new npm deps, NO package.json/lock change, NO migration, NO SDK/exporter registration. - lib/observability/phase0-trace.ts: dep-free shim. emit() records the Phase-0 span name + honesty attrs to the existing pino logger (@/lib/logger), internally try/catch so it can NEVER throw into the caller. Public phase0.* surface matches the spec stub so the deploy-time swap to @opentelemetry/api + Langfuse OTLP exporter happens at the SAME call-sites with no caller changes. - app/(auth)/auth/callback/route.ts: phase0.oauthConnect after the real verifyOtp/exchangeCodeForSession result (oauth.result success|error). - app/api/v1/actions/approve/route.ts: phase0.approve after the recovery_items approve update succeeds (email deep-link, mode='live'). - app/api/v1/action-map/briefs/[id]/approve/route.ts: phase0.approve after the recovery_opportunities update succeeds (in-app, mode='live'). ADDITIVE ONLY: every phase0.* call is a new standalone statement placed AFTER the real outcome is known; no existing logic changed/reordered/gated. Honesty attrs: approval.mode=live + oauth.result. Verified tsc --noEmit + eslint clean on all four touched files. DRAFT until first receipt. Contract: docs/specs/PHASE0-OTEL-TRACE-OAUTH-SEND-RECEIPT-2026-06-15.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Genericize the honesty-guard comment in lib/observability/phase0-trace.ts: the pilot business name is a banned token in changed-file PII scan (scripts/scan-pii-leaks.ps1). Replace it with "website/console payment" - same honesty point (measured recovered dollar is distinct from the website/console payment), no PII. Code behavior unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
🛡️ Cascade Quality Score: 100/100
Threshold: 85/100 | Result: PASS ✅ |
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.
What
The no-deploy-risk first wire of the Phase-0 OAUTH -> APPROVE trace into
relaylaunch-console. An additive, failure-isolated structured-logger shim — visible in runtime logs today, with the real@opentelemetry/apiSDK + Langfuse OTLP exporter swap documented as the deploy-time follow-up at the SAME call-sites.Contract:
docs/specs/PHASE0-OTEL-TRACE-OAUTH-SEND-RECEIPT-2026-06-15.md+phase0-trace.stub.ts.Changes (4 files, +109)
lib/observability/phase0-trace.ts(new) — dependency-free shim.emit()records the Phase-0 span name + honesty attrs to the existing pino logger (@/lib/logger), internallytry/catchso it can never throw into the caller. Publicphase0.{oauthConnect,approve,send,receipt}surface mirrors the spec stub, so the deploy-time swap to the OTel SDK + Langfuse OTLP exporter happens at the same call-sites with zero caller changes.app/(auth)/auth/callback/route.ts—phase0.oauthConnect({provider:'google', result: error?'error':'success'})after the realverifyOtp/exchangeCodeForSessionresult (the real login OAuth moment).app/api/v1/actions/approve/route.ts—phase0.approve(...)after therecovery_itemsapprove update succeeds (email deep-link, the HRC one-tap path).channel:'email',mode:'live'.app/api/v1/action-map/briefs/[id]/approve/route.ts—phase0.approve(...)after therecovery_opportunitiesupdate succeeds (in-app approve).mode:'live'.Honesty attrs
approval.mode=live(real one-tap approval, not a projected demo) +oauth.result(success|error). These are the guards that keep a demo from being mistaken for a real recovered dollar — and keep the $500 HRC website payment distinct from the first AI-recovered dollar.Guarantees
phase0.*call is a new standalone statement placed AFTER the real outcome is known. No existing logic changed, reordered, or gated.emit()is internallytry/catch; each call runs after the real auth/approve work, so even a throw could not abort it. Never awaited in a way that blocks a provider call.package.json/lock change, NO migration, NO SDK/exporter registration.Verification
tsc --noEmit— clean (EXIT 0) on the full project.eslint— clean (EXIT 0) on all four touched files.Status
DRAFT — do not merge, do not deploy. Merge AFTER the first attributed receipt lands (Phase-0 acceptance). The deploy-time follow-up (real OTel SDK + Langfuse OTLP exporter at these same call-sites) is documented in the shim header; confirm the Langfuse OTLP path via Context7 before that swap.
Generated with Claude Code by RelayLaunch