Skip to content

Hold the Build Grant key on the runner - #7

Merged
nick-potts merged 4 commits into
mainfrom
sealed/sl9b-runner-holder
Oct 27, 2026
Merged

nick-potts merged 4 commits into
mainfrom
sealed/sl9b-runner-holder

Conversation

@nick-potts

Copy link
Copy Markdown
Contributor

Companion to SL9b (Sealed values in GitHub builds). The runner holds its own Build Grant key, so Cloud never sees the grant secret.

What changes

  • prepare.sh generates an ed25519 key with node:crypto before the check-in. It writes the 32-byte seed 0600 to the work dir and sends {"holder":"<64 hex>"} as the check-in body.
  • A holder mint answers machine instead of grant. grant.js assembles ployzgrant1: + base64url(machine ‖ seed) in Node and prints ::add-mask:: for it before anything else runs. A response with grant (an older Machine or Cloud) still works.
  • build.sh reads the grant from the work dir. An EXIT/INT/TERM trap sends TERM to ployz build, waits for it, and only then removes the work dir. The always() cleanup in action.yml stays.
  • The runner now needs Node.js on PATH. GitHub-hosted runners have it. A runner without it fails with a clear error.

Ship order

Cloud and the daemon ship first, then this tag moves v1. Plain builds work in every mix. Do not merge or tag until the core PR is deployed.

Tests

bash test.sh and shellcheck *.sh pass on Ubuntu 24.04 (jq 1.7, Node 18). New cases:

  • RFC 8032 test 1 seed gives the expected holder through the Node import path.
  • Machine 32×0x01 with that seed assembles the contract's fixture grant, and it is masked.
  • A malformed machine is refused.
  • The full holder flow builds with the assembled grant, masked on the first line after the OIDC token.
  • The legacy grant response still builds.
  • The key file is 0600, and the check-in body carries its holder.
  • A cancelled build is stopped within 5s. The key is still present while it stops, and the work dir is gone after.

Removing the trap's kill or its wait each fails a test.

The runner generates its own ed25519 key, sends the public half as holder
in the check-in, and assembles ployzgrant1: from the Machine Cloud names.
A legacy grant response still works. A cancelled job stops ployz build
before the work dir holding the key is removed.
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 10f4b297-eb85-4d8f-a272-472a8fafba44

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • 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

Comment @coderabbitai help to get the list of available commands.

…on TERM

The cancel test's stub trapped TERM itself, which hid a ployz build that died on
TERM without cleanup. It now dies on TERM unless it models a graceful stop, and
ployz build runs with TMPDIR under the work dir, so opened Sealed values go with
it on any exit. A Cloud-held grant prints a notice. Key and grant files are 0600
even when one was already there, and a key that is not a 32-byte seed is refused.
@nick-potts
nick-potts marked this pull request as ready for review October 27, 2026 02:35
@nick-potts
nick-potts merged commit 7b57cb8 into main Oct 27, 2026
4 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T02:36:13.075143Z 35e2602 Draft marked ready
ℹ️ 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.

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