sil-openclaw 0.4.0 → 0.4.2

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.
@@ -7,8 +7,8 @@
7
7
  * - `sil_profile_materialize { name, userSpec }` — SETUP-ONLY: write user_spec.md
8
8
  * (its frontmatter carries the shopper name). Does NOT mint methods/PRDs.
9
9
  * - `sil_learn { target, domain?, prd?, kind, … }` — the single target+change verb
10
- * for the whole method/PRD lifecycle: create mints a whole doc; append/amend/
11
- * retract refine in place; attach-asset persists image bytes by path.
10
+ * for the whole method/PRD lifecycle: create mints a NEW doc; write replaces an
11
+ * existing doc's whole body (reconciled); attach-asset persists image bytes by path.
12
12
  * - `sil_profile_search { domain?, product?, intent?, query? }` — query artefact
13
13
  * FRONTMATTER (coordinates only, no bodies); the discovery / reuse-before-mint
14
14
  * primitive. Malformed frontmatter surfaces in `unreadable`, never dropped.
@@ -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,43 +78,30 @@ 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 | write | attach-asset) picks the change. `create` mints a NEW method/"
84
+ + "PRD (not valid for user_spec; errors if one already exists — use write). `write`"
85
+ + " replaces an EXISTING doc's whole body with a reconciled version you author (read"
86
+ + " it first with sil_profile_get and carry every buyer line forward; else not_found)."
87
+ + " `attach-asset` links image bytes. To change anything, WRITE the whole reconciled"
88
+ + " doc — there is no append/amend, so a correction never stacks a contradicting"
89
+ + " line. Local-only, atomic, owner-only, no network; a bad field → invalid_request"
90
+ + " and writes nothing.",
103
91
  parameters: Type.Object({
104
92
  target: Type.Union([Type.Literal("user_spec"), Type.Literal("method"), Type.Literal("prd")], { description: "WHERE the change lands: user_spec | method | prd." }),
105
93
  kind: Type.Union([
106
94
  Type.Literal("create"),
107
- Type.Literal("append"),
108
- Type.Literal("amend"),
109
- Type.Literal("retract"),
95
+ Type.Literal("write"),
110
96
  Type.Literal("attach-asset"),
111
- ], { description: "The change: create | append | amend | retract | attach-asset." }),
97
+ ], { description: "The change: create (mint new) | write (replace whole body) | attach-asset." }),
112
98
  domain: Type.Optional(Type.String({ description: "The domain slug (lower-kebab, not \"main\") — required for method/prd." })),
113
99
  prd: Type.Optional(Type.String({ description: "The PRD key <product>-<intent> (lower-kebab) — required for a prd target." })),
114
100
  name: Type.Optional(Type.String({ description: "create method: the human-readable domain name." })),
115
- body: Type.Optional(Type.String({ description: "create: the whole markdown body to mint." })),
101
+ body: Type.Optional(Type.String({ description: "create / write: the whole markdown body (mint, or the reconciled replacement)." })),
116
102
  product: Type.Optional(Type.String({ description: "create prd: the product type." })),
117
103
  intent: Type.Optional(Type.String({ description: "create prd: the use-context (general when context-free)." })),
118
104
  title: Type.Optional(Type.String({ description: "create prd: the human-readable job title." })),
119
- text: Type.Optional(Type.String({ description: "append: the one bullet to add." })),
120
- from: Type.Optional(Type.String({ description: "amend/retract: the exact bullet text to match (single occurrence)." })),
121
- to: Type.Optional(Type.String({ description: "amend: the replacement bullet text." })),
122
- section: Type.Optional(Type.String({ description: "append/amend/retract: the `## section` to scope to." })),
123
- hard: Type.Optional(Type.Boolean({ description: "append to user_spec/prd only: mark an inviolable constraint the shop loop rejects against." })),
124
105
  bytes: Type.Optional(Type.String({ description: "attach-asset: the image bytes, base64-encoded." })),
