Skip to content

feat(action): the Uptide Action, its OIDC push token and the uptide.run/v1 report - #92

Merged
lucasbraum merged 5 commits into
mainfrom
claude/youthful-carson-1zfxfj
Oct 13, 2026
Merged

lucasbraum merged 5 commits into
mainfrom
claude/youthful-carson-1zfxfj

Conversation

@lucasbraum

Copy link
Copy Markdown
Collaborator

What and why

UPT-19. The workflow that uptide init and the "Add Uptide" PR generate runs uptide-dev/uptide, and this PR makes that the Uptide Action. UPTIDE_ACTION stays pinned and released: false, because a release cannot contain its own tag SHA. The follow-up pins v0.9.0.

action.yml (composite). Composite because the Action has to run exactly the engine of the pinned commit. A node20 action would need a bundle committed at every release tag, and this repo commits no build output; Version Packages commits would have to carry dist/.

  • Setup (scripts/action-setup.sh) checks for Node 20 or newer.
  • It installs the repo's pinned pnpm into $RUNNER_TEMP, never on PATH, so the customer's package manager and Node stay as their workflow set them up. The engine checks the PATH pnpm/yarn against the repo's pin.
  • It installs this commit's dependencies from its frozen lockfile with scripts off, and builds the engine without declarations (a few seconds).
  • No npm install of any other Uptide version.
Input Default What it is
config uptide.yml Settings file, relative to the repo root; defaults apply when it is absent
mode check list, check or fix
package (empty) One dependency; empty for every one uptide.yml allows
anthropic-api-key (empty) For assisted fixes; empty means rule-based only
app-url https://uptide-app.vercel.app Issues the push token, receives the report

Output: report, the path of the run's uptide.run/v1 JSON.

Auth.

  • The job's OIDC token (audience uptide, requested as core.getIDToken does, with no new dependency) goes to {app-url}/api/action/token as Authorization: Bearer <jwt>.
  • The { token, expiresAt } that comes back is masked with ::add-mask:: before anything else touches the response, even on a refusal. It is renewed when less than 5 minutes remain.
  • The token reaches one process only, uptide pr, which runs git and gh and nothing of the repository's code:
    • gh gets it through a private GH_CONFIG_DIR (mode 0600, removed afterwards);
    • git push gets it as an http.extraheader through GIT_CONFIG_*, never in argv, a URL or .git/config.
  • The Action reuses the engine's existing publish path: the verified-tree check, the body limit, updating an existing PR, drafts.
  • Error messages name what failed, never what was sent. app-url must be https.

Run.

  • list, then check (at most 10 dependencies per run) or fix (--agent sdk by default, or --no-llm when the key is missing or llm.enabled: false).
  • maxOpenPrs and maxCost apply across the whole run, and a package with an open Uptide PR is skipped.
  • The engine runs with every credential variable removed. The Anthropic key is added for fix only, and the engine already strips it again from installs and tests.
  • The job fails only on run-level errors: an invalid config, no push token in fix, or the engine not answering. A migration that does not verify is reported, not a job failure.

Report (uptide.run/v1).

  • Owned by core (core/src/run-report) and published as uptide/report (types, validator, summary renderer; 8.6 KB, no npm packages) and uptide/report/schema.json.
  • Built from named fields of the engine's JSON only.
  • Every object is closed, and every string is pattern-bound to one bounded line without code punctuation.
  • assertSafeReport also rejects credential shapes. It runs before the report is written and again before it is sent.
  • The report goes to $GITHUB_STEP_SUMMARY and is POSTed to {app-url}/api/action/results with a fresh OIDC bearer. A failed POST is a ::warning::.

Generator. The generated workflow now asks for contents: read and id-token: write, and the PR body explains the App token. Goldens updated.

Removed. The earlier Renovate/Dependabot PR checker: scripts/action.ts, core/src/action/{detect,github,run}, eval-action and the example workflow. docs/ci.md is rewritten. Workflows pinned to an older commit keep running the old checker.

