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//! | `orphan_tasks` | **Supported and proven** — the hosted source's own, forwarded. |
30//! | `filter_by_label` | **Supported and proven** — the hosted source's own, forwarded. |
31//! | `filter_by_status` | **Supported and proven** — the hosted source's own, forwarded. |
32//! | `search_title` | **Supported and proven** — the hosted source's own, forwarded. |
33//! | `search_content` | **Supported and proven** — the hosted source's own, forwarded. |
34//! | `task_dependencies` | **Supported and proven** — the hosted source's own, forwarded. |
35//! | `project_dependencies` | **Supported and proven** — the hosted source's own, forwarded. |
36//! | `max_page_size` | **Supported and proven** — the hosted source's own, forwarded. |
37//!
38//! That is proven rather than asserted: the journey table's `subprocess` row hosts the
39//! in-memory source over a real pipe and answers every shared journey — every capability
40//! field included — with the same rows and the same plan the in-process row does.
41//!
42//! [`TaskSource`]: onetaskgraph_plugin_api::TaskSource
43
44mod connection;
45mod plugin;
46mod serve;
47mod source;
48mod wire;
49
50pub use connection::MAX_LINE;
51pub(crate) use plugin::SETTINGS_FIELD;
52pub use plugin::{Plugin as SubprocessPlugin, Program, SubprocessConfig};
53pub use serve::{serve, serve_plugin};
54pub use source::{RequestDeadline, SubprocessSource};
55pub(crate) use wire::DocumentDir;