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.
@@ -1,71 +1,97 @@
1
- # Set up your shopper — the onboarding interview
2
-
3
- When the user asks to **set up shopping** — "create my shopper", "set up an agent that shops for me", "I want something that shops for me" — do **not** jump to the engine. Run a short, **two-touchpoint** onboarding that shapes the shopper *with* the user — **pre-seeded from what they already said this session** — then **create nothing** until the user endorses the assembled draft. The agent-creation engine ([`agent_creation_engine.md`](agent_creation_engine.md)) only runs **after** that explicit endorsement.
4
-
5
- This is a **conversation, not a form-fill** — and a **short** one. Because you **pre-seed** from the session, you open by **reflecting a filled draft back**, not with a cold question. The shopper is a **generalist**: it goes deep on whatever the user later buys, **lazily minting a domain on first shop in each niche**. So onboarding does **NOT** research any niche and does **NOT** ask the user to pick one. It touches exactly **two** things: the **persona** (how their shopper should behave) and a **shared user-spec seed** (cross-niche facts + hard constraints). Everything niche-specific — how to shop a niche well, what each request in it should resolve, the niche shopping taste — is **deferred to first shop**, not authored here.
6
-
7
- ## Session pre-seed — open with a reflected draft, never a cold question
8
-
9
- Before you ask anything, assemble a **draft** from what the user has **already said** *this session*: the **persona** (their own words on how the shopper should behave) and the **shared user-spec seed** (any sizes, hard limits, or ethics rules they mentioned in passing). Then **open by reflecting that draft back** — *"from what you've told me, here's the shopper I'd set up…"* — and ask only to **confirm-or-adjust**. That is the **rich** (a filled draft, so the shopper demonstrably listened) + **light** (one confirm) shape.
10
-
11
- - **Pre-seed, don't interrogate.** **Pre-fill** the persona + the shared `user_spec` from the session; ask only to fill genuine gaps, never to re-collect what the user already told you.
12
- - **Never invent facts you did not hear.** If the session gave little, seed a **minimal honest** draft ("cross-niche facts to be learned as we shop; no hard constraints stated yet") and say so — never fabricate a size or a limit.
13
- - **Session-only — local + offline.** The seed is assembled **only** from this conversation. It does **NOT** pull `sil_whoami`, reads **no** token, and makes no network call. (The shopper registers the user later, on first shop, via `sil_register` — never a prerequisite here.)
14
- - **The endorsement gate is untouched.** A rich pre-fill is a **proposal**, never consent — see the gate in §3 below.
15
-
16
- ## The two onboarding touchpoints — persona + shared user spec
17
-
18
- A created shopper runs on a persona (`SOUL.md`) plus the **shared, agent-level `user_spec.md`**, both seeded here. The per-domain packs are minted lazily at shop time, not at onboarding.
19
-
20
- | Artefact | Where | What it holds | Seeded |
21
- |---|---|---|---|
22
- | **`SOUL.md`** (persona) | host workspace (via host CLI) | the shopper's identity / voice / standing rules — a **generalist**, not a niche specialist | pre-seeded from the session (§1 below); refined on persona refine, stable per query |
23
- | **`user_spec.md`** (shared) | sil data dir (**required**) | the user's **cross-niche** facts + hard constraints (addresses, sizes, allergy/ethics rules, budget psychology) | pre-seeded partial from the session (§2); augmented every query, reused across **every** niche |
24
-
25
- The niche packs — the deep niche know-how, the per-request template a query is resolved against, and the niche shopping taste — are **NOT** authored here; they are minted **on first shop in each niche** ([`shop_loop.md`](shop_loop.md)). The per-query fill (the template filled in for one request) is **ephemeral** — never persisted, never authored here.
26
-
27
- ## Principles for the interview
28
-
29
- - **Pre-seed from the session; open with the draft.** Assemble the persona + shared user-spec draft from what the user already said, and lead with it (reflect-back), not a cold questionnaire. The interview is **rich but light** — a filled draft plus one confirm-or-adjust per touchpoint.
30
- - **Two touchpoints, no niche research.** Touch the persona and the shared user spec — that is the whole onboarding. The shopper is a **generalist**; there is **no narrow-the-niche step** and **no domain interview**. The deep niche expertise is researched **lazily, at first shop**, never interrogated here.
31
- - **The persona question shapes voice, not a niche.** The persona surfaces the **voice / standing rules** — terse vs. chatty, cautious vs. opinionated, any never-break rules. It does **not** bind the shopper to one niche.
32
- - **Seed the shared facts, ask little.** The shared user spec holds cross-niche facts + hard constraints that carry across every niche. Seed what the user volunteered — don't run a questionnaire; the rest is **augmented per-query** at shop time.
33
- - **Converge, don't accumulate.** Reflect a short summary back and get a yes/adjust before advancing. The flow is **collaborative** and **re-entrant** — the user can revise an earlier touchpoint at any point.
34
- - **Endorsement is a gate, not a formality.** Until the user explicitly says "create it", run **zero** engine steps. The draft lives only in the conversation.
1
+ ---
2
+ name: brainstorm-interview
3
+ description: The two-touchpoint shopper onboarding — persona + shared user-spec seed, converged with the user and endorsement-gated. Load when the user asks to set up or create their shopper.
4
+ ---
35
5
 
