Skip to content

feat(pm-dispatch): cross-repo grants + reusable Actions (starter/queuer) - #2676

Merged
dezren39 merged 1 commit into
mainfrom
feat/2672-dispatch-grants
Oct 30, 2026
Merged

dezren39 merged 1 commit into
mainfrom
feat/2672-dispatch-grants

Conversation

@dezren39

@dezren39 dezren39 commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Part of #2672 (Parts 1 and 2; Part 3 call-site migration follows separately — do not close #2672 on merge).

Part 1 — Cross-repo grants (pm-stack/dispatch)

  • assertCallerRepo in src/auth.ts is now the grants mesh: every allowlisted repo may target every allowlisted repo; repos outside the allowlist can neither call (OIDC caller claim re-checked) nor be targeted; bearer callers remain bound only by the allowlist on the target. The grants rule is stated verbatim in the code comment.
  • Tests (test/auth.test.ts): cross-repo allowed (openchamber token → opencode target), caller outside allowlist rejected, target outside allowlist rejected, same-repo still allowed, bearer unaffected by pairing (allowlisted target passes, non-allowlisted rejected).
  • POST /v1/tasks gains optional issue_number (positive integer, validated in parseTaskRequest/parseIssueNumber with ValidationError): no issue is created; the task uses the canonical dedupe key for that existing issue, enqueues, then attaches — the same agent-note comment format as the create path plus queue/queued + source/dispatch labels. issue_number takes precedence over issue. On dezren39/nix (no GitHub App installation) the attach is skipped with a warning in the maybeCreateIssue style, but the task still enqueues and issue_number is still returned. The attach-path response also includes issue_url.

Part 2 — Reusable composite actions

  • .github/actions/pm-dispatch-start — POST /v1/sessions; outputs task_id, session_id, issue_number, issue_url. Pure bash+curl+jq, OIDC audience pm-dispatch, fails clearly when the caller job lacks permissions: id-token: write (documented in the description), token never printed.
  • .github/actions/pm-dispatch-queue — same plumbing over POST /v1/tasks with issue (default "true") and numeric issue_number (jq --argjson); outputs task_id, issue_number, issue_url.
  • pm-stack/dispatch/examples/dispatch-workflow.yml now uses both actions @main as the canonical example (raw-curl form noted as still working).
  • README: Auth section updated for the grants mesh; issue_number documented in the POST /v1/tasks section; new "GitHub Actions (reusable)" section. No other README sections restructured (concurrent nixos/pm-stack work untouched: no nixos/**, no pm-stack/scripts/**).

Verification

  • bun test in pm-stack/dispatch: 34 pass, 0 fail (was 28).
  • bun x tsc --noEmit: clean (after bun install --frozen-lockfile in the worktree).
  • Action run scripts extracted and executed against a stubbed curl: payload shapes verified (wait/issue as booleans, priority/model as strings, issue_number as a JSON number), outputs incl. derived issue_url written, missing-OIDC-env failure is explicit, token never echoed.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner October 30, 2026 09:57
@coderabbitai

coderabbitai Bot commented Oct 30, 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 8 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: a7b4cb49-f804-42a9-9550-48ecd3ed8668
Commits

Reviewing files that changed from the base of the PR and between 3bad045 and dbab526.

Files selected for processing: 9
  • .github/actions/pm-dispatch-queue/action.yml
  • .github/actions/pm-dispatch-start/action.yml
  • pm-stack/dispatch/README.md
  • pm-stack/dispatch/examples/dispatch-workflow.yml
  • pm-stack/dispatch/src/auth.ts
  • pm-stack/dispatch/src/server.ts
  • pm-stack/dispatch/src/validate.ts
  • pm-stack/dispatch/test/auth.test.ts
  • pm-stack/dispatch/test/validate.test.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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 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-30T09:58:07.154624Z dbab526 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.

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.

feat(dispatch): cross-repo grants + reusable Actions (starter/queuer) + workflow call-site migration

1 participant