Skip to content

feat(capability): Phase 3 - corvus-composer with AgentManifest schema#511

Merged
yacosta738 merged 1 commit into
feature/capability-architecturefrom
feature/capability-architecture-480-composer
Apr 11, 2026
Merged

feat(capability): Phase 3 - corvus-composer with AgentManifest schema#511
yacosta738 merged 1 commit into
feature/capability-architecturefrom
feature/capability-architecture-480-composer

Conversation

@yacosta738
Copy link
Copy Markdown
Contributor

Summary

Implements Phase 3A (Agent Manifest) and Phase 3B (AgentComposer) of the capability-based architecture.

What Changed

  • Created crates/corvus-composer/ with:

    • AgentManifest TOML schema (serializable Rust structs with serde)
    • Validation rules per PRD (R1-R7):
      • R1: At least one provider required
      • R2: At least one channel required
      • R3: Default provider must be enabled
      • R4: Enabled capabilities must be known
      • R5: Memory backend must be valid
      • R6: Security sandbox must be valid
      • R7: Tool restrictions must be subset of enabled tools
    • ValidationError enum for structured errors
    • CapabilityReport for introspection via required_capabilities()
    • Known capability registries (providers, channels, tools, backends)
  • Implements AgentComposer that:

    • Parses manifests from TOML string or file path
    • Validates against PRD requirements
    • Provides required_capabilities() returning CapabilityReport
    • Provides validate_with_warnings() for non-blocking issues
    • Provides into_agent_builder() placeholder (delegates to bootstrap)
  • Added crate to workspace (Cargo.toml) and wired into main corvus crate (lib.rs)

Not Changed

  • Existing AgentBuilder (kept as low-level assembly interface)
  • CLI commands (deferred to Phase 4)
  • .claude/ directory

Tests

All 8 corvus-composer tests pass:

  • parse_minimal_manifest
  • validate_requires_providers
  • validate_requires_channels
  • validate_requires_default_in_providers
  • validate_unknown_provider
  • validate_tool_restrictions_subset
  • required_capabilities
  • warnings_for_empty_tools

Validation

  • cargo fmt --check
  • cargo clippy
  • cargo test -p corvus-composer ✅ (8 tests)
  • cargo test ✅ (3478 tests)

…schema

Implements Phase 3A (Agent Manifest) and Phase 3B (AgentComposer):

- Creates  with:
  - AgentManifest TOML schema (serializable Rust structs)
  - Validation rules per PRD (R1-R7):
    - R1: At least one provider
    - R2: At least one channel
    - R3: Default provider must be enabled
    - R4: Enabled capabilities must be known
    - R5: Memory backend must be valid
    - R6: Security sandbox must be valid
    - R7: Tool restrictions must be subset
  - ValidationError enum for structured errors
  - CapabilityReport for introspection
  - Known capability registries (providers, channels, tools, backends)

- Implements AgentComposer that:
  - Parses manifests from TOML string or file
  - Validates against PRD requirements
  - Provides required_capabilities() introspection
  - Provides validate_with_warnings() for non-blocking issues

- Adds crate to workspace and wires into main corvus crate

Note: Registry resolution delegating to bootstrap (not implemented in composer)
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying corvus with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7f76df5
Status: ✅  Deploy successful!
Preview URL: https://2eb03721.corvus-42x.pages.dev
Branch Preview URL: https://feature-capability-architect-ta0v.corvus-42x.pages.dev

View logs

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 11, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (2)
  • wip
  • do-not-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a84d1835-2bee-4da5-9727-9a7db4e697d1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR establishes a modular trait abstraction layer by creating seven new workspace crates (corvus-traits, corvus-providers, corvus-channels, corvus-tools, corvus-memory, corvus-security, corvus-composer) that extract core runtime traits and types from the monolithic agent-runtime crate. The main runtime crate and existing modules are refactored to re-export from the extracted crates. A new TOML-driven agent manifest composition system (corvus-composer) is introduced for declarative agent configuration and validation.

Changes

