Skip to content

fix(deploy): Allow the local-time pattern that Junior sends - #10

Merged
dcramer merged 1 commit into
mainfrom
fix/junior-local-time-pattern
Oct 15, 2026
Merged

dcramer merged 1 commit into
mainfrom
fix/junior-local-time-pattern

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

The service refuses every Junior eval run with HTTP 400:

value local-time of rule model is not a pattern that the service allows

The local-time pattern in deploy/gcp/roach.tfvars started with (?<![\w-]). Junior sends it with NOT_AFTER_WORD from values.ts (packages/junior-evals/src/recording-rules.ts). The service allows only patterns that are exactly equal. This change copies the pattern of Junior into value_patterns, and adds a comment that the two must stay equal. The event-id pattern was already equal.

I checked this against the deployed service with replay runs: the built-in patterns and event-id are accepted (HTTP 201), and the current local-time value is refused (HTTP 400).

After merge: run terraform apply -var-file=roach.tfvars in deploy/gcp/, then restart the VM, because it reads its config only at start:

gcloud compute instances reset roach --zone us-east1-b --project roach-511216

The restart also fixes the publicUrl: the running service still gives runs https://roach-proxy.sentry.dev, because it did not restart after #6.

Needed by the Junior change that moves evals to this service.

via David Cramer.

--

View Junior Session [Sentry]

The local-time pattern in roach.tfvars started with (?<![\w-]). Junior
sends the pattern with NOT_AFTER_WORD. The service allows only equal
patterns, so it refused every Junior run with HTTP 400.

Co-Authored-By: David Cramer <david@sentry.io>
@dcramer
dcramer merged commit 1b0cd1f into main Oct 15, 2026
15 checks passed
dcramer added a commit to getsentry/junior that referenced this pull request Oct 16, 2026
Evals now use the shared Roach service at
`https://roach-proxy.getsentry.net`
([getsentry/roach](https://github.com/getsentry/roach)), in place of a
local proxy with recordings in git. This is a hard cutover. The service
keeps the recordings of the tenant `getsentry/junior` in its GCS bucket,
which deletes each one 30 days after it was written.

**What changes**

- `src/recording-run.ts` starts a run with `startRemoteRun()`. Workers
get the run's `controlUrl` and token, and open one session per test as
before.
- `ROACH_TOKEN` selects the mode. With the token, the default is `auto`.
Without it, the service allows only `replay`. `VITEST_EVALS_REPLAY_MODE`
still overrides. Only global setup reads the token, and it removes it
from `process.env`, so workers and child processes do not get it.
- `src/roach/` is now a copy of the client side of getsentry/roach at
`653c28e`: `client.ts`, `types.ts`, `report.ts`, and the patterns of
`values.ts`. The local proxy, its CLI, and its tests are deleted.
`@sentry/roach` is not on npm, and pnpm refuses it as a git dependency
(`ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`, because of its `prepare`
script). `src/roach/README.md` tells how to update the copy.
- `scripts/network-jail.sh` resolves `roach-proxy.getsentry.net` and
allows it on TCP 443. The launcher for a local proxy outside the jail is
gone.
- The committed recordings in `packages/junior-evals/recordings/` are
deleted. So are `evals-prune-recordings.yml` and the
`collect-eval-recordings`, `commit-eval-recordings`, and
`eval-recordings-mode` actions. The four eval workflows pass
`ROACH_TOKEN` to the run step and no longer have a "commit recordings"
job.
- `AGENTS.md` and "Recordings" in `packages/junior-evals/README.md`
describe the new flow.

**Verification**

- `pnpm --filter @sentry/junior-evals typecheck` passes.
- On Node 24, I ran `startRecordingRun()` with the real rules of this
branch against the deployed service, without a token. The service
accepted the run. A `webFetch`-style GET and an AI Gateway POST came
back `412 missed`. The report line and the non-zero exit code worked.
Before that, the service refused Junior's `local-time` value pattern;
getsentry/roach#10 fixed it.
- The jail rules were checked with a stub `sudo`. They allow
`136.69.81.163:443`, and the reject rules still come last.
- I did not run the eval harness tests (`pnpm --filter
@sentry/junior-evals test`) because the sandbox has no Postgres. The
only harness test of Roach was the local proxy test, which this PR
deletes.

**Before merge**

- Give `getsentry/junior` access to the `ROACH_TOKEN` organization
secret ("Deploy", step 6, in the roach README). Without it, CI runs only
replay, and every eval misses.
- The bucket starts empty, so the first `auto` run of each suite calls
the model live for every request.

**Behavior changes to know**

- A local run without `ROACH_TOKEN` uses `replay`. The service also
refuses requests that no rule records, such as Vercel Sandbox API calls
(HTTP 403). So behavioral and integration evals need the token to run
locally.
- Recordings are readable by anyone who can make the same request. The
service redacts credential-like request headers, but Junior's own
`SECRET_ENV` list for body redaction is gone, because the service has no
per-run secrets.
- Misses report only the key of the recording, not the closest recording
and the differing parts.
- `.gitattributes` and `warden.toml` still name
`packages/junior-evals/recordings/**`. That keeps this large deletion
out of review. They can be deleted in a follow-up.

<!-- junior-request-attribution:start -->
via Junior system actor `event`.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0B595QDZLL%3A1791656969.630679 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B595QDZLL%3A1791656969.630679)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B595QDZLL%3A1791656969.630679/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <david@sentry.io>
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