forge_save
Save a tap to disk as .tap.json and auto-commit to git. Optionally verify the saved tap against examples to assert row-shape contracts.
Instructions
Save the tap to disk as .tap.json and auto-commit to git. Accepts either a structured plan (W3C Annotation wrapping an ExecutionPlan body — preferred) or code (legacy .tap.js source, migrated to a plan on write). Falls back to code from the active forge.draft session when neither is passed. After saving, tap.run can execute it forever with zero AI.
Optional verify_examples runs the just-saved tap against the supplied examples and asserts row-shape contracts (min_rows, non_empty, max_elapsed_ms). When all examples pass, the response includes doctor (verdict from running tap.doctor on the saved tap). When any example fails, the response includes regenerated_inspect — a fresh forge.inspect on the same URL — so the agent can re-forge in one round-trip instead of three. When omitted, behavior is unchanged and the response carries doctor: "indeterminate".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | ||
| name | Yes | ||
| plan | No | TapAnnotation envelope — W3C Annotation with body:tap:ExecutionPlan. Preferred over code. | |
| code | No | Optional — legacy .tap.js source; auto-migrated to a plan on save | |
| verify_examples | No | Optional auto-verify hook (issue #31). Each example runs the just-saved tap with `args` and asserts the result against `expect`. On any failure the response gains `ok:false` and `regenerated_inspect` (a fresh forge.inspect on the saved URL). |