Files
reporting-governance-plugin/policy-packs/mandatory-checkpoint-structure/policy.yaml
2026-05-07 16:52:22 +08:00

213 lines
7.8 KiB
YAML

apiVersion: reporting-governance/v1alpha1
kind: PolicyPack
metadata:
id: mandatory-checkpoint-structure
title: Mandatory Checkpoint Structure
version: 1.0.0
summary: >-
Require checkpoint reports to include the minimum operator-usable structure
for status, completed work, next step, next reporting condition, and intervention need.
owner: reporting-governance-plugin
severity_default: medium
applies_to:
runtimes: [openclaw]
task_modes: [interactive, silent]
workflow_shapes: [single-agent, parent-child]
channels: [telegram]
tags: [reporting, structure, checkpoints, operator-ux]
spec:
evaluation_mode: any_rule_match
rules:
- id: mandatory-checkpoint-structure.required-fields-missing
title: Checkpoint must include the required operator fields
intent: >-
Ensure every checkpoint answers the minimum managerial questions the
operator needs to supervise the task.
triggers:
event_types: [task_checkpoint_sent, forced_operator_update]
claim_types: [progress]
conditions:
any:
- fact: message.current_status_present
equals: false
- fact: message.completed_this_segment_present
equals: false
- fact: message.next_step_present
equals: false
- fact: message.next_report_condition_present
equals: false
- fact: message.operator_intervention_needed_present
equals: false
evidence_requirements:
progress:
min_new_items_since_last_checkpoint: 0
decision_output:
decision: rewrite
severity: medium
reason: >-
checkpoint omitted one or more required operator-usable fields
suggested_status: in_progress
required_actions:
- action: rewrite_message
target: outgoing_report
mandatory: true
details:
mode: inject_missing_checkpoint_fields
- action: append_audit_note
target: task_record
mandatory: true
details:
note: missing checkpoint fields were normalized by governance
operator_notice:
required: false
channel: telegram
urgency: low
message: null
must_reference: []
deadline: null
operator_message_templates:
placeholder_rewrite: >-
Structured checkpoint required:
- Current status: {{current_status_or_unknown}}
- Completed this segment: {{completed_this_segment_or_none}}
- Next step: {{next_step_or_unspecified}}
- Next report condition: {{next_report_condition_or_missing}}
- Operator intervention needed: {{operator_intervention_needed_or_unknown}}
- id: mandatory-checkpoint-structure.next-step-and-report-condition-coupled
title: Next step must be paired with the next reporting condition
intent: >-
Prevent checkpoints from naming a next action without saying when or why
the operator should expect the next update.
triggers:
event_types: [task_checkpoint_sent]
claim_types: [progress]
conditions:
all:
- fact: message.next_step_present
equals: true
- fact: message.next_report_condition_present
equals: false
evidence_requirements:
progress:
min_new_items_since_last_checkpoint: 0
decision_output:
decision: rewrite
severity: medium
reason: >-
next step was stated without the next reporting condition
suggested_status: in_progress
required_actions:
- action: rewrite_message
target: outgoing_report
mandatory: true
details:
mode: append_next_report_condition_prompt
- action: append_audit_note
target: task_record
mandatory: true
details:
note: next-step-only checkpoint normalized to include follow-up condition
operator_notice:
required: false
channel: telegram
urgency: low
message: null
must_reference: []
deadline: null
operator_message_templates:
placeholder_rewrite: >-
Next step recorded, but the next report condition was missing. The
checkpoint must say when the next update will be sent or what event will trigger it.
- id: mandatory-checkpoint-structure.operator-intervention-explicit
title: Checkpoint must explicitly say whether operator intervention is needed
intent: >-
Prevent reports that leave the operator unsure whether action or waiting
is required.
triggers:
event_types: [task_checkpoint_sent, operator_review_requested, forced_operator_update]
claim_types: [progress, completion]
conditions:
all:
- fact: message.operator_intervention_needed_present
equals: false
evidence_requirements:
progress:
min_new_items_since_last_checkpoint: 0
decision_output:
decision: rewrite
severity: medium
reason: >-
checkpoint did not explicitly state whether operator intervention is needed
suggested_status: in_progress
required_actions:
- action: rewrite_message
target: outgoing_report
mandatory: true
details:
mode: append_operator_intervention_field
operator_notice:
required: false
channel: telegram
urgency: low
message: null
must_reference: []
deadline: null
operator_message_templates:
placeholder_rewrite: >-
Operator intervention field required: explicitly say either "no
operator action needed now" or describe the exact intervention required.
- id: mandatory-checkpoint-structure.block-empty-checkpoint
title: Empty or nearly empty checkpoints must not pass as compliant reports
intent: >-
Block reports that lack enough structure to function as real
supervision checkpoints.
triggers:
event_types: [task_checkpoint_sent, forced_operator_update]
claim_types: [progress]
conditions:
all:
- fact: message.required_checkpoint_field_count_present
less_than: 2
evidence_requirements:
progress:
min_new_items_since_last_checkpoint: 0
decision_output:
decision: block
severity: high
reason: >-
checkpoint was too structurally incomplete to count as a compliant report
suggested_status: blocked
required_actions:
- action: block_transition
target: outgoing_report
mandatory: true
details:
blocked_action: send_incomplete_checkpoint
- action: notify_operator
target: operator_channel
mandatory: true
details:
kind: malformed_checkpoint
- action: append_audit_note
target: task_record
mandatory: true
details:
note: empty checkpoint blocked before dispatch
operator_notice:
required: true
channel: telegram
urgency: medium
message: >-
A checkpoint was blocked because it omitted most required structure
and could not function as a real operator update.
must_reference: []
deadline: immediate
operator_message_templates:
blocked: >-
Blocked: this checkpoint is too incomplete to send. It must include at
least current status, completed this segment, next step, next report
condition, and whether operator intervention is needed.