36
- ## Run the interview in this order — two touchpoints
37
-
38
- ### 1. `SOUL.md` — persona + behaviour (a generalist shopper), pre-seeded
39
-
40
- Open by **reflecting the session-seeded persona draft back** ("from what you've told me, your shopper sounds like…"), then confirm-or-adjust its **voice/tone** (terse vs. chatty, cautious vs. opinionated) and any **standing rules** it should always follow. Only ask the persona/identity question cold if the session gave you nothing to reflect. This is the shopper's **system framing**, a **generalist** that will shop whatever the user buys — **not** a niche choice; the niche is decided later, per query, when the user actually shops. This becomes the host workspace **`SOUL.md`** (the persona is the agent's system framing — **not** a sil artefact, no `persona.md`).
41
-
42
- ### 2. `user_spec.md` (shared) — seed the cross-niche facts + hard constraints
43
-
44
- **Pre-fill** the **shared user spec** from the session: the user's **cross-niche** facts and any **hard constraints** that should hold in *every* niche — addresses / sizes the user volunteered, an allergy or ethics rule ("never leather"), a budget psychology. Reflect the pre-filled seed back and mark each as **hard** (inviolable — an allergy, an ethics rule, an age gate) vs **soft** (a bendable preference). Don't run a questionnaire — seed what the user offered; the rest is **augmented per-query** at shop time, and a niche-specific fact is learned when that niche is first shopped. If the user gave little, seed a minimal honest body (e.g. "cross-niche facts to be learned as we shop; no hard constraints stated yet") — non-blank, but partial. This lands in `userSpec` (→ the shared `user_spec.md`). **No niche taste, no domain question, no intent dimensions are gathered here** — those belong to first-shop lazy mint.
45
-
46
- ### 3. Derive the identity, assemble, endorse
47
-
48
- - **Identity.** Propose an `agentId` (lower-kebab, `^[a-z0-9][a-z0-9-]*$`, never `main`) and a human-readable `name` ("My Shopper" / `my-shopper`). **Confirm both** — never silently invent them.
49
- - **Assemble + present.** Compose **`{ agentId, name, persona, userSpec }`** and present a **readable summary**: who the shopper is (its persona/voice + standing rules) and the **seeded shared user spec** (cross-niche facts + hard constraints, partial, to grow per-query). Self-check the shape against the engine's contract: `agentId` lower-kebab & ≠ `main` (it keys the host `openclaw agents add`, not the sil tool), non-blank `name`/`persona`, and a non-blank shared `userSpec` — the only sil artefact at create (the engine passes just `name` + `userSpec` to the singleton `sil_profile_materialize`; no niche pack is authored here). This is shape-only — it writes nothing; the engine's validate-first step is the authoritative gate.
50
- - **Endorse — the gate.** Ask for an explicit go-ahead ("shall I create your shopper?"). Endorsement is an **affirmative user act** on the assembled draft — "yes, create it" / "go ahead". It is **NOT** inferred from the user answering the last question, and **NOT** from silence. **Only on that explicit endorsement** do you proceed to the engine ([`agent_creation_engine.md`](agent_creation_engine.md)) and run the one command.
51
-
52
- ## Edge cases the interview handles gracefully
53
-
54
- - **A shopper already exists (the singleton).** The shopper is a singleton — the engine refuses a second create (its `collision` outcome, "a shopper already exists") and never clobbers the existing one. Surface it and steer the user to **shop a new niche** (which lazily mints a domain on the spot) or **refine the existing shopper** — **never** mint a second shopper, never silently mutate the existing one.
55
- - **Abandon mid-flow.** Because **no engine step runs before endorsement**, abandonment leaves **nothing created** — no host agent, no artefacts, no wiring, no teardown. Never "save progress" by writing artefacts early.
56
- - **Creation is local + offline (for the user's identity).** Creating a shopper neither requires nor performs sil registration. Do **NOT** present sil registration or a token as a prerequisite to create the shopper; the session seed does **not** pull `sil_whoami`, reads no token, and never reaches the network. It registers the user later, on first shop, via `sil_register`. (No web access is needed at onboarding either — the niche research that reaches the web happens later, at first shop.)
57
-
58
- ## Business rules (invariants the interview holds on every path)
59
-
60
- 1. **No creation without explicit endorsement.** Nothing is written — not the host agent, the `SOUL.md`, the shared user spec, or the wiring — until the user explicitly endorses. The draft lives only in the conversation until then.
61
- 2. **Abandon-mid-flow creates nothing.** No engine step runs pre-endorsement (**zero engine steps** before the explicit "yes"), so an abandoned interview leaves no partial shopper — automatic, not a teardown. Nothing is created, nothing partial.
62
- 3. **Two touchpoints only — persona, then shared user spec.** `SOUL.md` (persona/voice, a generalist, NOT a niche) and the shared `user_spec.md` (cross-niche facts + hard constraints), both **pre-seeded from the session**. **No** niche know-how, no niche shopping taste, and no per-request template work at onboarding — those move to first-shop lazy mint.
63
- 4. **No niche is researched or chosen at onboarding.** The shopper is a generalist; the deep niche know-how, the per-request template, and the niche shopping taste are minted **lazily, on first shop** in each niche ([`shop_loop.md`](shop_loop.md)). Onboarding never interrogates a niche or asks the user to pick one.
64
- 5. **Converge each touchpoint before advancing; stay re-entrant.** Reflect-and-confirm per touchpoint; let the user revise an earlier one.
65
- 6. **Singleton: refuse a second shopper; never clobber.** Defer to the engine's `collision` refusal ("a shopper already exists"); steer to shop-a-new-niche or refine.
66
- 7. **Creation is local + offline for the user's identity.** Never present sil registration / a token as a prerequisite to create, and never pull `sil_whoami` to seed — the seed is session-only.
67
- 8. **The persona is the host `SOUL.md`, not a sil artefact.** No `persona.md` in the sil store. The only sil artefact seeded at create is the **shared** `user_spec.md`; the niche packs (the deep niche know-how, the per-request template, the niche shopping taste) are minted later, per niche.
68
-
69
- ## After endorsement
6
+ # Set up your shopper — the onboarding interview
70
7
 
71
- Once the user has **explicitly endorsed** the assembled draft, proceed to [`agent_creation_engine.md`](agent_creation_engine.md) and run the **one command**. Until that explicit endorsement, **zero engine steps** have run.
8
+ When the user asks to **set up shopping** — "create my shopper", "set up an agent
9
+ that shops for me" — do **not** jump to the engine. Run a short, **two-touchpoint**
10
+ onboarding that shapes the shopper *with* the user — **pre-seeded from what they
11
+ already said this session** — then create nothing until the user endorses the
12
+ assembled draft. The engine ([`agent_creation_engine.md`](agent_creation_engine.md))
13
+ runs only **after** that explicit endorsement.
14
+
15
+ This is a **conversation, not a form-fill** — and a short one. The shopper is a
16
+ **generalist**: it goes deep on whatever the user later buys, **lazily minting a
17
+ domain on first shop** in each niche. So onboarding does **not** research any niche
18
+ and does **not** ask the user to pick one. It touches exactly **two** things: the
19
+ **persona** (how the shopper behaves) and a **shared user-spec seed** (cross-niche
20
+ facts + hard constraints).
21
+
22
+ ## Open with a reflected draft, not a cold question
23
+
24
+ Before asking anything, **pre-seed** a draft from what the user already said *this
25
+ session*: the **persona** (their words on how the shopper should behave) and the
26
+ **shared user-spec seed** (any sizes, hard limits, or ethics rules mentioned in
27
+ passing). Then **open by reflecting that draft back** — *"from what you've told me,
28
+ here's the shopper I'd set up…"* — and ask only to confirm-or-adjust. That is the
29
+ rich (a filled draft) + light (one confirm) shape.
30
+
31
+ - **Pre-fill, don't interrogate.** Ask only to fill genuine gaps, never to re-collect
32
+ what the user already told you. If the session gave little, seed a **minimal
33
+ honest** draft ("cross-niche facts to be learned as we shop; no hard constraints
34
+ stated yet") and say so — never fabricate a size or a limit.
35
+ - **Session-only — local + offline.** The seed is assembled **only** from this
36
+ conversation. It reads **no token**, does **not** pull `sil_whoami`, and makes **no
37
+ network call**. (The shopper registers the user later, on first shop.)
38
+ - **The pre-fill is a proposal, never consent.** The endorsement gate below is
39
+ untouched.
40
+
41
+ ## The two touchpoints
42
+
43
+ | Artefact | Where | What it holds |
44
+ |---|---|---|
45
+ | **`SOUL.md`** (persona) | host workspace | the shopper's voice / standing rules — a **generalist**, not a niche specialist |
46
+ | **`user_spec.md`** (shared) | sil data dir (**required**) | the user's **cross-niche** facts + hard constraints (addresses, sizes, allergy/ethics rules, budget psychology) |
47
+
48
+ The niche packs — the deep niche know-how, the per-request template, and the niche
49
+ shopping taste — are **not authored here**; they are **minted lazily on first shop**
50
+ in each niche ([`shop_loop.md`](shop_loop.md)). Never research a niche here.
51
+
52
+ **1. Persona — reflect back, confirm.** Open by reflecting the session-seeded persona
53
+ draft ("from what you've told me, your shopper sounds like…"), then confirm-or-adjust
54
+ its **voice/tone** and any **standing rules**. This surfaces voice, **not a niche** —
55
+ a generalist that shops whatever the user buys. It becomes the host workspace
56
+ **`SOUL.md`** (no `persona.md`).
57
+
58
+ **2. Shared user spec — seed the cross-niche facts + hard constraints.** Pre-fill the
59
+ **shared user spec** from the session: **cross-niche** facts and any **hard
60
+ constraints** that should hold in *every* niche — addresses / sizes, an allergy or
61
+ ethics rule ("never leather"), a budget psychology. Reflect the seed back and mark
62
+ each **hard** (inviolable) vs **soft** (bendable). Seed what the user offered; the
63
+ rest is augmented per-query at shop time. This lands in `userSpec` (→ the shared
64
+ `user_spec.md`). **No niche taste, no domain question, no intent dimensions** are
65
+ gathered here.
66
+
67
+ ## Assemble + endorse
68
+
69
+ - **Identity.** Propose an `agentId` (lower-kebab, `^[a-z0-9][a-z0-9-]*$`, never
70
+ `main`) and a `name` ("My Shopper" / `my-shopper`). Confirm both.
71
+ - **Assemble + present.** Compose **`{ agentId, name, persona, userSpec }`** and
72
+ present a readable summary: who the shopper is and the seeded shared user spec
73
+ (partial, to grow per-query). Self-check the shape — `agentId` lower-kebab & ≠
74
+ `main`, non-blank `name`/`persona`, non-blank shared `userSpec` (the only sil
75
+ artefact at create). This writes nothing; the engine's validate-first step is the
76
+ authoritative gate.
77
+ - **Endorse — the gate.** Ask for an explicit go-ahead ("shall I create your
78
+ shopper?"). Endorsement is an affirmative act on the assembled draft — "yes, create
79
+ it". It is **not** inferred from the last answer and **not** from silence. **Only on
80
+ that explicit endorsement** do you proceed to the engine
81
+ ([`agent_creation_engine.md`](agent_creation_engine.md)).
82
+
83
+ ## Invariants (hold on every path)
84
+
85
+ - **No creation without explicit endorsement.** **Zero engine steps** run before the
86
+ explicit "yes"; the draft lives only in the conversation. **Nothing is created**
87
+ until then, so an abandoned interview leaves no partial shopper.
88
+ - **Two touchpoints only** — persona, then shared user spec, both pre-seeded from the
89
+ session. No niche is researched or chosen here; that is first-shop lazy mint.
90
+ - **Converge each touchpoint before advancing; stay re-entrant** — the user can revise
91
+ an earlier touchpoint at any point.
92
+ - **Singleton.** If a shopper already exists, the engine refuses a second create (its
93
+ `collision`, "a shopper already exists") — surface it and steer to shop-a-new-niche
94
+ or refine; never clobber the existing one.
95
+ - **Local + offline for identity.** Never present sil registration or a token as a
96
+ prerequisite to create, and never pull `sil_whoami` to seed — the seed is
97
+ session-only.
@@ -1,34 +1,32 @@
1
- # sil catalog + identity tools — per-tool behaviour and the shared status taxonomy
1
+ ---
2
+ name: catalog-tools-reference
3
+ description: Per-tool behaviour of the four core sil tools (register, whoami, search, product-get) and the shared status taxonomy. Load when driving any core catalog or identity tool.
4
+ ---
2
5
 
3
- Load this reference when driving any of the four core tools — `sil_register`,
4
- `sil_whoami`, `sil_search`, `sil_product_get`. It holds how each tool behaves and
5
- the status taxonomy every shopping tool shares. The router in `SKILL.md` names
6
- which tool an intent maps to; this reference is what that tool actually does.
6
+ # sil catalog + identity tools — per-tool behaviour and the shared status taxonomy
7
7
 
8
- All four return the canonical envelope: a single text content block whose JSON
9
- body carries a `status`. Prices are in the currency's ISO 4217 minor unit (e.g.
10
- cents).
8
+ Load this when driving any of the four core tools — `sil_register`, `sil_whoami`,
9
+ `sil_search`, `sil_product_get`. The router names which tool an intent maps to; this
10
+ reference is what each does, plus the status taxonomy they all share. All four return a
11
+ single JSON body carrying a `status`; prices are in the currency's ISO 4217 minor unit.
11
12
 
12
- ## How each tool behaves
13
+ ## Per-tool behaviour
13
14
 
14
- - **`sil_register`** starts browser-based registration. It returns promptly with
15
- `status: "awaiting_browser"` and an `auth_url` — share that URL with the user.
16
- The plugin polls in the background; once the user finishes signing in, call
17
- `sil_register` again to confirm (it reports `already_registered`).
18
- - **`sil_whoami`** returns the registered user's identity (name and addresses).
19
- An expired session token is refreshed transparently and the read retried; if the
20
- session is fully dead, the result names the recovery (`sil_register`).
15
+ - **`sil_register`** starts browser-based registration: it returns promptly with
16
+ `status: "awaiting_browser"` and an `auth_url` — share that URL. The plugin polls in
17
+ the background; once the user signs in, call `sil_register` again to confirm (it
18
+ reports `already_registered`).
19
+ - **`sil_whoami`** returns the registered user's identity (name + addresses). An expired
20
+ token is refreshed transparently; a fully-dead session names the recovery
21
+ (`sil_register`).
21
22
  - **`sil_search`** returns a ranked list of purchasable variants (`id`, `title`,
22
- `price`, `availability`, `checkout_url`, `source`), best match first — present
23
- them in order, do not re-rank. An empty list means nothing matched: a normal
24
- `ok` outcome, not an error. Use the returned `cursor` for the next page; its
25
- absence means no more results (never infer end-of-results from page size).
26
- - **`sil_product_get`** is the lookup companion to `sil_search`. Pass ids already
27
- held and get the matching products back with fresh detail (description, options,
28
- the featured variant). Each variant carries an `inputs` list correlating it back
29
- to the id(s) asked about (the response is NOT in request order). Ids that no
30
- longer resolve come back in a `not_found` list — a normal partial-success
31
- outcome, not an error; the other products are still valid.
23
+ `price`, `availability`, `checkout_url`, `source`), best match first — present in
24
+ order, do not re-rank. An empty list is a normal `ok` outcome, not an error. Use the
25
+ returned `cursor` for the next page; its absence means no more results.
26
+ - **`sil_product_get`** is the lookup companion — pass ids you already hold and get the
27
+ matching products back with fresh detail. Each variant carries an `inputs` list
28
+ correlating it to the id(s) asked about (the response is not in request order). Ids
29
+ that no longer resolve come back in a `not_found` list — a normal partial success.
32
30
 
33
31
  ## Status taxonomy (shared across the shopping tools)
34
32
 
@@ -41,6 +39,6 @@ cents).
41
39
  | `invalid_request` | The query/ids were rejected (e.g. empty input). | Fix the input and call again — do NOT re-register. |
