Repository navigation
feat(workflows): dry runs stub reads that depend on a stubbed write, and flag MCP tools servers call read-only - #10416
Open
waleedlatif1 wants to merge 2 commits into
Open
waleedlatif1 wants to merge 2 commits into
waleedlatif1 wants to merge 2 commits into
Conversation
…and flag MCP tools servers call read-only Placeholder values are distinctive: the dry-run sample mints each string it makes up as dryRunId(<field>, n) and each number as dryRunNumber(n) (above 900000000), beside the ids dryRunOutput hooks mint. The policy registers the placeholders of every answer it returns (stubbed writes, derived reads, blocks answered whole; never mocks or real results), per run and with no hook signature change. A read that would send a registered placeholder (a token anywhere in a string, in any case and ending at its _<digits>, or a number whole or as a digit run) is not sent and is listed in stubbed with dependsOnStub: a read tool's declared params, an HTTP GET/HEAD/OPTIONS (readsWhen reads go through the same check), an MCP call's arguments, and a GET/HEAD/OPTIONS fetch code makes in the isolate (its URL or body; answered with the empty stubbed 200 and left out of the --allow hint). Create-then-read chains, by id or by number, no longer reach the provider; free text quoting a placeholder counts too. Runs without a side-effect policy do no extra work. MCP tools keep their readOnlyHint/destructiveHint annotations, but a dry run never acts on them: annotations are the server's unverified claim. A held-back MCP call is still authorized and checked against an uncached tools/list without being sent; the check reports what it learned of the tool, so the stubbed entry carries readOnlyHint (read-only and not destructive), the CLI says --allow '<block>' sends it, and the placeholder samples the tool's outputSchema as structuredContent (integer as number, a union as its first non-null member, untyped fields left out). MCP block entries (stubbed and allowed) record the MCP server and tool they named, and allowed ones are deduplicated by it. Workflow test reports keep mcp, dependsOnStub and readOnlyHint. The v2 MCP tools route projects the strict contract fields, since discovered tools now carry annotations. Effect labels reviewed, unchanged: firecrawl_crawl and firecrawl_extract start async provider jobs with their own ids (write); slack_message_reader opens a DM conversation via conversations.open when given a user (param-dependent, write).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
[Medium impact] The changes affect dry-run behavior across workflow tools and their reports. Fix saved-report compatibility and the two incorrect read decisions before merging. FindingsSummaryThis PR gives dry-run outputs recognizable placeholders and skips reads that would send them. It also carries MCP read-only hints and output shapes into dry-run results.
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 31 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
…n code header values, and old test reports still parse
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dry_run_<field>_<n>and every number is above 900000000; hooks mint ids withdryRunIdfetchall count; each is recorded insideEffects.stubbedwithdependsOnStub: true(matching is exact per run: token boundaries, any case, numbers whole or as digit runs, bounded scan)readOnlyHint/destructiveHintannotations; a dry run still stubs every MCP call (annotations are server claims Sim can't verify) but flagsreadOnlyHintso--allow '<block>'is the one step to send it; stubbed MCP calls return a placeholder built from the tool'soutputSchema, and entries name the MCP server/tool instead ofmcp_run_operationdependsOnStub,readOnlyHintand the MCP toolfirecrawl_crawl,firecrawl_extractandslack_message_readerwere re-checked against the read rule and staywrite(async provider jobs; a DM open)Type of Change
Testing
dry-run.integration.ts(real Postgres/Redis, a real Streamable HTTP MCP fixture server, loopback HTTP server): MCP stubbed with readOnlyHint and outputSchema placeholders,--allowsends, derived-read chains across table, MCP, GitHub-by-number, Functionfetchand API GET, a real id still sent, non-dry run unaffected; each guard red-proofed (50/50)lib/workflows/dry-run/placeholders.test.ts(match / no-match cases), MCP use-case, client, internal MCP, v2 mcp-servers, workflow-tests and Mothership tests-tool suites; sim-cli protocol tests; type-check; lint; generateChecklist
test-auditauthoring gate)