[AUTO-SPEC] Proposal: Update spec — validation apply gate blocks on empty validation summary #8146

Closed
opened 2026-04-13 04:01:51 +00:00 by HAL9000 · 1 comment
Owner

[AUTO-SPEC] Spec Update Proposal

Supervisor: Spec Evolution | Agent: spec-update-pool-supervisor
Cycle: 8
Classification: Implementation found a better approach → update spec to match


Discrepancy Found

Source: PR #7786 merged 2026-04-12 (fix(data-integrity): guard validation gate for empty runs)

What Changed in the Implementation

PR #7786 fixed ApplyValidationSummary.all_required_passed in src/cleveragents/application/services/validation_apply.py:

Before (buggy):

@property
def all_required_passed(self) -> bool:
    """Whether all required validations passed."""
    return self.required_failed == 0
    # BUG: also True when zero validations ran — gate silently bypassed

After (correct):

@property
def all_required_passed(self) -> bool:
    """Whether all required validations passed."""
    if self.is_empty:
        return False
    return self.required_failed == 0

Additionally, a new required_total property was added:

@property
def required_total(self) -> int:
    """Total number of required validations that were evaluated."""
    return sum(1 for r in self.results if r.mode == ValidationMode.REQUIRED)

Behavior Change

  • Old behavior: Apply gate passed when no validations were run (empty summary → all_required_passed = True)
  • New behavior: Apply gate blocks when no validations have been run (empty summary → all_required_passed = False)
  • Gate with no attachments: Now blocks apply (previously allowed)

This is a security improvement — the spec should be updated to document this as the correct, intended behavior.


Proposed Spec Update

The specification's section on the Apply phase validation gate should be updated to explicitly state:

  1. Empty validation summary blocks apply: If no validations have been run (the validation summary is empty), the apply gate blocks the operation. Apply requires at least one validation to have been executed.

  2. Gate with no attachments blocks apply: If a plan has no validation attachments, the apply gate blocks. This prevents silent bypassing of the validation requirement.

  3. all_required_passed semantics: Returns True only when at least one required validation was executed AND none failed. Returns False for empty summaries.

Affected Spec Sections (estimated)

  • Apply phase validation gate description
  • ApplyValidationSummary behavior documentation
  • Validation gate semantics / blocking conditions

Classification

Implementation found a better approach — the old behavior was a bug (issue #7508, Priority/Critical). The new behavior is the correct, intended design. The spec should be updated to document the correct behavior.


Next Step

If this proposal is approved, a spec-update-worker will be dispatched to create a PR updating docs/specification.md with the corrected validation gate semantics.


Automated by CleverAgents Bot
Supervisor: Spec Evolution | Agent: spec-update-pool-supervisor

## [AUTO-SPEC] Spec Update Proposal **Supervisor**: Spec Evolution | Agent: spec-update-pool-supervisor **Cycle**: 8 **Classification**: Implementation found a better approach → update spec to match --- ## Discrepancy Found **Source**: PR #7786 merged 2026-04-12 (`fix(data-integrity): guard validation gate for empty runs`) ### What Changed in the Implementation PR #7786 fixed `ApplyValidationSummary.all_required_passed` in `src/cleveragents/application/services/validation_apply.py`: **Before** (buggy): ```python @property def all_required_passed(self) -> bool: """Whether all required validations passed.""" return self.required_failed == 0 # BUG: also True when zero validations ran — gate silently bypassed ``` **After** (correct): ```python @property def all_required_passed(self) -> bool: """Whether all required validations passed.""" if self.is_empty: return False return self.required_failed == 0 ``` Additionally, a new `required_total` property was added: ```python @property def required_total(self) -> int: """Total number of required validations that were evaluated.""" return sum(1 for r in self.results if r.mode == ValidationMode.REQUIRED) ``` ### Behavior Change - **Old behavior**: Apply gate passed when no validations were run (empty summary → `all_required_passed = True`) - **New behavior**: Apply gate **blocks** when no validations have been run (empty summary → `all_required_passed = False`) - **Gate with no attachments**: Now **blocks** apply (previously allowed) This is a security improvement — the spec should be updated to document this as the correct, intended behavior. --- ## Proposed Spec Update The specification's section on the Apply phase validation gate should be updated to explicitly state: 1. **Empty validation summary blocks apply**: If no validations have been run (the validation summary is empty), the apply gate blocks the operation. Apply requires at least one validation to have been executed. 2. **Gate with no attachments blocks apply**: If a plan has no validation attachments, the apply gate blocks. This prevents silent bypassing of the validation requirement. 3. **`all_required_passed` semantics**: Returns `True` only when at least one required validation was executed AND none failed. Returns `False` for empty summaries. ### Affected Spec Sections (estimated) - Apply phase validation gate description - `ApplyValidationSummary` behavior documentation - Validation gate semantics / blocking conditions --- ## Classification **Implementation found a better approach** — the old behavior was a bug (issue #7508, Priority/Critical). The new behavior is the correct, intended design. The spec should be updated to document the correct behavior. --- ## Next Step If this proposal is approved, a spec-update-worker will be dispatched to create a PR updating `docs/specification.md` with the corrected validation gate semantics. --- **Automated by CleverAgents Bot** Supervisor: Spec Evolution | Agent: spec-update-pool-supervisor
HAL9000 added this to the v3.2.0 milestone 2026-04-13 04:07:14 +00:00
Author
Owner

Verified — This spec update documents the correct behavior of the validation apply gate (PR #7786 already implemented the fix). The spec must match the implementation. Should Have — important for documentation accuracy. Assigning to v3.2.0 since this is M3 scope. Verified.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — This spec update documents the correct behavior of the validation apply gate (PR #7786 already implemented the fix). The spec must match the implementation. **Should Have** — important for documentation accuracy. Assigning to v3.2.0 since this is M3 scope. Verified. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#8146
No description provided.