Skip to content

Load self-healing cron context by dataset id#36

Draft
giaphutran12 wants to merge 1 commit into
codex/mastra-self-healing-cronfrom
codex/mastra-self-healing-dataset-id
Draft

Load self-healing cron context by dataset id#36
giaphutran12 wants to merge 1 commit into
codex/mastra-self-healing-cronfrom
codex/mastra-self-healing-dataset-id

Conversation

@giaphutran12
Copy link
Copy Markdown
Collaborator

@giaphutran12 giaphutran12 commented May 22, 2026

Summary

  • add --dataset-id to the self-healing populate CLI so cron/operator jobs can load live dataset context instead of relying on pasted JSON
  • add internal Convex query datasets.getForSystemPopulate for system-level populate context loading
  • add backend ConvexPopulateDatasetContextLoader with lazy import so old --context/--stdin dry-runs still do not require Convex env
  • tighten CLI parser to reject mixed context sources in any order
  • keep dry-run isolated in-memory; --dataset-id --commit uses durable store + writer after context load

Verification

  • npm --prefix backend test: 47/47 pass
  • npm --prefix backend run build: pass
  • node --check benchmarks/dataset-agent/adapters/mastra-populate-adapter.mjs: pass
  • npm --silent --prefix backend run populate:self-heal -- --dataset-id dataset-ai-posts: emits one JSON missing Convex/OpenRouter/TinyFish keys and exits 1
  • npm --silent --prefix backend run populate:self-heal -- --stdin: emits one JSON missing OpenRouter/TinyFish only and exits 1
  • npm --silent --prefix backend run populate:self-heal -- --stdin --context context.json: rejects mixed context sources before context read

Review Notes

  • critic rejected the first plan until dataset-id mode had exact-one source parsing and mode-aware Convex preflight; covered with tests
  • code reviewer flagged live Convex verification gap: make convex-push is currently blocked locally because Docker daemon is not running and ignored env files are absent in this worktree/main checkout
  • direct frontend Convex diagnostics remain noisy because frontend/convex/_generated is missing; backend tests cover loader call shape and CLI behavior

Notes

@giaphutran12 giaphutran12 self-assigned this May 22, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a40e0b5-129e-4c7a-bc12-6450d168c7cf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/mastra-self-healing-dataset-id

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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