How it was verified

  • Unit tests:
    • token exchange with a mocked fetch: audience, bearer, mask ordering, refusals with no token in the message, renewal, https-only app-url;
    • results upload: warns instead of throwing, and never sends an unsafe report;
    • engine env scrubbing, and the uptide pr credentials;
    • the orchestrator in all three modes: maxOpenPrs, an existing PR, no key, LLM off, the patch executor, verification failure, publish failure, no token, an invalid config, an up-to-date package.
  • Redaction: the report built from the storefront FixReport/CheckReport fixtures contains none of their diffs, snippets, compiler messages, test output, commands, the absolute checkout path or a planted env secret. Tampered reports (extra fields, code in a symbol, absolute or .. paths, multi-line or backticked errors, ghs_ tokens) are rejected.
  • Schema: it uses only keywords the validator enforces, closes every object and bounds every string; the published copy equals the source. uptide/report and uptide/onboarding keep their bundle contents, runtime imports and size budgets.
  • End to end: I ran the Action from an archive-style copy (no .git, as GitHub downloads it): action-setup.sh, then scripts/action.ts, on the public storefront fixture.
    • check: real breaking sites (zod 28, stripe 4).
    • fix against a local mock of GitHub OIDC, the two app endpoints and the pulls API: GET OIDC (audience=uptide, runner bearer), POST token (JWT bearer), GET pulls (installation token), a fresh GET OIDC, then POST results (JWT bearer). The posted body equals the written report.
    • Tokens appear in the log only inside ::add-mask:: lines.
    • Without a key, the rule-based zod migration leaves 4 manual sites, so it is reported failed with counts. That is a real result.
  • pnpm lint && pnpm typecheck && pnpm test pass (core 122 files, CLI 39).

Not covered: a hosted GitHub run, since the app endpoints are being built in parallel; e2e is out of scope here.

Checklist

  • Tests for the change (a bug fix starts with a failing test)
  • pnpm lint && pnpm typecheck && pnpm test pass
  • README and docs updated if behavior changed
  • Changeset added if a user would notice (pnpm changeset)
  • No new dependency, or it was agreed in an issue
  • No private code, names or paths in fixtures, tests or docs
  • The rules in CONTRIBUTING.md ("Rules that do not bend") still hold. Installs run with scripts off, and credentials stay out of install and test processes. The one push path is gated by verification and runs only on an explicit fix run configured by the repo owner.

🤖 Generated with Claude Code

https://claude.ai/code/session_016snMocPZAsAfZPPHnQJEb3


Generated by Claude Code

claude and others added 4 commits October 12, 2026 20:27
…un/v1 report

action.yml becomes the Uptide Action (composite): inputs config, mode
(list | check | fix), package, anthropic-api-key and app-url. It builds the
engine of its own pinned commit from that commit's frozen lockfile (install
scripts off, its pnpm off PATH) and drives list, check or fix with the
built CLI, --agent sdk by default.

To push, the job's OIDC token (audience "uptide") is exchanged at
{app-url}/api/action/token for an installation token of the Uptide GitHub
App, masked on arrival and given only to the `uptide pr` process (private
gh config, git extraheader), so Uptide's pull requests run the repository's
CI. maxOpenPrs and maxCost hold across the run.

Each run builds an uptide.run/v1 report from named fields of the engine's
JSON only, checks it against its closed schema and for credential shapes,
writes it to the job summary and posts it to {app-url}/api/action/results
with a fresh OIDC bearer; a failed post is a warning. The schema is owned
by the engine and published as uptide/report and uptide/report/schema.json.

The generated workflow now asks for contents: read and id-token: write.
The earlier Renovate/Dependabot PR checker that lived at action.yml is
removed. UPTIDE_ACTION stays pinned and unreleased until 0.9.0 ships.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016snMocPZAsAfZPPHnQJEb3
Signed-off-by: Claude <[email protected]>
… loadUptideConfig

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
… ESM and in a browser bundle

smoke:onboarding now also imports uptide/report and resolves
uptide/report/schema.json under Node ESM, and bundles it with
uptide/onboarding for the browser: no Node builtin may be reached. Docs
say uptide/report is pure, and how to check an OIDC workflow_ref against
WORKFLOW_PATH, exported from uptide/onboarding.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
…s missing

--agent sdk is the Action's default executor. The frozen install carries
the SDK and the platform's Claude Code binary; scripts/action-sdk.mjs
proves it after the build, and CI runs the same check on Linux after the
same install.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
@lucasbraum
lucasbraum force-pushed the claude/youthful-carson-1zfxfj branch from 59fc01b to 12b815d Compare October 13, 2026 03:33
…d what the Action applies

