sil-openclaw 0.4.0 → 0.4.1

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.
package/CHANGELOG.md CHANGED
@@ -10,6 +10,70 @@ release (`clawhub package publish --changelog`). See [README](./README.md#releas
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.4.1] - 2026-07-14
14
+
15
+ ### Fixed
16
+
17
+ - **First shop now reliably mints its domain.** A buy-intent in an unlearned niche
18
+ used to stall silently — the model classified the miss, found nothing to reuse,
19
+ and, with no next move in hand, answered off the open web instead of minting the
20
+ domain and shopping the sil catalog. The mint trigger is now **structural**:
21
+ `sil_profile_search` returns `next_step: "mint_domain"` (plus `guidance`) whenever
22
+ no learned domain matches (an empty store OR a filtered miss on a populated one),
23
+ so the MISS itself points at the mint — the same way the catalog tools carry
24
+ `recovery`. The always-on `SKILL.md` contract now states the rule up front
25
+ (mint-first-on-buy-intent; the picks are always sil catalog products, never
26
+ open-web results — the web only researches the method), instead of burying it two
27
+ lazy reference-hops deep.
28
+ - **Onboarding read the wrong tool for shopper state.** `setup_onboarding.md` steered
29
+ the model to a no-arg `sil_profile_get` overview, but `sil_profile_get` *requires* a
30
+ `domainSlug` — the coordinates-only overview tool is `sil_profile_search`. All stage
31
+ reads now use `sil_whoami` + `sil_profile_search`.
32
+
33
+ ### Changed
34
+
35
+ - **The shopper's soul carries the sil creed.** Every new shopper's `SOUL.md` gets a
36
+ "The sil way" block appended after its persona — a creed, not a rulebook: the mantra
37
+ (*explore first*), the loop in three lines (learn the domain → know the person → find
38
+ the thing), and the one distinction that matters — **the sil catalog is where you buy;
39
+ the open web is where you learn**. The method lives in the skill; the philosophy lives
40
+ in the soul, where the model weights identity.
41
+ - **The skill bundle is leaner.** The whole `sil-shopping/` bundle (router + references +
42
+ example) was cut to its load-bearing contract — narration, hedging, and cross-section
43
+ restatement removed. The 1341-line `skill-content.test.ts`, which pinned prose clauses
44
+ as spec (and stayed green while the mint bug was live), is deleted and replaced by a
45
+ lean behavioral guard that pins the contract: frontmatter + name-agreement, the
46
+ registered tool set appearing in the bundle, cross-link integrity, no dead tokens, and
47
+ the mint-first / catalog-of-record rule.
48
+ - **The shopper is denied the shell + file-write escape hatches.** `create-shopper.mjs`
49
+ now sets `agents.list[<idx>].tools.deny = ["exec","write","edit","apply_patch"]` (a
50
+ per-agent deny, never a global host change) so a new shopper can no longer run a shell
51
+ (`exec` — which it wasted re-reading its own skill files) or mutate host files
52
+ (`write`/`edit`/`apply_patch` — which it used to persist shopping memory into the host
53
+ workspace instead of the sil store). `deny` is used deliberately over a `tools.profile`
54
+ override: per OpenClaw's tool-precedence model a deny only *further-restricts* and
55
+ cannot strip the sil grant, whereas a profile swap replaces the agent's base tool set
56
+ and would risk removing the sil tools entirely. The sil tools and web (for domain
57
+ research) are kept.
58
+ - **Minting is where the shopper explores; the catalog is where it buys.**
59
+ `method_and_prds.md`'s MINT step now encourages web research **freely and often** to
60
+ learn how a niche is really bought (its load-bearing attributes, failure modes, what
61
+ separates a good buy from a bad one) — that exploration is the point of a first shop.
62
+ The one boundary: the shopper researches the **domain** on the web, never the
63
+ **products** — recommended products always come from `sil_search`, and if the catalog's
64
+ results aren't satisfactory that is the answer, not an open-web fallback.
65
+ - **Consolidated the reference set.** Deleted `references/catalog_tools_reference.md` and
66
+ `references/search_param_mapping.md` — the per-tool behaviour, status taxonomy, and
67
+ search params they restated already live in the tool definitions. Merged
68
+ `references/brainstorm_interview.md` into `references/agent_creation_engine.md` so the
69
+ onboarding interview and the creation engine are one endorsement-gated "create the
70
+ shopper" doc.
71
+ - **Leaner tool descriptions.** The five `sil_profile_*` / `sil_learn` verbs and
72
+ `sil_specs` had their descriptions cut to their load-bearing core (the store rules
73
+ they restated are already enforced by the code and named by the per-field schema),
74
+ reducing the per-turn token cost. `sil_profile_search` now advertises its
75
+ `next_step: mint_domain` cue.
76
+
13
77
  ## [0.4.0] - 2026-07-13
14
78
 
15
79
  ### Changed
