Roll up collection pipeline through PR 52#52
Draft
giaphutran12 wants to merge 31 commits into
Draft
Conversation
Introduces the "Clear & Populate" flow: an AI agent (Claude Sonnet 4.6 via OpenRouter) searches the web using TinyFish APIs, fetches page content, and inserts real data into datasets row by row. Backend: - Mastra populate workflow (clear rows → build prompt → run agent) - Populate agent with 7 tools: 5 database CRUD (insert, list, get, update, delete) + 2 web (search_web via TinyFish Search API, fetch_page via TinyFish Fetch API) - All tools return structured errors so the agent can self-correct - Data keys are sanitized to strip stray quotes/backticks from LLM output - Fetch responses capped at 15K chars to protect agent context window - Convex client uses anyApi to avoid cross-project imports in Docker - POST /populate route with Clerk JWT auth Frontend: - "Clear & Populate" button on dataset detail page - API client function in lib/backend.ts - Rows appear in realtime via Convex reactive queries Convex: - New internal functions: datasetRows.get (query) and datasetRows.remove (mutation) for single-row read/delete Infra: - TINYFISH_API_KEY wired through docker-compose.dev.yml to backend and mastra services Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Enforce dataset ownership on POST /populate by querying Convex for the dataset and comparing ownerId to req.auth.userId before running the workflow (fixes authz gap) - Remove raw row payloads from insert_row/update_row logs, log column count instead to avoid PII leakage - Add 30s AbortController timeouts to both TinyFish fetch calls in web-tools.ts so they can't hang indefinitely - Align PopulateResult type (rows → result) to match actual backend response shape Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convex query for dataset lookup can throw on invalid IDs — wrapping it in the existing try/catch ensures controlled 400 responses instead of unhandled 500s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
This is the stable base PR for the collection stack through PR #52. It keeps the head branch
codex/collection-official-website-sourcesintact so Mengzhe can keep working from that branch.Includes the collection/source-evidence stack up to the URL-field source evidence fix. Later self-healing, process-trace, browser-action, Playwright draft, and demo-path work is intentionally kept out of this PR.
Why this PR exists
Mengzhe is working from
codex/collection-official-website-sources. This PR makes that branch reviewable againstmainwithout rewriting or force-pushing the branch he based work on.Evidence from original stacked PR
official_website,company_website,careers_page_url,product_url, anddocs_urlcount as source evidence.make verify-self-healing, benchmark tests,node --check, andgit diff --check.Notes
No force-push. No raw benchmark artifacts committed. No auto-merge.