supercode-harness 0.5.45

The optional native Volter Harness agent and tool harness
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
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
//! Canonical implementation inventory for external coding harnesses.
//!
//! This registry describes wiring that exists in the compiled core. It does
//! not claim that a harness has passed a real executable smoke test; the
//! support audit joins this inventory with behavioral probe receipts and
//! tracker state before it calls anything verified.

use std::collections::BTreeMap;

use serde::{Deserialize, Serialize};

use crate::{
    AcpRuntimeBackend, ClaudeCodeRuntimeBackend, CodexRuntimeBackend, HarnessId,
    OpenCodeRuntimeBackend, PiRuntimeBackend, RuntimeBackend, RuntimeCapabilities,
    RuntimeConnectLaunch, RuntimeLaunch,
};

/// Schema emitted by [`harness_support_registry`].
pub const SUPPORT_REGISTRY_SCHEMA: &str = "supercode.support-registry.v1";

/// How a primitive is wired into the compiled core.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ImplementationKind {
    /// A harness-specific implementation is registered.
    BuiltIn,
    /// A protocol-generic implementation is usable with a known launch.
    GenericProtocol,
    /// No implementation is present.
    Absent,
}

/// Persisted-session and translation implementation facts.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct NativeSupport {
    /// Whether the catalog can discover this harness's sessions.
    pub discover: ImplementationKind,
    /// Whether the core can load this harness's native persisted format.
    pub load: ImplementationKind,
    /// Whether the generic follower can open this harness's native storage.
    pub follow: ImplementationKind,
    /// Whether the canonical session can import this native format.
    pub import: ImplementationKind,
    /// Whether the canonical session can export this native format.
    pub export: ImplementationKind,
}

/// Live runtime wiring known without launching the real executable.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct RuntimeSupport {
    /// Harness-specific or protocol-generic adapter registration.
    pub implementation: ImplementationKind,
    /// Protocol spoken by the adapter.
    pub protocol: String,
    /// Command used when callers do not provide an override.
    pub default_launch: Option<RuntimeLaunch>,
    /// Connect-mode launch for gateway harnesses: where a running endpoint's
    /// address and credential live in the harness's own config file. `None`
    /// for spawn-only harnesses; declaring one is an explicit registry
    /// decision, never inferred.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub connect_launch: Option<RuntimeConnectLaunch>,
    /// Static adapter capabilities. Optional protocol features are only true
    /// for known agents that advertise them; the adapter validates them again
    /// during the live handshake.
    pub capabilities: RuntimeCapabilities,
}

/// One compiled harness implementation descriptor.

/// The twelve Domain 11 concepts, in plan order
/// (`docs/plans/orchestration-domain-11-2026-09-02.md`).
pub const ORCHESTRATION_CONCEPTS: &[&str] = &[
    "scheduled_job",
    "run",
    "conversation",
    "pending_request",
    "profile",
    "skills",
    "memory",
    "delivery_target",
    "channel",
    "routing",
    "inbound_trigger",
    "gateway_health",
];

/// One orchestration concept's tiers for one harness (ORCH-4).
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ConceptSupport {
    /// One of [`ORCHESTRATION_CONCEPTS`].
    pub concept: String,
    /// Read tier: supercode lists/inspects the concept from the harness's own files or CLI.
    pub observed: ImplementationKind,
    /// Write tier: supercode mutates the concept through the harness's own verb.
    pub controlled: ImplementationKind,
    /// `harness.v1.<noun>.<verb>` methods backing the non-`Absent` tiers.
    #[serde(default, skip_serializing_if = "Vec::is_empty")]
    pub methods: Vec<String>,
}

/// Per-concept observed / controlled tiers for one harness (additive to the
/// v1 registry schema, like `connect_launch`).
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
pub struct OrchestrationSupport {
    /// Exactly [`ORCHESTRATION_CONCEPTS`], in order.
    pub concepts: Vec<ConceptSupport>,
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct HarnessSupportDescriptor {
    /// Stable harness identifier.
    pub id: HarnessId,
    /// Human-readable name.
    pub display_name: String,
    /// Native persistence/translation implementation.
    pub native: NativeSupport,
    /// Live runtime implementation.
    pub runtime: RuntimeSupport,
    /// ORCH-4: orchestration concept tiers (defaults to all-`Absent`).
    #[serde(default)]
    pub orchestration: OrchestrationSupport,
}

/// Machine-readable compiled support inventory.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SupportRegistryReport {
    /// Report schema.
    pub schema: String,
    /// Harness descriptors, in stable product order.
    pub harnesses: Vec<HarnessSupportDescriptor>,
}

