Skip to content

feat(action): require the Anthropic API key - #108

Merged
lucasbraum merged 2 commits into
mainfrom
claude/relaxed-knuth-dqw3xd
Oct 13, 2026
Merged

lucasbraum merged 2 commits into
mainfrom
claude/relaxed-knuth-dqw3xd

Conversation

@lucasbraum

Copy link
Copy Markdown
Collaborator

UPT-19

What and why

Product decision: Uptide without the LLM gives worse results, and no run is better than a poor one. So the Action now requires the Anthropic key.

  • Action (packages/core/src/action/run.ts, scripts/action.ts, action.yml, scripts/action-setup.sh): anthropic-api-key is checked first, in every mode (and for an invalid mode). If it is missing, empty or only whitespace, the run doesn't build the engine, read uptide.yml, list, check, fix or ask for a push token. It writes a job summary that says exactly what to add and where (Settings → Secrets and variables → Actions → ANTHROPIC_API_KEY, passed as anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}). It posts a report with no upgrades and an error that starts with LLM_KEY_MISSING, then exits non-zero. With a key, fix always runs assisted (--llm); --no-llm is gone from the Action.
  • uptide.run/v1: adds an optional top-level llmKey: "present" | "missing". It is never the key or any part of it. Old reports still validate. schema/uptide.run.v1.json is regenerated.
  • uptide.yml: the generator no longer writes llm.enabled, always passes the secret in the workflow, and drops "Turn the LLM off" from the "Add Uptide" PR body. The schema still accepts enabled so old files load. The Action rejects false with a message saying to remove it. uptide init / onboarding refuses an existing file that sets false (new refusal reason llm-disabled). A provider other than anthropic is also an error in the Action now, instead of a silent rule-based run.
  • CLI: no change for local use. uptide check and uptide fix still run without a key, and llm.enabled / --no-llm still work locally. Only the uptide init "Next" text changed.
  • Docs: docs/ci.md has a new "The Anthropic key is required" section and documents llmKey. docs/config.md and docs/commands/init.md no longer mention llm.enabled.

How it was verified

  • New tests in run.test.ts:
    • without a key, in each of list, check, fix and an invalid mode, and for an undefined, empty or whitespace key: no engine call, no token, no publish, no upgrades, llmKey: missing, LLM_KEY_MISSING, a safe report, and a summary with the Settings path;
    • with a key: llmKey: present, and no part of the key appears in the report;
    • llm.enabled: false is rejected before anything runs;
    • a non-Anthropic provider is rejected;
    • fix is always --llm, with the key passed to fix alone.
  • report.test.ts: llmKey is validated and optional, and the missing-key summary is rendered.
  • generate.test.ts and init.test.ts: the workflow always passes the key, uptide.yml has no enabled, an existing enabled: false is refused, and enabled: true still generates. Golden files are updated.
  • The existing CLI test that uptide fix honours llm.enabled: false locally still passes.
  • pnpm lint && pnpm typecheck && pnpm test pass: core 1383 passed / 32 skipped, CLI 434 passed. The one lint warning is also on main.

Checklist

  • Tests for the change
  • pnpm lint && pnpm typecheck && pnpm test pass
  • README and docs updated if behavior changed
  • Changeset added (.changeset/anthropic-key-required.md, minor)
  • No new dependency
  • No private code, names or paths in fixtures, tests or docs
  • The rules in CONTRIBUTING.md still hold

🤖 Generated with Claude Code

https://claude.ai/code/session_01RkdTEYv6CbvC97qNzAMyBz


Generated by Claude Code

The Action checks anthropic-api-key before anything else, in every mode.
Missing or empty: no engine build, no config read, no list/check/fix, no
push token. The job summary says to add the ANTHROPIC_API_KEY secret
(Settings → Secrets and variables → Actions), the report carries no
upgrades and an error starting with LLM_KEY_MISSING, and the job fails.

uptide.run/v1 gains an optional top-level llmKey: present | missing,
never the key. uptide init no longer writes llm.enabled and refuses an
existing uptide.yml that sets it to false; the schema still accepts the
field, and the Action rejects false with a clear message. The local CLI
is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RkdTEYv6CbvC97qNzAMyBz
Signed-off-by: Claude <[email protected]>
Keeps main's commit identity for engine runs and passes the required key
to uptide fix alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RkdTEYv6CbvC97qNzAMyBz
Signed-off-by: Claude <[email protected]>
@lucasbraum
lucasbraum merged commit 38dcd4b into main Oct 13, 2026
10 checks passed
@lucasbraum
lucasbraum deleted the claude/relaxed-knuth-dqw3xd branch October 13, 2026 18:30
@uptide-release uptide-release Bot mentioned this pull request Oct 13, 2026
lucasbraum pushed a commit that referenced this pull request Oct 13, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## [email protected]