The generated PR body said results go to Uptide as JSON and that
nothing else leaves the runner. It now lists the run report (no source,
diffs or environment values) and the OIDC token to Uptide, the npm
registry, GitHub, and with the repository's own key Anthropic, where
the Agent SDK can read any file in the checkout (the code around each
site with executor: patch). It links https://uptide-app.vercel.app/trust.
docs/config.md lists only the uptide.yml fields the Action applies;
schedule is read when the workflow is written.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
@lucasbraum
lucasbraum merged commit b21a911 into main Oct 13, 2026
10 checks passed
@lucasbraum
lucasbraum deleted the claude/youthful-carson-1zfxfj branch October 13, 2026 04:19
@uptide-release uptide-release Bot mentioned this pull request Oct 13, 2026
lucasbraum added a commit that referenced this pull request Oct 13, 2026
…ly compare (#98)

UPT-25.

On a repository that does not type-check before the upgrade, `fix`
printed `verification failed` with nothing to say the repository was
already broken, so it read as Uptide's fault. papermark/papermark
@ed19717 has 205 type errors before anything changes.

## What changes

- **Baseline health** (`packages/core/src/fix/baseline.ts`), measured
from what `fix` already collects before the bump: type errors, test runs
that failed or timed out, and TS2307 grouped by where the specifier
points (a path alias folder like `@/ee/`, or a package).
- **Unhealthy baseline goes first**: one warning line at the top of the
terminal summary, and a quote at the top of the PR body and migration
page.
- **Verdict**
  - healthy baseline and it passes: `verification passed`, as before
  - unhealthy baseline and nothing new: `no new errors`
- it fails with new type errors: `verification failed: N type errors
introduced by the upgrade, M pre-existing`
- The Types row reads `(205 pre-existing, 56 introduced by the
upgrade)`.
- **Gate unchanged**: `passed` and the exit code are computed exactly as
before, so it stays strict for healthy baselines. An unhealthy baseline
only changes the wording.
- **`check`** prints the pre-existing count on the coverage line under
each compiled package.
- **JSON**: `verification.baselineHealth` = `{ healthy, typeErrors,
failingTests, missingModules: [{ under, errors, modules }] }`. The field
is optional; stored runs without it are measured from `baseline` and
`baselineTests` (`baselineHealthOf`).

Files PR #92 touches (`core/src/action`, `fix/publish.ts`,
`run-report/*`) are untouched. `publish.ts` still says "verification
failed" when it refuses to publish; changing that wording is left for
after #92.

## papermark @ed19717, `--no-llm`

Run locally on a scratch clone, `uptide fix zod zod-openapi --target
4.6.7 --no-llm` (zod-openapi because check reports it as a peer
blocker). Nothing pushed, no PR opened there.

Before:
```
uptide fix · zod 3.25.76 → 4.6.7 (requested) · verification failed · 5m 12s

  Types     ❌ 260 errors after the bump → 247 (205 pre-existing)
```

After:
```
uptide fix · zod 3.25.76 → 4.6.7 (requested) · verification failed: 56 type errors introduced by the upgrade, 205 pre-existing · 4m 43s

⚠ this repository does not type-check before the upgrade (205 errors, 129 from missing modules: 108 under @/ee/, 11 under @/lib/, …); verification can only compare, not prove

  Risk      High: manual sites left; unverified sites; behavior changes
  Changes   57 sites · 6 changed files · 4 auto-fixed · 0 fixed by the agent (LLM) · 53 manual
  Types     ❌ 260 errors after the bump → 247 (205 pre-existing, 56 introduced by the upgrade)
  Behavior  ⚠️ 2 schemas identical · 9 not checked · 1 with differences · 0/4 custom-message assertions
  Tests     ⚠️ no tests ran: no test script or runner configuration for the repository · lint clean (prettier, eslint)
  With      @chronark/zod-bird 0.3.10 → 1.0.0, zod-openapi 4.2.4 → 5.1.0
  Coverage  33 importing files not analyzed (memory cap); findings in them may be missed
```

PR body head:
```
## Upgrade zod 3.25.76 → 4.6.7

> ⚠️ This repository does not type-check before the upgrade (205 errors, 129 from missing modules: 108 under @/ee/, 11 under @/lib/, …); verification can only compare, not prove.
```

`check zod` on the same tree:
```
zod   57 breaking · compiled against 4.6.7: 62 new type errors
  compiled 275 of 275 files in 1 workspace with the repo's TypeScript 5.9.3 · 509 pre-existing type errors in these files (subtracted)
```

