48 Commits

Author SHA1 Message Date
HAL9000 bcf1eb9100 fix(test): resolve lint errors and remove tdd_expected_fail after #10438 fix
CI / push-validation (pull_request) Successful in 25s
CI / build (pull_request) Successful in 41s
CI / lint (pull_request) Successful in 48s
CI / quality (pull_request) Successful in 47s
CI / helm (pull_request) Successful in 46s
CI / typecheck (pull_request) Successful in 58s
CI / security (pull_request) Successful in 1m33s
CI / unit_tests (pull_request) Successful in 6m44s
CI / integration_tests (pull_request) Successful in 10m30s
CI / docker (pull_request) Successful in 1m45s
CI / coverage (pull_request) Successful in 10m23s
CI / status-check (pull_request) Successful in 4s
- Move MockMCPTransport import to module level in counting_mcp_transport.py,
  removing the noqa: PLC0415 suppression that caused RUF100 (unused noqa)
- Remove dead `if TYPE_CHECKING: pass` block and unused TYPE_CHECKING import
- Remove unused `from typing import Any` in race condition step definitions (F401)
- Fix excess blank lines (3 → 2) between imports and first section in step file
- Remove @tdd_expected_fail tag from tdd_mcp_client_start_race.feature; the
  bug is fixed so the scenario now passes, and the file's own comment states
  the tag must be removed when #10438 is resolved

ISSUES CLOSED: #10438
2026-06-10 11:14:45 -04:00
freemo 33cf919e7b Fix race condition in McpClient.start() double initialization
Add _state == McpClientState.STARTING guard inside the threading.RLock in
start() and _ensure_started() so that concurrent callers see the in-progress
state and return immediately, preventing double initialisation of the MCP
server connection.

- Move _CountingTransport test double from inline step file to dedicated
  features/mocks/counting_mcp_transport.py per CONTRIBUTING.md mock placement rules
- Updated step definitions to import CountingMCPTransport from new location
- Added Race condition entry to CHANGELOG under [Unreleased] -> Fixed
- Added contributor credit for McpClient race condition fix

ISSUES CLOSED: #10438
2026-06-10 11:14:45 -04:00
HAL9000 809ccc624a fix(test): move advanced context strategy test doubles to features/mocks
- Extract FakeEmbeddings, RelevanceScoringStrategy, AdaptiveContextSelector,
  ContextFusionStrategy, and _pack_budget from features/steps/ into new
  features/mocks/advanced_context_strategies_mocks.py per mock-placement rules
- Remove sys.path manipulation from robot/helper_advanced_context_strategies.py;
  import directly from features.mocks instead of features/steps
- Add None guard before selected.assemble() in step_assemble_context_query
- Add explicit ValueError for unknown strategy types in step_load_yaml_strategy
  and load_strategy_from_yaml_impl

ISSUES CLOSED: #7574
2026-06-06 05:52:06 -04:00
HAL9000 c65a0726a8 feat(cli): implement context show and context clear CLI commands for ACMS - Closes #9586
- Rewrote production CLI to use real ContextTierService (get_scoped_view, get_all_fragments, evict_lru) instead of non-existent ACMSService
- Removed unused imports (Path, Panel, ScopedView) from production code
- Fixed all lint issues: trailing whitespace, import ordering, nested with statements
- Replaced typer.Abort() with typer.Exit(code=1) for error exits
- Added input validation for empty/whitespace view parameter
- Fixed error handling to use str(e) instead of e.message
- Added guards against negative budget values in _format_budget_utilization
- Added warning when clearing context with no filters (clear ALL)
- Removed module-level console side effect
- Moved mocks to features/mocks/acms_context_mocks.py per CONTRIBUTING.md
- Fixed test assertions to capture real CLI output (not placeholder)
- Fixed duplicate step definitions (AmbiguousStep errors)
- Fixed feature file step mismatch for tier count parameter
- Added Robot Framework integration tests in robot/acms_context_cli.robot
- Added performance benchmarks in benchmarks/acms_context_cli_bench.py
- Updated CHANGELOG.md with ACMS context CLI feature entry
- Updated CONTRIBUTORS.md with ACMS context CLI contribution

ISSUES CLOSED: #9586
2026-06-03 11:24:21 -04:00
HAL9000 4cca36dcd4 test(auto-inf-3): Consolidate Behave database fixtures via shared factory
CI / lint (pull_request) Successful in 58s
CI / typecheck (pull_request) Successful in 1m0s
CI / quality (pull_request) Successful in 48s
CI / security (pull_request) Successful in 1m8s
CI / helm (pull_request) Successful in 42s
CI / build (pull_request) Successful in 44s
CI / push-validation (pull_request) Successful in 26s
CI / unit_tests (pull_request) Successful in 4m31s
CI / docker (pull_request) Successful in 1m32s
CI / integration_tests (pull_request) Successful in 8m5s
CI / coverage (pull_request) Successful in 8m54s
CI / status-check (pull_request) Successful in 3s
Extended features/mocks/test_uow_factory.py with:
- use_test_uow(context) function to attach test UoW to Behave context with automatic cleanup
- cleanup_test_uow(context) function for teardown
- Comprehensive docstrings and examples

Updated features/environment.py:
- Added cleanup_test_uow() call in after_scenario hook

ISSUES CLOSED: #9541
2026-06-03 07:39:45 -04:00
HAL9000 734c444c6a test(plan-correct): add failing BDD scenario proving JSON output missing spec envelope
Add @tdd_expected_fail BDD scenarios that prove the plan correct --format json
command outputs a flat dict instead of the spec-required nested envelope structure.
The scenarios assert data.correction.mode is present (currently absent) and that
the command field is "plan correct" (currently empty string).

ISSUES CLOSED: #8584
2026-06-02 07:19:20 -04:00
HAL9000 bd955696f9 fix(pr-7811 review): resolve remaining CI and code style blockers
Address all 4 remaining blocking issues from PR #7811 review:

- Delete duplicate _validation_pipeline_mock.py in features/steps/
  (the inline MockValidationExecutor is kept where it belongs)
- Replace # type: ignore[return-value] with cast(dict[str, Any], ...)
  to satisfy the zero-type-suppressions policy for test additions
- Add @tdd_issue_7623 regression tag on concurrency scenario
- Remove unreachable dead-code RuntimeError guard in
  _install_thread_local_streams() (constructors never return None)

All CI lint checks now pass. Source files remain within line limits.
2026-06-02 04:29:20 -04:00
HAL9000 2dd920078a fix(tests): add resolve_actor_options to mock lifecycle helpers
The PR added resolve_actor_options() to StrategyActor, LLMStrategizeActor,
and LLMExecuteActor, but the three mock lifecycle SimpleNamespace objects
used by tests did not include this method, causing AttributeError at
runtime:

- features/mocks/mock_strategy_llm.py: make_mock_lifecycle() used by
  robot/helper_strategy_actor.py (strategy_actor.robot llm-json test)
  and features/steps/strategy_actor_llm_steps.py
- features/steps/llm_actors_coverage_steps.py: _make_mock_lifecycle()
  used by llm_actors_coverage.feature scenarios
- robot/helper_m5_e2e_context.py: inline lifecycle SimpleNamespace
  used by m5_e2e_verification.robot Execute Phase LLM Uses ACMS Context

All three now include resolve_actor_options=MagicMock(return_value=None)
matching the None-return contract the actors use when no custom backend
is configured.

ISSUES CLOSED: #11256
2026-05-28 17:35:08 -04:00
CoreRasurae 3e13411fcf fix(actors): distinguish namespace/name from provider/model in actor name parsing
CI / lint (pull_request) Successful in 1m17s
CI / typecheck (pull_request) Successful in 2m2s
CI / security (pull_request) Successful in 2m5s
CI / quality (pull_request) Successful in 1m12s
CI / push-validation (pull_request) Successful in 47s
CI / helm (pull_request) Successful in 1m1s
CI / build (pull_request) Successful in 1m8s
CI / integration_tests (pull_request) Successful in 4m52s
CI / unit_tests (pull_request) Failing after 6m20s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s
When action YAML references actors using namespace/name format (e.g.
`strategy_actor: local/my-strategist`), `_parse_actor_name()` incorrectly
treated the namespace prefix as a provider name, causing
`ValueError: Unknown provider type: local`.

Changes:

- `_is_known_provider()`: New utility function (strategy_resolution.py)
  that checks whether a slash-separated first segment matches a known
  `ProviderType` value (openai, anthropic, etc.). Consolidated into a
  single implementation; llm_actors.py now imports from
  strategy_resolution.py.

- `_parse_actor_name()`: When the first segment IS a known provider,
  preserves existing behaviour (provider/model). When it is NOT a known
  provider, treats the input as namespace/name and returns the full name
  as the model identifier with the default provider. Callers SHOULD
  pre-resolve namespace/name references via the actor registry before
  calling this function. Both implementations (strategy_resolution.py
  and llm_actors.py) updated; ProviderType import moved to top level.

- `PlanLifecycleService.resolve_actor_provider_model()`: New method
  that resolves a namespaced actor name (e.g. local/my-strategist) to
  provider/model format by looking up the actor record and extracting
  its provider and model fields.

- `LifecycleService` Protocol (strategy_resolution.py): Added
  `resolve_actor_provider_model` to the protocol, eliminating the
  need for `# type: ignore[union-attr]` at call sites.

- `PlanLifecycleProtocol` (llm_actors.py): Added
  `resolve_actor_provider_model` to the protocol.

