1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! `daemon/active-artifacts` handler — read-only enumeration of
//! `.sqry/graph` directories belonging to every workspace whose state
//! is `Loading | Loaded | Rebuilding`.
//!
//! Source: `00_contracts.md` §3.CC-4 + `E_p1_cluster.md` §E.4 (DPG
//! hand-off) + `G_daemon_control_plane.md` §7.1 hand-off G4. This is
//! the canonical mechanism that resolved the iter-1 mechanism
//! conflict between E (which required a dedicated IPC) and G (which
//! offered to filter `daemon/status` instead) — E's mechanism wins
//! because it gives `sqry workspace clean` a stable `() → Vec<PathBuf>`
//! contract independent of the heavier `DaemonStatus` schema.
//!
//! Wire contract:
//!
//! - **Method name:** `daemon/active-artifacts`
//! - **Params:** empty `{}` or `null` (no caller input).
//! - **Result:** `ResponseEnvelope<ActiveArtifactsResult>` where
//! `ActiveArtifactsResult { artifacts: Vec<PathBuf> }`.
//! - **Latency budget (caller-side):** 250 ms — `sqry workspace clean`
//! times the call out and falls back to "no daemon available" mode
//! on miss.
//! - **Concurrency:** read-only (`WorkspaceManager::active_artifact_dirs`
//! takes `self.workspaces.read()`).
//!
//! The fallback path described in `00_contracts.md` §3.CC-4 (an
//! advisory `<root>/.sqry/graph/active.lock` file written at publish
//! time) is owned by `IMP-G` Layer-2 and is not part of this method.
use ;
use Value;
use PathBuf;
use ;
use ;
/// `daemon/active-artifacts` params — currently empty. Accepts either an
/// empty object `{}` or no params field at all (for parity with
/// `daemon/status`'s param shape).
/// Wire result of `daemon/active-artifacts`. Always a single
/// stable-sorted `Vec<PathBuf>` — empty when the daemon has no live
/// workspaces.
/// Handle one `daemon/active-artifacts` request.
pub async