Bundle of AI plan summary improvements that kill the production hallucinations observed on v0.30.3 and add an iteration loop for prompt/config tuning.
Bug Fixes
- PLAN_JSON cleaning — the API now strips no-op
resource_changes(withoutimporting), no-opoutput_changes, and the verboseprior_statesnapshot before the plan reaches the model. The model can no longer hallucinate "this resource is upgrading to 1.35" frombefore/aftersnapshots of a no-op cluster.resource_driftis preserved in full; the operator's audit signal for out-of-band changes is intact. - Prompt hardening — the skill prompt now teaches the model that
change.actionsis the only source of truth and thatresource_driftis NOT the apply change set. Adds explicit handling of "drift reverted" (elevated risk) vs "drift accepted" (informational). Description and risk-factor styles aligned so the rendered summary doesn't whiplash between bold-sectioned prose and plain single sentences. - Helm template default —
max_output_tokensinconfigmap-api.yamlhardcoded| default 1024independently of the v0.30.3 Pydantic-side bump to 16384. Aligned to 16384 in the chart.
Features
- CODE_DIFF input — new
*.tf/*.tfvarsunified-diff input computed from the current config-version tarball vs the previously-applied tarball. Authoritative record of what changed in source, anchoring the model when no-op snapshots in PLAN_JSON would otherwise mislead. Falls back to absent on first runs or GC'd prior CVs; zip-slip guarded; best-effort and never blocks the summariser. - Regenerate button — re-fire the AI summary on any post-plan run via a button in the summary card. Workspace
readis required; cost is gated byai_summary.daily_token_budget; manual clicks bypass the 5-min auto-dedup so iteration is fast. - New configuration:
ai_summary.code_diff_max_bytes(default 100_000) — upper bound on the CODE_DIFF input. Set to 0 to disable CODE_DIFF entirely.
Endpoint Changes
The AI summary endpoints are not part of the Terraform CLI surface (terraform/tofu/tfci do not consume them) and have moved to /api/terrapod/v1/:
GET /api/terrapod/v1/runs/{run_id}/plan-summary(was/api/v2/plans/{id}/summary)POST /api/terrapod/v1/runs/{run_id}/plan-summary/regenerate(new)
The ai-summary-url link in plan responses now points at the new path. Frontend updated to match. No client-side changes required for the Go SDK or Terraform provider — neither consumes this surface.
Status
Stable — fixes the v0.30.0/v0.30.1/v0.30.2/v0.30.3 AI summary quality regressions on real production plans. Deployments running with ai_summary.enabled=true should upgrade. If you pinned ai_summary.max_output_tokens or set ai_summary.context.prompt_suffix to work around v0.30.3 issues, you can now drop those overrides — the equivalent fixes live upstream.
Full Changelog: v0.30.3...v0.30.4