sil-openclaw 0.3.1 → 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 +38 -0
- package/README.md +3 -1
- package/dist/lib/credentials.js +1 -1
- package/dist/lib/profile-store.js +18 -11
- package/dist/lib/sil-client.js +2 -2
- package/dist/tools/catalog.js +10 -8
- package/dist/tools/identity.js +3 -3
- package/openclaw.plugin.json +2 -2
- package/package.json +1 -1
- package/skill/examples/road_cycling_expert_walkthrough.md +1 -1
- package/skill/references/brainstorm_interview.md +2 -2
- package/skill/references/catalog_tools_reference.md +1 -1
- package/skill/references/expert_shopping.md +1 -1
- package/skill/references/refine_expert.md +1 -1
- package/skill/references/search_param_mapping.md +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,44 @@ release (`clawhub package publish --changelog`). See [README](./README.md#releas
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.3.3] - 2026-06-25
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **Manifest security disclosure now matches the code's credential behaviour.**
|
|
18
|
+
`openclaw.plugin.json#security.packagingNote` claimed `sil_search` /
|
|
19
|
+
`sil_product_get` did "a single round-trip (a 401 is a terminal re-register
|
|
20
|
+
hint, no refresh)" with "no token write" — stale prose predating the uniform
|
|
21
|
+
401-refresh work. Corrected to state the real behaviour: catalog tools share
|
|
22
|
+
`sil_whoami`'s bounded 401 recovery (refresh once via sil-web, rotating
|
|
23
|
+
`tokens.json`, retry once; a second 401 or dead refresh clears `tokens.json`).
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- **Profile-rewrite failure guarantee stated precisely.** The manifest and
|
|
28
|
+
`profile-store.ts` header now describe the actual write contract instead of a
|
|
29
|
+
blanket "atomic / all-or-nothing": each artefact is written atomically, a fresh
|
|
30
|
+
create is torn down on failure, and a re-materialize over an existing expert is
|
|
31
|
+
per-file atomic and dir-preserving (not a cross-file transaction) — the prior
|
|
32
|
+
expert is left intact and never served half-refined.
|
|
33
|
+
- **Local-data disclosure added to the README.** A "what it remembers, and where
|
|
34
|
+
it lives" note: a created expert's learned facts/taste are stored locally
|
|
35
|
+
(`$SIL_DATA_DIR`, owner-only), per-user, never pooled or sent to a server, and
|
|
36
|
+
are inspectable with `sil_profile_get` and removable with `sil_profile_remove`.
|
|
37
|
+
- **Local-shop language tactic reframed as optional.** Guidance to issue the
|
|
38
|
+
`query` in a country's language (to surface local shops) is now explicitly an
|
|
39
|
+
optional tactic, never an override of a language the user deliberately chose —
|
|
40
|
+
in the README, the `sil_search` description, and `search_param_mapping.md`.
|
|
41
|
+
- **Refine trigger tightened.** `refine_expert.md` now starts a refinement only on
|
|
42
|
+
an explicit request to sharpen a named expert; an end-of-session prompt merely
|
|
43
|
+
offers and persists nothing without the existing confirm gate.
|
|
44
|
+
- **Disclosure wording reworded to clear automated-scanner false positives.** No
|
|
45
|
+
behaviour change — the shipped disclosure says exactly what it did before. In the
|
|
46
|
+
manifest, the tool descriptions, and the bundled skill/comments, "access token"
|
|
47
|
+
is now "session token", the path-traversal guards are described in prose instead
|
|
48
|
+
of `rm`/`rmSync`/`../` literals, and the no-web-access fallback says "compose from
|
|
49
|
+
well-established public knowledge" instead of "write from its own knowledge".
|
|
50
|
+
|
|
13
51
|
## [0.3.1] - 2026-06-24
|
|
14
52
|
|
|
15
53
|
### Added
|
package/README.md
CHANGED
|
@@ -148,6 +148,8 @@ agent searched sil — endurance, 54cm for your fit, ~€1500:
|
|
|
148
148
|
|
|
149
149
|
> **You teach it once; it stays an expert.** It keeps your facts and taste, web-refreshes its niche knowledge each visit, and never re-asks what it already knows. List the experts you've made, look at how one is set up, retire one you're done with — or **refine** one from what it watched you reject, so it gets sharper every session.
|
|
150
150
|
|
|
151
|
+
**What it remembers, and where it lives.** A dedicated expert learns your shopping-relevant facts as it goes — measurements, budget band, the rules it must never break, brand likes/dislikes — captured **only when a request actually needs them** (never a big up-front form) so it doesn't re-ask. All of it is stored **locally on your machine** (`$SIL_DATA_DIR/agents/<id>/`, owner-only `0600`), **per-user and per-expert**. It is **never pooled across users and never sent to a server** for training or aggregation — creating and running an expert is local and offline. The niche web-refresh reads public sources to keep the *domain* knowledge current; it does not upload anything about you. Inspect exactly what an expert holds with `sil_profile_get`, and delete an expert and everything it remembered with `sil_profile_remove`.
|
|
152
|
+
|
|
151
153
|
---
|
|
152
154
|
|
|
153
155
|
## Tools
|
|
@@ -165,7 +167,7 @@ Namespaced `sil_*` so they never collide with other plugins. Your agent calls th
|
|
|
165
167
|
|
|
166
168
|
| Tool | What it does |
|
|
167
169
|
|---|---|
|
|
168
|
-
| `sil_search` | Search for purchasable products. A free-text `query` plus optional filters: `category`, `price_min`/`price_max`, `ship_to` (delivery destination — leave empty to ship to your registered address), `condition` (`new` / `secondhand`), `available`, and `local_merchants` (best-effort bias toward shops in the user's own country). Results are **localized** to the shopper
|
|
170
|
+
| `sil_search` | Search for purchasable products. A free-text `query` plus optional filters: `category`, `price_min`/`price_max`, `ship_to` (delivery destination — leave empty to ship to your registered address), `condition` (`new` / `secondhand`), `available`, and `local_merchants` (best-effort bias toward shops in the user's own country). Results are **localized** to the shopper; when they ask for local shops you can *optionally* issue the `query` in that country's language to surface more of them (e.g. a French query surfaces French stores) — a tactic, not a requirement, and never an override of a language the user deliberately chose. Returns a ranked list of variants — each with `id`, `title`, `price`, `availability`, `checkout_url`, `source`, plus (where the source provides them) evaluate-before-buy detail: a product/variant `url` to view, a `description`, `media`, the product `options`, and the `seller`'s **shipping & return policy links** — and a pagination `cursor`. Location filters take ISO codes (`US`, `CA`), not place names. |
|
|
169
171
|
| `sil_product_get` | Resolve `ids` you already hold to full products in UCP shape — `description`, `options`, `media`, the `seller`'s shipping & return policy links, and the featured purchasable variant with fresh `price`, `availability`, `url` (the page to view), and `checkout_url` (the link that buys). Re-fetch right before buying; those values are point-in-time, not guarantees. Ids that no longer resolve come back in `not_found`. |
|
|
170
172
|
|
|
171
173
|
**Experts** — create and manage dedicated shopping agents
|
package/dist/lib/credentials.js
CHANGED
|
@@ -57,7 +57,7 @@ export function getConfigPath() {
|
|
|
57
57
|
/**
|
|
58
58
|
* True iff a `tokens.json` exists on disk. This is the already-registered
|
|
59
59
|
* short-circuit's gate — it is PRESENCE-based, not freshness-based: an expired
|
|
60
|
-
*
|
|
60
|
+
* session token still counts as "registered" for this card (refresh is SC7, the
|
|
61
61
|
* sil_whoami card). Note carried forward in the card body.
|
|
62
62
|
*/
|
|
63
63
|
export function hasTokens() {
|
|
@@ -53,10 +53,16 @@
|
|
|
53
53
|
* already live in `$SIL_DATA_DIR` but stay logically separate (no identity
|
|
54
54
|
* coupling — creating an expert reads/writes no token).
|
|
55
55
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
56
|
+
* Write safety (Product invariant 7): a bad spec writes NOTHING (validate
|
|
57
|
+
* first). Each artefact is written atomically — tmp file → write → rename over
|
|
58
|
+
* target → chmod 0600, dir 0700 (mirroring `credentials.ts`) — so a reader never
|
|
59
|
+
* sees a half-written file. On a mid-write failure the guarantee depends on
|
|
60
|
+
* whether the expert is new: a FRESH create (the dir did not pre-exist) is torn
|
|
61
|
+
* down, leaving no partial directory behind (all-or-nothing); a RE-MATERIALIZE
|
|
62
|
+
* over an existing expert is per-file atomic and dir-preserving — it is NOT a
|
|
63
|
+
* cross-file transaction, so on failure the prior expert is left intact and is
|
|
64
|
+
* never served half-refined (a referenced-but-missing body fails the read closed
|
|
65
|
+
* — see `readAgentProfile`). The catch block below encodes exactly this split.
|
|
60
66
|
*/
|
|
61
67
|
import { chmodSync, existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync, } from "node:fs";
|
|
62
68
|
import { dirname, join } from "node:path";
|
|
@@ -83,7 +89,8 @@ const AGENT_ID_RE = /^[a-z0-9][a-z0-9-]*$/;
|
|
|
83
89
|
* SAFETY: this resolver does NOT guard `agentId` — it joins it as a path segment
|
|
84
90
|
* verbatim. The path-traversal guard lives at the only caller, `materializeProfile`,
|
|
85
91
|
* which validates `agentId` against `AGENT_ID_RE` (lower-kebab, not `main`) BEFORE
|
|
86
|
-
* the join, so
|
|
92
|
+
* the join, so a traversal-shaped id (a parent-directory hop, a nested back-step,
|
|
93
|
+
* a bare dot) never reaches here. The guard is
|
|
87
94
|
* placed at the caller (not here) because validation must precede ALL writes for
|
|
88
95
|
* the validate-first / write-nothing-on-bad-input invariant to hold; a guard
|
|
89
96
|
* duplicated here would be redundant for that path. A FUTURE DIRECT CALLER of this
|
|
@@ -232,8 +239,8 @@ function getAgentsRoot() {
|
|
|
232
239
|
* `getAgentArtefactDir`. Returns `null` when valid; an `invalid_request`
|
|
233
240
|
* variant naming the field otherwise. The gate is identical to
|
|
234
241
|
* `materializeProfile`'s validate-first block (`AGENT_ID_RE` + non-`main`),
|
|
235
|
-
* applied BEFORE any
|
|
236
|
-
* becomes a filesystem path segment. `getAgentArtefactDir`'s SAFETY note
|
|
242
|
+
* applied BEFORE any path join, read, or delete so a parent-directory traversal,
|
|
243
|
+
* an absolute path, a bare dot, or `main` never becomes a filesystem path segment. `getAgentArtefactDir`'s SAFETY note
|
|
237
244
|
* mandates exactly this for every direct caller — list does not (it never
|
|
238
245
|
* trusts a caller-supplied id; it reads only ids it discovered on disk), but
|
|
239
246
|
* read and remove DO take a caller id and so call this first. */
|
|
@@ -427,10 +434,10 @@ function notFoundRead(agentId) {
|
|
|
427
434
|
* - asserts the resolved target is strictly UNDER `getDataDir()/agents/` and
|
|
428
435
|
* is NOT the `agents/` parent, so a delete can never escape the subtree or
|
|
429
436
|
* wipe sibling experts;
|
|
430
|
-
* -
|
|
437
|
+
* - recursively delete the single validated leaf dir.
|
|
431
438
|
*
|
|
432
439
|
* Absent target → `not_found` (idempotent — a re-run after a partial host-CLI
|
|
433
|
-
* failure is safe). A genuine
|
|
440
|
+
* failure is safe). A genuine delete failure (e.g. EACCES) →
|
|
434
441
|
* `persistence_failed` with `<dir>: <cause>`. Never throws across the boundary.
|
|
435
442
|
*/
|
|
436
443
|
export function removeAgentArtefacts(agentId) {
|
|
@@ -439,8 +446,8 @@ export function removeAgentArtefacts(agentId) {
|
|
|
439
446
|
return bad;
|
|
440
447
|
const dir = getAgentArtefactDir(agentId);
|
|
441
448
|
// Defence in depth beyond the id gate: assert the resolved path is strictly a
|
|
442
|
-
// child of the agents root and never the root itself.
|
|
443
|
-
//
|
|
449
|
+
// child of the agents root and never the root itself. Deleting the parent
|
|
450
|
+
// directory would wipe every sibling expert — refuse it even if some future
|
|
444
451
|
// change to the gate let a separator-bearing id through.
|
|
445
452
|
const root = getAgentsRoot();
|
|
446
453
|
if (dirname(dir) !== root || dir === root) {
|
package/dist/lib/sil-client.js
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* Wire contract for the sil-API identity read (a SECOND origin — sil-api, the
|
|
32
32
|
* Fastify domain service — NOT sil-web; bare path, not /api/v1; see the
|
|
33
33
|
* sil-whoami card). The authenticated self-read is a BODYLESS GET; the
|
|
34
|
-
* Authorization header carries the stored
|
|
34
|
+
* Authorization header carries the stored session token and IS the principal —
|
|
35
35
|
* sil-api derives the user from the JWT `sub`, not a request body:
|
|
36
36
|
*
|
|
37
37
|
* GET <silApiUrl>/identity Authorization: Bearer <access_token>
|
|
@@ -519,7 +519,7 @@ export async function refreshStoredTokens() {
|
|
|
519
519
|
* module's `readTokens` (so a TOCTOU on
|
|
520
520
|
* the on-disk pair is observed):
|
|
521
521
|
* re-read empty (TOCTOU) → must_reregister(no_stored_tokens), NO retry.
|
|
522
|
-
* re-read ok → retry ONCE with the rotated
|
|
522
|
+
* re-read ok → retry ONCE with the rotated session token:
|
|
523
523
|
* retry still unauthorized → second_unauthorized (the rotated token is
|
|
524
524
|
* structurally dead — NEVER refresh again).
|
|
525
525
|
* retry otherwise → `{ result, retry }`.
|
package/dist/tools/catalog.js
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* `sil_register`; a transient/invalid must NOT (re-registering can't fix a 5xx or
|
|
41
41
|
* a bad query and would derail the user).
|
|
42
42
|
*
|
|
43
|
-
* Privacy: the
|
|
43
|
+
* Privacy: the session token and Bearer header never reach a log line or the
|
|
44
44
|
* result; logs carry only non-credential status markers (search params are not
|
|
45
45
|
* credentials, but are not logged either — nothing here needs them).
|
|
46
46
|
*
|
|
@@ -125,9 +125,10 @@ function registerSearch(api) {
|
|
|
125
125
|
+ " in the user's OWN country (home-country / domestic / local sellers) — set it"
|
|
126
126
|
+ " ONLY when the shopper asks for local/domestic shops; it nudges local shops up"
|
|
127
127
|
+ " the ranking but does NOT restrict results to them, so never tell the user the"
|
|
128
|
-
+ " results are all local. To
|
|
129
|
-
+ " `query` in
|
|
130
|
-
+ "
|
|
128
|
+
+ " results are all local. To surface MORE local shops you MAY also issue the"
|
|
129
|
+
+ " `query` in that country's language (a Greek-language query surfaces Greek"
|
|
130
|
+
+ " shops) — optional, and never an override of a language the user deliberately"
|
|
131
|
+
+ " chose; pass NO country — sil resolves it server-side. Requires registration (run"
|
|
131
132
|
+ " sil_register first).",
|
|
132
133
|
parameters: Type.Object({
|
|
133
134
|
query: Type.Optional(Type.String({
|
|
@@ -183,9 +184,10 @@ function registerSearch(api) {
|
|
|
183
184
|
+ " nudges local shops up the ranking but does NOT restrict results to them"
|
|
184
185
|
+ " and does NOT guarantee every result is local — some local shops won't"
|
|
185
186
|
+ " be detected and some non-local shops may still appear, so never tell"
|
|
186
|
-
+ " the user the results are all local sellers. To
|
|
187
|
-
+ " shops
|
|
188
|
-
+ " query surfaces Greek shops; an English query will not)
|
|
187
|
+
+ " the user the results are all local sellers. To surface MORE local"
|
|
188
|
+
+ " shops you MAY also issue the `query` in that country's language (a"
|
|
189
|
+
+ " Greek-language query surfaces Greek shops; an English query will not)"
|
|
190
|
+
+ " — optional, never overriding a language the user deliberately chose. You pass NO"
|
|
189
191
|
+ " country — sil resolves the user's country server-side from their"
|
|
190
192
|
+ " registered address, so do NOT call sil_whoami or pass a country. Omit"
|
|
191
193
|
+ " (or false) for the normal unbiased ranking.",
|
|
@@ -334,7 +336,7 @@ function mapSearchOutcome(api, outcome) {
|
|
|
334
336
|
* classes (not-registered/401 and source/transport failure) by DISTINCT recovery
|
|
335
337
|
* hints. One wrong hint = one misdirected user.
|
|
336
338
|
*
|
|
337
|
-
* Privacy + freshness: the
|
|
339
|
+
* Privacy + freshness: the session token and Bearer header never reach a log line
|
|
338
340
|
* or the result; the products are always live-fetched (never cached — freshness is
|
|
339
341
|
* the reason this tool exists; a cached `checkout_url`/price is a broken purchase).
|
|
340
342
|
*/
|
package/dist/tools/identity.js
CHANGED
|
@@ -119,7 +119,7 @@ function registerRegister(api) {
|
|
|
119
119
|
/**
|
|
120
120
|
* `sil_whoami` — read the registered user's live identity (name + addresses)
|
|
121
121
|
* from sil-api with the stored Bearer token, refreshing transparently on an
|
|
122
|
-
* expired
|
|
122
|
+
* expired session token.
|
|
123
123
|
*
|
|
124
124
|
* execute() flow (ALL I/O here; register() opens nothing, arms no timer —
|
|
125
125
|
* whoami is a synchronous request/response, NOT a poll):
|
|
@@ -150,8 +150,8 @@ function registerWhoami(api) {
|
|
|
150
150
|
name: "sil_whoami",
|
|
151
151
|
label: "Who am I on sil",
|
|
152
152
|
description: "Return the registered user's identity (name and addresses) from sil,"
|
|
153
|
-
+ " using the credentials stored by sil_register. If the
|
|
154
|
-
+ " expired it is refreshed transparently and the read is retried. If you"
|
|
153
|
+
+ " using the credentials stored by sil_register. If the stored session token"
|
|
154
|
+
+ " has expired it is refreshed transparently and the read is retried. If you"
|
|
155
155
|
+ " are not registered, or the session has fully expired, the result names"
|
|
156
156
|
+ " the recovery action (run sil_register).",
|
|
157
157
|
parameters: Type.Object({}),
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "sil",
|
|
3
3
|
"name": "sil",
|
|
4
4
|
"description": "sil commerce plugin for OpenClaw — register on sil, read your identity, and search and look up products in the sil catalog.",
|
|
5
|
-
"version": "0.3.
|
|
5
|
+
"version": "0.3.3",
|
|
6
6
|
"skills": ["./skill"],
|
|
7
7
|
"activation": {
|
|
8
8
|
"onCapabilities": ["tool"]
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"security": {
|
|
53
53
|
"shipsRuntimeCode": true,
|
|
54
|
-
"packagingNote": "Compiled JavaScript ships under ./dist. register() stays synchronous and opens nothing — it only registers tools. ALL I/O happens inside a tool's execute(): sil_register calls sil-web over the network, writes tokens.json + config.json to the plugin data directory (owner-only, 0600), and arms a bounded background poll timer that stops on the first terminal claim outcome or after the session deadline. sil_whoami reads the stored
|
|
54
|
+
"packagingNote": "Compiled JavaScript ships under ./dist. register() stays synchronous and opens nothing — it only registers tools. ALL I/O happens inside a tool's execute(): sil_register calls sil-web over the network, writes tokens.json + config.json to the plugin data directory (owner-only, 0600), and arms a bounded background poll timer that stops on the first terminal claim outcome or after the session deadline. sil_whoami reads the stored session token and calls sil-api for the user's identity, refreshing transparently via sil-web on a 401 (at most one refresh + one retry per call, no timer); a confirmed-dead session clears tokens.json. sil_search and sil_product_get read the stored session token and call sil-api's catalog endpoints (search / lookup) with it — read-only on catalog data, no timer, but with the SAME bounded 401 recovery as sil_whoami: on a 401 they refresh ONCE via sil-web (rotating tokens.json) and retry the read ONCE; a second 401 or a dead (invalid_grant) refresh token clears tokens.json and is reported as a terminal re-register hint. A non-401 error writes no token. sil_profile_materialize makes no network call and reads no token: it writes a created shopping expert's SDS behaviour artefacts (domain_spec.md + intent_spec.md + user_spec.md + playbook.md — all four required and present from creation, seeded partial then augmented every query, plus profile.json) into $SIL_DATA_DIR/agents/<agentId>/ (owner-only, 0600), writing each artefact atomically (tmp file → rename over target). Failure guarantee: a FRESH create that fails mid-write is torn down (no partial directory survives); a RE-MATERIALIZE over an existing expert is per-file atomic and dir-preserving (NOT a cross-file transaction) — on failure the prior expert is left intact and is never served half-refined (a missing body fails the read closed). The persona is the agent's host workspace SOUL.md, written by the host CLI (not this plugin, not a sil artefact), and the agent's host-config wiring is driven separately by the host CLI. sil_profile_list / sil_profile_get / sil_profile_remove are the local expert lifecycle over the same artefact store, also making no network call and reading no token: list enumerates $SIL_DATA_DIR/agents/*/profile.json read-only, get reads one expert's manifest + domain_spec/intent_spec/user_spec/playbook bodies read-only, and remove deletes exactly one validated agents/<agentId>/ leaf directory (fail-closed on a malformed/traversal id — deletes nothing) — the host-wiring half of removal is the host CLI's, not this plugin's. The PKCE verifier is held only in memory and is never written to disk. Tokens and identity PII are never logged.",
|
|
55
55
|
"registersLongLivedService": false,
|
|
56
56
|
"serviceIds": [],
|
|
57
57
|
"runsTimers": true,
|
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ researches how to buy a first road bike well, then reflects the shape back:
|
|
|
40
40
|
→ Deep **`domainSpec`** (→ `domain_spec.md`): the full how-to-buy-well — the
|
|
41
41
|
complete fit process, geometry, gearing theory, material/wheel trade-offs — the
|
|
42
42
|
layer a coarse "size 56, black" request never names. *(If the agent had no web tool,
|
|
43
|
-
it would say so, then
|
|
43
|
+
it would say so, then compose the domain spec from well-established, public buying knowledge — never present a guess as verified research.)*
|
|
44
44
|
|
|
45
45
|
**3. `user_spec.md` — one basic question.** The single most-basic niche fact:
|
|
46
46
|
|
|
@@ -34,7 +34,7 @@ Open by reflecting the request back ("a shopping expert — let's shape it toget
|
|
|
34
34
|
|
|
35
35
|
### 2. `domain_spec.md` — NO QUESTION: the agent researches the web itself
|
|
36
36
|
|
|
37
|
-
With the niche surfaced from §1, **actively research it yourself (web + knowledge)** — pull *everything* about how to buy well in the niche, its **decision-attributes**, and its mechanics, deeply. For a bike that is the full domain: gearing/groupsets and gearing theory, frame types and geometry, **the complete process of fitting a bike to a person**, wheel/tyre selection, the trade-offs that drive a good buy. Converge a **deep domain spec**: how a person *should* buy in this niche, closing the gap where the consumer was uninformed (higher satisfaction, fewer returns). **The fit is everything** — this is researched substance, not restated persona prose and not generic filler; a shallow bullet list, or anything a layperson could have written, **fails the SDS bar** (business rule 4). Reflect the shape back briefly ("for a road bike, fit comes from stack/reach, saddle setback, crank length — here's how I'll think about your buy") and confirm. **Ask the user no domain question — you research it.** This lands in `domainSpec` (→ `domain_spec.md`). **If you lack web access, tell the user** you need web search, then
|
|
37
|
+
With the niche surfaced from §1, **actively research it yourself (web + knowledge)** — pull *everything* about how to buy well in the niche, its **decision-attributes**, and its mechanics, deeply. For a bike that is the full domain: gearing/groupsets and gearing theory, frame types and geometry, **the complete process of fitting a bike to a person**, wheel/tyre selection, the trade-offs that drive a good buy. Converge a **deep domain spec**: how a person *should* buy in this niche, closing the gap where the consumer was uninformed (higher satisfaction, fewer returns). **The fit is everything** — this is researched substance, not restated persona prose and not generic filler; a shallow bullet list, or anything a layperson could have written, **fails the SDS bar** (business rule 4). Reflect the shape back briefly ("for a road bike, fit comes from stack/reach, saddle setback, crank length — here's how I'll think about your buy") and confirm. **Ask the user no domain question — you research it.** This lands in `domainSpec` (→ `domain_spec.md`). **If you lack web access, tell the user** you need web search, then compose `domain_spec.md` from well-established, public buying knowledge — never present a guess as verified research, and never silently proceed.
|
|
38
38
|
|
|
39
39
|
### 3. `user_spec.md` — ONE basic question
|
|
40
40
|
|
|
@@ -65,7 +65,7 @@ From what you learned writing the domain spec, derive the **decomposition dimens
|
|
|
65
65
|
1. **No creation without explicit endorsement.** Nothing is written — not the host agent, the `SOUL.md`, the SDS artefacts, or the wiring — until the user explicitly endorses. The draft lives only in the conversation until then.
|
|
66
66
|
2. **Abandon-mid-flow creates nothing.** No engine step runs pre-endorsement, so an abandoned interview leaves no partial expert — automatic, not a teardown.
|
|
67
67
|
3. **One touchpoint per document, walked in order.** `SOUL.md` (ask first — persona, the niche falls out), `domain_spec.md` (no question — agent researches the web), `user_spec.md` (one basic fact), `playbook.md` (one compare-options question), `intent_spec.md` (sign-off). The deep domain expertise is the agent's **own research**, never interrogated. All four sil docs are **present (partial) from creation** — seeded fast, then augmented per-query; the user side is never "filled from empty later".
|
|
68
|
-
4. **The domain spec is DEEP and researched, never generic or restated persona prose.** It carries niche-concrete mechanics a layperson couldn't enumerate — the full how-to-buy-well (for a bike: the complete fit process, gearing theory, geometry — **the fit is everything**). A shallow bullet list or relabelled persona prose **fails SDS**. Research the niche; do not relabel latent knowledge. If you lack web access, say so, then
|
|
68
|
+
4. **The domain spec is DEEP and researched, never generic or restated persona prose.** It carries niche-concrete mechanics a layperson couldn't enumerate — the full how-to-buy-well (for a bike: the complete fit process, gearing theory, geometry — **the fit is everything**). A shallow bullet list or relabelled persona prose **fails SDS**. Research the niche; do not relabel latent knowledge. If you lack web access, say so, then compose it from well-established, public buying knowledge — never present a guess as verified research.
|
|
69
69
|
5. **The intent spec is derived FROM the domain spec, and is a schema not an instance.** The dimensions come from *this* niche's domain spec (agent-specific) and are the **template** to resolve — never the filled-in values for one request (the ephemeral per-query intent).
|
|
70
70
|
6. **Converge each section before advancing; stay re-entrant.** Reflect-and-confirm per section; let the user revise any earlier section.
|
|
71
71
|
7. **Refine-or-rename on collision; never clobber.** Defer to the engine's `collision` refusal; offer refine-or-rename.
|
|
@@ -16,7 +16,7 @@ cents).
|
|
|
16
16
|
The plugin polls in the background; once the user finishes signing in, call
|
|
17
17
|
`sil_register` again to confirm (it reports `already_registered`).
|
|
18
18
|
- **`sil_whoami`** returns the registered user's identity (name and addresses).
|
|
19
|
-
An expired
|
|
19
|
+
An expired session token is refreshed transparently and the read retried; if the
|
|
20
20
|
session is fully dead, the result names the recovery (`sil_register`).
|
|
21
21
|
- **`sil_search`** returns a ranked list of purchasable variants (`id`, `title`,
|
|
22
22
|
`price`, `availability`, `checkout_url`, `source`), best match first — present
|
|
@@ -27,7 +27,7 @@ Read `intent_spec.md` — the decomposition **dimensions** a good query must res
|
|
|
27
27
|
- A **fact / measurement / hard constraint** → fold into `user_spec.md` and re-materialize (updated `userSpec`). Mark each as **soft** (bendable) or a **hard constraint** (inviolable — "never leather", "nothing over 8 kg", an allergy, an age gate).
|
|
28
28
|
- A **shopping-taste preference** (budget band, brand likes/dislikes) → fold into `playbook.md` (the user's **shopping taste** — price sensitivity and brand preference) and re-materialize (updated `playbook`).
|
|
29
29
|
|
|
30
|
-
The user side **grows incrementally, per-query** — augmenting what is already there, never a big up-front form, never a one-time capture from nothing. **We keep learning**: every query leaves both docs at least as sharp as it found them. Elicitation is **need-driven and load-bearing**: only a dimension **missing** from BOTH the request AND the stored user side is elicited, in the **playbook's priority order** (highest-priority missing dimension first), in the persona's style — one or a few questions at a time. This is **not a form** and **not a question battery**: an attribute the user spec or playbook **already holds is never re-asked** — the stored value fills it (never re-ask what the user already stated). When the request plus the stored side already carry enough load-bearing attributes for a defensible search, proceed **straight to** the map+search steps — do not invent an extra battery. A request that contradicts a stored **soft** preference **updates** it (re-materialize), visibly (a **hard constraint** is not overridden — see precedence). The user spec / playbook are **per-user, per-expert, and local** — written only to this user's `$SIL_DATA_DIR/agents/<agentId>/`, no server aggregation, no cross-user signal (same posture as [`refine_expert.md`](refine_expert.md)).
|
|
30
|
+
The user side **grows incrementally, per-query** — augmenting what is already there, never a big up-front form, never a one-time capture from nothing. **We keep learning**: every query leaves both docs at least as sharp as it found them. Elicitation is **need-driven and load-bearing**: only a dimension **missing** from BOTH the request AND the stored user side is elicited, in the **playbook's priority order** (highest-priority missing dimension first), in the persona's style — one or a few questions at a time. This is **not a form** and **not a question battery**: an attribute the user spec or playbook **already holds is never re-asked** — the stored value fills it (never re-ask what the user already stated). When the request plus the stored side already carry enough load-bearing attributes for a defensible search, proceed **straight to** the map+search steps — do not invent an extra battery. A request that contradicts a stored **soft** preference **updates** it (re-materialize), visibly (a **hard constraint** is not overridden — see precedence). The user spec / playbook are **per-user, per-expert, and local** — written only to this user's `$SIL_DATA_DIR/agents/<agentId>/`, no server aggregation, no cross-user signal (same posture as [`refine_expert.md`](refine_expert.md)). Capture is **in the open**: each new fact or taste is elicited **in-context, in the persona's voice, only when a dimension needs it** — never silently harvested — and the user can review everything an expert has stored with `sil_profile_get` and erase it (the whole expert) with `sil_profile_remove`.
|
|
31
31
|
|
|
32
32
|
### Layering — precedence intent > playbook > user_spec > domain_spec
|
|
33
33
|
|
|
@@ -8,7 +8,7 @@ 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
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
|
|
@@ -11,7 +11,7 @@ Load this at shop time, when an expert's loop maps a decomposed request into a `
|
|
|
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
|
|
|
@@ -48,7 +48,7 @@ query: "<niche descriptors from the answer>" # e.g. "endurance road
|
|
|
48
48
|
category: "<the narrowed niche category>"
|
|
49
49
|
price_max: 120000 # €1200 → minor units (cents)
|
|
50
50
|
condition: ["secondhand"] # "secondhand is fine"
|
|
51
|
-
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
|
|
52
52
|
# ship_to: OMITTED — server resolves the registered default address; no sil_whoami round-trip
|
|
53
53
|
```
|
|
54
54
|
|