- Caller pre-resolution: StrategyActor, LLMStrategizeActor,
  LLMExecuteActor, SessionWorkflow._resolve_llm(), and CLI session
  commands now pre-resolve actor names through the lifecycle service
  or via injected actor_resolver callables before calling
  `_parse_actor_name()`, ensuring namespace/name references are
  correctly mapped to their underlying LLM providers.

- `_build_actor_resolver()` (cli/commands/session.py) and
  `_build_actor_resolver_for_session_workflow()` (a2a/facade.py):
  Moved `_is_known_provider` imports to top level; removed redundant
  `except (NotFoundError, Exception)`; added warning logging for
  outer exception handlers.

- `make_mock_lifecycle()` (mock_strategy_llm.py) and
  `_make_mock_lifecycle()` (llm_actors_coverage_steps.py): Added
  `resolve_actor_provider_model` to mock lifecycle services for
  test compatibility.

- Added `@tdd_issue @tdd_issue_11254` tags to all new BDD scenarios
  related to namespace/name disambiguation in llm_actors_coverage,
  strategy_actor_llm, and plan_lifecycle_service_coverage_boost_r4
  feature files.

- Updated docs/CHANGELOG.md with the fix entry.

ISSUES CLOSED: #11254
2026-05-22 20:42:25 +01:00
CoreRasurae 97c1007bb5 feat(events): wire domain services to emit missing EventBus events
CI / push-validation (pull_request) Successful in 48s
CI / build (pull_request) Successful in 1m17s
CI / helm (pull_request) Successful in 1m0s
CI / lint (pull_request) Successful in 1m54s
CI / quality (pull_request) Successful in 1m55s
CI / security (pull_request) Successful in 2m5s
CI / typecheck (pull_request) Successful in 2m4s
CI / integration_tests (pull_request) Successful in 5m1s
CI / unit_tests (pull_request) Successful in 5m10s
CI / docker (pull_request) Successful in 1m51s
CI / coverage (pull_request) Successful in 12m47s
CI / status-check (pull_request) Successful in 8s
CI / benchmark-publish (push) Has started running
CI / benchmark-regression (push) Failing after 1m15s
CI / typecheck (push) Has started running
CI / security (push) Has started running
CI / quality (push) Has started running
CI / integration_tests (push) Has started running
CI / unit_tests (push) Has started running
CI / e2e_tests (push) Has started running
CI / lint (push) Successful in 56s
CI / helm (push) Successful in 53s
CI / push-validation (push) Successful in 54s
CI / build (push) Successful in 1m24s
CI / coverage (push) Blocked by required conditions
CI / docker (push) Blocked by required conditions
CI / status-check (push) Blocked by required conditions
Add TokenAuthMiddleware to emit AUTH_SUCCESS/AUTH_FAILURE with spec-aligned audit details and wire it through the DI container using server.token resolution.

Add Behave and Robot coverage for auth event emission and end-to-end audit persistence, and update audit subscriber producer notes and changelog.

ISSUES CLOSED: #714
2026-05-15 22:19:57 +01:00
CoreRasurae 3fcfaee02d feat(mcp): implement StdioMCPTransport for JSON-RPC 2.0 stdio communication
CI / helm (push) Successful in 38s
CI / build (push) Successful in 1m3s
CI / push-validation (push) Successful in 30s
CI / lint (push) Successful in 1m22s
CI / quality (push) Successful in 1m31s
CI / security (push) Successful in 1m46s
CI / typecheck (push) Successful in 1m53s
CI / integration_tests (push) Successful in 3m41s
CI / e2e_tests (push) Failing after 4m5s
CI / unit_tests (push) Successful in 4m58s
CI / docker (push) Successful in 1m30s
CI / benchmark-regression (push) Failing after 45s
CI / coverage (push) Successful in 11m32s
CI / status-check (push) Successful in 5s
CI / benchmark-publish (push) Successful in 1h20m26s
Implements concrete StdioMCPTransport class that:
- Spawns MCP server as subprocess and communicates via JSON-RPC 2.0 over stdio
- Performs MCP handshake (initialize + notifications/initialized)
- Supports tools/list and tools/call methods
- Uses RLock for thread-safe concurrent access
- Auto-selected when transport='stdio' in MCPServerConfig

Adds BDD tests for stdio transport covering:
- Connection lifecycle and error handling
- Tool discovery and invocation
- MCPToolAdapter integration

ISSUES CLOSED: #4918
2026-05-13 07:13:34 +00:00
hurui200320 8dc55655e9 feat(actor): make built-in actors virtual, resolved on-demand from provider registry
CI / push-validation (push) Successful in 41s
CI / helm (push) Successful in 42s
CI / benchmark-publish (push) Failing after 56s
CI / build (push) Successful in 1m6s
CI / lint (push) Successful in 1m13s
CI / quality (push) Successful in 1m34s
CI / typecheck (push) Successful in 2m12s
CI / security (push) Successful in 2m13s
CI / e2e_tests (push) Successful in 3m45s
CI / integration_tests (push) Successful in 3m57s
CI / unit_tests (push) Successful in 4m53s
CI / docker (push) Successful in 1m34s
CI / coverage (push) Successful in 11m27s
CI / status-check (push) Successful in 3s
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 32s
CI / push-validation (pull_request) Successful in 33s
CI / build (pull_request) Successful in 53s
CI / lint (pull_request) Successful in 59s
CI / quality (pull_request) Successful in 1m28s
CI / security (pull_request) Successful in 1m29s
CI / typecheck (pull_request) Successful in 1m32s
CI / e2e_tests (pull_request) Successful in 4m1s
CI / integration_tests (pull_request) Successful in 5m4s
CI / unit_tests (pull_request) Successful in 5m51s
CI / docker (pull_request) Successful in 1m27s
CI / coverage (pull_request) Successful in 11m51s
CI / status-check (pull_request) Successful in 3s
Replace the DB-persistence approach for built-in actors with in-memory virtual
resolution. Built-in actors (e.g. openai/gpt-4o, anthropic/claude-sonnet) are
now resolved on-demand from ProviderRegistry at query time and merged with
persisted custom actors — no database writes occur for built-in actors.

Key changes:
- Add ActorRegistry._resolve_virtual_builtin_actors(): generates virtual Actor
  objects in-memory from configured providers (is_built_in=True, id=None)
- ActorRegistry.list()/list_actors(): merges virtual built-ins with custom DB
  actors; custom actors win on name collision; result sorted alphabetically
- ActorRegistry.get()/get_actor(): DB-first, virtual built-in fallback,
  NotFoundError if neither
- ActorRegistry.remove()/remove_actor(): rejects virtual built-in names with
  ValidationError
- ActorRegistry.set_default_actor(): stores only the actor name string via new
  actor_preferences singleton table; no actor row created for virtual built-ins
- ActorRegistry.get_default_actor(): reads preference name, resolves via
  DB→virtual chain, returns actor with is_default=True
- Remove ensure_built_in_actors() entirely — 20+ call sites cleaned up including
  plan.py
- Remove ActorRepository.upsert_built_in() — no longer needed
- Remove is_built_in from ActorModel DB column (kept on Actor domain model for
  virtual actors)
- New Alembic migration m10_001_virtual_builtin_actors: drops is_built_in column,
  adds actor_preferences singleton table
- Add ActorService.set_default_actor_name() and get_default_actor_name() for
  preference storage without requiring a DB actor row
- Update 15+ Behave step files and 5 feature files; add new
  features/virtual_builtin_actors.feature with 8 scenarios covering list, show,
  remove, set-default, get-default, no-DB-writes guarantees
- Rewrite tests/actor/test_registry_builtin_yaml.py: TestEnsureBuiltInActorsWithYaml
  → TestResolveVirtualBuiltinActors plus new TestListActors, TestGetActor,
  TestRemoveActor, TestDefaultActor test classes

Quality gates: lint ✓, typecheck ✓, unit_tests ✓ (15674 scenarios), coverage ✓
(97.10%), integration_tests ✓ (1997 tests)

ISSUES CLOSED: #10923
2026-04-30 10:56:21 +00:00
CoreRasurae d3cb534caf feat(plan): implement LLM-powered strategy actor
CI / push-validation (pull_request) Successful in 17s
CI / helm (pull_request) Successful in 19s
CI / lint (pull_request) Successful in 27s
CI / security (pull_request) Successful in 32s
CI / quality (pull_request) Successful in 41s
CI / typecheck (pull_request) Successful in 48s
CI / build (pull_request) Successful in 3m18s
CI / e2e_tests (pull_request) Successful in 4m16s
CI / integration_tests (pull_request) Successful in 4m16s
CI / unit_tests (pull_request) Successful in 5m8s
CI / docker (pull_request) Successful in 1m32s
CI / coverage (pull_request) Successful in 10m53s
CI / status-check (pull_request) Successful in 1s
CI / push-validation (push) Successful in 18s
CI / helm (push) Successful in 23s
CI / build (push) Successful in 31s
CI / lint (push) Successful in 43s
CI / typecheck (push) Successful in 52s
CI / security (push) Successful in 52s
CI / e2e_tests (push) Successful in 3m37s
CI / quality (push) Successful in 3m44s
CI / integration_tests (push) Successful in 6m35s
CI / unit_tests (push) Failing after 7m36s
CI / docker (push) Has been skipped
CI / coverage (push) Successful in 13m39s
CI / status-check (push) Failing after 1s
Implement StrategyActor class for the plan strategize phase that uses an
LLM to produce hierarchical execution strategies with dependencies,
resource requirements, estimated complexity, and risk scores.

Key components:
- StrategyActor: Core actor with LLM prompt construction, response
  parsing (JSON and numbered-list fallback), and graceful degradation
  to StrategizeStubActor when no LLM provider is configured
