sil-openclaw 0.3.8 → 0.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,126 +1,65 @@
1
+ ---
2
+ name: multi-domain-shopper-walkthrough
3
+ description: Worked end-to-end example — create one shopper, then shop two unrelated niches in one session with a shared fact reused across both and per-domain taste kept isolated.
4
+ ---
5
+
1
6
  # Worked example — one shopper, two unrelated niches, one session
2
7
 
3
- A short walkthrough of the **headline capability**: create **ONE shopper**
8
+ The headline: create **one shopper**
4
9
  ([`../references/brainstorm_interview.md`](../references/brainstorm_interview.md) →
5
- [`../references/agent_creation_engine.md`](../references/agent_creation_engine.md)),
6
- then shop **two unrelated niches in the same session** — the second **minted on
7
- the fly** — with a **shared fact reused across both** and **per-domain taste that
8
- does not leak**. The transcript is illustrative — it shows the *shape*, the gates,
9
- and the SDS layering, not exact wording.
10
+ [`../references/agent_creation_engine.md`](../references/agent_creation_engine.md)), then
11
+ shop **two unrelated niches in the same session** — the second **minted on the fly** —
12
+ with a **shared fact reused across both** and **per-domain taste that does not leak**. It
13
+ shows the shape and the gates, not exact wording; the machinery lives in the references.
10
14
 
11
- ## Onboarding — two touchpoints, NO niche research
15
+ ## Onboarding — two touchpoints, no niche research
12
16
 
13
17
  > **User:** "Set up something that shops for me."
14
18
 
15
- The shopper is a **generalist** — onboarding touches only the persona and the
16
- shared user spec; it researches **no** niche.
17
-
18
- **1. `SOUL.md` — ask first (persona; a generalist, NOT a niche).**
19
-
20
- > **Shopper:** "Let's set up your shopper. How do you want it to behave?"
21
- > **User:** "Be concise and a bit opinionated — and never recommend anything with
22
- > leather, it's an ethics thing for me."
23
-
24
- → Persona (→ host **`SOUL.md`**): *concise, lightly opinionated generalist.* No
25
- niche is chosen — it will shop whatever the user buys.
26
-
27
- **2. `user_spec.md` (shared) — seed the cross-niche facts + hard constraints.**
19
+ A **generalist** — onboarding touches only the persona and the shared user spec, no niche.
28
20
 
21
+ > **Shopper:** "How do you want it to behave?"
22
+ > **User:** "Concise and a bit opinionated — never recommend anything with leather, it's
23
+ > an ethics thing."
29
24
  > **Shopper:** "Anything I should always know — sizes, where to ship, hard rules?"
30
- > **User:** "Ship to 12 Rue Centrale, Lyon, France. And the no-leather rule is
31
- > absolute."
32
-
33
- → Seeded partial **shared `userSpec`** (→ `user_spec.md`): *ship-to Lyon, France
34
- (soft fact); **HARD-NO: leather** (inviolable, carries across every niche).* The
35
- rest is augmented per query.
25
+ > **User:** "Ship to 12 Rue Centrale, Lyon, France. The no-leather rule is absolute."
36
26
 
37
- ## Assemble + endorse — the gate
27
+ → persona (→ host `SOUL.md`): *concise, lightly opinionated generalist.* Shared
28
+ `userSpec`: *ship-to Lyon (soft fact); **HARD-NO: leather** (inviolable, carries across
29
+ every niche).*
38
30
 
39
- Identity confirmed (`my-shopper` / "My Shopper"), the assembled draft splits across
40
- the two stores — `agentId` + `persona` drive the host wiring (`openclaw agents add`
41
- + `SOUL.md`); `name` + the **shared user spec only** feed the singleton
42
- `sil_profile_materialize` **create** (no `agentId`, no domain pack at create):
31
+ ## Assemble + endorse
43
32
 
44
33
  ```jsonc
45
34
  {
46
- "agentId": "my-shopper",
47
- "name": "My Shopper",
35
+ "agentId": "my-shopper", "name": "My Shopper",
48
36
  "persona": "A concise, lightly opinionated generalist shopper.",
49
- "userSpec": "## Shared user spec (seeded partial)\n### Soft facts\n- Ship-to: 12 Rue Centrale, Lyon, France.\n### Hard constraints (INVIOLABLE — every niche)\n- HARD-NO: leather (ethics)."
37
+ "userSpec": "### Soft facts\n- Ship-to: 12 Rue Centrale, Lyon, France.\n### Hard constraints (INVIOLABLE — every niche)\n- HARD-NO: leather (ethics)."
50
38
  }
51
39
  ```
52
40
 
53
- > **Shopper:** "Here's your shopper — shall I create it?"
54
- > **User:** "Yes, create it."
41
+ > **Shopper:** "Here's your shopper — shall I create it?" **User:** "Yes, create it."
55
42
 
