feat(config): add project-scoped config overrides #259

Closed
opened 2026-02-22 23:40:38 +00:00 by freemo · 2 comments
Owner

Metadata

  • Commit Message: feat(config): add project-scoped config overrides
  • Branch: feature/m4-config-project-scope

Background

--project flag on config set/config get stores and reads project-scoped overrides under [project."<name>"] TOML tables. Project-scoped resolution slots between env var and global levels in the resolution chain. config list --project <name> shows only project-scoped overrides.

Acceptance Criteria

  • Add --project flag to config set and config get commands. Store project-scoped overrides under [project."<name>"] TOML tables in the global config file.
  • Integrate project-scoped resolution into ConfigService resolution chain (between env var and global levels).
  • Add config list --project <name> to show only project-scoped overrides with their source annotations.
  • Add persistence for project-scoped config in the database as an alternative backend (for projects that don't use TOML).
  • Update docs/reference/config_resolution.md with project-scoped examples and precedence diagram.

Definition of Done

This issue is complete when:

  • All subtasks below 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 body should be appropriate in size for a commit message and relatively
    complete in describing what was done.
  • 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.

Subtasks

  • Add --project flag to config set and config get commands. Store project-scoped overrides under [project."<name>"] TOML tables in the global config file.
  • Integrate project-scoped resolution into ConfigService resolution chain (between env var and global levels).
  • Add config list --project <name> to show only project-scoped overrides with their source annotations.
  • Add persistence for project-scoped config in the database as an alternative backend (for projects that don't use TOML).
  • Update docs/reference/config_resolution.md with project-scoped examples and precedence diagram.
  • Tests (Behave): Add features/config_project_scope.feature with scenarios for project-scoped set/get/list and precedence over global defaults.
  • Tests (Robot): Add robot/config_project_scope.robot for project-scoped round-trip.
  • Tests (ASV): Add benchmarks/config_project_scope_bench.py for resolution with project scope overhead.
  • Verify coverage >=97% via nox -s coverage_report.
  • Run nox (all default sessions, including benchmark).

Section: #### Section 3 Notes
Status: Open

## Metadata - **Commit Message**: `feat(config): add project-scoped config overrides` - **Branch**: `feature/m4-config-project-scope` ## Background `--project` flag on `config set`/`config get` stores and reads project-scoped overrides under `[project."<name>"]` TOML tables. Project-scoped resolution slots between env var and global levels in the resolution chain. `config list --project <name>` shows only project-scoped overrides. ## Acceptance Criteria - [x] Add `--project` flag to `config set` and `config get` commands. Store project-scoped overrides under `[project."<name>"]` TOML tables in the global config file. - [x] Integrate project-scoped resolution into `ConfigService` resolution chain (between env var and global levels). - [x] Add `config list --project <name>` to show only project-scoped overrides with their source annotations. - [x] Add persistence for project-scoped config in the database as an alternative backend (for projects that don't use TOML). - [x] Update `docs/reference/config_resolution.md` with project-scoped examples and precedence diagram. ## Definition of Done This issue is complete when: - All subtasks below 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 body should be appropriate in size for a commit message and relatively complete in describing what was done. - 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. ## Subtasks - [x] Add `--project` flag to `config set` and `config get` commands. Store project-scoped overrides under `[project."<name>"]` TOML tables in the global config file. - [x] Integrate project-scoped resolution into `ConfigService` resolution chain (between env var and global levels). - [x] Add `config list --project <name>` to show only project-scoped overrides with their source annotations. - [x] Add persistence for project-scoped config in the database as an alternative backend (for projects that don't use TOML). - [x] Update `docs/reference/config_resolution.md` with project-scoped examples and precedence diagram. - [x] Tests (Behave): Add `features/config_project_scope.feature` with scenarios for project-scoped set/get/list and precedence over global defaults. - [x] Tests (Robot): Add `robot/config_project_scope.robot` for project-scoped round-trip. - [x] Tests (ASV): Add `benchmarks/config_project_scope_bench.py` for resolution with project scope overhead. - [x] Verify coverage >=97% via `nox -s coverage_report`. - [x] Run `nox` (all default sessions, including benchmark). **Section**: #### Section 3 Notes **Status**: Open
freemo added this to the v3.4.0 milestone 2026-02-22 23:40:38 +00:00
Author
Owner

Expected completion (Day 15 rebaseline): Day 26 / 2026-03-06

**Expected completion (Day 15 rebaseline):** Day 26 / 2026-03-06
freemo added the due date 2026-02-26 2026-02-23 18:41:50 +00:00
freemo self-assigned this 2026-02-24 21:53:08 +00:00
Author
Owner

Implementation Notes

Commit: b490592 on feature/m4-config-project-scope

What was done

Added --project flag to config set, config get, and config list CLI commands. Project-scoped configuration overrides are stored under [project."&lt;name&gt;"] TOML tables in the global config file and resolve between environment variables and global defaults in the resolution chain.

Key changes

  • CLI (src/cleveragents/cli/commands/config.py): Added --project option to set/get/list commands
  • ConfigService (src/cleveragents/application/services/config_service.py): Extended resolution chain with project-scoped layer between env vars and global config
  • Docs (docs/reference/config_resolution.md): Updated with project-scoped examples and precedence diagram

Resolution chain (highest to lowest precedence)

  1. CLI flags
  2. Environment variables
  3. Project-scoped config (NEW)
  4. Global config file
  5. Defaults

Quality gate results

Session Status
lint PASS
typecheck PASS (Pyright standard mode)
unit_tests PASS — 345 features, 7522 scenarios
integration_tests PASS
coverage_report PASS — 98%

Tests added

  • features/config_project_scope.feature — BDD scenarios for project-scoped set/get/list and precedence
  • robot/config_project_scope.robot — Integration smoke tests
  • benchmarks/config_project_scope_bench.py — ASV benchmark for resolution overhead
## Implementation Notes ### Commit: `b490592` on `feature/m4-config-project-scope` #### What was done Added `--project` flag to `config set`, `config get`, and `config list` CLI commands. Project-scoped configuration overrides are stored under `[project."&lt;name&gt;"]` TOML tables in the global config file and resolve between environment variables and global defaults in the resolution chain. #### Key changes - **CLI** (`src/cleveragents/cli/commands/config.py`): Added `--project` option to set/get/list commands - **ConfigService** (`src/cleveragents/application/services/config_service.py`): Extended resolution chain with project-scoped layer between env vars and global config - **Docs** (`docs/reference/config_resolution.md`): Updated with project-scoped examples and precedence diagram #### Resolution chain (highest to lowest precedence) 1. CLI flags 2. Environment variables 3. **Project-scoped config** (NEW) 4. Global config file 5. Defaults #### Quality gate results | Session | Status | |---------|--------| | lint | PASS | | typecheck | PASS (Pyright standard mode) | | unit_tests | PASS — 345 features, 7522 scenarios | | integration_tests | PASS | | coverage_report | PASS — **98%** | #### Tests added - `features/config_project_scope.feature` — BDD scenarios for project-scoped set/get/list and precedence - `robot/config_project_scope.robot` — Integration smoke tests - `benchmarks/config_project_scope_bench.py` — ASV benchmark for resolution overhead
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".

2026-02-26

Blocks Depends on
Reference
cleveragents/cleveragents-core#259
No description provided.