sysprims-core 0.2.3

Core types, errors, and platform abstractions for sysprims
Documentation
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
//! Schema ID constants for JSON output contracts.
//!
//! All sysprims JSON outputs include a `schema_id` field that references
//! the corresponding schema. These constants define the canonical schema URLs.
//!
//! ## Schema Hosting
//!
//! sysprims schemas are hosted at `schemas.3leaps.dev/sysprims/` (not fulmenhq.dev).
//! While sysprims uses rsfulmen for signal/exit code constants from the Fulmen
//! ecosystem, sysprims itself is a 3leaps project aimed at wider community use.
//!
//! For Crucible/Fulmen schemas consumed via rsfulmen, use rsfulmen's resolver.
//!
//! ## URI Structure
//!
//! Follows the Canonical URI Resolution Standard:
//! ```text
//! https://schemas.3leaps.dev/<module>/<topic>/<version>/<filename>
//! ```
//!
//! Where:
//! - `module` = `sysprims` (source repository)
//! - `topic` = feature area (e.g., `timeout`, `process`, `signal`)
//! - `version` = SemVer (e.g., `v1.0.0`)
//! - `filename` = schema file with `.schema.json` suffix
//!
//! ## Validation Strategy
//!
//! sysprims does NOT perform runtime JSON schema validation (too heavy).
//! Instead:
//! - Input validation: `serde(deny_unknown_fields)` + manual range checks
//! - Output validation: goneat CLI in CI pipeline
//! - Schema ID verification: Unit tests against SSOT
//!
//! ## Example
//!
//! ```rust,ignore
//! use sysprims_core::schema::TIMEOUT_RESULT_V1;
//! use serde::Serialize;
//!
//! #[derive(Serialize)]
//! struct TimeoutResult {
//!     schema_id: &'static str,
//!     status: String,
//!     // ... other fields
//! }
//!
//! let result = TimeoutResult {
//!     schema_id: TIMEOUT_RESULT_V1,
//!     status: "completed".into(),
//! };
//! ```

/// Schema ID for timeout result JSON output (v1.0.0).
///
/// This schema defines the structure of `sysprims timeout --json` output.
///
/// Schema location: `schemas/timeout/v1.0.0/timeout-result.schema.json`
pub const TIMEOUT_RESULT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/timeout/v1.0.0/timeout-result.schema.json";

/// Schema ID for timeout result JSON output with unproven reliability (v1.1.0).
pub const TIMEOUT_RESULT_V1_1: &str =
    "https://schemas.3leaps.dev/sysprims/timeout/v1.1.0/timeout-result.schema.json";

/// Schema ID for process info JSON output (v1.1.0).
///
/// This schema defines the structure of `sysprims pstat --json` output.
///
/// Schema location: `schemas/process/v1.1.0/process-info.schema.json`
pub const PROCESS_INFO_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.1.0/process-info.schema.json";

/// Schema ID for process snapshot output with sampled (monitor-style) CPU (v1.1.0).
///
/// This schema matches the shape of `process-info.schema.json` but relaxes
/// `cpu_percent` to allow values > 100 when a process uses multiple cores.
///
/// Schema location: `schemas/process/v1.1.0/process-info-sampled.schema.json`
pub const PROCESS_INFO_SAMPLED_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.1.0/process-info-sampled.schema.json";

/// Schema ID for process filter input (v1.0.0).
///
/// This schema defines the structure of filter JSON accepted by
/// `sysprims_proc_list()` FFI function.
///
/// Schema location: `schemas/process/v1.0.0/process-filter.schema.json`
pub const PROC_FILTER_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/process-filter.schema.json";

/// Schema ID for port binding snapshot output (v1.0.0).
///
/// This schema defines the structure of `listening_ports()` output.
///
/// Schema location: `schemas/process/v1.0.0/port-bindings.schema.json`
pub const PORT_BINDINGS_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/port-bindings.schema.json";

/// Schema ID for port filter input (v1.0.0).
///
/// This schema defines the structure of filter JSON accepted by
/// `sysprims_proc_listening_ports()` FFI function.
///
/// Schema location: `schemas/process/v1.0.0/port-filter.schema.json`
pub const PORT_FILTER_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/port-filter.schema.json";

/// Schema ID for file descriptor snapshot output (v1.0.0).
///
/// Schema location: `schemas/process/v1.0.0/fd-snapshot.schema.json`
pub const FD_SNAPSHOT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/fd-snapshot.schema.json";

