Files
cleveragents-core/features/tui_persona_system.feature
T
aditya d9e51d98f8 fix(tui,cli,tests): harden persona/input modes and stabilize parallel test execution
- Add shell safety controls for REPL/TUI (`looks_dangerous`, confirmation gate, timeout handling, and env-based shell disable guard).
- Secure persona workflows with strict name/path validation, safe import/export resolution, atomic+locked registry writes, and malformed YAML resilience.
- Unify persona models and wiring by reusing canonical TUI schema/registry, adding DI providers, and lazy-loading TUI exports to avoid circular imports.
- Improve reference discovery with ignored-directory filtering, symlink-safe walking, and TTL caching for CLI/TUI reference catalogs.
- Expand Behave/Robot coverage for safety/error paths and parallel-isolation behavior; add shared `features/mocks/fake_repl_input.py` helper.
- Fix parallel-run flakiness via deterministic cleanup/reload patterns and watchdog polling fallback when inotify limits are reached.

ISSUES CLOSED: #695
2026-03-18 10:09:06 +00:00

64 lines
3.0 KiB
Gherkin

Feature: TUI persona system
Personas are TUI-only YAML records with per-session binding.
Scenario: Persona schema auto-creates default preset
When I build a TUI persona named "dev" with actor "local/mock-default"
Then the persona should include exactly one default preset
Scenario: Persona registry saves and loads YAML records
Given a temporary TUI persona registry
When I save a TUI persona named "reviewer" with actor "local/mock-default"
Then loading persona "reviewer" should succeed
And the loaded persona actor should be "local/mock-default"
Scenario: Persona registry validates duplicate cycle order
Given a temporary TUI persona registry
And I save a TUI persona named "a" with actor "local/mock-default" and cycle order 1
When I try to save a TUI persona named "b" with actor "local/mock-default" and cycle order 1
Then saving the second persona should fail with cycle order error
Scenario: Persona state is bound per session
Given a temporary TUI persona registry
And I save a TUI persona named "dev" with actor "local/mock-default"
And I save a TUI persona named "reviewer" with actor "local/mock-default"
When I set active persona to "dev" for session "s1"
And I set active persona to "reviewer" for session "s2"
Then active persona for session "s1" should be "dev"
And active persona for session "s2" should be "reviewer"
Scenario: Persona state cycles through presets per session
Given a temporary TUI persona registry
And I save TUI persona "cycler" with actor "local/mock-default" and extra preset "focused"
When I set active persona to "cycler" for session "s1"
And I cycle persona preset for session "s1"
Then current preset for session "s1" should be "focused"
When I cycle persona preset for session "s1"
Then current preset for session "s1" should be "default"
Scenario: Malformed persona YAML does not break registry operations
Given a temporary TUI persona registry
And I save a TUI persona named "good" with actor "local/mock-default"
And I create malformed TUI persona file "broken"
When I list TUI personas
Then TUI persona list should include "good"
When I save a TUI persona named "stillworks" with actor "local/mock-default"
Then loading persona "stillworks" should succeed
Scenario: TUI registry rejects unsafe export and import paths
Given a temporary TUI persona registry
And I save a TUI persona named "safe" with actor "local/mock-default"
When I export TUI persona "safe" to "../escape.yaml"
Then TUI export should fail with "stay within working directory"
When I import TUI persona from "../escape.yaml"
Then TUI import should fail with "stay within working directory"
Scenario: TUI registry state writes tolerate concurrent updates
Given a temporary TUI persona registry
When I concurrently set TUI last persona names
| name |
| a |
| b |
| c |
| d |
Then TUI concurrent update should complete without errors