Skip to content

Python SDK release notes

All notable changes to the diteko Python package. The format follows Keep a Changelog, and versions follow Semantic Versioning as described under “Versioning” in the README.

  • Test.route: the flow blocks a test goes through, in order (API 1.7); None from an older server.
  • diteko triage labels a failure after a changed block flow_change (rule after-change): the test’s route went through a block the change touched before the block where it failed, as when a key the change rewired leads to a different branch. It needs a server with API 1.7; with an older server those failures stay inconclusive, as before. The first live recordings, a reworded prompt and a key swap on the Card Services sample, are replayed in the tests.
  • diteko triage: why each live test a failed gate saw fail (docs/design-note-diteko-triage.md). It reads diteko-gate.json and labels each test flow_change, test_at_fault, environment or inconclusive, with the evidence behind it: the failure point, whether the change touched that block, the flow’s instance-dependent diagnostics there, and any values the test made up. Rules decide; no model is called. It writes diteko-triage.json and triage.md, needs a READ key and API 1.6, and never changes the gate’s verdict. diteko.triage.triage() in Python.
  • diteko gate: a change review for Contact Flow pipelines (docs/design-note-diteko-gate.md). Run after flows are deployed to a test Connect instance. Each flow is imported and checked, then compared with the flow its suite was evolved from. The tests the change affects get a dry run and, with --live, a run on Connect within --max-executions. It writes diteko-gate.json, junit.xml and summary.md, and exits 0 (passed or unchanged), 1 (failed), 2 (budget) or 3 (configuration). Needs a server with API 1.6 (server 0.4). The same logic is diteko.gate.gate() in Python. A GitHub Action wraps it: Lehlohonolo-Sehako/diteko-selfhost/gate.

The new calls need a server with API 1.6 (server 0.4); an older server is refused with a clear error.

  • Execution.outcome(test_id): one test’s outcome in full, for triage, with the failure point as fields and Connect’s records. MCP: get_test_outcome.
  • Project.diff(definition=None, connect_flow_id=None): what changed in the flow, block by block. MCP: diff_flow.
  • Run.suite(..., touching=[...]) and Project.suite(..., touching=[...]): only the tests whose route passes through those blocks, for listing and for publish_to_connect(). MCP: touching_blocks on list_tests and publish_suite.
  • Execution.flow_content_sha256: the hash of the flow content a Connect run tested.
  • Run.error reads the reason from the progress when the server sends it.

Works with the same servers as 0.7.0. list_tests(connect_only=True) needs server 0.3 (API 1.5).

  • MCP tools for agents: whoami, validate_flow, list_connect_flows, save_grammar (edit a grammar and see its errors), test_grammar, list_tests (with connect_only) and list_connect_runs.
  • Project.imported: what the server said about an import from Connect, warnings such as REPLACED_FLOW included. Grammar.warnings (the generator’s) and Grammar.validation (the last validation). Grammar.test(), Run.error, Run.connect_runs() and Diteko.connect_flows().
  • The MCP tools stop dropping what the server reports. import_flow returns the flow’s coded diagnostics and, from Connect, the import warnings. generate_grammar returns valid, errors and warnings rather than failing on an invalid grammar. get_run says why a failed run failed.
  • Run.wait() names the server’s reason when a run fails.
  • Generating a grammar for a project that already has one replaces it, as the console’s Generate does. It used to store a second grammar under the same name, which the server refused with HTTP 409, so project.grammar.generate() and the MCP generate_grammar failed on every project that had a grammar. Found by the agent evals.
  • import_flow is now marked as reaching an external system: with a Connect flow id it reads the Connect instance.

