Runtime artifacts

Workflow and test runners need two kinds of output: what humans see right now (progress, status) and what is left behind after the process exits (replay, diffs, CI reports). Jaiph keeps those separate: the live channel is __JAIPH_EVENT__ JSON lines on the child process’s stderr; the durable side is a tree of files under the project workspace so you can inspect, diff, and archive a run after it finishes.

When you run a workflow, or jaiph test executes workflows inside test blocks, the Node workflow runtime materializes that durable tree. By default it lives at <workspace>/.jaiph/runs/; you can point it elsewhere with run.logs_dir / JAIPH_RUNS_DIR (see Configuration — Run keys). The layout below is what NodeWorkflowRuntime writes.

Run directory layout

The runtime uses a UTC-dated hierarchy. Each run gets its own folder: UTC date, then UTC time plus a basename derived from JAIPH_SOURCE_FILE when set, otherwise the entry module’s file basename.

.jaiph/runs/
  <YYYY-MM-DD>/                       # UTC date (see NodeWorkflowRuntime)
    <HH-MM-SS>-<source-basename>/       # UTC time + basename (see above)
      000001-module__step.out          # stdout capture per step (6-digit seq prefix)
      000001-module__step.err          # stderr capture (when non-empty)
      artifacts/                       # user-published files (`jaiphlang/artifacts`); `JAIPH_ARTIFACTS_DIR`
      inbox/                           # inbox message files (when channels are used)
      heartbeat                        # liveness: epoch ms, refreshed about every 10s
      return_value.txt                 # present if `default` workflow exited 0 and returned a value
      run_summary.jsonl                # durable event timeline (JSON Lines)

Sequence numbers in those filenames are monotonic and unique per run: a single in-memory counter in NodeWorkflowRuntime increments for each step capture. The separate seq-alloc helper is a file-backed allocator for tooling; ordinary runs do not use a .seq file in the run directory. For the full system picture, see Architecture — Durable artifact layout and Architecture — Contracts (__JAIPH_EVENT__ on stderr is the live path).

What each artifact is for

Keeping runs out of git

Run jaiph init to add .jaiph/.gitignore entries for runs and tmp under .jaiph/. You can mirror those paths in a root .gitignore if you prefer.