/// Whether a harness can enter its own sandbox by replacing its process image.
///
/// WebAssembly has no process replacement, so a harness asked to sandbox itself
/// there aborts before its handshake. Everything the loader starts on that
/// target is already confined to the browser it runs in.
pub(crate) fn self_sandbox_supported() -> bool {
    !cfg!(target_family = "wasm")
}

/// Grok refuses its `workspace` sandbox when its home is a symlink ("symlinked GROK_HOME is
/// not allowed under sandbox write-deny"), so a symlinked `~/.grok` is named by the path it
/// resolves to: the same directory, which the sandbox can then protect. An explicit
/// `GROK_HOME` is left to the caller.
pub(crate) fn grok_home_env() -> BTreeMap<String, String> {
    let mut env = BTreeMap::new();
    if std::env::var_os("GROK_HOME").is_none() {
        if let Some(home) = supercode_interchange::user_home()
            .map(std::path::PathBuf::into_os_string)
            .map(std::path::PathBuf::from)
        {
            let grok = home.join(".grok");
            let linked = std::fs::symlink_metadata(&grok)
                .map(|metadata| metadata.file_type().is_symlink())
                .unwrap_or(false);
            if let (true, Ok(resolved)) = (linked, grok.canonicalize()) {
                env.insert("GROK_HOME".into(), resolved.to_string_lossy().into_owned());
            }
        }
    }
    env
}

/// A headless Grok runtime's environment: no agent dashboard, and [`grok_home_env`].
pub(crate) fn grok_env() -> BTreeMap<String, String> {
    let mut env = grok_home_env();
    env.insert("GROK_AGENT_DASHBOARD".into(), "0".into());
    env
}

/// Builds Grok's stdio launch, asking it to sandbox itself where it can.
fn grok_arguments() -> Vec<String> {
    let mut arguments: Vec<String> = Vec::new();
    if self_sandbox_supported() {
        arguments.push("--sandbox".into());
        arguments.push("workspace".into());
    }
    arguments.push("agent".into());
    arguments.push("--no-leader".into());
    arguments.push("stdio".into());
    arguments
}

fn built_in_native() -> NativeSupport {
    NativeSupport {
        discover: ImplementationKind::BuiltIn,
        load: ImplementationKind::BuiltIn,
        follow: ImplementationKind::BuiltIn,
        import: ImplementationKind::BuiltIn,
        export: ImplementationKind::BuiltIn,
    }
}

fn built_in_runtime(
    backend: &dyn RuntimeBackend,
    protocol: &str,
    launch: RuntimeLaunch,
) -> RuntimeSupport {
    RuntimeSupport {
        implementation: ImplementationKind::BuiltIn,
        protocol: protocol.into(),
        default_launch: Some(launch),
        connect_launch: None,
        capabilities: backend.capabilities(),
    }
}

/// Return the single compiled inventory used by product surfaces and audits.

