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//! | `assets` | **Supported and proven** — the hosted source's own, forwarded; absent from a handshake written before assets, and then read as unsupported, so such a plugin is never handed an asset. A record's assets cross beside `write_task` and `write_document` as §4.9 specifies; a source over the pipe reports no asset of its own, because the protocol carries no asset read. |
28//! | `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. |
29//! | `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. |
30//! | `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. |
31//! | `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. |
32//! | `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. |
33//! | `orphan_tasks` | **Supported and proven** — the hosted source's own, forwarded. |
34//! | `filter_by_label` | **Supported and proven** — the hosted source's own, forwarded. |
35//! | `filter_by_status` | **Supported and proven** — the hosted source's own, forwarded. |
36//! | `search_title` | **Supported and proven** — the hosted source's own, forwarded. |
37//! | `search_content` | **Supported and proven** — the hosted source's own, forwarded. |
38//! | `task_dependencies` | **Supported and proven** — the hosted source's own, forwarded. |
39//! | `project_dependencies` | **Supported and proven** — the hosted source's own, forwarded. |
40//! | `max_page_size` | **Supported and proven** — the hosted source's own, forwarded. |
41//!
42//! That is proven rather than asserted: the journey table's `subprocess` row hosts the
43//! in-memory source over a real pipe and answers every shared journey — every capability
44//! field included — with the same rows and the same plan the in-process row does.
45//!
46//! [`TaskSource`]: onetaskgraph_plugin_api::TaskSource
47
48mod connection;
49mod plugin;
50mod serve;
51mod source;
52mod wire;
53
54pub use connection::MAX_LINE;
55pub(crate) use plugin::SETTINGS_FIELD;
56pub use plugin::{Plugin as SubprocessPlugin, Program, SubprocessConfig};
57pub use serve::{serve, serve_plugin};
58pub use source::{RequestDeadline, SubprocessSource};
59pub(crate) use wire::DocumentDir;