With `--no-llm`, 53 of 57 sites stay manual, so this run still fails on
its own errors (56 introduced). It now says so instead of blaming the
repository's 205.

## Notes for review

- The brief's example said "129 missing modules under @/ee/". Measured:
129 TS2307 errors, 108 under `@/ee/`; the rest are `@/lib/` (11),
`@react-email/components` (8) and `@/public/` (2).
- The check and fix counts differ (509 vs 205) because their scopes
differ. Check compiles only the files that use the package, and never
writes to the checkout, so the Prisma client stays ungenerated. Fix
generates clients in its clone first. Plain `tsc` on the ungenerated
tree reports 1596. Check's line says "in these files" to keep the scope
visible.
- Failing baseline tests also make a baseline unhealthy. They were
already marked `preexisting` and didn't fail the gate; now they show in
the headline too.

## Tests

`baseline.test.ts` builds healthy, unhealthy and missing-module
repositories on disk (a `@/*` path alias and an undeclared package) and
measures them with the same `diagnostics` `fix` uses. It covers health,
grouping, headline, verdict, the PR body and the Types cell, plus a
stored run without the field. The CLI tests cover the warning line and
verdict in the fix summary and the check line. The storefront-zod
snapshot gains the warning and the split Types cell. `pnpm test`, `pnpm
typecheck`, `pnpm lint` and `public:check` all pass.

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

---------

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

- [#93](#93)
[`765de77`](765de77)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `uptide fix
<package>` with Anthropic selected runs assisted fixes as one Claude
Agent SDK session in the temporary clone, covering the package's manual
sites and their rule knowledge, gated once at the end of the session. It
is the default when `@anthropic-ai/claude-agent-sdk`, an optional peer
that is never bundled, is installed next to Uptide; without it, the
patch executor runs and the output says what to install. Use `--agent
patch` to opt out; other providers keep the patch executor. See
`docs/decisions/0016-agent-sdk-executor.md`.
  
Stripe period helpers accept both endpoint payload shapes, and both
executors share the same period knowledge.

- [#94](#94)
[`5f54bad`](5f54bad)
Thanks [@lucasbraum](https://github.com/lucasbraum)! -
`uptide/onboarding` loads where it broke: under plain Node ESM, Vitest
and Turbopack, and in a browser bundle. It no longer inlines `yaml` (its
CommonJS build called `require("process")` inside an ES module); `yaml`
is now a dependency of the package. The entry is pure, with no file
system and no Node globals: `loadUptideConfig` and `snapshotFromDisk`
move to `uptide/onboarding/node` (breaking for code that imported them
from `uptide/onboarding`). The command line is unchanged.

- [#92](#92)
[`b21a911`](b21a911)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - The Uptide
Action: `action.yml` at the root of this repository now runs Uptide in a
repository's own GitHub Actions (`mode: list | check | fix`, `package`,
`config`, `anthropic-api-key`, `app-url`). It builds the engine of its
own pinned commit, migrates with `--agent sdk` by default, and opens
draft pull requests with a short-lived installation token of the Uptide
GitHub App, obtained for the job's OIDC token, so those pull requests
run the repository's CI. Each run writes an `uptide.run/v1` report to
the job summary and sends it to the Uptide app; a failed upload is a
warning. It replaces the earlier Renovate/Dependabot pull-request
checker that lived at the same path; workflows pinned to an earlier
commit keep running that one.
  
New `uptide/report` export: the `uptide.run/v1` types, its JSON Schema
(also `uptide/report/schema.json`), a validator and the summary
renderer. The report holds no source code, diffs, snippets or
environment values: paths, line numbers, symbol names and counts only.
  
`uptide init` and the "Add Uptide" pull request now write `permissions:
contents: read, id-token: write`; the Action pushes with the Uptide
GitHub App's token instead of `GITHUB_TOKEN`.

### Patch Changes

- [#96](#96)
[`b9c1d71`](b9c1d71)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Assisted fixes
group two sites of one file into one task only when their fix is in the
same place: the same repository declarations behind each compiler error,
or none. Two React 19 `RefObject<T | null>` errors in one file whose
prop types live in two components were sent as one task that could edit
only the first component, and both stayed manual (a regression in
0.8.0).

Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
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