Skip to content

test(pm-console): signed-in flows and the alarm in the real Worker runtime (#13499) - #13526

Merged
dezren39 merged 1 commit into
mainfrom
lane-aat-13499
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-aat-13499

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Closes #13499

What

pm-stack/console/scripts/edge-smoke.ts ran the Worker bundle in workerd but could only check what needs no sign-in: the smoke issuer pointed at a real Cloudflare Access key set the run does not hold a key for. This gives the run its own issuer and checks the signed-in flows and the Durable Object alarm in the real runtime.

  • The run's own sign-in. The smoke generates an RS256 keypair; the host stand-in serves the public half at /jwks (the demo script's shape). The issuer in the host's config is https://smoke.invalid with an https key-set address, so no config validation is relaxed. Two new local-only Worker vars, KEYS_FROM / KEYS_TO, rewrite only this Worker's fetch of that one address to the stand-in — the same pattern as the existing GITHUB_API_ORIGIN / QUEUE_DB_ORIGIN / HOST_ORIGIN stand-in vars, and never set where deployed.
  • Signed-in checks in workerd: /console/api/me names the owner; a named push.class action is done once and its second arrival is answered from the record (again: true); the platform read is answered at the edge from the repository's own list (the GitHub stand-in now serves pm-stack/platform/workers.json and workflow runs) with no machine asked.
  • The alarm. A new local-only var OWN_CLOCK_MS shortens the object's clock minute for the run (plumbed through EdgeOptions.ownClockMs; unset keeps the minute). A device takes notifications, a signed-in state read starts the clock, and the run waits until what the owner is told about is read again unasked after it goes stale — proof an alarm the object set fired and did its work.
  • Held flow, host down: a message.send (holdable, not edge-direct) is held rather than lost, listed by the machines read, and taken back with held.drop.
  • The deploy workflow's smoke step passes the two new var pairs and stays the gate it was.

Verification (laptop, real runtime)

  • SMOKE_PRIMARY=1 bun run scripts/edge-smoke.ts against wrangler dev with the workflow's vars: all checks passed (including every pre-existing check).
  • bun test in pm-stack/console: 358 pass, 0 fail.
  • wrangler deploy --dry-run for both the Worker and the init config: builds clean.

Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

… Worker runtime (#13499)

The edge smoke run now signs its own sign-in token: a key the run
makes, whose public half the host stand-in serves as the issuer's key
set. The Worker's fetch of the issuer's https key-set address is
sent to the stand-in by two local-only Worker vars (KEYS_FROM /
KEYS_TO), the same stand-in shape as GITHUB_API_ORIGIN and
HOST_ORIGIN; the issuer address in the settings is never rewritten
and no validation is relaxed.

With that, the run checks in workerd what only a signed-in caller
reaches: who the edge says is calling, an action done once under a
name and answered again from the record, the platform read (the
stand-in now serves the repository's Workers list and deploy runs
as GitHub would), and -- with the host gone -- an action held for a
machine, listed by the machines read, and taken back.

An alarm set by the object is watched firing and doing its work:
the object's clock minute is shortened for the run by a local-only
var (OWN_CLOCK_MS, plumbed through EdgeOptions), a device takes
notifications, a state read starts the clock, and the run waits for
what the owner is told about to be read again unasked once it goes
stale.

Verified on the laptop in the real runtime: the full smoke run
passes every check (SMOKE_PRIMARY=1, wrangler dev), the console's
bun suite passes 358/358, and both wrangler dry-run deploys build.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T17:43:23.638224Z ba43b65 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ac20e199-60a3-4264-bea2-28a9d5ec69dc
Commits

Reviewing files that changed from the base of the PR and between a94634c and ba43b65.

Files selected for processing: 4

  • .github/workflows/pm-console-edge-deploy.yml
  • pm-stack/console/edge/src/edge.ts
  • pm-stack/console/edge/src/worker.ts
  • pm-stack/console/scripts/edge-smoke.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 3eb33d1 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane-aat-13499 branch November 23, 2026 17:42
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.

pm-console: check the signed-in flows and the alarm in the real Worker runtime

1 participant