Skip to main content

onetaskgraph_core/
lib.rs

1//! The onetaskgraph engine.
2//!
3//! It drives the sources a configuration names and reports what it had to do to
4//! answer. Everything a *plugin author* needs lives in `onetaskgraph-plugin-api`
5//! instead, and **no plugin crate may depend on this one**: `deny.toml` permits
6//! this crate exactly one wrapper, the binary, failing the required `deny` job, and
7//! `scripts/check-plugin-isolation.sh` reads the real `cargo metadata` graph inside
8//! `just check`.
9//!
10//! # The invariant that shapes this crate
11//!
12//! No work data may be stored, cached, indexed or mirrored outside a plugin. The
13//! engine compensates for a missing capability *transiently*: it holds at most one
14//! source page plus the caller's page and writes nothing down. Three mechanisms
15//! enforce that rather than asking for it: `deny.toml` refuses every embedded store,
16//! index and cache crate, so reaching for one fails the required `deny` job; a sandboxed
17//! journey plants sentinels, drives every verb, and fails if one reaches any file written
18//! during the run; and a re-ask test fails if one query asked twice reaches the source
19//! once. The latter two land with the verbs they drive.
20#![deny(missing_docs)]
21
22pub mod config;
23
24mod engine;
25
26mod environment;
27mod global_id;
28mod plan;
29mod registry;
30mod resolve;
31mod schema;
32mod secrets;
33pub mod subprocess;
34
35pub use config::{Config, ConfigError, Loaded, OutputFormat, SourceConfig};
36pub use engine::{
37    ConfiguredSource, DependencyRequest, Engine, EngineError, Filters, LabelRequest, Paging,
38    ProjectRequest, ProjectSelector, Qualified, QualifiedEdge, SearchHit, SearchKind,
39    SearchRequest, SourceListing, SourceState, TaskRequest,
40};
41pub use environment::Environment;
42pub use global_id::GlobalId;
43pub use plan::{PageToken, Predicate, QueryPlan, QueryResponse, SourceFailure, SourcePlan};
44pub use registry::{PluginKind, plugin_for, plugin_kinds, registry};
45pub use resolve::{
46    ResolvedSource, UnavailableSource, resolve, resolve_available, validate_sources,
47};
48pub use schema::{SCHEMA_BUNDLE_VERSION, schema_bundle};
49pub use secrets::{CredentialLayer, CredentialName, ResolvedCredential, Secrets, SecretsReport};
50pub use subprocess::{
51    MAX_LINE, Program, RequestDeadline, SubprocessConfig, SubprocessPlugin, SubprocessSource,
52    serve, serve_plugin,
53};