Commit Graph

14 Commits

Author SHA1 Message Date
hurui200320 7164b04019 refactor(providers): unify provider factory behind single source of truth
CI / lint (push) Successful in 1m1s
CI / build (push) Successful in 53s
CI / quality (push) Successful in 1m23s
CI / typecheck (push) Successful in 1m24s
CI / benchmark-regression (push) Has been skipped
CI / security (push) Successful in 1m42s
CI / push-validation (push) Successful in 21s
CI / helm (push) Successful in 25s
CI / e2e_tests (push) Successful in 4m6s
CI / integration_tests (push) Successful in 4m12s
CI / unit_tests (push) Successful in 6m39s
CI / docker (push) Successful in 1m44s
CI / coverage (push) Successful in 10m51s
CI / status-check (push) Successful in 2s
CI / benchmark-publish (push) Successful in 1h17m10s
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 33s
CI / build (pull_request) Successful in 50s
CI / lint (pull_request) Successful in 1m7s
CI / quality (pull_request) Successful in 1m9s
CI / typecheck (pull_request) Successful in 1m20s
CI / security (pull_request) Successful in 1m25s
CI / push-validation (pull_request) Successful in 19s
CI / integration_tests (pull_request) Successful in 3m20s
CI / e2e_tests (pull_request) Failing after 5m3s
CI / unit_tests (pull_request) Successful in 6m40s
CI / docker (pull_request) Successful in 1m30s
CI / coverage (pull_request) Successful in 11m9s
CI / status-check (pull_request) Failing after 3s
CI / benchmark-regression (pull_request) Failing after 1m11s
Extract _get_api_key() and _create_provider_instance() as a single internal
factory that handles all provider types, including MOCK. Both create_llm() and
create_ai_provider() now delegate to _create_provider_instance(), eliminating
the duplicated if/elif provider-switching chains and the divergence between the
two code paths. Adding a new provider now requires touching exactly one place.

Key changes:
- New _get_api_key(provider_type) consolidates API key lookup and validation
  that was previously duplicated across create_llm(), _create_provider_llm(),
  and every branch of create_ai_provider().
- New _create_provider_instance() is the unified raw-LLM factory, replacing
  _create_provider_llm() and the specialised adapter constructors in
  create_ai_provider(). MOCK is now handled here via FakeListLLM.
- create_ai_provider() wraps all providers uniformly in LangChainChatProvider
  instead of using specialised adapters (OpenAIChatProvider, AnthropicChatProvider,
  GoogleChatProvider, OpenRouterChatProvider) for the four primary providers.
- create_llm() drops its own API key validation block; validation now happens
  inside _create_provider_instance() via _get_api_key().
- All BDD scenarios updated: _create_provider_llm references become
  _create_provider_instance, and provider-type assertions on create_ai_provider
  results are updated to LangChainChatProvider.

Review fixes (Cycle 2):
- Add _coerce_env_bool() for consistent boolean env-var coercion in
  CLEVERAGENTS_ALLOW_MOCK_PROVIDER checks.
- Introduce _ApiKeyMissing sentinel to distinguish 'not provided' from None
  in provider configuration.
- Set MOCK supports_streaming=False in DEFAULT_CAPABILITIES to align with
  FakeListLLM semantics.
- Make MOCK is_configured conditional on CLEVERAGENTS_ALLOW_MOCK_PROVIDER.
- Use FakeListLLM(responses=['mock response'] * 10) to prevent IndexError
  in multi-step workflows.
- Strip max_retries from kwargs before passing to LangChain constructors.
- Extract _resolve_provider_type() helper shared by create_llm() and
  create_ai_provider() to reduce duplication and improve readability.
- Ensure __api_key_sentinel flows through factory_kwargs even when api_key
  is None, avoiding double _get_api_key() calls.
- Add CHANGELOG env-var documentation and providers.md env-var table.
- Resolve template DB lock issues by persisting in-memory SQLite via
  VACUUM INTO instead of direct file creation on tmpfs.