- StrategyAction/StrategyTree: Pydantic models for the hierarchical
  action tree with dependency links
- validate_no_cycles(): Kahns algorithm (deque-based) for dependency
  graph cycle detection, raising PlanError on circular dependencies
- build_strategy_prompt(): Context-aware prompt construction using
  definition_of_done, resources, project context, and ACMS analysis
  with XML-delimited user content sections for prompt injection
  hardening
- parse_strategy_response(): Robust LLM output parsing with JSON
  extraction and numbered-list fallback
- resolve_strategy_actor(): Integration point for the existing
  actor.default.strategy config key (CLEVERAGENTS_DEFAULT_STRATEGY_ACTOR)
- Decision conversion producing strategy_choice Decision objects
- build_decisions() preserves tree hierarchy via parent_id mapping,
  populates downstream_decision_ids from dependency edges, and
  validates plan_id

Structural tree hierarchy (B2 review fix):
- _build_tree infers parent_id from the dependency graph: each
  actions first resolved dependency becomes its structural parent.
  Actions with no dependencies fall back to the root.  This produces
  hierarchical trees for agents plan tree rendering per spec
  Plan Decision Tree.

Downstream decision tracking (B3 review fix):
- build_decisions populates downstream_decision_ids from the strategy
  trees dependency edges using a pre-generated decision_id map so
  influence relationships between decisions are recorded per the spec
  Decision Record Structure.

