Skip to content

Factory: let cloud stations run node/npm on the bot's own factory PRs - #157

Draft
ShuhaoZQGG wants to merge 1 commit into
devfrom
chore/factory-trust-bot-prs
Draft

ShuhaoZQGG wants to merge 1 commit into
devfrom
chore/factory-trust-bot-prs

Conversation

@ShuhaoZQGG

Copy link
Copy Markdown
Contributor

No issue: this fixes the factory after the #80 build failed. The same change goes to dev and master (two PRs), because the Claude action skips a workflow whose file differs from the default branch's copy.

Why

On 2026-11-12, claude-code-action shipped anthropics/claude-code-action#2001: on a PR whose author doesn't have write access, it denies code-running commands (node, npm, npx, vitest, python and more), even when claude_args allows them. It counts bots as untrusted. Factory PRs are opened by the Claude bot (app/claude opened #138, #139 and #143), so the #80 build (run 43660639722) had every node/npm command denied and stopped before doing anything. The log says: "The author of pull request #143 is not confirmed to have write access, so commands that run code from the checkout are denied." The last good cloud build (#107, Nov 11) ran on the action version just before this change.

What changes

restrict_untrusted_prs: "false" on the Claude step of factory-build.yml and factory-plan.yml (the plan station's "a factory PR closed" trigger is also a PR event with a bot author), with a comment explaining why.

Security

This turns off a default guard for these two workflows only. The trust check stays where it already was:

  • The gate. state.mjs only returns next: build (or picks an issue to plan) when the human gate label (plan:approved / factory:ready) was last added by an actor in .factory/config.json.
  • Forks. The build job only runs for factory/ head branches, and pull requests from forks get no secrets.
  • The guard added little here. The workflow's own Install step already runs npm ci on the PR's code before the Claude step.

Production impact

None for users: CI workflow files only. Merging the master PR may start a production Workers build, which redeploys the same application code.

Testing

  • YAML parses; restrict_untrusted_prs reads as 'false' in both files.
  • The two branches' copies of both workflow files are byte-identical.
  • npm test / npm run test:e2e / npm run test:specs: not run locally (no app code changed). CI runs on this PR.
  • The real test is the next labelled factory build after both merge.

Evidence (real Zoom client)

n/a: no Zoom-client spec covers these files.

Not verified

Look here first

  • The restrict_untrusted_prs lines and their comment in both workflow files.

… PRs

claude-code-action 3fd0895 (2026-11-12, anthropics/claude-code-action#2001)
denies code-running commands on PRs whose author lacks write access, and
counts bots as untrusted. Factory PRs are opened by the Claude bot, so the
#80 build (run 43660639722) had node, npm and vitest denied and stopped
before doing anything.

Set restrict_untrusted_prs: "false" on the plan and build stations. Their
trust check is the gate: state.mjs only lets a station run after a factory
actor opened the human gate, and fork PRs get no secrets. Both files stay
identical on dev and master.

This branch has not been deployed

No deployments
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