/// Derive a harness's orchestration tiers from what the registry already
/// proves: a harness whose sessions load natively is `observed` for the
/// conversation concept (`sessions.discover`/`load`), and a runtime door that
/// answers protocol requests is `controlled` for pending requests
/// (`runtimes.respond`). Every other cell is `Absent` until its ORCH item
/// lands and adds its method here.
pub fn orchestration_support(descriptor: &HarnessSupportDescriptor) -> OrchestrationSupport {
    let concepts = ORCHESTRATION_CONCEPTS
        .iter()
        .map(|concept| {
            let (observed, controlled, methods): (
                ImplementationKind,
                ImplementationKind,
                Vec<&str>,
            ) = match *concept {
                // ORCH-18: the two harnesses that publish a client-callable
                // cron verb are also CONTROLLED — supercode runs `hermes cron
                // …` / `openclaw cron …` on the caller's behalf and re-reads
                // the row (`crate::jobs_control`). supercode still schedules
                // nothing itself; the tier means "the harness's own verb is
                // reachable through one uniform door".
                "scheduled_job"
                    if crate::jobs_control::supports_job_control(descriptor.id.as_str()) =>
                {
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::BuiltIn,
                        vec![
                            "harness.v1.jobs.list",
                            "harness.v1.jobs.get",
                            "harness.v1.jobs.create",
                            "harness.v1.jobs.update",
                            "harness.v1.jobs.pause",
                            "harness.v1.jobs.resume",
                            "harness.v1.jobs.run",
                            "harness.v1.jobs.delete",
                        ],
                    )
                }
                // ORCH-7: the three harnesses that HAVE scheduled jobs are read
                // uniformly from their own stores. Claude Code stays read-only
                // on purpose: its jobs are session-scoped runtime state created
                // by the model inside a session (`CronCreate`), so there is no
                // harness verb for a client to call.
                "scheduled_job" if crate::jobs::supports_jobs(descriptor.id.as_str()) => (
                    ImplementationKind::BuiltIn,
                    ImplementationKind::Absent,
                    vec!["harness.v1.jobs.list", "harness.v1.jobs.get"],
                ),
                // ORCH-8: a harness is `observed` for runs when it KEEPS a
                // fire store the loader in `crate::runs` opens. Claude Code
                // has scheduled jobs but no run store — its fires are turns —
                // so it is deliberately absent here while `scheduled_job`
                // above is built-in for it.
                "run" if crate::runs::supports_runs(descriptor.id.as_str()) => (
                    ImplementationKind::BuiltIn,
                    ImplementationKind::Absent,
                    vec!["harness.v1.runs.list", "harness.v1.runs.get"],
                ),
                // ORCH-19: a harness is CONTROLLED for conversations when it
                // publishes at least one lifecycle DOOR supercode can drive —
                // Codex's `archive`/`delete` CLI verbs, OpenCode's HTTP session
                // API, Hermes's and OpenClaw's `/new`/`/reset` slash commands
                // typed into a live driven session, Hermes's `sessions delete`,
                // and supercode's own store. The advertised methods come from
                // `sessions_control`'s own door table, so a method can never be
                // listed here without a door behind it. Claude Code stays
                // read-only on purpose: it publishes no lifecycle verb at all
                // (its sessions expire on a retention window it owns).
                "conversation"
                    if descriptor.native.load == ImplementationKind::BuiltIn
                        && !crate::sessions_control::controlled_methods(descriptor.id.as_str())
                            .is_empty() =>
                {
                    let mut methods =
                        vec!["harness.v1.sessions.discover", "harness.v1.sessions.load"];
                    methods.extend(crate::sessions_control::controlled_methods(
                        descriptor.id.as_str(),
                    ));
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::BuiltIn,
                        methods,
                    )
                }
                // ORC-7: the orchestrator's conversations are its BINDINGS,
                // discovered from every profile folder's `bindings` table
                // (`supercode_interchange::catalog::discover_orchestrator`). They are
                // observed, not loadable: the transcript belongs to the
                // worker harness the binding addresses and is read through
                // that harness's own `sessions.load`.
                // ORC-13 makes them CONTROLLED: `/new` and `/reset` are the
                // two chat commands the daemon's reducer applies to a binding
                // (`docs/ORCHESTRATOR-IR.md` §4.5), and the operator door now
                // reaches that reducer from outside a chat — the daemon's own
                // socket, or its package's CLI when the daemon is down. The
                // methods come from `sessions_control`'s door table, so a
                // method can never be advertised without a door behind it.
                "conversation" if descriptor.id.as_str() == HarnessId::ORCHESTRATOR => {
                    let mut methods = vec!["harness.v1.sessions.discover"];
                    methods.extend(crate::sessions_control::controlled_methods(
                        descriptor.id.as_str(),
                    ));
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::BuiltIn,
                        methods,
                    )
                }
                "conversation" if descriptor.native.load == ImplementationKind::BuiltIn => (
                    ImplementationKind::BuiltIn,
                    ImplementationKind::Absent,
                    vec!["harness.v1.sessions.discover", "harness.v1.sessions.load"],
                ),
                // ORCH-9: a harness is `observed` for pending requests when
                // its runtime door can carry one — the same flag that makes
                // it `controlled`, because at the pinned versions the LIVE
                // request IS the only uniform source (no harness stores
                // approvals; see `crate::approvals`).
                // ORCH-20 adds `harness.v1.approvals.resolve` to the
                // controlled tier: one uniform decision, translated onto the
                // request's own options and sent through `runtimes.respond`.
                "pending_request" if descriptor.runtime.capabilities.respond_to_requests => (
                    ImplementationKind::BuiltIn,
                    ImplementationKind::BuiltIn,
                    vec![
                        "harness.v1.approvals.list",
                        "harness.v1.approvals.resolve",
                        "harness.v1.runtimes.respond",
                    ],
                ),
                // ORCH-21: the two harnesses that publish a client-callable
                // profile lifecycle verb are also CONTROLLED — supercode runs
                // `hermes profile create|delete` / `openclaw agents
                // add|delete` on the caller's behalf and re-reads the row
                // (`crate::profiles_control`). supercode still owns no config
                // plane; the tier means "the harness's own verb is reachable
                // through one uniform door".
                "profile"
                    if crate::profiles_control::supports_profile_control(
                        descriptor.id.as_str(),
                    ) =>
                {
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::BuiltIn,
                        vec![
                            "harness.v1.profiles.list",
                            "harness.v1.profiles.get",
                            "harness.v1.profiles.create",
                            "harness.v1.profiles.delete",
                        ],
                    )
                }
                // ORCH-10: the profile noun is read for the four harnesses
                // that have one — supercode's presets, Codex's
                // `[profiles.<name>]` tables, Hermes's profile homes, and
                // OpenClaw's agent homes. Every other harness refuses. Codex
                // and supercode stay read-only on purpose: a Codex profile is
                // a table a human authors in `config.toml` and a supercode
                // preset is compiled-in code, so neither publishes a verb a
                // client could call.
                "profile"
                    if crate::profiles::PROFILE_HARNESSES.contains(&descriptor.id.as_str()) =>
                {
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::Absent,
                        vec!["harness.v1.profiles.list", "harness.v1.profiles.get"],
                    )
                }
                // ORCH-11: a harness is `observed` for skills when the loader
                // in `crate::skills` opens its documented skill roots.
                // ORCH-22 makes those same harnesses `controlled`: each one
                // publishes a skills door supercode drives — `hermes skills
                // install|uninstall`, `openclaw skills install`, and for the
                // core four the loader's own directory, which IS their only
                // skills door. supercode resolves no registry and unpacks no
                // archive; a verb a harness lacks (OpenClaw has no `skills
                // remove` at the pin) refuses with UnsupportedAction.
                "skills"
                    if crate::skills_control::supports_skill_control(descriptor.id.as_str()) =>
                {
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::BuiltIn,
                        vec![
                            "harness.v1.skills.list",
                            "harness.v1.skills.install",
                            "harness.v1.skills.remove",
                        ],
                    )
                }
                // ORCH-13: a delivery target is a FIELD on a job or a run,
                // not a noun with verbs of its own, so it is observed exactly
                // where those rows are — `deliver` on every job harness, and
                // the delivery record on the two that keep a fire store.
                // Nothing is controlled: supercode never sends.
                "delivery_target" if crate::jobs::supports_jobs(descriptor.id.as_str()) => {
                    let mut methods = vec!["harness.v1.jobs.list", "harness.v1.jobs.get"];
                    if crate::runs::supports_runs(descriptor.id.as_str()) {
                        methods.push("harness.v1.runs.list");
                        methods.push("harness.v1.runs.get");
                    }
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::Absent,
                        methods,
                    )
                }
                // ORCH-14: the channel noun is read for the two gateway
                // harnesses that HAVE install-scoped channels — Hermes's
                // `platforms:` blocks and OpenClaw's `channels.<name>`
                // entries. Claude Code's channels are MCP servers that
                // declare the capability over the protocol, not in a config
                // file, so it is refused rather than guessed at.
                // ORCH-17: gateway state/endpoint on the inventory row, derived from the
                // UNI-7 running-instance probe and the harness's own config.
                "gateway_health"
                    if matches!(
                        descriptor.id.as_str(),
                        // ORC-7: the orchestrator's gateway state is its
                        // daemon lease (`<home>/orchestrator.lock` plus a
                        // liveness check on the pid it names), reported on
                        // the same `harnesses.list` row as the other two.
                        HarnessId::HERMES | HarnessId::OPENCLAW | HarnessId::ORCHESTRATOR
                    ) =>
                {
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::Absent,
                        vec!["harness.v1.harnesses.list"],
                    )
                }
                // ORCH-16: inbound webhook routes / hook mappings from the same configs.
                "inbound_trigger"
                    if crate::triggers::TRIGGER_HARNESSES.contains(&descriptor.id.as_str()) =>
                {
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::Absent,
                        vec!["harness.v1.triggers.list"],
                    )
                }
                // ORCH-15: routing entries read from the same gateway configs.
                "routing" if crate::routes::ROUTE_HARNESSES.contains(&descriptor.id.as_str()) => (
                    ImplementationKind::BuiltIn,
                    ImplementationKind::Absent,
                    vec!["harness.v1.routes.list"],
                ),
                "channel"
                    if crate::channels::CHANNEL_HARNESSES.contains(&descriptor.id.as_str()) =>
                {
                    (
                        ImplementationKind::BuiltIn,
                        ImplementationKind::Absent,
                        vec!["harness.v1.channels.list", "harness.v1.channels.status"],
                    )
                }
                // ORCH-12: a harness is `observed` for memory when
                // `crate::memory` opens its own persistent memory documents —
                // Claude Code's per-project auto-memory directory, Hermes's
                // `memories/MEMORY.md`/`USER.md` per profile home, and
                // OpenClaw memory-core's workspace files. Nothing is
                // controlled: forget/reset stay the harness's own verb.
                "memory" if crate::memory::supports_memory(descriptor.id.as_str()) => (
                    ImplementationKind::BuiltIn,
                    ImplementationKind::Absent,
                    vec!["harness.v1.memory.show", "harness.v1.memory.search"],
                ),
                _ => (
                    ImplementationKind::Absent,
                    ImplementationKind::Absent,
                    vec![],
                ),
            };
            ConceptSupport {
                concept: (*concept).to_string(),
                observed,
                controlled,
                methods: methods.into_iter().map(str::to_string).collect(),
            }
        })
        .collect();
    OrchestrationSupport { concepts }
}

