Files
cleveragents-core/features/actor_context_cmds.feature
T
HAL9000 70bb19e1d9
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 24s
CI / helm (pull_request) Successful in 23s
CI / push-validation (pull_request) Successful in 29s
CI / quality (pull_request) Successful in 35s
CI / build (pull_request) Successful in 36s
CI / typecheck (pull_request) Successful in 53s
CI / security (pull_request) Successful in 1m20s
CI / e2e_tests (pull_request) Successful in 3m1s
CI / integration_tests (pull_request) Failing after 4m22s
CI / unit_tests (pull_request) Successful in 5m22s
CI / docker (pull_request) Successful in 1m24s
CI / coverage (pull_request) Successful in 10m36s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-regression (pull_request) Successful in 58m26s
fix(cli): add [REGEX] positional argument to actor context list (#6500)
ISSUES CLOSED: #6500
2026-04-10 06:42:52 +00:00

110 lines
5.1 KiB
Gherkin

Feature: Actor context remove, export, and import commands
As a CleverAgents user
I want to manage actor contexts via the CLI
So that I can remove, export, and import conversation contexts
Background:
Given a temporary context directory for actor context tests
@actor_context_list_regex
Scenario: List actor contexts filtered by regex
Given an actor context named "docs" exists
And an actor context named "notes" exists
When I run actor context list "docs"
Then the actor context list command should succeed
And the list output should contain "docs"
And the list output should not contain "notes"
# ── context remove ─────────────────────────────────────────
Scenario: Remove a named actor context
Given an actor context named "docs" exists
When I run actor context remove "docs" with --yes
Then the actor context remove command should succeed
And the context "docs" should no longer exist
Scenario: Remove all actor contexts
Given an actor context named "docs" exists
And an actor context named "notes" exists
When I run actor context remove --all with --yes
Then the actor context remove command should succeed
And no actor contexts should remain
Scenario: Remove non-existent context fails
When I run actor context remove "nonexistent" with --yes
Then the actor context remove command should fail with exit code 1
Scenario: Remove requires NAME or --all
When I run actor context remove without name or all
Then the actor context remove command should fail with exit code 1
Scenario: Remove rejects NAME with --all
When I run actor context remove "docs" with --all
Then the actor context remove command should fail with exit code 1
Scenario: Remove outputs JSON format
Given an actor context named "docs" exists
When I run actor context remove "docs" with --yes and format "json"
Then the actor context remove command should succeed
And the output should contain valid JSON with key "context_removed"
# ── context export ─────────────────────────────────────────
Scenario: Export a named actor context to JSON
Given an actor context named "docs" exists with messages
When I run actor context export "docs" to a JSON file
Then the actor context export command should succeed
And the exported file should exist and contain valid JSON
And the exported JSON should contain key "messages"
Scenario: Export a named actor context to YAML
Given an actor context named "docs" exists with messages
When I run actor context export "docs" to a YAML file
Then the actor context export command should succeed
And the exported YAML file should exist and be valid
Scenario: Export non-existent context fails
When I run actor context export "nonexistent" to a JSON file
Then the actor context export command should fail with exit code 1
Scenario: Export outputs JSON format metadata
Given an actor context named "docs" exists with messages
When I run actor context export "docs" to a JSON file with format "json"
Then the actor context export command should succeed
And the output should contain valid JSON with key "context_export"
# ── context import ─────────────────────────────────────────
Scenario: Import a context from a JSON file
Given a valid context JSON file named "imported-ctx.json"
When I run actor context import from that file as "imported-ctx"
Then the actor context import command should succeed
And the context "imported-ctx" should exist
Scenario: Import infers name from file metadata
Given a valid context JSON file with context_name "auto-named"
When I run actor context import from that file without a name
Then the actor context import command should succeed
And the context "auto-named" should exist
Scenario: Import refuses to overwrite without --update
Given an actor context named "existing" exists
And a valid context JSON file named "existing.json"
When I run actor context import from that file as "existing" without update
Then the actor context import command should fail with exit code 1
Scenario: Import with --update replaces existing context
Given an actor context named "existing" exists
And a valid context JSON file named "existing.json"
When I run actor context import from that file as "existing" with --update
Then the actor context import command should succeed
And the context "existing" should exist
Scenario: Export then import round-trip preserves data
Given an actor context named "roundtrip" exists with messages
When I export the context "roundtrip" to a JSON file
And I remove the context "roundtrip"
And I import the context from that JSON file as "roundtrip"
Then the context "roundtrip" should exist
And the imported context should have the same messages as the original