/// Schema ID for file descriptor filter input (v1.0.0).
///
/// Schema location: `schemas/process/v1.0.0/fd-filter.schema.json`
pub const FD_FILTER_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/fd-filter.schema.json";

/// Schema ID for wait-pid result JSON output (v1.0.0).
///
/// This schema defines the structure of `wait_pid()` output.
///
/// Schema location: `schemas/process/v1.0.0/wait-pid-result.schema.json`
pub const WAIT_PID_RESULT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/wait-pid-result.schema.json";

/// Schema ID for batch kill result JSON output (v1.0.0).
///
/// This schema defines the structure of `sysprims kill --json` output.
///
/// Schema location: `schemas/signal/v1.0.0/batch-kill-result.schema.json`
pub const BATCH_KILL_RESULT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/signal/v1.0.0/batch-kill-result.schema.json";

/// Schema ID for terminate-tree config JSON input (v1.0.0).
///
/// Schema location: `schemas/process/v1.0.0/terminate-tree-config.schema.json`
pub const TERMINATE_TREE_CONFIG_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/terminate-tree-config.schema.json";

/// Schema ID for terminate-tree result JSON output (v1.0.0).
///
/// Schema location: `schemas/process/v1.0.0/terminate-tree-result.schema.json`
pub const TERMINATE_TREE_RESULT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/terminate-tree-result.schema.json";

/// Schema ID for spawn-in-group config JSON input (v1.0.0).
///
/// Schema location: `schemas/process/v1.0.0/spawn-in-group-config.schema.json`
pub const SPAWN_IN_GROUP_CONFIG_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/spawn-in-group-config.schema.json";

/// Schema ID for spawn-in-group result JSON output (v1.0.0).
///
/// Schema location: `schemas/process/v1.0.0/spawn-in-group-result.schema.json`
pub const SPAWN_IN_GROUP_RESULT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/spawn-in-group-result.schema.json";

/// Schema ID for run-setsid config JSON input (v1.0.0).
///
/// Schema location: `schemas/session/v1.0.0/run-setsid-config.schema.json`
pub const RUN_SETSID_CONFIG_V1: &str =
    "https://schemas.3leaps.dev/sysprims/session/v1.0.0/run-setsid-config.schema.json";

/// Schema ID for run-nohup config JSON input (v1.0.0).
///
/// Schema location: `schemas/session/v1.0.0/run-nohup-config.schema.json`
pub const RUN_NOHUP_CONFIG_V1: &str =
    "https://schemas.3leaps.dev/sysprims/session/v1.0.0/run-nohup-config.schema.json";

/// Schema ID for session spawn result JSON output (v1.0.0).
///
/// Schema location: `schemas/session/v1.0.0/session-spawn-result.schema.json`
pub const SESSION_SPAWN_RESULT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/session/v1.0.0/session-spawn-result.schema.json";

/// Schema ID for descendants result JSON output (v1.0.0).
///
/// This schema defines the structure of `sysprims descendants --json` output.
///
/// Schema location: `schemas/process/v1.0.0/descendants-result.schema.json`
pub const DESCENDANTS_RESULT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/descendants-result.schema.json";

/// Schema ID for descendants result JSON output with sampled (monitor-style) CPU (v1.1.0).
///
/// This schema matches the descendants result shape but relaxes `cpu_percent` to
/// allow values > 100 when a process uses multiple cores.
///
/// Schema location: `schemas/process/v1.1.0/descendants-result-sampled.schema.json`
pub const DESCENDANTS_RESULT_SAMPLED_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.1.0/descendants-result-sampled.schema.json";

/// Schema ID for guard step event JSON output (v1.0.0).
///
/// This schema defines the structure of one-shot `guard_step()` events.
///
/// Schema location: `schemas/process/v1.0.0/guard-event.schema.json`
pub const GUARD_EVENT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/guard-event.schema.json";

/// Schema ID for ancestors result JSON output (v1.0.0).
///
/// This schema defines the structure of `sysprims ancestors --json` output.
///
/// Schema location: `schemas/process/v1.0.0/ancestors-result.schema.json`
pub const ANCESTORS_RESULT_V1: &str =
    "https://schemas.3leaps.dev/sysprims/process/v1.0.0/ancestors-result.schema.json";

// ============================================================================
// Schema Host Constants
// ============================================================================

/// Base URL for sysprims schemas.
pub const SCHEMA_HOST: &str = "https://schemas.3leaps.dev";

