sil-openclaw 0.3.0 → 0.3.3
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 +72 -0
- package/README.md +33 -37
- package/dist/lib/credentials.js +1 -1
- package/dist/lib/profile-store.js +126 -67
- package/dist/lib/sil-client.js +2 -2
- package/dist/tools/catalog.js +10 -8
- package/dist/tools/identity.js +3 -3
- package/dist/tools/profile.js +91 -55
- package/openclaw.plugin.json +3 -3
- package/package.json +1 -1
- package/skill/SKILL.md +1 -1
- package/skill/examples/road_cycling_expert_walkthrough.md +112 -68
- package/skill/references/agent_creation_engine.md +41 -30
- package/skill/references/brainstorm_interview.md +49 -40
- package/skill/references/catalog_tools_reference.md +1 -1
- package/skill/references/expert_shopping.md +51 -84
- package/skill/references/manage_experts.md +17 -75
- package/skill/references/refine_expert.md +11 -9
- package/skill/references/search_param_mapping.md +25 -5
|
@@ -1,100 +1,42 @@
|
|
|
1
1
|
# Manage your sil shopping experts — list, view, remove
|
|
2
2
|
|
|
3
|
-
Load this
|
|
4
|
-
created — "what experts do I have?", "show me the gift buyer", "delete the
|
|
5
|
-
grocery agent". The router in `SKILL.md` names which `sil_profile_*` tool each
|
|
6
|
-
intent maps to; this reference is what those tools actually do, plus the
|
|
7
|
-
host-CLI-first ordering and the confirm-before-remove gate the remove flow
|
|
8
|
-
turns on.
|
|
3
|
+
Load this when the user wants to see or remove an expert they created — "what experts do I have?", "show me the gift buyer", "delete the grocery agent". The router in `SKILL.md` names which `sil_profile_*` tool each intent maps to; this reference is what those tools do, plus the host-CLI-first ordering and the confirm-before-remove gate.
|
|
9
4
|
|
|
10
|
-
These are pure local-lifecycle operations over the two stores the
|
|
11
|
-
create-engine established — **host config = wiring, `$SIL_DATA_DIR/agents/<id>/`
|
|
12
|
-
= behaviour artefacts**. No server call, no token read, no identity coupling: a
|
|
13
|
-
user with zero experts (or who just removed their last) still shops generically
|
|
14
|
-
exactly as before.
|
|
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/agents/<id>/` = SDS behaviour artefacts**. No server call, no token read, no identity coupling: a user with zero experts still shops generically exactly as before.
|
|
15
6
|
|
|
16
|
-
**The source of truth for "what is a sil expert" is the sil artefact store, not
|
|
17
|
-
the host agent list.** A directory `$SIL_DATA_DIR/agents/<id>/` with a readable
|
|
18
|
-
`profile.json` IS a sil expert; a bare host `agents.list[]` entry without one is
|
|
19
|
-
just a host agent and is not ours to list, view, or remove. Always read the
|
|
20
|
-
artefact store — `profile.json` — never the host agent list, to decide what
|
|
21
|
-
exists.
|
|
7
|
+
**The source of truth for "what is a sil expert" is the sil artefact store, not the host agent list.** A directory `$SIL_DATA_DIR/agents/<id>/` with a readable `profile.json` IS a sil expert; a bare host `agents.list[]` entry without one is just a host agent, not ours to list/view/remove. Always read `profile.json`, **never the host agent list**, to decide what exists.
|
|
22
8
|
|
|
23
9
|
## Match intent to a tool
|
|
24
10
|
|
|
25
11
|
| Intent | Tool |
|
|
26
12
|
|---|---|
|
|
27
13
|
| "list my experts" / "what shopping experts do I have?" | `sil_profile_list` (no arguments) |
|
|
28
|
-
| "show me / tell me about <expert>" | `sil_profile_get` (pass the
|
|
29
|
-
| "remove / delete
|
|
14
|
+
| "show me / tell me about <expert>" | `sil_profile_get` (pass the `agentId`) |
|
|
15
|
+
| "remove / delete <expert>" | host CLI `openclaw agents remove <agentId>` **FIRST**, then `sil_profile_remove` (see the remove flow) |
|
|
30
16
|
|
|
31
17
|
## How the two read tools behave
|
|
32
18
|
|
|
33
|
-
- **`sil_profile_list`** enumerates the artefact store and
|
|
34
|
-
|
|
35
|
-
`agentId`, `name`, `hasPlaybook`, and `createdAt`. Present a name + a short
|
|
36
|
-
domain summary (distilled from the persona; a playbook signals a specialized
|
|
37
|
-
domain) plus the `agentId` so the user can refer to one unambiguously. An
|
|
38
|
-
empty `experts: []` is a normal, successful outcome — say plainly "you have no
|
|
39
|
-
sil shopping experts yet" and point at how to create one ("ask me to make a
|
|
40
|
-
shopping expert for …"). One degraded expert lands in `unreadable[]` — mention
|
|
41
|
-
it inline, but never let it hide the healthy ones.
|
|
42
|
-
- **`sil_profile_get`** resolves one expert by `agentId` and returns its `name`,
|
|
43
|
-
`persona`, optional `playbook`, `profilePath`, and `createdAt`. Render a human
|
|
44
|
-
summary: the expert's name, its domain/persona, whether it carries a domain
|
|
45
|
-
playbook (and a summary when present), and a wiring summary — it is a real
|
|
46
|
-
host agent with the sil plugin enabled and the sil skill attached, ready to
|
|
47
|
-
shop with no further setup. An unknown expert returns `not_found` — frame it
|
|
48
|
-
plainly ("no sil expert named '<x>'") and list the experts that DO exist (or
|
|
49
|
-
say there are none) so the next step is obvious. Never surface a stack trace or
|
|
50
|
-
a raw filesystem path.
|
|
19
|
+
- **`sil_profile_list`** enumerates the artefact store, returning experts most-recently-created first (`createdAt` desc), each with `agentId`, `name`, `createdAt`. Every expert carries all four SDS specs (all required, present from creation), so per-slot presence is not flagged. Present a name + short domain summary + the `agentId` so the user can refer to one unambiguously. An empty `experts: []` is a normal, successful outcome — say "you have no sil shopping experts yet" and point at how to create one. A degraded expert lands in `unreadable[]` — mention it inline, but never let it hide the healthy ones.
|
|
20
|
+
- **`sil_profile_get`** resolves one expert by `agentId`, returning its `name`, its four SDS specs (**`domainSpec`** + **`intentSpec`** + **`userSpec`** + **`playbook`**, all present), `profilePath`, and `createdAt`. The persona is **not** here — it is the host workspace `SOUL.md`. Render a human summary: the name, the niche (from the domain spec), what it knows about the user (user-spec facts + buying taste), and a wiring summary (a real host agent, sil plugin enabled, sil skill attached, ready with no further setup). An unknown expert returns `not_found` — frame it plainly ("no sil expert named '<x>'") and list the experts that DO exist. **Never surface a stack trace or a raw filesystem path.**
|
|
51
21
|
|
|
52
22
|
## Remove flow — host-CLI FIRST, then the artefact tool
|
|
53
23
|
|
|
54
|
-
Removal is **destructive and irreversible** (the
|
|
55
|
-
authored are deleted), so **confirm before removing**: state exactly what will
|
|
56
|
-
be deleted — this one named expert, both its host wiring and its sil behaviour
|
|
57
|
-
artefacts — and proceed only on the user's explicit go-ahead. Then run these
|
|
58
|
-
steps **in this exact order**:
|
|
24
|
+
Removal is **destructive and irreversible** (the expert's SDS artefacts, host wiring, and `SOUL.md` are deleted), so **confirm before removing**: state exactly what will be deleted — this one named expert, both its host wiring and its sil behaviour artefacts — and proceed only on the user's **explicit go-ahead**. Then run these steps **in this exact order**:
|
|
59
25
|
|
|
60
|
-
1. **Existence check (read).** Run `openclaw agents list --json` and confirm the
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`openclaw agents remove <agentId>`, then `openclaw config validate --json` to
|
|
64
|
-
confirm the host config is still valid. The plugin cannot write the host
|
|
65
|
-
config, so this half is always the host CLI's, and it runs ahead of the
|
|
66
|
-
artefact removal.
|
|
67
|
-
3. **Remove the sil artefacts (plugin tool) — SECOND.** Call
|
|
68
|
-
`sil_profile_remove { agentId }` to delete the expert's behaviour-artefact
|
|
69
|
-
directory. It deletes the **artefact half only** — the expert's
|
|
70
|
-
`$SIL_DATA_DIR/agents/<id>/` directory — scoped to exactly the one validated
|
|
71
|
-
`agentId`; a malformed/traversal/`main` id returns `invalid_request` and
|
|
72
|
-
deletes nothing, and an unknown id returns `not_found` (idempotent — safe to
|
|
73
|
-
re-run).
|
|
26
|
+
1. **Existence check (read).** Run `openclaw agents list --json` and confirm the `agentId` is a sil-wired agent the user means.
|
|
27
|
+
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.
|
|
28
|
+
3. **Remove the sil artefacts (plugin tool) — SECOND.** Call `sil_profile_remove { agentId }` to delete the expert's behaviour-artefact directory — the **artefact half only** (`$SIL_DATA_DIR/agents/<id>/`), scoped to exactly the one validated `agentId`. A malformed/traversal/`main` id returns `invalid_request` and deletes nothing; an unknown id returns `not_found` (idempotent — safe to re-run).
|
|
74
29
|
|
|
75
|
-
**Never artefacts-first.** The order is a safety decision,
|
|
76
|
-
if step 3 fails after step 2, the only survivor is a *residual artefact
|
|
77
|
-
directory with no host entry* — harmless disk cruft, no broken agent ever loads,
|
|
78
|
-
and `sil_profile_list` still surfaces it so the user retries `sil_profile_remove`
|
|
79
|
-
clean. The **reverse** order is unsafe: artefacts removed first, then a failed
|
|
80
|
-
host step, leaves a *host `agents` entry whose `profile.json` is gone* — the
|
|
81
|
-
agent still loads but the sil skill ENOENTs on its persona/playbook at runtime,
|
|
82
|
-
a visible, confusing, broken expert. Both halves are individually idempotent
|
|
83
|
-
(host `agents remove` and `sil_profile_remove` both no-op on an absent target),
|
|
84
|
-
so a re-run from any partial state converges to clean. After a successful
|
|
85
|
-
removal, confirm the expert is gone and that the user's **other experts and
|
|
86
|
-
generic shopping are untouched**.
|
|
30
|
+
**Never artefacts-first.** The order is a safety decision: if step 3 fails after step 2, the only survivor is a *residual artefact directory with no host entry* — harmless disk cruft that `sil_profile_list` still surfaces, so the user retries `sil_profile_remove` clean. The **reverse** order 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 on its SDS specs at runtime, a visibly broken expert. Both halves are individually idempotent, so a re-run from any partial state converges to clean. After removal, confirm the expert is gone and the user's **other experts and generic shopping are untouched**.
|
|
87
31
|
|
|
88
|
-
Leave `plugins.entries.sil.enabled` alone on removal — it is shared host state
|
|
89
|
-
(every other expert depends on it; generic shopping is unaffected by it), not
|
|
90
|
-
per-agent. Even removing the last expert leaves it enabled.
|
|
32
|
+
Leave `plugins.entries.sil.enabled` alone on removal — it is shared host state (every other expert depends on it), not per-agent. Even removing the last expert leaves it enabled.
|
|
91
33
|
|
|
92
34
|
## Status taxonomy (manage: list / view / remove)
|
|
93
35
|
|
|
94
36
|
| `status` | Meaning | What to do |
|
|
95
37
|
|---|---|---|
|
|
96
|
-
| `ok` | List succeeded (`experts` may be empty —
|
|
97
|
-
| `not_found` | No sil expert matches the `agentId` (view or remove). | Frame it plainly and list the experts that DO exist; do NOT re-register. For remove,
|
|
98
|
-
| `invalid_request` | The `agentId` was malformed, `main`, or traversal-shaped. **Nothing was read or deleted.** | Fix the id and call again — never a stack trace or
|
|
38
|
+
| `ok` | List succeeded (`experts` may be empty — normal), or a view returned the expert's detail. | Relay the data; on an empty list, say so plainly and point at creation. |
|
|
39
|
+
| `not_found` | No sil expert matches the `agentId` (view or remove). | Frame it plainly and list the experts that DO exist; do NOT re-register. For remove, a re-run is safe (idempotent). |
|
|
40
|
+
| `invalid_request` | The `agentId` was malformed, `main`, or traversal-shaped. **Nothing was read or deleted.** | Fix the id and call again — never a stack trace or raw path to the user. |
|
|
99
41
|
| `removed` | `sil_profile_remove` deleted the expert's artefact directory. | Confirm it is gone; ensure the host-wiring removal (step 2) ran first. |
|
|
100
|
-
| `persistence_failed` | The artefact directory could not be removed (the **path** + **cause** name what to fix). | Fix the data directory (writable), then remove again; the
|
|
42
|
+
| `persistence_failed` | The artefact directory could not be removed (the **path** + **cause** name what to fix). | Fix the data directory (writable), then remove again; the host-wiring half need not be redone. |
|
|
@@ -8,23 +8,25 @@ Run these steps **in order, top to bottom** — the order is the spec.
|
|
|
8
8
|
|
|
9
9
|
## The refinement loop (run in this exact order)
|
|
10
10
|
|
|
11
|
-
1. **Trigger + load the named expert.**
|
|
11
|
+
1. **Trigger + load the named expert.** Refinement starts only when the user **explicitly asks** to sharpen a **named** expert. 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 that one expert's current SDS artefacts with **`sil_profile_get { agentId }`** — the manifest plus the `domainSpec` / `intentSpec` bodies (always present) and the `userSpec` / `playbook` bodies (when captured). The persona is the host workspace **`SOUL.md`**, read separately when a persona refinement is on the table. This is the working expert you are about to sharpen; everything you propose is grounded in what it already is.
|
|
12
12
|
|
|
13
13
|
2. **Propose, session-grounded — concretely, never a generic template.** Propose a small set of **concrete refinements drawn from the observed session** — what the agent actually saw in the just-completed (or in-progress) shopping session under this expert. Each proposal must name **two things**:
|
|
14
|
-
- **which artefact element it changes** — a
|
|
15
|
-
- **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 taste/constraint the user **volunteered but the
|
|
14
|
+
- **which artefact element it changes** — a **persona** standing rule (the host `SOUL.md`), a **domain-spec** mechanic or dimension (`domain_spec.md` — e.g. a niche detail the research missed or got wrong), an **intent-spec** decomposition dimension (`intent_spec.md` — e.g. a dimension that mattered for every request but the schema never named), a **user-spec** fact or hard constraint (`user_spec.md` — e.g. a standing measurement, "never leather" as a hard constraint), or a **buying-taste** preference (`playbook.md` — e.g. a brand the user keeps rejecting, a tightened budget band); and
|
|
15
|
+
- **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 `user_spec.md` hard constraint; "you rejected every leather option" → a `user_spec.md` hard constraint; "you kept asking about lug depth, which my domain spec never covered" → a `domain_spec.md` mechanic; "every request turned on frame size, but my intent schema never decomposed on it" → an `intent_spec.md` dimension).
|
|
16
|
+
|
|
17
|
+
The four SDS artefacts are **first-class refinable elements** alongside the persona: a refinement can target the **domain spec** (`domain_spec.md`), the **intent spec** dimensions (`intent_spec.md`), a **user-spec** fact or hard constraint (`user_spec.md`), or the **buying taste** (`playbook.md`) as a distinct artefact element, each persisted via the same in-place re-materialize (step 4). The **per-query intent** is ephemeral and is never a refine target — only the `intent_spec.md` *dimension schema* is.
|
|
16
18
|
|
|
17
19
|
Every proposal cites the observed evidence — it is **grounded**, not guesswork. This is **not a generic template** and **not** a plausible-sounding ungrounded "improvement"; 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.)
|
|
18
20
|
|
|
19
21
|
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; the user chooses **which to keep**). 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**.
|
|
20
22
|
|
|
21
|
-
4. **Persist ONLY the confirmed subset.** Fold **only the confirmed** proposals into the expert's **
|
|
23
|
+
4. **Persist ONLY the confirmed subset.** Fold **only the confirmed** proposals into the expert's spec (a **domain-spec** change → the `domainSpec` body / `domain_spec.md`; an **intent-spec** dimension change → the `intentSpec` body / `intent_spec.md`; a **user-spec** fact or hard-constraint change → the `userSpec` body / `user_spec.md`; a **buying-taste** change → the `playbook` body / `playbook.md`), then re-run the engine's persist step — **`sil_profile_materialize { agentId, name, domainSpec, intentSpec, userSpec, playbook }`** — over that one `agentId`. **All four specs are required and are always passed** (read the current bodies, fold the confirmed change into the relevant one, and pass all four back — the re-materialize re-writes each whether or not it changed). The unconfirmed proposals are **discarded** with the conversation; nothing else persists. If the user confirms nothing, nothing changes.
|
|
22
24
|
|
|
23
|
-
The re-materialize is an **atomic in-place re-write** of that one expert's artefacts — `
|
|
25
|
+
The re-materialize is an **atomic in-place re-write** of that one expert's four SDS artefacts — `domain_spec.md`, `intent_spec.md`, `user_spec.md`, `playbook.md` (all four are passed; the confirmed refinements change whichever bodies they touch) are overwritten and the manifest refreshed, all-or-nothing per file (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 expert is never served half-refined, and you tell the user the refinement **did not stick** (the failure leaves the prior state unchanged, so there is nothing to undo). *Truthful failure-safety note: the re-write is per-file atomic and dir-preserving — a failed re-write never tears the expert down and never serves a coherent half-refined expert (a broken manifest reads back as not-found, fail-closed). It is **not** a cross-file transaction; the safety property is "fails closed, prior expert intact / never half-served", not "all files roll back together".*
|
|
24
26
|
|
|
25
|
-
When a confirmed refinement changes the **persona** (the expert's system framing),
|
|
27
|
+
When a confirmed refinement changes the **persona** (the expert's system framing), 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. SDS behaviour artefacts go to the sil data directory via the plugin tool; the `SOUL.md` refresh is host-CLI; identity is untouched.
|
|
26
28
|
|
|
27
|
-
5. **Close the loop — the refined expert reflects the kept changes on re-run.** A later session opened inside the refined expert loads the **updated** artefacts (the same Runtime hook the engine documents) and behaves accordingly — the sharper
|
|
29
|
+
5. **Close the loop — the refined expert reflects the kept changes on re-run.** A later session opened inside the refined expert loads the **updated** artefacts (the same Runtime hook the engine documents) and behaves accordingly — the deeper domain spec, the sharper intent dimensions, the new hard-no in the user spec, the tightened taste. The improvement is durable: refinement is **iterative, never one-shot** — a change that did not land well is itself refinable next time.
|
|
28
30
|
|
|
29
31
|
6. **Isolation + the no-signal fallback.** A refinement touches exactly the named expert's `agents/<agentId>/` directory — keyed off the single validated `agentId`. **Other experts are untouched** (no sibling expert's artefacts mutate), and the **generic, profile-less shopping path is untouched** (a plain sil session still shops exactly as today). One expert's sharpening never leaks into another or into generic shopping.
|
|
30
32
|
|
|
@@ -32,9 +34,9 @@ Run these steps **in order, top to bottom** — the order is the spec.
|
|
|
32
34
|
|
|
33
35
|
The improvement is **per-user and local**: it is written only to this user's sil data directory (`$SIL_DATA_DIR/agents/<agentId>/`), on this machine. There is **no server-side aggregation, no shared store, no shared expert, and no cross-user signal** — the refine path calls **no server endpoint** and performs **no identity round-trip**. The expert gets sharper for this user alone; nothing is pooled or shared.
|
|
34
36
|
|
|
35
|
-
##
|
|
37
|
+
## How a refinement reaches the `sil_search` params
|
|
36
38
|
|
|
37
|
-
A refinement to the
|
|
39
|
+
A refinement to what the expert searches on lands in an SDS artefact — a domain mechanic in `domain_spec.md`, a decomposition dimension in `intent_spec.md`, a stored fact in `user_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** — and 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) (the table, the worked params, and the `ship_to`-empty rule).
|
|
38
40
|
|
|
39
41
|
## When there is no observed-session signal
|
|
40
42
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Answer→`sil_search`-param mapping (the mapping is real)
|
|
2
2
|
|
|
3
|
-
Load this
|
|
3
|
+
Load this at shop time, when an expert's loop maps a decomposed request into a `sil_search` call ([`expert_shopping.md`](expert_shopping.md) Step 4). The mapping must target the **real `sil_search` parameters** (the shopping loop's catalog tool, named in `SKILL.md`) and nothing else — never invent a filter. (Under SDS there is no stored "answer→param mapping" seller artefact — the niche knowledge of *what* to search on lives in the domain spec; this reference is the generic param table the mapping draws on.)
|
|
4
4
|
|
|
5
5
|
## The parameters available to map onto
|
|
6
6
|
|
|
@@ -11,25 +11,45 @@ Load this while converging interview section 4 (the answer→`sil_search`-param
|
|
|
11
11
|
| "New only" | `condition: ["new"]` |
|
|
12
12
|
| The narrowed niche + key descriptors | `query` (free text) and/or `category` |
|
|
13
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 —
|
|
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
15
|
|
|
16
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 an expert that emits invalid `sil_search` calls at shop time.
|
|
17
17
|
|
|
18
|
+
## SDS mapping inputs — the decomposed intent, the user facts, the buying taste, the domain mechanics
|
|
19
|
+
|
|
20
|
+
Under [Spec-Driven Shopping](expert_shopping.md), the mapping reads several layers, not only the user's words for *this* request:
|
|
21
|
+
|
|
22
|
+
- The **decomposed per-query intent** (the `intent_spec.md` dimensions filled in for this request — ephemeral) is the most specific layer and wins for *preferences* (precedence **intent > playbook > user_spec > domain_spec**).
|
|
23
|
+
- The **buying taste** (`playbook.md`) supplies the user's standing preferences — 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**.
|
|
24
|
+
- The **user spec** (`user_spec.md`) supplies the user's standing **facts** (a foot profile, a compatibility detail) and the **hard constraints** — facts map to params like any stated answer; the stored value fills the param, never re-asked.
|
|
25
|
+
- The **domain spec** (`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.
|
|
26
|
+
|
|
27
|
+
The param table itself is **unchanged** — these layers are inputs to the same mapping, not new params. A domain dimension, a standing user fact, or a taste with **no matching param** folds into `query`/rubric per the no-invented-filter rule above, exactly like any other non-param taste.
|
|
28
|
+
|
|
29
|
+
## Hard constraints — route to a real filter AND a reject-at-recommend rule, NEVER only `query` text
|
|
30
|
+
|
|
31
|
+
A **user-spec hard constraint** ("never leather", "nothing over 8 kg", an allergy, an age gate) is **inviolable** — the expert 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-recommend rubric rule** (`expert_shopping.md` Step 4). 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
|
+
|
|
18
38
|
## `ship_to` stays EMPTY by default — inline rule (do not skip)
|
|
19
39
|
|
|
20
40
|
Do **not** map the user's location onto `ship_to`, and do **not** instruct the expert 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 expert inherits correct location-aware search by construction — leave `ship_to` out, and never round-trip `sil_whoami` to fill it.
|
|
21
41
|
|
|
22
42
|
## Worked param examples
|
|
23
43
|
|
|
24
|
-
|
|
44
|
+
At shop time the mapping translates the decomposed intent + the stored facts/taste into concrete params. For a road-cycling expert whose user said (this request, plus a stored €1200 budget taste) "secondhand is fine, I'm in France and want local shops":
|
|
25
45
|
|
|
26
46
|
```
|
|
27
47
|
query: "<niche descriptors from the answer>" # e.g. "endurance road bike 105 groupset"
|
|
28
48
|
category: "<the narrowed niche category>"
|
|
29
49
|
price_max: 120000 # €1200 → minor units (cents)
|
|
30
50
|
condition: ["secondhand"] # "secondhand is fine"
|
|
31
|
-
local_merchants: true # "want local shops" → ranking bias;
|
|
51
|
+
local_merchants: true # "want local shops" → ranking bias; optionally query in the local language (e.g. French) to surface more of them
|
|
32
52
|
# ship_to: OMITTED — server resolves the registered default address; no sil_whoami round-trip
|
|
33
53
|
```
|
|
34
54
|
|
|
35
|
-
|
|
55
|
+
Budget → `price_max` (cents), "secondhand is fine" → `condition`, "want local shops" → `local_merchants: true`; `ship_to` left out so the server resolves the registered default. A non-param taste ("understated colours") folds into `query` or the rubric, never a new filter.
|