Skip to content

docs(ci): record the model credential as environment-scoped - #3760

Merged
max-sixty merged 1 commit into
mainfrom
tend-oauth-env
Aug 7, 2026
Merged

max-sixty merged 1 commit into
mainfrom
tend-oauth-env

Conversation

@max-sixty

@max-sixty max-sixty commented Aug 7, 2026 •

Copy link
Copy Markdown
Owner

Documents CLAUDE_CODE_OAUTH_TOKEN moving out of repo-level storage and into the tend environment — the last operational secret still sitting where any workflow the repo runs could read it, and the remaining repo-secret-allowlist failure after #3748. The environment copy is set; the repo-level copy is deleted once this PR's own tend-review run comes back green.

That run is the verification. An environment secret outranks a repo-level one of the same name, so a job naming environment: tend already reads the new value while both exist — which means the credential is exercised end to end before anything is removed, rather than after.

Nothing about who reads the token changes. All eight readers — triage, handle, fix-ci, nightly, review-runs, notifications, weekly, review — already declare environment: tend.

The lead sentence of "Environment protection" claimed environments hold "credentials that grant write access". That was never the set — the model credential grants no write access to anything in this repo, and it now lives in one. It states the set directly instead, with the reason CODECOV_TOKEN stays outside it.

The tend row's "Read by" cell also picks up semicolons. every tend-*.yaml job but relay, append-gist, both create-issue-on-*-failure jobs reads as one four-item exclusion list, which would say append-gist doesn't read the token — it does.

This was written by Claude Code on behalf of max-sixty

CLAUDE_CODE_OAUTH_TOKEN moves from repo level into the tend environment,
leaving CODECOV_TOKEN as the only repo-level secret. Every job that reads
the model credential already names environment: tend, so the readers are
unchanged.

The environment-protection lead said "credentials that grant write
access", which never described the set: the model credential grants no
repo write, and now sits in an environment. It states the set directly
instead.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing as a draft — flagging anything that looks worth a quick fix. Mark ready for a full review.

One note on the Read by cell the PR is rewriting for clarity: the semicolons fix the exclusion-list misreading, but the remaining ambiguity is scope. append-gist and create-issue-on-benchmark-failure live in benchmarks.yaml, create-issue-on-nightly-failure in nightly.yaml — none of them are tend-*.yaml jobs, and nothing in the cell says so, so a reader still has to grep to find out whether the leading every tend-*.yaml job clause was meant to cover them.

Comment thread .github/CLAUDE.md
| Environment | Admits | Secret | Read by |
|-------------|--------|--------|---------|
| `tend` | `main` | `TEND_BOT_TOKEN` | every `tend-*.yaml` job but `relay`, `append-gist`, both `create-issue-on-*-failure` jobs |
| `tend` | `main` | `CLAUDE_CODE_OAUTH_TOKEN`, `TEND_BOT_TOKEN` | every `tend-*.yaml` job except `relay`; `append-gist`; both `create-issue-on-*-failure` jobs |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `tend` | `main` | `CLAUDE_CODE_OAUTH_TOKEN`, `TEND_BOT_TOKEN` | every `tend-*.yaml` job except `relay`; `append-gist`; both `create-issue-on-*-failure` jobs |
| `tend` | `main` | `CLAUDE_CODE_OAUTH_TOKEN`, `TEND_BOT_TOKEN` | every `tend-*.yaml` job except `relay`; plus `append-gist` and `create-issue-on-benchmark-failure` in `benchmarks.yaml`, and `create-issue-on-nightly-failure` in `nightly.yaml` |

@max-sixty
max-sixty merged commit 5d4d0e8 into main Aug 7, 2026
43 checks passed
@max-sixty
max-sixty deleted the tend-oauth-env branch August 7, 2026 22:40
max-sixty pushed a commit that referenced this pull request Aug 7, 2026
Nightly sweep finding: the last paragraph of "Environment protection" in
`.github/CLAUDE.md` describes a gap that closed the same night it was
written.

#3748 added the paragraph saying the generated `tend-*.yaml` files
"still carry the bare `environment: tend`" and that `tend check`'s
`environment-deployments` "fails until a `uvx tend@latest init` regen
lands them on tend ≥ 0.1.14". #3749 merged 3 hours later and did exactly
that regen — every generated job now reads `{name: tend, deployment:
false}`, and tonight's `tend check` reports `environment-deployments` as
`PASS`. Left as-is, the file tells the next reader to expect a failure
that no longer happens and a regen that already ran.

The rewrite keeps the durable half — the generated files aren't
hand-edited, because `uvx tend@latest init` overwrites them — and states
the resolution instead of the pending action.

<details><summary>Evidence</summary>

Current state of the generated files (all eight are identical in shape):

```
$ grep -A2 'environment:' .github/workflows/tend-nightly.yaml
    environment:
      name: tend
      deployment: false
```

Tonight's `tend check`, run by the nightly sweep:

```
  PASS  environment-deployments — No job files a deployment for the 'tend' environment
```

The three checks still failing (`credential-environments`,
`claude-auth`, `repo-secret-allowlist`) are tracked in #3729 and are
repository-settings changes, unrelated to this file. #3760 edits the
same section but not these lines, so the two don't conflict.

</details>

No test accompanies this — it's a documentation-only change to a file no
test reads.

Co-authored-by: worktrunk-bot <[email protected]>

This branch was previously deployed

1 inactive deployment
tend — 42df677b Deployed Aug 7, 2026 by max-sixty via review #3739
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.

2 participants