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.
* 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>
* 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
* 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