Skip to content

achieves

achieves

Declare the machine’s goal and success criteria. The achieves section defines what the machine is trying to accomplish, what success looks like, what it must never do, and provides concrete input/output examples. This is the machine’s specification: a human-readable contract that drives both testing and evaluation.

When to use

Every machine should have an achieves section. It serves three purposes:

  1. Documentation: tells humans (and Koda) what the machine does
  2. Implicit tests: for example blocks are executable test cases
  3. Evaluation: succeeds when criteria are checked by mashin run --to evaluate

Omit it only for trivial utility machines where the purpose is self-evident from the name and contract.

Syntax

achieves
goal "<description>"
succeeds when "<success_criterion>"
never "<constraint>"
for example
given { <input_field>: <value>, ... }
expect { <output_field>: <value>, ... }

Components

ComponentRequiredDescription
goal "<description>"YesWhat the machine achieves. One sentence, specific and measurable.
succeeds when "<criterion>"RecommendedQuantifiable success condition. Used by the evaluate interpretation mode.
never "<constraint>"RecommendedHard constraints the machine must not violate. Compiled into guardrail checks.
for exampleRecommendedConcrete input/output pairs. Each for example block is an implicit test case.

for example blocks

Each example provides a given (inputs) and expect (expected outputs):

for example
given {message: "My payment failed"}
expect {team: "billing", confidence: 0.95}

These examples are:

  • Executable as tests during mashin test
  • Shown in Koda when inspecting the machine
  • Used by mashin run --to evaluate to check metrics
  • Displayed in the visual builder as documentation

Examples

Simple goal with examples

achieves
goal "Classify support tickets by department"
succeeds when "correct department >90% of the time"
never "expose customer PII in routing metadata"
for example
given {message: "My payment failed"}
expect {team: "billing"}
for example
given {message: "I can't log in to my account"}
expect {team: "technical"}

Research assistant goal

achieves
goal "Answer research questions with cited sources"
succeeds when "answer != null and sources_count > 0"
never "fabricate sources or citations"
for example
given {question: "What is Rice's theorem?"}
expect {answer: "Rice's theorem states...", sources_count: 2}

Data pipeline goal

achieves
goal "Clean messy data by handling missing values and reshaping for analysis"
succeeds when "completeness >= 90% after cleaning"

Multi-constraint goal

achieves
goal "Route incoming emails to the correct team and draft responses"
succeeds when "routing accuracy > 95% and response quality rating > 4.0/5.0"
never "send a response without human approval for VIP customers"
never "include internal notes or ticket IDs in customer-facing responses"
for example
given {subject: "Billing question", body: "Why was I charged twice?", is_vip: false}
expect {team: "billing", priority: "high", needs_response: true}
for example
given {subject: "Thanks!", body: "Just wanted to say thanks for the quick resolution", is_vip: false}
expect {team: "general", priority: "low", needs_response: false}

Relationship to verifies

achieves > for example blocks and verifies > test blocks serve related but distinct purposes:

for example (in achieves)test (in verifies)
PurposeSpecification by exampleExplicit test cases
FocusWhat success looks likeEdge cases, error paths, integration
VisibilityShown in documentation and KodaUsed by test runner
MockingNo assuming supportFull assuming support for mocking steps
GranularityInput/output onlyCan assert on intermediate step values

Both are executed during mashin test. A well-specified machine has for example blocks for the happy path and test blocks for edge cases and failure modes.

Governance

The achieves section directly informs governance:

  1. never constraints compile into guardrail checks. The governance interpreter can reference them during step execution.
  2. succeeds when criteria are used by mashin run --to evaluate to assess machine performance against declared targets.
  3. for example blocks provide the reference data for evaluation metrics in the optimizes section.

The achieves section is a compile-time declaration with runtime implications. It does not directly cost anything to declare, but the governance features it enables (guardrails, evaluation) are active during execution.

Translations

LanguageKeyword
Englishachieves
Spanishlogra
Frenchatteint
Germanerreicht
Japanese達成
Chinese达成
Korean달성

Sub-keywords

EnglishSpanishFrenchGermanJapaneseChineseKorean
goalmetaobjectifZiel目標目标목표
succeeds whenexito cuandoreussit quanderfolgreich wenn成功条件成功条件성공 조건
nevernuncajamaisniemals禁止事項禁止금지
for examplepor ejemplopar exemplezum Beispiel例えば例如예를 들어

See also

  • verifies - Explicit test cases with mocking
  • ensures - Governance rules that enforce constraints
  • optimizes - Metrics and fitness criteria
  • accepts - Input fields referenced in given blocks
  • responds with - Output fields referenced in expect blocks