Skip to content

feat(workflows): approval gates persist and resume, with duration validation ( WF-08) - #8709

Open
aihubworkflow wants to merge 5 commits into
block:mainfrom
aihubworkflow:main
Open

aihubworkflow wants to merge 5 commits into
block:mainfrom
aihubworkflow:main

Conversation

@aihubworkflow

Copy link
Copy Markdown

Summary
Implements WF-08 approval gates end to end: gates persist to the DB, runs park
in WaitingApproval, and the decide endpoint grants/denies with
resume-after-gate. Also adds definition-time validation for step durations and
day-granularity (7d) timeout support.

Changes
• Approval gate persistence and resume-after-decide (WF-08, BZ-02)
• POST .../approvals/{ref}/decide endpoint with approver checks
• parse_duration_secs accepts d suffix; invalid/zero approval timeouts and
delay durations rejected at save time; delays capped at 270s at definition
time
• Approval timeout parse errors propagate instead of silently falling back to
24h

Testing
• cargo test -p buzz-workflow --lib: 177 passed, 0 failed
• cargo test -p buzz-relay --lib workflows: 5 passed
• cargo fmt --check: clean

@aihubworkflow
aihubworkflow requested a review from a team as a code owner October 29, 2026 20:18
@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is ccfc1490e451b99e8bc472ab7df5d65b0f4d3837...d7d3c5e0b64fef0014875980eea886dc6c105600.
A new review must complete for this exact range. When manual authorization
is required, a user with write access must comment exactly
@buzz-security-review d7d3c5e0b64fef0014875980eea886dc6c105600 to authorize a new review.
Any previous review applies only to its recorded range.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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 ⚠️ Failed 2026-10-29T20:19:53.444485Z
We couldn’t complete this review. Comment @codex review to try again.
d7d3c5e 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.

@presentyourlove

Copy link
Copy Markdown

Hi @aihubworkflow! 👋

I've merged the latest main into a branch to resolve the merge conflict on PR #8709:

Reconciled Changes:

  • crates/buzz-relay/src/api/workflows.rs: Reconciled your workflow approval endpoints with main's latest AccessSlot access layer changes:
    • Passed slot to authorize_workflow_read while preserving your method parameter and proven pubkey return tuple (TenantContext, Vec<u8>).
    • Added slot: crate::access::AccessSlot extractor to decide_approval and passed it through to decide_approval_inner.

Rebased/Merged Branch:

  • Branch: https://github.com/presentyourlove/buzz/tree/fix/workflow-approval-gates-8709
  • To fetch and merge directly:
    git fetch https://github.com/presentyourlove/buzz.git fix/workflow-approval-gates-8709
    git merge FETCH_HEAD

Hope this helps get PR #8709 unblocked! 🚀

@joahg joahg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Blocking on the approver check in the new decide endpoint (inline). Also: this branch is conflicting with main and bundles an unrelated hermit node bump (bin/node, corepack, npm, npx). The description claims d suffix and definition-time duration validation, but this diff has neither (no schema.rs change, parse_duration_secs unchanged); #8699 looks like the newer version of this work.

if trimmed.len() == 64 && trimmed.chars().all(|c| c.is_ascii_hexdigit()) {
return trimmed.eq_ignore_ascii_case(proven_pubkey_hex);
}
true

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 P1: any spec that is not a bare 64-hex pubkey returns true, so a gate like from: '@manager' can be granted or denied by anyone who can read the workflow's channel, including whoever triggered the run. Fail closed until roles resolve: reject non-pubkey specs with 403, or restrict to channel owner/admin.

This branch has not been deployed

No deployments
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.

3 participants