Files
cleveragents-core/features/project_context_depth_gradient.feature
freemo 4eddbcf489 fix(cli): add --depth-gradient flag to project context set
Add the missing --depth-gradient repeatable flag to `project context set`
per specification. The flag accepts HOP:INT_OR_NAME format to control
context detail depth degradation with graph distance. Parsing validates
hop as integer and value as integer or recognized detail level name.

ISSUES CLOSED: #889
2026-03-30 17:12:20 +00:00

50 lines
2.6 KiB
Gherkin

Feature: Project context depth-gradient flag (B2.cli)
As a CleverAgents user
I want to set per-hop depth gradients via ``project context set --depth-gradient``
So that context detail depth degrades with graph distance from focus nodes
Background:
Given a project context CLI in-memory database is initialized
And a project "local/ctx-app" exists for context CLI
# ── single depth-gradient value ─────────────────────────────
Scenario: Set a single depth-gradient with integer value
When I run context set on "local/ctx-app" with depth-gradient "0:9"
Then the context set command should succeed
And the stored ACMS depth gradient should have hop "0" with value 9
Scenario: Set a single depth-gradient with named level value
When I run context set on "local/ctx-app" with depth-gradient "1:SIGNATURES"
Then the context set command should succeed
And the stored ACMS depth gradient should have hop "1" with string value "SIGNATURES"
# ── multiple depth-gradient values ──────────────────────────
Scenario: Set multiple depth-gradient values
When I run context set on "local/ctx-app" with depth-gradients "0:9,1:4,2:MODULE_LISTING"
Then the context set command should succeed
And the stored ACMS depth gradient should have hop "0" with value 9
And the stored ACMS depth gradient should have hop "1" with value 4
And the stored ACMS depth gradient should have hop "2" with string value "MODULE_LISTING"
# ── invalid format ──────────────────────────────────────────
Scenario: Invalid depth-gradient missing colon fails
When I run context set on "local/ctx-app" with depth-gradient "bad"
Then the context set command should fail
Scenario: Invalid depth-gradient non-integer hop fails
When I run context set on "local/ctx-app" with depth-gradient "abc:5"
Then the context set command should fail
# ── display in show command ─────────────────────────────────
Scenario: Depth gradient is displayed in context show output
Given I have set depth-gradient "0:9,1:SIGNATURES" on "local/ctx-app"
When I run context show on "local/ctx-app" without options
Then the context show command should succeed
And the context show output should contain "Depth gradient"
And the context show output should contain "0:9"
And the context show output should contain "1:SIGNATURES"