| id | title |
|---|---|
task-target-schema |
Morphir Task and Target Schema (Draft) |
This document defines a draft schema for tasks and targets in morphir.toml.
Targets are conventional task names/aliases (e.g., build, test, clean).
- Configure tasks and targets in
morphir.toml. - Support dependencies, inputs/outputs, parameters, and env vars.
- Support intrinsic actions and external commands.
- Ensure outputs are JSON-serializable.
- Run external commands sandboxed by default (explicit RW mounts).
[tasks]
[tasks.build]
depends_on = ["compile", "analyze"]
pre = ["setup"]
post = ["summarize"]
[tasks.compile]
kind = "intrinsic"
action = "morphir.pipeline.compile"
inputs = ["workspace:/src/**/*.elm"]
outputs = ["workspace:/build/**"]
params = { profile = "dev" }
env = { GOFLAGS = "-mod=mod" }
mounts = { workspace = "rw", config = "ro", env = "ro" }
[tasks.analyze]
kind = "intrinsic"
action = "morphir.analyzer.run"
inputs = ["workspace:/build/**"]
outputs = ["workspace:/reports/analyzer.json"]
[tasks.codegen]
kind = "command"
cmd = ["morphir", "gen", "--target", "Scala"]
inputs = ["workspace:/morphir-ir.json"]
outputs = ["workspace:/dist/**"]
mounts = { workspace = "rw", config = "ro", env = "ro" }
[tasks.setup]
kind = "command"
cmd = ["./scripts/setup.sh"]
mounts = { workspace = "rw", env = "ro" }
[tasks.summarize]
kind = "intrinsic"
action = "morphir.report.summary"
inputs = ["workspace:/reports/**"]
outputs = ["workspace:/reports/summary.json"]kind:intrinsicorcommand.action: intrinsic action identifier (forkind = "intrinsic").cmd: external command (forkind = "command"), array form.depends_on: list of task names to run before this task.pre: list of task names to run immediately before this task.post: list of task names to run immediately after this task.inputs: list of VPath globs used for caching and incremental builds.outputs: list of VPath globs produced by the task.params: task parameters (key/value).env: environment variables for the task.mounts: mount permissions (roorrw).
Tasks should emit JSON-serializable output data (stdout for structured results). Diagnostics and progress logs should go to stderr.
External commands run sandboxed by default:
- Only mounts explicitly marked
rware writable. - Read-only mounts are visible but not writable.
- Opt-in to broader access should be explicit.
- Should we allow task-level timeouts and retries?
- Do we need composite task definitions beyond pre/post hooks?