Suite.connect_tests needs server 0.3 (API 1.5); everything else works with the same servers as 0.6.0.

  • Suite.connect_tests: the tests publish_to_connect() publishes, in the same order and size. Suite.tests lists every test the run kept, which can differ: Connect cannot run some of them, and the published suite is drawn from the rest. Needs a server with API 1.5 or later; an older server is refused with a clear error rather than answering with the unfiltered list.
  • The self-hosting files bundled for diteko server default to the server’s 0.3 image line.
  • Project.evolve(strategy=...): rank a run by "weighted" (the weighted sum, as before), "pareto" or "lexicographic" (heaviest weight first). The server has supported all three; the SDK only ever sent the weighted sum.
  • Diteko.fitness_functions(): the catalogue of fitness functions a run can weigh, with ids for evolve(weights=...).
  • STRATEGIES, exported next to SIZES and FOCUS.
  • Project.validate() returns the flow’s health as diagnostics: [{code, severity, blockId, message}], for example UNRENDERED_PLACEHOLDER for a Terraform template that was never rendered (needs a server with flow health).
  • Exports are the minimal suite by default (server 0.2 and later). Without top, export_json, export_native and export_xlsx return the fewest tests that cover every decision outcome the suite covers, instead of every test. Pass full=True for every test. With top, nothing changes.
  • The package summary and README describe what the SDK does rather than how hard it searches.
  • A Funding link on PyPI, and a “Support Diteko” section in this README.
  • diteko server up, status and down: start a Diteko server on this machine with only Docker installed. The self-hosting files ship inside the package (a copy of self-hosting/, kept identical by a test), the settings are written in Python as setup.sh writes them (so it works on Windows too), and the first start creates a WRITE key and prints what to set. A later up refreshes the server’s files and keeps your settings. --latest uses the newest diteko-selfhost release instead (checked against its SHA256SUMS), --bundle a local folder, --port another port. When Docker is missing, stopped or may not pull the image, it says so.
  • The “no server answered” error mentions diteko server up.
  • A server started with diteko server up serves the API reference and links its console to the docs site (DITEKO_DOCS_URL in its .env; empty hides the links).
  • MCP tool get_execution(upload_id): a Connect run’s status, verdicts, inconclusive count and per-test results. Diteko.execution(upload_id) does the same from Python.
  • [project.urls], so PyPI links to where you can run a server.
  • The default server address is http://localhost:8080, where a self-hosted Diteko listens, instead of :8888, which only Diteko’s own development setup uses. DITEKO_URL and url= work as before.
  • MCP publish_suite returns at once with the upload id and status, instead of holding one tool call open for up to 30 minutes. Poll get_execution for the verdicts.
  • When no server answers, the error says the SDK needs a running Diteko server, how to point at one (DITEKO_URL) and where to get one. Connecting gives up after 10 seconds.
  • An address that is not a Diteko server (a 404 without a problem body on /api/version, or a page that is not JSON) is reported as such, instead of a warning followed by a page of HTML. HTML in any error is reduced to its text and cut to 300 characters.
  • The version check runs again on the next call when the server could not be reached, instead of being skipped for the rest of the session.
  • evolve(preset="thorough") uses a per-bit mutation rate of 0.05 instead of 0.1, like the console’s Thorough size: on the largest corpus flow it did better and was never worse elsewhere. Quick and standard runs are unchanged.
  • Execution.wait() returned only on COMPLETED, so a run a server restart cut off (INTERRUPTED) blocked for the full 30-minute timeout. Every status but RUNNING now ends the wait, and INTERRUPTED raises DitekoError asking you to publish again.
  • Verdict.attempts and Verdict.passed_on_rerun. A server on API 1.2 re-runs a test that failed, once, because Connect’s prompt recognition sometimes misses a prompt the flow played; a pass on the re-run is reported as a pass with attempts == 2. Older servers leave attempts as None.
  • Run.wait(progress=True) keeps a line on stderr up to date while a run evolves; pass a callable instead to receive a RunProgress whenever the generation or status changes.
  • Typed views alongside the raw responses: Run.info (RunProgress), Project.info (ProjectInfo: grammar, latest run, suite, last execution), Execution.results (Verdicts with Connect’s message) and Execution.inconclusive.
  • Diteko() reads DITEKO_URL when no address is given, as diteko-mcp already did.
  • A getting-started guide in this README, and examples/cxblueprint_to_excel.py (and the same as a notebook): from a cxblueprint flow to an Excel test script.
  • A project’s last execution no longer reads as RUNNING for a moment after the execution reported COMPLETED (fixed server-side).
  • The first call checks that the server speaks this SDK’s API major version (GET /api/version, API 1.x). A server on another major is refused with an error that says which side to upgrade; a server that predates version reporting gets a warning, not a failure. Diteko(..., check_version=False) skips the check.
  • Diteko.version() returns the server’s API version and build.
  • API keys: the SDK and diteko-mcp send DITEKO_API_KEY (or Diteko(api_key=...)) to servers that require keys (API 1.1). A missing key, a refused key and a key without permission each raise a DitekoError that says which. Diteko.whoami() returns the key in use.
  • Moving a record to another parent with a partial update (for example a grammar to another flow) no longer fails on the server (fixed server-side, Diteko API 1.0).
  • First release: projects from Connect exports, cxblueprint flows or a Connect instance; grammars as BNF or JSON; evolution with size and focus presets; suites exported as an Excel test script (ISO/IEC/IEEE 29119-3), JSON or Connect native tests; publishing to Connect, dry run by default.
  • diteko-mcp, an MCP server exposing the same pipeline as eight tools, on mcp 1.x or 2.x.