Control State And Artifact Retention
Control State
Bootstrap operations now track a lightweight control-state snapshot per cell_group.
The current model records:
attach_freeze:inactiveoractivedrain:idle,draining, ordrainedsource_change_id,source_command,reason, andchanged_at
The state lives in the BEAM and is intended for bounded operational coordination, not long-term persistence.
Request Contract
Control-state mutations are requested through metadata.control.
Example:
{
"metadata": {
"control": {
"attach_freeze": "activate",
"drain": "start"
}
}
}Supported intents:
attach_freeze:activate,releasedrain:start,complete,clear
Validation And Verify Checks
precheck and verify now understand these bounded checks:
attach_freeze_activedrain_activecell_group_draineddrain_idle
This lets skills and operators gate backend work on explicit freeze and drain state without inventing separate ad hoc probes.
Observe Contract
observe now returns:
control_stateincident_summary.severityincident_summary.reasonsincident_summary.suggested_next
This is the repo-local incident brief that dashboard and skills can consume before a human decides to continue, rollback, or capture more evidence.
Artifact Retention
Bootstrap artifact naming remains deterministic and append-only by reference id.
- change-scoped plans and state:
artifacts/plans/<change_id>.jsonartifacts/changes/<change_id>.jsonartifacts/verify/<change_id>.jsonartifacts/rollback_plans/<change_id>.jsonartifacts/approvals/<change_id>-<command>.json
- capture-scoped support artifacts:
artifacts/captures/<incident_id-or-change_id>.jsonartifacts/config_snapshots/<incident_id-or-change_id>.jsonartifacts/control_snapshots/<incident_id-or-change_id>.jsonartifacts/probe_snapshots/<incident_id-or-change_id>.json
Retention policy is intentionally simple for bootstrap:
- never overwrite a different reference id
- rewrite the same reference id deterministically
- keep runtime logs and generated confs under
artifacts/runtime/<change_id>/ - treat cleanup as an explicit operator action, not automatic garbage collection
Current explicit cleanup contract:
mix ran.prune_artifactsplans retention without deleting anythingmix ran.prune_artifacts --applydeletes only entries selected by the planner- default keep limits:
- JSON artifact refs:
20per category - runtime directories:
8 - release bundle directories:
5
- JSON artifact refs:
artifacts/control_state/*is protected by default and excluded from pruning
Operator Debug Artifacts
Target-host staging and remote execution now also produce operator-facing debug bundles:
artifacts/deploy_preview/quick_install/<run_stamp>/debug-summary.txtartifacts/deploy_preview/quick_install/<run_stamp>/debug-pack.txtartifacts/install_runs/<host>/<run_stamp>-ship/debug-summary.txtartifacts/install_runs/<host>/<run_stamp>-ship/debug-pack.txtartifacts/remote_runs/<host>/<run_stamp>-<command>/debug-summary.txtartifacts/remote_runs/<host>/<run_stamp>-<command>/debug-pack.txtartifacts/remote_runs/<host>/<run_stamp>-<command>/fetch/debug-summary.txtartifacts/remote_runs/<host>/<run_stamp>-<command>/fetch/debug-pack.txt
These are not yet pruned by a separate policy. They live beside the run they describe so operators can inspect one directory and stop.
See 14-debug-and-evidence-workflow.md for the triage path that consumes them.