Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,10 @@ jobs:
# "reference backend" promise, now real.
- name: cargo test -p ogar-knowable-from --features vart-backend
run: cargo test -p ogar-knowable-from --features vart-backend
# Exercise the `ontology-cache` feature on ogar-action-handler — pulls
# in lance-graph-ontology by git to load OGIT into the Ontology cache
# and compare its names with the OGIT tables. Off by default so
# path-based consumers (rs-graph-llm) stay lean; same crate-scoped
# pattern as the other feature steps.
- name: cargo test -p ogar-action-handler --features ontology-cache
run: cargo test -p ogar-action-handler --features ontology-cache
8 changes: 7 additions & 1 deletion crates/ogar-action-handler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ license.workspace = true
repository.workspace = true
authors.workspace = true
rust-version.workspace = true
description = "OGAR-native HIRO ActionHandler runtime — CapabilityExecutor impls (the B1 executor seam) over the action-ws protocol core in ogar-from-schema. The reference NativeCommandExecutor runs a capability's command via a local process; SSH/REST targets follow the same trait. rs-graph-llm's graph-flow-action provides the production executors."
description = "OGAR-native HIRO ActionHandler runtime — CapabilityExecutor impls (the B1 executor seam) over the action-ws protocol core in ogar-from-schema. The reference NativeCommandExecutor runs a capability's command via a local process; SSH/REST targets follow the same trait. rs-graph-llm's graph-flow-action provides the production executors. Also holds the OGIT tables HIRO validates against and, behind `ontology-cache`, the Ontology cache loader."

[features]
default = []
# The Ontology cache: lance-graph-ontology's OntologyRegistry, loaded from an
# OGIT tree (`ogit::load_registry`). Off by default, because it brings
# lance-graph by git, which path-based consumers such as rs-graph-llm's
# graph-flow-action-ogar do not need.
ontology-cache = ["dep:lance-graph-ontology"]

[dependencies]
ogar-from-schema = { path = "../ogar-from-schema", features = ["serde"] }
Expand All @@ -19,6 +24,7 @@ ogar-vocab = { path = "../ogar-vocab" }
# (`ogar-from-schema`) stays parser-free — it defines the `Deserialize` DTOs +
# the pure lift; this crate does the `from_str`. (B2-lift.)
serde_json = "1.0"
lance-graph-ontology = { git = "https://github.com/AdaWorldAPI/lance-graph", branch = "main", optional = true }

[dev-dependencies]
# Execution probe only: drives the executor from a *lifted* ActionDef
Expand Down
40 changes: 40 additions & 0 deletions crates/ogar-action-handler/examples/ogit_tables.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//! `ogit_tables [<ogit-root>]`: loads the OGIT tables and prints their sizes
//! and how long the load took. The root defaults to `OGIT_FORK_PATH`, then to
//! `../OGIT`.

use std::path::PathBuf;
use std::process::ExitCode;
use std::time::Instant;

use ogar_action_handler::ogit::{OgitTables, Table};

fn main() -> ExitCode {
let root = std::env::args()
.nth(1)
.map(PathBuf::from)
.or_else(|| std::env::var_os("OGIT_FORK_PATH").map(PathBuf::from))
.unwrap_or_else(|| PathBuf::from("../OGIT"));
let start = Instant::now();
let tables = match OgitTables::load(&root) {
Ok(t) => t,
Err(e) => {
eprintln!("{}: {e}", root.display());
return ExitCode::FAILURE;
}
};
let elapsed = start.elapsed();
for table in [
Table::Type,
Table::Attribute,
Table::TypeAttr,
Table::Verb,
Table::Allowed,
] {
println!("{table:?}\t{} rows", tables.rows(table));
}
println!("domains\t{}", tables.domains().len());
println!("rejected files\t{}", tables.rejected().len());
println!("unresolved references\t{}", tables.unresolved().len());
println!("load\t{:.1} ms", elapsed.as_secs_f64() * 1000.0);
ExitCode::SUCCESS
}
6 changes: 6 additions & 0 deletions crates/ogar-action-handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@
//! let result = reaction.result.unwrap();
//! assert!(result.result.contains("\"output\":\"hi\""));
//! ```
//!
//! [`ogit`] holds the OGIT tables HIRO validates against, read once from an
//! OGIT tree, and, behind the `ontology-cache` feature, the Ontology cache
//! loader.

#![forbid(unsafe_code)]
#![warn(missing_docs)]

pub mod ogit;

use std::process::Command;

use std::collections::BTreeMap;
Expand Down
Loading
Loading