Skip to content

ai-pipeline

Enterprise Part of the commercial Kumiko Enterprise offering — not in the open framework.

Tenant-editable policy layer for AI pipelines whose step structure lives in code. The app author declares one AiStepSpec per step instance (stable stepKey, a zod params schema, default policy, optional dryRun runner) and passes them to createAiPipelineFeature. A TenantAdmin overrides enabled/providerId/model/params per step: ai-pipeline:write:set-policy saves and activates it in one call (the shipped editor UI’s contract); draft/activate/rollback split that into an explicit review gate — a draft has no run-time effect until activate, and rollback restores an older revision. resolveStepPolicy(ctx, tenantId, spec) always resolves the highest ACTIVE revision, never a draft. Goldens (create-golden/delete-golden/goldens) are curated input/expectedOutput fixtures per step; dry-run executes a step’s declared dryRun runner against one golden with an ad-hoc, never-persisted policy/prompt override and reports whether the output matches, with usage/cost — no domain write. Use this when operators must retune AI behaviour live and preview a change before it goes live; the pipeline’s step order and wiring stay in code.

What this feature needs to run (Requires, top) and the write commands this feature provides (Provides, bottom).

flowchart TB
  n_ai_pipeline["ai-pipeline"]
  subgraph how_reqs["Requires"]
    n_tenant["tenant"]
    n_ai_foundation["ai-foundation"]
    n_prompt_store["prompt-store"]
  end
  subgraph how_provides["Provides"]
    n_cmd_ai_pipeline_write_activate(["activate"])
    n_cmd_ai_pipeline_write_create_golden(["create-golden"])
    n_cmd_ai_pipeline_write_delete_golden(["delete-golden"])
    n_cmd_ai_pipeline_write_draft(["draft"])
    n_cmd_ai_pipeline_write_rollback(["rollback"])
    n_cmd_ai_pipeline_write_set_policy(["set-policy"])
  end
  n_tenant --> n_ai_pipeline
  n_ai_foundation --> n_ai_pipeline
  n_prompt_store --> n_ai_pipeline
  n_ai_pipeline --> n_cmd_ai_pipeline_write_activate
  n_ai_pipeline --> n_cmd_ai_pipeline_write_create_golden
  n_ai_pipeline --> n_cmd_ai_pipeline_write_delete_golden
  n_ai_pipeline --> n_cmd_ai_pipeline_write_draft
  n_ai_pipeline --> n_cmd_ai_pipeline_write_rollback
  n_ai_pipeline --> n_cmd_ai_pipeline_write_set_policy

Provides — write commands this feature registers (dispatch them through the command bus):

  • ai-pipeline:write:activate
  • ai-pipeline:write:create-golden
  • ai-pipeline:write:delete-golden
  • ai-pipeline:write:draft
  • ai-pipeline:write:rollback
  • ai-pipeline:write:set-policy