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//!
21//! The repository README is included below so its worked Rust example is compiled and
22//! executed as a doctest whenever this crate's documentation tests run.
23#![doc = include_str!(concat!(
24 env!("CARGO_MANIFEST_DIR"),
25 "/",
26 env!("CARGO_PKG_README")
27))]
28#![deny(missing_docs)]
29
30pub mod config;
31
32mod engine;
33
34mod environment;
35mod global_id;
36mod plan;
37mod registry;
38mod resolve;
39mod schema;
40mod secrets;
41pub mod subprocess;
42
43pub use config::{Config, ConfigError, Loaded, OutputFormat, SourceConfig};
44pub use engine::{
45 ConfiguredSource, CopyAction, CopyItems, CopyOutcome, CopyReport, CopyRequest, CopyScope,
46 DependencyRequest, DocumentFilters, DocumentRequest, Engine, EngineError, Filters,
47 LabelRequest, LeftBehind, MatchBy, Paging, ProjectRequest, ProjectSelector, Qualified,
48 QualifiedEdge, QualifiedEndpoint, SearchHit, SearchKind, SearchRequest, SourceListing,
49 SourceState, TaskRequest,
50};
51pub use environment::Environment;
52pub use global_id::GlobalId;
53pub use plan::{PageToken, Predicate, QueryPlan, QueryResponse, SourceFailure, SourcePlan};
54pub use registry::{PluginKind, plugin_for, plugin_kinds, registry};
55pub use resolve::{
56 ResolvedSource, UnavailableSource, resolve, resolve_available, validate_sources,
57};
58pub use schema::{SCHEMA_BUNDLE_VERSION, schema_bundle};
59pub use secrets::{CredentialLayer, CredentialName, ResolvedCredential, Secrets, SecretsReport};
60pub use subprocess::{
61 MAX_LINE, Program, RequestDeadline, SubprocessConfig, SubprocessPlugin, SubprocessSource,
62 serve, serve_plugin,
63};