56
- **This affirmative act is the gate** — up to here, **zero engine steps ran**. Only
57
- now does the engine proceed
58
- ([`../references/agent_creation_engine.md`](../references/agent_creation_engine.md)):
59
- validate-first → singleton check → `openclaw agents add my-shopper --workspace
60
- ~/.openclaw/workspace-my-shopper --non-interactive --json` (confirm the inherited
61
- profile grants a web tool) → write the persona into `SOUL.md` →
62
- `sil_profile_materialize { name, userSpec }` **(NO `domain` — writes the shared
63
- `user_spec.md` + `profile.json` with an empty `domains: {}`)** → wire sil:
64
-
65
- ```
66
- openclaw config set 'agents.list[<i>].skills' '["sil"]' --strict-json
67
- openclaw config set plugins.entries.sil.enabled true --strict-json
68
- ```
69
-
70
- → then **admit sil at the host allow surfaces** so the `sil_*` tools are un-filtered
71
- — the shipped helper does the additive, idempotent merge of `plugins.allow` +
72
- `tools.alsoAllow` (never clobbering another admitted plugin like `klodi`):
73
-
74
- ```
75
- sil-openclaw-allowlist
76
- ```
77
-
78
- → `openclaw config validate --json` returns valid → **`created`** (a non-zero
79
- helper exit would be `persistence_failed`, not `created` — never a green shopper
80
- over still-filtered tools). The shopper now exists with an **empty `domains` map** —
81
- healthy; it will mint each niche on first shop.
43
+ **This affirmative act is the gate** — up to here, zero engine steps ran. Only now does
44
+ the engine run — `openclaw agents add my-shopper …` → persona into `SOUL.md` →
45
+ `sil_profile_materialize { name, userSpec }` (no `domain`; writes the shared
46
+ `user_spec.md` + an empty `domains: {}`) → wire + admit sil → validate → **`created`**,
47
+ with an **empty `domains` map** (healthy; each niche mints on first shop).
82
48
 
83
49
  ## Niche A — road cycling (minted on the fly, announced)
84
50
 
85
51
  > **User:** "Find me a first road bike, around €1500."
86
52
 
87
- The shop loop ([`../references/shop_loop.md`](../references/shop_loop.md) owns the
88
- machinery — not repeated here) classifies the niche (**road cycling**), reads
89
- `profile.json.domains`, finds **no** matching domain, and **mints it on the spot —
90
- announced**:
91
-
92
- > **Shopper:** "I haven't shopped cycling for you yet — setting that up now (road
93
- > cycling, first bike). One sec while I do the homework."
53
+ The shop loop classifies the niche (**road cycling**), finds no match, and **mints it on
54
+ the spot — announced** ("I haven't shopped cycling for you yet — setting that up"). It
55
+ researches a deep `domainSpec` (fit is everything; geometry; gearing; material/wheel
56
+ trade-offs), derives the `intentSpec`, seeds a partial `playbook`, and persists with the
57
+ whole-doc `sil_profile_materialize` carrying `domain.slug: "road-cycling"`. It recommends
58
+ with a **"why" that cites the layers** — "for a first bike **fit/comfort outrank outright
59
+ speed** (a domain mechanic), a 54 cm endurance frame fits, kept within your value budget;
60
+ **no leather anywhere** (your standing hard rule)."
94
61
 
95
- It **researches** the niche deeply (the deep `domainSpec` — the full how-to-buy:
96
- **fit is everything** — frame size from height *and* inseam, stack/reach, saddle
97
- setback, crank length; geometry; gearing theory; material/wheel trade-offs),
98
- derives the `intentSpec` dimensions, seeds a partial `playbook`, then persists with
99
- the **whole-doc** mint:
100
-
101
- ```jsonc
102
- sil_profile_materialize {
103
- name: "My Shopper",
104
- userSpec: "…the current shared spec (re-persisted)…",
105
- domain: {
106
- slug: "road-cycling", name: "Road cycling",
107
- domainSpec: "## First road bike — how to buy well (deep)\nFit is everything: size from height AND inseam; stack/reach set torso angle; saddle setback from KOPS; crank length scales with inseam…\n## Geometry: endurance vs race. ## Gearing: gear-inches, compact vs mid-compact. ## Material/wheels: alloy vs carbon; rim depth vs crosswind.",
108
- intentSpec: "## Dimensions (schema)\nuse-case; terrain; budget band; fit envelope; timeline; compatibility; performance priorities; aesthetics.",
109
- playbook: "## Buying taste (seeded partial)\nTo be learned as we shop."
110
- }
111
- }
112
- ```
113
-
114
- Then the loop runs on the active **road-cycling** domain: decompose the intent
115
- (first bike, ~€1500), map → `sil_search` → compare on the rubric, and recommend
116
- with a **"why" that cites the layers** — "for a first bike **fit/comfort outrank
117
- outright speed** (a domain mechanic), a 54 cm endurance frame sits right, and I kept
118
- it within your value budget; **no leather anywhere** (your standing hard rule)." A
119
- rationale naming no domain mechanic and reusing no stored fact would **fail the SDS
120
- bar** even if the bike were fine.
121
-
122
- The session surfaces a **taste**, captured the **cheap** way — one append, scoped to
123
- this domain:
62
+ A taste surfaces, captured the cheap way — one append, scoped to this domain:
124
63
 
