Skip to content

Approval demo - #718

Open
khaliqgant wants to merge 19 commits into
mainfrom
demo/nabis-flow/uc1
Open

khaliqgant wants to merge 19 commits into
mainfrom
demo/nabis-flow/uc1

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

UC1

  • Consume an authenticated Slack event for an explicitly approved workspace and test channel. The task uses fictional pickup routing.
  • Generate and execute a runtime task graph. Demonstrate the first reviewer rejecting the missing held route, an agent repair, and successful re-review with independent routing checks.
  • Bind a threaded Slack decision to the approver and open run wait. Record simulated shipment only after approval and send the Done, Next, and Blocked summary in the same thread.
  • Settle the SDK's pending dispatch promise when resuming an already-completed helper effect. A regression test covers a Slack write immediately before a human wait.

Verification

  • Passed flows check, example typecheck, and the end-to-end mock-agent and mock-Slack verification on Node 22.23.3.
  • Completed a real Codex agent run with mock Slack and a simulated shipment on Node 26.8.1. The example README records the invocation and journal receipts.
  • Live Slack delivery is pending an approved channel, designated approver, and existing authenticated ingress and writeback access.

Review verification at 70f329d

The SDK build, example typecheck, mock rehearsal and 24 focused SDK tests passed on Node 22.23.3 at 70f329dfbfcd16ce651ab676bd0b5bd17a36ef21. The synthetic Relayfile cases used a local directory and did not contact Slack. Rehearsal commands

  • The approval callback restarted relayflowd after it stopped at the human wait and completed the same run 01M8TTHJ92HHEMN0S8HNBPRFW0. node examples/nabis-uc1/verify.mjs asserted resumedAfterDaemonRestart=true. Thread 4765987773 · Restart test
  • The bridge resolved relative RELAYFILE_MOUNT_PATH=mount before entering its private working directory. In a targeted rehearsal with synthetic delivery receipts, run 01M8TTQHHMZ9D97P7657SFH6KT wrote the prompt and summary beneath that mount in the same fixture thread and then completed. Thread 4765987931 · Mount resolution
  • The held-only coder returned {"rules":null} in targeted mock run 01M8TTQN1P6PG5DSGBG1XM4Z9Y. The run recorded step_failed and a threaded blocked summary before the reviewer or human wait. Both comments identify the same input check. Thread 4765988130 · Thread 4766011976 · Coder output validation
  • The SDK settles the memoized helper's dispatch promise because the lifecycle tracks the promise from completed.catch(). Removing only resolve() reproduced unsettled_derived_work. Restoring it passed and verified a single approval prompt followed by an Approved reply in its thread. The SDK source and test match the mutation receipt at this head. The 24-test successor run included this regression. Thread 4766046957 · Fail-and-pass receipt · SDK regression test

Successor verification at b93e121

The model-pin successor declares codex/gpt-5.6-sol for the UC1 worker. The bridge still uses the local read-only Codex shim. The shipped-source scanner found no missing or unresolved model pair for UC1. Pinned agent call

  • The mock rehearsal passed at the successor and completed run 01M8TV9F81T9S329MW98CYGEKT after a daemon restart. The two targeted cases also passed. Run 01M8TV9F50EMS5FF30KJT4QM2C wrote through the relative synthetic mount and surfaced the stale socket warning. Run 01M8TV9JW85WTJ7W94C93WPDH5 stopped on malformed coder output. Rehearsal commands
  • Real Codex with the supported model completed run 01M8TV5KEFQDA9QAGASGRBA823 with mock Slack and one simulated shipment. Journal receipt

Linux artifact result and PATH follow-up

The Linux artifact job on b93e1217 stopped in the full SDK suite with 11 failures, 5,029 passes, and 14 skips. All 11 failing cases also failed on the fa65e682 merge base. The UC1 model-pin check and authored Slack replay tests passed in the Linux job. Successor Linux job · Merge-base Linux run

The bridge drops empty PATH entries before resolution at 5008a075. In a targeted mock rehearsal, removing the filter let a trailing empty entry expose the launch directory to the fake agent and reproduced a refusal. Restoring the filter passed. At 5008a075, the same rehearsal approved mock run 01M8TWEVJFR44HVGR6ZW2RRMAK with the trailing empty entry present in the launch environment. Thread 4766274883 · PATH normalization

PATH verification at ee42845

The bridge drops empty PATH entries. If that leaves only the read-only Codex shim, the shim exits 127 immediately. The previous shim timed out in the same setup. At ee428459, the targeted trailing-entry rehearsal passed in mock run 01M8TWQ1GF0V5S50DJWWTJ5F0E. The full mock verifier also passed, including the shim-only refusal and approval after a daemon restart, in run 01M8TWQ53D1DNMTQTWSZ3RRZFC. Review thread 4766274883 · Verifier