ISSUES CLOSED: #10949
2026-05-05 06:16:46 +00:00
HAL9000 988a169831 docs: add InvariantReconciliationActor API docs, devcontainer discovery module guide, and mkdocs nav
CI / benchmark-regression (push) Has been skipped
CI / benchmark-publish (push) Failing after 41s
CI / quality (push) Failing after 1m4s
CI / security (push) Failing after 1m4s
CI / unit_tests (push) Failing after 1m3s
CI / build (push) Failing after 45s
CI / push-validation (push) Successful in 47s
CI / helm (push) Successful in 42s
CI / lint (push) Successful in 1m33s
CI / e2e_tests (push) Failing after 45s
CI / integration_tests (push) Failing after 47s
CI / typecheck (push) Successful in 1m43s
CI / docker (push) Has been skipped
CI / coverage (push) Has been skipped
CI / status-check (push) Failing after 6s
CI / benchmark-publish (pull_request) Has been skipped
CI / helm (pull_request) Successful in 50s
CI / build (pull_request) Successful in 57s
CI / lint (pull_request) Successful in 1m9s
CI / quality (pull_request) Successful in 1m18s
CI / benchmark-regression (pull_request) Failing after 1m16s
CI / typecheck (pull_request) Successful in 1m30s
CI / security (pull_request) Successful in 1m36s
CI / e2e_tests (pull_request) Successful in 3m52s
CI / integration_tests (pull_request) Successful in 4m30s
CI / push-validation (pull_request) Successful in 20s
CI / unit_tests (pull_request) Successful in 6m31s
CI / docker (pull_request) Successful in 1m36s
CI / coverage (pull_request) Successful in 12m19s
CI / status-check (pull_request) Successful in 4s
- docs/api/actor.md: Add InvariantReconciliationActor section documenting
  the built-in reconciliation actor introduced in v3.8.0, including the
  reconciliation algorithm, ReconciliationResult/ConflictRecord/ScopeInvariants
  data classes, standalone reconcile_invariants() function, DI registration,
  and failure behaviour.

