Skip to main content

onetaskgraph_core/subprocess/
mod.rs

1//! Sources that are other processes, on both sides of the pipe.
2//!
3//! `docs/plugin-protocol.md` is the normative text; this module is its Rust
4//! implementation. [`SubprocessSource`] is the engine's half — a [`TaskSource`] that is a
5//! spawned program — and [`serve`] is the plugin's half, hosting any plugin of this build
6//! behind the same protocol so the two can be exercised against each other.
7//!
8//! Nothing here compensates for a capability. A subprocess-hosted source declares what it
9//! can do in the handshake exactly as a compiled-in one does, and the engine's one
10//! compensation layer reads that declaration and does the rest — which is what keeps a
11//! source's answers the same whichever side of a pipe it is on.
12//!
13//! # What this source declares, field by field
14//!
15//! One verdict per field of `Capabilities`. Every one of them is **supported and proven,
16//! and is the hosted source's own**: [`SubprocessSource`] reports the value the program
17//! behind the pipe sent in its handshake, unchanged, and holds no opinion of its own about
18//! any of them. Nothing here could be unsupported, because nothing here decides — a
19//! hosted source with no documents declares that itself, and this source forwards the
20//! declaration rather than holding one.
21//!
22//! | Field | Verdict |
23//! | --- | --- |
24//! | `projects` | **Supported and proven** — the hosted source's own, forwarded. |
25//! | `documents` | **Supported and proven** — the hosted source's own, forwarded. |
26//! | `comments` | **Supported and proven** — the hosted source's own, forwarded, and the four comment methods carried over the pipe as §4.15 and §4.16 specify. |
27//! | `priority` | **Supported and proven** — the hosted source's own, forwarded; absent from a handshake written before priorities, and then read as unsupported, so such a plugin is never handed a priority it would drop. `set_task_priority` is carried over the pipe as §4.19 specifies. |
28//! | `filter_by_priority` | **Supported and proven** — the hosted source's own, forwarded; absent from an older handshake, and then read as unsupported, so the engine narrows. |
29//! | `filter_by_comment_activity` | **Supported and proven** — the hosted source's own, forwarded, and a query's `commented_since` carried over the pipe as §4.5 specifies; absent from an older handshake, and then read as unsupported, so the engine narrows over the plugin's comments. |
30//! | `filter_by_metadata` | **Supported and proven** — the hosted source's own, forwarded, and a query's `metadata` matches carried over the pipe as §4.5 specifies; absent from an older handshake, and then read as unsupported, so the engine narrows over each task's metadata. |
31//! | `filter_by_origin` | **Supported and proven** — the hosted source's own, forwarded, and a query's `origin` carried over the pipe as §4.5 specifies, on the same terms. |
32//! | `orphan_tasks` | **Supported and proven** — the hosted source's own, forwarded. |
33//! | `filter_by_label` | **Supported and proven** — the hosted source's own, forwarded. |
34//! | `filter_by_status` | **Supported and proven** — the hosted source's own, forwarded. |
35//! | `search_title` | **Supported and proven** — the hosted source's own, forwarded. |
36//! | `search_content` | **Supported and proven** — the hosted source's own, forwarded. |
37//! | `task_dependencies` | **Supported and proven** — the hosted source's own, forwarded. |
38//! | `project_dependencies` | **Supported and proven** — the hosted source's own, forwarded. |
39//! | `max_page_size` | **Supported and proven** — the hosted source's own, forwarded. |
40//!
41//! That is proven rather than asserted: the journey table's `subprocess` row hosts the
42//! in-memory source over a real pipe and answers every shared journey — every capability
43//! field included — with the same rows and the same plan the in-process row does.
44//!
45//! [`TaskSource`]: onetaskgraph_plugin_api::TaskSource
46
47mod connection;
48mod plugin;
49mod serve;
50mod source;
51mod wire;
52
53pub use connection::MAX_LINE;
54pub(crate) use plugin::SETTINGS_FIELD;
55pub use plugin::{Plugin as SubprocessPlugin, Program, SubprocessConfig};
56pub use serve::{serve, serve_plugin};
57pub use source::{RequestDeadline, SubprocessSource};
58pub(crate) use wire::DocumentDir;