Skip to content

feat(agent-core): implement core invocation and Rust CLI bridge with tests#5

Closed
yacosta738 wants to merge 1 commit into
mainfrom
feat/kmp
Closed

feat(agent-core): implement core invocation and Rust CLI bridge with tests#5
yacosta738 wants to merge 1 commit into
mainfrom
feat/kmp

Conversation

@yacosta738
Copy link
Copy Markdown
Contributor

This pull request introduces a foundational contract and JVM bridge implementation for the agent core module, along with comprehensive tests and documentation updates. The most important changes are grouped below by theme.

Core Contracts and Identity

  • Introduced shared core contracts in CoreContracts.kt, including CoreInvocation, CoreResult, CoreOutput, and the AgentCoreBridge interface for invoking the agent core.
  • Added module identity and contract version metadata in AgentKernel.kt, exposing name and contractVersion.

JVM Rust Bridge Implementation

  • Implemented the RustCliBridge class in RustCliBridge.kt, providing a JVM bridge that shells out to the Rust CLI core and maps process outcomes to typed results, including robust handling for errors and timeouts.

Testing

  • Added unit tests for core contracts in CoreContractsTest.kt and for the JVM Rust bridge in RustCliBridgeTest.kt, covering success, failure, timeout, and missing executable scenarios. [1] [2]
  • Enhanced AgentKernelTest.kt to verify module identity and contract version.

Documentation

  • Updated README.md for agent-core-kmp to clarify module scope, contracts, and usage of the JVM Rust bridge.

CI Workflow

  • Added a new GitHub Actions workflow in .github/workflows/core-check.yml to automate core checks for relevant modules and ensure code quality.

@github-actions
Copy link
Copy Markdown
Contributor

Thank you for contributing to this project with this PR, welcome to the community and the amazing world of open source!

@github-actions github-actions Bot added the close|invalid An issue that we don't feel is valid label Feb 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

It seems you edited the limitation files. These files aren't open for contributions. If you think they should be, feel free to reply here.

@github-actions github-actions Bot closed this Feb 16, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 16, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Agent communication contracts now available (invocations, results, and bridge interface)
    • External executable integration support with timeout and error handling capabilities
    • Module contract version information exposed
  • Documentation

    • Updated module documentation with integration examples and contract specifications
  • Tests

    • Added test coverage for agent communication contracts and external executable integrations

Walkthrough

Introduces a new core agent communication framework with standardized contracts (CoreInvocation, CoreResult, AgentCoreBridge), implements a Rust CLI bridge for external process invocation with timeout handling, adds comprehensive test coverage, updates module documentation, and configures GitHub Actions workflow for automated core checks including Rust and Gradle tasks.

Changes

Cohort / File(s) Summary
CI/CD Configuration
.github/workflows/core-check.yml
New GitHub Actions workflow triggering on pushes and PRs to specified branches. Sets up Java (Corretto 25), Gradle, and Rust toolchain, then runs core checks for agent-core-kmp and agent-core-rust modules with Rust tasks enabled.
Core Contract Definitions
modules/agent-core-kmp/src/commonMain/kotlin/com/profiletailors/agent/core/CoreContracts.kt, modules/agent-core-kmp/src/commonTest/kotlin/com/profiletailors/agent/core/CoreContractsTest.kt
Introduces CoreInvocation (request data class with prompt, sessionId, metadata, timeoutMs), CoreOutput (response with text, transport, rawOutput), CoreResult sealed interface (Success/Failure outcomes), and AgentCoreBridge functional interface for agent execution. Includes tests validating defaults and result types.
Agent Kernel Updates
modules/agent-core-kmp/src/commonMain/kotlin/com/profiletailors/agent/core/AgentKernel.kt, modules/agent-core-kmp/src/commonTest/kotlin/com/profiletailors/agent/core/AgentKernelTest.kt
Adds contractVersion constant ("0.1") to AgentKernel object. Test renamed to reflect module identity assertion and expanded with new contractVersion validation.
Rust CLI Bridge Implementation
modules/agent-core-kmp/src/jvmMain/kotlin/com/profiletailors/agent/core/RustCliBridge.kt, modules/agent-core-kmp/src/jvmTest/kotlin/com/profiletailors/agent/core/RustCliBridgeTest.kt
Implements AgentCoreBridge for invoking external Rust CLI processes. RustCliBridgeConfig provides defaults (executable: "corvus", arguments: ["agent","-m"], timeout: 30s). RustCliBridge handles process creation, timeout enforcement, and error/success response mapping. Tests cover success, failure, timeout, and missing executable scenarios.
Documentation
modules/agent-core-kmp/README.md, apps/docs/website/src/pages/404.astro
Module README expanded with contract-baseline details, JVM Rust Bridge concept, default command usage, and Kotlin example. 404 page refactored with template literals and locale-specific label handling.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant RustCliBridge
    participant ProcessBuilder
    participant RustCLI as External Rust CLI

    Caller->>RustCliBridge: invoke(CoreInvocation)
    RustCliBridge->>RustCliBridge: validate timeout
    RustCliBridge->>RustCliBridge: build command list
    RustCliBridge->>ProcessBuilder: create with command
    ProcessBuilder->>RustCLI: start process
    RustCLI-->>ProcessBuilder: process started
    RustCliBridge->>RustCLI: wait for completion (with timeout)
    alt Timeout occurs
        RustCliBridge->>RustCLI: forcibly destroy
        RustCliBridge-->>Caller: CoreResult.Failure (recoverable)
    else Process completes
        RustCLI-->>RustCliBridge: exit code + output
        alt Exit code == 0
            RustCliBridge->>RustCliBridge: wrap in CoreOutput
            RustCliBridge-->>Caller: CoreResult.Success
        else Exit code != 0
            RustCliBridge-->>Caller: CoreResult.Failure (recoverable, with details)
        end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 Hops with glee through contracts new,
A bridge to Rust, so swift and true!
CoreInvocation meets the CLI,
Timeouts caught, results fly high!
With tests in place and workflows spun,
The agent core has just begun! 🚀

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/kmp

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 Feb 16, 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 9 >= 1
Negative Reactions Negative reactions received 0 <= 5
Account Age GitHub account age 3033 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 362 >= 0
Merger Diversity Unique maintainers who merged PRs 3 >= 0
Repo History Merge Rate Merge rate in this repo 50% >= 0%
Repo History Min PRs Previous PRs in this repo 2 >= 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-02-16 to 2026-02-16

@yacosta738 yacosta738 reopened this Feb 16, 2026
@github-actions
Copy link
Copy Markdown
Contributor

It seems you edited the limitation files. These files aren't open for contributions. If you think they should be, feel free to reply here.

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

Labels

close|invalid An issue that we don't feel is valid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant