fix(config): correct Settings.data_dir default from Path("data") to Path.home() / ".cleveragents" #3198
No reviewers
Labels
No labels
auto/needs-reevaluation
controller-managed
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
cleveragents/cleveragents-core!3198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/settings-data-dir-default"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes a bug where
Settings.data_dirdefaulted toPath("data")(a relative path) instead of the spec-required~/.cleveragents. This caused all persistent state (logs, database, cache, backups) to be written to a relativedata/directory whenCLEVERAGENTS_DATA_DIRwas not explicitly set.Changes
Bug Fix
src/cleveragents/config/settings.py: Changeddata_dirdefault_factoryfromlambda: Path("data")tolambda: Path.home() / ".cleveragents", aligning with the specification and the existingConfigServicecore.data-dirdefault.Tests (TDD — failing test written first)
features/settings_configuration.feature: Added two new Behave scenarios:data_dir default is the spec-required home directory path— verifiesSettings().data_dir == Path.home() / ".cleveragents"whenCLEVERAGENTS_DATA_DIRis not setdata_dir env var override takes precedence over default— verifiesCLEVERAGENTS_DATA_DIRenv var override continues to work correctlyfeatures/steps/settings_steps.py: Added step definitionthe data directory should equal the home cleveragents pathVerification
Settings().data_dirnow returnsPath.home() / ".cleveragents"whenCLEVERAGENTS_DATA_DIRis not setCLEVERAGENTS_DATA_DIRenv var override continues to work correctlySettings.data_dirdefault is now consistent withConfigServicecore.data-dirdefault (~/.cleveragents)nox -e typecheck— 0 errors, 0 warningsnox -e lint— All checks passednox -e format— 1874 files left unchangedImpact
Any code that reads
Settings().data_dirwithout settingCLEVERAGENTS_DATA_DIRwill now correctly use~/.cleveragentsinstead of a relativedata/directory. This affects log storage, database location, cache directory, backups directory, and all persistent state.Closes #2851
Automated by CleverAgents Bot
Supervisor: Implementation | Agent: ca-issue-worker
The Settings class had data_dir defaulting to Path("data") — a relative path — but the specification requires the default data directory to be ~/.cleveragents. This inconsistency caused any code reading Settings().data_dir without setting CLEVERAGENTS_DATA_DIR to use a relative 'data/' directory instead of the spec-required ~/.cleveragents, affecting log storage, database location, cache, backups, and all persistent state. Changes: - Fix data_dir default_factory from Path("data") to Path.home() / ".cleveragents" - Add Behave scenario: 'data_dir default is the spec-required home directory path' - Add Behave scenario: 'data_dir env var override takes precedence over default' - Add step definition: 'the data directory should equal the home cleveragents path' Settings.data_dir is now consistent with ConfigService core.data-dir default (~/.cleveragents). The CLEVERAGENTS_DATA_DIR env var override continues to work. ISSUES CLOSED: #2851Settings.data_dirdefault is'data'(relative path) — spec requires~/.cleveragents#2851🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3198-1743897600]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
Code Review — LGTM ✅
PR: fix(config): correct Settings.data_dir default from Path("data") to Path.home() / ".cleveragents"
Review Checklist
✅ Correctness:
lambda: Path.home() / ".cleveragents"is the correct default per spec. Consistent withConfigServicecore.data-dirdefault.✅ Test Coverage: Two new BDD scenarios — default value and env var override. Both in
features/as required.✅ Type Safety: No
# type: ignore. Pyright passes with 0 errors.✅ Commit Format:
fix(config):follows Conventional Changelog format.Issues Noted (Non-blocking)
Type/Bug.Decision: LGTM — Proceeding to merge when CI passes.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
🔒 Review claimed by reviewer-pool-1 [claim-token: reviewer-pool-1-3198-1775372800]
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-continuous-pr-reviewer
Independent Code Review — LGTM ✅
PR: fix(config): correct Settings.data_dir default from Path("data") to Path.home() / ".cleveragents"
Linked Issue: #2851
Reviewer: ca-pr-self-reviewer (independent review)
Review Summary
This is a clean, focused bug fix that corrects a spec violation in
Settings.data_dir. The change is minimal (1 line of production code), well-tested (2 new BDD scenarios), and aligns with both the specification and the existingConfigServicedefaults.Detailed Review
Specification Alignment ✅
~/.cleveragentsas the default data directory.Path.home() / ".cleveragents"correctly implements this.Settings.data_diris now consistent withConfigServicecore.data-dirdefault, eliminating a confusing inconsistency.Correctness ✅
Path.home() / ".cleveragents"is the idiomatic Python way to construct this path.validation_alias=AliasChoices("CLEVERAGENTS_DATA_DIR")is preserved, so env var override continues to work.Test Quality ✅
features/settings_configuration.feature:Path.home() / ".cleveragents"/tmp/custom-datafeatures/steps/settings_steps.pyincludes a clear assertion message.Commit Quality ✅
fix(config): ...ISSUES CLOSED: #2851footer present.Code Quality ✅
# type: ignoresuppressions.Settingsclass.Security ✅
Metadata Corrections Applied
CI Status
All required checks passing: lint ✅, typecheck ✅, security ✅, quality ✅, unit_tests ✅, integration_tests ✅, e2e_tests ✅, coverage ✅, build ✅, status-check ✅
Decision: APPROVED — Proceeding to merge.
Automated by CleverAgents Bot
Supervisor: PR Review | Agent: ca-pr-self-reviewer
Settings.data_dirdefault is'data'(relative path) — spec requires~/.cleveragents#2851