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.
- package/CHANGELOG.md +56 -0
- package/dist/lib/bind-channel.js +10 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/scripts/create-shopper.mjs +176 -14
- package/sil-shopping/SKILL.md +97 -54
- package/sil-shopping/examples/multi_domain_shopper_walkthrough.md +64 -136
- package/sil-shopping/references/agent_creation_engine.md +112 -63
- package/sil-shopping/references/brainstorm_interview.md +95 -69
- package/sil-shopping/references/catalog_tools_reference.md +27 -29
- package/sil-shopping/references/manage_domains.md +60 -39
- package/sil-shopping/references/refine_shopper.md +92 -43
- package/sil-shopping/references/search_param_mapping.md +71 -47
- package/sil-shopping/references/setup_onboarding.md +68 -0
- package/sil-shopping/references/shop_loop.md +154 -124
|
@@ -1,71 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
This is a **conversation, not a form-fill** — and a **short** one. Because you **pre-seed** from the session, you open by **reflecting a filled draft back**, not with a cold question. The shopper is a **generalist**: it goes deep on whatever the user later buys, **lazily minting a domain on first shop in each niche**. So onboarding does **NOT** research any niche and does **NOT** ask the user to pick one. It touches exactly **two** things: the **persona** (how their shopper should behave) and a **shared user-spec seed** (cross-niche facts + hard constraints). Everything niche-specific — how to shop a niche well, what each request in it should resolve, the niche shopping taste — is **deferred to first shop**, not authored here.
|
|
6
|
-
|
|
7
|
-
## Session pre-seed — open with a reflected draft, never a cold question
|
|
8
|
-
|
|
9
|
-
Before you ask anything, assemble a **draft** from what the user has **already said** *this session*: the **persona** (their own words on how the shopper should behave) and the **shared user-spec seed** (any sizes, hard limits, or ethics rules they mentioned in passing). Then **open by reflecting that draft back** — *"from what you've told me, here's the shopper I'd set up…"* — and ask only to **confirm-or-adjust**. That is the **rich** (a filled draft, so the shopper demonstrably listened) + **light** (one confirm) shape.
|
|
10
|
-
|
|
11
|
-
- **Pre-seed, don't interrogate.** **Pre-fill** the persona + the shared `user_spec` from the session; ask only to fill genuine gaps, never to re-collect what the user already told you.
|
|
12
|
-
- **Never invent facts you did not hear.** If the session gave little, seed a **minimal honest** draft ("cross-niche facts to be learned as we shop; no hard constraints stated yet") and say so — never fabricate a size or a limit.
|
|
13
|
-
- **Session-only — local + offline.** The seed is assembled **only** from this conversation. It does **NOT** pull `sil_whoami`, reads **no** token, and makes no network call. (The shopper registers the user later, on first shop, via `sil_register` — never a prerequisite here.)
|
|
14
|
-
- **The endorsement gate is untouched.** A rich pre-fill is a **proposal**, never consent — see the gate in §3 below.
|
|
15
|
-
|
|
16
|
-
## The two onboarding touchpoints — persona + shared user spec
|
|
17
|
-
|
|
18
|
-
A created shopper runs on a persona (`SOUL.md`) plus the **shared, agent-level `user_spec.md`**, both seeded here. The per-domain packs are minted lazily at shop time, not at onboarding.
|
|
19
|
-
|
|
20
|
-
| Artefact | Where | What it holds | Seeded |
|
|
21
|
-
|---|---|---|---|
|
|
22
|
-
| **`SOUL.md`** (persona) | host workspace (via host CLI) | the shopper's identity / voice / standing rules — a **generalist**, not a niche specialist | pre-seeded from the session (§1 below); refined on persona refine, stable per query |
|
|
23
|
-
| **`user_spec.md`** (shared) | sil data dir (**required**) | the user's **cross-niche** facts + hard constraints (addresses, sizes, allergy/ethics rules, budget psychology) | pre-seeded partial from the session (§2); augmented every query, reused across **every** niche |
|
|
24
|
-
|
|
25
|
-
The niche packs — the deep niche know-how, the per-request template a query is resolved against, and the niche shopping taste — are **NOT** authored here; they are minted **on first shop in each niche** ([`shop_loop.md`](shop_loop.md)). The per-query fill (the template filled in for one request) is **ephemeral** — never persisted, never authored here.
|
|
26
|
-
|
|
27
|
-
## Principles for the interview
|
|
28
|
-
|
|
29
|
-
- **Pre-seed from the session; open with the draft.** Assemble the persona + shared user-spec draft from what the user already said, and lead with it (reflect-back), not a cold questionnaire. The interview is **rich but light** — a filled draft plus one confirm-or-adjust per touchpoint.
|
|
30
|
-
- **Two touchpoints, no niche research.** Touch the persona and the shared user spec — that is the whole onboarding. The shopper is a **generalist**; there is **no narrow-the-niche step** and **no domain interview**. The deep niche expertise is researched **lazily, at first shop**, never interrogated here.
|
|
31
|
-
- **The persona question shapes voice, not a niche.** The persona surfaces the **voice / standing rules** — terse vs. chatty, cautious vs. opinionated, any never-break rules. It does **not** bind the shopper to one niche.
|
|
32
|
-
- **Seed the shared facts, ask little.** The shared user spec holds cross-niche facts + hard constraints that carry across every niche. Seed what the user volunteered — don't run a questionnaire; the rest is **augmented per-query** at shop time.
|
|
33
|
-
- **Converge, don't accumulate.** Reflect a short summary back and get a yes/adjust before advancing. The flow is **collaborative** and **re-entrant** — the user can revise an earlier touchpoint at any point.
|
|
34
|
-
- **Endorsement is a gate, not a formality.** Until the user explicitly says "create it", run **zero** engine steps. The draft lives only in the conversation.
|
|
1
|
+
---
|
|
2
|
+
name: brainstorm-interview
|
|
3
|
+
description: The two-touchpoint shopper onboarding — persona + shared user-spec seed, converged with the user and endorsement-gated. Load when the user asks to set up or create their shopper.
|
|
4
|
+
---
|
|
35
5
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
### 1. `SOUL.md` — persona + behaviour (a generalist shopper), pre-seeded
|
|
39
|
-
|
|
40
|
-
Open by **reflecting the session-seeded persona draft back** ("from what you've told me, your shopper sounds like…"), then confirm-or-adjust its **voice/tone** (terse vs. chatty, cautious vs. opinionated) and any **standing rules** it should always follow. Only ask the persona/identity question cold if the session gave you nothing to reflect. This is the shopper's **system framing**, a **generalist** that will shop whatever the user buys — **not** a niche choice; the niche is decided later, per query, when the user actually shops. This becomes the host workspace **`SOUL.md`** (the persona is the agent's system framing — **not** a sil artefact, no `persona.md`).
|
|
41
|
-
|
|
42
|
-
### 2. `user_spec.md` (shared) — seed the cross-niche facts + hard constraints
|
|
43
|
-
|
|
44
|
-
**Pre-fill** the **shared user spec** from the session: the user's **cross-niche** facts and any **hard constraints** that should hold in *every* niche — addresses / sizes the user volunteered, an allergy or ethics rule ("never leather"), a budget psychology. Reflect the pre-filled seed back and mark each as **hard** (inviolable — an allergy, an ethics rule, an age gate) vs **soft** (a bendable preference). Don't run a questionnaire — seed what the user offered; the rest is **augmented per-query** at shop time, and a niche-specific fact is learned when that niche is first shopped. If the user gave little, seed a minimal honest body (e.g. "cross-niche facts to be learned as we shop; no hard constraints stated yet") — non-blank, but partial. This lands in `userSpec` (→ the shared `user_spec.md`). **No niche taste, no domain question, no intent dimensions are gathered here** — those belong to first-shop lazy mint.
|
|
45
|
-
|
|
46
|
-
### 3. Derive the identity, assemble, endorse
|
|
47
|
-
|
|
48
|
-
- **Identity.** Propose an `agentId` (lower-kebab, `^[a-z0-9][a-z0-9-]*$`, never `main`) and a human-readable `name` ("My Shopper" / `my-shopper`). **Confirm both** — never silently invent them.
|
|
49
|
-
- **Assemble + present.** Compose **`{ agentId, name, persona, userSpec }`** and present a **readable summary**: who the shopper is (its persona/voice + standing rules) and the **seeded shared user spec** (cross-niche facts + hard constraints, partial, to grow per-query). Self-check the shape against the engine's contract: `agentId` lower-kebab & ≠ `main` (it keys the host `openclaw agents add`, not the sil tool), non-blank `name`/`persona`, and a non-blank shared `userSpec` — the only sil artefact at create (the engine passes just `name` + `userSpec` to the singleton `sil_profile_materialize`; no niche pack is authored here). This is shape-only — it writes nothing; the engine's validate-first step is the authoritative gate.
|
|
50
|
-
- **Endorse — the gate.** Ask for an explicit go-ahead ("shall I create your shopper?"). Endorsement is an **affirmative user act** on the assembled draft — "yes, create it" / "go ahead". It is **NOT** inferred from the user answering the last question, and **NOT** from silence. **Only on that explicit endorsement** do you proceed to the engine ([`agent_creation_engine.md`](agent_creation_engine.md)) and run the one command.
|
|
51
|
-
|
|
52
|
-
## Edge cases the interview handles gracefully
|
|
53
|
-
|
|
54
|
-
- **A shopper already exists (the singleton).** The shopper is a singleton — the engine refuses a second create (its `collision` outcome, "a shopper already exists") and never clobbers the existing one. Surface it and steer 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, never silently mutate the existing one.
|
|
55
|
-
- **Abandon mid-flow.** Because **no engine step runs before endorsement**, abandonment leaves **nothing created** — no host agent, no artefacts, no wiring, no teardown. Never "save progress" by writing artefacts early.
|
|
56
|
-
- **Creation is local + offline (for the user's identity).** Creating a shopper neither requires nor performs sil registration. Do **NOT** present sil registration or a token as a prerequisite to create the shopper; the session seed does **not** pull `sil_whoami`, reads no token, and never reaches the network. It registers the user later, on first shop, via `sil_register`. (No web access is needed at onboarding either — the niche research that reaches the web happens later, at first shop.)
|
|
57
|
-
|
|
58
|
-
## Business rules (invariants the interview holds on every path)
|
|
59
|
-
|
|
60
|
-
1. **No creation without explicit endorsement.** Nothing is written — not the host agent, the `SOUL.md`, the shared user spec, or the wiring — until the user explicitly endorses. The draft lives only in the conversation until then.
|
|
61
|
-
2. **Abandon-mid-flow creates nothing.** No engine step runs pre-endorsement (**zero engine steps** before the explicit "yes"), so an abandoned interview leaves no partial shopper — automatic, not a teardown. Nothing is created, nothing partial.
|
|
62
|
-
3. **Two touchpoints only — persona, then shared user spec.** `SOUL.md` (persona/voice, a generalist, NOT a niche) and the shared `user_spec.md` (cross-niche facts + hard constraints), both **pre-seeded from the session**. **No** niche know-how, no niche shopping taste, and no per-request template work at onboarding — those move to first-shop lazy mint.
|
|
63
|
-
4. **No niche is researched or chosen at onboarding.** The shopper is a generalist; the deep niche know-how, the per-request template, and the niche shopping taste are minted **lazily, on first shop** in each niche ([`shop_loop.md`](shop_loop.md)). Onboarding never interrogates a niche or asks the user to pick one.
|
|
64
|
-
5. **Converge each touchpoint before advancing; stay re-entrant.** Reflect-and-confirm per touchpoint; let the user revise an earlier one.
|
|
65
|
-
6. **Singleton: refuse a second shopper; never clobber.** Defer to the engine's `collision` refusal ("a shopper already exists"); steer to shop-a-new-niche or refine.
|
|
66
|
-
7. **Creation is local + offline for the user's identity.** Never present sil registration / a token as a prerequisite to create, and never pull `sil_whoami` to seed — the seed is session-only.
|
|
67
|
-
8. **The persona is the host `SOUL.md`, not a sil artefact.** No `persona.md` in the sil store. The only sil artefact seeded at create is the **shared** `user_spec.md`; the niche packs (the deep niche know-how, the per-request template, the niche shopping taste) are minted later, per niche.
|
|
68
|
-
|
|
69
|
-
## After endorsement
|
|
6
|
+
# Set up your shopper — the onboarding interview
|
|
70
7
|
|
|
71
|
-
|
|
8
|
+
When the user asks to **set up shopping** — "create my shopper", "set up an agent
|
|
9
|
+
that shops for me" — do **not** jump to the engine. Run a short, **two-touchpoint**
|
|
10
|
+
onboarding that shapes the shopper *with* the user — **pre-seeded from what they
|
|
11
|
+
already said this session** — then create nothing until the user endorses the
|
|
12
|
+
assembled draft. The engine ([`agent_creation_engine.md`](agent_creation_engine.md))
|
|
13
|
+
runs only **after** that explicit endorsement.
|
|
14
|
+
|
|
15
|
+
This is a **conversation, not a form-fill** — and a short one. The shopper is a
|
|
16
|
+
**generalist**: it goes deep on whatever the user later buys, **lazily minting a
|
|
17
|
+
domain on first shop** in each niche. So onboarding does **not** research any niche
|
|
18
|
+
and does **not** ask the user to pick one. It touches exactly **two** things: the
|
|
19
|
+
**persona** (how the shopper behaves) and a **shared user-spec seed** (cross-niche
|
|
20
|
+
facts + hard constraints).
|
|
21
|
+
|
|
22
|
+
## Open with a reflected draft, not a cold question
|
|
23
|
+
|
|
24
|
+
Before asking anything, **pre-seed** a draft from what the user already said *this
|
|
25
|
+
session*: the **persona** (their words on how the shopper should behave) and the
|
|
26
|
+
**shared user-spec seed** (any sizes, hard limits, or ethics rules mentioned in
|
|
27
|
+
passing). Then **open by reflecting that draft back** — *"from what you've told me,
|
|
28
|
+
here's the shopper I'd set up…"* — and ask only to confirm-or-adjust. That is the
|
|
29
|
+
rich (a filled draft) + light (one confirm) shape.
|
|
30
|
+
|
|
31
|
+
- **Pre-fill, don't interrogate.** Ask only to fill genuine gaps, never to re-collect
|
|
32
|
+
what the user already told you. If the session gave little, seed a **minimal
|
|
33
|
+
honest** draft ("cross-niche facts to be learned as we shop; no hard constraints
|
|
34
|
+
stated yet") and say so — never fabricate a size or a limit.
|
|
35
|
+
- **Session-only — local + offline.** The seed is assembled **only** from this
|
|
36
|
+
conversation. It reads **no token**, does **not** pull `sil_whoami`, and makes **no
|
|
37
|
+
network call**. (The shopper registers the user later, on first shop.)
|
|
38
|
+
- **The pre-fill is a proposal, never consent.** The endorsement gate below is
|
|
39
|
+
untouched.
|
|
40
|
+
|
|
41
|
+
## The two touchpoints
|
|
42
|
+
|
|
43
|
+
| Artefact | Where | What it holds |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| **`SOUL.md`** (persona) | host workspace | the shopper's voice / standing rules — a **generalist**, not a niche specialist |
|
|
46
|
+
| **`user_spec.md`** (shared) | sil data dir (**required**) | the user's **cross-niche** facts + hard constraints (addresses, sizes, allergy/ethics rules, budget psychology) |
|
|
47
|
+
|
|
48
|
+
The niche packs — the deep niche know-how, the per-request template, and the niche
|
|
49
|
+
shopping taste — are **not authored here**; they are **minted lazily on first shop**
|
|
50
|
+
in each niche ([`shop_loop.md`](shop_loop.md)). Never research a niche here.
|
|
51
|
+
|
|
52
|
+
**1. Persona — reflect back, confirm.** Open by reflecting the session-seeded persona
|
|
53
|
+
draft ("from what you've told me, your shopper sounds like…"), then confirm-or-adjust
|
|
54
|
+
its **voice/tone** and any **standing rules**. This surfaces voice, **not a niche** —
|
|
55
|
+
a generalist that shops whatever the user buys. It becomes the host workspace
|
|
56
|
+
**`SOUL.md`** (no `persona.md`).
|
|
57
|
+
|
|
58
|
+
**2. Shared user spec — seed the cross-niche facts + hard constraints.** Pre-fill the
|
|
59
|
+
**shared user spec** from the session: **cross-niche** facts and any **hard
|
|
60
|
+
constraints** that should hold in *every* niche — addresses / sizes, an allergy or
|
|
61
|
+
ethics rule ("never leather"), a budget psychology. Reflect the seed back and mark
|
|
62
|
+
each **hard** (inviolable) vs **soft** (bendable). Seed what the user offered; the
|
|
63
|
+
rest is augmented per-query at shop time. This lands in `userSpec` (→ the shared
|
|
64
|
+
`user_spec.md`). **No niche taste, no domain question, no intent dimensions** are
|
|
65
|
+
gathered here.
|
|
66
|
+
|
|
67
|
+
## Assemble + endorse
|
|
68
|
+
|
|
69
|
+
- **Identity.** Propose an `agentId` (lower-kebab, `^[a-z0-9][a-z0-9-]*$`, never
|
|
70
|
+
`main`) and a `name` ("My Shopper" / `my-shopper`). Confirm both.
|
|
71
|
+
- **Assemble + present.** Compose **`{ agentId, name, persona, userSpec }`** and
|
|
72
|
+
present a readable summary: who the shopper is and the seeded shared user spec
|
|
73
|
+
(partial, to grow per-query). Self-check the shape — `agentId` lower-kebab & ≠
|
|
74
|
+
`main`, non-blank `name`/`persona`, non-blank shared `userSpec` (the only sil
|
|
75
|
+
artefact at create). This writes nothing; the engine's validate-first step is the
|
|
76
|
+
authoritative gate.
|
|
77
|
+
- **Endorse — the gate.** Ask for an explicit go-ahead ("shall I create your
|
|
78
|
+
shopper?"). Endorsement is an affirmative act on the assembled draft — "yes, create
|
|
79
|
+
it". It is **not** inferred from the last answer and **not** from silence. **Only on
|
|
80
|
+
that explicit endorsement** do you proceed to the engine
|
|
81
|
+
([`agent_creation_engine.md`](agent_creation_engine.md)).
|
|
82
|
+
|
|
83
|
+
## Invariants (hold on every path)
|
|
84
|
+
|
|
85
|
+
- **No creation without explicit endorsement.** **Zero engine steps** run before the
|
|
86
|
+
explicit "yes"; the draft lives only in the conversation. **Nothing is created**
|
|
87
|
+
until then, so an abandoned interview leaves no partial shopper.
|
|
88
|
+
- **Two touchpoints only** — persona, then shared user spec, both pre-seeded from the
|
|
89
|
+
session. No niche is researched or chosen here; that is first-shop lazy mint.
|
|
90
|
+
- **Converge each touchpoint before advancing; stay re-entrant** — the user can revise
|
|
91
|
+
an earlier touchpoint at any point.
|
|
92
|
+
- **Singleton.** If a shopper already exists, the engine refuses a second create (its
|
|
93
|
+
`collision`, "a shopper already exists") — surface it and steer to shop-a-new-niche
|
|
94
|
+
or refine; never clobber the existing one.
|
|
95
|
+
- **Local + offline for identity.** Never present sil registration or a token as a
|
|
96
|
+
prerequisite to create, and never pull `sil_whoami` to seed — the seed is
|
|
97
|
+
session-only.
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: catalog-tools-reference
|
|
3
|
+
description: Per-tool behaviour of the four core sil tools (register, whoami, search, product-get) and the shared status taxonomy. Load when driving any core catalog or identity tool.
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
`sil_whoami`, `sil_search`, `sil_product_get`. It holds how each tool behaves and
|
|
5
|
-
the status taxonomy every shopping tool shares. The router in `SKILL.md` names
|
|
6
|
-
which tool an intent maps to; this reference is what that tool actually does.
|
|
6
|
+
# sil catalog + identity tools — per-tool behaviour and the shared status taxonomy
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
Load this when driving any of the four core tools — `sil_register`, `sil_whoami`,
|
|
9
|
+
`sil_search`, `sil_product_get`. The router names which tool an intent maps to; this
|
|
10
|
+
reference is what each does, plus the status taxonomy they all share. All four return a
|
|
11
|
+
single JSON body carrying a `status`; prices are in the currency's ISO 4217 minor unit.
|
|
11
12
|
|
|
12
|
-
##
|
|
13
|
+
## Per-tool behaviour
|
|
13
14
|
|
|
14
|
-
- **`sil_register`** starts browser-based registration
|
|
15
|
-
`status: "awaiting_browser"` and an `auth_url` — share that URL
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **`sil_whoami`** returns the registered user's identity (name
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
- **`sil_register`** starts browser-based registration: it returns promptly with
|
|
16
|
+
`status: "awaiting_browser"` and an `auth_url` — share that URL. The plugin polls in
|
|
17
|
+
the background; once the user signs in, call `sil_register` again to confirm (it
|
|
18
|
+
reports `already_registered`).
|
|
19
|
+
- **`sil_whoami`** returns the registered user's identity (name + addresses). An expired
|
|
20
|
+
token is refreshed transparently; a fully-dead session names the recovery
|
|
21
|
+
(`sil_register`).
|
|
21
22
|
- **`sil_search`** returns a ranked list of purchasable variants (`id`, `title`,
|
|
22
|
-
`price`, `availability`, `checkout_url`, `source`), best match first — present
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
to the id(s) asked about (the response is NOT in request order). Ids that no
|
|
30
|
-
longer resolve come back in a `not_found` list — a normal partial-success
|
|
31
|
-
outcome, not an error; the other products are still valid.
|
|
23
|
+
`price`, `availability`, `checkout_url`, `source`), best match first — present in
|
|
24
|
+
order, do not re-rank. An empty list is a normal `ok` outcome, not an error. Use the
|
|
25
|
+
returned `cursor` for the next page; its absence means no more results.
|
|
26
|
+
- **`sil_product_get`** is the lookup companion — pass ids you already hold and get the
|
|
27
|
+
matching products back with fresh detail. Each variant carries an `inputs` list
|
|
28
|
+
correlating it to the id(s) asked about (the response is not in request order). Ids
|
|
29
|
+
that no longer resolve come back in a `not_found` list — a normal partial success.
|
|
32
30
|
|
|
33
31
|
## Status taxonomy (shared across the shopping tools)
|
|
34
32
|
|
|
@@ -41,6 +39,6 @@ cents).
|
|
|
41
39
|
| `invalid_request` | The query/ids were rejected (e.g. empty input). | Fix the input and call again — do NOT re-register. |
|
|
42
40
|
| `retryable` | A transient network/5xx blip. | Try the same call again — do NOT re-register. |
|
|
43
41
|
|
|
44
|
-
On a non-`ok` status, say what happened and follow the tool's own `recovery`
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
On a non-`ok` status, say what happened and follow the tool's own `recovery` hint —
|
|
43
|
+
never improvise a different one (re-registering can't fix a bad query or a transient
|
|
44
|
+
5xx).
|
|
@@ -1,56 +1,77 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
name: manage-domains
|
|
3
|
+
description: View or forget the shopper's learned domains — the two sil_profile tools, the two remove granularities, confirm-before-remove. Load when the user wants to see what the shopper knows or forget a niche.
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
# Manage your shopper's domains — view, forget
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
Load this when the user wants to see what their **shopper** knows or **forget a domain**
|
|
9
|
+
(a niche) — "what does my shopper know?", "which domains has it learned?", "show me the
|
|
10
|
+
cycling domain", "forget the grocery niche". The router names which `sil_profile_*` tool
|
|
11
|
+
each intent maps to; this reference is what those tools do, plus the **two remove
|
|
12
|
+
granularities** and the confirm-before-remove gate.
|
|
6
13
|
|
|
7
|
-
|
|
14
|
+
These are pure local-lifecycle operations — no server call, no token read. The shopper is
|
|
15
|
+
a **singleton** scoped to the fixed `$SIL_DATA_DIR/shopper/` path, so these tools take
|
|
16
|
+
**no caller `agentId`** — only an optional `domainSlug`. **The source of truth is the sil
|
|
17
|
+
artefact store, not the host agent list:** `$SIL_DATA_DIR/shopper/` with a readable
|
|
18
|
+
`profile.json` IS the shopper; its `domains` map is the niche index. Always read
|
|
19
|
+
`profile.json`, **never the host agent list**, to decide what exists.
|
|
8
20
|
|
|
9
21
|
## Match intent to a tool
|
|
10
22
|
|
|
11
23
|
| Intent | Tool |
|
|
12
24
|
|---|---|
|
|
13
|
-
| "what does my shopper know?" / "which domains has it learned?"
|
|
25
|
+
| "what does my shopper know?" / "which domains has it learned?" (overview) | `sil_profile_get` (no `domainSlug`) |
|
|
14
26
|
| "show me / tell me about the <niche> domain" | `sil_profile_get` (pass the `domainSlug`) |
|
|
15
27
|
| "forget / remove / delete the <niche> domain" | `sil_profile_remove` (pass the `domainSlug`) |
|
|
16
|
-
| "decommission / tear down my whole shopper" | host CLI `openclaw agents remove <agentId>` **FIRST**, then clear the artefact tree
|
|
17
|
-
|
|
18
|
-
## How the
|
|
19
|
-
|
|
20
|
-
`
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
| "decommission / tear down my whole shopper" | host CLI `openclaw agents remove <agentId>` **FIRST**, then clear the artefact tree |
|
|
29
|
+
|
|
30
|
+
## How `sil_profile_get` reads the singleton shopper
|
|
31
|
+
|
|
32
|
+
- **No `domainSlug` (overview):** returns the `name`, the shared `userSpec` (cross-niche
|
|
33
|
+
facts + hard constraints), the **`domains` index** (each niche's `slug`/`name`/
|
|
34
|
+
timestamps — no bodies), plus any degraded directory in **`unreadable`**. A shopper
|
|
35
|
+
with **no domains yet still reads `ok`, empty index — healthy** (the first shop mints
|
|
36
|
+
one); so does an empty store ("you haven't set up a shopper yet" → point at create —
|
|
37
|
+
still `ok`, never `not_found`). Render a human summary (shopper, what it knows, domains
|
|
38
|
+
learned, wiring); a flat-layout leftover from the old one-agent-per-niche model reads
|
|
39
|
+
as `unreadable` — frame it as an old-model leftover, do not read it as a domain.
|
|
40
|
+
- **With a `domainSlug`:** returns that niche's pack (`domainSpec` + `intentSpec` +
|
|
41
|
+
`playbook`) plus the shared `userSpec`. An unminted/unloadable domain returns
|
|
42
|
+
`not_found` (its `recovery` is the no-args `sil_profile_get`) — frame it plainly and
|
|
43
|
+
list what DOES exist. **Never surface a stack trace or a raw filesystem path.**
|
|
44
|
+
|
|
45
|
+
## The two remove granularities
|
|
46
|
+
|
|
47
|
+
Removal is **destructive and irreversible**, so **confirm before removing**: state
|
|
48
|
+
exactly what will be deleted and proceed only on the user's **explicit go-ahead**. When
|
|
49
|
+
ambiguous, ask.
|
|
50
|
+
|
|
51
|
+
**Forget ONE domain (`sil_profile_remove`).** "forget the grocery niche", "remove the
|
|
52
|
+
cycling domain", **"delete the grocery agent"** all mean **forget that one DOMAIN** — the
|
|
53
|
+
niche pack only. The shopper, the shared user spec, and every **sibling domain survive**;
|
|
54
|
+
no host wiring is touched. Call **`sil_profile_remove { domainSlug }`** — `domainSlug` is
|
|
55
|
+
**REQUIRED**. A malformed/traversal/`main`/missing slug returns `invalid_request` and
|
|
56
|
+
deletes nothing; an unregistered slug returns `not_found` (idempotent); a filesystem
|
|
57
|
+
failure returns `persistence_failed`.
|
|
58
|
+
|
|
59
|
+
**Decommission the WHOLE shopper (host-CLI-first).** Remove the entire shopper — host
|
|
60
|
+
wiring + `SOUL.md` + the whole artefact tree: (1) `openclaw agents list --json` to
|
|
61
|
+
confirm the `agentId`; (2) `openclaw agents remove <agentId>` then `openclaw config
|
|
62
|
+
validate --json` — the plugin cannot write host config, so this half runs **first**; (3)
|
|
63
|
+
clear the whole `$SIL_DATA_DIR/shopper/` tree. Host-first is a safety order: a failed
|
|
64
|
+
artefact step after the host removal leaves only harmless residual artefacts, whereas the
|
|
65
|
+
reverse leaves a host entry whose `profile.json` is gone — a visibly broken shopper. Both
|
|
66
|
+
halves are idempotent. Leave `plugins.entries.sil.enabled` alone — it is shared host
|
|
67
|
+
state for a future re-create.
|
|
47
68
|
|
|
48
69
|
## Status taxonomy (manage: view / remove)
|
|
49
70
|
|
|
50
71
|
| `status` | Meaning | What to do |
|
|
51
72
|
|---|---|---|
|
|
52
|
-
| `ok` | A view returned the overview (a
|
|
53
|
-
| `not_found` | No domain matches the `domainSlug
|
|
54
|
-
| `invalid_request` | The `domainSlug` was malformed, `main`, traversal-shaped, or (remove) missing. **Nothing
|
|
73
|
+
| `ok` | A view returned the overview (a `domains` map may be empty — normal; an absent shopper is still `ok`) or one domain's detail. | Relay the data; on an empty index, point at "just shop a niche". |
|
|
74
|
+
| `not_found` | No domain matches the `domainSlug`. Its `recovery` is the no-args `sil_profile_get`. | Frame it plainly and list what DOES exist; for remove, a re-run is safe. |
|
|
75
|
+
| `invalid_request` | The `domainSlug` was malformed, `main`, traversal-shaped, or (remove) missing. **Nothing read or deleted.** | Fix the slug and call again — never a stack trace or raw path. |
|
|
55
76
|
| `removed` | `sil_profile_remove` deleted exactly one domain pack. | Confirm that niche is gone; the shopper + shared user spec + sibling domains are untouched. |
|
|
56
77
|
| `persistence_failed` | The domain directory could not be removed (the **path** + **cause** name what to fix). | Fix the data directory (writable), then remove again. |
|
|
@@ -1,48 +1,97 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Refine has **two targets** — pick the one the user means:
|
|
6
|
-
|
|
7
|
-
- **The shopper itself** — the **shared `user_spec.md`** (cross-niche facts + hard constraints that carry across every niche), or the **persona** (the host `SOUL.md`).
|
|
8
|
-
- **One domain** — a single niche pack (target it by **slug**): its `domain_spec.md` (niche mechanics), `intent_spec.md` (decomposition dimensions), or `playbook.md` (the niche buying taste).
|
|
9
|
-
|
|
10
|
-
This is a distinct capability from creating the shopper ([`agent_creation_engine.md`](agent_creation_engine.md), which CREATES) and from the shop-time loop (which SHOPS). The default is a **targeted amend**, not a full cold re-onboard. Run these steps **in order, top to bottom** — the order is the spec.
|
|
11
|
-
|
|
12
|
-
## The refinement loop (run in this exact order)
|
|
13
|
-
|
|
14
|
-
1. **Trigger + load the target.** Refinement starts only when the user **explicitly asks** to sharpen the shopper or a **named** domain. At the end of a session you MAY *offer* to refine — but that offer is a prompt only: it loads nothing, proposes nothing, and persists nothing until the user accepts and then clears the explicit confirm gate in step 3. An ambiguous, silent, or off-topic remark is **never** a trigger. Once triggered, load the relevant artefacts with **`sil_profile_get { domainSlug? }`**:
|
|
15
|
-
- To refine the **shopper**, load the **overview** (no `domainSlug`) — the shared `userSpec` + the domain index.
|
|
16
|
-
- To refine **one domain**, pass its **`domainSlug`** — its `domainSpec` / `intentSpec` / `playbook` bodies **plus** the shared `userSpec`.
|
|
17
|
-
The persona is the host workspace **`SOUL.md`**, read separately when a persona refinement is on the table. Everything you propose is grounded in what the shopper already is.
|
|
18
|
-
|
|
19
|
-
2. **Propose, session-grounded — concretely, never a generic template.** Propose a small set of **concrete refinements drawn from the observed session** — what the shopper actually saw in the just-completed (or in-progress) session. Each proposal must name **two things**:
|
|
20
|
-
- **which artefact element it changes** — a **persona** standing rule (the host `SOUL.md`), a **shared user-spec** fact or hard constraint (`user_spec.md` — e.g. a standing measurement, "never leather" as a hard constraint — carries across every niche), or, within **one named domain**, a **domain-spec** mechanic (`domain_spec.md`), an **intent-spec** dimension (`intent_spec.md`), or a **buying-taste** preference (`playbook.md` — a brand the user keeps rejecting in this niche, a tightened budget band); and
|
|
21
|
-
- **the concrete observed evidence behind it** — a `sil_search` param mapping that returned **relevant** vs **irrelevant** items, a question that turned out to matter (or was noise), a candidate the user **accepted** or **rejected**, or a fact/taste/constraint the user **volunteered but the spec never captured** (e.g. "you said 'nothing over 8kg' three times" → a shared `user_spec.md` hard constraint; "you rejected every leather option" → a shared hard constraint; "you kept asking about lug depth, which the cycling domain spec never covered" → that domain's `domain_spec.md` mechanic; "every cycling request turned on frame size, but its intent schema never decomposed on it" → that domain's `intent_spec.md` dimension).
|
|
22
|
-
|
|
23
|
-
**Scope each proposal correctly:** a cross-niche fact/constraint or persona change targets the **shopper** (shared `user_spec.md` / `SOUL.md`); a niche-mechanical change targets **one domain's** pack. The **per-query intent** is ephemeral and is never a refine target — only a domain's `intent_spec.md` *dimension schema* is. Every proposal cites the observed evidence — it is **grounded**, not guesswork; a proposal not tied to anything the session showed is forbidden. (When the observed session is unavailable, do not invent one — see the fallback at the foot of this reference.)
|
|
1
|
+
---
|
|
2
|
+
name: refine-shopper
|
|
3
|
+
description: The refinement loop — sharpen the shopper or one domain from observed sessions, confirm-before-persist. Load when the user asks to refine, sharpen, or amend their shopper or a niche.
|
|
4
|
+
---
|
|
24
5
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
4. **Persist ONLY the confirmed subset — scoped to the right target.** Fold **only the confirmed** proposals into the right artefact, then re-run the engine's persist step over the matching target — refine is a **whole-doc path**, so it uses **`sil_profile_materialize`** (not `sil_remember`):
|
|
28
|
-
- A **shared user-spec** change (cross-niche fact / hard constraint) → **`sil_profile_materialize { name, userSpec }`** with **NO `domain`** — read the current shared `userSpec`, fold the confirmed change in, pass it back. This overwrites only the shared `user_spec.md`; no domain pack is touched.
|
|
29
|
-
- A **domain** change (a domain-spec mechanic, an intent-spec dimension, or a buying-taste preference for one niche) → **`sil_profile_materialize { name, userSpec, domain: { slug, name, domainSpec, intentSpec, playbook } }`** scoped to **that one slug** — read the current pack, fold the confirmed change into the relevant body, pass all three domain bodies (+ the unchanged shared `userSpec`) back. This re-mints exactly that one `domains/<slug>/` pack; sibling domains and the shared spec are untouched.
|
|
30
|
-
- A **persona** change → refresh the agent's workspace **`SOUL.md`** via the host CLI — the persona is the `SOUL.md`, not a sil artefact, so a persona refinement is a host-CLI `SOUL.md` re-write, **NOT** a `sil_profile_materialize` call.
|
|
31
|
-
|
|
32
|
-
The unconfirmed proposals are **discarded** with the conversation; nothing else persists. If the user confirms nothing, nothing changes. The re-materialize is an **atomic in-place re-write** of the targeted artefact(s) (the store's existing idiom; do **not** hand-roll a write under the sil data directory). **On a persist failure the prior artefacts are left intact** — the shopper is never served half-refined, and you tell the user the refinement **did not stick**. *Truthful failure-safety note: the re-write is per-file atomic and dir-preserving — a failed re-write never tears the shopper down and never serves a coherent half-refined pack (a broken manifest reads back as not-found, fail-closed). It is **not** a cross-file transaction; the safety property is "fails closed, prior state intact / never half-served", not "all files roll back together".*
|
|
33
|
-
|
|
34
|
-
5. **Close the loop — the refined shopper reflects the kept changes on re-run.** A later session loads the **updated** artefacts (the same Runtime hook the engine documents) and behaves accordingly — the new shared hard-no, the deeper cycling domain spec, the sharper intent dimensions, the tightened niche taste. The improvement is durable: refinement is **iterative, never one-shot** — a change that did not land well is itself refinable next time.
|
|
35
|
-
|
|
36
|
-
6. **Isolation — the targeted artefact only.** A domain refinement touches exactly that one `domains/<slug>/` pack — **siblings and the shared user spec are untouched** (unless the shared spec is the target). A shared-spec or persona refinement touches the shopper level and **no domain pack**. And the **generic, profile-less shopping path is untouched** (a plain sil session still shops exactly as today). One target's sharpening never leaks into another.
|
|
37
|
-
|
|
38
|
-
## Privacy + scope — per-user and local
|
|
39
|
-
|
|
40
|
-
The improvement is **per-user and local**: written only to this user's sil data directory (`$SIL_DATA_DIR/shopper/`), on this machine. There is **no server-side aggregation, no shared store, no cross-user signal** — the refine path calls **no server endpoint** and performs **no identity round-trip**. The shopper gets sharper for this user alone; nothing is pooled or shared.
|
|
41
|
-
|
|
42
|
-
## How a refinement reaches the `sil_search` params
|
|
6
|
+
# Refine your shopper or one of its domains — the refinement loop
|
|
43
7
|
|
|
44
|
-
|
|
8
|
+
When the user wants to **sharpen their shopper** — "refine my shopper", "the cycling
|
|
9
|
+
domain keeps surfacing the wrong stuff", "amend what you know about me" — do **not**
|
|
10
|
+
re-onboard and do **not** quietly mutate anything. Run this **targeted-amend** loop:
|
|
11
|
+
load the relevant artefact, propose refinements drawn from what the shopper actually
|
|
12
|
+
**observed** in real sessions, let the user **confirm a subset**, and persist **only**
|
|
13
|
+
the confirmed subset. Nothing changes silently; nothing persists without confirmation.
|
|
14
|
+
|
|
15
|
+
Refine has **two targets**:
|
|
16
|
+
|
|
17
|
+
- **The shopper itself** — the **shared `user_spec.md`** (cross-niche facts + hard
|
|
18
|
+
constraints), or the **persona** (the host `SOUL.md`).
|
|
19
|
+
- **One domain** — a single niche **domain pack**, targeted by **slug**: its
|
|
20
|
+
`domain_spec.md`, `intent_spec.md`, or `playbook.md`.
|
|
21
|
+
|
|
22
|
+
This is distinct from creating the shopper
|
|
23
|
+
([`agent_creation_engine.md`](agent_creation_engine.md)) and from the shop loop (which
|
|
24
|
+
SHOPS). Run the steps **in order**.
|
|
25
|
+
|
|
26
|
+
## The refinement loop
|
|
27
|
+
|
|
28
|
+
1. **Trigger + load the target.** Refinement starts only when the user **explicitly
|
|
29
|
+
asks** to sharpen the shopper or a **named** domain. At session end you MAY *offer*
|
|
30
|
+
to refine, but that offer loads/proposes/persists nothing until the user accepts and
|
|
31
|
+
clears the confirm gate (step 3). Load with **`sil_profile_get { domainSlug? }`** —
|
|
32
|
+
the overview (no slug) for the shopper, or a `domainSlug` for one domain's pack (+
|
|
33
|
+
the shared `userSpec`). Read the persona from the host **`SOUL.md`** when it is on
|
|
34
|
+
the table.
|
|
35
|
+
2. **Propose, session-grounded — never a generic template.** Propose a small set of
|
|
36
|
+
**concrete refinements drawn from the observed session** — what the shopper actually
|
|
37
|
+
saw. Each proposal names **which artefact element it changes** (a persona rule, a
|
|
38
|
+
shared `user_spec.md` fact/constraint, or — within one named domain — a
|
|
39
|
+
`domain_spec.md` mechanic, an `intent_spec.md` dimension, or a `playbook.md` taste)
|
|
40
|
+
**and the concrete observed evidence** (a param mapping that returned relevant vs
|
|
41
|
+
irrelevant items, a candidate accepted or rejected, a fact the user volunteered but
|
|
42
|
+
the spec never captured — "you said 'nothing over 8kg' three times" → a shared hard
|
|
43
|
+
constraint; "you kept asking about lug depth" → that domain's `domain_spec.md`).
|
|
44
|
+
Scope each correctly: a cross-niche fact/constraint or persona change targets the
|
|
45
|
+
**shopper**; a niche-mechanical change targets **one domain's** pack. The per-query
|
|
46
|
+
intent is ephemeral and never a refine target — only a domain's `intent_spec.md`
|
|
47
|
+
*schema* is. Every proposal cites its evidence; an ungrounded one is not proposed.
|
|
48
|
+
3. **Confirm — the gate.** Present the proposals and let the user **confirm a subset** —
|
|
49
|
+
all, some, or none (per-proposal accept/reject). Confirmation is an explicit
|
|
50
|
+
affirmative act; it is **never inferred from silence**, and never from an
|
|
51
|
+
**off-topic** reply. Until the user confirms, the proposals live only in the
|
|
52
|
+
conversation. (This re-applies the create engine's endorsement discipline — see
|
|
53
|
+
[`brainstorm_interview.md`](brainstorm_interview.md); do not restate it here.)
|
|
54
|
+
4. **Persist ONLY the confirmed subset — scoped to the right target.** Fold **only the
|
|
55
|
+
confirmed** proposals in and re-run the engine's persist step — refine is a
|
|
56
|
+
**whole-doc** path, so it uses **`sil_profile_materialize`** (not `sil_remember`):
|
|
57
|
+
- A **shared user-spec** change → **`sil_profile_materialize { name, userSpec }`**
|
|
58
|
+
with **no `domain`** — overwrites only the shared `user_spec.md`.
|
|
59
|
+
- A **domain** change → **`sil_profile_materialize { name, userSpec, domain: { slug,
|
|
60
|
+
name, domainSpec, intentSpec, playbook } }`** scoped to **that one slug** —
|
|
61
|
+
re-mints exactly that `domains/<slug>/` pack; siblings + the shared spec untouched.
|
|
62
|
+
- A **persona** change → refresh the workspace **`SOUL.md`** via the host CLI — a
|
|
63
|
+
persona refinement is a host-CLI `SOUL.md` re-write, **not** a
|
|
64
|
+
`sil_profile_materialize` call.
|
|
65
|
+
The re-materialize is an **atomic in-place re-write** (the store's idiom; do not
|
|
66
|
+
hand-roll a write). **On a persist failure the prior artefacts are left intact** —
|
|
67
|
+
never a half-refined shopper — and you tell the user the refinement did not stick.
|
|
68
|
+
5. **Close the loop.** A later session loads the **updated** artefacts and behaves
|
|
69
|
+
accordingly. Refinement is iterative — a change that did not land is refinable next
|
|
70
|
+
time.
|
|
71
|
+
6. **Isolation.** A domain refinement touches exactly that one `domains/<slug>/` pack —
|
|
72
|
+
**siblings and the shared user spec are untouched** unless the shared spec is the
|
|
73
|
+
target — and the profile-less path is untouched. One target's sharpening never leaks
|
|
74
|
+
into another.
|
|
75
|
+
|
|
76
|
+
## Per-user + local
|
|
77
|
+
|
|
78
|
+
The improvement is **per-user and local**: written only to this user's sil data
|
|
79
|
+
directory (`$SIL_DATA_DIR/shopper/`), on this machine. No server-side aggregation, no
|
|
80
|
+
cross-user signal, no identity round-trip.
|
|
81
|
+
|
|
82
|
+
## How a refinement reaches the params
|
|
83
|
+
|
|
84
|
+
A refined fact / mechanic / dimension / taste lands in an artefact and feeds the
|
|
85
|
+
**shop-time** mapping ([`search_param_mapping.md`](search_param_mapping.md)) — real
|
|
86
|
+
`sil_search` params only; a refinement with no matching param folds into `query` or the
|
|
87
|
+
rubric, never an invented filter. The `ship_to` rule is unchanged (leave it empty; the
|
|
88
|
+
server resolves the registered default). **Do not restate the param table here** — point
|
|
89
|
+
at [`search_param_mapping.md`](search_param_mapping.md).
|
|
45
90
|
|
|
46
91
|
## When there is no observed-session signal
|
|
47
92
|
|
|
48
|
-
If the user asks to refine but **no observed session** is available
|
|
93
|
+
If the user asks to refine but **no observed session** is available (a fresh session, or
|
|
94
|
+
the prior one is out of context), do **not fabricate** observations. Fall back to a
|
|
95
|
+
**guided amend**: ask the user what to change (apply the same confirm-before-persist
|
|
96
|
+
gate), or **invite them to shop a session first** so the next refinement has real
|
|
97
|
+
evidence. Never invent observations.
|