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//!
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 failure;
36mod global_id;
37mod plan;
38mod registry;
39mod resolve;
40mod schema;
41mod secrets;
42pub mod subprocess;
43// llmlint: ignore[code_lands_in_the_domain_that_owns_it] The task that introduced templates fixes their API at this crate's root; the head of `template/mod.rs` states why.
44pub mod template;
45
46pub use config::{Config, ConfigError, Loaded, OutputFormat, SourceConfig};
47pub use engine::{
48    BudgetSpent, CommentList, ConfiguredSource, CopyAction, CopyItems, CopyOutcome, CopyReport,
49    CopyRequest, CopyScope, DeletedComment, Delivered, DeliveryOutcome, DependencyRequest,
50    DocumentFilters, DocumentRequest, Engine, EngineError, Filters, LabelRequest, LeftBehind,
51    MatchBy, MetadataSet, Paging, ProjectRequest, ProjectSelector, Qualified, QualifiedEdge,
52    QualifiedEndpoint, SearchHit, SearchKind, SearchRequest, SourceListing, SourceState, Spent,
53    TaskContentSet, TaskDetail, TaskPrioritySet, TaskRequest, TaskStatusSet, settled,
54};
55pub use environment::Environment;
56pub use failure::{Failure, FailureClass, FailureDocument, classify};
57pub use global_id::GlobalId;
58pub use plan::{PageToken, Predicate, QueryPlan, QueryResponse, SourceFailure, SourcePlan};
59pub use registry::{PluginKind, plugin_for, plugin_kinds, registry};
60pub use resolve::{
61    ResolvedSource, UnavailableSource, resolve, resolve_available, validate_sources,
62};
63pub use schema::{SCHEMA_BUNDLE_VERSION, schema_bundle};
64pub use secrets::{CredentialLayer, CredentialName, ResolvedCredential, Secrets, SecretsReport};
65pub use subprocess::{
66    MAX_LINE, Program, RequestDeadline, SubprocessConfig, SubprocessPlugin, SubprocessSource,
67    serve, serve_plugin,
68};
69pub use template::{
70    Answers, ChainField, DECLARATION_KEYS, FRONT_MATTER_KEYS, ItemType, RenderedTemplate, Template,
71    TemplateError, TemplateLoader, TemplateVariable, TemplateVariables, VariableType,
72};