The exact-head Linux artifact job stopped in the SDK suite with 11 failures, 5,029 passes, and 14 skips. All 11 failures also appeared on the fa65e682 merge base. The shipped-source model-pin and authored Slack tests passed. Exact-head Linux job · Merge-base Linux run


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


Summary by cubic

Adds the Nabis UC1 Slack approval demo, where a Slack mention in an approved workspace and test channel starts a fictional pickup-routing run: a planner builds a task graph at runtime, the first reviewer rejects the missing held route, a repair agent fixes it, and a threaded approval from the designated approver must confirm before a simulated shipment is recorded. Also fixes the SDK so resuming an already-completed helper effect settles its pending dispatch promise instead of leaving derived work pending after a Slack write before a human wait.

The demo ships with both a local Socket Mode listener and a native hosted Slack path. The local bridge validates incoming events through a scoped envelope, persists accepted callbacks to an inbox before Slack acknowledgment, and replays unfinished work after a listener restart. It routes through the Flows CLI and the f.human gate, reconnecting to the local journal before each approval so decisions land after a daemon restart. Mock-agent and real Codex runs pass with mock Slack, including refusals for wrong workspace, channel, approver, or thread, stale replies, bot replies, and a shim-only PATH.

Hosted Slack path

  • Adds the mentioned=true boolean to the slack: trigger settings in @relayflows/surface so Cloud accepts a top-level app mention for the approved channel.
  • Posts a link to the live Cloud run as the first threaded reply, before any agent or Slack step; the base URL is validated like the SDK and normalized to strip trailing slashes and empty query or fragment separators, and invalid bases fail the run before any reply or agent step.
  • Verifies the mounted Slack record (sender, exact text, thread) before any agent or reply step; on a cold start it waits up to 60 seconds for the trigger's record to appear in the mirror.
  • Posts the approval question in the trigger thread and records the simulated shipment only after the designated approver confirms.
  • Hosted tests exercise the input, mounted-record, mirror-delay, approval, and Cloud-link normalization branches with local fixtures; a live Slack rehearsal in the approved workspace is pending.

A live recording needs the approved workspace, test channel, designated approver, and authenticated ingress and writeback access.

Written for commit 12cf8a4. Summary will update on new commits.

View guided diff Turn on auto-fix

@khaliqgant khaliqgant added the merge-train:hold Hold merge train entry pending an explicit blocker resolution label Dec 2, 2026
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

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: 5509b25f-8390-4faf-b427-98a2834032b3
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • 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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

Devin Review

Comment thread examples/nabis-uc1/slack-event.mjs Resolved
Comment thread examples/nabis-uc1/slack-event.mjs Resolved
Comment thread examples/nabis-uc1/uc1.flow.ts Resolved
@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The changes appear safe to merge; no new blocking issue was found.

Summary

Adds a Slack approval demo with agent planning, review, repair, and a simulated shipment after human approval. Also fixes completed helper promises during resume.

  • Slack mentions start a reviewed pickup-routing demo.
  • The local Slack listener saves approved events and resumes matching runs.
  • Resumed Slack flows finish after their earlier write is complete.

Diagram

%%{init: {'theme': 'neutral', 'htmlLabels': false}}%%
flowchart TD
  A[Scoped Slack trigger] --> B[Plan and code]
  B --> C[Reviewer rejects missing held route]
  C --> D[Repair and routing checks]
  D --> E[Human approval wait]
  E -->|Approve| F[Record simulated shipment]
  E -->|Decline| G[No shipment]
  F --> H[Threaded summary]
  G --> H
Loading

Reviews (18) · Last reviewed commit: "Normalize the hosted UC1 dashboard link ..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/nabis-uc1/agent-cli/codex Resolved
Comment thread examples/nabis-uc1/verify.mjs Resolved
Comment thread examples/nabis-uc1/uc1.flow.ts Resolved
Comment thread examples/nabis-uc1/slack-event.mjs Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/nabis-uc1/README.md Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 7 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/nabis-uc1/slack-event.mjs Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 6 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/nabis-uc1/slack-event.mjs Resolved
@khaliqgant khaliqgant changed the title Add the local Nabis UC1 Slack approval demo Approval demo Dec 4, 2026
Comment thread examples/nabis-uc1/slack-listen.mjs Resolved
Comment thread examples/nabis-uc1/slack-listen.mjs Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 7 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/nabis-uc1/slack-event.mjs Resolved
Comment thread examples/nabis-uc1/slack-listen.mjs Resolved
Comment thread examples/nabis-uc1/slack-listen.mjs Resolved
Comment thread examples/nabis-uc1/slack-listen.mjs Resolved
Comment thread examples/nabis-uc1/README.md Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 5 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/nabis-uc1/slack-inbox.mjs Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/nabis-uc1/hosted.test.mjs Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/nabis-uc1/uc1.flow.ts Resolved
Comment thread examples/nabis-uc1/uc1.flow.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/nabis-uc1/uc1.flow.ts Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-train:hold Hold merge train entry pending an explicit blocker resolution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant