UAT: audit.* config keys (audit.retention-days, audit.async, audit.queue-maxsize) are not registered in ConfigService registry — cannot be managed via agents config CLI #3407

Open
opened 2026-04-05 16:32:34 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/config-service-audit-keys-registration
  • Commit Message: fix(config): register audit.retention-days, audit.async, and audit.queue-maxsize in ConfigService registry
  • Milestone: none (backlog)
  • Parent Epic: #362

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Bug Description

The specification (docs/specification.md, section "audit.* — Audit Logging") defines three configuration keys that must be manageable via the agents config set/get/list commands, but none of them are registered in the ConfigService registry (_build_catalog() function in config_service.py).

Key Type Default Env Variable
audit.retention-days integer 0 CLEVERAGENTS_AUDIT_RETENTION_DAYS
audit.async boolean true CLEVERAGENTS_AUDIT_ASYNC
audit.queue-maxsize integer 10000 CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE

What Was Tested

Code-level analysis of src/cleveragents/application/services/config_service.py — specifically the _build_catalog() function that registers all config keys.

Expected Behavior (from spec)

All three audit.* keys should be registered in the _REGISTRY dict in config_service.py, making them manageable via:

  • agents config get audit.retention-days
  • agents config set audit.async false
  • agents config list audit.*

Actual Behavior

The _build_catalog() function in config_service.py registers keys for sections: core, server, actor, plan, sandbox, index, context, provider, and skills — but has no audit.* keys registered.

The audit settings DO exist in Settings (pydantic-settings) in config/settings.py as audit_retention_days, audit_async, and audit_queue_maxsize, but they are NOT wired into the ConfigService registry. This means:

  1. agents config get audit.retention-days fails with "Unknown configuration key"
  2. agents config set audit.async false fails with "Unknown configuration key"
  3. agents config list audit.* returns no results

Code Location

  • src/cleveragents/application/services/config_service.py_build_catalog() function (around line 200+)
  • The function ends with skills.* registration and never registers audit.* keys

Steps to Reproduce

  1. Run agents config get audit.retention-days
  2. Observe: BadParameter: Unknown configuration key: 'audit.retention-days'

Fix Required

Add audit.* key registrations to _build_catalog() in config_service.py:

# ── audit.* (3 keys) ────────────────────────────────────────────────
_register("audit", "retention-days", int, 0, project_scopable=False, env_var="CLEVERAGENTS_AUDIT_RETENTION_DAYS", description="Days to retain audit log entries before pruning. 0 means keep indefinitely.")
_register("audit", "async", bool, True, project_scopable=False, env_var="CLEVERAGENTS_AUDIT_ASYNC", description="When true, audit entries are written asynchronously.")
_register("audit", "queue-maxsize", int, 10000, project_scopable=False, env_var="CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE", description="Maximum pending audit entries in the write-behind queue.")

Subtasks

  • Add audit.retention-days registration to _build_catalog() in config_service.py
  • Add audit.async registration to _build_catalog() in config_service.py
  • Add audit.queue-maxsize registration to _build_catalog() in config_service.py
  • Write Behave BDD scenario: agents config get audit.retention-days returns 0
  • Write Behave BDD scenario: agents config set audit.async false succeeds and persists
  • Write Behave BDD scenario: agents config list audit.* returns all three keys
  • Verify env var overrides work for all three keys
  • Open PR and pass all nox quality gates

Definition of Done

  • All three audit.* keys are registered in ConfigService._build_catalog()
  • agents config get audit.retention-days returns 0 (default)
  • agents config set audit.async false succeeds and persists the value
  • agents config list audit.* returns all three keys with correct types and defaults
  • Env var overrides (CLEVERAGENTS_AUDIT_RETENTION_DAYS, CLEVERAGENTS_AUDIT_ASYNC, CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE) are respected
  • Behave BDD scenarios cover all three keys (get, set, list, env override)
  • All nox stages pass
  • Coverage >= 97%
  • PR merged and issue closed

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