Cohort / File(s) Summary
Core Trait Infrastructure (corvus-traits)
crates/corvus-traits/Cargo.toml, crates/corvus-traits/src/lib.rs, crates/corvus-traits/src/channels.rs, crates/corvus-traits/src/memory.rs, crates/corvus-traits/src/multimedia.rs, crates/corvus-traits/src/providers.rs, crates/corvus-traits/src/security.rs, crates/corvus-traits/src/tools.rs, crates/corvus-traits/src/testing.rs
New core trait definitions for channels (multimodal messaging), memory (session/entry storage), multimedia (image/audio metadata), providers (LLM chat abstraction), security (sandbox isolation), and tools (function calling). Introduces comprehensive APIs with serializable data structures and async trait methods.
Registry/Wrapper Crates
crates/corvus-providers/Cargo.toml, crates/corvus-providers/src/lib.rs, crates/corvus-channels/Cargo.toml, crates/corvus-channels/src/lib.rs, crates/corvus-memory/Cargo.toml, crates/corvus-memory/src/lib.rs, crates/corvus-security/Cargo.toml, crates/corvus-security/src/lib.rs, crates/corvus-tools/Cargo.toml, crates/corvus-tools/src/lib.rs
New public registry crates that re-export corvus-traits types and provide metadata structs (ProviderInfo, ChannelInfo, MemoryInfo, SecurityInfo, ToolInfo) for capability discovery.
Agent Composition Framework
crates/corvus-composer/Cargo.toml, crates/corvus-composer/src/lib.rs
New TOML manifest schema (AgentManifest) with sections for providers, channels, tools, memory, observer, and security. Includes AgentComposer for TOML/file parsing, validation (required capabilities, defaults, known provider/channel/tool/backend validation), warnings (empty tools, missing memory), and trait-object builder placeholder. Extensive test coverage for parsing, validation failures, and capability reporting.
Workspace and Root Updates
Cargo.toml, src/lib.rs
Updated workspace members list to include all new corvus-* crates. Added new public composer module to main runtime re-exporting corvus-composer. Updated root Cargo.toml dependencies on new internal crates.
Media Type Refactoring
src/channels/media.rs, src/channels/audio_media.rs
Removed local definitions of AllowedImageMime, ImageTransportForm, StagedImage, and ImageHistoryMeta (and audio equivalents); replaced with corvus-traits::multimedia re-exports. Added centralized cleanup_staged_image() helper function to replace per-type cleanup methods. Updated callsites in mod.rs, discord.rs, slack.rs to use shared cleanup.
Trait Re-export Refactoring
src/channels/traits.rs, src/memory/traits.rs, src/providers/traits.rs, src/tools/traits.rs, src/security/traits.rs
Converted all trait definition files from containing full implementations to thin re-export shims importing from corvus-traits. Removed ~2,700 lines of local implementations (trait methods, helpers, test modules) now owned by extracted crates.
Test and Adapter Updates
src/providers/reliable.rs, src/providers/router.rs, tests/traits_api_compat.rs
Added compatibility wrapper types (ModelAwareMockHandle, MockProviderHandle) in provider tests to maintain boxed trait objects. New 380-line integration test validating type identity and trait object interchangeability between legacy and extracted trait paths via dummy implementations.

Sequence Diagram

sequenceDiagram
    participant User
    participant AgentComposer as Agent Composer
    participant Validator as Validator
    participant Report as Capability Report
    participant Builder as Agent Builder

    User->>AgentComposer: from_toml(manifest_str)
    AgentComposer->>Validator: validate()
    Validator->>Validator: Check required providers/channels
    Validator->>Validator: Verify defaults exist & enabled
    Validator->>Validator: Validate against KNOWN_* lists
    Validator->>Validator: Check sandbox/memory backends
    Validator->>Validator: Verify tool_restrictions ⊆ enabled tools
    Validator-->>AgentComposer: Result<(), ValidationError>
    AgentComposer->>Report: populate_from_manifest()
    AgentComposer-->>User: AgentComposer { manifest, reports }
    User->>AgentComposer: into_agent_builder()
    AgentComposer->>Builder: new() with capabilities
    Builder-->>User: Result<B>
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • corvus#510: Direct predecessor/parallel refactor extracting identical trait infrastructure into corvus-traits workspace crates with matching module structure and re-export patterns.
  • corvus#68: Adds MemoryValidationResult and Memory::validate_response method that are now part of the extracted corvus-traits::memory module.
  • corvus#182: Extends ToolResult with a new structured field for JSON payloads, which is now defined in the extracted corvus-traits::tools module.

Suggested labels

area:rust, area:docs, risk:high

Suggested reviewers

  • yuniel-acosta
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commit style with 'feat(capability):' prefix, clearly describes the Phase 3 implementation with AgentManifest schema, and is 69 characters (within the 72-character limit).
Description check ✅ Passed The PR description comprehensively covers Summary, What Changed (with detailed subsections), Not Changed, Tests (with specific test names), and Validation (with tool outputs). It closely follows the template structure and provides actionable detail for review.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/capability-architecture-480-composer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 11, 2026

✅ Contributor Report

User: @yacosta738
Status: Passed (12/13 metrics passed)

Metric Description Value Threshold Status
PR Merge Rate PRs merged vs closed 89% >= 30%
Repo Quality Repos with ≥100 stars 0 >= 0
Positive Reactions Positive reactions received 10 >= 1
Negative Reactions Negative reactions received 0 <= 5
Account Age GitHub account age 3087 days >= 30 days
Activity Consistency Regular activity over time 108% >= 0%
Issue Engagement Issues with community engagement 0 >= 0
Code Reviews Code reviews given to others 545 >= 0
Merger Diversity Unique maintainers who merged PRs 2 >= 0
Repo History Merge Rate Merge rate in this repo 92% >= 0%
Repo History Min PRs Previous PRs in this repo 230 >= 0
Profile Completeness Profile richness (bio, followers) 90 >= 0
Suspicious Patterns Spam-like activity detection 1 N/A

Contributor Report evaluates based on public GitHub activity. Analysis period: 2025-04-11 to 2026-04-11

@yacosta738 yacosta738 changed the base branch from main to feature/capability-architecture April 11, 2026 14:40
@yacosta738 yacosta738 merged commit 61312a6 into feature/capability-architecture Apr 11, 2026
15 checks passed
@yacosta738 yacosta738 deleted the feature/capability-architecture-480-composer branch April 11, 2026 14:43
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant