Files
worktrunk/.github/AGENTS.md
45d9b4e842 Run Worktrunk Tend workflows with Codex on gpt-6-sol (#4240)
Switch Worktrunk's Tend agent workflows to Codex on `gpt-6-sol`,
generated with Tend 0.3.14. Mackup's existing account rotator owns
subscription refresh (`codex.auth_refresh: false`) and publishes
access-only `CODEX_AUTH_JSON` plus `CODEX_ACCOUNT`. This removes the
proposed hosted refresh workflow and its separate login/PAT requirement.
The unused hosted-refresh PAT secret has been removed.

Validation: `actionlint` and the complete branch whitespace check pass.
An independent code review found no issues. GitHub CI, including
Codecov, passes at `8e842331aa0f29949579050551dd2d0b67fb04b1`, and
worktrunk-bot approved that exact commit. A real Codex 0.160.0 request
to `gpt-6-sol` succeeded with an access-only credential derived from a
saved login selected by Mackup's allocator. All 5,388 Rust tests passed
(one skipped), along with documentation checks and the final full
pre-commit run.

Cutover requires maintainer merge authorization. Mackup reads ownership
from the default branch and the `tend` environment admits only main, so
credential publication and a hosted Codex run follow the merge. After
landing, run the allocator, verify the published account and secret
timestamp, rerun `tend check`, and validate a hosted agent run; retry
any agent job that starts before publication. Current `tend check`
passes every check except the missing Codex consumer credential. This
supersedes the earlier dedicated-login premerge condition; hosted
operation is not yet validated.

> _This was written by Codex on behalf of max-sixty_

---------

Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
2026-10-21 10:19:04 -07:00

2.6 KiB

Worktrunk CI automation

The generic security model is in https://github.com/max-sixty/tend/blob/main/docs/security-model.md. This file records the Worktrunk-specific boundaries; verify current GitHub settings before changing them.

Bot identity

worktrunk-bot is a PAT-backed GitHub user with write access. Only the repo owner can merge to main. The Merge access and Tag operations rulesets enforce those limits; required checks are test (linux), test (macos), test (windows), and fast-checks.

Tokens and environments

  • tend admits main and holds CODEX_AUTH_JSON and TEND_BOT_TOKEN for concurrent agent jobs.
  • release admits tags and holds AUR_SSH_PRIVATE_KEY, TEND_BOT_TOKEN, and SIGNPATH_API_TOKEN; it also gates packslip signing and crates.io Trusted Publishing through OIDC.
  • github-pages admits main and uses OIDC without a stored secret.
  • CODECOV_TOKEN is a repo secret allowlisted for coverage upload.

A job naming an environment can reference all its secrets through the secrets context; pass each secret only to the step that needs it. Signing and publishing share release because their ref gates are the same. The branch and tag policies are security gates: do not broaden them to make a workflow run. Tag environments admit every tag because the Tag operations ruleset controls creation and movement. tend and release each hold TEND_BOT_TOKEN because their admitted refs differ.

Generated tend agent workflows use environment {name: tend, deployment: false}. The deployment flag prevents pull_request_target runs from creating misleading deployment records on PRs. Edit the generator or its config, not generated tend-*.yaml files.

Codex subscription refresh is external (codex.auth_refresh: false). Mackup's account rotator owns the refreshable logins and publishes access-only CODEX_AUTH_JSON with the CODEX_ACCOUNT environment variable. Refresh tokens stay on the rotator's host.

Sandbox toolchain

Tend agents run in a copy-on-write view of the runner checkout and home. The tend-setup action installs the gate's tools; the following setup step checks their presence. Keep the probe when changing setup. A binary on PATH does not guarantee its service is reachable: Nix currently cannot connect to its daemon from the sandbox, so a flake.lock refresh needs a different execution path.

Build environment

Swatinem/rust-cache hashes the CARGO* and RUST* variables visible at the cache step. Workflows sharing a cache must set the same variables before that step. A mismatch restores nothing without failing the job. Generated tend workflows currently build cold; measure restore cost before adding a separate cache scheme.