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,55 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## The parameters available to map onto
|
|
6
|
-
|
|
7
|
-
| User's stated input | `sil_search` param it maps to |
|
|
8
|
-
|---|---|
|
|
9
|
-
| A budget ("under €1500", "€800–1200") | `price_min` / `price_max` — **in the currency's ISO 4217 minor unit** (cents): €1500 → `price_max: 150000` |
|
|
10
|
-
| "Prefer secondhand" / "used is fine" | `condition: ["secondhand"]` |
|
|
11
|
-
| "New only" | `condition: ["new"]` |
|
|
12
|
-
| The narrowed niche + key descriptors | `query` (free text) and/or `category` |
|
|
13
|
-
| "In stock only" (the default) / "show me out-of-stock too" | `available` (omit for in-stock default; `false` to include unavailable) |
|
|
14
|
-
| "Buy from a local/domestic shop" | `local_merchants: true` (a best-effort ranking *bias*, not a hard filter — and *optionally*, to surface more local shops, issue the `query` in that country's language; a tactic, never an override of a language the user deliberately chose) |
|
|
15
|
-
|
|
16
|
-
A stated taste with **no matching param** (e.g. "I like bold colours", "prefer eco-friendly brands") does **not** become a new param — fold it into the `query` text or into the recommendation rubric. There is no `color` filter, no `brand` filter; inventing one produces a shopper that emits invalid `sil_search` calls at shop time.
|
|
17
|
-
|
|
18
|
-
## SDS mapping inputs — the decomposed intent, the shared user facts, the domain buying taste, the domain mechanics
|
|
19
|
-
|
|
20
|
-
Under [Spec-Driven Shopping](shop_loop.md), the mapping reads several layers, not only the user's words for *this* request:
|
|
21
|
-
|
|
22
|
-
- The **decomposed per-query intent** (the active domain's `intent_spec.md` dimensions filled in for this request — ephemeral) is the most specific layer and wins for *preferences* (precedence **intent > playbook(domain) > user_spec(SHARED) > domain_spec(domain)**).
|
|
23
|
-
- The **buying taste** (the active domain's `playbook.md`) supplies the user's standing preferences for *this niche* — budget band, brand likes/dislikes — these map to params (a budget band → `price_min`/`price_max`) exactly like a freshly-stated answer would, but are **never re-asked**. Taste is per-domain — it does not carry to another niche.
|
|
24
|
-
- The **shared user spec** (`user_spec.md`) supplies the user's standing **facts** (a foot profile, a compatibility detail) and the **hard constraints**, reused across **every** niche — facts map to params like any stated answer; the stored value fills the param, never re-asked.
|
|
25
|
-
- The **domain spec** (the active domain's `domain_spec.md`) supplies the niche's **decision-mechanics** — which attributes are load-bearing for *this* niche (last volume, rim depth, gearing range), so the mapping knows what to map and what matters.
|
|
1
|
+
---
|
|
2
|
+
name: search-param-mapping
|
|
3
|
+
description: The shop-time answer→sil_search parameter mapping — real params only, hard-constraint routing, the ship_to rule. Load when mapping a decomposed request into a sil_search call.
|
|
4
|
+
---
|
|
26
5
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Hard constraints — route to a real filter AND a reject-at-recommend rule, NEVER only `query` text
|
|
30
|
-
|
|
31
|
-
A **shared user-spec hard constraint** ("never leather", "nothing over 8 kg", an allergy, an age gate) is **inviolable** in *every* niche — the shopper never recommends a violating item. A hard constraint carried **only** as soft `query` free text leaks: the catalog can still surface a violating product, and recommending it is a defect. So map every hard constraint to **two** enforcement points, **not merely `query`**:
|
|
32
|
-
|
|
33
|
-
1. **A real `sil_search` filter where one exists.** "New only" / "secondhand only" → `condition`; "in stock only" → `available` (omit for the in-stock default). Where a param matches the constraint, set it so the catalog never returns the violating item at all.
|
|
34
|
-
2. **An explicit reject-at-pick rubric rule** ([`shop_loop.md`](shop_loop.md) Step 6). For a constraint with **no matching param** (no `material` filter for "never leather"), the constraint becomes a rubric rule that **rejects** any violating candidate outright — **never recommend** it — rather than down-weighting it. A hard constraint is a reject, not a weight.
|
|
35
|
-
|
|
36
|
-
A hard constraint that lands **only** in `query` text is **not** enforced — it is a hint, not a filter, and the catalog may ignore it. Route it to a filter and a reject rule; the `query` text is at most an additional nudge, never the sole carrier of an inviolable constraint.
|
|
37
|
-
|
|
38
|
-
## `ship_to` stays EMPTY by default — inline rule (do not skip)
|
|
39
|
-
|
|
40
|
-
Do **not** map the user's location onto `ship_to`, and do **not** instruct the shopper to call `sil_whoami` to populate it. When `ship_to` is absent, sil-api resolves the user's **registered default address** server-side. Set `ship_to` (a `{ country, region?, postal_code? }` object of ISO codes) **only** to OVERRIDE the default with a *different* destination than the registered address (e.g. "ship this to my office in Germany"). The shopper inherits correct location-aware search by construction — leave `ship_to` out, and never round-trip `sil_whoami` to fill it.
|
|
41
|
-
|
|
42
|
-
## Worked param examples
|
|
6
|
+
# Answer→`sil_search`-param mapping (the mapping is real)
|
|
43
7
|
|
|
44
|
-
|
|
8
|
+
Load this at shop time, when the shop loop maps a decomposed request into a
|
|
9
|
+
`sil_search` call ([`shop_loop.md`](shop_loop.md) Beat 5). The mapping targets the
|
|
10
|
+
**real `sil_search` parameters** and nothing else — never invent a filter.
|
|
11
|
+
|
|
12
|
+
**The param catalog lives in the `sil_search` tool description** — the full list and
|
|
13
|
+
their forms (`query`/`category`; `price_min`/`price_max` in the currency's ISO 4217
|
|
14
|
+
minor unit; `condition` = `["new"]`/`["secondhand"]`; `available`; `local_merchants`;
|
|
15
|
+
`ship_to` as ISO codes). Read it there; do not restate it here. Under SDS there is no
|
|
16
|
+
stored "answer→param" seller artefact — *what* to search on for a niche lives in the
|
|
17
|
+
active domain's `domain_spec.md`; this reference covers only the SDS layers that feed
|
|
18
|
+
the mapping and the two rules the mapping must hold.
|
|
19
|
+
|
|
20
|
+
## What feeds the mapping — the SDS layers
|
|
21
|
+
|
|
22
|
+
The mapping reads several layers, not just the user's words for this request:
|
|
23
|
+
|
|
24
|
+
- The **decomposed per-query intent** (the active `intent_spec.md` filled for this
|
|
25
|
+
request — ephemeral) is most specific and wins for *preferences* (precedence
|
|
26
|
+
**intent > playbook(domain) > user_spec(SHARED) > domain_spec(domain)**).
|
|
27
|
+
- The **shopping taste** (the active `playbook.md`) supplies standing preferences for
|
|
28
|
+
*this niche* — a budget band → `price_min`/`price_max` exactly like a freshly-stated
|
|
29
|
+
answer, but **never re-asked**. Taste is per-domain.
|
|
30
|
+
- The **shared user spec** (`user_spec.md`) supplies standing **facts** and the **hard
|
|
31
|
+
constraints**, reused across **every** niche — a fact maps to a param like any answer.
|
|
32
|
+
- The **domain spec** supplies the niche's decision-mechanics — which attributes are
|
|
33
|
+
load-bearing here — so the mapping knows what to map and what matters.
|
|
34
|
+
|
|
35
|
+
These layers are inputs to the same params, not new params. A stated taste with **no
|
|
36
|
+
matching param** (a colour, a brand, "eco-friendly") folds into the `query` text or the
|
|
37
|
+
recommendation rubric — **never a new filter**. There is no `color` or `brand` param;
|
|
38
|
+
inventing one emits invalid `sil_search` calls.
|
|
39
|
+
|
|
40
|
+
## Hard constraints — a real filter AND a reject-at-recommend rule, NEVER only `query`
|
|
41
|
+
|
|
42
|
+
A shared user-spec **hard constraint** ("never leather", "nothing over 8 kg", an
|
|
43
|
+
allergy, an age gate) is **inviolable** in every niche. A hard constraint carried
|
|
44
|
+
**only** as soft `query` text leaks — the catalog can still surface a violating item.
|
|
45
|
+
Route each to **two** points, **not merely `query`** (see
|
|
46
|
+
[`shop_loop.md`](shop_loop.md) Beat 5):
|
|
47
|
+
|
|
48
|
+
1. **A real `sil_search` filter where one exists** — "new/secondhand only" →
|
|
49
|
+
`condition`; "in stock only" → `available` (omit for the in-stock default). Where a
|
|
50
|
+
param matches, set it so the catalog never returns the violating item.
|
|
51
|
+
2. **An explicit reject-at-pick rubric rule** for a constraint with no matching param
|
|
52
|
+
(no `material` filter for "never leather"): the constraint **rejects** any violating
|
|
53
|
+
candidate outright, never down-weights it. A hard constraint is a reject, not a
|
|
54
|
+
weight.
|
|
55
|
+
|
|
56
|
+
## `ship_to` stays EMPTY by default
|
|
57
|
+
|
|
58
|
+
Do **not** map the user's location onto `ship_to`, and do **not** call `sil_whoami` to
|
|
59
|
+
populate it. When `ship_to` is absent, sil-api resolves the user's **registered default
|
|
60
|
+
address** server-side. Set `ship_to` only to OVERRIDE the default with a *different*
|
|
61
|
+
destination (e.g. "ship this to my office in Germany"). The shopper inherits
|
|
62
|
+
location-aware search by construction — leave `ship_to` out.
|
|
63
|
+
|
|
64
|
+
## Worked example
|
|
65
|
+
|
|
66
|
+
For a road-cycling domain whose user said (this request + a stored budget taste in that
|
|
67
|
+
domain) "secondhand is fine, I'm in France and want local shops":
|
|
45
68
|
|
|
46
69
|
```
|
|
47
|
-
query: "
|
|
70
|
+
query: "endurance road bike 105 groupset" # niche descriptors
|
|
48
71
|
category: "<the narrowed niche category>"
|
|
49
72
|
price_max: 120000 # €1200 → minor units (cents)
|
|
50
|
-
condition: ["secondhand"]
|
|
51
|
-
local_merchants: true
|
|
52
|
-
# ship_to: OMITTED — server resolves the registered default address
|
|
73
|
+
condition: ["secondhand"]
|
|
74
|
+
local_merchants: true # ranking bias; optionally query in French to surface more local shops
|
|
75
|
+
# ship_to: OMITTED — server resolves the registered default address
|
|
53
76
|
```
|
|
54
77
|
|
|
55
|
-
|
|
78
|
+
A non-param taste ("understated colours") folds into `query` or the rubric, never a new
|
|
79
|
+
filter.
|
|
@@ -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 memory tool has been used (`sil_remember` stored a fact or taste — a soft self-check
|
|
34
|
+
judged from whether this shopper has ever remembered 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,164 @@
|
|
|
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
|
-
## Beat
|
|
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
|
-
|
|
1
|
+
---
|
|
2
|
+
name: shop-loop
|
|
3
|
+
description: The Spec-Driven Shopping loop — the one shopper shops any niche, reusing or minting a domain on the fly, then decomposing the request and learning from it. Load when running as the shopper and the user states a shopping intent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Shop-time loop — how the one shopper shops any niche
|
|
7
|
+
|
|
8
|
+
Load this when you (the sil skill) run as the user's **shopper** and they state a
|
|
9
|
+
shopping intent. There is **one shopper** — a generalist holding **many domains**
|
|
10
|
+
(niches), each **minted lazily on first shop**. The [engine's Runtime
|
|
11
|
+
hook](agent_creation_engine.md) leaves you here: the persona is injected via
|
|
12
|
+
**`SOUL.md`**, and the skill has read the shared **`user_spec.md`** (cross-niche facts +
|
|
13
|
+
hard constraints, reused across every niche) plus the slug-keyed **`domains`** map from
|
|
14
|
+
`$SIL_DATA_DIR/shopper/profile.json`.
|
|
15
|
+
|
|
16
|
+
This is **Spec-Driven Shopping (SDS)**: a fact from niche A is reused in niche B without
|
|
17
|
+
being re-asked, while each domain's **`domain_spec.md`** (deep niche expertise),
|
|
18
|
+
**`intent_spec.md`** (decomposition schema), and **`playbook.md`** (the **shopping
|
|
19
|
+
taste**) stay niche-scoped — taste does not leak, only shared facts carry. Behave like a
|
|
20
|
+
specialist in the persona's voice; apply the rubric at reasoning time, not via a new tool.
|
|
21
|
+
|
|
22
|
+
## The five beats — run every query, in order
|
|
23
|
+
|
|
24
|
+
A beat only **asks** when something is genuinely unresolved; a fully-resolved query asks
|
|
25
|
+
nothing and passes straight through.
|
|
26
|
+
|
|
27
|
+
1. **Domain-exists check** — classify the niche, reuse a matching domain or register a miss.
|
|
28
|
+
2. **Learn on a miss** (or refresh on a hit) — the pack is present and current before you search.
|
|
29
|
+
3. **Gather what's missing before searching** — resolve each dimension, then ask only what's unresolved.
|
|
30
|
+
4. **Persist what surfaced** — a single `sil_remember` per new fact or taste.
|
|
31
|
+
5. **Search → rubric → recommend-with-why → re-fetch before purchase.**
|
|
32
|
+
|
|
33
|
+
## Beat 1 — Domain-exists check
|
|
34
|
+
|
|
35
|
+
Name the **shopping niche** this request belongs to ("a waterproof trail shoe for a wet
|
|
36
|
+
ultra" → trail running) — your reasoning, no tool call. Then read `profile.json.domains`
|
|
37
|
+
(via the no-args `sil_profile_get`) and match the niche **semantically, not by exact
|
|
38
|
+
string**. If a domain covers it, **reuse it** and go to the gate. **Reuse-before-mint**
|
|
39
|
+
is the shop loop's job: the store enforces only shape, so without **semantic dedup** the
|
|
40
|
+
shopper fragments into duplicate thin packs (`cycling`, `road-cycling`,
|
|
41
|
+
`bikes` for one niche). Torn between a close existing slug and a new one, prefer the
|
|
42
|
+
existing. No match ⇒ register a **miss** for Beat 2.
|
|
43
|
+
|
|
44
|
+
## Beat 2 — Learn the domain (mint on a miss, refresh on a hit)
|
|
45
|
+
|
|
46
|
+
**On a miss — mint the domain on the fly, announced.** Tell the user, in the shopper's
|
|
47
|
+
voice — **never silently** — that this is a new niche ("I haven't shopped cycling for
|
|
48
|
+
you yet — setting that up"), and **state the inferred niche so the user can correct it**.
|
|
49
|
+
**Research** it (web + knowledge) into a **deep `domainSpec`** (a shallow bullet list a
|
|
50
|
+
layperson could write fails the SDS bar), derive the **`intentSpec`** dimensions, and
|
|
51
|
+
seed a partial **`playbook`**. No web tool? Say so and compose from public knowledge —
|
|
52
|
+
never present a guess as verified research. Persist with the **whole-doc**
|
|
53
|
+
**`sil_profile_materialize { name, userSpec, domain: { slug, name, domainSpec,
|
|
54
|
+
intentSpec, playbook } }`** — the deduped slug from Beat 1, `userSpec` re-persisted
|
|
55
|
+
atomically alongside. One atomic call upserts `domains[slug]`. Never `sil_remember`.
|
|
56
|
+
|
|
57
|
+
**On a hit — web-refresh the active domain's `domain_spec.md`** so it stays current, and
|
|
58
|
+
persist by re-running `sil_profile_materialize` with the `domain` object carrying the
|
|
59
|
+
fresh `domainSpec`. A real web step — no web tool? Say so and proceed on the existing
|
|
60
|
+
spec; never pretend the refresh happened.
|
|
61
|
+
|
|
62
|
+
## Beat 3 — Gather what's missing before searching
|
|
63
|
+
|
|
64
|
+
Runs to completion **before any `sil_search`**. Read the active `intent_spec.md`
|
|
65
|
+
dimensions and fill them for **this** request ("a waterproof trail shoe for a wet ultra,
|
|
66
|
+
around €160" → use-case: trail/ultra; weather: wet; budget: ~€160). This filled
|
|
67
|
+
**per-query intent** is **ephemeral** — it lives only in this conversation and is
|
|
68
|
+
**never persisted**; only the `intent_spec.md` *schema* is stored.
|
|
69
|
+
|
|
70
|
+
Resolve each dimension against — in order — the **request**, the shared **`user_spec`**,
|
|
71
|
+
the active **`playbook`**, and any defensible `domain_spec` default. Then **elicit only
|
|
72
|
+
what is genuinely unresolved** — a dimension the `domain_spec`/`intent_spec` marks
|
|
73
|
+
**load-bearing** *and* still unfilled. Ask in the persona's voice, a few at a time, each
|
|
74
|
+
tied to *why* — never a battery. A stored attribute is never re-asked. When everything
|
|
75
|
+
load-bearing is covered, **ask nothing and pass straight through** to Beat 5. If the user
|
|
76
|
+
skips a question, proceed on the best defensible params and state what you assumed — a
|
|
77
|
+
declined question narrows quality, never access.
|
|
65
78
|
|
|
66
79
|
## Beat 4 — Persist what surfaced (fact → shared user spec, taste → active domain)
|
|
67
80
|
|
|
68
|
-
When the
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- A **
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
81
|
+
When the interaction surfaces a new user **fact** or **shopping taste**, persist it with
|
|
82
|
+
a **single `sil_remember`** — fired **only when something new surfaced**:
|
|
83
|
+
|
|
84
|
+
- A **fact / measurement / hard constraint** → **`sil_remember { kind: "fact", text,
|
|
85
|
+
hard? }`** — the cheap append to the **shared** `user_spec.md`. A fact carries across
|
|
86
|
+
every niche (no `domain`). Mark a never-break rule (an allergy, an ethics rule, an age
|
|
87
|
+
gate) with **`hard: true`**; a bendable fact is a soft entry.
|
|
88
|
+
- A **shopping taste** (budget band, brand leaning) → **`sil_remember { kind: "taste",
|
|
89
|
+
text, domain }`** — one entry to **this niche's** `playbook.md`, the **active domain**.
|
|
90
|
+
Pass the active `domain` slug (with 2+ domains, omitting it is rejected). Taste is soft
|
|
91
|
+
and scoped to this domain.
|
|
92
|
+
|
|
93
|
+
Reserve the **whole-doc** `sil_profile_materialize` for the heavy paths only — the Beat-2
|
|
94
|
+
mint, the web refresh, a full **refine** ([`refine_shopper.md`](refine_shopper.md)), and
|
|
95
|
+
**contradiction-resolution** (a new statement contradicting a stored *soft* preference is
|
|
96
|
+
a visible whole-doc rewrite; an append is accretive, never corrective). One learning per
|
|
97
|
+
call; if nothing surfaced, no call. Capture is **in the open** — never silently harvested
|
|
98
|
+
— reviewable with `sil_profile_get`, erasable with `sil_profile_remove`, per-user and
|
|
99
|
+
local under `$SIL_DATA_DIR/shopper/`.
|
|
76
100
|
|
|
77
101
|
### Layering — precedence intent > playbook(domain) > user_spec(SHARED) > domain_spec(domain)
|
|
78
102
|
|
|
79
|
-
- **Intent**
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- **Domain spec** (this domain's) supplies the **decision-mechanics and trade-offs** to reason over (for trail running, last volume and lug depth matter more than weight here) — the substrate, not a tiebreaker over the user's wants.
|
|
103
|
+
- **Intent** narrows the field. **Playbook** shapes preferences within it. **User spec**
|
|
104
|
+
(the **shared** spec) fills standing **facts** the request left unsaid and carries the
|
|
105
|
+
**hard constraints**. **Domain spec** supplies the decision-mechanics — the substrate.
|
|
83
106
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
**
|
|
87
|
-
|
|
88
|
-
|
|
107
|
+
A specific request overrides a standing taste, over a soft fact-preference, over a domain
|
|
108
|
+
default. **Hard constraints are inviolable:** a shared `user_spec.md` **hard constraint**
|
|
109
|
+
is **never overridden** by intent, taste, the domain, or the catalog. Route each to a
|
|
110
|
+
real enforcement point — a `sil_search` filter where one exists (`condition`,
|
|
111
|
+
`available`, per [`search_param_mapping.md`](search_param_mapping.md)) **and** a
|
|
112
|
+
reject-at-pick rubric rule (rejected outright, not down-weighted). A constraint carried
|
|
113
|
+
only as free-text `query` is not enforced.
|
|
89
114
|
|
|
90
115
|
## Beat 5 — Search → rubric → recommend-with-why → re-fetch before purchase
|
|
91
116
|
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
117
|
+
Best-first, never re-rank, reject-at-pick for hard constraints, re-fetch before purchase.
|
|
118
|
+
|
|
119
|
+
**Map the answers to `sil_search` params.** Translate each filled dimension — plus the
|
|
120
|
+
shared facts, this domain's taste, and the domain-spec mechanics — to real params per
|
|
121
|
+
[`search_param_mapping.md`](search_param_mapping.md) (that reference owns the table; do
|
|
122
|
+
not re-carry it). A taste with no matching param folds into `query` or the rubric —
|
|
123
|
+
**never invent a filter**. Leave **`ship_to` empty** so the server resolves the
|
|
124
|
+
registered default; do not call `sil_whoami` to populate it.
|
|
125
|
+
|
|
126
|
+
**Search.** Call `sil_search` with the mapped params. It returns purchasable variants
|
|
127
|
+
best-first.
|
|
128
|
+
|
|
129
|
+
**Compare on the rubric — reject hard-constraint violators outright.** Build the rubric
|
|
130
|
+
from the active domain-spec dimensions, weighted by this domain's taste, the shared user
|
|
131
|
+
facts, and the per-query intent. A hard constraint is a **reject-at-pick** rule: a
|
|
132
|
+
violating candidate is removed from contention, never the pick. Present results
|
|
133
|
+
**best-first** as returned — **never re-rank** — but a violator is never the pick.
|
|
134
|
+
|
|
135
|
+
**Recommend — always with the "why" that cites the layers.** The "why" must cite the
|
|
136
|
+
per-query intent, at least one stored shared fact or this-domain taste you did **not**
|
|
137
|
+
re-ask ("you're a wide D-width, kept from before"), and at least one researched
|
|
138
|
+
domain-spec dimension ("for trail running, last volume and lug depth matter more than
|
|
139
|
+
weight here"). A "why" naming no researched dimension and reusing no stored attribute is
|
|
140
|
+
generic attribute matching and **fails the SDS bar** even if the product is fine. Never
|
|
141
|
+
hand back a bare list.
|
|
142
|
+
|
|
143
|
+
**Re-fetch with `sil_product_get` before any buy.** Price, availability, and
|
|
144
|
+
`checkout_url` from `sil_search` are **point-in-time**. Before any buy / checkout,
|
|
145
|
+
re-fetch the chosen item with `sil_product_get`. Never commit a buy off the stale
|
|
146
|
+
`sil_search` snapshot.
|
|
147
|
+
|
|
148
|
+
**After every recommendation, before the turn ends,** persist anything the interaction
|
|
149
|
+
newly surfaced that Beat 4 did not capture — each via a single `sil_remember` (a fact
|
|
150
|
+
`kind: "fact"` → shared user spec; a taste `kind: "taste"` + the active `domain` → this
|
|
151
|
+
domain's playbook) — and **only when something surfaced** (no empty, duplicate, or noise
|
|
152
|
+
entries).
|
|
153
|
+
|
|
154
|
+
## Empty, unservable, and non-`ok` results
|
|
155
|
+
|
|
156
|
+
- **`ok` with `products: []`** — a normal, servable outcome. **Relax or re-frame** the
|
|
157
|
+
params and **explain** the change ("I dropped the secondhand-only filter — here's
|
|
158
|
+
what's in stock"). Never stop silently.
|
|
159
|
+
- **Genuinely unservable** (out of scope, not shippable, age-gated, or persistently
|
|
160
|
+
empty after a reasonable relax) — say so **honestly**. Never fabricate options and
|
|
161
|
+
never pad with junk.
|
|
162
|
+
- **A non-`ok` status** is not an empty match — do not relax the params. **Follow the
|
|
163
|
+
tool's own `recovery`** exactly and never improvise. The taxonomy lives in
|
|
164
|
+
[`catalog_tools_reference.md`](catalog_tools_reference.md); load it, don't re-carry it.
|