@@ -602,25 +602,15 @@ function registerSpecs(api) {
602
602
  api.registerTool({
603
603
  name: "sil_specs",
604
604
  label: "Canonicalize coined spec definitions",
605
- description: "Canonicalize the coined spec DEFINITIONS a shopping method invents for a"
606
- + " niche — the dedupe-or-create registry call at method mint/refresh (Beat 2)."
607
- + " Pass the motivating `query` (what the shopper is buying — governance /"
608
- + " dedupe context) and `specs`, a list of coined definitions ({ namespace,"
609
- + " key, display_name, data_type, description?, unit?, allowed_values? }). Each"
610
- + " submitted spec resolves 1:1: a `matched` result means an equivalent"
611
- + " canonical spec already exists — ADOPT its `canonical` { namespace, key }"
612
- + " and DROP your coined synonym (this convergence is what makes filters.specs"
613
- + " actually filter across methods); a `created` result means yours is novel and"
614
- + " registered as canonical (`canonical` === `submitted`, keep it). Rewrite the"
615
- + " method's `## Search vocabulary` and any PRD `specs` predicates to the"
616
- + " returned canonical names BEFORE persisting — the method is born canonical,"
617
- + " never write-then-amend. On REFRESH submit ONLY the specs that do not yet"
618
- + " carry a canonical name; already-canonical names are stable, do not resubmit"
619
- + " them. This is INTERNAL plumbing: never surface `ns.key` names or"
620
- + " \"converged your specs\" to the buyer. If the call is not `ok` (retryable /"
621
- + " forbidden / must_reregister), do NOT block the mint — persist the method"
622
- + " with the raw coined names and shop on; convergence retries on the next"
623
- + " mint/refresh. Requires registration (run sil_register first).",
605
+ description: "Canonicalize the coined spec DEFINITIONS a method invents for a niche — the"
606
+ + " dedupe-or-create registry call at method mint/refresh. Pass the motivating"
607
+ + " `query` and `specs` (coined { namespace, key, display_name, data_type,"
608
+ + " description?, unit?, allowed_values? }). Each resolves 1:1: `matched` → adopt"
609
+ + " the returned canonical { namespace, key } and drop your synonym; `created` →"
610
+ + " yours is novel, keep it. Rewrite the method's search vocabulary + any PRD"
611
+ + " predicates to the canonical names before persisting. Internal plumbing — never"
612
+ + " surface ns.key to the buyer. If not `ok`, do NOT block the mint: persist raw and"
613
+ + " converge on the next mint/refresh. Requires registration.",
624
614
  parameters: Type.Object({
625
615
  query: Type.String({
626
616
  description: "The motivating shopping query — what the shopper is buying. Governance /"
@@ -44,19 +44,13 @@ function registerMaterialize(api) {
44
44
  api.registerTool({
45
45
  name: "sil_profile_materialize",
46
46
  label: "Set up the sil shopper",
47
- description: "SETUP-ONLY: create the one sil shopper by writing its shared user spec into the"
48
- + " sil data directory. Writes user_spec.md — the person's standing facts + hard"
49
- + " constraints (addresses, sizes, allergy/ethics rules, budget psychology) that"
50
- + " carry across EVERY niche — with the shopper `name` in the file's own"
51
- + " frontmatter (there is NO manifest; the frontmatter IS the source of truth)."
52
- + " It does NOT mint any domain method or PRD — that is sil_learn create. `name`"
53
- + " and `userSpec` are both REQUIRED. Run this ONCE at setup: post-setup user-spec"
54
- + " refinement is sil_learn (append/amend), NEVER a re-materialize (a re-run"
55
- + " overwrites the whole body, discarding what sil_learn added). Makes no network"
56
- + " call and reads no token. The"
57
- + " persona is NOT written here — it is the host workspace SOUL.md. A blank"
58
- + " name/userSpec returns invalid_request and writes nothing; a write failure"
59
- + " returns persistence_failed.",
47
+ description: "SETUP-ONLY: create the one sil shopper by writing its shared user_spec.md — the"
48
+ + " person's cross-niche facts + hard constraints — with the shopper `name` in the"
49
+ + " file's frontmatter (no manifest). Does NOT mint any domain method or PRD (that"
50
+ + " is sil_learn create). Run ONCE at setup; refine later with sil_learn, never a"
51
+ + " re-materialize (it overwrites the whole body). `name` + `userSpec` required and"
52
+ + " non-empty. Local-only, no network. Blank input → invalid_request; write failure"
53
+ + " → persistence_failed.",
60
54
  parameters: Type.Object({
61
55
  name: Type.String({
62
56
  description: "The human-readable shopper name (recorded in user_spec.md frontmatter).",
@@ -84,22 +78,14 @@ function registerLearn(api) {
84
78
  api.registerTool({
85
79
  name: "sil_learn",
86
80
  label: "Teach the sil shopper (create or refine a method / PRD)",
87
- description: "The single target+change verb that owns the whole method/PRD lifecycle for the"
88
- + " sil shopper — create a whole doc, or refine one in place. `target` selects"
89
- + " WHERE the change lands: `user_spec` (the shared person spec, no selector),"
90
- + " `method` (needs `domain`), or `prd` (needs `domain` + `prd`, the"
91
- + " <product>-<intent> key). `kind` selects the change: `create` mints a whole"
92
- + " method (domain, name, body) or PRD (domain, prd, product, intent, title,"
93
- + " body) — NOT valid for user_spec; `append` adds one `- text` bullet under a"
94
- + " named `## section` (fail-closed if that heading is absent) else at EOF;"
95
- + " `amend` replaces the single bullet matching `from` with `to` (an ambiguous"
96
- + " 2+ match is refused); `retract` removes the single bullet matching `from`;"
97
- + " `attach-asset` persists image `bytes` (base64 + `mime`) into the domain's"
98
- + " assets and links them by relative path. `hard` marks an inviolable"
99
- + " constraint — valid only on append to user_spec or prd. append/amend/retract/"
100
- + " attach-asset require the target to already exist (else not_found). Makes no"
101
- + " network call and reads no token; writes are atomic + owner-only. A bad field"
102
- + " returns invalid_request and writes nothing.",
81
+ description: "The single target+change verb owning the sil shopper's method/PRD lifecycle."
82
+ + " `target` (user_spec | method | prd) picks WHERE the change lands; `kind`"
83
+ + " (create | append | amend | retract | attach-asset) picks the change — the"
84
+ + " per-field schema names which fields each needs. `create` mints a whole method/"
85
+ + "PRD (not valid for user_spec); append/amend/retract/attach-asset need the target"
86
+ + " to exist (else not_found). `hard` (append to user_spec/prd only) marks an"
87
+ + " inviolable constraint. Local-only, atomic, owner-only, no network; a bad field"
88
+ + " → invalid_request and writes nothing.",
103
89
  parameters: Type.Object({
104
90
  target: Type.Union([Type.Literal("user_spec"), Type.Literal("method"), Type.Literal("prd")], { description: "WHERE the change lands: user_spec | method | prd." }),
105
91
  kind: Type.Union([
@@ -173,15 +159,13 @@ function registerSearch(api) {
173
159
  name: "sil_profile_search",
174
160
  label: "Search what the sil shopper knows (domains + PRDs)",
175
161
  description: "Query the sil shopper's artefact FRONTMATTER — the discovery / reuse-before-mint"
176
- + " primitive. Returns COORDINATES only (no document bodies): the domains the"
177
- + " shopper has learned ({slug, name}) and its PRDs ({domain, key, product,"
178
- + " intent, title, …}). All filters are optional — pass none for the full"
179
- + " overview, or narrow by `domain` / `product` / `intent` / a free-text"
180
- + " `query`. This is a filesystem SCAN, not an index read; a domain or PRD whose"
181
- + " frontmatter is malformed is SKIPPED and surfaced in `unreadable` (never"
182
- + " silently dropped, never half-read) while healthy siblings still list. An"
183
- + " empty store returns ok with empty domains/prds (healthy). Makes no network"
184
- + " call and reads no token.",
162
+ + " primitive. Returns COORDINATES only (no bodies): the domains learned ({slug,"
163
+ + " name}) and their PRDs ({domain, key, product, intent, title}). All filters"
164
+ + " optional — none = full overview; narrow by domain/product/intent/query. A"
165
+ + " filesystem scan: malformed frontmatter is surfaced in `unreadable`, never"
166
+ + " dropped; healthy siblings still list. Empty store → ok with empty lists. When"
167
+ + " NO domain matches, the result carries `next_step: mint_domain` — the cue to"
168
+ + " mint the niche (sil_learn create) BEFORE shopping. Local-only, no network.",
185
169
  parameters: Type.Object({
186
170
  domain: Type.Optional(Type.String({ description: "Filter to one domain slug." })),
187
171
  product: Type.Optional(Type.String({ description: "Filter PRDs by product type." })),
@@ -200,11 +184,27 @@ function registerSearch(api) {
200
184
  prd_count: result.prds.length,
201
185
  unreadable_count: result.unreadable.length,
202
186
  });
187
+ // The mint trigger. No matching domain came back (an empty store, or a
188
+ // filtered miss on a populated one) — this IS the reuse-before-mint MISS, and
189
+ // it is where a first shop silently stalls: the model finds nothing to reuse
190
+ // and, with no next move in hand, answers a buy-intent off the open web. Carry
191
+ // the next action in the result so the MISS itself points at the mint, the way
192
+ // the catalog tools carry `recovery`. Absent when a domain matched.
193
+ const noMatch = result.domains.length === 0;
203
194
  return jsonResult({
204
195
  status: "ok",
205
196
  domains: result.domains,
206
197
  prds: result.prds,
207
198
  unreadable: result.unreadable,
199
+ ...(noMatch
200
+ ? {
201
+ next_step: "mint_domain",
202
+ guidance: "No learned domain matches this request. To shop this niche, mint"
203
+ + " its domain FIRST: research the buying guide, then sil_learn create"
204
+ + " (target: method). Then shop with sil_search — a buy-intent is"
205
+ + " answered from the sil catalog, never from the open web.",
206
+ }
207
+ : {}),
208
208
  });
209
209
  },
210
210
  });
@@ -213,16 +213,13 @@ function registerGet(api) {
213
213
  api.registerTool({
214
214
  name: "sil_profile_get",
215
215
  label: "Read one sil shopper document (method or PRD)",
216
- description: "Read ONE full body from the sil shopper's store — the rich read. With a"
217
- + " `domainSlug` only, returns that domain's method body (its buying guide +"
218
- + " taste + search vocabulary); with `domainSlug` + `prd`, returns that PRD's"
219
- + " body (its requirements + filled preferences). Use sil_profile_search first"
220
- + " to discover which domains/PRDs exist (coordinates), then this to read one in"
221
- + " full. A missing method/PRD returns not_found; a present-but-corrupt body"
222
- + " (malformed/absent frontmatter) returns unreadable (inspect / repair — do NOT"
223
- + " overwrite it, it may be recoverable), distinct from not_found; a malformed/"
224
- + "traversal/\"main\" slug returns invalid_request. Makes no network call and reads"
225
- + " no token.",
216
+ description: "Read ONE full body from the sil shopper's store. `domainSlug` alone → the method"
217
+ + " body (buying guide + taste + search vocabulary); `domainSlug` + `prd` → that"
218
+ + " PRD body (requirements + filled preferences). Discover coordinates with"
219
+ + " sil_profile_search first. Missing → not_found; present-but-corrupt frontmatter"
220
+ + " → unreadable (inspect/repair — do NOT overwrite, it may be recoverable), distinct"
221
+ + " from not_found; a bad/traversal/\"main\" slug → invalid_request. Local-only, no"
222
+ + " network.",
226
223
  parameters: Type.Object({
227
224
  domainSlug: Type.String({
228
225
  description: "The domain slug to read (lower-kebab, not \"main\"). REQUIRED.",
@@ -251,15 +248,12 @@ function registerRemove(api) {
251
248
  api.registerTool({
252
249
  name: "sil_profile_remove",
253
250
  label: "Remove a sil shopper domain, or one of its PRDs",
254
- description: "Remove artefacts from the sil shopper's store — the SIL-SIDE half only. With a"
255
- + " `domainSlug` only, removes the WHOLE domain subtree (method + all PRDs +"
256
- + " assets); with `domainSlug` + `prd`, removes just that ONE PRD (the method and"
257
- + " sibling PRDs survive). Scoped and fail-closed: a malformed/traversal/\"main\""
258
- + " slug returns invalid_request and deletes nothing; an unregistered domain/PRD"
259
- + " returns not_found (idempotent — safe to re-run); a genuine filesystem failure"
260
- + " returns persistence_failed. Never removes the shopper itself (that is a host"
261
- + " concern). Confirm with the user before removing — it is destructive. Makes no"
262
- + " network call and reads no token.",
251
+ description: "Remove artefacts from the sil shopper's store. `domainSlug` alone removes the"
252
+ + " WHOLE domain subtree (method + all PRDs + assets); `domainSlug` + `prd` removes"
253
+ + " just that ONE PRD (method + siblings survive). Destructive — confirm with the"
254
+ + " user first. A bad/traversal/\"main\" slug → invalid_request (deletes nothing); an"
255
+ + " unregistered domain/PRD → not_found (idempotent); a filesystem failure →"
256
+ + " persistence_failed. Never removes the shopper itself. Local-only, no network.",
263
257
  parameters: Type.Object({
264
258
  domainSlug: Type.String({
265
259
  description: "The domain slug to remove from (lower-kebab, not \"main\"). REQUIRED.",
@@ -2,7 +2,7 @@
2
2
  "id": "sil",
3
3
  "name": "sil",
4
4
  "description": "Turn your OpenClaw into an expert shopping agent.",
5
- "version": "0.4.0",
5
+ "version": "0.4.1",
6
6
  "skills": ["./sil-shopping"],
7
7
  "activation": {
8
8
  "onCapabilities": ["tool"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sil-openclaw",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Turn your OpenClaw into an expert shopping agent.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -9,7 +9,7 @@
9
9
  * "never write host config / `noChildProcess: true`" guarantees do not bind it; it
10
10
  * legitimately drives `openclaw …` via `execFileSync`.
11
11
  *
12
- * It runs POST-endorsement: the interview (`brainstorm_interview.md`) owns the
12
+ * It runs POST-endorsement: the interview (`agent_creation_engine.md` Part 1) owns the
13
13
  * consent gate; this bin executes an already-assembled, already-endorsed spec
14
14
  * non-interactively. It never prompts, never re-runs the interview.
15
15
  *
@@ -31,7 +31,8 @@
31
31
  * 7. materializeProfile — REUSED; SETUP-ONLY { name, userSpec } ⇒ shared
32
32
  * user_spec.md (its frontmatter carries the name);
33
33
  * NO manifest, no domain minted at create
34
- * 8. attach the sil skill + enable the sil plugin (openclaw config set --strict-json)
34
+ * 8. attach the sil skill + deny the escape-hatch tools (exec/write/edit/apply_patch,
35
+ * a per-agent tools.deny that keeps sil + web) + enable the sil plugin (config set)
35
36
  * 9. sil-openclaw-allowlist — REUSED whole; additive/idempotent/atomic three-surface
36
37
  * trust merge (plugins.allow + tools.alsoAllow + plugins.entries.sil)
37
38
  * 10. bind the current channel — FAIL-OPEN convenience, NOT fail-closed: resolve the channel
@@ -97,6 +98,37 @@ const MANIFEST_PATH = resolve(ROOT, "openclaw.plugin.json");
97
98
  /** A shopper id path-segment shape — lower-kebab, never `main` (host-reserved). */
98
99
  const AGENT_ID_RE = /^[a-z0-9][a-z0-9-]*$/;
99
100
 
101
+ /** The escape-hatch tools the shopper is DENIED at the per-agent level — the shell
102
+ * (`exec`) and the filesystem mutators (`write`/`edit`/`apply_patch`). A shopper shops
103
+ * through the sil tools; it has no business running a shell (which it wasted re-reading
104
+ * its own skill files) or writing host files (which it used to persist shopping memory
105
+ * into the workspace instead of the sil store). `deny` is the SAFE lever: per the host's
106
+ * tool-precedence model it only further-RESTRICTS and cannot re-grant, so it removes
107
+ * exactly these and CANNOT strip the sil tools (a per-agent `tools.profile` override,
108
+ * by contrast, replaces the base set and would risk the sil grant). Web + messaging
109
+ * tools are intentionally kept — web still feeds gap-filling method research. */
110
+ const SHOPPER_TOOL_DENY = ["exec", "write", "edit", "apply_patch"];
111
+
112
+ /** The sil creed appended to every shopper's SOUL.md after its persona — a soul, not a
113
+ * rulebook. It carries the mantra (explore first), the loop in three lines, and the one
114
+ * distinction that matters (the catalog is where you buy, the web is where you learn),
115
+ * so the shopper's character carries the method. The mechanics live in the attached
116
+ * sil-shopping skill; this is the philosophy the model weights as identity. */
117
+ const SOUL_SIL_RULES =
118
+ "\n## The sil way\n\n"
119
+ + "You are a spec-driven shopper, and your mantra is **explore first**: before you buy"
120
+ + " in a niche, you learn how it is really bought.\n\n"
121
+ + "The loop, in three lines:\n"
122
+ + "1. **Learn the domain** — the first time you shop a niche, explore it on the web,"
123
+ + " research how it is bought, and remember what you find (`sil_learn`).\n"
124
+ + "2. **Know the person** — reuse the sizes, tastes, and limits you already hold; ask"
125
+ + " only what you genuinely cannot infer.\n"
126
+ + "3. **Find the thing** — search the sil catalog, weigh what comes back against what"
127
+ + " you learned, and say why your pick fits.\n\n"
128
+ + "The **sil catalog is where you buy; the open web is where you learn.** Research a"
129
+ + " niche freely and often, but the products you recommend always come from the"
130
+ + " catalog. Keep what you learn so tomorrow's shop starts smarter than today's.\n";
131
+
100
132
  const CREATED_EVENT = "sil_shopper_created";
101
133
  const FAILED_EVENT = "sil_shopper_create_failed";
102
134
 
@@ -284,23 +316,10 @@ function agentIndex(config, agentId) {
284
316
  return list.findIndex((a) => a?.id === agentId);
285
317
  }
286
318
 
287
- /** Best-effort web-capability check (SA ruling: warn, never hard-fail). The shopper
288
- * lazily mints/refreshes a domain over the web (inherited from `agents.defaults`);
289
- * bare `sil_search` works without it. Warn ONLY when `agents.defaults` is present
290
- * yet names no web/fetch capability — never fabricate a gap on an absent defaults
291
- * block (the host may grant web by other means). */
292
- function webCapabilityWarnings(config) {
293
- const defaults = config?.agents?.defaults;
294
- if (defaults === undefined || defaults === null || typeof defaults !== "object") return [];
295
- const json = JSON.stringify(defaults).toLowerCase();
296
- const WEB_TOKENS = ["web", "fetch", "browse", "http"];
297
- if (WEB_TOKENS.some((t) => json.includes(t))) return [];
298
- return [
299
- "the created shopper inherits its tool profile from agents.defaults, which does not appear to"
300
- + " grant a web/fetch tool — a domain cannot be lazily minted or web-refreshed without it"
301
- + " (bare sil_search still works). Confirm agents.defaults grants a web capability.",
302
- ];
303
- }
319
+ // The shopper's per-agent escape-hatch deny-list (step 8) is the INTENDED end state, not
320
+ // a degradation — so it rides no `warnings` entry (that rail is for real gaps, and the
321
+ // happy path stays clean). What the shopper keeps (sil tools + web) and drops (the shell
322
+ // + fs mutators) is documented in CHANGELOG.md + agent_creation_engine.md.
304
323
 
305
324
  /** True iff `openclaw config validate --json` reported `{valid:true}`. The host
306
325
  * writes its verdict to stdout even on a non-zero exit, so read stdout, never the
@@ -540,10 +559,13 @@ function main() {
540
559
  failAndTeardown(configPath, "`openclaw agents add` failed: " + (addRes.stderr || "non-zero exit"));
541
560
  }
542
561
 
543
- // --- 6. Write the persona into the workspace SOUL.md (host CLI has no writer) ---
562
+ // --- 6. Write the persona + standing sil rules into the workspace SOUL.md ---
563
+ // The endorsed persona, then SOUL_SIL_RULES — the identity-level restatement of the
564
+ // shopping contract, so the shopper's tool discipline is anchored in its soul, not the
565
+ // skill alone (host CLI has no SOUL.md writer, so the bin does it).
544
566
  const soulPath = join(workspace, "SOUL.md");
545
567
  try {
546
- atomicWrite(soulPath, persona.endsWith("\n") ? persona : persona + "\n");
568
+ atomicWrite(soulPath, (persona.endsWith("\n") ? persona : persona + "\n") + SOUL_SIL_RULES);
547
569
  } catch (err) {
548
570
  failAndTeardown(soulPath, "could not write SOUL.md: " + errCause(err));
549
571
  }
@@ -571,6 +593,21 @@ function main() {
571
593
  if (!skillRes.ok) {
572
594
  failAndTeardown(configPath, "attaching the sil skill failed: " + (skillRes.stderr || "non-zero exit"));
573
595
  }
596
+ // Deny the shopper the escape-hatch tools at the per-agent level — sibling of the
597
+ // `.skills` set above. This subtracts the shell + fs mutators from whatever the host's
598
+ // global profile grants, so the sil tools (admitted via plugin trust, step 9) and web
599
+ // survive while the shell/file-write hatches are gone. `deny` is chosen over a
600
+ // per-agent `tools.profile` override precisely because it only further-restricts and
601
+ // can never strip the sil grant (SHOPPER_TOOL_DENY rationale). `--strict-json` requires
602
+ // a valid-JSON value, so the array is passed via JSON.stringify (→ '["exec",…]'),
603
+ // exactly like the `["…"]` / `true` values above; a bare token would exit 0 but no-op.
604
+ const denyRes = runOpenclaw(
605
+ ["config", "set", `agents.list[${idx}].tools.deny`, JSON.stringify(SHOPPER_TOOL_DENY), "--strict-json"],
606
+ configPath,
607
+ );
608
+ if (!denyRes.ok) {
609
+ failAndTeardown(configPath, "setting the shopper tool deny-list failed: " + (denyRes.stderr || "non-zero exit"));
610
+ }
574
611
  const enableRes = runOpenclaw(
575
612
  ["config", "set", "plugins.entries.sil.enabled", "true", "--strict-json"],
576
613
  configPath,
@@ -665,7 +702,7 @@ function main() {
665
702
  }
666
703
 
667
704
  // --- 12. Declare created — carry the identity + the bound channel (honesty rail) ---
668
- const warnings = [...webCapabilityWarnings(readConfig(configPath) ?? postAddConfig), ...bindWarnings];
705
+ const warnings = [...bindWarnings];
669
706
  emitCreated({ name, agentId, workspace, boundChannel, warnings });
670
707
  }
671
708
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: sil-shopping
3
- description: 'Use for any sil shopping, identity, or shopper-setup intent: register or sign in, check the account, search the sil catalog for purchasable products, or look up products by id — plus the single-shopper lifecycle: create the shopper (a short two-touchpoint onboarding), search what it knows or which domains (niches) it has learned, view or forget a domain or one of its PRDs, refine it — or, as the shopper, run the six-beat Spec-Driven Shopping loop on any niche and learn a fact or buying taste it surfaces. Drives sil_register, sil_whoami, sil_search, sil_product_get, sil_specs, sil_profile_materialize, sil_profile_search, sil_profile_get, sil_profile_remove, and sil_learn.'
3
+ description: 'Use for any sil shopping, identity, or shopper-setup intent: register, check the account, search the sil catalog, look up products by id — plus the single-shopper lifecycle: create the shopper (a two-touchpoint onboarding), search what it knows or which domains (niches) it learned, view or forget a domain or PRD, refine it — or, as the shopper, run the six-beat Spec-Driven Shopping loop and learn a fact or taste it surfaces. Drives sil_register, sil_whoami, sil_search, sil_product_get, sil_specs, sil_profile_materialize, sil_profile_search, sil_profile_get, sil_profile_remove, sil_learn.'
4
4
  metadata:
5
5
  openclaw:
6
6
  emoji: "\U0001F6D2"
@@ -8,55 +8,59 @@ metadata:
8
8
 
9
9
  # sil-shopping
10
10
 
11
- Drive the sil plugin's tools on the user's behalf: register them, read their
12
- identity, help them find purchasable products — and, when asked, set up their
13
- **shopper** (one sil-wired agent that shops every niche), then search what it
14
- knows, view or forget a domain, or refine it. Read intent, route to the matching
15
- tool or reference (loading it on demand), call it, and report what came back.
11
+ Drive the sil plugin's tools on the user's behalf: read intent, route to the
12
+ matching tool or reference (loading on demand), call it, report what came back. The
13
+ **shopper** is one sil-wired agent that shops every niche — set it up, search what
14
+ it knows, view or forget a domain, refine it.
16
15
 
17
16
  ## Always-on contract
18
17
 
19
18
  - **Act, don't narrate.** When intent maps to a tool, call it — don't re-confirm
20
19
  what was already stated.
21
20
  - **Follow the tool's own `recovery`.** Every tool returns a `status`; on a
22
- non-`ok` one, say what happened and follow that tool's `recovery` hint, never
23
- improvise another. The taxonomy lives in
24
- [`references/catalog_tools_reference.md`](references/catalog_tools_reference.md).
25
- - **Prices are point-in-time.** Before the user buys, re-fetch the item with
26
- `sil_product_get` rather than trusting an earlier `sil_search` snapshot.
21
+ non-`ok` one, say what happened and follow that tool's own `recovery` hint —
22
+ never improvise.
23
+ - **Prices are point-in-time.** Re-fetch with `sil_product_get` before the user
24
+ buys — never trust an earlier `sil_search` snapshot.
25
+ - **Buy-intent in an unlearned niche ⇒ mint first.** A request whose niche you
26
+ have not learned is a MISS — `sil_profile_search` returns it with `next_step:
27
+ mint_domain`. Research the buying guide and `sil_learn create` the domain method
28
+ **before** searching; never skip the mint. The picks you return are always sil
29
+ catalog products (`sil_search` → `checkout_url`), **never** open-web results —
30
+ the web only researches the method, it never sources a pick.
27
31
 
28
32
  ## Session start
29
33
 
30
- Confirm the `sil_*` tools are exposed. If they are missing, the host is filtering
31
- them — run the shipped admission helper `sil-openclaw-allowlist` (it additively
32
- admits sil at `plugins.allow` + `tools.alsoAllow`), then reopen the session. Most
33
- flows need an identity: calling a catalog tool first lets an unregistered outcome
34
- route to `sil_register`, or run `sil_register` up front when intent requires it.
34
+ Confirm the `sil_*` tools are exposed. If missing, the host is filtering them —
35
+ run the shipped admission helper `sil-openclaw-allowlist` (it additively admits
36
+ sil at `plugins.allow` + `tools.alsoAllow`), then reopen the session. Most flows
37
+ need an identity: call a catalog tool first and let an unregistered outcome route
38
+ to `sil_register`, or run `sil_register` up front when intent requires it.
35
39
 
36
40
  ## Routing — read the stage, then match intent to a tool
37
41
 
38
- **Read the stage from state — never guess it.** Two cheap reads settle it:
39
- `sil_whoami` (is a sil identity **registered** yet?) and `sil_profile_search` (is
40
- a shopper set up — does it return any `domains`?).
42
+ **Read the stage from state — never guess.** Two cheap reads settle it:
43
+ `sil_whoami` (is a sil identity **registered**?) and `sil_profile_search` (is a
44
+ shopper set up — any `domains`?).
41
45
 
42
46
  - **No identity** ⇒ guide the user to register.
43
- - **No shopper / no domains** ⇒ bare shopping is a first-class quick lookup; the
44
- setup path is offered alongside it.
47
+ - **No shopper / no domains** ⇒ bare shopping is a first-class quick lookup, with
48
+ the setup path offered alongside.
45
49
  - **Shopper present** ⇒ shop through what you know about the person via the loop.
46
50
 
47
51
  [`references/setup_onboarding.md`](references/setup_onboarding.md) owns the setup
48
52
  script — the staged ladder, the after-register offer, the per-search pitch. Load
49
- it while setup is incomplete; it sheds once a shopper exists.
53
+ while setup is incomplete; it sheds once a shopper exists.
50
54
 
51
55
  ### Intent → tool / reference (load on demand)
52
56
 
53
57
  | Intent | Tool / path | Reference |
54
58
  |---|---|---|
55
- | "sign me up" / "log me in" / "register" | `sil_register` | [`catalog_tools_reference.md`](references/catalog_tools_reference.md) |
56
- | "who am I?" / show my saved name + addresses | `sil_whoami` | [`catalog_tools_reference.md`](references/catalog_tools_reference.md) |
57
- | "find X" / "search for X" / browse a category or price range | `sil_search` | [`catalog_tools_reference.md`](references/catalog_tools_reference.md) |
58
- | "look up these items" / re-check ids from a prior result | `sil_product_get` | [`catalog_tools_reference.md`](references/catalog_tools_reference.md) |
59
- | "set up an agent that shops for me" / "create my shopper" | (onboarding, then the engine) | the two-step below |
59
+ | "sign me up" / "log me in" / "register" | `sil_register` | — |
60
+ | "who am I?" / show my saved name + addresses | `sil_whoami` | — |
61
+ | "find X" / "search for X" / browse a category or price range | `sil_search` | — |
62
+ | "look up these items" / re-check ids from a prior result | `sil_product_get` | — |
63
+ | "set up an agent that shops for me" / "create my shopper" | (onboarding, then the engine) | [`agent_creation_engine.md`](references/agent_creation_engine.md) |
60
64
  | "what does my shopper know?" / "which domains / PRDs?" | `sil_profile_search` | [`method_and_prds.md`](references/method_and_prds.md) |
61
65
  | "show me the &lt;niche&gt; domain" (method or one PRD) | `sil_profile_get` | [`method_and_prds.md`](references/method_and_prds.md) |
62
66
  | "forget the &lt;niche&gt; domain" (or one PRD) | `sil_profile_remove` | [`method_and_prds.md`](references/method_and_prds.md) |
@@ -64,43 +68,27 @@ it while setup is incomplete; it sheds once a shopper exists.
64
68
  | "learn / remember this" — a fact or taste the shopper surfaced | `sil_learn` | [`fill_and_feedback.md`](references/fill_and_feedback.md) |
65
69
  | "refine / sharpen my shopper" / fix a niche | `sil_learn` (target + change) | [`fill_and_feedback.md`](references/fill_and_feedback.md) |
66
70
 
67
- [`references/catalog_tools_reference.md`](references/catalog_tools_reference.md)
68
- holds the per-tool behaviour + status taxonomy — basic shopping needs only that.
69
- The answer→`sil_search`-param mapping is
70
- [`references/search_param_mapping.md`](references/search_param_mapping.md); a full
71
- run is
72
- [`examples/multi_domain_shopper_walkthrough.md`](examples/multi_domain_shopper_walkthrough.md).
73
-
74
- **Setting up the shopper — the endorsement-gated two-step.** The shopper is a
75
- singleton (refused once one exists). (1) **Onboard first:** run
76
- [`references/brainstorm_interview.md`](references/brainstorm_interview.md), the
77
- two-touchpoint onboarding. (2) **Only after** the user explicitly **endorses** the
78
- assembled draft, run
79
- [`references/agent_creation_engine.md`](references/agent_creation_engine.md), the
80
- engine that persists the one sil-wired shopper. No engine step runs before that
81
- endorsement.
71
+ Each core tool's behaviour + status taxonomy live in its own tool definition and
72
+ response (the `recovery`/`status` it returns) — basic shopping needs only that. A full
73
+ run: [`examples/multi_domain_shopper_walkthrough.md`](examples/multi_domain_shopper_walkthrough.md).
74
+
75
+ **Setting up the shopper — endorsement-gated.** The shopper is a singleton (refused
76
+ once one exists). Run
77
+ [`references/agent_creation_engine.md`](references/agent_creation_engine.md) — it holds
78
+ both the two-touchpoint onboarding and the engine that persists the one sil-wired
79
+ shopper. Nothing is created until the user explicitly **endorses** the draft.
82
80
 
83
81
  ## As the shopper — the six-beat Spec-Driven-Shopping loop
84
82
 
85
83
  Once a shopper exists, shop through what you know about the person. The loop is a
86
84
  **six-beat** state machine — **classify → method → fill → search-space → reflect →
87
- feedback** — and its detail lives in the references that own each beat, loaded on
88
- demand:
89
-
90
- 1. **Classify** the request's `{domain, product, intent}` and reuse a learned
91
- domain/PRD before minting — [`references/shop_loop.md`](references/shop_loop.md).
92
- 2. **Method** load (hot path) or research-and-mint, then intent-keyed PRDs and the
93
- frontmatter-as-truth store — [`references/method_and_prds.md`](references/method_and_prds.md).
94
- 3. **Fill** the PRD by precedence, eliciting only the residue —
95
- [`references/fill_and_feedback.md`](references/fill_and_feedback.md).
96
- 4. **Search-space** — the bounded fan-out —
97
- [`references/shop_loop.md`](references/shop_loop.md).
98
- 5. **Reflect** on best-available vs the PRD —
99
- [`references/shop_loop.md`](references/shop_loop.md).
100
- 6. **Feedback** — capture what surfaced via `sil_learn` —
101
- [`references/fill_and_feedback.md`](references/fill_and_feedback.md).
85
+ feedback** — loaded on demand from the references that own each beat: **1 classify,
86
+ 4 search-space, 5 reflect** → [`references/shop_loop.md`](references/shop_loop.md);
87
+ **2 method** (load/mint/refresh, intent-keyed PRDs, the frontmatter-as-truth store)
88
+ → [`references/method_and_prds.md`](references/method_and_prds.md); **3 fill, 6
89
+ feedback** → [`references/fill_and_feedback.md`](references/fill_and_feedback.md).
102
90
 
103
91
  The loop shapes the shopper's **reasoning, not the user's inbox**: a reused domain
104
- plus a fully-resolved request **passes straight through, asking nothing**. It
105
- scopes to `sil_search`-driven discovery — identity, a direct `sil_product_get`
106
- re-check, and shopper-management route normally, ungated.
92
+ plus a fully-resolved request **passes straight through, asking nothing**. It gates
93
+ only `sil_search`-driven discovery — identity, a direct `sil_product_get` re-check,
94
+ and shopper-management run ungated.