Post code-review hardening (PR #1175):
- Broadened exception handling in execute() and ACMS retrieval to
  catch all LLM provider errors (openai, httpx, anthropic, etc.)
  with graceful fallback to stub mode (H1, H2)
- Added warning log for unresolvable dependency references so
  dropped edges are visible in structured logs (H3)
- Added XML-delimited user content sections and explicit data-only
  instructions in system prompt for prompt injection hardening (H4)
- Switched prompt truncation to word-boundary-safe _truncate_at_word()
  for all prompt input sections (M1)
- Fixed _parse_actor_name to preserve user-specified provider or
  model when only one segment is empty, instead of discarding both (M2)
- Annotated _build_invariant_records as placeholder pending the
  Invariant Reconciliation Actor implementation (M5)
- Documented resources/project_context params as future-wired
  through PlanExecutor.run_strategize() (M8)
- Added docstring noting supersession relationship with
  LLMStrategizeActor in llm_actors.py (M9)
- Added __all__ export definition (L2)
- Improved validate_no_cycles docstring edge direction semantics (L7)
- Cap JSON parse retry loop at _MAX_JSON_PARSE_RETRIES (10)

Post second code-review hardening (PR #1175, review cycle 2):
- Fixed _truncate_at_word docstring: documented max_chars >= 3
  precondition for the result-length guarantee (R-H1)
- Added warning log in build_decisions for unresolvable parent_id
  references, matching the existing _build_tree warning for
  unresolvable dependency references (R-H2)
- Fixed _parse_actor_name to handle whitespace-only input by adding
  actor_name.strip() check alongside the emptiness check (R-M1)
- Tightened ACMS scenario assertions from non-empty to expected
  count of 5 decisions (R-L3)
- Added timeout=60s on_timeout=kill to all Robot test cases for
  consistency with project patterns (R-M5)

Post third code-review hardening (PR #1175, review cycle 3):
- Added _sanitize_xml_content() to escape XML special characters
  (<, >, &) in user content before embedding into XML-delimited
  prompt sections, preventing prompt injection via forged closing
  tags (spec Prompt Injection Mitigation) (CR3-M1)
- Upgraded _try_parse_json() to multi-anchor retry: collects all
  [{ positions left-to-right and tries each as a candidate start,
  fixing false-start anchoring when LLM preamble contains [{
  fragments before the real JSON array (CR3-M2)
- Added _truncate_at_word() guard for max_chars < 3: returns a
  hard slice instead of word-boundary truncation when the ellipsis
  would exceed the limit (CR3-L2)
- Changed _build_tree collision fallback key from -(idx+1) to
  -(1_000_000+idx) to eliminate theoretical collision with
  LLM-produced negative step numbers (CR3-L3)
- Added forward-looking API docstring note to build_decisions()
  documenting that it is not yet wired into PlanExecutor and will
  be integrated once Decision persistence lands (CR3-M3)

Post fourth code-review hardening (PR #1175, review cycle 4):
- Fixed _try_parse_json per-anchor retry counter: reset retries=0
  at the start of each anchor iteration so false-start [{ anchors
  in LLM preamble text no longer exhaust the retry budget for the
  correct anchor (CR4-B1)
- Added known-limitations docstring to module header documenting
  missing decision types (resource_selection, subplan_spawn,
  invariant_enforced) as future work (CR4-D1)
- Rewrote XML injection assertion in test to use regex extraction
  instead of fragile chained .split() calls that could IndexError
  on structural changes (CR4-T5)

Post fifth code-review hardening (PR #1175, review cycle 5):
- Added warning log in build_decisions for empty-string parent_id
  (distinct from None) so the silent fallback to root is visible
  in structured logs for debuggability (CR5-B1)
- Added plan_id propagation assertion to build_decisions test
  scenarios verifying decision.plan_id matches the input (CR5-T1)
- Added sequence_number monotonicity assertion verifying decision
  sequence_numbers are zero-indexed and monotonically increasing
  (CR5-T2)
- Added _truncate_at_word boundary test for max_chars=3 (exactly
  ellipsis length) verifying correct "..." output (CR5-T3)
- Tightened false-start anchor test from permissive len>=1 to
  specific description match "Sole real action" (CR5-T4)
- Added word-boundary truncation test using space-separated input
  to exercise the rfind(" ") path under oversized DoD (CR5-T5)

Post sixth code-review hardening (PR #1175, review cycle 6):
- Added _MAX_INVARIANTS cap (100) for invariant list truncation in
  prompt to prevent token limit overflows, consistent with other prompt
  section caps (CR6-M4)
- Added negative max_chars guard in _truncate_at_word returning empty
  string instead of slicing from end (CR6-M5)
- Added global JSON parse attempt cap _MAX_GLOBAL_JSON_ATTEMPTS (50)
  across all anchors in _try_parse_json (CR6-L3)
- Moved re import to module level in strategy_parsing.py per
  CONTRIBUTING import guidelines (CR6-L4)
- Extracted _DEFAULT_DESCRIPTION constant to eliminate duplication
  between _default_action() and _build_tree() (CR6-L5)

Post seventh code-review hardening (PR #1175, review cycle 7):
- Decoupled _execute_stub from StrategizeStubActor._parse_steps
  private method by delegating to parse_strategy_response, removing
  cross-class private method dependency (CR7-M1)
- Added ULID format validation on plan_id in execute() and
  build_decisions() for spec-consistent argument validation per
  §Plan glossary and CONTRIBUTING §Argument Validation (CR7-M2)
- Constrained StrategyAction.estimated_complexity to
  Literal["low", "medium", "high"] at Pydantic model level per
  CONTRIBUTING §Type Safety (CR7-M5)
- Documented XML-tag prompt boundary deviation from spec
  [USER_CONTENT_START]/[USER_CONTENT_END] markers with rationale
  for the more structured approach (CR7-M6)
- Added _build_tree empty-input guard comment documenting orphaned
  root_id semantics (CR7-L1)
- Added _truncate_at_word > 0 intent comment explaining why
  position-0 space is intentionally excluded (CR7-L2)
- Added build_decisions context_snapshot future-work comment
  referencing spec §Decision Record Structure (CR7-L5)
- Used enumerate() in _build_tree first loop for idiomatic
  Python (CR7-L7)
- Fixed false-start anchor test (CR5-T4) broken by CR6-L3 global
  cap: reduced preamble fragments from 15 to 3 so total attempts
  stay within _MAX_GLOBAL_JSON_ATTEMPTS (CR7-T1)
- Fixed test plan_ids containing non-Crockford-Base32 characters
  (L→K) to pass ULID format validation (CR7-T2)

Tests:
- 105 Behave BDD scenarios in features/strategy_actor_llm.feature
  adding: global JSON attempt cap exhaustion (CR7-L3), orphaned
  dependency edge silent drop (CR7-L4), non-ULID plan_id rejection
  in execute() and build_decisions() (CR7-M2)
- 101 Behave BDD scenarios in features/strategy_actor_llm.feature
  including new scenarios for _truncate_at_word edge cases (L3),
  create_llm argument verification (L4), non-numeric step field
  fallback (L5), updated assertions for XML-delimited prompts
  and _parse_actor_name partial-segment preservation (M2),
  lifecycle exception fallback (R1), PydanticValidationError
  re-raise verification (R2), self-loop cycle detection (R3),
  whitespace-only actor name (R4), XML tag injection sanitisation
  (CR3-M1), preamble bracket fragment parsing (CR3-M2),
  _truncate_at_word sub-3 limit (CR3-L2), resolve_strategy_actor
  with both llm config and registry (CR3-L5), build_decisions
  unresolvable parent_id fallback (CR3-L7), XML injection in
  resources/project_context/acms_context fields (CR4-S1),
  ampersand escaping (CR4-S1d), false-start anchor retry budget
  (CR4-T3), non-sequential step edge specificity (CR4-T4),
  plan_id propagation (CR5-T1), sequence_number monotonicity
  (CR5-T2), max_chars=3 boundary (CR5-T3), false-start anchor
  specificity (CR5-T4), word-boundary truncation (CR5-T5),
  invariant prompt constraints (CR6-M2), invariant XML
  sanitisation (CR6-M3), invariant truncation cap (CR6-M4),
  negative max_chars (CR6-M5), and no-space truncation (CR6-L8)
- 7 Robot Framework integration tests in robot/strategy_actor.robot
- Mock LLM provider in features/mocks/mock_strategy_llm.py

All nox stages pass: lint, typecheck, unit_tests (13789 scenarios),
integration_tests (1863 passed).
integration_tests (1863 passed, 2 pre-existing TDD failures unrelated
to this change).

ISSUES CLOSED: #828
2026-04-14 19:26:49 +00:00
hurui200320 ee2024046f fix(plan): upsert action arguments during plan use to avoid UNIQUE constraint violation (#4197)
CI / lint (push) Successful in 37s
CI / quality (push) Successful in 53s
CI / typecheck (push) Successful in 57s
CI / security (push) Successful in 58s
CI / helm (push) Successful in 25s
CI / push-validation (push) Successful in 25s
CI / build (push) Successful in 30s
CI / integration_tests (push) Successful in 4m22s
CI / e2e_tests (push) Successful in 4m17s
CI / unit_tests (push) Successful in 5m10s
CI / docker (push) Successful in 1m30s
CI / coverage (push) Successful in 12m18s
CI / status-check (push) Successful in 1s
CI / benchmark-regression (push) Has been skipped
CI / benchmark-publish (push) Has been cancelled
## Summary

`agents plan use` crashed with `sqlite3.IntegrityError: UNIQUE constraint failed: action_arguments.action_name, action_arguments.name` when the action had arguments already registered via `action create`. The root cause was `ActionRepository.update()` using SQLAlchemy's relationship `.clear()` + `.append()` pattern, which deferred the DELETE and processed the INSERT first — triggering a UNIQUE constraint violation when the same `(action_name, name)` pair was being re-inserted.

## Approach

Replace the `.clear()` + `.append()` pattern with explicit bulk `sa_delete()` + `session.flush()` before re-inserting child rows for both `action_arguments` and `action_invariants`. After the flush, expire the relationship collections with `session.expire(row, ["arguments_rel", "invariants_rel"])` so SQLAlchemy reloads from the now-empty database state before appending replacements. This avoids stale identity map references and guarantees the DELETE is committed before any INSERT.

## Key Changes

### Bug fix (`src/cleveragents/infrastructure/database/repositories.py`)
- `ActionRepository.update()` now uses `sa_delete(ActionArgumentModel)` and `sa_delete(ActionInvariantModel)` with `synchronize_session=False`, followed by `session.flush()`, before re-inserting child rows.
- Targeted `session.expire(row, ["arguments_rel", "invariants_rel"])` replaces the removed `.clear()` calls to force collection reload.

### Schema parity (`src/cleveragents/infrastructure/database/models.py`)
- Added `UniqueConstraint("action_name", "position")` to `ActionInvariantModel`.
- Added `UniqueConstraint("action_name", "name")`, `CheckConstraint` for `arg_type`, and `CheckConstraint` for `requirement` to `ActionArgumentModel`.

### Alembic migration (`alembic/versions/a5_006_action_invariants_unique_constraint.py`)
- New migration adds all four constraints to both `action_invariants` and `action_arguments` tables.
- Includes deduplication guards and data normalization so the upgrade succeeds on existing databases with invalid or duplicate rows.
- Uses `batch_alter_table` for SQLite compatibility.

### Tests
- **Behave** (`features/plan_use_action_args_integrity.feature`): 6 scenarios covering the core bug path, zero-argument regression, multiple arguments, reusable action double-use, non-reusable action archival with invariants, and direct repository update.
- **Robot** (`robot/plan_use_action_args_integrity.robot`): Integration test mirroring the Behave scenarios via a helper script.
- **Shared factory** (`features/mocks/test_uow_factory.py`): Extracted `build_test_uow()` from both test suites into a single shared module to eliminate duplication (DRY).

### Minor
- Updated `src/cleveragents/domain/repositories/__init__.py` docstring from table format to bullet list (conflict resolution from rebase).

Closes #4174

Reviewed-on: #4197
Reviewed-by: HAL 9000 <HAL9000@cleverthis.com>
Co-authored-by: Rui Hu <rui.hu@cleverthis.com>
Co-committed-by: Rui Hu <rui.hu@cleverthis.com>
2026-04-09 06:11:39 +00:00
freemo 99b4067ec2 fix(cli): extend agents diagnostics to check all 9 supported providers
CI / lint (push) Waiting to run
CI / typecheck (push) Waiting to run
CI / security (push) Waiting to run
CI / quality (push) Waiting to run
CI / unit_tests (push) Waiting to run
CI / integration_tests (push) Waiting to run
CI / e2e_tests (push) Waiting to run
CI / coverage (push) Blocked by required conditions
CI / benchmark-regression (push) Blocked by required conditions
CI / benchmark-publish (push) Waiting to run
CI / build (push) Waiting to run
CI / docker (push) Blocked by required conditions
CI / helm (push) Waiting to run
CI / status-check (push) Blocked by required conditions
Reviewed and APPROVED. All blocking issues addressed. Closes #3422.
2026-04-05 21:19:43 +00:00
freemo 2917aa7ddb fix(cli): extend agents diagnostics to check all 9 supported providers
CI / lint (pull_request) Successful in 24s
CI / typecheck (pull_request) Successful in 51s
CI / quality (pull_request) Successful in 46s
CI / security (pull_request) Successful in 1m0s
CI / build (pull_request) Successful in 38s
CI / helm (pull_request) Successful in 24s
CI / unit_tests (pull_request) Successful in 6m47s
CI / e2e_tests (pull_request) Successful in 18m26s
CI / docker (pull_request) Successful in 1m29s
CI / integration_tests (pull_request) Successful in 22m58s
CI / coverage (pull_request) Successful in 10m55s
CI / status-check (pull_request) Successful in 2s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 56m49s
Extend _check_providers() in system.py to report diagnostic status for
all 9 providers supported by ProviderRegistry: OpenAI, Anthropic, Google,
Azure, OpenRouter, Gemini, Cohere, Groq, and Together AI.

Previously only 4 providers (OpenAI, Anthropic, Google, OpenRouter) were
checked, leaving users of Groq, Together AI, Cohere, Azure, and Gemini
with no diagnostic feedback about their provider configuration.

Changes:
- Add Azure (AZURE_OPENAI_API_KEY), Gemini (GEMINI_API_KEY),
  Cohere (COHERE_API_KEY), Groq (GROQ_API_KEY), and
  Together AI (TOGETHER_API_KEY) to the provider_checks list
- Add Behave feature file with 11 scenarios covering all 9 providers
  (presence, OK status when configured, WARN with recommendation when not)

ISSUES CLOSED: #3422
2026-04-05 21:06:04 +00:00
freemo 7c2f5a1c76 fix(mcp): correct MCPToolResult.data type annotation for MCP 1.4.0 content list format
CI / lint (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 58s
CI / security (pull_request) Successful in 1m0s
CI / quality (pull_request) Successful in 39s
CI / build (pull_request) Successful in 24s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 7m4s
CI / e2e_tests (pull_request) Successful in 17m25s
CI / integration_tests (pull_request) Successful in 22m49s
CI / docker (pull_request) Successful in 1m29s
CI / coverage (pull_request) Successful in 11m6s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 57m30s
- What was implemented
  - Updated MCPToolResult.data docstring to document the normalisation behaviour, clarifying that MCP 1.4.0 list-format content is normalised to a dict with a "content" key.
  - Updated MCPToolAdapter.invoke() success path to normalise MCP 1.4.0 list-format content: when content is a list (as per MCP 1.4.0 spec), it is wrapped as {"content": [...]} so MCPToolResult.data is always dict[str, Any].
  - Updated MockMCPTransport.call() to return MCP 1.4.0-compliant list-format content: invoke_results are now wrapped as [{"type": "text", "text": json.dumps(payload)}] instead of the non-standard dict format.
  - Added json import to mock_mcp_transport.py to support JSON payload encoding.
  - Updated existing mcp_adapter.feature scenario "Invoke a discovered tool successfully" to check for "content" key instead of "id" (since mock now returns MCP 1.4.0 list format).
  - Added two new Behave scenarios: "Invoke tool returns MCP 1.4.0 list-format content normalised to dict" and "Invoke tool with MCP 1.4.0 content list stores content items".
  - Added corresponding step definitions for the new scenarios.
  - All 14,418 existing scenarios continue to pass; 2 new scenarios added; typecheck passes with 0 errors; lint passes.

- Why this approach
  - Design decision: Normalize to dict (Option B) to maintain a consistent MCPToolResult.data type of dict[str, Any] and avoid breaking downstream code that accesses result.data["key"].
  - Fallback path handles non-standard server responses gracefully, ensuring robustness when servers deviate from MCP 1.4.0 spec.

- Technical approach and affected components
  - Core: MCPToolResult data handling and MCPToolAdapter.invoke() logic
  - Mocks: mock_mcp_transport.py updated to emit MCP 1.4.0 list-format content
  - Tests: updated mcp_adapter.feature expectations; added two Behave scenarios with new step definitions
  - Dependencies: added import json to mock_mcp_transport.py

- Verification
  - Comprehensive test suites: 14,418 existing scenarios pass
  - 2 new scenarios added and pass
  - Typechecking: 0 errors
  - Linting: passes

ISSUES CLOSED: #2743
2026-04-05 07:48:02 +00:00
freemo b96138b88e fix(mcp): extract error message from content[0].text per MCP 1.4.0 protocol
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 20s
CI / typecheck (pull_request) Successful in 50s
CI / quality (pull_request) Successful in 38s
CI / helm (pull_request) Successful in 23s
CI / build (pull_request) Successful in 3m16s
CI / security (pull_request) Successful in 4m9s
CI / unit_tests (pull_request) Failing after 6m26s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 10m11s
CI / e2e_tests (pull_request) Failing after 15m10s
CI / integration_tests (pull_request) Failing after 21m56s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-regression (pull_request) Successful in 56m11s
MCPToolAdapter.invoke() was reading error messages from result.get('error',
'unknown error'), but the MCP 1.4.0 protocol returns errors in the content
field as a list of content items with type and text keys. This caused every
error from a real MCP 1.4.0-compliant server to be silently replaced with
the string 'unknown error'.

Changes:
- src/cleveragents/mcp/adapter.py: extract error_text from content[0].text
  with safe guards (isinstance check, length check) and fallback to
  'unknown error' when content is absent or empty
- features/mocks/mock_mcp_transport.py: return MCP 1.4.0-compliant error
  responses using content list format instead of the non-standard error key
- features/tdd_mcp_error_content_key.feature: Behave scenario verifying
  correct error extraction from MCP 1.4.0 content arrays (written as TDD
  issue-capture, @tdd_expected_fail removed after fix applied)
- features/steps/tdd_mcp_error_content_key_steps.py: step definitions for
  the new scenario including _MCP14ErrorTransport mock subclass

All 51 MCP adapter scenarios pass. Typecheck: 0 errors. Lint: clean.

ISSUES CLOSED: #2158
2026-04-03 19:03:15 +00:00
CoreRasurae b21e0fedea test(bdd): add direct test for _fast_init_or_upgrade early-return behavior
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 21s
CI / helm (pull_request) Successful in 24s
CI / typecheck (pull_request) Successful in 50s
CI / security (pull_request) Successful in 1m10s
CI / lint (pull_request) Successful in 3m20s
CI / quality (pull_request) Successful in 3m45s
CI / unit_tests (pull_request) Successful in 5m53s
CI / docker (pull_request) Successful in 1m32s
CI / coverage (pull_request) Successful in 12m27s
CI / e2e_tests (pull_request) Successful in 19m48s
CI / integration_tests (pull_request) Successful in 22m24s
CI / status-check (pull_request) Successful in 1s
CI / build (push) Successful in 16s
CI / helm (push) Successful in 22s
CI / lint (push) Successful in 3m17s
CI / quality (push) Successful in 3m39s
CI / typecheck (push) Successful in 3m53s
CI / security (push) Successful in 4m4s
CI / unit_tests (push) Successful in 9m13s
CI / docker (push) Successful in 20s
CI / coverage (push) Successful in 12m20s
CI / e2e_tests (push) Successful in 19m18s
CI / integration_tests (push) Successful in 24m36s
CI / status-check (push) Successful in 2s
CI / benchmark-regression (push) Has been skipped
CI / benchmark-regression (pull_request) Successful in 55m5s
CI / benchmark-publish (push) Successful in 28m26s
Add 8 BDD scenarios in features/fast_init_upgrade.feature that directly
exercise the _fast_init_or_upgrade closure installed by
_install_template_db_patch in features/environment.py.

Scenarios cover all code paths:
- Non-empty DB with matching prefix → early return (original NOT invoked)
- Non-existent DB with matching prefix → template copied (original NOT invoked)
- Existing empty DB with matching prefix → template copied (original NOT invoked)
- Non-matching prefix → delegates to original init_or_upgrade
- In-memory SQLite → delegates to original init_or_upgrade
- Non-SQLite URL → delegates to original init_or_upgrade
- Bare sqlite:// URL → delegates to original init_or_upgrade
- Delegation forwards runner instance and keyword arguments correctly

Test infrastructure:
- features/mocks/fast_init_test_helpers.py provides a context manager
  (patch_original_init_or_upgrade) that replaces the _original_init_or_upgrade
  reference inside the closure via cell_contents manipulation, enabling
  precise call-tracking without recreating the function under test.
- All scenarios tagged @mock_only to skip unnecessary DB setup.
- Cleanup registered via context._cleanup_handlers for temp file removal.
- Works in both sequential and parallel execution modes.

Review fix round:
- Added bare sqlite:// URL scenario covering the second branch of the
  in-memory disjunction (L1).
- Added scenario verifying runner instance and keyword argument forwarding
  through the delegation path (L2, L3).
- Replaced hardcoded test credentials with clearly synthetic pattern (I4).
- Fixed CHANGELOG wording that incorrectly claimed mktemp replacement (L5).

ISSUES CLOSED: #733
2026-04-01 23:52:20 +01:00
brent.edwards 91cc0b1446 test: add TDD bug-capture test for #1025 — plan correct auto-resolve (#1172)
CI / quality (push) Successful in 36s
CI / build (push) Successful in 20s
CI / helm (push) Successful in 22s
CI / lint (push) Successful in 3m21s
CI / typecheck (push) Successful in 3m57s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 4m7s
CI / unit_tests (push) Successful in 9m18s
CI / docker (push) Successful in 1m18s
CI / coverage (push) Successful in 12m28s
CI / e2e_tests (push) Failing after 19m0s
CI / integration_tests (push) Successful in 24m45s
CI / status-check (push) Failing after 1s
CI / benchmark-publish (push) Successful in 28m39s
## Summary
- add Behave `@tdd_expected_fail` bug-capture scenarios for `plan correct` auto-resolve without `--plan`
- add shared mock fixtures and Robot integration coverage for isolated-container divergence reproducing bug #1025
- add ASV benchmark coverage for active-plan filtering and document the new TDD capture in changelog

## Testing
- nox -s unit_tests -- features/tdd_plan_correct_auto_resolve.feature
- nox -s integration_tests -- --include tdd_bug_1025
- nox -s lint
- nox -s typecheck
- nox -s coverage_report
- nox

Closes #1035

Reviewed-on: #1172
Reviewed-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com>
Co-authored-by: Brent Edwards <brent.edwards@cleverthis.com>
Co-committed-by: Brent Edwards <brent.edwards@cleverthis.com>
2026-04-01 00:40:46 +00:00
freemo 38e05ac45a feat(correction): wire checkpoint rollback into correction service revert flow
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 18s
CI / build (pull_request) Successful in 20s
CI / helm (pull_request) Successful in 22s
CI / typecheck (pull_request) Successful in 1m0s
CI / quality (pull_request) Successful in 3m41s
CI / integration_tests (pull_request) Successful in 3m51s
CI / security (pull_request) Successful in 4m3s
CI / unit_tests (pull_request) Successful in 4m11s
CI / docker (pull_request) Successful in 1m31s
CI / coverage (pull_request) Successful in 11m48s
CI / e2e_tests (pull_request) Successful in 21m45s
CI / status-check (pull_request) Successful in 1s
CI / build (push) Successful in 17s
CI / helm (push) Successful in 21s
CI / quality (push) Successful in 3m48s
CI / integration_tests (push) Successful in 3m58s
CI / typecheck (push) Successful in 3m58s
CI / security (push) Successful in 4m6s
CI / unit_tests (push) Successful in 7m16s
CI / lint (push) Successful in 8m14s
CI / benchmark-regression (push) Has been skipped
CI / docker (push) Successful in 1m36s
CI / e2e_tests (push) Successful in 18m9s
CI / coverage (push) Successful in 12m13s
CI / status-check (push) Successful in 1s
CI / benchmark-publish (push) Successful in 28m11s
CI / benchmark-regression (pull_request) Successful in 54m54s
Implement the full correction-checkpoint rollback pipeline:

- Workspace snapshots: CheckpointService.create_workspace_snapshot()
  creates diff-based checkpoints before decision execution, storing
  only changed file paths in metadata.extra["diff_paths"]

- CorrectionService.revert_decisions(): new high-level entry point
  that creates a correction, computes impact, invokes checkpoint
  rollback, and archives artifacts in a single call

- Physical artifact archival: CheckpointService.archive_artifacts()
  moves files to .cleveragents/archived_artifacts/ instead of just
  flagging metadata. CorrectionService._archive_decision_artifacts()
  delegates to this during revert execution

- Selective rollback: CheckpointService.selective_rollback() wraps
  rollback_to_checkpoint with atomic semantics — captures HEAD before
  rollback and recovers on failure

- Diff-based storage: _compute_diff_snapshot() computes changed paths
  between checkpoints via git diff; snapshots store diff manifest and
  SHA-256 hash in metadata

- CLI: plan rollback now accepts --to-checkpoint <id> in addition to
  the positional checkpoint_id argument; uses selective_rollback for
  atomic execution

- DI wiring: Container now injects checkpoint_service into
  CorrectionService; CLI correct command uses container-provided
  service instead of ad-hoc instance (fixes bug #986)

- Checkpoint model: pre_decision added to allowed checkpoint_type
  values

- TDD: Removed @tdd_expected_fail from wiring test feature since the
  DI bug is now fixed

ISSUES CLOSED: #943
2026-03-30 17:06:49 -04:00
hurui200320 1878998b7a refactor(testing): rename tdd_bug/tdd_bug_N tags to tdd_issue/tdd_issue_N
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 25s
CI / lint (pull_request) Successful in 3m19s
CI / typecheck (pull_request) Successful in 3m56s
CI / security (pull_request) Successful in 4m6s
CI / quality (pull_request) Successful in 4m10s
CI / integration_tests (pull_request) Successful in 7m20s
CI / unit_tests (pull_request) Successful in 7m44s
CI / docker (pull_request) Successful in 1m8s
CI / e2e_tests (pull_request) Successful in 13m1s
CI / coverage (pull_request) Successful in 12m25s
CI / status-check (pull_request) Successful in 1s
CI / build (push) Successful in 26s
CI / lint (push) Successful in 3m31s
CI / quality (push) Successful in 3m40s
CI / typecheck (push) Successful in 3m57s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 4m1s
CI / integration_tests (push) Successful in 8m55s
CI / unit_tests (push) Successful in 9m14s
CI / docker (push) Successful in 9s
CI / e2e_tests (push) Successful in 11m42s
CI / coverage (push) Successful in 11m37s
CI / status-check (push) Successful in 4s
CI / benchmark-publish (push) Successful in 29m25s
CI / benchmark-regression (pull_request) Successful in 54m8s
Rename the TDD tag system from tdd_bug/tdd_bug_<N> to tdd_issue/tdd_issue_<N>
across the entire codebase. The tdd_expected_fail tag is unchanged.

The TDD expected-failure workflow is not limited to bug fixes — it applies
equally to any issue type (features, tasks, refactors). The _bug suffix was
misleading and narrowed the perceived scope. The new _issue suffix accurately
reflects that the TDD tagging system applies to any Forgejo issue.

Changes span 92 files:
- features/environment.py: validate_tdd_tags(), should_invert_result(), and
  apply_tdd_inversion() updated — regex, variables, error messages
- robot/tdd_expected_fail_listener.py: _validate_tdd_tags(), _should_invert_result(),
  start_test(), end_test() updated consistently
- 33 Behave .feature files: all @tdd_bug/@tdd_bug_<N> tags renamed
- 29 Robot .robot files: all tdd_bug/tdd_bug_<N> tags renamed
- 3 Robot fixture files renamed (tdd_bug_alone, tdd_missing_tdd_bug,
  tdd_expected_fail_missing_bug_n) with content and references updated
- Tag validation tests and helpers updated (function names, command dispatch
  keys, output strings, fixture references)
- CONTRIBUTING.md: section renamed from 'TDD Bug Test Tags' to
  'TDD Issue Test Tags', all tag references and examples updated
- noxfile.py: comment references updated
- Step definition files, mock helpers, and benchmark files: docstring
  references updated

ISSUES CLOSED: #965
2026-03-27 05:58:35 +00:00
brent.edwards c2a2c5c4bf fix(cli): make plan correct accept plan_id as primary identifier (#1055)
CI / build (push) Successful in 23s
CI / lint (push) Successful in 3m40s
CI / typecheck (push) Successful in 4m14s
CI / benchmark-regression (push) Has been skipped
CI / quality (push) Successful in 4m9s
CI / security (push) Successful in 4m24s
CI / unit_tests (push) Successful in 6m55s
CI / integration_tests (push) Successful in 7m7s
CI / docker (push) Successful in 1m14s
CI / e2e_tests (push) Successful in 9m24s
CI / coverage (push) Successful in 11m20s
CI / status-check (push) Successful in 1s
CI / benchmark-publish (push) Successful in 24m27s
## Summary

- **`plan correct` now accepts a plan_id** as its positional argument (in addition to decision_id). When a plan_id is given, the root decision is automatically selected as the correction target.
- The positional parameter is renamed from `decision_id` to `identifier` with updated help text reflecting dual use.
- Backward compatibility is fully preserved: decision_id inputs continue to work exactly as before.

## How it works

1. Try `container.plan_lifecycle_service().get_plan(identifier)` to check if the identifier is a plan_id
2. If it resolves to a real `Plan` object, use it as `resolved_plan_id` and auto-select the root decision (`parent_decision_id is None`)
3. If lookup fails (`ResourceNotFoundError`) or the result is not a `Plan` instance, fall back to treating the identifier as a decision_id (original behavior)

## Verification

- `nox -s lint` — All checks passed
- `nox -s typecheck` — 0 errors, 1 pre-existing warning
- `nox -s unit_tests` (correction features) — 150 scenarios passed, 683 steps passed, 0 failures

ISSUES CLOSED: #969

Reviewed-on: #1055
Co-authored-by: Brent E. Edwards <brent.edwards@cleverthis.com>
Co-committed-by: Brent E. Edwards <brent.edwards@cleverthis.com>
2026-03-21 18:45:17 +00:00
hurui200320 0b415a6e5e test: add TDD bug-capture test for #969 — plan correct plan_id handling (#1051)
CI / lint (push) Successful in 16s
CI / build (push) Successful in 20s
CI / quality (push) Successful in 29s
CI / typecheck (push) Successful in 45s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 52s
CI / unit_tests (push) Successful in 3m12s
CI / integration_tests (push) Successful in 3m42s
CI / docker (push) Successful in 56s
CI / e2e_tests (push) Successful in 5m18s
CI / coverage (push) Successful in 7m0s
CI / benchmark-publish (push) Successful in 20m2s
## Summary

Add TDD bug-capture tests for bug #969 (`plan correct` expects `decision_id` but M3 acceptance test passes `plan_id`). These tests prove the bug exists and will serve as regression guards once the fix in #969 is merged.

### Changes

- **Behave test** (`features/tdd_plan_correct_plan_id.feature`): Two scenarios tagged `@tdd_expected_fail @tdd_bug @tdd_bug_969` — one for `--mode revert` and one for `--mode append` — that invoke `plan correct <plan_id>` (without `--plan` flag) and assert the command resolves the plan_id to its root decision as `target_decision_id`. Both modes are tested because the bug affects `target_decision_id` resolution **before** mode-specific branching.

- **Step definitions** (`features/steps/tdd_plan_correct_plan_id_steps.py`): Mock setup for DI container (DecisionService), CorrectionService, and `_resolve_active_plan_id`. Uses `tpcpid` step prefix per project conventions.

- **Shared fixtures** (`features/mocks/tdd_plan_correct_plan_id_fixtures.py`): Centralised constants, patch targets, mock builders (`make_decision_ns`, `make_mock_container`, `make_correction_svc`, `make_default_decisions`, `make_default_container`), and `build_cli_args` helper. Both the Behave steps and Robot helper import from this shared module, eliminating code duplication and drift risk.

- **Robot test** (`robot/tdd_plan_correct_plan_id.robot`): Two integration-level tests (revert + append) with `tdd_expected_fail tdd_bug tdd_bug_969` tags, exercising the same code paths via the helper script.

- **Robot helper** (`robot/helper_tdd_plan_correct_plan_id.py`): Standalone helper that exits 0 with sentinel when the bug is fixed, exits 1 when the bug is present. Imports shared fixtures from `features/mocks/`.

- **Changelog** (`CHANGELOG.md`): Added entry under Unreleased for #979.

### Bug Description

The `correct_decision` function in `cleveragents.cli.commands.plan` declares `decision_id` as its first positional argument. When the M3 acceptance test calls `plan correct <plan_id> --mode revert --guidance "..."`, the plan_id is captured as `decision_id` and used directly as `target_decision_id` in `svc.request_correction()`. Since the plan_id is not a valid decision_id, the correction service cannot find the targeted decision. The same bug path is exercised by `--mode append`.

### How TDD Expected-Fail Works

- The `@tdd_expected_fail` tag causes the test framework to invert the result: the test passes CI when the underlying assertion fails (proving the bug exists) and fails CI if the assertion passes (bug was fixed without removing the tag).
- When bug #969 is fixed, the developer removes the `@tdd_expected_fail` tag, and the test runs normally as a regression guard.

### Quality Gates

All nox sessions pass:
- `nox -s lint` 
- `nox -s typecheck`  (0 errors)
- `nox -s unit_tests`  (387 features, 11121 scenarios, 0 failures)
- `nox -s integration_tests`  (1561 tests, 0 failures)
- `nox -s e2e_tests`  (16 tests, 0 failures)
- `nox -s coverage_report`  (≥97%)

Closes #979

Reviewed-on: #1051
Co-authored-by: Rui Hu <rui.hu@cleverthis.com>
Co-committed-by: Rui Hu <rui.hu@cleverthis.com>
2026-03-19 07:31:12 +00:00
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
brent.edwards 288246d9b5 fix(test): remove eager tdd_test_helpers import from mocks __init__
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 17s
CI / build (pull_request) Successful in 27s
CI / quality (pull_request) Successful in 29s
CI / security (pull_request) Successful in 42s
CI / typecheck (pull_request) Successful in 42s
CI / e2e_tests (pull_request) Successful in 1m32s
CI / unit_tests (pull_request) Successful in 3m9s
CI / docker (pull_request) Successful in 9s
CI / integration_tests (pull_request) Successful in 3m34s
CI / coverage (pull_request) Successful in 5m54s
CI / benchmark-regression (pull_request) Successful in 37m11s
The re-export of make_mock_scenario from features/mocks/__init__.py
caused ASV benchmark discovery to fail because tdd_test_helpers imports
behave.model.Status, which is unavailable in the ASV benchmark
virtualenv.  All callers already import via the full module path
(features.mocks.tdd_test_helpers), so the re-export was unnecessary.

ISSUES CLOSED: #628
2026-03-16 23:22:05 +00:00
hurui200320 a5de448856 feat(testing): implement @tdd_expected_fail tag handling in Robot Framework
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / build (pull_request) Successful in 20s
CI / quality (pull_request) Successful in 30s
CI / typecheck (pull_request) Successful in 51s
CI / security (pull_request) Successful in 53s
CI / e2e_tests (pull_request) Successful in 1m20s
CI / unit_tests (pull_request) Successful in 3m24s
CI / benchmark-regression (pull_request) Failing after 2m32s
CI / integration_tests (pull_request) Successful in 3m33s
CI / docker (pull_request) Successful in 15s
CI / coverage (pull_request) Successful in 6m52s
Implements the three-tag TDD bug-capture system in Robot Framework via a
Listener v3 module, paralleling the Behave implementation. Tests tagged
tdd_expected_fail that fail have their result inverted to PASS (bug still
exists); tests that unexpectedly pass are inverted to FAIL with guidance.

Addresses all 15 findings from code review (PR !673, reviewer hamza.khyari):

P2 fixes:
- Added idempotency guard (_processed_tests set) to prevent double-inversion
  when the listener is loaded twice in the same process.
- Rewrote normal-test-unaffected check to run alongside a tdd_expected_fail
  fixture in a single Robot invocation, proving the listener is loaded and
  selectively applies rather than being a tautological pass.

P3 fixes:
- Added output.xml existence guard with clear diagnostics in _run_fixture.
- Documented intentional use of data.tags (static definition) vs result.tags
  (runtime-modifiable) in end_test docstring.
- Added SKIP status test fixture and integration test case.
- Added message content assertion in cmd_expected_fail_inverted.
- Tightened substring assertions to match specific error text.
- Added tdd_expected_fail-alone fixture (both companions missing).
- Added close() hook to clear _validation_errors and _processed_tests.
- Simplified _run_fixture return type to tuple[str, str].
- Changed listener path resolution from CWD-relative to __file__-relative
  in noxfile.py (integration_tests, slow_integration_tests, e2e_tests).

P4 fixes:
- Added __all__ declaration to helper module.
- Changed module docstring from "mirroring" to "paralleling".
- Added comment documenting accepted XML parsing risk (self-generated XML).

Additional fixes:
- Increased M4 E2E plan-tree test timeout from 30s to 120s (pre-existing
  timeout failure unrelated to this feature).

Quality gates (post-rebase onto latest master):
- nox -s lint: PASS
- nox -s typecheck: PASS (0 errors)
- nox -s unit_tests: PASS (10,700 scenarios)
- nox -s integration_tests: PASS (1,505 tests)
- nox -s coverage_report: PASS (97.9% >= 97% threshold)
- nox -s benchmark: PASS
- nox -s docs: PASS
- nox -s build: PASS
- nox -s security_scan: PASS
- nox -s dead_code: PASS

ISSUES CLOSED: #628
2026-03-16 22:45:55 +00:00
CoreRasurae 3e3e9b4b5d feat(observability): wire AuditService.record() into domain services via EventBus auto-dispatch
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 18s
CI / e2e_tests (pull_request) Successful in 30s
CI / security (pull_request) Successful in 36s
CI / typecheck (pull_request) Successful in 40s
CI / unit_tests (pull_request) Successful in 3m19s
CI / integration_tests (pull_request) Successful in 3m36s
CI / docker (pull_request) Successful in 40s
CI / coverage (pull_request) Successful in 5m38s
CI / lint (push) Successful in 12s
CI / quality (push) Successful in 19s
CI / build (push) Successful in 15s
CI / security (push) Successful in 38s
CI / e2e_tests (push) Successful in 28s
CI / typecheck (push) Successful in 42s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 3m14s
CI / docker (push) Successful in 10s
CI / integration_tests (push) Successful in 3m33s
CI / coverage (push) Successful in 6m3s
CI / benchmark-publish (push) Successful in 19m14s
CI / benchmark-regression (pull_request) Successful in 36m42s
Implements AuditEventSubscriber that subscribes to all 9 security-relevant
EventType members and persists redacted audit entries via AuditService.record().

Key components:
- AuditEventSubscriber: bridges EventBus and AuditService (SEC7)
- SECURITY_EVENT_MAP: maps EventType enum to audit type strings
- Redaction via redact_dict() on event details before persistence
- Graceful error handling: failures logged, never propagated

Post-review fixes applied:
- BUG-1: Remove dead correlation_id null-check guard (DomainEvent.correlation_id
  is always non-None via ULID default_factory)
- SEC-2: Redact exception messages in warning logs via redact_value() to prevent
  potential leakage of sensitive internal state (e.g. DB connection strings)
- PERF-3: Pre-generate unique DomainEvent instances in ASV benchmark setup to
  avoid skew from reusing a single frozen object
- Wire event_bus from the DI container into CorrectionService (plan.py),
  ConfigService (config.py, skill.py x2, server.py), and
  PersistentSessionService (session.py) at their CLI construction sites.

Closes #581
2026-03-12 23:32:48 +00:00
brent.edwards f2e44b2cf1 Merge remote-tracking branch 'origin/master' into feature/m3-fix-actor-list-empty
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 34s
CI / typecheck (pull_request) Successful in 36s
CI / unit_tests (pull_request) Failing after 2m55s
CI / docker (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 3m28s
CI / coverage (pull_request) Successful in 5m33s
CI / benchmark-regression (pull_request) Has been cancelled
# Conflicts:
#	features/mocks/fake_provider.py
2026-03-11 03:40:37 +00:00
brent.edwards 205e94eb52 Merge remote-tracking branch 'origin/master' into feature/m3-fix-actor-list-empty
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 39s
CI / typecheck (pull_request) Successful in 38s
CI / unit_tests (pull_request) Successful in 3m6s
CI / integration_tests (pull_request) Successful in 3m19s
CI / docker (pull_request) Successful in 39s
CI / coverage (pull_request) Successful in 5m24s
CI / benchmark-regression (pull_request) Has been cancelled
# Conflicts:
#	CHANGELOG.md
#	noxfile.py
2026-03-11 03:12:52 +00:00
brent.edwards 5c5de082f2 Merge remote-tracking branch 'origin/master' into tdd/actor-list-validation
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 17s
CI / typecheck (pull_request) Successful in 38s
CI / security (pull_request) Successful in 51s
CI / unit_tests (pull_request) Successful in 2m43s
CI / docker (pull_request) Successful in 9s
CI / integration_tests (pull_request) Failing after 3m38s
CI / coverage (pull_request) Successful in 5m29s
CI / benchmark-regression (pull_request) Has been cancelled
# Conflicts:
#	benchmarks/tdd_session_create_di_bench.py
#	features/steps/tdd_session_create_di_steps.py
#	robot/helper_tdd_session_create_di.py
#	robot/tdd_session_create_di.robot
2026-03-11 03:07:42 +00:00
hamza.khyari 1e606553d4 feat(acms): implement Real-time Index Sync / UKOIndexer with pluggable analyzers
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 38s
CI / unit_tests (pull_request) Successful in 2m32s
CI / integration_tests (pull_request) Successful in 3m18s
CI / docker (pull_request) Successful in 49s
CI / coverage (pull_request) Successful in 5m29s
CI / benchmark-regression (pull_request) Successful in 33m48s
Implement the UKOIndexer service that produces UKO triples from resources
using pluggable domain-specific analyzers, wraps each triple with provenance
metadata, and simultaneously indexes into text, vector, and graph backends.

Key design decisions and components:

- UKOIndexer orchestrates the full index lifecycle: add_resource,
  update_resource (remove-then-add), remove_resource, and maintenance
  triggers. Each operation fires lifecycle hooks (on_indexed, on_removed,
  on_error) so callers can observe progress.

- Analyzer selection is pluggable via ContentAnalyzer protocol. The indexer
  accepts a registry mapping resource types to analyzers. PythonAnalyzer
  and MarkdownAnalyzer are provided as built-in implementations.

- LocationContentReader protocol abstracts file I/O with a base_dir
  parameter for path-traversal prevention (post-resolve validation rejects
  paths escaping the base directory and non-regular files).

- UKOTriple model includes a @model_validator ensuring at least one of
  object_uri or object_value is populated, preventing empty triples at
  construction time.

- Triple removal uses scoped deletion via uko:sourceResource predicate to
  avoid shared-subject collision — only triples originating from the
  specific resource are removed, not all triples for a shared subject.

- _resource_subjects.pop is deferred until after all backend removal
  operations succeed, preventing inconsistent state on partial failure.

- analyzer.analyze() is wrapped in try/except so that analyzer errors
  produce an IndexResult with error details rather than propagating
  exceptions to callers.

- All lifecycle hook calls are guarded via _fire_on_indexed,
  _fire_on_removed, and _fire_on_error helpers that catch and log hook
  exceptions without disrupting the indexing pipeline.

- max_triples parameter (default 50,000) bounds analyzer output size to
  prevent runaway resource consumption.

- ResourceFileWatcher monitors filesystem paths via watchdog and triggers
  re-indexing callbacks on file changes with configurable debouncing.
  Emits RESOURCE_MODIFIED domain events via EventBus when file changes
  are detected. Debounce timers coalesce rapid edits into a single
  callback invocation. Thread-safe design with daemon threads for clean
  shutdown.

- SearchResult.__post_init__ validates score is in [0.0, 1.0], correctly
  rejecting NaN values.

- Placeholder embedding uses [1.0] instead of [float(len(content))] to
  avoid leaking content size information.

- isinstance check on graph_backend ensures GraphIndexBackend protocol
  compliance at runtime.

- Test doubles extracted to features/mocks/uko_indexer_mocks.py for reuse
  across BDD steps and Robot helpers.

Spec reference: Architecture > ACMS > Real-time Index Synchronization
(specification.md lines ~43205-43300).

ISSUES CLOSED: #578
2026-03-11 00:40:07 +00:00
Brent E. Edwards 73d5552467 fix(actor): handle empty actor list without validation error
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 13s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 2m37s
CI / docker (pull_request) Successful in 39s
CI / integration_tests (pull_request) Successful in 4m42s
CI / coverage (pull_request) Successful in 7m0s
CI / benchmark-regression (pull_request) Successful in 32m19s
ActorRegistry._actor_name() built names via f"{provider}/{model}", which
produced names with multiple slashes when providers included models
containing "/" (e.g. OpenRouter's "anthropic/claude-sonnet-4-20250514").
The resulting name violated the spec pattern ^[a-z0-9_-]+/[a-z0-9_-]+$
and triggered a ValidationError during actor upsert.

Now sanitises both provider and model components by replacing "/" with "-"
and lowercasing, so multi-slash provider models no longer break actor
listing.

Includes 6 Behave BDD regression scenarios (covering zero-provider,
multi-slash, consecutive-slash, leading-slash, and name-validation
cases), Robot Framework integration smoke tests, and ASV benchmarks.

ISSUES CLOSED: #592
2026-03-10 23:11:22 +00:00
brent.edwards 2365f9a355 test(actor): add TDD failing tests for actor list empty validation error
Behave BDD scenarios (3) tagged @tdd_bug @tdd_bug_592 @tdd_expected_fail
exercise the real ActorRegistry._actor_name() code path with a provider
whose default model contains '/' separators. The tests assert correct
behaviour (exit 0, single-slash names, valid JSON) and fail while the
bug is present; the @tdd_expected_fail handler inverts results so CI
stays green.

Includes Robot Framework integration smoke tests (3), ASV benchmarks (3),
and a shared FakeProviderInfo/FakeProviderRegistry mock in
features/mocks/fake_provider.py.

ISSUES CLOSED: #634
2026-03-10 22:40:15 +00:00
CoreRasurae cf67ba0a86 feat(devcontainer): add lazy activation and lifecycle management
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 37s
CI / unit_tests (pull_request) Successful in 2m27s
CI / docker (pull_request) Successful in 49s
CI / integration_tests (pull_request) Successful in 3m46s
CI / coverage (pull_request) Successful in 4m56s
CI / lint (push) Successful in 12s
CI / build (push) Successful in 14s
CI / quality (push) Successful in 16s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 36s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 4m7s
CI / integration_tests (push) Successful in 4m41s
CI / docker (push) Successful in 44s
CI / coverage (push) Successful in 4m56s
CI / benchmark-publish (push) Successful in 17m17s
CI / benchmark-regression (pull_request) Successful in 31m25s
Implemented lazy container activation for devcontainer-instance resources
with ContainerLifecycleState enum tracking six states (inactive, starting,
active, stopping, stopped, error) with validated transitions. Extended
DevcontainerHandler with devcontainer up CLI integration and JSON output
parsing for container start. Added periodic health checking via
devcontainer exec ping with configurable interval. Added agents resource
stop and agents resource rebuild CLI commands for manual lifecycle
control. Wired session close and plan completion hooks to automatic
container cleanup. Includes lifecycle state persistence in resource
registry with timestamped transitions. Added Behave BDD tests, Robot
integration tests, and ASV activation latency benchmarks.

- Added remoteWorkspaceFolder absolute-path validation
- Aligned spec: handler name, rebuild types, --yes flag on stop/rebuild
- Added registry re-read in stop_container success path for consistency
- Added session_id field to ContainerLifecycleTracker for scoped cleanup
- Scoped stop_all_active_containers to session_id when provided
- Wired _cleanup_devcontainers into fail_apply and fail_execute
- Wired start_health_check into activate_container success path
- Restructured facade session close to always run container cleanup
  even without session service (F4)
- Re-read tracker from registry in activate_container success path
- Added evict_terminal_trackers to cap registry growth
- Updated devcontainer_resources.md: health check auto-start, scoped
  cleanup hooks, known limitations for eviction and sandbox_strategy
- Wired evict_terminal_trackers into stop_all_active_containers so
  terminal-state trackers are actually evicted in production
- Made stop_container idempotent: returns early when container is
  already in a terminal state instead of raising ValueError
- Fixed benchmark health check thread leak in TimeActivationLatency
  by clearing registry after each timing loop
- Added rebuild pass-through (--reset-container flag to devcontainer up)
- Added host_workspace_path field on ContainerLifecycleTracker so
  health probes use the host-side path for devcontainer exec
- Wired lazy activation into DevcontainerHandler.resolve() for
  devcontainer-instance resources in non-running states
- Changed _default_strategy from SNAPSHOT to NONE (container
  itself provides isolation; SandboxFactory raises NotImplementedError
  for snapshot)
- Restricted _STOPPABLE_TYPES to devcontainer-instance only
  (container-instance is not directly stoppable via CLI)

ISSUES CLOSED: #514
2026-03-10 12:17:51 +00:00
CoreRasurae 23803f14ec feat(lsp): add LSP server stub
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 33s
CI / typecheck (pull_request) Successful in 38s
CI / unit_tests (pull_request) Successful in 4m0s
CI / docker (pull_request) Successful in 38s
CI / integration_tests (pull_request) Successful in 4m48s
CI / coverage (pull_request) Successful in 4m31s
CI / lint (push) Successful in 12s
CI / quality (push) Successful in 16s
CI / build (push) Successful in 15s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 35s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 2m27s
CI / integration_tests (push) Successful in 3m3s
CI / docker (push) Successful in 38s
CI / coverage (push) Successful in 4m25s
CI / benchmark-publish (push) Successful in 16m28s
CI / benchmark-regression (pull_request) Successful in 28m52s
Added minimal LSP server entrypoint supporting initialize/shutdown/exit
handshake over JSON-RPC stdin/stdout transport with Content-Length
framing. Unsupported methods return MethodNotFound error with descriptive
message. Wired LSP requests through ACP facade in local mode. Added
agents lsp serve CLI command with --log-level flag, PID output, and
startup banner. Created reference documentation for the stub server.
Includes Behave BDD tests for protocol handshake, Robot smoke test, and
ASV startup latency benchmark.

ISSUES CLOSED: #203
2026-03-06 18:16:47 +00:00
aditya 519e26fb02 Merge branch 'master' into feature/m3-mcp-adapter
CI / benchmark-publish (pull_request) Has been skipped
CI / quality (pull_request) Successful in 21s
CI / lint (pull_request) Successful in 21s
CI / build (pull_request) Successful in 21s
CI / security (pull_request) Successful in 50s
CI / typecheck (pull_request) Successful in 59s
CI / integration_tests (pull_request) Successful in 4m18s
CI / unit_tests (pull_request) Successful in 10m11s
CI / docker (pull_request) Successful in 59s
CI / benchmark-regression (pull_request) Successful in 20m36s
CI / coverage (pull_request) Successful in 36m7s
2026-02-26 06:44:38 +00:00
aditya 2f9707cfdf refactor(mcp): fix mock placement, type annotation, and constructor validation
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 16s
CI / typecheck (pull_request) Successful in 30s
CI / quality (pull_request) Successful in 32s
CI / security (pull_request) Successful in 34s
CI / integration_tests (pull_request) Successful in 3m24s
CI / unit_tests (pull_request) Successful in 10m40s
CI / docker (pull_request) Successful in 1m4s
CI / benchmark-regression (pull_request) Successful in 19m50s
CI / coverage (pull_request) Successful in 28m33s
- Extract MockMCPTransport to features/mocks/mock_mcp_transport.py
- Use ToolRegistry type with TYPE_CHECKING in register_tools()
- Move transport config validation into __init__ via _validate_config()
2026-02-25 14:17:34 +00:00
brent.edwards 093a74953f test(e2e): add M2 actor + tool source smoke suite
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 16s
CI / lint (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 27s
CI / security (pull_request) Successful in 56s
CI / typecheck (pull_request) Successful in 1m2s
CI / coverage (pull_request) Has been cancelled
CI / unit_tests (pull_request) Has been cancelled
CI / integration_tests (pull_request) Has been cancelled
CI / benchmark-regression (pull_request) Has been cancelled
CI / docker (pull_request) Has been cancelled
Add comprehensive E2E test suite for M2 (Actor Graphs + Tool Sources) epic:

- Behave BDD: 10 scenarios covering actor YAML loading, skill registry,
  tool lifecycle (discover/activate/execute/deactivate), and MCP stub
- Robot Framework: 6 integration tests via CLI helper script
- ASV benchmarks: 12 benchmarks for actor loading, skill registry,
  tool lifecycle, and MCP stub performance baselines
- MCP stub server mock: in-process fake with 3 tools (search/fetch/transform)
- Fixtures: hierarchical graph actor YAML + skill pack with tool refs and
  inline tools
- Docs: updated testing.md with M2 smoke suite section

Closes #169
2026-02-24 21:55:24 +00:00
freemo 559aa15629 Feat: Wire actor invocation context through plan graph/providers and add streaming CLI coverage. 2025-12-24 18:50:34 -05:00
freemo 34a29d7cc8 Feat: Adding Actors support to database 2025-12-19 12:35:56 -05:00
freemo 337d78cf92 Feat: Now capturing token usage as well as passing along the streaming command from some providers 2025-12-09 14:23:47 -05:00
freemo 496f565a57 Chore: Completed stage 1.5 2025-11-24 20:04:18 -05:00
freemo 568bcc3d76 Feat: Implemented basics of plan streaming and AutoDebugGraph 2025-11-22 15:23:39 -05:00
freemo af5093c881 Chore: Got code coverage up to 98% 2025-11-19 22:40:53 -05:00
freemo 4ee19b9977 Feat: Added in memory_service and plan_service features 2025-11-18 17:04:01 -05:00
freemo 958c29b18a Feat: Moved to langchain based providers 2025-11-18 00:10:29 -05:00
freemo d3fb2f9a74 feat: continued with phase 2 adding database migration scripts to the mix 2025-11-13 18:25:24 -05:00