Reading the state comment
How to read the sticky comment, the state values, and check run conclusions.
Each turn updates one pull request comment in place. The body starts with the marker <!-- autofeat:state -->. The author is autofeat-axc[bot].
Find it with the comments API, or read the journal. The recipe is on State schema.
Banners
Zero, one, or two banner lines sit above the table. They use GitHub alert syntax.
| Banner | When |
|---|---|
> [!CAUTION] | A budget alert fired on the last run, or the state is failed. |
> [!WARNING] | ledger.alert_fired is true: spend reached budget.alert_usd. |
No banner means neither of those fired. A warning is not a hard stop. A caution on a budget alert means the run is red.
Table
The human-readable part is a two-column table.
| Field | Value |
|---|---|
| state | Current state name. List below. |
| turn | Loop turn counter. |
| spend | usd=<n> tokens=<n> minutes=<n> runs=<n> from the ledger. |
| last_run_id | Id of the latest run, or -. |
| head_sha | Head SHA this state applies to, or -. |
| policy_sha | Default-branch commit whose config judged the run, or -. |
Example shape:
<!-- autofeat:state -->
> [!WARNING]
> **autofeat spend alert: usd=10.0 reached budget.alert_usd**
| Field | Value |
| --- | --- |
| state | reviewing |
| turn | 2 |
| spend | usd=10.0 tokens=400000 minutes=12.0 runs=2 |
| last_run_id | 01JABC... |
| head_sha | abcdef1234567890 |
| policy_sha | fedcba0987654321 |Under the table, an HTML comment holds a json fence. That object is the RunState. Do not edit it. The signature covers that object. Field list: State schema.
State values
| State | Meaning |
|---|---|
queued | Accepted. A stage has not started. |
planning | plan is in progress. |
specced | plan finished. |
implementing | implement is in progress. |
testing | test is in progress, or implement finished and test is next. |
reviewing | review is in progress. |
gating | gate is in progress, or review finished and gate is next. |
waiting_for_author | The run stopped for the author. Not terminal. Push a new head. |
approved | approve_only finished an approval and did not merge. Not terminal. |
ready | Waiting for a human merge. Autofeat sets autofeat:ready. Not terminal. |
merging | Merge is in progress. |
merged | Merge completed. Terminal. |
done | Terminal finished state in the schema. The merge path records ready or merged. |
halted | A halt action finished. Terminal. |
failed | The stage failed. Not terminal. Push a new head to try again. |
budget_exceeded | A hard budget ceiling stopped the run. Terminal until you raise budget.* or an operator reconciles. |
Terminal states have no legal next state: done, merged, halted, budget_exceeded.
review_only (the default) uses review, gate, merge, and halt. You will not see planning, implementing, or testing unless policy.mode is full.
Check run conclusions
Each stage writes one check run named autofeat/<action> on the head SHA. Status moves queued -> in_progress -> completed.
| Conclusion | Meaning |
|---|---|
success | The stage succeeded and writes ran. |
neutral | Dry run (summary starts with Dry run), or the run is waiting for the author. |
failure | Policy or guard refusal, failed stage, crash, or a blocking budget alert. |
cancelled | Operator stop or cancel. |
Filter names you will see on a review_only repository: autofeat/review, autofeat/gate, autofeat/merge.