pub fn harness_support_registry() -> SupportRegistryReport {
    let claude = ClaudeCodeRuntimeBackend::new();
    let codex = CodexRuntimeBackend::new();
    let opencode = OpenCodeRuntimeBackend::new();
    let pi = PiRuntimeBackend::new();
    let grok_launch = RuntimeLaunch {
        program: "grok".into(),
        arguments: grok_arguments(),
        env: grok_env(),
    };
    let grok = AcpRuntimeBackend::new(HarnessId::from(HarnessId::GROK), grok_launch.clone())
        .with_resume_support(true);
    let gemini_launch = RuntimeLaunch {
        program: "gemini".into(),
        // PARITY-24 drift 2026-08-31: gemini-cli 0.29.x renamed the ACP
        // flag; `--acp` is rejected with "Unknown argument". Verified live:
        // `--experimental-acp` completes the v1 initialize handshake.
        arguments: vec!["--experimental-acp".into()],
        env: BTreeMap::new(),
    };
    let gemini = AcpRuntimeBackend::new(HarnessId::from(HarnessId::GEMINI), gemini_launch.clone())
        .with_resume_support(true);
    let goose_launch = RuntimeLaunch {
        program: "goose".into(),
        arguments: vec!["acp".into()],
        env: BTreeMap::new(),
    };
    let goose = AcpRuntimeBackend::new(HarnessId::from(HarnessId::GOOSE), goose_launch.clone())
        .with_resume_support(true);
    let hermes_launch = RuntimeLaunch {
        program: "hermes-acp".into(),
        arguments: Vec::new(),
        env: BTreeMap::new(),
    };
    let hermes = AcpRuntimeBackend::new(HarnessId::from(HarnessId::HERMES), hermes_launch.clone())
        .with_resume_support(true);
    let openclaw_launch = RuntimeLaunch {
        // `openclaw acp` is a stdio ACP bridge that CONNECTS to a running
        // Gateway (never spawns one); with no flags it resolves the gateway
        // target from OpenClaw's own config. The explicit-endpoint variant is
        // the connect_launch below.
        program: "openclaw".into(),
        arguments: vec!["acp".into()],
        env: BTreeMap::new(),
    };
    let openclaw = AcpRuntimeBackend::new(
        HarnessId::from(HarnessId::OPENCLAW),
        openclaw_launch.clone(),
    )
    .with_resume_support(true);
    let supercode_launch = RuntimeLaunch {
        program: "supercode".into(),
        arguments: vec!["acp".into()],
        env: BTreeMap::new(),
    };
    let supercode = AcpRuntimeBackend::new(
        HarnessId::from(HarnessId::SUPERCODE),
        supercode_launch.clone(),
    )
    .with_resume_support(true);

    let mut report = SupportRegistryReport {
        schema: SUPPORT_REGISTRY_SCHEMA.into(),
        harnesses: vec![
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::CLAUDE_CODE),
                display_name: "Claude Code".into(),
                orchestration: OrchestrationSupport::default(),
                native: built_in_native(),
                // the backend's own prefix: a published launch that omitted the
                // stream-json flags started the interactive TUI on a pipe when
                // handed back through `RuntimeStart.launch`
                runtime: built_in_runtime(&claude, "claude-stream-json", claude.launch().clone()),
            },
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::CODEX),
                display_name: "Codex".into(),
                orchestration: OrchestrationSupport::default(),
                native: built_in_native(),
                runtime: built_in_runtime(
                    &codex,
                    "codex-app-server-jsonl",
                    RuntimeLaunch {
                        program: "codex".into(),
                        arguments: vec!["app-server".into()],
                        env: BTreeMap::new(),
                    },
                ),
            },
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::OPENCODE),
                display_name: "OpenCode".into(),
                orchestration: OrchestrationSupport::default(),
                native: built_in_native(),
                runtime: built_in_runtime(
                    &opencode,
                    "opencode-http-sse",
                    RuntimeLaunch {
                        program: "opencode".into(),
                        arguments: vec!["serve".into()],
                        env: BTreeMap::new(),
                    },
                ),
            },
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::PI),
                display_name: "Pi".into(),
                orchestration: OrchestrationSupport::default(),
                native: built_in_native(),
                runtime: built_in_runtime(
                    &pi,
                    "pi-rpc-jsonl",
                    RuntimeLaunch {
                        program: "pi".into(),
                        arguments: vec!["--mode".into(), "rpc".into()],
                        env: BTreeMap::new(),
                    },
                ),
            },
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::GROK),
                display_name: "Grok".into(),
                orchestration: OrchestrationSupport::default(),
                native: built_in_native(),
                runtime: RuntimeSupport {
                    implementation: ImplementationKind::GenericProtocol,
                    protocol: "acp-v1-jsonrpc".into(),
                    default_launch: Some(grok_launch),
                    connect_launch: None,
                    capabilities: grok.capabilities(),
                },
            },
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::GEMINI),
                display_name: "Gemini CLI".into(),
                orchestration: OrchestrationSupport::default(),
                native: built_in_native(),
                runtime: RuntimeSupport {
                    implementation: ImplementationKind::GenericProtocol,
                    protocol: "acp-v1-jsonrpc".into(),
                    default_launch: Some(gemini_launch),
                    connect_launch: None,
                    capabilities: gemini.capabilities(),
                },
            },
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::GOOSE),
                display_name: "Goose".into(),
                orchestration: OrchestrationSupport::default(),
                native: built_in_native(),
                runtime: RuntimeSupport {
                    implementation: ImplementationKind::GenericProtocol,
                    protocol: "acp-v1-jsonrpc".into(),
                    default_launch: Some(goose_launch),
                    connect_launch: None,
                    capabilities: goose.capabilities(),
                },
            },
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::HERMES),
                display_name: "Hermes Agent".into(),
                orchestration: OrchestrationSupport::default(),
                native: NativeSupport {
                    // UNI-15 read-only tier: discovery + load over the
                    // state.db SQLite store. Follow/import stay Absent.
                    // EXPORT (UNI-18) goes through Hermes's own door:
                    // `hermes sessions import --from codex` (0.21.0), which
                    // writes the store with Hermes's own writer — supercode
                    // never writes a live Hermes store itself. The tier
                    // stays driven (matrix membership is UNI-17's flip).
                    discover: ImplementationKind::BuiltIn,
                    load: ImplementationKind::BuiltIn,
                    follow: ImplementationKind::Absent,
                    import: ImplementationKind::Absent,
                    export: ImplementationKind::GenericProtocol,
                },
                runtime: RuntimeSupport {
                    implementation: ImplementationKind::GenericProtocol,
                    protocol: "acp-v1-jsonrpc".into(),
                    default_launch: Some(hermes_launch),
                    connect_launch: None,
                    capabilities: hermes.capabilities(),
                },
            },
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::OPENCLAW),
                display_name: "OpenClaw".into(),
                orchestration: OrchestrationSupport::default(),
                native: NativeSupport {
                    // UNI-16 read-only tier: discovery over
                    // `agents/<id>/sessions/*.jsonl` and the pi-v3-dialect
                    // loader (`from_openclaw_str`). Import (translate IN),
                    // export (write OUT), and follow stay Absent — the write
                    // path is a permanent skip, and the TIER stays `driven`:
                    // matrix membership remains UNI-17's priced flip.
                    discover: ImplementationKind::BuiltIn,
                    load: ImplementationKind::BuiltIn,
                    follow: ImplementationKind::Absent,
                    import: ImplementationKind::Absent,
                    export: ImplementationKind::Absent,
                },
                runtime: RuntimeSupport {
                    implementation: ImplementationKind::GenericProtocol,
                    protocol: "acp-v1-jsonrpc".into(),
                    default_launch: Some(openclaw_launch),
                    // Blind-walk finding 2026-08-31: `gateway.url` is NOT a
                    // key openclaw's config schema accepts (the gateway
                    // rejects the whole file as invalid config). The real
                    // shape: an optional full URL at `gateway.remote.url`, a
                    // bare `gateway.port` number, or nothing at all — the
                    // documented out-of-the-box endpoint is ws://127.0.0.1:18789.
                    connect_launch: Some(RuntimeConnectLaunch {
                        config_path: "~/.openclaw/openclaw.json".into(),
                        address_pointer: "/gateway/remote/url".into(),
                        port_pointer: Some("/gateway/port".into()),
                        default_address: Some("ws://127.0.0.1:18789".into()),
                        auth_pointer: Some("/gateway/auth/token".into()),
                        protocol: "acp-v1-jsonrpc".into(),
                    }),
                    capabilities: openclaw.capabilities(),
                },
            },
            // ORC-7: the orchestrator is a harness id so the EXISTING
            // orchestration readers list its state — its folder is a
            // Hermes-shaped home (`docs/ORCHESTRATOR-IR.md` §6) and each
            // reader is pointed at it with no new reader code. It has no
            // native session tier of its own: it keeps no transcripts, only
            // BINDINGS that address a WORKER harness's session, which is read
            // through that harness's own door. It has no runtime either — the
            // daemon is a Node process the operator verbs start and stop, not
            // an adapter supercode connects a turn to.
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::ORCHESTRATOR),
                display_name: "Orchestrator".into(),
                orchestration: OrchestrationSupport::default(),
                native: NativeSupport {
                    discover: ImplementationKind::Absent,
                    load: ImplementationKind::Absent,
                    follow: ImplementationKind::Absent,
                    import: ImplementationKind::Absent,
                    export: ImplementationKind::Absent,
                },
                runtime: RuntimeSupport {
                    implementation: ImplementationKind::Absent,
                    protocol: "none".into(),
                    default_launch: None,
                    connect_launch: None,
                    capabilities: RuntimeCapabilities {
                        start_session: false,
                        resume_session: false,
                        attach_existing_process: false,
                        send_input: false,
                        stream_events: false,
                        interrupt: false,
                        steer: false,
                        respond_to_requests: false,
                    },
                },
            },
            HarnessSupportDescriptor {
                id: HarnessId::from(HarnessId::SUPERCODE),
                display_name: "Volter Harness".into(),
                orchestration: OrchestrationSupport::default(),
                native: built_in_native(),
                runtime: RuntimeSupport {
                    implementation: ImplementationKind::GenericProtocol,
                    protocol: "acp-v1-jsonrpc".into(),
                    default_launch: Some(supercode_launch),
                    connect_launch: None,
                    capabilities: supercode.capabilities(),
                },
            },
        ],
    };
    for descriptor in &mut report.harnesses {
        descriptor.orchestration = orchestration_support(descriptor);
    }
    report
}

/// Look up one harness in the compiled registry.
pub fn harness_support(id: &str) -> Option<HarnessSupportDescriptor> {
    harness_support_registry()
        .harnesses
        .into_iter()
        .find(|harness| harness.id.as_str() == id)
}