## Metadata - **Branch**: `fix/config-service-audit-keys-registration` - **Commit Message**: `fix(config): register audit.retention-days, audit.async, and audit.queue-maxsize in ConfigService registry` - **Milestone**: none (backlog) - **Parent Epic**: #362 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Bug Description The specification (`docs/specification.md`, section "audit.* — Audit Logging") defines three configuration keys that must be manageable via the `agents config set/get/list` commands, but none of them are registered in the `ConfigService` registry (`_build_catalog()` function in `config_service.py`). | Key | Type | Default | Env Variable | |-----|------|---------|-------------| | `audit.retention-days` | integer | `0` | `CLEVERAGENTS_AUDIT_RETENTION_DAYS` | | `audit.async` | boolean | `true` | `CLEVERAGENTS_AUDIT_ASYNC` | | `audit.queue-maxsize` | integer | `10000` | `CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE` | ## What Was Tested Code-level analysis of `src/cleveragents/application/services/config_service.py` — specifically the `_build_catalog()` function that registers all config keys. ## Expected Behavior (from spec) All three `audit.*` keys should be registered in the `_REGISTRY` dict in `config_service.py`, making them manageable via: - `agents config get audit.retention-days` - `agents config set audit.async false` - `agents config list audit.*` ## Actual Behavior The `_build_catalog()` function in `config_service.py` registers keys for sections: `core`, `server`, `actor`, `plan`, `sandbox`, `index`, `context`, `provider`, and `skills` — but has **no `audit.*` keys registered**. The audit settings DO exist in `Settings` (pydantic-settings) in `config/settings.py` as `audit_retention_days`, `audit_async`, and `audit_queue_maxsize`, but they are NOT wired into the `ConfigService` registry. This means: 1. `agents config get audit.retention-days` fails with "Unknown configuration key" 2. `agents config set audit.async false` fails with "Unknown configuration key" 3. `agents config list audit.*` returns no results ## Code Location - `src/cleveragents/application/services/config_service.py` — `_build_catalog()` function (around line 200+) - The function ends with `skills.*` registration and never registers `audit.*` keys ## Steps to Reproduce 1. Run `agents config get audit.retention-days` 2. Observe: `BadParameter: Unknown configuration key: 'audit.retention-days'` ## Fix Required Add `audit.*` key registrations to `_build_catalog()` in `config_service.py`: ```python # ── audit.* (3 keys) ──────────────────────────────────────────────── _register("audit", "retention-days", int, 0, project_scopable=False, env_var="CLEVERAGENTS_AUDIT_RETENTION_DAYS", description="Days to retain audit log entries before pruning. 0 means keep indefinitely.") _register("audit", "async", bool, True, project_scopable=False, env_var="CLEVERAGENTS_AUDIT_ASYNC", description="When true, audit entries are written asynchronously.") _register("audit", "queue-maxsize", int, 10000, project_scopable=False, env_var="CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE", description="Maximum pending audit entries in the write-behind queue.") ``` ## Subtasks - [ ] Add `audit.retention-days` registration to `_build_catalog()` in `config_service.py` - [ ] Add `audit.async` registration to `_build_catalog()` in `config_service.py` - [ ] Add `audit.queue-maxsize` registration to `_build_catalog()` in `config_service.py` - [ ] Write Behave BDD scenario: `agents config get audit.retention-days` returns `0` - [ ] Write Behave BDD scenario: `agents config set audit.async false` succeeds and persists - [ ] Write Behave BDD scenario: `agents config list audit.*` returns all three keys - [ ] Verify env var overrides work for all three keys - [ ] Open PR and pass all nox quality gates ## Definition of Done - [ ] All three `audit.*` keys are registered in `ConfigService._build_catalog()` - [ ] `agents config get audit.retention-days` returns `0` (default) - [ ] `agents config set audit.async false` succeeds and persists the value - [ ] `agents config list audit.*` returns all three keys with correct types and defaults - [ ] Env var overrides (`CLEVERAGENTS_AUDIT_RETENTION_DAYS`, `CLEVERAGENTS_AUDIT_ASYNC`, `CLEVERAGENTS_AUDIT_QUEUE_MAXSIZE`) are respected - [ ] Behave BDD scenarios cover all three keys (get, set, list, env override) - [ ] All nox stages pass - [ ] Coverage >= 97% - [ ] PR merged and issue closed --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Backlog (unchanged)
  • Story Points: 2 — S — Register audit config keys in ConfigService registry.
  • MoSCoW: Could Have — Config management completeness.

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Backlog (unchanged) - **Story Points**: 2 — S — Register audit config keys in ConfigService registry. - **MoSCoW**: Could Have — Config management completeness. --- **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.

Blocks
#362 Epic: Security & Safety Hardening
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3407
No description provided.