ami_mark_stage
Mark each workflow stage as you enter it to capture an accurate Agent Effort Profile. Close the final stage to prevent post-work from being attributed to it.
Instructions
Declare the workflow stage you are entering, e.g. 'Classify Severity' or 'Draft Customer Reply'. Call it as you move through the workflow to get a declared-stage Agent Effort Profile; without markers the profile falls back to AMI-observed execution phases. No survey run is needed first: markers emitted before ami_survey_begin are buffered with the timestamp you emitted them at and attached to the run when it opens. When the last stage is done, call once more with closes=true - each marker ends the stage before it, so without a closing one the final stage runs to the end of the measurement window and absorbs everything you do afterwards.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Optional workspace override; buffered markers are adopted by a run opened in the same workspace. | |
| note | No | ||
| stage | No | Name of the stage being entered. | |
| closes | No | True to end declared work rather than start a stage. Call this when the final stage is complete, before you verify output or report back; work after it is attributed to observed phases instead of to a stage. | |
| run_id | No | ||
| marked_at | No | ISO-8601; defaults to now. |