Skip to content

fix(organization-search): prove resume steering end to end, skip locked Slack refreshes, parse tool calls once - #10591

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/organization-search-audit-followups
Dec 1, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/organization-search-audit-followups

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-ups from the post-merge audit of #10562, #10572, #10573 and #10575. The audit found no security or correctness bugs.

  1. Resume steering, tested end to end (lib/workflows/executor/resume-steering.integration.ts). Real Postgres and the real executor run a deployed workflow that pauses for approval and then reaches an Organization Search block:

    • Resumed by its starter, the block runs (control).
    • Resumed by another member, the block refuses.
    • After another member's approval and then a timer resume (which records no resumer), it still refuses.

    I removed each of the three audited lines locally:

    • human-in-the-loop-manager.ts (...resumerOf(...) into the resume metadata): red.
    • execution-core.ts (metadata.resumedBy into executorDelegationOrigin): red.
    • snapshot-serializer.ts (resumedBy carried into the next pause's snapshot): still green. resumerOf also reads the resumer recorded on every earlier resumed point of the paused row, and those points keep resumedBy until a point returns to paused or failed. The serializer copy is redundant defense, so removing it does not reopen the hole. I kept it.
  2. catalog.test.ts: dropped the three assertions that held by construction (registry key, tool registry entry, block access). It now checks, for every tool and every operation it performs (both of search_people's), that the operation admits 'executor' in its organization delegated services; this goes red when 'executor' is removed from listActivity. It also checks that the Assistant has the tool, with the Assistant-name map moved into the test.

  3. Slack identity sweep:

    • New organizations are enrolled once per sweep, at the epoch, so they come first.
    • leaseNext then selects with FOR UPDATE SKIP LOCKED: a row another sweep holds is skipped, not waited on, and no lost race ends the sweep early.
    • New test: with the first-due organization's row locked by another transaction, the sweep refreshes the next one. On the previous code the sweep blocks on the lock.
  4. Simplifications:

    • ORGANIZATION_TOOLS[name].prepare(input) parses once and returns the operation, cost and run. The workflow handler no longer parses twice; it answers invalid input with the same 400 shape.
    • Catalog entries drop name (it is the key), title (derived from the label in sentence case) and assistantName (only the test used it).
    • The Search MCP tool runner moved into server.ts, its only consumer.
    • Block descriptions point only to the operations the block lists. A per-organization flag such as my-activity can't be known when the static config is built; the operation refuses at run time.

MCP tools/list is byte-identical to staging. Generated block metadata, contracts and the Assistant contract are unchanged. No migration and no mothership companion.

Type of Change

  • Bug fix

Testing

  • New integration tests: resume-steering.integration.ts (3) and the Slack lock-skip case in slack-identities.integration.ts.
  • The rewritten catalog.test.ts (12) passes.
  • Related unit suites (13,367) and the execute-tool, slack-identities, resume-steering and pause-persistence integration suites (53) pass.
  • Audits pass: test-types, test-patterns, comment-hygiene, boundaries, unused-exports, file-names, tool-registry-boundary, explicit-any.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…ck refreshes without waiting on another sweep, parse each tool call once

- An integration test runs a deployed workflow that pauses for approval: resumed by its starter, the Organization Search block runs; resumed by another member, it refuses, and keeps refusing after a later timer resume.
- The catalog test checks what construction does not guarantee: every operation a tool performs admits the executor delegation, and the Assistant has the tool.
- The Slack identity sweep enrolls new organizations once, then leases with FOR UPDATE SKIP LOCKED, so a row another sweep holds is skipped rather than waited on.
- An organization tool call parses its input once (prepare), so the workflow handler no longer parses twice; catalog entries drop the name and title they repeated; the Search MCP's tool runner lives in the server that uses it; block descriptions point only to the operations the block lists.
@vercel

vercel Bot commented Dec 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 1, 2026 6:02pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 10 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds end-to-end checks for resume steering and changes Slack refreshes to skip locked rows.

  • Slack identity sweeps skip locked rows and refresh the next due organization.
  • Organization Search calls parse inputs once and share catalog details across surfaces.
  • A workflow test checks resume identity before an Organization Search block runs.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Start Slack sweep] --> B[Enroll new organizations at epoch]
  B --> C[Select next due unlocked row]
  C --> D[Set lease token and expiry]
  D --> E[Read Slack members]
  E --> F{Lease token still matches?}
  F -->|Yes| G[Save identities and next refresh]
  F -->|No| H[Discard this result]
Loading

Reviews (1) · Last reviewed commit: "fix(organization-search): prove resume s..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit af68b1e into staging Dec 1, 2026
75 of 83 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/organization-search-audit-followups branch December 1, 2026 18:08

This branch was previously deployed

1 inactive deployment
Preview — 1f553685 Deployed Dec 1, 2026 by vercel[bot]
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