Repository navigation
Conversation
Add create_python_scenario and set_python_scenario_script, narrow Design-only direct writes for custom_python scenarios. Cobuild creates only step-based scenarios and cannot edit a scenario's script. Creation makes the scenario inactive and without triggers, saves the script, and confirms it by reading it back. When the scenario exists but its script is not confirmed, the tool returns python_scenario_script_unconfirmed with the scenario_id instead of reporting success. Script edits replace the whole script, keep every other setting, and refuse step-based scenarios. get_scenario_settings now includes the script of a Python-script scenario. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dataiku accepts duplicate scenario names, so a create retried after a lost response could leave a second scenario holding Dataiku's sample script. The tool now refuses a name already in use and returns that scenario's id. Also state the Python-script scenario exception consistently in the capability matrix and routing convention, and correct the skill's note on code environments for existing scenarios. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Prompted by user feedback.
Adds Python-script scenarios (scenario type
custom_python) to Headless. Cobuild creates only step-based scenarios and cannot edit a scenario's script, so there was no supported path. This PR adds two narrow Design-only direct writes and exposes the script in the existing inspection tool.Dataiku accepts duplicate scenario names, so the name check keeps a retried call from leaving a second scenario that holds the sample script.
Why
settings.save()and not the script endpoint alone: the definition save runs Dataiku's code-permission and license checks for Python scenarios, and the SDK performs it before the script write. A caller Dataiku refuses therefore never reaches the script.dataiku_mcp/tools/scenarios.py + create_python_scenario, set_python_scenario_script (PROJECT_EDIT_POLICY) ~ get_scenario_settings returns the script of a Python-script scenario CODING_STANDARDS_AND_STRUCTURE.md + fixed exception in the Cobuild write-routing convention docs/capabilities.md + inventory, Automation exclusions, 133 tools skills/dataiku-headless/ SKILL.md + routing for Python-script scenarios; Automation exclusion references/scenarios.md + scenario types; "Python-Script Scenarios" workflow, recovery from an unconfirmed script, safety rules tests/test_python_scenarios.py + 18 focused tests tests/test_tool_surface.py, tests/test_instance_policy.py + pinned surface and Design-only policyOut of scope: the scenario's Python code environment (the scenario inherits the default), and triggers, reporters, and activation, which stay with Cobuild as for any scenario.
Evidence
Before: Cobuild created only step-based scenarios (at most with a
custom_pythonstep), and no tool could read or write a scenario's script.After, automated:
tests/test_python_scenarios.py(fakes mirror the SDK's definition-then-script save order; no live instance)Local gates on this head:
uv sync --locked,uv run pre-commit run --all-files(all hooks pass),uv run pytest(852 passed),uv buildplus wheel import smoke on Python 3.12,cz checkon the branch.After, live: run against a personal Design node on DSS 15.0.0 through the real stdio launcher (
uv run --locked --script runtime/run_mcp.py --transport stdio), calling the registered tools over MCP in a synthetic scratch project. The script only wrote a marker into that project's own variables and printed it. The test used no reporters, email, inference, or external calls.Merge Danger
Door: two-way
The tools only add capabilities. Reverting removes them; scenarios created through them remain ordinary Python-script scenarios that the UI can edit or delete.
Blast Radius: moderate
A Python-script scenario runs arbitrary Python as its run-as user when someone runs it. Creation never runs it: scenarios start inactive without triggers, and Dataiku still requires code-writing permission and a license for Python scenarios. A script save rewrites the scenario definition just read, so a concurrent edit to that scenario is lost (documented in the skill).
get_scenario_settingsresponses for Python-script scenarios grow by the script. The catalog grows by two tools (133).Shared files with #213 (recipe code environment): both PRs edit the tool total in
docs/capabilities.md, the Automation exclusion lists, the routing convention, and the pinned tool tests. The diffs are independent, but whichever merges second needs a small textual rebase (134 tools in total).🤖 Generated with Claude Code