-
Notifications
You must be signed in to change notification settings - Fork 0
Update Core #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Update Core #4
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
3401966
Update release workflow to always mark as prerelease
Jordonbc 64207e8
Improve
Jordonbc f5efecd
Fixed compile issue
Jordonbc ed80217
Update ci.yml
Jordonbc 7872f44
Fix compile issues
Jordonbc 373d585
Fix compile issues
Jordonbc 6c603bf
Update ci.yml
Jordonbc 4ae51c3
Update Cargo.toml
Jordonbc 3f036c4
Fixed issue
Jordonbc 82965c0
Update ci.yml
Jordonbc 0bdd548
Update backend_descriptor.rs
Jordonbc e803769
Added helpers
Jordonbc 011dfc4
Update plugin_stdio.rs
Jordonbc 3601da1
Update plugin_stdio.rs
Jordonbc bd61a77
Added logger
Jordonbc 7d58052
Update plugin_stdio.rs
Jordonbc 9c952d1
Improve core
Jordonbc 0c74263
Improvements
Jordonbc dca4e78
Improved core
Jordonbc d2f51f7
Update lib.rs
Jordonbc 0d31500
Create AGENTS.md
Jordonbc 4628205
Update Cargo.toml
Jordonbc cf1a654
Update Cargo.toml
Jordonbc 455b248
Added fmt requirement
Jordonbc 5573461
Improved core
Jordonbc ab8249f
Update README.md
Jordonbc dc8a7f1
Update README.md
Jordonbc 5e6cab0
Update
Jordonbc fa560c2
Version bump
Jordonbc e547092
Improved workflows
Jordonbc 9fac442
Update plugin_runtime.rs
Jordonbc 9d1977a
Update Justfile
Jordonbc 5a8a6fb
Version bump
Jordonbc 03c1c8f
Update release.yml
Jordonbc 08ffa2e
Update release.yml
Jordonbc 371276d
Version Bump
Jordonbc b833211
Remove duplicated cfg attribute from backend_descriptor.rs
Jordonbc e034c0d
Update AGENTS.md
Jordonbc 7d281f0
agents: require 72-char commit title in AGENTS.md
Jordonbc dbaa322
docs: note sandbox requirements for and cargo commands in AGENTS.md
Jordonbc fd5e913
Update Cargo.lock
Jordonbc e9e0d64
Update version
Jordonbc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Repository Guidelines | ||
|
|
||
| ## Project Structure & Module Organization | ||
|
|
||
| - `src/`: Single Rust crate (`openvcs-core`) providing shared types/traits for the OpenVCS client and plugins. | ||
| - Feature-gated modules: `plugin_protocol`, `plugin_stdio`, `plugin_runtime`, `events`, `host`. | ||
| - VCS surface area lives behind the `vcs` feature (see `src/lib.rs`). | ||
| - `.github/workflows/`: CI, CodeQL, nightly packaging/release automation. | ||
| - `target/`: Cargo build artifacts (do not commit). | ||
|
|
||
| ## Build, Test, and Development Commands | ||
|
|
||
| - `cargo check --all-targets --all-features`: Fast compile check matching CI’s broadest configuration. | ||
| - `cargo test`: Run default-feature unit tests. | ||
| - `cargo test --no-default-features --features plugin-protocol,vcs,backend-registry`: Validate feature combinations used in CI. | ||
| - `cargo package`: Ensure the crate packages cleanly (used by nightly automation). | ||
|
|
||
| ## Coding Style & Naming Conventions | ||
|
|
||
| - Format with Rustfmt: `cargo fmt`. | ||
| - Prefer Clippy-clean code: `cargo clippy --all-targets --all-features -D warnings`. | ||
| - Naming: `snake_case` (functions/modules), `CamelCase` (types), `SCREAMING_SNAKE_CASE` (constants). | ||
| - Preserve feature gates (`#[cfg(feature = "...")]`) when adding new APIs; keep the default feature set lightweight. | ||
|
|
||
| ## Testing Guidelines | ||
|
|
||
| - Uses Rust’s built-in test harness (`#[test]`) with unit tests colocated in modules (e.g., `src/models.rs`). | ||
| - Add tests next to the code they cover; keep tests deterministic and free of network/file-system assumptions unless required. | ||
|
|
||
| ## Commit & Pull Request Guidelines | ||
|
|
||
| - Before committing, run `cargo fmt` (CI enforces `cargo fmt --all -- --check`). | ||
| - Commit messages in this repo are short and imperative (e.g., “Update lib.rs”, “Fix compile issues”). Follow that pattern and mention the touched area. | ||
| - Commit message format: agents must format commit messages with a short | ||
| title of at most 72 characters, followed by a blank line and any | ||
| additional explanatory text in the body. | ||
| - Open PRs against the `Dev` branch; include a clear description, rationale, and any relevant issue links. | ||
| - Ensure CI passes locally where possible (at minimum `cargo test`, ideally the full-feature test command above). | ||
|
|
||
| - After making changes, run `just fix` to automatically apply formatting and simple fixes before committing. | ||
| - Commit changes locally with a clear, conventional message, but do NOT push to remotes or create PRs—leave pushing and PR creation to a human maintainer. | ||
|
|
||
| **Sandbox note**: Running `just fix` and some `cargo` commands (for example `cargo build` or commands that fetch dependencies or build native binaries) may require network access or host-level tooling and therefore should be run outside a restricted sandbox or container. If operating with sandboxing or restricted network access, request approval before executing these commands or run them on the host machine. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| set shell := ["bash", "-eu", "-o", "pipefail", "-c"] | ||
|
|
||
| default: | ||
| @just --list | ||
|
|
||
| fix: | ||
| cargo fmt --all | ||
| cargo clippy --fix --all-targets --all-features --allow-dirty --allow-staged | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,57 @@ | ||
| # OpenVCS-Core | ||
| # OpenVCS Core (`openvcs-core`) | ||
|
|
||
| Shared Rust crate for OpenVCS plugins and the OpenVCS client. | ||
| [](https://github.com/Open-VCS/OpenVCS-Core/actions/workflows/ci.yml) | ||
|
|
||
| Shared Rust crate for: | ||
| - OpenVCS plugins (JSON-RPC over stdio) | ||
| - The OpenVCS client/host (shared models + backend trait surface) | ||
|
|
||
| ## Cargo features | ||
| - `plugin-protocol` (default): JSON RPC message types for plugin stdio communication. | ||
| - `vcs`: the `Vcs` trait + `VcsError`. | ||
| - `backend-registry`: backend registry helpers (requires `vcs`). | ||
|
|
||
| - `plugin-protocol` (default): JSON-RPC wire types + plugin helper modules: | ||
| - `openvcs_core::plugin_protocol` (`PluginMessage`, `RpcRequest`, `RpcResponse`) | ||
| - `openvcs_core::plugin_stdio` (read/write helpers, `respond_shared`, host calls) | ||
| - `openvcs_core::plugin_runtime` (simple request dispatch loop + handler registry) | ||
| - `openvcs_core::events` (host event subscribe/emit helpers) | ||
| - `openvcs_core::host` (bridge for calling the host over stdio) | ||
| - `vcs`: the backend trait surface: | ||
| - `openvcs_core::Vcs`, `openvcs_core::VcsError`, `openvcs_core::Result` | ||
| - `openvcs_core::models` (shared request/response/event types) | ||
| - enables `backend-registry` | ||
| - `backend-registry`: link-time backend discovery via `openvcs_core::backend_descriptor::BACKENDS` | ||
| - intended to be enabled together with `vcs` | ||
| - on `wasm32`, the registry is always empty (no `linkme` support) | ||
|
|
||
| ## Plugin quickstart (stdio JSON-RPC) | ||
|
|
||
| Register one or more RPC handlers and run the dispatch loop: | ||
|
|
||
| ```rust | ||
| use openvcs_core::plugin_runtime::{register_delegate, run_registered}; | ||
| use openvcs_core::plugin_stdio::ok; | ||
|
|
||
| fn main() -> std::io::Result<()> { | ||
| register_delegate("ping", |_ctx, _req| ok(serde_json::json!({ "pong": true }))); | ||
| run_registered() | ||
| } | ||
| ``` | ||
|
|
||
| Notes: | ||
| - `openvcs_core::{trace, debug, info, warn, error}` forward logs to the OpenVCS host when available (and also emit normal `log` records). | ||
| - Host calls from plugins go through `openvcs_core::host::call(...)` (the runtime initializes the host bridge for stdio). | ||
| - `OPENVCS_PLUGIN_HOST_TIMEOUT_MS` controls host call timeouts (default: 60000ms). | ||
|
|
||
| ## Development | ||
|
|
||
| Common checks (matches CI): | ||
| - `just fix` (runs rustfmt + clippy) | ||
| - `cargo fmt --all -- --check` | ||
| - `cargo clippy --all-targets --all-features -- -D warnings` | ||
| - `cargo check --all-targets --all-features` | ||
| - `cargo test` | ||
| - `cargo test --no-default-features --features plugin-protocol,vcs,backend-registry` | ||
| - `cargo package` | ||
|
|
||
| ## License | ||
|
|
||
| GPL-3.0-or-later (see `LICENSE`). |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
backend_descriptor.rsimportscrate::{Result, Vcs}, which are only defined underfeature = "vcs"(seesrc/lib.rs). After this change,backend-registryno longer enablesvcs, socargo build --no-default-features --features backend-registrywill now fail with unresolved imports. This is a regression from the previous feature graph. Consider restoringvcsas a dependency ofbackend-registryor gatingbackend_descriptorbehind both features.Useful? React with 👍 / 👎.