### Minor Changes

- [#108](#108)
[`38dcd4b`](38dcd4b)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - The Uptide Action
now requires the Anthropic API key. Without `anthropic-api-key` (or with
it
empty), in any mode, it stops before doing anything: the job summary
says to add the
repository secret `ANTHROPIC_API_KEY` (Settings → Secrets and variables
→ Actions), the run
report has no upgrades and an error starting with `LLM_KEY_MISSING`, and
the job fails.
`uptide.run/v1` gains `llmKey` (`present` or `missing`; never the key).
`uptide init` no longer
writes `llm.enabled`, and refuses an existing `uptide.yml` that sets it
to `false`, which the
  Action rejects. The CLI on your own machine still runs without a key.

- [#101](#101)
[`8452329`](8452329)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `list`, `check`,
`fix`, `plan` and the Action never target a release younger than the
repository's release-age policy: npm `min-release-age` (`.npmrc`), pnpm
`minimumReleaseAge`
with `minimumReleaseAgeExclude` (`pnpm-workspace.yaml`), or Yarn
`npmMinimalAgeGate` with
`npmPreapprovedPackages` (`.yarnrc.yml`). When none is set, the default
of the pinned package
manager version applies (pnpm 11 and 12, Yarn 4.15 and later: one day),
labelled as such.
When the newest release is too young, the newest one old enough is the
target and the output
says why (`4.6.7 is 2 days old; your policy is 7 days (min-release-age
in .npmrc); targeting
4.6.5`). When nothing newer than the installed version qualifies, the
package is skipped with
that reason, shown as `status: skipped` in `uptide.run/v1` and in the
HTML list report.
Companions and peers follow the same policy. `minReleaseAgeDays` in
`uptide.yml` applies when
the repository sets no policy itself. See `docs/config.md#release-age`.

### Patch Changes

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - The Action's
commits are authored by the Uptide App's own bot account,
`<app slug>[bot] <<bot user id>+<app
slug>[bot]@users.noreply.github.com>`, resolved with the
installation token, so GitHub links them to the App. When it cannot be
resolved they keep
  `uptide[bot] <[email protected]>` and the job log warns.

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `uptide.run/v1`
gains `verification.baselineHealth`: the repository before the upgrade
in
counts only (type errors, failing test runs, and missing-module errors
under its own paths and
in packages), so the dashboard can tell a run that could only compare
from one that proved.
No module or alias name leaves the fix report. Optional; absent in older
reports.

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `check` analyzes
a package's companions at the versions its upgrade moves them to, even
when
nothing imports them or they only carry types: `check react` in a Next
app used to report
`react-dom` and `@types/react` on their own at their installed versions,
while `react` moved
to 19. They are now members of `react`'s group, linked into the compile
at 19, and the
  Action's job summary shows each one moving with `react`.

- [#102](#102)
[`78f1f7a`](78f1f7a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `uptide init`
writes a workflow that runs the released Uptide Action,
`uptide-dev/uptide@2045c7d # v0.9.0`,
and no longer notes that the action is not released yet.

- [#100](#100)
[`53f9f7d`](53f9f7d)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `fix` reads pnpm
lockfiles that install a package once per version of the upgraded one
(`x@1([email protected])` next to `x@1([email protected])`) instead of failing with
"Map keys must be unique". Variants that differ only by that version are
compared as one entry; variants that differ in anything else are still
checked one by one.

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - When Uptide
refuses to publish a migration that did not verify, it words the reason
as the
run's verdict does: `1 type error introduced by the upgrade, 2
pre-existing` instead of
`1 new type error`, and a test run that was already failing before the
upgrade is named as
  such instead of as a failure of the migration.

- [#104](#104)
[`8fd120e`](8fd120e)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Reports no longer
show a breaking count of 0 for a package without a migration pack: the
terminal, the HTML report and the Action's job summary say `not
analyzed: no pack yet`
instead, and `uptide.run/v1` gains `analysis` (`pack` or `none`, absent
when nothing was
analyzed). A companion that `check` reports at its installed version
(`react-dom` or
`@types/react` with `react`) shows the versions it moves to and `moves
with react`, carried as
`movesWith`, instead of `up to date`; no upgrade kind is printed when
nothing moves. The job
summary lists breaking sites per package by path and line, and has no
breaking-sites section
when there are none. The generated workflow runs on `ubuntu-24.04`
instead of `ubuntu-latest`.

- [#107](#107)
[`008f84a`](008f84a)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Reports say what
the upgrade broke and what the migration left. `uptide.run/v1` gains
`verification.typecheck.afterUpgrade`, the type errors right after the
version bump and before
any fix, next to `before` and `after` (optional; absent in older
reports). The job summary
prints `types 0 → 4 with the upgrade → 0 after Uptide`, and the pull
request body and the
  terminal say `the upgrade broke 4 · Uptide left 0`.

Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
lucasbraum added a commit that referenced this pull request Oct 13, 2026
…109)

UPT-19

## What and why

uptide-test/saas-starter-kit PR #3 bumped `next` 15.5.14 → 16.4.0 with
no pack and no migration. The type-check passed, so it opened as if
verified. Next 16 changes the build config, removes `next lint` and
enforces async request APIs, and next-i18next 15 does not support it.
Product rule: Uptide never opens a PR for an upgrade it could not
analyze.

The policy is in one place, `fix/no-pack.ts`, and every path reads it:

1. **A major upgrade with no verified pack never becomes a PR.**
- `publicationBlockers`, the gate behind `fix --pr`, `uptide pr` and the
Action, refuses it.
- `fix --pr` refuses before migrating anything. That includes the CLI's
clone-then-publish path (new `forPublication` option), so no agent
budget is spent.
- The Action skips it before running `fix` and reports `status:
"skipped"`, `analysis: "none"`, `error: "no pack yet"`, whatever the
slots or budget. A post-run guard covers the case where discovery and
the engine disagree.
- "Major" means a new major, or a new minor below 1.0.0 (0.4 → 0.5),
since semver treats those as breaking.
2. **A minor or patch with no pack needs the repo's own build and
tests.**
- `fix` now runs the repo's `build` script after the bump for no-pack
runs: the workspace's script, else the root's. It is recorded in
`verification.build`.
   - A failing build fails verification.
- With no build script, no tests that ran, or tests that already failed
before the bump, no PR opens and the reason says which. The Action
reports this as `skipped` / `analysis: "none"`.
3. **The PR body always says what verified it.** A new **Verified by**
row covers the pack, type-check, build and tests.
- A no-pack run shows each check as passed, failed or not run, e.g. `⚠️
no migration pack: nothing analyzed what next 16.4.0 changes · ✅
type-check · ⚠️ build not run: no build script · ⚠️ tests not run: none
ran`.
- A pack-covered run shows `build not required (pack-verified
migration)` with no warning. The warning is only for no-pack runs, where
the build is required.
   - The build command and its result go in the verification details.
- A no-pack run is never Low risk any more. Before, a bump-only run with
green tests got "types and tests verified".
   - "Ready for review" now requires that the run is publishable.

## How it was verified

- PR #3 reproduced (major, no pack, clean type-check), each asserting
that no PR opens:
- `action/run.test.ts`: no `fix` call, nothing published, the row is
skipped / `none` / `no pack yet`, and the summary renders it. Also
covers the post-run guard.
- `fix/generic.test.ts`: `--pr` refuses before any change. Without
`--pr`, verification passes but `publicationBlockers` and
`publishVerified` refuse.
- `fix/isolate.test.ts`: the CLI `--pr` path refuses before the agent is
called. This test fails without the `forPublication` pass-through.
- Minor with no pack: opens when build and tests pass, is refused with
no build script or no tests, and fails when the build fails
(`generic.test.ts`, `action/run.test.ts`).
- `no-pack.test.ts` and `build.test.ts` cover the new modules.
- Report snapshots and expectations are updated for the new row, the
pack-covered build wording, and the risk change.
- Merged with `main` (#103, #107, #108). The conflicts in `publish.ts`
and `run-report/build.ts` were independent additions, and both sides are
kept.
- `pnpm lint && pnpm typecheck && pnpm test` pass after the merge: core
1410, CLI 434. The one lint warning (an unused import in
`report.test.ts`) is already on `main`.

## Checklist

- [x] Tests for the change (a bug fix starts with a failing test)
- [x] `pnpm lint && pnpm typecheck && pnpm test` pass
- [x] README and docs updated if behavior changed (`docs/ci.md`,
`docs/commands/fix.md`, `docs/concepts.md`, `docs/faq.md`)
- [x] Changeset added if a user would notice
- [x] No new dependency, or it was agreed in an issue
- [x] No private code, names or paths in fixtures, tests or docs
- [x] The rules in CONTRIBUTING.md ("Rules that do not bend") still hold

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01BVrNCZBUt1KvChzeqDo7dd

---------

Signed-off-by: Claude <[email protected]>
Co-authored-by: Claude <[email protected]>
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