42
40
  | `retryable` | A transient network/5xx blip. | Try the same call again — do NOT re-register. |
43
41
 
44
- On a non-`ok` status, say what happened and follow the tool's own `recovery`
45
- hint — never improvise a different one (re-registering can't fix a bad query or a
46
- transient 5xx, and would derail the user).
42
+ On a non-`ok` status, say what happened and follow the tool's own `recovery` hint —
43
+ never improvise a different one (re-registering can't fix a bad query or a transient
44
+ 5xx).
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: fill-and-feedback
3
+ description: Beat 3 (fill the PRD by precedence, multi-turn, hard-constraint dual-enforce, the persistence split) and Beat 6 (the reaction half — capture-gate, confirm-before-write, route-by-scope), plus sil_learn, the one target+change write verb. Load when eliciting requirements or capturing what a reaction surfaced.
4
+ ---
5
+
6
+ # Beat 3 (Fill) and Beat 6 (Feedback) — via `sil_learn`
7
+
8
+ Beats 1–2 hand off the resolved PRD + the method body. Beat 3 fills the PRD; Beat 6
9
+ captures what the reaction surfaces. Both persist through **`sil_learn`**.
10
+
11
+ ## Beat 3 — Fill by precedence
12
+
13
+ Enumerate the load-bearing dimensions the method names, then resolve each by
14
+ walking the chain top-down, **first hit wins**:
15
+
16
+ **request-intent > PRD filled-pref > method taste > user_spec fact > method default**
17
+
18
+ This is a pure **read-compose** — **most** dimensions **resolve** from stored state
19
+ with **no question**, which is the whole point of the chain (a revisited niche does
20
+ not re-ask).
21
+
22
+ **Elicit the residue — multi-turn.** Only a dimension that is unresolved **and**
23
+ load-bearing **and** not answerable from a sensible default goes to the buyer.
24
+ Elicitation is **multi-turn**: keep pursuing each until it is **resolved** or
25
+ explicitly **declined**, then search. Each turn stays **a few at a time, never a
26
+ battery**, each tied to **why**, and plays the filled understanding back.
27
+
28
+ **Live request vs a stored durable pref — ask, don't guess.** When the request
29
+ contradicts a stored **durable** PRD preference, the request wins **this** search,
30
+ but ask whether it is **one-off** or a **standing** change rather than assuming.
31
+ "Just this once" → ephemeral, no write. "From now on" → a **standing** change:
32
+ **amend** the stored preference. **Never silently overwrite** a standing preference.
33
+
34
+ **Hard constraints are inviolable — dual-enforced.** `user_spec [hard]` + PRD hard
35
+ requirements are **inviolable**. Each is routed to a real **filter** where one
36
+ exists **and** handed to Beat 5's **reject-at-pick** check — belt and suspenders,
37
+ because a `specs` predicate can read `applied:false`.
38
+
39
+ **The split — persist stated durable answers NOW.** Fill is the **first** of two
40
+ persistence moments: a durable answer the buyer **stated** during elicitation is
41
+ **written** to the PRD's *Filled preferences* **now**, via `sil_learn` — so an
42
+ abandoned session still recovers what was settled. What the buyer's **reaction**
43
+ surfaces is **Beat 6's** write (the **reaction half**). One-off direction stays
44
+ **ephemeral** and is **never written** by either.
45
+
46
+ **Decline never blocks.** A declined question narrows **quality**, never **access**
47
+ — proceed on the best-defensible params and **state the assumption** ("assuming
48
+ waterproofing, since it's for the slope"). Unresolved-and-declined dimensions land
49
+ in the PRD's *Notes / open* so the next session recovers rather than re-asks.
50
+
51
+ ## Beat 6 — Feedback: the reaction half
52
+
53
+ Beat 6 is the loop's **only reaction-time persistence** and a standing beat.
54
+
55
+ **The capture gate — most reactions persist nothing.** Write only a signal that is
56
+ **durable AND new** — **no duplicate** (**not already stored**), no **noise**, no
57
+ **empty** entry. A this-pick reaction ("too pricey this time") is not durable and
58
+ is never written.
59
+
60
+ **Confirm before every durable write.** When the gate surfaces a new durable
61
+ candidate, **confirm before** writing it ("want me to remember you run Shimano?")
62
+ — **never a silent harvest**. The confirm is gated behind the candidate, so most
63
+ reactions ask nothing.
64
+
65
+ **Route by scope — the placement rule.** A confirmed signal lands at the
66
+ **broadest scope where it stays true**:
67
+
68
+ - a cross-domain **fact** / **hard** constraint → **`user_spec`**;
69
+ - a durable per-domain **taste** → the **method**;
70
+ - a **this-job** preference → the **PRD**;
71
+ - an **image** → **`attach-asset`** (per-domain).
72
+
73
+ **Pick the kind.** New learning → **append**; a reaction that contradicts a stored
74
+ **soft** pref → **amend** (it **supersedes** — **never a stacked bullet**, never a
75
+ second bullet); a withdrawal → **retract**.
76
+
77
+ **Re-scope = write-broader-then-retract-narrower.** When a reaction shows a stored
78
+ fact is broader than where it lives, write it to the **broader** target and
79
+ **retract** the narrower copy (two `sil_learn` calls). There is **no promote verb**.
80
+
81
+ ## `sil_learn` — the one target + change write verb
82
+
83
+ `sil_learn` is the single **target + change** verb owning the whole method/PRD
84
+ lifecycle. `target` selects where the change lands (`user_spec` / `method` /
85
+ `prd`); the **kind** selects the change. Its **five kinds**: **create** (mint a
86
+ whole method/PRD), **append**, **amend**, **retract**, and **attach-asset** (persist
87
+ image bytes, linked by path). Every capture is reviewable via `sil_profile_get` and
88
+ erasable via `sil_profile_remove` — never silently harvested.
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: method-and-prds
3
+ description: Beat 2 of the loop — load, mint or signal-refresh a domain's method — plus the intent-keyed PRD model, the frontmatter-as-truth store, and discovery/manage via sil_profile_search / sil_profile_get / sil_profile_remove. Load when resolving a domain's method or managing what the shopper knows.
4
+ ---
5
+
6
+ # Beat 2 — the domain method, intent-keyed PRDs, and the store
7
+
8
+ Beat 1 hands off a resolved `domain` — a **HIT** (the method exists) or a **MISS**
9
+ (no method yet). Beat 2 turns that into a method body in context, ready for Beat 3
10
+ to fill. Three paths, not one.
11
+
12
+ ## LOAD — the hot path (HIT, fresh)
13
+
14
+ A plain revisit **LOADS**: `sil_profile_get(domain)` reads the durable method body
15
+ — **no research**, no round-trip. This is the default on every revisit; the method
16
+ is **recovered, never rebuilt**. Loading the method's `## Search vocabulary` also
17
+ brings its coined `ns.key` dimensions into context for Beat 4.
18
+
19
+ ## MINT — cold (MISS)
20
+
21
+ No method exists, so **research** the niche (a web tool where available, else
22
+ public knowledge stated plainly) and **mint** one. Draft the buying guide + the
23
+ buyer's durable per-domain taste (seeded from `user_spec`) + the whole-domain
24
+ **spec vocabulary** you **coin** from the research (`ns.key` + data type + unit +
25
+ why-it-matters) + a **volatility marker** (the domain's volatile axis + rough
26
+ cadence). Persist with **`sil_learn create`** — `target: "method"`, with the domain
27
+ + name + body — the file **is** the registration. The mint verb is **`sil_learn
28
+ create`**, never the **setup-only** `sil_profile_materialize` (which writes only the
29
+ shared `user_spec.md` and mints no domain). Then **announce** the inferred domain so
30
+ the buyer can correct it.
31
+
32
+ The coined vocabulary is **coined to converge, then canonicalized before persist**.
33
+ `sil_specs` is **precision-first** — two coined specs converge only when **every field**
34
+ agrees within the same `namespace` and `data_type`, so the name you coin decides whether a
35
+ concept converges or forks: a synonym (`speed_mbps` vs `transfer_speed_mbps`) splits one
36
+ concept into two specs that never match. So coin for the match. **One concept,
37
+ one spelling:** reuse the exact `ns.key`, `display_name`, `data_type`, and `unit` you
38
+ already coined for that concept — verbatim, across every domain (consult a sibling
39
+ method with `sil_profile_get` only when the concept plausibly recurs, never an
40
+ exhaustive scan). For a common, widely-shared attribute you have **not** coined before
41
+ (screen size, weight, RAM, waterproof rating, material…), take its **conventional**
42
+ name over a personal synonym — a Schelling point, since there is no registry to read.
43
+ Coin a fresh name only for a genuinely niche attribute. On each coined spec carry a
44
+ concept-naming **`description`** — the load-bearing **corroborator** the dedupe leans on
45
+ to merge true synonyms and the veto that keeps distinct concepts apart — and get
46
+ **`data_type`** and **`namespace`** right, the hard floors a wrong value forks the
47
+ concept past. Then submit the coined spec
48
+ definitions to **`sil_specs`** (dedupe-or-create) and adopt the returned **canonical**
49
+ `ns.key` for every spec: a **`matched`** result means an equivalent canonical spec
50
+ already exists — **drop your coined synonym and adopt the canonical name**; a
51
+ **`created`** result means yours is novel and is canonical going forward (keep it).
52
+ Rewrite the method's `## Search vocabulary` and any PRD `specs` predicates to those
53
+ canonical names, then persist — the method is **born canonical**, never
54
+ write-then-amend. This convergence is what makes `filters.specs` actually filter
55
+ across methods; good naming is never a gate — a fragmenting name never blocks a
56
+ search, it only costs precision. If `sil_specs` is **not `ok`** (a registry blip),
57
+ **do not block the mint**: persist with the **raw coined names** (every predicate
58
+ reads `applied:false`) and shop on — convergence retries on the next mint/refresh.
59
+ Canonicalization is **silent to the buyer**: never surface `ns.key` plumbing.
60
+
61
+ ## REFRESH — signal-driven (HIT, stale)
62
+
63
+ A plain revisit LOADS; a refresh fires **only on a signal**, never on a TTL and
64
+ **not every revisit**. The three signals: the buyer **contradicts** the guide, the
65
+ method's own **volatility marker** is overdue, or the buyer **explicitly asks**. So
66
+ refresh is **signal-driven** — `contradict` · overdue volatility `marker` ·
67
+ `explicit ask` — not a clock.
68
+
69
+ Refresh is **create-with-merge**: load the current method, re-research **only** the
70
+ stale volatile material, **carry every buyer-authored line forward verbatim**,
71
+ re-emit the whole body via `sil_learn create` (overwrite), and announce the delta.
72
+ The merge **preserves** every **buyer** `sil_learn` edit — it rewrites stale
73
+ *research* claims and **never clobbers** a buyer edit. The method is fully
74
+ buyer-mutable at any time via `sil_learn` append/amend/retract.
75
+
76
+ Canonicalize any **newly-coined** specs via `sil_specs` before persisting the
77
+ refreshed method — coin them with the same convergence discipline (reuse a name you
78
+ already coined for the concept; take the conventional name for a common attribute)
79
+ and resubmit **only** the specs not yet carrying a canonical name (already-canonical
80
+ names are stable; do not resubmit them).
81
+
82
+ ## Intent-keyed PRDs
83
+
84
+ A PRD's identity is the **job-to-be-done**. Its key carries three coordinates so it
85
+ stays queryable: `{ domain, product, intent }` → `ski/gloves-slope`. Intent is
86
+ always present (a context-free request keys `general`). A PRD holds the method's
87
+ requirements **specialized to this job** plus the buyer's **durable** filled
88
+ preferences (the per-job slice; the per-domain durable taste lives in the method).
89
+ PRDs are **durable** and **revisitable** — you re-buy the same thing, or you don't
90
+ finish in one session, and the PRD is **recovered**, never rebuilt.
91
+
92
+ ## The store — frontmatter-as-truth (no manifest)
93
+
94
+ Artefacts live at `shopper/domains/<slug>/{method.md, prds/<product>-<intent>.md,
95
+ assets/}`. There is **no manifest** — each file's own **frontmatter** IS the source
96
+ of truth, discovered by a filesystem **scan** over those **coordinates**. A file
97
+ with malformed frontmatter is skipped and surfaced as `unreadable`, never half-read.
98
+
99
+ ## Discovery + manage
100
+
101
+ - **Discover / reuse-before-mint** with **`sil_profile_search`** — it queries
102
+ artefact **frontmatter** and returns **coordinates** only (no bodies): the
103
+ domains the shopper has learned and its PRDs. This is the frontmatter-as-truth
104
+ query, **not a manifest** and not a filesystem guess. The no-filter call is the
105
+ "what does my shopper know?" overview.
106
+ - **Read one body** with **`sil_profile_get`** — `domainSlug` for the method body,
107
+ `+prd` for that PRD's body.
108
+ - **Remove** with **`sil_profile_remove`** — `domainSlug` alone removes the
109
+ **whole domain** subtree; `+prd` removes **just that PRD** (method + siblings
110
+ survive). It is destructive: **confirm** with the buyer first.
@@ -1,55 +1,80 @@
1
- # Answer→`sil_search`-param mapping (the mapping is real)
2
-
3
- Load this at shop time, when the shop loop maps a decomposed request into a `sil_search` call ([`shop_loop.md`](shop_loop.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 active domain's domain spec; this reference is the generic param table the mapping draws on.)
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
- 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 **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
- At shop time the mapping translates the decomposed intent + the stored facts/taste into concrete params. For a shopper's road-cycling domain whose user said (this request, plus a stored €1200 budget taste in that domain) "secondhand is fine, I'm in France and want local shops":
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. There is no stored
16
+ "answer→param" seller artefact — *what* to search on for a niche lives in the active
17
+ domain's **method**; this reference covers only the SDS layers that feed the mapping and
18
+ 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 (the fill
23
+ precedence — see [`fill_and_feedback.md`](fill_and_feedback.md) — is
24
+ **request-intent > PRD filled-pref > method taste > user_spec fact > method default**):
25
+
26
+ - The **filled PRD** for this job is most specific and wins for *preferences* — its
27
+ filled answers map onto params exactly like a freshly-stated answer, but **never
28
+ re-asked**.
29
+ - The buyer's durable per-domain **taste** (in the **method**) supplies standing
30
+ preferences for *this niche* — a budget band → `price_min`/`price_max`.
31
+ - The **shared user spec** (`user_spec.md`) supplies standing **facts** and the **hard
32
+ constraints**, reused across **every** niche — a fact maps to a param like any answer.
33
+ - The **method** supplies the niche's decision-mechanics — which attributes are
34
+ load-bearing here — so the mapping knows what to map and what matters.
35
+
36
+ These layers are inputs to the same params, not new params. A stated taste with **no
37
+ matching param** (a colour, a brand, "eco-friendly") folds into the `query` text or the
38
+ recommendation reflection — **never a new filter**. There is no `color` or `brand` param;
39
+ inventing one emits invalid `sil_search` calls.
40
+
41
+ ## Hard constraints — a real filter AND a reject-at-recommend rule, NEVER only `query`
42
+
43
+ A shared user-spec **hard constraint** ("never leather", "nothing over 8 kg", an
44
+ allergy, an age gate) is **inviolable** in every niche. A hard constraint carried
45
+ **only** as soft `query` text leaks — the catalog can still surface a violating item.
46
+ Route each to **two** points, **not merely `query`** (see
47
+ [`shop_loop.md`](shop_loop.md) Beat 5):
48
+
49
+ 1. **A real `sil_search` filter where one exists** — "new/secondhand only" →
50
+ `condition`; "in stock only" → `available` (omit for the in-stock default). Where a
51
+ param matches, set it so the catalog never returns the violating item.
52
+ 2. **An explicit reject-at-pick rule** for a constraint with no matching param
53
+ (no `material` filter for "never leather"): the constraint **rejects** any violating
54
+ candidate outright, never down-weights it. A hard constraint is a reject, not a
55
+ weight.
56
+
57
+ ## `ship_to` stays EMPTY by default
58
+
59
+ Do **not** map the user's location onto `ship_to`, and do **not** call `sil_whoami` to
60
+ populate it. When `ship_to` is absent, sil-api resolves the user's **registered default
61
+ address** server-side. Set `ship_to` only to OVERRIDE the default with a *different*
62
+ destination (e.g. "ship this to my office in Germany"). The shopper inherits
63
+ location-aware search by construction — leave `ship_to` out.
64
+
65
+ ## Worked example
66
+
67
+ For a road-cycling domain whose user said (this request + a stored budget taste in that
68
+ domain) "secondhand is fine, I'm in France and want local shops":
45
69
 
46
70
  ```
47
- query: "<niche descriptors from the answer>" # e.g. "endurance road bike 105 groupset"
71
+ query: "endurance road bike 105 groupset" # niche descriptors
48
72
  category: "<the narrowed niche category>"
49
73
  price_max: 120000 # €1200 → minor units (cents)
50
- condition: ["secondhand"] # "secondhand is fine"
51
- local_merchants: true # "want local shops" → ranking bias; optionally query in the local language (e.g. French) to surface more of them
52
- # ship_to: OMITTED — server resolves the registered default address; no sil_whoami round-trip
74
+ condition: ["secondhand"]
75
+ local_merchants: true # ranking bias; optionally query in French to surface more local shops
76
+ # ship_to: OMITTED — server resolves the registered default address
53
77
  ```
54
78
 
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.
79
+ A non-param taste ("understated colours") folds into `query` or the recommendation
80
+ reflection, never a new filter.