Skip to content

Add privacy-safe AgentPond tracing for AI Insights#514

Open
marcusschiesser wants to merge 2 commits into
jimmykane:mainfrom
marcusschiesser:feat/agentpond-ai-insights
Open

Add privacy-safe AgentPond tracing for AI Insights#514
marcusschiesser wants to merge 2 commits into
jimmykane:mainfrom
marcusschiesser:feat/agentpond-ai-insights

Conversation

@marcusschiesser

@marcusschiesser marcusschiesser commented Jul 12, 2026

Copy link
Copy Markdown

Summary

  • initialize the existing default Firebase Admin app before an AgentPond OpenTelemetry exporter
  • preserve every existing Cloud Functions export through an ESM bootstrap
  • add OpenInference LLM spans for the sanitize, repair, location, and summarize stages of AI Insights
  • retain the existing Genkit spans on the same global provider
  • keep personal prompts, fitness data, locations, and generated narratives out of span attributes
  • retain the AgentPond skills installed by npx agentpond@0.5.2 init

Existing Storage Rules only grant client access below user-owned paths, leaving agentpond/** inaccessible to client SDKs.

Why AgentPond

AgentPond turns the multi-stage AI Insights pipeline into an inspectable trace stored in Quantified Self's own Firebase bucket. Maintainers can see whether failures or latency originate in language sanitization, query repair, location inference, or narrative summarization; compare model usage by stage; and investigate production behavior locally without exporting personal fitness content to a hosted tracing SaaS.

Verification

  • Functions lint completed with no errors
  • npm run build in functions/
  • targeted AI Insights suite: 53 tests passed
  • full Functions suite: 2,335 tests passed
  • loaded the compiled bootstrap and confirmed all 88 existing Functions exports
  • verified privacy-safe OpenInference span metadata with an in-memory exporter
  • git diff --check

A production Firebase Storage export was not attempted because the contributor environment does not have project bucket access.

@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: a668fdb1f6

ℹ️ 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 thread functions/bootstrap.mjs
Comment on lines +75 to +76
export const processSportsLibReparseTask = functions.processSportsLibReparseTask;
export const processSportsLibRouteReparseTask = functions.processSportsLibRouteReparseTask;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-export the heavy reparse functions

When the functions package now loads through bootstrap.mjs, Firebase can only discover the function names exported from this file. The two heavy reparse functions are still attached in index.ts via computed CommonJS exports[...], but this static bootstrap list skips processSportsLibReparseHeavyTask and retrySportsLibReparseHeavyJob; the former is the Cloud Tasks target and the latter is called by the admin queue UI, so deploying this entrypoint leaves those existing functions absent from the exported module. Please add both exports here or generate this list from the actual runtime exports.

Useful? React with 👍 / 👎.

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