125
64
  > **User:** "I don't chase brands — value over name."
126
65
 
@@ -128,30 +67,24 @@ this domain:
128
67
  sil_remember { kind: "taste", text: "Value over brand; ~€1500 band.", domain: "road-cycling" }
129
68
  ```
130
69
 
131
- That taste lands in **`domains/road-cycling/playbook.md`** — this niche only.
132
-
133
- ## Niche B — espresso (a SECOND niche, same session, no switch)
134
-
135
- Moments later, **same session, no agent switch, no re-onboarding**:
70
+ → lands in `domains/road-cycling/playbook.md` only.
136
71
 
137
- > **User:** "Different thing — I want a home espresso machine, decent but not crazy."
72
+ ## Niche B — espresso (a second niche, same session, no switch)
138
73
 
139
- The loop classifies the niche (**espresso**), reads `profile.json.domains`, finds
140
- no match, and **mints espresso on the fly — announced** ("new niche for me —
141
- setting up espresso") with its own deep `domainSpec` (boiler type, PID, pressure
142
- profiling, portafilter size, grinder pairing), `intentSpec`, and partial `playbook`,
143
- via a second whole-doc `sil_profile_materialize` with `domain.slug: "espresso"`.
74
+ > **User:** "Different thing — a home espresso machine, decent but not crazy."
144
75
 
145
- **The shared fact carries — without being re-asked:**
76
+ Same session, **no agent switch, no re-onboarding**. The loop classifies **espresso**,
77
+ finds no match, and **mints espresso on the fly — announced**, with its own deep
78
+ `domainSpec` (boiler type, PID, pressure profiling, grinder pairing) via a second
79
+ whole-doc `sil_profile_materialize` (`domain.slug: "espresso"`).
146
80
 
147
- > **Shopper:** "I'll ship to your Lyon address as usual" — **the ship-to from the
148
- > shared `user_spec.md`, captured during onboarding, reused in espresso with no
149
- > re-ask.** The **no-leather hard rule** also still applies (it rejects a
150
- > leather-wrapped tamper handle outright).
81
+ **The shared fact carries — without being re-asked:** the ship-to from the shared
82
+ `user_spec.md` is reused in espresso with **no re-ask** ("I'll ship to your Lyon address
83
+ as usual"), and the no-leather hard rule still rejects a leather-wrapped tamper handle.
151
84
 
152
- **The niche taste does NOT leak:** the *value-over-brand, ~€1500* taste lives in
153
- `domains/road-cycling/playbook.md` and **does not shape** the espresso picks —
154
- espresso starts with its own (partial) taste, learned fresh:
85
+ **The niche taste does not leak:** the *value-over-brand* taste lives in
86
+ `domains/road-cycling/playbook.md` and does not shape the espresso picks — espresso learns
87
+ its own:
155
88
 
156
89
  > **User:** "For coffee I'll happily pay for a known reliable brand."
157
90
 
@@ -159,32 +92,27 @@ espresso starts with its own (partial) taste, learned fresh:
159
92
  sil_remember { kind: "taste", text: "Pays up for a reliable known brand.", domain: "espresso" }
160
93
  ```
161
94
 
162
- → lands in **`domains/espresso/playbook.md`** only. Road cycling's "value over
163
- brand" and espresso's "pay for a known brand" coexist **without contradiction** —
164
- that is per-domain taste isolation. A **fact** (a new measurement, a hard rule) would
165
- instead go to the **shared** `user_spec.md` (`kind: "fact"`) and carry to *both*
166
- niches.
95
+ → `domains/espresso/playbook.md` only. The two tastes coexist without contradiction —
96
+ per-domain taste isolation. A **fact** would instead go to the shared `user_spec.md`
97
+ (`kind: "fact"`) and carry to *both* niches.
167
98
 
168
99
  ## The singleton edge — refuse a second shopper
169
100
 
170
101
  > **User:** "Can you make me a second shopper just for coffee?"
171
- > **Shopper:** "You already have a shopper — it handles every niche. I've added
172
- > espresso as a domain on it; I won't create a second shopper. Want me to refine
173
- > the espresso domain instead?"
102
+ > **Shopper:** "You already have a shopper — it handles every niche. I've added espresso
103
+ > as a domain; I won't create a second. Want me to refine the espresso domain instead?"
174
104
 
175
105
  The engine's **singleton refusal** (`collision`, "a shopper already exists") — one
176
- shopper, many domains; you never mint a second.
106
+ shopper, many domains.
177
107
 
178
108
  ## Edge cases this example would have handled
179
109
 