125
106
  mime: Type.Optional(Type.String({ description: "attach-asset: image/jpeg | image/png | image/webp | image/gif." })),
126
107
  caption: Type.Optional(Type.String({ description: "attach-asset: an optional caption for the markdown link." })),
@@ -128,7 +109,7 @@ function registerLearn(api) {
128
109
  async execute(_callId, params) {
129
110
  const spec = {
130
111
  target: params["target"] ?? "method",
131
- kind: params["kind"] ?? "append",
112
+ kind: params["kind"] ?? "write",
132
113
  domain: optString(params["domain"]),
133
114
  prd: optString(params["prd"]),
134
115
  name: optString(params["name"]),
@@ -136,11 +117,6 @@ function registerLearn(api) {
136
117
  product: optString(params["product"]),
137
118
  intent: optString(params["intent"]),
138
119
  title: optString(params["title"]),
139
- text: optString(params["text"]),
140
- from: optString(params["from"]),
141
- to: optString(params["to"]),
142
- section: optString(params["section"]),
143
- hard: params["hard"] === true ? true : undefined,
144
120
  bytes: optString(params["bytes"]),
145
121
  mime: optString(params["mime"]),
146
122
  caption: optString(params["caption"]),
@@ -173,15 +149,13 @@ function registerSearch(api) {
173
149
  name: "sil_profile_search",
174
150
  label: "Search what the sil shopper knows (domains + PRDs)",
175
151
  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.",
152
+ + " primitive. Returns COORDINATES only (no bodies): the domains learned ({slug,"
153
+ + " name}) and their PRDs ({domain, key, product, intent, title}). All filters"
154
+ + " optional — none = full overview; narrow by domain/product/intent/query. A"
155
+ + " filesystem scan: malformed frontmatter is surfaced in `unreadable`, never"
156
+ + " dropped; healthy siblings still list. Empty store → ok with empty lists. When"
157
+ + " NO domain matches, the result carries `next_step: mint_domain` — the cue to"
158
+ + " mint the niche (sil_learn create) BEFORE shopping. Local-only, no network.",
185
159
  parameters: Type.Object({
186
160
  domain: Type.Optional(Type.String({ description: "Filter to one domain slug." })),
187
161
  product: Type.Optional(Type.String({ description: "Filter PRDs by product type." })),
@@ -200,11 +174,27 @@ function registerSearch(api) {
200
174
  prd_count: result.prds.length,
201
175
  unreadable_count: result.unreadable.length,
202
176
  });
177
+ // The mint trigger. No matching domain came back (an empty store, or a
178
+ // filtered miss on a populated one) — this IS the reuse-before-mint MISS, and
179
+ // it is where a first shop silently stalls: the model finds nothing to reuse
180
+ // and, with no next move in hand, answers a buy-intent off the open web. Carry
181
+ // the next action in the result so the MISS itself points at the mint, the way
182
+ // the catalog tools carry `recovery`. Absent when a domain matched.
183
+ const noMatch = result.domains.length === 0;
203
184
  return jsonResult({
204
185
  status: "ok",
205
186
  domains: result.domains,
206
187
  prds: result.prds,
207
188
  unreadable: result.unreadable,
189
+ ...(noMatch
190
+ ? {
191
+ next_step: "mint_domain",
192
+ guidance: "No learned domain matches this request. To shop this niche, mint"
193
+ + " its domain FIRST: research the buying guide, then sil_learn create"
194
+ + " (target: method). Then shop with sil_search — a buy-intent is"
195
+ + " answered from the sil catalog, never from the open web.",
196
+ }
197
+ : {}),
208
198
  });
209
199
  },
210
200
  });
@@ -213,16 +203,13 @@ function registerGet(api) {
213
203
  api.registerTool({
214
204
  name: "sil_profile_get",
215
205
  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.",
206
+ description: "Read ONE full body from the sil shopper's store. `domainSlug` alone → the method"
207
+ + " body (buying guide + taste + search vocabulary); `domainSlug` + `prd` → that"
208
+ + " PRD body (requirements + filled preferences). Discover coordinates with"
209
+ + " sil_profile_search first. Missing → not_found; present-but-corrupt frontmatter"
210
+ + " → unreadable (inspect/repair — do NOT overwrite, it may be recoverable), distinct"
211
+ + " from not_found; a bad/traversal/\"main\" slug → invalid_request. Local-only, no"
212
+ + " network.",
226
213
  parameters: Type.Object({
227
214
  domainSlug: Type.String({
228
215
  description: "The domain slug to read (lower-kebab, not \"main\"). REQUIRED.",
@@ -251,15 +238,12 @@ function registerRemove(api) {
251
238
  api.registerTool({
252
239
  name: "sil_profile_remove",
253
240
  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.",
241
+ description: "Remove artefacts from the sil shopper's store. `domainSlug` alone removes the"
242
+ + " WHOLE domain subtree (method + all PRDs + assets); `domainSlug` + `prd` removes"
243
+ + " just that ONE PRD (method + siblings survive). Destructive — confirm with the"
244
+ + " user first. A bad/traversal/\"main\" slug → invalid_request (deletes nothing); an"
245
+ + " unregistered domain/PRD → not_found (idempotent); a filesystem failure →"
246
+ + " persistence_failed. Never removes the shopper itself. Local-only, no network.",
263
247
  parameters: Type.Object({
264
248
  domainSlug: Type.String({
265
249
  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.2",
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.2",
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,7 @@
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 + enable the sil plugin (config set)
35
35
  * 9. sil-openclaw-allowlist — REUSED whole; additive/idempotent/atomic three-surface
36
36
  * trust merge (plugins.allow + tools.alsoAllow + plugins.entries.sil)
37
37
  * 10. bind the current channel — FAIL-OPEN convenience, NOT fail-closed: resolve the channel
@@ -97,6 +97,26 @@ const MANIFEST_PATH = resolve(ROOT, "openclaw.plugin.json");
97
97
  /** A shopper id path-segment shape — lower-kebab, never `main` (host-reserved). */
98
98
  const AGENT_ID_RE = /^[a-z0-9][a-z0-9-]*$/;
99
99
 
100
+ /** The sil creed appended to every shopper's SOUL.md after its persona — a soul, not a
101
+ * rulebook. It carries the mantra (explore first), the loop in three lines, and the one
102
+ * distinction that matters (the catalog is where you buy, the web is where you learn),
103
+ * so the shopper's character carries the method. The mechanics live in the attached
104
+ * sil-shopping skill; this is the philosophy the model weights as identity. */
105
+ const SOUL_SIL_RULES =
106
+ "\n## The sil way\n\n"
107
+ + "You are a spec-driven shopper, and your mantra is **explore first**: before you buy"
108
+ + " in a niche, you learn how it is really bought.\n\n"
109
+ + "The loop, in three lines:\n"
110
+ + "1. **Learn the domain** — the first time you shop a niche, explore it on the web,"
111
+ + " research how it is bought, and remember what you find (`sil_learn`).\n"
112
+ + "2. **Know the person** — reuse the sizes, tastes, and limits you already hold; ask"
113
+ + " only what you genuinely cannot infer.\n"
114
+ + "3. **Find the thing** — search the sil catalog, weigh what comes back against what"
115
+ + " you learned, and say why your pick fits.\n\n"
116
+ + "The **sil catalog is where you buy; the open web is where you learn.** Research a"
117
+ + " niche freely and often, but the products you recommend always come from the"
118
+ + " catalog. Keep what you learn so tomorrow's shop starts smarter than today's.\n";
119
+
100
120
  const CREATED_EVENT = "sil_shopper_created";
101
121
  const FAILED_EVENT = "sil_shopper_create_failed";
102
122
 
@@ -284,24 +304,6 @@ function agentIndex(config, agentId) {
284
304
  return list.findIndex((a) => a?.id === agentId);
285
305
  }
286
306
 
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
- }
304
-
305
307
  /** True iff `openclaw config validate --json` reported `{valid:true}`. The host
306
308
  * writes its verdict to stdout even on a non-zero exit, so read stdout, never the
307
309
  * exit code (fail closed if it is not JSON). */
@@ -540,10 +542,13 @@ function main() {
540
542
  failAndTeardown(configPath, "`openclaw agents add` failed: " + (addRes.stderr || "non-zero exit"));
541
543
  }
542
544
 
543
- // --- 6. Write the persona into the workspace SOUL.md (host CLI has no writer) ---
545
+ // --- 6. Write the persona + standing sil rules into the workspace SOUL.md ---
546
+ // The endorsed persona, then SOUL_SIL_RULES — the identity-level restatement of the
547
+ // shopping contract, so the shopper's tool discipline is anchored in its soul, not the
548
+ // skill alone (host CLI has no SOUL.md writer, so the bin does it).
544
549
  const soulPath = join(workspace, "SOUL.md");
545
550
  try {
546
- atomicWrite(soulPath, persona.endsWith("\n") ? persona : persona + "\n");
551
+ atomicWrite(soulPath, (persona.endsWith("\n") ? persona : persona + "\n") + SOUL_SIL_RULES);
547
552
  } catch (err) {
548
553
  failAndTeardown(soulPath, "could not write SOUL.md: " + errCause(err));
549
554
  }
@@ -571,6 +576,12 @@ function main() {
571
576
  if (!skillRes.ok) {
572
577
  failAndTeardown(configPath, "attaching the sil skill failed: " + (skillRes.stderr || "non-zero exit"));
573
578
  }
579
+ // No per-agent `tools.deny` is set: the shopper inherits the host's default toolset
580
+ // untouched. A deny of the fs-mutators is inert here — codex brings its OWN shell
581
+ // (surfaced as `bash`), which the deny cannot name and which reads the shopper's
582
+ // skill files anyway, and an open shell writes files regardless of any fs-mutator
583
+ // deny. The shell stays open by design (trusted single-operator posture); persistence
584
+ // is steered through the sil tools by the skill, not enforced by tool policy.
574
585
  const enableRes = runOpenclaw(
575
586
  ["config", "set", "plugins.entries.sil.enabled", "true", "--strict-json"],
576
587
  configPath,
@@ -665,7 +676,7 @@ function main() {
665
676
  }
666
677
 
667
678
  // --- 12. Declare created — carry the identity + the bound channel (honesty rail) ---
668
- const warnings = [...webCapabilityWarnings(readConfig(configPath) ?? postAddConfig), ...bindWarnings];
679
+ const warnings = [...bindWarnings];
669
680
  emitCreated({ name, agentId, workspace, boundChannel, warnings });
670
681
  }
671
682
 
@@ -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,62 @@ 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.
31
+ - **Your memory is the sil store, never a `MEMORY.md`.** Persist and recall every
32
+ shopping fact, taste, and domain method through `sil_learn` / `sil_profile_*` — a
33
+ workspace `MEMORY.md` is not the shopper's memory; do not read or write it.
27
34
 
28
35
  ## Session start
29
36
 
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.
37
+ Confirm the `sil_*` tools are exposed. If missing, the host is filtering them —
38
+ run the shipped admission helper `sil-openclaw-allowlist` (it additively admits
39
+ sil at `plugins.allow` + `tools.alsoAllow`), then reopen the session. Most flows
40
+ need an identity: call a catalog tool first and let an unregistered outcome route
41
+ to `sil_register`, or run `sil_register` up front when intent requires it.
35
42
 
36
43
  ## Routing — read the stage, then match intent to a tool
37
44
 
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`?).
45
+ **Read the stage from state — never guess.** Two cheap reads settle it:
46
+ `sil_whoami` (is a sil identity **registered**?) and `sil_profile_search` (is a
47
+ shopper set up — any `domains`?).
41
48
 
42
49
  - **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.
50
+ - **No shopper / no domains** ⇒ bare shopping is a first-class quick lookup, with
51
+ the setup path offered alongside.
45
52
  - **Shopper present** ⇒ shop through what you know about the person via the loop.
46
53
 
47
54
  [`references/setup_onboarding.md`](references/setup_onboarding.md) owns the setup
48
55
  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.
56
+ while setup is incomplete; it sheds once a shopper exists.
50
57
 
51
58
  ### Intent → tool / reference (load on demand)
52
59
 
53
60
  | Intent | Tool / path | Reference |
54
61
  |---|---|---|
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 |
62
+ | "sign me up" / "log me in" / "register" | `sil_register` | — |
63
+ | "who am I?" / show my saved name + addresses | `sil_whoami` | — |
64
+ | "find X" / "search for X" / browse a category or price range | `sil_search` | — |
65
+ | "look up these items" / re-check ids from a prior result | `sil_product_get` | — |
66
+ | "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
67
  | "what does my shopper know?" / "which domains / PRDs?" | `sil_profile_search` | [`method_and_prds.md`](references/method_and_prds.md) |
61
68
  | "show me the &lt;niche&gt; domain" (method or one PRD) | `sil_profile_get` | [`method_and_prds.md`](references/method_and_prds.md) |
62
69
  | "forget the &lt;niche&gt; domain" (or one PRD) | `sil_profile_remove` | [`method_and_prds.md`](references/method_and_prds.md) |
@@ -64,43 +71,31 @@ it while setup is incomplete; it sheds once a shopper exists.
64
71
  | "learn / remember this" — a fact or taste the shopper surfaced | `sil_learn` | [`fill_and_feedback.md`](references/fill_and_feedback.md) |
65
72
  | "refine / sharpen my shopper" / fix a niche | `sil_learn` (target + change) | [`fill_and_feedback.md`](references/fill_and_feedback.md) |
66
73
 
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.
74
+ Each core tool's behaviour + status taxonomy live in its own tool definition and
75
+ response (the `recovery`/`status` it returns) — basic shopping needs only that. A full
76
+ run: [`examples/multi_domain_shopper_walkthrough.md`](examples/multi_domain_shopper_walkthrough.md).
77
+
78
+ **Setting up the shopper — endorsement-gated.** The shopper is a singleton (refused
79
+ once one exists). Run
80
+ [`references/agent_creation_engine.md`](references/agent_creation_engine.md) — it holds
81
+ both the two-touchpoint onboarding and the engine that persists the one sil-wired
82
+ shopper. Nothing is created until the user explicitly **endorses** the draft.
82
83
 
83
84
  ## As the shopper — the six-beat Spec-Driven-Shopping loop
84
85
 
85
86
  Once a shopper exists, shop through what you know about the person. The loop is a
86
87
  **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).
88
+ feedback** — loaded on demand from the references that own each beat: **1 classify,
89
+ 4 search-space, 5 reflect** → [`references/shop_loop.md`](references/shop_loop.md);
90
+ **2 method** (load/mint/refresh, intent-keyed PRDs, the frontmatter-as-truth store)
91
+ → [`references/method_and_prds.md`](references/method_and_prds.md); **3 fill, 6
92
+ feedback** → [`references/fill_and_feedback.md`](references/fill_and_feedback.md).
93
+
94
+ **Beat 4 is bounded: ≤ 4 spec-filtered `sil_search` calls** per request — the tightest
95
+ projection of the PRD's core first, then deliberate widenings; never brand-by-brand
96
+ enumeration.
102
97
 
103
98
  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.
99
+ plus a fully-resolved request **passes straight through, asking nothing**. It gates
100
+ only `sil_search`-driven discovery — identity, a direct `sil_product_get` re-check,
101
+ and shopper-management run ungated.