sil-openclaw 0.3.8 → 0.4.0
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 +116 -0
- package/dist/lib/bind-channel.js +10 -0
- package/dist/lib/profile-store.js +578 -581
- package/dist/lib/sil-client.js +282 -33
- package/dist/tools/catalog.js +485 -7
- package/dist/tools/profile.js +235 -371
- package/openclaw.plugin.json +6 -4
- package/package.json +1 -1
- package/scripts/create-shopper.mjs +188 -32
- package/sil-shopping/SKILL.md +85 -54
- package/sil-shopping/examples/multi_domain_shopper_walkthrough.md +56 -190
- package/sil-shopping/references/agent_creation_engine.md +113 -63
- package/sil-shopping/references/brainstorm_interview.md +95 -69
- package/sil-shopping/references/catalog_tools_reference.md +27 -29
- package/sil-shopping/references/fill_and_feedback.md +88 -0
- package/sil-shopping/references/method_and_prds.md +110 -0
- package/sil-shopping/references/search_param_mapping.md +72 -47
- package/sil-shopping/references/setup_onboarding.md +68 -0
- package/sil-shopping/references/shop_loop.md +117 -134
- package/sil-shopping/references/manage_domains.md +0 -56
- package/sil-shopping/references/refine_shopper.md +0 -48
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: setup-onboarding
|
|
3
|
+
description: The one-time setup script the router defers to — the five-stage onboarding progression, the after-register shopper offer, and the per-search pitch. Load while a shopper is still being set up (SKILL.md routes here); it is shed once setup is complete.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Setting up the shopper — the staged onboarding
|
|
7
|
+
|
|
8
|
+
The router defers the **one-time setup script** here: the five-stage **progression**, the
|
|
9
|
+
after-register offer, and the per-search pitch. None of it applies once setup is complete
|
|
10
|
+
— the router sheds it. Read every stage from state, never guess: `sil_whoami` (is there a
|
|
11
|
+
sil identity yet?) plus the no-arg `sil_profile_get` overview (does a shopper exist — the
|
|
12
|
+
`name` field — and does it hold any `domains`?). Present **only the current stage's beat
|
|
13
|
+
and its single next step**.
|
|
14
|
+
|
|
15
|
+
## The five-stage progression — present one stage, shed it on completion
|
|
16
|
+
|
|
17
|
+
1. **Unregistered** — `sil_whoami` finds no sil identity. Before `sil_register` runs, set
|
|
18
|
+
the expectation: state plainly what registering does and **how 4GPTs & SIL use the
|
|
19
|
+
user's data**, grounded strictly in this plugin — no invented policy. Registering opens
|
|
20
|
+
a browser sign-in and creates their **sil identity** (name + addresses, read by
|
|
21
|
+
`sil_whoami`), stored **locally**; their shopper's setup and memory live in a **local
|
|
22
|
+
profile store** under `$SIL_DATA_DIR`, never leaving the device via the plugin; catalog
|
|
23
|
+
**search** queries sil's product catalog. Next: `sil_register`.
|
|
24
|
+
2. **Registered, no shopper** — a sil identity exists, no shopper yet. Bare `sil_search`
|
|
25
|
+
works now, but is not the finished state. Guide the user to **set up their shopper**,
|
|
26
|
+
naming **up front, before the onboarding starts**, that it takes a **couple of minutes
|
|
27
|
+
and a few questions**. The after-register offer below owns the gate.
|
|
28
|
+
3. **Shopper, no domain yet** — `name` present, `domains: []`. The first shopping intent
|
|
29
|
+
**mints the first domain**, announced with the inferred niche stated so the user can
|
|
30
|
+
correct it. Next: state a shopping intent.
|
|
31
|
+
4. **Shopper active** — `name` present, `domains` non-empty. Check off the completion
|
|
32
|
+
**milestones**: the **first domain created** (`domains` now non-empty) and, softer, that
|
|
33
|
+
the learn tool has been used (`sil_learn` stored a fact or taste — a soft self-check
|
|
34
|
+
judged from whether this shopper has ever learned anything).
|
|
35
|
+
5. **Setup complete** — a shopper with at least one domain. **Shed** every onboarding beat:
|
|
36
|
+
none of the stages above apply. **Show only how to use** the plugin well — the
|
|
37
|
+
**domain-gated shop loop** and **Spec-Driven Shopping** ([`shop_loop.md`](shop_loop.md)).
|
|
38
|
+
|
|
39
|
+
## After register — offer to set up the shopper, once (offer_shopper)
|
|
40
|
+
|
|
41
|
+
`sil_register` returns `already_registered` with `next_step: "offer_shopper"` on a
|
|
42
|
+
confirmed registration. That hint is a breadcrumb: first run a **no-arg `sil_profile_get`**
|
|
43
|
+
(the overview) to read shopper state, then branch:
|
|
44
|
+
|
|
45
|
+
- **Empty store — no shopper yet:** introduce the shopper in one short beat and offer to
|
|
46
|
+
set it up — name the value (it shops each niche in depth, reuses the sizes and hard
|
|
47
|
+
limits it already knows so nothing is re-asked, explains why each pick fits). Load
|
|
48
|
+
[`brainstorm_interview.md`](brainstorm_interview.md) **only if the user accepts** (a
|
|
49
|
+
yes). Take no for an answer; bare `sil_search` stays first-class.
|
|
50
|
+
- **A shopper already exists:** **skip this beat** entirely. The shopper is a **singleton**
|
|
51
|
+
— never offer a second one.
|
|
52
|
+
|
|
53
|
+
## After a bare search — the per-search pitch (post-result)
|
|
54
|
+
|
|
55
|
+
When a plain `sil_search` **completes with status `ok`** in a **profile-less** session,
|
|
56
|
+
present the results best-first **exactly as they came back**, then append **one short
|
|
57
|
+
trailing line** naming what a shopper would add. It is never a pre-search question and
|
|
58
|
+
never a re-rank. Name one or two of the three levers, rotating which you lead with:
|
|
59
|
+
|
|
60
|
+
- **niche depth** — a shopper weighs these picks against how the niche actually buys;
|
|
61
|
+
- **memory** — it keeps your sizes and hard limits on file, so no search re-asks them;
|
|
62
|
+
- **the why** — it explains which pick fits you and why.
|
|
63
|
+
|
|
64
|
+
This line **recurs on every** completed profile-less search — the recurrence is the point;
|
|
65
|
+
there is **no fire-once or seen-it gate, and no cooldown**. Brevity plus lever rotation
|
|
66
|
+
keep it from nagging. Two things suppress it: a **shopper already exists** (that session is
|
|
67
|
+
the shopper's — **drop the line**), or the search **did not complete `ok`** (a non-ok
|
|
68
|
+
status carries its own recovery — follow that and add no tip).
|
|
@@ -1,134 +1,117 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
### After the recommendation — capture what surfaced via `sil_remember`
|
|
119
|
-
|
|
120
|
-
**After every recommendation, before the turn ends**, persist anything new the interaction surfaced that Beat 4 did not already capture — each via its **own single `sil_remember`** call (a person fact with `kind: "fact"` → the shared user spec, a niche buying taste with `kind: "taste"` + the active `domain` → this domain's playbook). This is the safety net that makes "every query is a learning step" hold under load: the whole-doc round-trip is the path the shopper skips, so this **cheap append** is the one that actually runs, and a measurement or brand preference voiced in the session is never lost to the conversation.
|
|
121
|
-
|
|
122
|
-
Fire this capture **only when something new actually surfaced** — a measurement stated, a brand preference revealed, a hard constraint learned, that the shared user spec / this domain's playbook did **not already hold**. If **nothing surfaced**, make **no `sil_remember` call**: no empty, duplicate, or noise entries. One discrete learning per call — two facts and a taste are three calls — and never silently; capture only what the interaction surfaced in the open. A **fact** carries to every niche (shared user spec); a **taste** stays in this domain.
|
|
123
|
-
|
|
124
|
-
## When `sil_search` returns `ok` with `products: []` — relax and explain
|
|
125
|
-
|
|
126
|
-
An empty result on `status: ok` is a normal, servable outcome — **never a silent dead-end**. **Relax or re-frame** the params (loosen a constraint, broaden the `query`) and **explain what you changed and why** ("I dropped the secondhand-only filter because nothing matched — here's what's in stock"). Never just stop silently.
|
|
127
|
-
|
|
128
|
-
## When the domain is genuinely unservable — an honest "no", never junk
|
|
129
|
-
|
|
130
|
-
When the catalog **cannot serve** the niche — out of scope, **not shippable**, **age-gated**, or persistently empty after a reasonable relax — say so **honestly**. This is a **different outcome** from the empty-but-servable relax case: there is no constraint to loosen, so you give an honest "no". **Never fabricate** options and **never pad with junk** — handing back unbuyable results destroys trust.
|
|
131
|
-
|
|
132
|
-
## When `sil_search` / `sil_product_get` returns a non-`ok` status
|
|
133
|
-
|
|
134
|
-
A non-`ok` status is **not an empty match** — do **not** treat a `retryable` or an auth failure like `products: []` and relax the params. **Follow the tool's own `recovery` hint** exactly and **never improvise**. The full taxonomy and per-status recovery live in [`catalog_tools_reference.md`](catalog_tools_reference.md) — **load it, do not re-carry the taxonomy here.**
|
|
1
|
+
---
|
|
2
|
+
name: shop-loop
|
|
3
|
+
description: The six-beat Spec-Driven Shopping loop — the state machine the shopper runs on every niche. Owns Beat 1 (classify), Beat 4 (search-space) and Beat 5 (reflect); routes Beats 2, 3 and 6 to the references that own them. Load when shopping as the shopper.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# The six-beat Spec-Driven Shopping loop
|
|
7
|
+
|
|
8
|
+
As the shopper you run one loop on every request — a **six-beat** state machine.
|
|
9
|
+
Most of it is reasoning over what you already know; you only ask the buyer about
|
|
10
|
+
the genuine residue. The beats run **in this order**:
|
|
11
|
+
|
|
12
|
+
1. **Classify** — resolve the request's `{domain, product, intent}` and reuse a
|
|
13
|
+
learned domain/PRD before minting (owned here, below).
|
|
14
|
+
2. **Method load / mint / refresh** — recover or research the domain's method +
|
|
15
|
+
its intent-keyed PRDs — [`method_and_prds.md`](method_and_prds.md).
|
|
16
|
+
3. **Fill** — resolve the PRD by precedence, eliciting only the residue (Beat 3).
|
|
17
|
+
4. **Search-space** — project the filled PRD into a bounded fan-out (owned here).
|
|
18
|
+
5. **Reflect** — judge best-available against the PRD + method (owned here).
|
|
19
|
+
6. **Feedback** — capture what the reaction surfaced (Beat 6).
|
|
20
|
+
|
|
21
|
+
Beats 2, 3 and 6 live in their references; this file owns Beats 1, 4 and 5.
|
|
22
|
+
|
|
23
|
+
## Beat 1 — Classify: `{domain, product, intent}`, reuse before mint
|
|
24
|
+
|
|
25
|
+
Resolve the request through **three coordinates, top-down**: the **domain** (the
|
|
26
|
+
niche that owns the method), the **product** type within it, and the **intent**
|
|
27
|
+
(the use-context that reshapes the requirements). **Intent is always present**: a
|
|
28
|
+
**context-free** request keys the `general` intent (`ski/boots-general`), so every
|
|
29
|
+
job carries all three coordinates and stays uniformly queryable.
|
|
30
|
+
|
|
31
|
+
**Reuse-before-mint.** Query existing coordinates with **`sil_profile_search`**
|
|
32
|
+
(the frontmatter-as-truth discovery tool — never a filesystem guess) and
|
|
33
|
+
**semantic-match** the request against them: **prefer existing** when a learned
|
|
34
|
+
domain/PRD already covers the job, and only mint when nothing does. The one guard
|
|
35
|
+
against over-merging is the requirements-divergence test — two requests share a
|
|
36
|
+
PRD only if they resolve to the same requirements.
|
|
37
|
+
|
|
38
|
+
**Never over-ask just to key.** Keying **never** forces an extra question: a
|
|
39
|
+
silent request keys `general` and moves on. When intent is genuinely
|
|
40
|
+
requirement-defining but the request is silent, that surfaces as the first Beat-3
|
|
41
|
+
question — not a keying interrogation here.
|
|
42
|
+
|
|
43
|
+
**Announce a mint.** A new-domain or new-PRD mint is **announced** — state the
|
|
44
|
+
inferred `domain / product / intent` so the buyer can **correct** it — **never
|
|
45
|
+
silent**. A reuse passes through with no announcement.
|
|
46
|
+
|
|
47
|
+
## Beat 4 — Search-space: a bounded, priority-ordered fan-out (not a re-rank)
|
|
48
|
+
|
|
49
|
+
Project the filled PRD onto **`sil_search`** as a **bounded ≤ 4 priority-ordered**
|
|
50
|
+
fan-out, not one search and not unbounded — the bound is a production budget (each
|
|
51
|
+
call is a round-trip + tokens):
|
|
52
|
+
|
|
53
|
+
- **Call 1 is the tightest projection of the PRD's core** (its load-bearing
|
|
54
|
+
requirements); **calls 2–4 are deliberate widenings** — relax the least
|
|
55
|
+
load-bearing requirement, an adjacent phrasing that improves recall, or an
|
|
56
|
+
explicit either/or branch. **Core first, widenings after** — that is the
|
|
57
|
+
**priority order**.
|
|
58
|
+
- **Merge by dedup + concatenate in issue order — this is NOT a re-rank.**
|
|
59
|
+
Concatenate the per-call backend-ranked lists in issue order and **drop** any
|
|
60
|
+
product already **seen** in an earlier call. Because issue order *is* priority
|
|
61
|
+
order, concatenation **never re-ranks** a backend list nor lifts a peripheral
|
|
62
|
+
hit above a core one — the engine owns order *within* each call, the fan-out
|
|
63
|
+
owns order *across* calls.
|
|
64
|
+
- **Project each requirement onto existing params, then `specs` predicates, then
|
|
65
|
+
query enrichment — in that order.** Map each requirement onto the tightest real
|
|
66
|
+
channel:
|
|
67
|
+
1. an **existing** `sil_search` **param** where one fits (`category`,
|
|
68
|
+
`price_min`/`price_max`, `condition`, `available`, `local_merchants`);
|
|
69
|
+
2. else a structured **`filters.specs` predicate**, built from the method's
|
|
70
|
+
Beat-2 canonical `## Search vocabulary` (the `sil_specs`-coined names) — one
|
|
71
|
+
`{ns, key, op, value, unit?, hard?}` per annotated requirement, marking an
|
|
72
|
+
inviolable one `hard:true`. **Prefer a dedicated param over a predicate** for
|
|
73
|
+
the SAME attribute — never send both (a `price_max` param OR a price spec, not
|
|
74
|
+
both);
|
|
75
|
+
3. else — a purely descriptive residue (a colour, a phrasing) — fold it into the
|
|
76
|
+
free-text `query`, which **you author yourself**. The plugin is **pure
|
|
77
|
+
transport**: it never folds a predicate into `query`, so a requirement that
|
|
78
|
+
belongs in `filters.specs` stays a predicate, never `query` prose.
|
|
79
|
+
Leave **`ship_to`** empty (the server resolves the registered default). **Never
|
|
80
|
+
invent** a param or a predicate that isn't real — the params live in the
|
|
81
|
+
`sil_search` description, the predicate vocabulary in the domain method (see
|
|
82
|
+
[`search_param_mapping.md`](search_param_mapping.md)). Then read the per-predicate
|
|
83
|
+
**`specs_status`** the response returns (each `{ns, key, applied}`) — it feeds
|
|
84
|
+
Beat 5's honesty pass, which rejects at pick any `hard` predicate the backend left
|
|
85
|
+
`applied:false`.
|
|
86
|
+
|
|
87
|
+
## Beat 5 — Reflect: honesty pass first, judgment not threshold, propose-and-wait
|
|
88
|
+
|
|
89
|
+
Take Beat 4's merged issue-order list and its per-call `specs_status`. Run in
|
|
90
|
+
order — **honesty pass → judge → branch** — and **never re-rank**: the engine owns
|
|
91
|
+
order, you own the verdict.
|
|
92
|
+
|
|
93
|
+
**1 — Honesty pass, first.** Before judging fitness, walk the survivors and
|
|
94
|
+
**reject-at-pick** any candidate that violates a *hard* constraint the backend
|
|
95
|
+
could not enforce — exactly the predicates the response marked **`applied:false`**,
|
|
96
|
+
plus the `user_spec` `[hard]` markers. A violator is removed from contention, never
|
|
97
|
+
the pick; if rejection empties the set, fall through to the empty path.
|
|
98
|
+
|
|
99
|
+
**2 — Judge, then branch.** Weigh the best surviving candidate against the PRD +
|
|
100
|
+
method. Whether it satisfies or falls short is a **judgment** call, **not a
|
|
101
|
+
threshold** and not a mechanical any-unmet-requirement rule — read the whole set.
|
|
102
|
+
|
|
103
|
+
- **Satisfies → a hero + 1–2 justified alternatives.** Lead with **one**
|
|
104
|
+
recommendation carrying the SDS-bar *why* (a met requirement, a researched method
|
|
105
|
+
mechanic, and a stored preference reused without re-asking), then **one or two**
|
|
106
|
+
considered **alternatives**, each with a one-line reason. Best-first **as
|
|
107
|
+
returned** — **never re-rank**, never a bare list.
|
|
108
|
+
- **Shortfall or empty → propose a specific relaxation and wait.** Name the gap,
|
|
109
|
+
show the closest survivors, and **propose** the specific change that would widen
|
|
110
|
+
it — then **wait** for the buyer's nod. **No silent re-search** and no silent
|
|
111
|
+
auto-widen; the buyer can redirect instead.
|
|
112
|
+
|
|
113
|
+
A **non-`ok`** status is not an empty match — do not relax params; follow that
|
|
114
|
+
tool's own **`recovery`** exactly.
|
|
115
|
+
|
|
116
|
+
**Then Beat 6.** The buyer's reaction to the recommendation is what Beat 6 captures
|
|
117
|
+
— [`fill_and_feedback.md`](fill_and_feedback.md).
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Manage your shopper's domains — view, forget
|
|
2
|
-
|
|
3
|
-
Load this when the user wants to see what their **shopper** knows or **forget a domain** (a niche) — "what does my shopper know?", "which domains has it learned?", "show me the cycling domain", "forget the grocery niche". The router in `SKILL.md` names which `sil_profile_*` tool each intent maps to; this reference is what those tools do, plus the **two remove granularities** and the confirm-before-remove gate.
|
|
4
|
-
|
|
5
|
-
These are pure local-lifecycle operations over the two stores the create-engine established — **host config + workspace `SOUL.md` = wiring + persona; `$SIL_DATA_DIR/shopper/` = the shared user spec + per-domain packs**. No server call, no token read, no identity coupling: a shopper with zero domains still shops generically — the first shop in a niche mints it. The shopper is a **singleton**, scoped to the fixed `$SIL_DATA_DIR/shopper/` path, so these tools take **no caller `agentId`** — only an optional `domainSlug` to address one niche.
|
|
6
|
-
|
|
7
|
-
**The source of truth for "what the shopper knows" is the sil artefact store, not the host agent list.** The directory `$SIL_DATA_DIR/shopper/` with a readable `profile.json` IS the shopper; its `domains` map is the niche index. A bare host `agents.list[]` entry without a `profile.json` is just a host agent, not ours to view/forget. Always read `profile.json`, **never the host agent list**, to decide what exists.
|
|
8
|
-
|
|
9
|
-
## Match intent to a tool
|
|
10
|
-
|
|
11
|
-
| Intent | Tool |
|
|
12
|
-
|---|---|
|
|
13
|
-
| "what does my shopper know?" / "which domains has it learned?" / "show me the shopper" (overview) | `sil_profile_get` (no `domainSlug` — the overview absorbs the old listing) |
|
|
14
|
-
| "show me / tell me about the <niche> domain" | `sil_profile_get` (pass the `domainSlug`) |
|
|
15
|
-
| "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 (see the two granularities) |
|
|
17
|
-
|
|
18
|
-
## How the read tool behaves
|
|
19
|
-
|
|
20
|
-
`sil_profile_get` reads the **singleton** shopper in two modes:
|
|
21
|
-
|
|
22
|
-
- **No `domainSlug` (overview — the folded listing):** returns the shopper's `name`, the **shared `userSpec`** (the person's cross-niche facts + hard constraints), and the **`domains` index** (each niche's `slug`, `name`, `createdAt`, `updatedAt` — no per-domain bodies), plus any degraded directory in **`unreadable`**. A shopper **with no domains yet still reads ok, with an empty domain index — that is healthy, not an error** (the first shop in a niche mints it); so is an empty store ("you haven't set up a shopper yet" → point at create — it returns `ok`, never `not_found`). Render a human summary: the shopper, what it knows about the user (shared facts + hard constraints), the domains it has learned, and a wiring summary (a real host agent, sil plugin enabled, sil skill attached, ready with no further setup). A degraded/legacy directory lands in `unreadable` — mention it inline, but never let it hide the healthy state. (A flat-layout directory left over from the retired one-agent-per-niche model reads as `unreadable` — frame it as an **old-model leftover** and steer the user to re-create their shopper; do not try to read it as a domain.)
|
|
23
|
-
- **With a `domainSlug` (one domain):** returns that niche's pack — `domainSpec` + `intentSpec` + `playbook` (the niche buying taste) **plus** the shared `userSpec`. Render the niche (from the domain spec), its decomposition dimensions, and the buying taste learned for it. An unminted/unloadable domain returns `not_found` (its `recovery` is `sil_profile_get`, the no-args overview) — frame it plainly ("no `<slug>` domain — here's what the shopper has learned") and list what DOES exist. **Never surface a stack trace or a raw filesystem path.**
|
|
24
|
-
|
|
25
|
-
## The two remove granularities — forget a domain vs decommission the shopper
|
|
26
|
-
|
|
27
|
-
Removal is **destructive and irreversible**, so **confirm before removing**: state exactly what will be deleted and proceed only on the user's **explicit go-ahead**. There are **two distinct granularities** — pick the one the user means, and when ambiguous, ask:
|
|
28
|
-
|
|
29
|
-
### Forget ONE domain (the common case — `sil_profile_remove`)
|
|
30
|
-
|
|
31
|
-
"forget the grocery niche", "remove the cycling domain", **"delete the grocery agent"** now mean **forget that one DOMAIN** — the niche pack only. The shopper, the **shared user spec**, and **every sibling domain survive**. This is the **artefact half only**, scoped to one niche; **no host wiring is touched** (the shopper agent stays):
|
|
32
|
-
|
|
33
|
-
- Call **`sil_profile_remove { domainSlug }`** — `domainSlug` is **REQUIRED** (it never deletes the whole shopper). It removes exactly the one `domains/<slug>/` leaf and de-registers it from the manifest. A malformed/traversal/`main`/missing slug returns `invalid_request` and deletes nothing; an unregistered slug returns `not_found` (idempotent — safe to re-run); a filesystem failure returns `persistence_failed`.
|
|
34
|
-
- After it, confirm the domain is gone and the shopper, the shared user spec, and its **sibling domains are untouched**.
|
|
35
|
-
|
|
36
|
-
### Decommission the WHOLE shopper (the host-CLI-first path)
|
|
37
|
-
|
|
38
|
-
"tear down my shopper", "decommission the whole thing" means remove the **entire shopper** — host wiring + `SOUL.md` + the whole artefact tree. This is the **host-CLI-first** flow, for the **whole agent** (not a single niche):
|
|
39
|
-
|
|
40
|
-
1. **Existence check (read).** Run `openclaw agents list --json` and confirm the `agentId` is the sil-wired shopper.
|
|
41
|
-
2. **Remove the host wiring (host CLI) — FIRST.** Run `openclaw agents remove <agentId>`, then `openclaw config validate --json` to confirm the host config is still valid. The plugin cannot write the host config, so this half is the host CLI's and runs ahead of the artefact removal.
|
|
42
|
-
3. **Remove the sil artefacts — SECOND.** Clear the shopper's whole `$SIL_DATA_DIR/shopper/` tree (the shared user spec + every domain pack). `sil_profile_remove` is **per-domain** by design (its `domainSlug` is required), so decommissioning the shopper's full tree is the host-side concern, not a single tool call — remove each domain, or clear the shopper directory as part of the host teardown.
|
|
43
|
-
|
|
44
|
-
**Never artefacts-first for the whole-shopper path.** The order is a safety decision: a failed artefact step after the host removal leaves only *residual artefacts with no host entry* — harmless disk cruft the no-args `sil_profile_get` still surfaces, so the user retries clean. The **reverse** is unsafe — artefacts gone, then a failed host step, leaves a *host entry whose `profile.json` is gone*: the agent still loads but the sil skill ENOENTs at runtime, a visibly broken shopper. Both halves are individually idempotent, so a re-run from any partial state converges to clean.
|
|
45
|
-
|
|
46
|
-
Leave `plugins.entries.sil.enabled` alone on any removal — it is shared host state (the shopper depends on it), not per-domain. Even decommissioning the shopper leaves it enabled for a future re-create.
|
|
47
|
-
|
|
48
|
-
## Status taxonomy (manage: view / remove)
|
|
49
|
-
|
|
50
|
-
| `status` | Meaning | What to do |
|
|
51
|
-
|---|---|---|
|
|
52
|
-
| `ok` | A view returned the overview (a shopper's `domains` may be empty — normal; an absent shopper is still `ok`, empty-is-healthy) or one domain's detail. | Relay the data; on an empty domain index, say so plainly and point at "just shop a niche". |
|
|
53
|
-
| `not_found` | No domain matches the `domainSlug` (view or remove). Its `recovery` is `sil_profile_get` (the no-args overview). | Frame it plainly and list what DOES exist; do NOT re-register. For remove, a re-run is safe (idempotent). |
|
|
54
|
-
| `invalid_request` | The `domainSlug` was malformed, `main`, traversal-shaped, or (remove) missing. **Nothing was read or deleted.** | Fix the slug and call again — never a stack trace or raw path to the user. |
|
|
55
|
-
| `removed` | `sil_profile_remove` deleted exactly one domain pack. | Confirm that niche is gone; the shopper + shared user spec + sibling domains are untouched. |
|
|
56
|
-
| `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 +0,0 @@
|
|
|
1
|
-
# Refine your shopper or one of its domains — the refinement loop
|
|
2
|
-
|
|
3
|
-
When the user wants to **sharpen their shopper** — "refine my shopper", "the cycling domain keeps surfacing the wrong stuff, let's fix it", "amend what you know about me" — do **not** re-onboard from scratch and do **not** quietly mutate anything. Run this **targeted-amend** loop: load the relevant artefact, propose concrete refinements drawn from what the shopper actually **observed** in real shopping sessions, let the user **confirm a subset**, and persist **only** the confirmed subset by re-running the existing persist step. Nothing changes silently; nothing persists without the user's explicit confirmation.
|
|
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.)
|
|
24
|
-
|
|
25
|
-
3. **Confirm — the gate, before anything persists.** Present the proposals and let the user **confirm a subset** — all, some, or none (per-proposal accept/reject). Confirmation is an **explicit affirmative act** on specific proposals. It is **never inferred from silence**, and **never** from the user answering an **off-topic** / unrelated question. This is the strongest invariant of the loop, re-applying the create engine's endorsement discipline at refine time — *see [`brainstorm_interview.md`](brainstorm_interview.md) for the endorsement-gate discipline; do not restate it here.* Until the user confirms, the proposals live **only in the conversation**.
|
|
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
|
|
43
|
-
|
|
44
|
-
A refinement to what the shopper searches on lands in an artefact — a shared fact in `user_spec.md`, or, within a domain, a mechanic in `domain_spec.md`, a dimension in `intent_spec.md`, or a taste in `playbook.md` — and those feed the **shop-time** mapping ([`search_param_mapping.md`](search_param_mapping.md)). The mapping maps **only onto real `sil_search` params** — a refined fact/taste with **no matching param** folds into the `query` text or the recommend-time rubric, **never an invented filter**. The `ship_to` rule is unchanged at refine time too: leave it empty (the server resolves the registered default) — no identity round-trip to populate it. **Do not restate the param table here** — point at [`search_param_mapping.md`](search_param_mapping.md).
|
|
45
|
-
|
|
46
|
-
## When there is no observed-session signal
|
|
47
|
-
|
|
48
|
-
If the user asks to refine but **no observed session** is available — a fresh session, or the prior session is out of context — do **not fabricate** session observations to propose against. Fall back to a **guided amend**: ask the user what they want to change (and apply the same confirm-before-persist gate to whatever they describe), or **invite them to shop a session first** so the next refinement has real evidence to ground proposals in. Never invent observations.
|