180
- - **Reuse before mint** — asking for "another road bike, this time for winter" reuses
181
- the **existing `road-cycling` domain** (semantic dedup), never mints a near-duplicate
182
- `cycling` / `bikes` pack.
110
+ - **Reuse before mint** — "another road bike, for winter" reuses the existing
111
+ `road-cycling` domain (semantic dedup), never a near-duplicate pack.
183
112
  - **Forget one domain ≠ decommission the shopper** — "forget espresso" runs
184
- `sil_profile_remove { domainSlug: "espresso" }` (artefact-only; the shopper,
185
- the shared user spec, and the road-cycling domain survive). Tearing down the whole
186
- shopper is the separate host-CLI-first path.
187
- - **No web tool**: the shopper says so honestly at mint time and composes the domain
188
- spec from public buying knowledge — never pretends the research happened.
189
- - **Creation is local + offline** (for identity): no sil registration to create; the
190
- user registers later, on first shop, via `sil_register`.
113
+ `sil_profile_remove { domainSlug: "espresso" }`; the shopper, shared user spec, and
114
+ road-cycling domain survive.
115
+ - **No web tool** — the shopper says so honestly at mint time and composes from public
116
+ knowledge, never pretending the research happened.
117
+ - **Creation is local + offline** — no sil registration to create; the user registers
118
+ later, on first shop.
@@ -1,90 +1,139 @@
1
- # Create your sil-wired shopper — the agent-creation engine
1
+ ---
2
+ name: agent-creation-engine
3
+ description: The ordered, one-command engine that persists the single sil-wired shopper after the user endorses the assembled draft. Load only after explicit endorsement in the interview.
4
+ ---
2
5
 
3
- **Precondition: run this ONLY after the user has explicitly endorsed the assembled draft from [`brainstorm_interview.md`](brainstorm_interview.md).** Anything below before that endorsement is forbidden — the interview owns the gate.
6
+ # Create your sil-wired shopper — the agent-creation engine
4
7
 
5
- When the user wants to **set up shopping**, author and persist **one** valid OpenClaw agent profile — the user's **shopper**: a real new agent under the host `agents` config, with the **sil plugin enabled**, the **sil skill attached**, its persona written into the workspace **`SOUL.md`**, plus the shopper's **shared user spec** in the sil data directory — so it shops with **no further setup**. The shopper is a **singleton**: you create it **once**, then it learns **domains** (niches) lazily on first shop — you never mint a second shopper.
8
+ **Precondition: run this ONLY after the user has explicitly endorsed the assembled draft
9
+ from [`brainstorm_interview.md`](brainstorm_interview.md).** The interview owns that gate.
6
10
 
