0
Fork 0
mirror of https://github.com/TanStack/ai.git synced 2026-11-16 19:38:41 +00:00
Commit graph

5 commits

Author SHA1 Message Date
Alem Tuzlak
032881c712
fix(ci): run the AI review script with node instead of tsx (#1712)
tsx resolves fast-json-patch's CJS main to the index.ts it ships, which
imports ./src/core that the package does not publish. Every AI review
run crashed before it started. Run the script with Node's built-in type
stripping and drop the one parameter property it cannot strip.
2026-10-12 13:48:43 +02:00
Alem Tuzlak
342953704c
fix(ci): harden fork AI review (#1380)
* fix(ci): run AI review from base so fork label triggers get secrets

* fix(ci): document manual-only AI review triggers

* feat(ci): auto AI review via unprivileged signal plus workflow_run

* fix(ci): isolate automatic AI review

* docs(ci): clarify AI review security flow

* ci: apply automated fixes

* fix(ci): harden AI review workflow outputs

* fix(ci): validate generated patch paths

* ci: apply automated fixes

* fix(ci): block renamed lockfiles

* fix(ci): reject hidden patches and clear stale review labels

* fix(ci): clear readiness labels for unchanged drafts

* ci: apply automated fixes

* fix(ci): resolve fork PRs by head, drop pull_request_target

The base repo's /commits/{sha}/pulls returns [] for a fork head on the
live API, so every fork workflow_run failed to resolve. List open PRs by
head owner and branch instead.

Drop the ai-review label trigger, the only user of pull_request_target.
Maintainers keep /ai-review and workflow_dispatch. Add a repository_owner
guard and fail red on missing secrets.

Post a bot comment when the host check blocks a PR, fail red on a failed
git fetch, block review text that holds the sandbox key, keep the comment
after a stale read of our own polish push, name file type changes, and
match "HTTP 404:" so a PR number cannot look like a 404.

* fix(ci): give the review sandbox a per-run xAI key

The sandbox runs fork PR code with network access, so any key it holds
can be stolen. Stop passing the long-lived XAI_API_KEY into it.

The host now uses XAI_MANAGEMENT_KEY and XAI_TEAM_ID to mint one API key
per run through the xAI management API. The key expires 35 minutes later,
5 minutes after the job timeout, and the host deletes it when the run
ends. The management key stays on the host and is removed from the git
child env. The leak scan checks for the per-run key.

* Revert "fix(ci): give the review sandbox a per-run xAI key"

This reverts commit 70cd198eb8.

* chore(ci): trim dead AI review code and unrelated test hunks

Revert the ai-solid vitest hot flag and the sbx ps probe to main. They are not part of this fix.

Delete tools.ts, files.ts, and their tests. run.ts does not use them now.

Delete the label trigger helpers and the pull_request parse path. No workflow sends these events now.

Match 'HTTP 404:' in the stale-label delete loop, as secure.ts and labels.ts do. Add a test for a non-404 error.

Remove the proceed output from ai-review.yml. It was always true.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Tom Beckenham <34339192+tombeckenham@users.noreply.github.com>
2026-10-08 15:38:02 +02:00
Alem Tuzlak
09bf8608ae
feat(ci): start AI review from label and approve waiting checks (#1280)
* feat(ci): start AI review when the ai-review label is added

* feat(ci): mark ready PRs secure and approve waiting workflows

* feat(ci): print Grok review output in the Actions log

* feat(ci): print each Grok review stream chunk in the Actions log

* feat(ci): log review text, reasoning, and tool I/O

* fix(ci): require a maintainer to trigger label review and fail closed on workflow changes
2026-08-31 21:54:00 +00:00
Alem Tuzlak
515b9b2626
fix(ci): review PRs with grokBuildText grok-4.6 (#1279)
* fix(ci): review PRs with grokBuildText instead of grokText

* fix(ci): use grok-4.6 with grokBuildText for PR review

* fix(ci): install Grok CLI in the review sandbox setup
2026-08-31 14:45:38 +00:00
Alem Tuzlak
01f4ac7dff
ci: add in-process Grok PR review bot (#1277)
* ci: add in-process Grok PR review bot

Review open PRs with grok-4.6, comment, label, and optionally push listed polish.

* ci: simplify Grok PR review bot

Use chat() outputSchema for the verdict, import @tanstack/ai and @tanstack/ai-grok directly, and drop copied skills.

* ci: harden Grok PR review bot against injection and path escape

* ci: stop nested nx inside test:ai-review
2026-08-31 08:40:25 -05:00