Expand description
§4 “Presets” (docs/composable-harness/COMPOSABLE-HARNESS-DESIGN.md) —
P2 of the composable-harness migration (design §5.2, phase P2).
The six reserved built-in presets, compiled in as TOML consts, transcribed
faithfully from the design doc’s §4.1-§4.5 TOML blocks (and §4’s intro
paragraph for the sixth, supercode-default, which the doc defines by
prose rather than a TOML block — S10 fix: “pi-core MINUS {trust, session_tree, session_share, server, plugins}”, not “pi-core plus
extras”).
Syntax fix (P2 judgment call). The design doc’s [capabilities.X] { enabled = true, ... } lines combine a TOML table-HEADER and an
inline-table VALUE on one line, which is not valid TOML (verified
empirically against the toml crate: invalid table header, expected newline). Naively rewriting them as dotted-key assignments
(capabilities.X = { ... }) is also unsafe wherever such a line appears
after an already-open [capabilities.permissions] table (cc-parity,
cx-parity, oc-parity all have this): a dotted key inside an open table is
relative to the CURRENT table, so capabilities.permissions.sandbox = {..}
written while inside [capabilities.permissions] nests as
capabilities.permissions.capabilities.permissions.sandbox, silently
corrupting the structure. The transcription below instead expands every
[capabilities.X] { k = v, ... } shorthand into the equivalent explicit
form — a real [capabilities.X] table header (always root-absolute,
never context-relative) followed by k = v lines — which is safe
regardless of surrounding context and preserves the exact same resolved
structure. Every block below is verified to parse into HarnessConfig
in this module’s tests, and each preset’s resolved shape is golden-tested
against §4.6’s per-preset verdicts in
crates/harness/tests/composable_presets.rs.
Comments from the design doc are preserved verbatim inside each TOML block for traceability back to the source section.
Constants§
- CC_
PARITY_ TOML cc-parity— design §4.2.- CX_
PARITY_ TOML cx-parity— design §4.3.- OC_
PARITY_ TOML oc-parity— design §4.4.- PI_
CORE_ TOML pi-core— design §4.1.- RESERVED_
PRESET_ NAMES - The six reserved built-in preset names (design §4, opening paragraph).
- SUPERCODE_
DEFAULT_ TOML supercode-default— design §4 intro (S10 fix).- TOKEN_
SAVER_ TOML token-saver— design §4.5.
Functions§
- lookup
- Look up a built-in preset’s compiled-in TOML text by name. Returns
Nonefor anything not one of the sixRESERVED_PRESET_NAMES— the resolver (configfile.rs§3.5) falls back to treating the name as a file path in that case (user/global layer only, §3.3).