7
- The shopper runs **entirely on Spec-Driven Shopping (SDS)** — the operating model, not an optional layer. At create time exactly **one** sil artefact is persisted: the **shared, agent-level `userSpec`** (the person's cross-niche facts + hard constraints, seeded *partial* by the interview). **No** niche is researched and **no** per-domain pack is written at create time — there is **no** `domainSpec` / `intentSpec` / `playbook` here. Those are minted **lazily, per niche, on first shop** ([`shop_loop.md`](shop_loop.md)) into `domains/<slug>/`. A freshly-created shopper has an **empty `domains` map** — that is **healthy**, not a deficiency.
11
+ This persists **one** valid OpenClaw agent — the user's **shopper**: a real agent under
12
+ the host `agents` config, sil plugin enabled, sil skill attached, its persona in the
13
+ workspace **`SOUL.md`**, plus the **shared user spec** in the sil data dir — so it shops
14
+ with **no further setup**. The shopper is a **singleton**: created once, then it learns
15
+ **domains** lazily on first shop, so a fresh shopper has an **empty `domains` map** —
16
+ healthy. Creation is **local and offline**: no token is read, no `sil_register` /
17
+ `sil_whoami`, no network call. The shopper registers the user later, on first shop.
8
18
 
9
19
  ## The one command
10
20
 
11
- After the explicit endorsement, you run exactly **ONE** shipped command — the package `bin` **`sil-openclaw-create-shopper`** — and it runs the whole choreography **atomically** and fail-closed. You do **NOT** hand-run the nine host-CLI steps yourself; the bin runs them **for you, in order, as one transaction**, then returns a single structured JSON result. Feed it the endorsed spec as **one JSON object on `stdin`** (or via **`--spec <path>`**):
21
+ After the endorsement, run exactly **one** shipped command — the package bin
22
+ **`sil-openclaw-create-shopper`** — and it runs the whole choreography **atomically** and
23
+ **fail-closed**, then returns one structured JSON result. You do **not** hand-run the
24
+ host-CLI steps; the bin runs them **for you, in order, as one transaction**. Feed it the
25
+ endorsed spec as one JSON object on **`stdin`** (or via **`--spec <path>`**):
12
26
 
13
27
  ```
14
28
  sil-openclaw-create-shopper <<'JSON'
15
- { "agentId": "my-shopper", "name": "My Shopper", "workspace": "~/.openclaw/workspace-my-shopper",
16
- "persona": "…the endorsed persona…", "userSpec": "…the seeded shared user spec…" }
29
+ { "agentId": "my-shopper", "name": "My Shopper",
30
+ "workspace": "~/.openclaw/workspace-my-shopper",
31
+ "persona": "…the endorsed persona…", "userSpec": "…the seeded shared user spec…",
32
+ "channel": "telegram" }
17
33
  JSON
18
34
  ```
19
35
 
20
- Passing the multiline `persona` / `userSpec` as JSON dodges shell-arg escaping. The bin is **non-interactive**: it executes an **already-assembled, already-endorsed** spec — it never re-runs the interview and never prompts (the endorsement gate lives upstream in the interview; the bin's own validate-first + singleton pre-flight still protect a direct caller). Creation is **local and offline** — the bin reads **no token**, performs **no** `sil_register` / `sil_whoami`, and makes **no network call**. The `sil` **plugin** and `sil` **skill** are always wired (that is what makes it *sil-wired*). Do **not** present sil registration as a prerequisite — the shopper registers the user later, on first shop, via `sil_register`.
21
-
22
- > The bin is a standalone operator script (the same class as the other shipped `sil-openclaw` operator bins), **not** the plugin process — so the plugin's `noChildProcess` / "never write host config" guarantee is intact; the bin legitimately drives the host `openclaw …` CLI on your behalf.
36
+ The bin is **non-interactive**: it executes an **already-assembled, already-endorsed**
37
+ spec — it **never re-runs the interview** and never prompts. The sil **plugin** and sil
38
+ **skill** are always wired — that is what makes it *sil-wired*. It is a standalone
39
+ operator script, **not** the plugin process, so the plugin's "never write host config"
40
+ guarantee holds; the bin legitimately drives `openclaw …` on your behalf.
23
41
 
24
- ## The profile spec (input) — the JSON the bin reads
25
-
26
- The endorsed draft feeds two stores. The **persona** becomes the host workspace **`SOUL.md`** (its identity / voice / standing rules — via the host CLI, **not** a sil artefact). The **shared user spec** becomes the sil data-dir artefact:
42
+ ## The spec (input)
27
43
 
28
44
  | Field | Meaning | Goes to | Required? |
29
45
  |---|---|---|---|
30
- | **agentId** | Lower-kebab id (e.g. `my-shopper`) → `agents.list[].id`. Unique, never `main`. | host | Required |
46
+ | **agentId** | Lower-kebab id → `agents.list[].id`. Unique, never `main`. | host | Required |
31
47
  | **name** | Human-readable name ("My Shopper"). | sil manifest | Required |
32
- | **persona** | Who this shopper is and how it shops — a generalist, voice/tone, standing rules. | host **`SOUL.md`** (via host CLI — no `persona.md`) | Required (non-empty) |
33
- | **workspace** | The shopper's workspace directory (e.g. `~/.openclaw/workspace-my-shopper`). | host | Required for the non-interactive add |
34
- | **userSpec** | The user's **shared, cross-niche** facts + hard constraints (addresses, sizes, allergy/ethics rules, budget psychology). **Seeded partial** by the interview, then augmented per-query. | sil `user_spec.md` | **Required (non-empty)** |
35
-
36
- There is **no** per-niche input at create time. The deep `domainSpec`, the derived `intentSpec` schema, and the niche `playbook` are **not** authored here — they are researched and minted on first shop in each niche.
37
-
38
- ## The created shopper needs WEB tools
39
-
40
- The shopper **lazily mints a domain on first shop** (its research pass reaches the web) and **web-refreshes each domain spec on every query**. So the created agent must have **web/fetch tools in its tool profile** — inherited from `agents.defaults` when its shell is created. If `agents.defaults` does **not** grant a web tool, the bin reports **`created` with a `warnings` entry** naming the gap (bare `sil_search` still works, so it does **not** hard-fail) — it never silently swallows the gap and never pretends the research happened. Surface that warning to the user.
41
-
42
- ## What the bin does atomically (the choreography it runs for you, in this exact order)
43
-
44
- 1. **Validates the spec FIRST — before anything is written.** It checks `agentId` (present, lower-kebab, ≠ `main`), `name`, `persona`, `workspace`, and the **shared `userSpec` — present and non-blank** (the only sil artefact at create; seeded *partial* by the interview, never omitted). There is **no** `domainSpec` / `intentSpec` / `playbook` to validate here. On any failure it stops with **`invalid_request`** naming the field and **writes nothing**. This runs ahead of every host command, so a bad spec never reaches the host.
45
-
46
- 2. **Singleton check — a user has exactly ONE shopper.** The bin runs `openclaw agents list --json` and reads the sil artefact store (the no-args `sil_profile_get` overview, `ok` empty-is-healthy when no shopper exists) **before** the add; if a sil shopper **already exists**, it stops with **`collision`** — **"a shopper already exists"** — and **does not** run `openclaw agents add`. That steers the user to **shop a new niche** (which lazily mints a domain on the spot) or **refine the existing shopper** — **never mint a second shopper**. An `agentId` that collides with any existing agent is likewise refused (`collision`) — never overwriting an existing agent's persona or wiring. If either read is **inconclusive** (a CLI error, a degraded store), the bin fails closed rather than fabricate a "no shopper" verdict.
47
-
48
- 3. **Creates the agent shell (host CLI).** It runs:
49
- ```
50
- openclaw agents add <agentId> --workspace <workspace> --non-interactive --json
51
- ```
52
- This creates the real `agents.list[]` entry and the workspace bootstrap files (`SOUL.md`, `AGENTS.md`, …), inheriting model and **tool profile** (which must grant **web/fetch** — see above) from `agents.defaults`. `--non-interactive --json` drives it without a prompt.
53
-
54
- 4. **Writes the persona into the workspace `SOUL.md` (host CLI).** The persona is the shopper's soul / system framing — the host's `SOUL.md`, **not** a sil artefact. The bin writes the endorsed persona text **straight into** the new agent's `SOUL.md`. There is **no** `persona.md` in the sil store and **no copy** step — the persona lives in exactly one place.
55
-
56
- 5. **Materializes the shared user spec — NO `domain`.** The bin calls **`sil_profile_materialize`** with **`{ name, userSpec }`** — the shared `userSpec` seeded by the interview. The shopper is a singleton, so this takes **no `agentId`**. **With no `domain`** at create, the tool writes the shared **`user_spec.md`** + **`profile.json`** (with an **empty `domains: {}` map**) into the fixed **`$SIL_DATA_DIR/shopper/`**, atomically. There is **no** `domain_spec.md` / `intent_spec.md` / `playbook.md` yet — the first shop in a niche mints that niche's pack (with a `domain` object) lazily. On `invalid_request` it wrote nothing; on `persistence_failed` it left nothing partial.
57
-
58
- 6. **Wires the sil skill + plugin (host CLI).** Asserted against the pinned host — **`alpine/openclaw:2026.6.9`** — both value-mode sets with `--strict-json` (the only set mode this image accepts):
48
+ | **persona** | Who the shopper is / how it shops — a generalist, voice, standing rules. | host **`SOUL.md`** (no `persona.md`) | Required |
49
+ | **workspace** | The shopper's workspace directory. | host | Required |
50
+ | **userSpec** | The user's **shared, cross-niche** facts + hard constraints. Seeded partial by the interview. | sil `user_spec.md` | **Required** |
51
+ | **channel** | The channel the setup conversation is on — bound to the new shopper. | host `openclaw.json` bindings | **Optional (fail-open)** |
52
+
53
+ There is **no per-niche input at create** — no `domainSpec` / `intentSpec` / `playbook`;
54
+ those are minted lazily on first shop. The shopper reaches the web to mint and refresh
55
+ domains, so the agent needs web/fetch tools (inherited from `agents.defaults`); if
56
+ defaults grant none, the bin reports `created` with a `warnings` entry naming the gap
57
+ (bare `sil_search` still works) — surface it.
58
+
59
+ ## What the bin does atomically (in this exact order)
60
+
61
+ 1. **Validate the spec FIRST** — `agentId` (present, lower-kebab, ≠ `main`), `name`,
62
+ `persona`, `workspace`, and the shared **`userSpec`** (present, non-blank — the only
63
+ sil artefact at create). No `domainSpec` / `intentSpec` / `playbook` to validate. Any
64
+ failure stops with **`invalid_request`** naming the field and **writes nothing**, ahead
65
+ of every host command.
66
+ 2. **Singleton check.** Run `openclaw agents list --json` and read the sil store (the
67
+ no-args `sil_profile_get` overview) **before** the add. If a sil shopper already
68
+ exists, stop with **`collision`** — **"a shopper already exists"** — and do **not** run
69
+ `openclaw agents add`; steer to shop-a-new-niche (lazy mint) or refine — **never mint a
70
+ second shopper**. An `agentId` clashing with any existing agent is likewise
71
+ `collision`. An inconclusive read fails closed.
72
+ 3. **Create the agent shell.** `openclaw agents add <agentId> --workspace <workspace>
73
+ --non-interactive --json` — the real `agents.list[]` entry + workspace bootstrap
74
+ (`SOUL.md`, `AGENTS.md`, …), inheriting model and tool profile from `agents.defaults`.
75
+ 4. **Write the persona straight into the workspace `SOUL.md`** (host CLI). The persona is
76
+ the shopper's soul — the host's `SOUL.md`, not a sil artefact. There is **no**
77
+ `persona.md` and **no copy** step.
78
+ 5. **Materialize the shared user spec — NO `domain`.** Call `sil_profile_materialize {
79
+ name, userSpec }` (the singleton takes no `agentId`). With no `domain`, it writes the
80
+ shared **`user_spec.md`** + **`profile.json`** with an **empty `domains: {}` map** into
81
+ `$SIL_DATA_DIR/shopper/`, atomically. No `domain_spec.md` / `intent_spec.md` /
82
+ `playbook.md` yet.
83
+ 6. **Wire the sil skill + plugin** (host CLI). Asserted against the pinned host
84
+ **`alpine/openclaw:2026.6.9`**, both value-mode sets with `--strict-json` (the only set
85
+ mode this image accepts):
59
86
  ```
60
87
  openclaw config set 'agents.list[<i>].skills' '["sil"]' --strict-json
61
88
  openclaw config set plugins.entries.sil.enabled true --strict-json
62
89
  ```
63
- The skill **attach** makes the agent **know how** to drive the tools; the plugin **enable** turns the sil plugin **on** — but it does **not** by itself un-filter the `sil_*` tools (see the admission step next). `sil` stays in the agent's skill list and the `sil_*` tools are not denied.
64
-
65
- 7. **Admits sil at the host allow surfaces — the shipped helper.** Enabling the plugin is necessary but not sufficient: until `sil` is admitted at the **global** allow surfaces `plugins.allow` + **`tools.alsoAllow`**, the host keeps the `sil_*` tools **filtered**. Admission is **plugin-ID only** — no per-tool key. The value-mode `openclaw config set` above is **overwrite-only** on this image, so it cannot additively merge those shared global arrays without clobbering another already-admitted plugin (e.g. `klodi`). The bin therefore runs the shipped admission helper — the sibling package `bin` `sil-openclaw-allowlist` (same artefact as the `openclaw:allowlist` script) — which performs the **additive, idempotent, atomic, self-validating** three-surface merge (`plugins.allow` + `tools.alsoAllow` + `plugins.entries.sil`). **If the helper exits non-zero (a failed admission), the bin reports `persistence_failed` with the path + cause and does NOT declare `created`** — never a green `created` over still-filtered tools.
66
-
67
- 8. **Validates with the host's OWN check, THEN declares created.** The bin runs `openclaw config validate --json`. The verdict is `{ valid, path, issues? }` — success keys off **`.valid`**, never an `ok` field. Only when `valid: true` **and** the admission (step 7) succeeded does it report **`created`**. If `valid: false`, the admission helper exited non-zero, or any step failed, it reports **`persistence_failed`** with the failing **path** + **cause** (the `issues?`).
68
-
69
- 9. **On any failure after writes begin, tears down — leaving nothing partial.** The bin snapshots `openclaw.json` before step 3 and, on any failure, **restores that whole-file snapshot** (reversing the `agents.list` entry + the skill + the plugin + the trust admission in one atomic op), then removes the workspace dir (only if it created it) and the singleton shopper dir (only if it did not pre-exist). This returns the host to its **exact pre-run state** — a co-installed `klodi` that was trusted pre-run stays trusted — so `persistence_failed` truthfully means **nothing partial** is left.
70
-
71
- The bin emits **one** `{ status, … }` JSON result and exits 0 **only** on `created`.
72
-
73
- ## Status taxonomy (agent-creation engine)
90
+ The skill **attach** makes the agent know how to drive the tools; the plugin **enable**
91
+ turns sil on — but does not un-filter the tools by itself (next step).
92
+ 7. **Admit sil at the host allow surfaces.** Until sil is admitted at `plugins.allow` +
93
+ **`tools.alsoAllow`**, the host keeps the `sil_*` tools filtered. The value-mode `config
94
+ set` above is overwrite-only, so it cannot additively merge those shared arrays without
95
+ clobbering another admitted plugin (e.g. `klodi`). The bin runs the shipped admission
96
+ helper — the sibling bin `sil-openclaw-allowlist` (the `openclaw:allowlist` script) —
97
+ the additive, idempotent, self-validating three-surface merge. **If the helper exits
98
+ non-zero (a failed admission), the bin reports `persistence_failed` with the path +
99
+ cause and does NOT declare `created`** — never a green `created` over filtered tools.
100
+ 8. **Bind the current channel — FAIL-OPEN.** Resolve the channel (`spec.channel`, else the
101
+ host's `OPENCLAW_MCP_MESSAGE_CHANNEL`) and, if one resolves, run `openclaw agents bind
102
+ --agent <agentId> --bind <channel> --json`, then **verify** the route stuck (read-back +
103
+ `openclaw config validate` still passes). If undetermined, owned by another agent (no
104
+ `--force`), or unverifiable, revert any partial route and degrade to a manual-bind hint
105
+ in `warnings` — this step **never fails creation**.
106
+ 9. **Validate with the host's own check, THEN declare created.** `openclaw config validate
107
+ --json` returns `{ valid, path, issues? }` — success keys off **`.valid`**, never an
108
+ `ok` field. Only when `valid: true` **and** admission (step 7) succeeded does it report
109
+ **`created`**, carrying `boundChannel` (or `null`). Otherwise it reports
110
+ **`persistence_failed`** with the failing **path** + **cause**.
111
+ 10. **On any failure after writes begin, tear down** — restore the pre-run `openclaw.json`
112
+ snapshot (reversing the agent entry + skill + plugin + admission + any channel
113
+ binding), remove the workspace dir (only if it created it) and the singleton shopper
114
+ dir (only if it did not pre-exist). `persistence_failed` truthfully means **nothing
115
+ partial** is left. In the rare case teardown cannot fully revert, the bin reports a
116
+ distinct, louder outcome that **names the residue** — never voiced as "nothing partial".
117
+
118
+ The bin emits **one** `{ status, … }` result and exits 0 **only** on `created`.
119
+
120
+ ## Status taxonomy
74
121
 
75
122
  | `status` | Meaning | What to do |
76
123
  |---|---|---|
77
- | `created` | Shopper added, shared user spec materialized, sil plugin + skill wired, `openclaw config validate` accepted it. Carries `name` + `agentId` + `workspace`. | Tell the user it's ready and how to open it. |
78
- | `invalid_request` | Spec failed validation (missing/blank field). **Nothing attempted.** | Name the field, fix it, run the command again — nothing reached `openclaw agents add`. |
79
- | `collision` | A shopper already exists (the singleton), or the `agentId` clashes. **Nothing written.** | Surface it — "a shopper already exists"; steer to shop-a-new-niche (lazy mint) or refine. **Never mint a second shopper.** |
80
- | `persistence_failed` | A write, the allow-list admission helper (non-zero exit), or `openclaw config validate` step failed. Teardown ran — **nothing partial** left. | Fix the reported path/cause, run the command again (a re-run is safe). |
81
-
82
- In the **rare** case teardown itself cannot fully revert (e.g. the agent was added but reverting it fails), the bin reports a **distinct, louder** outcome that **names the residue** — do **not** voice that as `persistence_failed`'s "nothing partial"; tell the user exactly what remains and where.
124
+ | `created` | Shopper added, shared user spec materialized, plugin + skill wired, `openclaw config validate` accepted it. Carries `name` + `agentId` + `workspace` + `boundChannel` (or `null`). | Tell the user it's ready; if `boundChannel` is `null`, relay the manual-bind hint. |
125
+ | `invalid_request` | Spec failed validation. **Nothing attempted.** | Name the field, fix it, run again. |
126
+ | `collision` | A shopper already exists (the singleton), or the `agentId` clashes. **Nothing written.** | Surface "a shopper already exists"; steer to shop-a-new-niche or refine. **Never a second shopper.** |
127
+ | `persistence_failed` | A write, the allow-list helper (non-zero exit), or `openclaw config validate` failed. Teardown ran — **nothing partial** left. | Fix the reported path/cause and re-run (safe). |
83
128
 
84
129
  ## Runtime — how the shopper loads its behaviour
85
130
 
86
- When you (the sil skill) start a session as the shopper, the host has already injected the persona via the workspace **`SOUL.md`**. Then read `$SIL_DATA_DIR/shopper/profile.json` and load:
87
- - the **shared `user_spec.md`** — the person's cross-niche facts + hard constraints (seeded partial, augmented per-query), reused across **every** niche;
88
- - the slug-keyed **`domains`** map — the niches the shopper has already learned. An **empty** map is healthy; the per-domain packs (`domains/<slug>/{domain_spec,intent_spec,playbook}.md`) load **lazily at shop time**, not here.
89
-
90
- Loading these is what lets the shopper shop any niche with no further setup. When the user states a shopping intent, shop per [`shop_loop.md`](shop_loop.md) — the loop that classifies the niche, **reuses an existing domain or mints one on the fly**, then on **every query** web-refreshes that domain's spec, decomposes the request along its intent-spec dimensions (the ephemeral per-query intent), and **learns** every query (a fact → the shared `user_spec.md`, a taste → the active domain's `playbook.md`, each via a single `sil_remember` append). Because the `sil_*` tools were admitted at create, the shopper calls **`sil_search`** / **`sil_product_get`** (and `sil_register` / `sil_whoami` as needed) on the user's intent with **no further setup**, minting each niche's domain pack on the fly the first time the user shops it. To sharpen the shopper or one of its domains from observed sessions, see [`refine_shopper.md`](refine_shopper.md).
131
+ When you (the sil skill) start a session as the shopper, the host has already injected the
132
+ persona via **`SOUL.md`**. Then read `$SIL_DATA_DIR/shopper/profile.json` and load the
133
+ shared **`user_spec.md`** (cross-niche facts + hard constraints, reused across every
134
+ niche) and the slug-keyed **`domains`** map — an empty map is healthy; the per-domain
135
+ packs load **lazily at shop time**. Because the `sil_*` tools were admitted at create, the
136
+ shopper calls **`sil_search`** / **`sil_product_get`** (and `sil_register` / `sil_whoami`
137
+ as needed) with **no further setup**, minting each niche on the fly the first time the
138
+ user shops it, per [`shop_loop.md`](shop_loop.md). To sharpen the shopper or a domain, see
139
+ [`refine_shopper.md`](refine_shopper.md).