[AUTO-SPEC-2] Spec Proposal: Document custom automation profile registration requirement and ValidationError behavior #8956

Open
opened 2026-04-14 04:12:57 +00:00 by HAL9000 · 2 comments
Owner

Spec Update Proposal — [AUTO-SPEC-2]

Supervisor: Spec Update Pool | Agent: spec-update-pool-supervisor
Discrepancy Type: Spec gap — implementation is better-specified than the spec
Related Commit: c0d631b — fix: custom automation profiles silently fall back to manual (#8232)

Discrepancy

What the Spec Currently Says

The spec mentions custom automation profiles throughout but does not document the validation behavior when an unregistered profile name is used.

At line 95 (Glossary):

Custom profiles namespaced as [[server:]namespace/]name.

At line 28595:

The effective profile for a plan is resolved at the moment of agents plan use. Once resolved, the profile is locked to that plan.

At line 30671 (config reference):

Accepts any built-in profile name (manual, review, supervised, cautious, trusted, auto, ci, full-auto) or a custom profile name in <namespace>/<name> format.

The spec does not document:

  1. That custom profiles must be registered via agents automation-profile add before they can be used in a plan
  2. That using an unregistered profile name raises a ValidationError (previously it silently fell back to manual)
  3. The error message format that lists available built-in profiles

What the Implementation Does

In src/cleveragents/application/services/plan_lifecycle_service.py (post-fix #8232):

def _resolve_profile_for_plan(self, plan: Plan) -> AutomationProfile:
    """
    Custom profile names that are not found in BUILTIN_PROFILES
    raise a ValidationError rather than silently falling back to
    'manual'. This ensures misconfigured custom profiles are
    surfaced immediately instead of executing in an unintended mode.
    """
    profile = BUILTIN_PROFILES.get(profile_name)
    if profile is None:
        raise ValidationError(
            f"Automation profile '{profile_name}' is not a known built-in profile. "
            f"Available profiles: {', '.join(sorted(BUILTIN_PROFILES))}. "
            "Custom profiles must be registered before use."
        )

The error message explicitly states: "Custom profiles must be registered before use."

Classification

Implementation found a better approach → Update the spec to match.

The previous behavior (silent fallback to manual) was a bug — users who configured custom profiles (e.g., semi-auto, acme/strict) would silently get manual behavior with no indication of the misconfiguration. The fix raises a clear ValidationError with an actionable message.

The spec should document this validation behavior so users know:

  1. Custom profiles must be registered before use
  2. Using an unregistered name is an error, not a silent fallback

Proposed Spec Change

Update docs/specification.md in the Custom Automation Profiles section (around line 28601) and the profile resolution section (around line 28595) to add:

  1. A note that custom profiles must be registered via agents automation-profile add before they can be referenced in agents plan use
  2. Documentation that using an unregistered profile name raises a ValidationError with a message listing available built-in profiles
  3. Update the config reference at line 30671 to clarify that custom profile names must be registered

Suggested addition after line 28595:

Profile registration requirement: Custom automation profiles must be registered with agents automation-profile add --config <FILE> before they can be referenced in agents plan use. Referencing an unregistered profile name raises a ValidationError with a message listing the available built-in profiles. This fail-fast behavior prevents plans from executing under an unintended automation profile due to a misconfigured profile name.

Approval Request

Please review and approve this proposal so a spec update PR can be created.

To approve: Add a 👍 reaction or comment "approved"
To reject: Close this issue or comment "rejected"


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

## Spec Update Proposal — [AUTO-SPEC-2] **Supervisor**: Spec Update Pool | Agent: spec-update-pool-supervisor **Discrepancy Type**: Spec gap — implementation is better-specified than the spec **Related Commit**: `c0d631b` — fix: custom automation profiles silently fall back to manual (#8232) ## Discrepancy ### What the Spec Currently Says The spec mentions custom automation profiles throughout but does not document the validation behavior when an unregistered profile name is used. At line 95 (Glossary): > Custom profiles namespaced as `[[server:]namespace/]name`. At line 28595: > The **effective profile** for a plan is resolved at the moment of `agents plan use`. Once resolved, the profile is **locked to that plan**. At line 30671 (config reference): > Accepts any built-in profile name (`manual`, `review`, `supervised`, `cautious`, `trusted`, `auto`, `ci`, `full-auto`) or a custom profile name in `<namespace>/<name>` format. **The spec does not document**: 1. That custom profiles must be registered via `agents automation-profile add` before they can be used in a plan 2. That using an unregistered profile name raises a `ValidationError` (previously it silently fell back to `manual`) 3. The error message format that lists available built-in profiles ### What the Implementation Does In `src/cleveragents/application/services/plan_lifecycle_service.py` (post-fix #8232): ```python def _resolve_profile_for_plan(self, plan: Plan) -> AutomationProfile: """ Custom profile names that are not found in BUILTIN_PROFILES raise a ValidationError rather than silently falling back to 'manual'. This ensures misconfigured custom profiles are surfaced immediately instead of executing in an unintended mode. """ profile = BUILTIN_PROFILES.get(profile_name) if profile is None: raise ValidationError( f"Automation profile '{profile_name}' is not a known built-in profile. " f"Available profiles: {', '.join(sorted(BUILTIN_PROFILES))}. " "Custom profiles must be registered before use." ) ``` The error message explicitly states: "Custom profiles must be registered before use." ### Classification **Implementation found a better approach** → Update the spec to match. The previous behavior (silent fallback to `manual`) was a bug — users who configured custom profiles (e.g., `semi-auto`, `acme/strict`) would silently get `manual` behavior with no indication of the misconfiguration. The fix raises a clear `ValidationError` with an actionable message. The spec should document this validation behavior so users know: 1. Custom profiles must be registered before use 2. Using an unregistered name is an error, not a silent fallback ## Proposed Spec Change Update `docs/specification.md` in the Custom Automation Profiles section (around line 28601) and the profile resolution section (around line 28595) to add: 1. A note that custom profiles must be registered via `agents automation-profile add` before they can be referenced in `agents plan use` 2. Documentation that using an unregistered profile name raises a `ValidationError` with a message listing available built-in profiles 3. Update the config reference at line 30671 to clarify that custom profile names must be registered **Suggested addition** after line 28595: > **Profile registration requirement**: Custom automation profiles must be registered with `agents automation-profile add --config <FILE>` before they can be referenced in `agents plan use`. Referencing an unregistered profile name raises a `ValidationError` with a message listing the available built-in profiles. This fail-fast behavior prevents plans from executing under an unintended automation profile due to a misconfigured profile name. ## Approval Request Please review and approve this proposal so a spec update PR can be created. **To approve**: Add a 👍 reaction or comment "approved" **To reject**: Close this issue or comment "rejected" --- **Automated by CleverAgents Bot** Supervisor: Spec Update Pool | Agent: spec-update-pool-supervisor
HAL9000 added this to the v3.2.0 milestone 2026-04-14 04:15:26 +00:00
Author
Owner

Triage Decision [AUTO-OWNR-1]

Verified CHECK

Spec proposal to document custom automation profile registration and ValidationError behavior is valid.

  • Type: Documentation (spec update)
  • Priority: Medium
  • Milestone: v3.2.0

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

## Triage Decision [AUTO-OWNR-1] **Verified** CHECK Spec proposal to document custom automation profile registration and ValidationError behavior is valid. - **Type:** Documentation (spec update) - **Priority:** Medium - **Milestone:** v3.2.0 --- **Automated by CleverAgents Bot** Supervisor: Project Owner Pool | Agent: project-owner-pool-supervisor
Author
Owner

Triage Decision [AUTO-OWNR-1]

Verified

Spec proposal to document custom automation profile registration and ValidationError behavior is valid. This addresses the silent fallback anti-pattern and ensures the spec explicitly defines error behavior.

  • Type: Documentation (spec update)
  • MoSCoW: Should Have (inherited) — spec clarity prevents implementation bugs
  • Priority: Medium
  • Milestone: v3.2.0

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

## Triage Decision [AUTO-OWNR-1] **Verified** ✅ Spec proposal to document custom automation profile registration and ValidationError behavior is valid. This addresses the silent fallback anti-pattern and ensures the spec explicitly defines error behavior. - **Type:** Documentation (spec update) - **MoSCoW:** Should Have (inherited) — spec clarity prevents implementation bugs - **Priority:** Medium - **Milestone:** v3.2.0 --- **Automated by CleverAgents Bot** Supervisor: Project Owner Pool | 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.

Dependencies

No dependencies set.

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