Repository navigation
feat(workflows): approval gates persist and resume, with duration validation ( WF-08) - #8709
aihubworkflow wants to merge 5 commits into
Conversation
🔐 Codex Security Review
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Hi @aihubworkflow! 👋 I've merged the latest Reconciled Changes:
Rebased/Merged Branch:
Hope this helps get PR #8709 unblocked! 🚀 |
joahg
left a comment
There was a problem hiding this comment.
🤖 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 |
There was a problem hiding this comment.
🤖 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.
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