- docs/modules/devcontainer-discovery.md: New module guide for the
  devcontainer auto-discovery system (v3.8.0 fix #2615), covering
  DevcontainerDiscoveryResult, discover_devcontainers(), is_trigger_type(),
  monorepo named-config support, and gotchas.

- mkdocs.yml: Add 'Devcontainer Auto-Discovery' to the Modules nav section,
  alongside shell-safety, uko-provenance, invariant-reconciliation,
  context-hydration, and git-worktree-sandbox module docs.

- robot/coverage_threshold.robot: Add tdd_issue and tdd_issue_4305 tags
  to the Noxfile Contains Coverage Threshold Constant test case.

ISSUES CLOSED: #4485
2026-05-05 06:15:57 +00:00
HAL9000 4f2122cd9e docs: add action module API reference, update CHANGELOG and nav
CI / push-validation (pull_request) Successful in 27s
CI / helm (pull_request) Successful in 32s
CI / lint (pull_request) Successful in 1m6s
CI / build (pull_request) Successful in 1m0s
CI / typecheck (pull_request) Successful in 1m35s
CI / quality (pull_request) Successful in 1m41s
CI / benchmark-publish (pull_request) Has been skipped
CI / security (pull_request) Successful in 2m50s
CI / integration_tests (pull_request) Successful in 5m3s
CI / e2e_tests (pull_request) Successful in 5m27s
CI / unit_tests (pull_request) Successful in 6m49s
CI / docker (pull_request) Successful in 1m23s
CI / coverage (pull_request) Successful in 11m17s
CI / status-check (pull_request) Successful in 3s
CI / lint (push) Successful in 1m14s
CI / security (push) Successful in 1m22s
CI / typecheck (push) Successful in 1m51s
CI / quality (push) Successful in 1m29s
CI / push-validation (push) Successful in 27s
CI / helm (push) Successful in 48s
CI / build (push) Successful in 48s
CI / integration_tests (push) Successful in 4m11s
CI / e2e_tests (push) Successful in 4m19s
CI / unit_tests (push) Successful in 6m14s
CI / docker (push) Successful in 1m33s
CI / coverage (push) Successful in 16m7s
CI / benchmark-regression (push) Has been skipped
CI / benchmark-publish (push) Failing after 1m3s
CI / status-check (push) Successful in 3s
CI / benchmark-regression (pull_request) Failing after 1h11m1s
- Add docs/api/action.md: full API reference for ActionConfigSchema and ActionArgumentSchema — field tables, factory methods, camelCase compat mapping, env-var interpolation, database integrity note, and complete YAML example
- Update docs/api/index.md: add cleveragents.action entry to module index
- Update mkdocs.yml: add 'Action Schema: api/action.md' to the API Reference nav
- Update CHANGELOG.md [Unreleased] Fixed: document plan use UNIQUE constraint violation fix (#4174, #4197)
- Clarify from_yaml_file ValueError semantics, document inputs_schema type as dict[str, Any] | None, and update A2A ASV benchmarks to pass method= requests after JSON-RPC migration

ISSUES CLOSED: #7472
2026-04-26 09:39:17 +00:00
HAL9000 df863f169b docs(api): add ACMS/UKO API reference and update nav
CI / lint (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 45s
CI / quality (pull_request) Successful in 41s
CI / security (pull_request) Successful in 49s
CI / build (pull_request) Successful in 32s
CI / helm (pull_request) Successful in 26s
CI / push-validation (pull_request) Successful in 23s
CI / e2e_tests (pull_request) Successful in 3m38s
CI / integration_tests (pull_request) Successful in 4m36s
CI / unit_tests (pull_request) Successful in 5m25s
CI / docker (pull_request) Successful in 10s
CI / coverage (pull_request) Successful in 16m0s
CI / status-check (pull_request) Successful in 1s
CI / lint (push) Successful in 23s
CI / quality (push) Successful in 41s
CI / security (push) Successful in 54s
CI / typecheck (push) Successful in 56s
CI / build (push) Successful in 20s
CI / helm (push) Successful in 24s
CI / push-validation (push) Successful in 33s
CI / integration_tests (push) Successful in 4m6s
CI / e2e_tests (push) Successful in 4m27s
CI / unit_tests (push) Successful in 5m42s
CI / docker (push) Successful in 1m36s
CI / coverage (push) Successful in 10m56s
CI / status-check (push) Successful in 1s
Add comprehensive API documentation for the cleveragents.acms package,
covering the four-layer UKO ontology hierarchy (Layer 0-3), all public
types (VocabularyRegistry, ProvenanceInfo, UKOClass, UKOProperty,
UKOVocabulary, Layer2Dependency, ParadigmVocabulary), detail level maps
(DetailLevelMapBuilder, build_detail_level_map, build_effective_map,
resolve_detail_level), and all Layer 3 language vocabulary types for
Python, TypeScript, Rust, and Java.

- Add docs/api/acms.md with full API reference and usage example
- Update docs/api/index.md to include ACMS/UKO in the module index
- Update mkdocs.yml nav to include the new ACMS/UKO page
- Update CHANGELOG.md [Unreleased] with the documentation addition
2026-04-14 15:45:11 +00:00
freemo c886eb2a44 docs(api): add providers module to API reference index
CI / push-validation (push) Successful in 23s
CI / helm (push) Successful in 23s
CI / build (push) Successful in 24s
CI / lint (push) Failing after 37s
CI / quality (push) Successful in 37s
CI / typecheck (push) Has been cancelled
CI / security (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / integration_tests (push) Has been cancelled
CI / unit_tests (push) Has been cancelled
CI / benchmark-publish (push) Has been cancelled
CI / status-check (push) Has been cancelled
CI / coverage (push) Has been cancelled
CI / benchmark-regression (push) Has been cancelled
CI / docker (push) Has been cancelled
Add cleveragents.providers to the API Reference module index table.
The providers.md page already exists but was missing from the index,
making it undiscoverable via the documentation navigation.

ISSUES CLOSED: #4940
2026-04-08 23:39:38 +00:00
freemo 3acfe45b7b docs: add providers API reference, update index/architecture/changelog
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. Documentation-only PR.
2026-04-05 21:09:47 +00:00
freemo d72993d908 docs: add shell safety API, invariant reconciliation architecture, and new feature highlights
CI / lint (pull_request) Successful in 29s
CI / typecheck (pull_request) Successful in 50s
CI / security (pull_request) Successful in 1m3s
CI / quality (pull_request) Successful in 33s
CI / build (pull_request) Successful in 23s
CI / helm (pull_request) Successful in 24s
CI / unit_tests (pull_request) Failing after 7m12s
CI / docker (pull_request) Has been skipped
CI / e2e_tests (pull_request) Successful in 17m51s
CI / integration_tests (pull_request) Failing after 23m31s
CI / coverage (pull_request) Successful in 10m44s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 56m49s
- docs/api/tui.md: Document ShellDangerLevel, DangerousPattern, DEFAULT_PATTERNS,
  DangerousPatternDetector, ShellSafetyService, and SafetyCheckResult with
  full API reference, parameter tables, and usage examples
- docs/architecture.md: Add Invariant Reconciliation section covering the
  builtin/invariant-reconciliation actor, four-scope algorithm, failure
  behaviour, and DI registration
- README.md: Add Invariant Reconciliation, TUI shell danger detection, and
  UKO provenance tracking to the Highlights section

ISSUES CLOSED: #3377
2026-04-05 19:36:58 +00:00
freemo f1ab5d90dc docs: update documentation for v3.8.0 unreleased features
CI / unit_tests (push) Waiting to run
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
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 / 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
- Promote [Unreleased] CHANGELOG entries to [3.8.0] (2026-04-05)
- Add Shell Danger Detection section to docs/api/tui.md covering
  ShellDangerLevel, DangerousPattern, ShellSafetyService, and
  SafetyCheckResult with full API reference and usage examples
- Add InvariantService section to docs/api/core.md documenting
  the new DI-registered singleton, its methods, and emitted events
- Update docs/architecture.md Plan Lifecycle section to document
  invariant reconciliation as a phase transition gate
- Update README.md Highlights with shell danger detection, inline
  permission questions, invariant reconciliation, UKO provenance
  tracking, and JSON-RPC 2.0 A2A wire format
- Create docs/modules/shell-safety.md with full module guide
  covering purpose, key classes, built-in patterns, custom pattern
  registration, TUI integration, and testing guidance

ISSUES CLOSED: #1003 #997 #1391 #1004 #891 #1501 #1577 #1941 #2334
2026-04-05 19:33:19 +00:00
freemo a17848064d docs: add providers API reference, update index/architecture/changelog
CI / lint (pull_request) Successful in 40s
CI / typecheck (pull_request) Successful in 56s
CI / quality (pull_request) Successful in 32s
CI / security (pull_request) Successful in 58s
CI / build (pull_request) Successful in 23s
CI / helm (pull_request) Successful in 23s
CI / unit_tests (pull_request) Successful in 7m17s
CI / docker (pull_request) Successful in 11s
CI / e2e_tests (pull_request) Successful in 15m51s
CI / coverage (pull_request) Successful in 10m18s
CI / integration_tests (pull_request) Successful in 23m11s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-publish (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 58m25s
- docs/api/providers.md: new comprehensive API reference for
  cleveragents.providers — ProviderRegistry, ProviderType,
  ProviderCapabilities, ProviderInfo, LangChainChatProvider,
  module-level helpers, environment variables, and ASV benchmarks
- docs/api/index.md: add providers module to module index table
- docs/architecture.md: add Provider Registry section with discovery,
  selection, and factory usage examples
- CHANGELOG.md: add [Unreleased] entries for:
  - agents plan list --namespace/-n option (#2616)
  - ASV benchmark suite for providers module (#3022)
  - MCP error extraction from content[0].text per MCP 1.4.0 (#2600)
  - CI quality gates restored to passing on master (#2629)
2026-04-05 07:03:54 +00:00
freemo 5c0016c79d docs: add DomainBaseModel API reference and CI template DB changelog entry
CI / helm (push) Successful in 23s
CI / lint (push) Successful in 25s
CI / build (push) Successful in 28s
CI / quality (push) Successful in 3m41s
CI / typecheck (push) Successful in 3m56s
CI / security (push) Successful in 4m6s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Failing after 6m19s
CI / docker (push) Has been skipped
CI / e2e_tests (push) Failing after 14m13s
CI / coverage (push) Successful in 10m24s
CI / integration_tests (push) Failing after 21m19s
CI / status-check (push) Failing after 2s
CI / benchmark-publish (push) Has been cancelled
Add DomainBaseModel section to docs/api/core.md documenting the shared Pydantic base class from PR #2014 (issue #1941), and add CHANGELOG entry for the CI template DB extension from PR #2399 (issue #2334).

ISSUES CLOSED: #1941

Co-authored-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com>
Co-committed-by: Jeffrey Phillips Freeman <jeffrey.freeman@cleverthis.com>
2026-04-03 20:41:23 +00:00
freemo d66887766f docs(tui): document PermissionQuestionWidget and add CHANGELOG entry
CI / lint (pull_request) Successful in 20s
CI / quality (pull_request) Successful in 54s
CI / typecheck (pull_request) Successful in 58s
CI / security (pull_request) Successful in 59s
CI / build (pull_request) Successful in 24s
CI / helm (pull_request) Successful in 30s
CI / benchmark-publish (pull_request) Has been skipped
CI / unit_tests (pull_request) Failing after 6m59s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Successful in 11m7s
CI / e2e_tests (pull_request) Failing after 16m35s
CI / integration_tests (pull_request) Failing after 21m56s
CI / status-check (pull_request) Failing after 1s
CI / benchmark-regression (pull_request) Successful in 54m46s
Add PermissionQuestionWidget API documentation to docs/api/tui.md including
method table, key bindings, PermissionDecisionEvent dataclass, and
render_permission_question() helper reference. Add corresponding CHANGELOG
entry under [Unreleased] Added section.

Refs: #997
2026-04-03 06:39:51 +00:00
freemo 108d87e1bb docs: update CHANGELOG and A2A API docs for recent merged PRs
CI / lint (push) Failing after 35s
CI / build (push) Successful in 37s
CI / security (push) Failing after 48s
CI / typecheck (push) Failing after 50s
CI / quality (push) Successful in 55s
CI / coverage (push) Has been skipped
CI / helm (push) Successful in 27s
CI / unit_tests (push) Failing after 2m20s
CI / docker (push) Has been skipped
CI / e2e_tests (push) Failing after 15m33s
CI / integration_tests (push) Failing after 21m26s
CI / status-check (push) Failing after 1s
CI / benchmark-regression (push) Has been skipped
CI / benchmark-publish (push) Has been cancelled
Add CHANGELOG [Unreleased] entries for 6 recently merged commits:
- feat(tui): shell danger detection patterns (#1003)
- fix(a2a): JSON-RPC 2.0 wire format compliance — BREAKING field rename (#1501)
- fix(cli): disallow mixing legacy and v3 plan workflows (#1577)
- fix(cli): actor add rich output missing panels
- fix(infra): E2E suite centralized database initialization (#1023)
- ci(pipeline): parallelized static analysis jobs

Update docs/api/a2a.md to reflect JSON-RPC 2.0 field name changes:
A2aRequest.operation → method, A2aResponse.data → result, etc.
2026-04-03 02:43:00 +00:00
freemo 71177c6e1a docs: update changelog, API docs, and architecture for 2026-04-02 merged PRs
CI / lint (push) Failing after 18s
CI / build (push) Successful in 18s
CI / helm (push) Successful in 29s
CI / quality (push) Successful in 37s
CI / security (push) Failing after 52s
CI / typecheck (push) Failing after 58s
CI / coverage (push) Has been skipped
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Failing after 1m58s
CI / docker (push) Has been skipped
CI / benchmark-publish (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / integration_tests (push) Has been cancelled
CI / status-check (push) Has been cancelled
- CHANGELOG: add [Unreleased] entries for TUI first-run experience (#1391),
  session Markdown export (#1004), and UKO provenance/temporal versioning (#891)
- README: add first-run experience and Markdown transcript export bullets
- docs/api/tui.md: new TUI API reference covering first-run, persona system,
  input routing, slash commands, session export/import, and widgets
- docs/api/index.md: add TUI entry to module index
- docs/api/resource.md: document DatabaseResourceHandler and DevcontainerHandler
  full protocol implementations with method tables and examples
- docs/architecture.md: expand UKO section with provenance/temporal versioning
  details; update TUI design decision summary
- mkdocs.yml: add TUI page to API Reference nav

ISSUES CLOSED: #1391 #1004 #891
2026-04-02 19:30:53 +00:00
freemo e9c96c3d0c docs: add API reference and architecture overview
CI / build (push) Successful in 17s
CI / lint (push) Failing after 19s
CI / helm (push) Successful in 34s
CI / security (push) Failing after 42s
CI / quality (push) Has been cancelled
CI / unit_tests (push) Has been cancelled
CI / e2e_tests (push) Has been cancelled
CI / integration_tests (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / benchmark-publish (push) Has been cancelled
CI / coverage (push) Has been cancelled
CI / benchmark-regression (push) Has been cancelled
CI / docker (push) Has been cancelled
CI / status-check (push) Has been cancelled
Add docs/api/ with per-module API documentation for core, a2a, actor,
skills, tool, mcp, resource, and config packages. Add docs/architecture.md
with a developer-oriented system overview including component map, layer
diagram, plan lifecycle, and key design decisions. Update mkdocs.yml nav
to expose both new sections.

ISSUES CLOSED: #N/A
2026-04-02 19:02:53 +00:00