UAT: Settings.log_level default is 'INFO' instead of spec-required 'FATAL' — inconsistent with ConfigService and spec #1967

Open
opened 2026-04-03 00:25:33 +00:00 by freemo · 3 comments
Owner

Metadata

  • Branch: fix/config-settings-log-level-default-fatal
  • Commit Message: fix(config): correct Settings.log_level default from 'INFO' to spec-required 'FATAL'
  • Milestone: v3.7.0
  • Parent Epic: #945

Background and context

The specification (§Global Configuration Keys, core.* table) explicitly defines core.log.level as defaulting to 'FATAL':

core.log.level | string | FATAL | CLEVERAGENTS_LOG_LEVEL | Base logging verbosity level. The default FATAL means only fatal errors (where the application exits) produce log output; all other log messages are suppressed.

The ConfigService registry correctly uses 'FATAL' as the default for core.log.level. However, the Settings class in src/cleveragents/config/settings.py defines log_level with a default of 'INFO', diverging from both the specification and the ConfigService.

Current behavior

Settings.log_level defaults to 'INFO':

# src/cleveragents/config/settings.py, lines 120–123
log_level: str = Field(
    default="INFO",  # BUG: should be "FATAL" per spec
    validation_alias=AliasChoices("CLEVERAGENTS_LOG_LEVEL"),
)

Reproduction:

from cleveragents.config.settings import Settings
from cleveragents.application.services.config_service import _REGISTRY

s = Settings()
print(f'Settings.log_level default: {s.log_level}')  # Prints: INFO

entry = _REGISTRY.get('core.log.level')
print(f'ConfigService core.log.level default: {entry.default}')  # Prints: FATAL

Expected behavior

Settings.log_level should default to 'FATAL', consistent with the specification and ConfigService. Code that uses Settings directly (e.g., in tests or server startup) should produce no log output by default, matching the spec's intent that only fatal errors generate output.

Acceptance criteria

  • Settings.log_level field default is changed from "INFO" to "FATAL" in src/cleveragents/config/settings.py
  • Settings().log_level returns 'FATAL' when no environment variable is set
  • Settings.log_level default is consistent with ConfigService registry entry for core.log.level
  • All existing tests continue to pass (no regressions)
  • New Behave scenario added to verify Settings.log_level defaults to 'FATAL'

Supporting information

  • File: src/cleveragents/config/settings.py, lines 120–123
  • Spec reference: §Global Configuration Keys, core.* table — core.log.level default is FATAL
  • Related issue: #1934 (configure_structlog() rejects TRACE log level — also a logging/config spec alignment bug)
  • Impact: Medium — when Settings is used directly (e.g., in tests or server startup), the log level defaults to INFO instead of FATAL, potentially causing verbose log output in production environments

Subtasks

  • Change default="INFO" to default="FATAL" in Settings.log_level field (src/cleveragents/config/settings.py)
  • Audit any tests that rely on the INFO default and update them to expect FATAL
  • Tests (Behave): Add scenario asserting Settings().log_level == 'FATAL' when CLEVERAGENTS_LOG_LEVEL is unset
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata - **Branch**: `fix/config-settings-log-level-default-fatal` - **Commit Message**: `fix(config): correct Settings.log_level default from 'INFO' to spec-required 'FATAL'` - **Milestone**: v3.7.0 - **Parent Epic**: #945 ## Background and context The specification (§Global Configuration Keys, `core.*` table) explicitly defines `core.log.level` as defaulting to `'FATAL'`: > `core.log.level` | string | `FATAL` | `CLEVERAGENTS_LOG_LEVEL` | Base logging verbosity level. The default `FATAL` means only fatal errors (where the application exits) produce log output; all other log messages are suppressed. The `ConfigService` registry correctly uses `'FATAL'` as the default for `core.log.level`. However, the `Settings` class in `src/cleveragents/config/settings.py` defines `log_level` with a default of `'INFO'`, diverging from both the specification and the `ConfigService`. ## Current behavior `Settings.log_level` defaults to `'INFO'`: ```python # src/cleveragents/config/settings.py, lines 120–123 log_level: str = Field( default="INFO", # BUG: should be "FATAL" per spec validation_alias=AliasChoices("CLEVERAGENTS_LOG_LEVEL"), ) ``` Reproduction: ```python from cleveragents.config.settings import Settings from cleveragents.application.services.config_service import _REGISTRY s = Settings() print(f'Settings.log_level default: {s.log_level}') # Prints: INFO entry = _REGISTRY.get('core.log.level') print(f'ConfigService core.log.level default: {entry.default}') # Prints: FATAL ``` ## Expected behavior `Settings.log_level` should default to `'FATAL'`, consistent with the specification and `ConfigService`. Code that uses `Settings` directly (e.g., in tests or server startup) should produce no log output by default, matching the spec's intent that only fatal errors generate output. ## Acceptance criteria - [ ] `Settings.log_level` field default is changed from `"INFO"` to `"FATAL"` in `src/cleveragents/config/settings.py` - [ ] `Settings().log_level` returns `'FATAL'` when no environment variable is set - [ ] `Settings.log_level` default is consistent with `ConfigService` registry entry for `core.log.level` - [ ] All existing tests continue to pass (no regressions) - [ ] New Behave scenario added to verify `Settings.log_level` defaults to `'FATAL'` ## Supporting information - **File**: `src/cleveragents/config/settings.py`, lines 120–123 - **Spec reference**: §Global Configuration Keys, `core.*` table — `core.log.level` default is `FATAL` - **Related issue**: #1934 (`configure_structlog()` rejects `TRACE` log level — also a logging/config spec alignment bug) - **Impact**: Medium — when `Settings` is used directly (e.g., in tests or server startup), the log level defaults to `INFO` instead of `FATAL`, potentially causing verbose log output in production environments ## Subtasks - [ ] Change `default="INFO"` to `default="FATAL"` in `Settings.log_level` field (`src/cleveragents/config/settings.py`) - [ ] Audit any tests that rely on the `INFO` default and update them to expect `FATAL` - [ ] Tests (Behave): Add scenario asserting `Settings().log_level == 'FATAL'` when `CLEVERAGENTS_LOG_LEVEL` is unset - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.7.0 milestone 2026-04-03 00:25:58 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: MoSCoW/Should Have — bug or error handling improvement.

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

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: MoSCoW/Should Have — bug or error handling improvement. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

