| name | write-summary |
| description | Stage 4 (final). Write a 1-paragraph natural-language summary of the regression results. Triggers when state.stage == "tabulated". |
Write summary
Pre
Read state/state.json. Confirm state.stage == "tabulated" and
state.artifacts.regression is populated.
Act
Ensure the output directory exists (mkdir -p summary), then generate a
1-paragraph summary at summary/summary.md. Format:
Over {n_obs} monthly observations, the portfolio earned a CAPM
alpha of {alpha:.4f} ({t_alpha:.2f}) per month and a market beta
of {beta:.4f} ({t_beta:.2f}). The R-squared was {r2:.3f}. Alpha
[is / is not] statistically significant at the 5% level.
The "[is / is not]" decision must be made from the actual t-stat (|t| >= 1.96).
Do NOT hedge. Do NOT add extra interpretation beyond what the numbers say.
Verify -- via subagent
Spawn the verifier subagent with the prompt:
"Read summary/summary.md and state/state.json. Confirm every number
in the summary matches state.artifacts.regression. Confirm the
significance call matches the t-stat. Reply OK or list discrepancies."
If verifier returns anything other than OK: halt with the discrepancy as halt_reason.
Post
state.artifacts.summary_path = "summary/summary.md"
state.stage = "done"
state.last_action = {...}
Run python scripts/verify_state.py. We are done.