/// Module name for sysprims in schema URIs.
pub const SCHEMA_MODULE: &str = "sysprims";

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_schema_ids_are_valid_urls() {
        // All schema IDs should be valid HTTPS URLs
        assert!(TIMEOUT_RESULT_V1.starts_with("https://"));
        assert!(TIMEOUT_RESULT_V1_1.starts_with("https://"));
        assert!(PROCESS_INFO_V1.starts_with("https://"));
        assert!(PROCESS_INFO_SAMPLED_V1.starts_with("https://"));
        assert!(PROC_FILTER_V1.starts_with("https://"));
        assert!(PORT_BINDINGS_V1.starts_with("https://"));
        assert!(PORT_FILTER_V1.starts_with("https://"));
        assert!(FD_SNAPSHOT_V1.starts_with("https://"));
        assert!(FD_FILTER_V1.starts_with("https://"));
        assert!(WAIT_PID_RESULT_V1.starts_with("https://"));
        assert!(BATCH_KILL_RESULT_V1.starts_with("https://"));
        assert!(TERMINATE_TREE_CONFIG_V1.starts_with("https://"));
        assert!(TERMINATE_TREE_RESULT_V1.starts_with("https://"));
        assert!(SPAWN_IN_GROUP_CONFIG_V1.starts_with("https://"));
        assert!(SPAWN_IN_GROUP_RESULT_V1.starts_with("https://"));
        assert!(RUN_SETSID_CONFIG_V1.starts_with("https://"));
        assert!(RUN_NOHUP_CONFIG_V1.starts_with("https://"));
        assert!(SESSION_SPAWN_RESULT_V1.starts_with("https://"));
        assert!(DESCENDANTS_RESULT_V1.starts_with("https://"));
        assert!(DESCENDANTS_RESULT_SAMPLED_V1.starts_with("https://"));
        assert!(GUARD_EVENT_V1.starts_with("https://"));
        assert!(ANCESTORS_RESULT_V1.starts_with("https://"));
    }

    #[test]
    fn test_schema_ids_use_3leaps_host() {
        // sysprims schemas live at schemas.3leaps.dev, not fulmenhq.dev
        let expected_prefix = "https://schemas.3leaps.dev/sysprims/";

        assert!(
            TIMEOUT_RESULT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            PROCESS_INFO_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            PROCESS_INFO_SAMPLED_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            PROC_FILTER_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            PORT_BINDINGS_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            PORT_FILTER_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            FD_SNAPSHOT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            FD_FILTER_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            WAIT_PID_RESULT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            BATCH_KILL_RESULT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            TERMINATE_TREE_CONFIG_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            TERMINATE_TREE_RESULT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            SPAWN_IN_GROUP_CONFIG_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            SPAWN_IN_GROUP_RESULT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            RUN_SETSID_CONFIG_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            RUN_NOHUP_CONFIG_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            SESSION_SPAWN_RESULT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            DESCENDANTS_RESULT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            DESCENDANTS_RESULT_SAMPLED_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            GUARD_EVENT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
        assert!(
            ANCESTORS_RESULT_V1.starts_with(expected_prefix),
            "Expected 3leaps.dev host"
        );
    }

    #[test]
    fn test_schema_ids_follow_canonical_uri_pattern() {
        // Pattern: https://schemas.3leaps.dev/sysprims/<topic>/<version>/<filename>.schema.json

        // All should end with .schema.json
        assert!(TIMEOUT_RESULT_V1.ends_with(".schema.json"));
        assert!(PROCESS_INFO_V1.ends_with(".schema.json"));
        assert!(PROCESS_INFO_SAMPLED_V1.ends_with(".schema.json"));
        assert!(PROC_FILTER_V1.ends_with(".schema.json"));
        assert!(PORT_BINDINGS_V1.ends_with(".schema.json"));
        assert!(PORT_FILTER_V1.ends_with(".schema.json"));
        assert!(FD_SNAPSHOT_V1.ends_with(".schema.json"));
        assert!(FD_FILTER_V1.ends_with(".schema.json"));
        assert!(WAIT_PID_RESULT_V1.ends_with(".schema.json"));
        assert!(BATCH_KILL_RESULT_V1.ends_with(".schema.json"));
        assert!(TERMINATE_TREE_CONFIG_V1.ends_with(".schema.json"));
        assert!(TERMINATE_TREE_RESULT_V1.ends_with(".schema.json"));
        assert!(SPAWN_IN_GROUP_CONFIG_V1.ends_with(".schema.json"));
        assert!(SPAWN_IN_GROUP_RESULT_V1.ends_with(".schema.json"));
        assert!(RUN_SETSID_CONFIG_V1.ends_with(".schema.json"));
        assert!(RUN_NOHUP_CONFIG_V1.ends_with(".schema.json"));
        assert!(SESSION_SPAWN_RESULT_V1.ends_with(".schema.json"));
        assert!(DESCENDANTS_RESULT_V1.ends_with(".schema.json"));
        assert!(DESCENDANTS_RESULT_SAMPLED_V1.ends_with(".schema.json"));
        assert!(GUARD_EVENT_V1.ends_with(".schema.json"));
        assert!(ANCESTORS_RESULT_V1.ends_with(".schema.json"));

        // Process snapshot schemas are v1.1.0 (additive ProcessInfo fields).
        assert!(PROCESS_INFO_V1.contains("/v1.1.0/"));
        assert!(PROCESS_INFO_SAMPLED_V1.contains("/v1.1.0/"));
        assert!(DESCENDANTS_RESULT_SAMPLED_V1.contains("/v1.1.0/"));

        // Remaining schemas are currently v1.0.0.
        assert!(TIMEOUT_RESULT_V1.contains("/v1.0.0/"));
        assert!(PROC_FILTER_V1.contains("/v1.0.0/"));
        assert!(PORT_BINDINGS_V1.contains("/v1.0.0/"));
        assert!(PORT_FILTER_V1.contains("/v1.0.0/"));
        assert!(FD_SNAPSHOT_V1.contains("/v1.0.0/"));
        assert!(FD_FILTER_V1.contains("/v1.0.0/"));
        assert!(WAIT_PID_RESULT_V1.contains("/v1.0.0/"));
        assert!(BATCH_KILL_RESULT_V1.contains("/v1.0.0/"));
        assert!(TERMINATE_TREE_CONFIG_V1.contains("/v1.0.0/"));
        assert!(TERMINATE_TREE_RESULT_V1.contains("/v1.0.0/"));
        assert!(SPAWN_IN_GROUP_CONFIG_V1.contains("/v1.0.0/"));
        assert!(SPAWN_IN_GROUP_RESULT_V1.contains("/v1.0.0/"));
        assert!(RUN_SETSID_CONFIG_V1.contains("/v1.0.0/"));
        assert!(RUN_NOHUP_CONFIG_V1.contains("/v1.0.0/"));
        assert!(SESSION_SPAWN_RESULT_V1.contains("/v1.0.0/"));
        assert!(DESCENDANTS_RESULT_V1.contains("/v1.0.0/"));
        assert!(GUARD_EVENT_V1.contains("/v1.0.0/"));
        assert!(ANCESTORS_RESULT_V1.contains("/v1.0.0/"));
    }

    #[test]
    fn test_schema_ids_have_correct_topics() {
        // Verify topic segments are correct
        assert!(
            TIMEOUT_RESULT_V1.contains("/timeout/"),
            "timeout schema should have timeout topic"
        );
        assert!(
            PROCESS_INFO_V1.contains("/process/"),
            "process-info schema should have process topic"
        );
        assert!(
            PROCESS_INFO_SAMPLED_V1.contains("/process/"),
            "process-info-sampled schema should have process topic"
        );
        assert!(
            PROC_FILTER_V1.contains("/process/"),
            "process-filter schema should have process topic"
        );
        assert!(
            PORT_BINDINGS_V1.contains("/process/"),
            "port-bindings schema should have process topic"
        );
        assert!(
            PORT_FILTER_V1.contains("/process/"),
            "port-filter schema should have process topic"
        );
        assert!(
            FD_SNAPSHOT_V1.contains("/process/"),
            "fd-snapshot schema should have process topic"
        );
        assert!(
            FD_FILTER_V1.contains("/process/"),
            "fd-filter schema should have process topic"
        );
        assert!(
            WAIT_PID_RESULT_V1.contains("/process/"),
            "wait-pid-result schema should have process topic"
        );
        assert!(
            BATCH_KILL_RESULT_V1.contains("/signal/"),
            "batch-kill-result schema should have signal topic"
        );
        assert!(
            TERMINATE_TREE_CONFIG_V1.contains("/process/"),
            "terminate-tree-config schema should have process topic"
        );
        assert!(
            TERMINATE_TREE_RESULT_V1.contains("/process/"),
            "terminate-tree-result schema should have process topic"
        );
        assert!(
            SPAWN_IN_GROUP_CONFIG_V1.contains("/process/"),
            "spawn-in-group-config schema should have process topic"
        );
        assert!(
            SPAWN_IN_GROUP_RESULT_V1.contains("/process/"),
            "spawn-in-group-result schema should have process topic"
        );
        assert!(
            RUN_SETSID_CONFIG_V1.contains("/session/"),
            "run-setsid-config schema should have session topic"
        );
        assert!(
            RUN_NOHUP_CONFIG_V1.contains("/session/"),
            "run-nohup-config schema should have session topic"
        );
        assert!(
            SESSION_SPAWN_RESULT_V1.contains("/session/"),
            "session-spawn-result schema should have session topic"
        );
        assert!(
            DESCENDANTS_RESULT_V1.contains("/process/"),
            "descendants-result schema should have process topic"
        );
        assert!(
            DESCENDANTS_RESULT_SAMPLED_V1.contains("/process/"),
            "descendants-result-sampled schema should have process topic"
        );
        assert!(
            GUARD_EVENT_V1.contains("/process/"),
            "guard-event schema should have process topic"
        );
        assert!(
            ANCESTORS_RESULT_V1.contains("/process/"),
            "ancestors-result schema should have process topic"
        );
    }

    #[test]
    fn test_schema_ids_are_unique() {
        let ids = [
            TIMEOUT_RESULT_V1,
            PROCESS_INFO_V1,
            PROCESS_INFO_SAMPLED_V1,
            PROC_FILTER_V1,
            PORT_BINDINGS_V1,
            PORT_FILTER_V1,
            FD_SNAPSHOT_V1,
            FD_FILTER_V1,
            WAIT_PID_RESULT_V1,
            BATCH_KILL_RESULT_V1,
            TERMINATE_TREE_CONFIG_V1,
            TERMINATE_TREE_RESULT_V1,
            SPAWN_IN_GROUP_CONFIG_V1,
            SPAWN_IN_GROUP_RESULT_V1,
            RUN_SETSID_CONFIG_V1,
            RUN_NOHUP_CONFIG_V1,
            SESSION_SPAWN_RESULT_V1,
            DESCENDANTS_RESULT_V1,
            DESCENDANTS_RESULT_SAMPLED_V1,
            GUARD_EVENT_V1,
            ANCESTORS_RESULT_V1,
        ];

        // Check all pairs are different
        for (i, a) in ids.iter().enumerate() {
            for (j, b) in ids.iter().enumerate() {
                if i != j {
                    assert_ne!(a, b, "Schema IDs must be unique");
                }
            }
        }
    }

    #[test]
    fn test_schema_host_constants() {
        assert_eq!(SCHEMA_HOST, "https://schemas.3leaps.dev");
        assert_eq!(SCHEMA_MODULE, "sysprims");

        // All schema IDs should start with host/module
        let prefix = format!("{}/{}/", SCHEMA_HOST, SCHEMA_MODULE);
        assert!(TIMEOUT_RESULT_V1.starts_with(&prefix));
        assert!(PROCESS_INFO_V1.starts_with(&prefix));
        assert!(PROCESS_INFO_SAMPLED_V1.starts_with(&prefix));
        assert!(PROC_FILTER_V1.starts_with(&prefix));
        assert!(PORT_BINDINGS_V1.starts_with(&prefix));
        assert!(PORT_FILTER_V1.starts_with(&prefix));
        assert!(FD_SNAPSHOT_V1.starts_with(&prefix));
        assert!(FD_FILTER_V1.starts_with(&prefix));
        assert!(WAIT_PID_RESULT_V1.starts_with(&prefix));
        assert!(BATCH_KILL_RESULT_V1.starts_with(&prefix));
        assert!(TERMINATE_TREE_CONFIG_V1.starts_with(&prefix));
        assert!(TERMINATE_TREE_RESULT_V1.starts_with(&prefix));
        assert!(SPAWN_IN_GROUP_CONFIG_V1.starts_with(&prefix));
        assert!(SPAWN_IN_GROUP_RESULT_V1.starts_with(&prefix));
        assert!(RUN_SETSID_CONFIG_V1.starts_with(&prefix));
        assert!(RUN_NOHUP_CONFIG_V1.starts_with(&prefix));
        assert!(SESSION_SPAWN_RESULT_V1.starts_with(&prefix));
        assert!(DESCENDANTS_RESULT_V1.starts_with(&prefix));
        assert!(DESCENDANTS_RESULT_SAMPLED_V1.starts_with(&prefix));
        assert!(GUARD_EVENT_V1.starts_with(&prefix));
        assert!(ANCESTORS_RESULT_V1.starts_with(&prefix));
    }
}