Duplicate UAT Report — No New Issue Created

A UAT Testing session attempted to file a new issue for this bug but a pre-creation duplicate check found this existing issue (#1967) covers the identical defect.

Duplicate report details:

  • Reported by: ca-uat-tester (Supervisor: UAT Testing)
  • Reported on: 2026-04-04
  • Duplicate title: UAT: Settings.log_level default is 'INFO' — spec requires 'FATAL'

The incoming report's description, reproduction steps, and impact assessment are consistent with this issue. No new issue was created. The UAT tester's report has been absorbed here for traceability.

Current issue status:

  • Linked to Parent Legendary: #945 (Specification Alignment)
  • Milestone: v3.7.0
  • Labels: State/Unverified, Type/Bug, Priority/Medium, MoSCoW/Should have
  • Branch: fix/config-settings-log-level-default-fatal

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Duplicate UAT Report — No New Issue Created A UAT Testing session attempted to file a new issue for this bug but a pre-creation duplicate check found this existing issue (#1967) covers the identical defect. **Duplicate report details:** - **Reported by:** ca-uat-tester (Supervisor: UAT Testing) - **Reported on:** 2026-04-04 - **Duplicate title:** `UAT: Settings.log_level default is 'INFO' — spec requires 'FATAL'` The incoming report's description, reproduction steps, and impact assessment are consistent with this issue. No new issue was created. The UAT tester's report has been absorbed here for traceability. **Current issue status:** - ✅ Linked to Parent Legendary: #945 (Specification Alignment) - ✅ Milestone: v3.7.0 - ✅ Labels: `State/Unverified`, `Type/Bug`, `Priority/Medium`, `MoSCoW/Should have` - ✅ Branch: `fix/config-settings-log-level-default-fatal` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium (confirmed — incorrect default value, but not a crash or data loss scenario)
  • Milestone: v3.7.0 (confirmed — config/settings alignment is foundational infrastructure)
  • MoSCoW: Should Have (confirmed — the spec explicitly defines core.log.level default as FATAL, and the Settings class diverges from this. This is a spec-alignment issue that affects production logging behavior.)
  • Parent Epic: #945 (as noted in issue metadata — logging/observability infrastructure)

Simple one-line fix with clear spec reference. Valid and actionable.


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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium (confirmed — incorrect default value, but not a crash or data loss scenario) - **Milestone**: v3.7.0 (confirmed — config/settings alignment is foundational infrastructure) - **MoSCoW**: Should Have (confirmed — the spec explicitly defines `core.log.level` default as `FATAL`, and the `Settings` class diverges from this. This is a spec-alignment issue that affects production logging behavior.) - **Parent Epic**: #945 (as noted in issue metadata — logging/observability infrastructure) Simple one-line fix with clear spec reference. Valid and actionable. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
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#1967
No description provided.