sil-openclaw 0.3.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/dist/lib/profile-store.js +578 -581
- package/dist/lib/sil-client.js +282 -33
- package/dist/tools/catalog.js +485 -7
- package/dist/tools/profile.js +235 -371
- package/openclaw.plugin.json +6 -4
- package/package.json +1 -1
- package/scripts/create-shopper.mjs +12 -18
- package/sil-shopping/SKILL.md +41 -53
- package/sil-shopping/examples/multi_domain_shopper_walkthrough.md +40 -102
- package/sil-shopping/references/agent_creation_engine.md +24 -23
- package/sil-shopping/references/fill_and_feedback.md +88 -0
- package/sil-shopping/references/method_and_prds.md +110 -0
- package/sil-shopping/references/search_param_mapping.md +17 -16
- package/sil-shopping/references/setup_onboarding.md +2 -2
- package/sil-shopping/references/shop_loop.md +113 -160
- package/sil-shopping/references/manage_domains.md +0 -77
- package/sil-shopping/references/refine_shopper.md +0 -97
package/openclaw.plugin.json
CHANGED
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
"id": "sil",
|
|
3
3
|
"name": "sil",
|
|
4
4
|
"description": "Turn your OpenClaw into an expert shopping agent.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.4.0",
|
|
6
6
|
"skills": ["./sil-shopping"],
|
|
7
7
|
"activation": {
|
|
8
8
|
"onCapabilities": ["tool"]
|
|
9
9
|
},
|
|
10
10
|
"contracts": {
|
|
11
11
|
"tools": [
|
|
12
|
+
"sil_learn",
|
|
12
13
|
"sil_product_get",
|
|
13
14
|
"sil_profile_get",
|
|
14
15
|
"sil_profile_materialize",
|
|
15
16
|
"sil_profile_remove",
|
|
17
|
+
"sil_profile_search",
|
|
16
18
|
"sil_register",
|
|
17
|
-
"sil_remember",
|
|
18
19
|
"sil_search",
|
|
20
|
+
"sil_specs",
|
|
19
21
|
"sil_whoami"
|
|
20
22
|
]
|
|
21
23
|
},
|
|
@@ -51,7 +53,7 @@
|
|
|
51
53
|
},
|
|
52
54
|
"security": {
|
|
53
55
|
"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 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.
|
|
56
|
+
"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. The five profile verbs make NO network call and read no token; they write the one sil shopper's SINGLETON behaviour artefacts under a fixed $SIL_DATA_DIR/shopper/ (owner-only, files 0600, dirs 0700) as frontmatter-as-truth markdown — there is NO profile.json manifest; each file's own frontmatter IS the source of truth, discovered by a filesystem scan. sil_profile_materialize is SETUP-ONLY: it writes shopper/user_spec.md (the shared person spec; its frontmatter carries the shopper name), minting no domain. sil_learn is the single target+change verb over shopper/domains/<slug>/{method.md, prds/<product>-<intent>.md, assets/}: create mints a whole method or PRD; append/amend/retract refine a section-aware markdown body in place (single-occurrence match, fail-closed if the target or the named section is absent); attach-asset persists image bytes (size-capped, image MIME allowlist) into the domain's assets/ owner-only and links them by RELATIVE path, never inline bytes. sil_profile_search scans artefact FRONTMATTER and returns coordinates only (no bodies) — a domain/PRD with malformed frontmatter is skipped and surfaced as unreadable, never silently dropped or half-read. sil_profile_get reads ONE whole body (method or PRD); sil_profile_remove deletes a whole validated domain subtree, or one PRD file, fail-closed on a malformed/traversal/\"main\" or missing slug (never the whole shopper). The only caller-supplied path segments are the domain slug and the PRD key, both validated (lower-kebab, not \"main\") before any join; the shopper segment is a compile-time constant. Every write is atomic (tmp file → rename over target → chmod), so a reader sees a whole file or none. The persona is the shopper's host workspace SOUL.md, written by the host CLI (not this plugin, not a sil artefact), and the shopper's host-config wiring is driven separately by the host CLI. The PKCE verifier is held only in memory and is never written to disk. Artefact bodies, tokens, and identity PII are never logged.",
|
|
55
57
|
"registersLongLivedService": false,
|
|
56
58
|
"serviceIds": [],
|
|
57
59
|
"runsTimers": true,
|
|
@@ -61,7 +63,7 @@
|
|
|
61
63
|
"https://sil.4gpts.com"
|
|
62
64
|
],
|
|
63
65
|
"filesystemScope": [
|
|
64
|
-
"$SIL_DATA_DIR (default $XDG_DATA_HOME/sil, else ~/.local/share/sil) — tokens.json, config.json, shopper/
|
|
66
|
+
"$SIL_DATA_DIR (default $XDG_DATA_HOME/sil, else ~/.local/share/sil) — tokens.json, config.json, shopper/user_spec.md + shopper/domains/<slug>/{method.md, prds/<product>-<intent>.md, assets/<content-hash>.<ext>} (the ONE sil shopper's singleton behaviour artefacts, frontmatter-as-truth with NO profile.json manifest: sil_profile_materialize writes the shared user_spec.md at setup (its frontmatter carries the shopper name), and sil_learn mints/refines per-domain methods, intent-keyed PRDs, and per-domain image assets. The `shopper` segment is a fixed compile-time constant, not caller input; the domain slug and PRD key are the only caller-supplied path segments, validated (lower-kebab, not \"main\") before any join. All writes are atomic + owner-only (files 0600, dirs 0700). The persona is the host workspace SOUL.md, not a sil artefact)"
|
|
65
67
|
],
|
|
66
68
|
"credentialsOnDisk": [
|
|
67
69
|
"tokens.json (access + refresh token)",
|
package/package.json
CHANGED
|
@@ -28,8 +28,9 @@
|
|
|
28
28
|
* 4. snapshot openclaw.json — the whole-file teardown anchor, taken BEFORE step 5
|
|
29
29
|
* 5. openclaw agents add — create the real agents.list entry + workspace bootstrap
|
|
30
30
|
* 6. write <workspace>/SOUL.md — the persona (atomic tmp→rename); never a sil artefact
|
|
31
|
-
* 7. materializeProfile — REUSED; { name, userSpec }
|
|
32
|
-
*
|
|
31
|
+
* 7. materializeProfile — REUSED; SETUP-ONLY { name, userSpec } ⇒ shared
|
|
32
|
+
* user_spec.md (its frontmatter carries the name);
|
|
33
|
+
* NO manifest, no domain minted at create
|
|
33
34
|
* 8. attach the sil skill + enable the sil plugin (openclaw config set --strict-json)
|
|
34
35
|
* 9. sil-openclaw-allowlist — REUSED whole; additive/idempotent/atomic three-surface
|
|
35
36
|
* trust merge (plugins.allow + tools.alsoAllow + plugins.entries.sil)
|
|
@@ -81,7 +82,7 @@ import { fileURLToPath } from "node:url";
|
|
|
81
82
|
|
|
82
83
|
import {
|
|
83
84
|
materializeProfile,
|
|
84
|
-
|
|
85
|
+
readShopperIdentity,
|
|
85
86
|
getShopperArtefactDir,
|
|
86
87
|
} from "../dist/lib/profile-store.js";
|
|
87
88
|
import { resolveBindChannel } from "../dist/lib/bind-channel.js";
|
|
@@ -398,14 +399,12 @@ function teardown({ configPath, snapshot, mode, bakPreexisted, workspace, worksp
|
|
|
398
399
|
// 3. Remove the singleton shopper dir ONLY if it did not pre-exist (the singleton
|
|
399
400
|
// pre-flight guarantees it was ours this run).
|
|
400
401
|
// KNOWN GAP (narrow): this keys on WHOLE-DIR pre-existence, not on the leaf we
|
|
401
|
-
// wrote
|
|
402
|
-
// (profile-store.ts). If `shopper/` pre-existed but EMPTY (no profile.json), the
|
|
402
|
+
// wrote. If `shopper/` pre-existed but held no readable user_spec.md, the
|
|
403
403
|
// singleton read passes ("no shopper") yet `shopperDirPreexisted` is true, so a
|
|
404
|
-
// post-materialize failure leaves THIS run's
|
|
405
|
-
//
|
|
406
|
-
//
|
|
407
|
-
//
|
|
408
|
-
// this removal on "we wrote profile.json this run", mirroring `!leafPreexisted`.
|
|
404
|
+
// post-materialize failure leaves THIS run's user_spec.md un-removed and does NOT
|
|
405
|
+
// surface as residue → `teardown_failed`. Extremely narrow (normal operation
|
|
406
|
+
// never leaves an empty `shopper/`). To close it, key this removal on "we wrote
|
|
407
|
+
// user_spec.md this run".
|
|
409
408
|
if (!shopperDirPreexisted) {
|
|
410
409
|
const shopperDir = getShopperArtefactDir();
|
|
411
410
|
try {
|
|
@@ -467,14 +466,9 @@ function main() {
|
|
|
467
466
|
const skillAttachName = skill.name;
|
|
468
467
|
|
|
469
468
|
// --- 3. Singleton + agentId pre-flight (nothing written; inconclusive → fail closed) ---
|
|
470
|
-
// The sil artefact store is the source of truth for "a shopper exists".
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
emitFailure("persistence_failed", {
|
|
474
|
-
path: getShopperArtefactDir(),
|
|
475
|
-
cause: "could not read the sil shopper store to check the singleton — failing closed rather than risk a second shopper",
|
|
476
|
-
});
|
|
477
|
-
}
|
|
469
|
+
// The sil artefact store is the source of truth for "a shopper exists": user_spec.md
|
|
470
|
+
// present + its frontmatter `name` reads (frontmatter-as-truth, no manifest).
|
|
471
|
+
const overview = readShopperIdentity();
|
|
478
472
|
if (Array.isArray(overview.unreadable) && overview.unreadable.length > 0) {
|
|
479
473
|
// A degraded store is INCONCLUSIVE — never fabricate a "no shopper" verdict.
|
|
480
474
|
emitFailure("persistence_failed", {
|
package/sil-shopping/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sil-shopping
|
|
3
|
-
description: 'Use for any sil shopping, identity, or shopper-setup intent: register or sign in, check the account, search the sil catalog for purchasable products, or look up products by id — plus the single-shopper lifecycle: create the shopper (a short two-touchpoint onboarding),
|
|
3
|
+
description: 'Use for any sil shopping, identity, or shopper-setup intent: register or sign in, check the account, search the sil catalog for purchasable products, or look up products by id — plus the single-shopper lifecycle: create the shopper (a short two-touchpoint onboarding), search what it knows or which domains (niches) it has learned, view or forget a domain or one of its PRDs, refine it — or, as the shopper, run the six-beat Spec-Driven Shopping loop on any niche and learn a fact or buying taste it surfaces. Drives sil_register, sil_whoami, sil_search, sil_product_get, sil_specs, sil_profile_materialize, sil_profile_search, sil_profile_get, sil_profile_remove, and sil_learn.'
|
|
4
4
|
metadata:
|
|
5
5
|
openclaw:
|
|
6
6
|
emoji: "\U0001F6D2"
|
|
@@ -10,9 +10,9 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
Drive the sil plugin's tools on the user's behalf: register them, read their
|
|
12
12
|
identity, help them find purchasable products — and, when asked, set up their
|
|
13
|
-
**shopper** (one sil-wired agent that shops every niche), then
|
|
14
|
-
view or forget a domain, or refine it. Read intent, route to the matching
|
|
15
|
-
(loading
|
|
13
|
+
**shopper** (one sil-wired agent that shops every niche), then search what it
|
|
14
|
+
knows, view or forget a domain, or refine it. Read intent, route to the matching
|
|
15
|
+
tool or reference (loading it on demand), call it, and report what came back.
|
|
16
16
|
|
|
17
17
|
## Always-on contract
|
|
18
18
|
|
|
@@ -36,34 +36,33 @@ route to `sil_register`, or run `sil_register` up front when intent requires it.
|
|
|
36
36
|
## Routing — read the stage, then match intent to a tool
|
|
37
37
|
|
|
38
38
|
**Read the stage from state — never guess it.** Two cheap reads settle it:
|
|
39
|
-
`sil_whoami` (is a sil identity **registered** yet?) and
|
|
40
|
-
|
|
41
|
-
present only once a shopper exists).
|
|
39
|
+
`sil_whoami` (is a sil identity **registered** yet?) and `sil_profile_search` (is
|
|
40
|
+
a shopper set up — does it return any `domains`?).
|
|
42
41
|
|
|
43
42
|
- **No identity** ⇒ guide the user to register.
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
-
|
|
43
|
+
- **No shopper / no domains** ⇒ bare shopping is a first-class quick lookup; the
|
|
44
|
+
setup path is offered alongside it.
|
|
45
|
+
- **Shopper present** ⇒ shop through what you know about the person via the loop.
|
|
47
46
|
|
|
48
47
|
[`references/setup_onboarding.md`](references/setup_onboarding.md) owns the setup
|
|
49
48
|
script — the staged ladder, the after-register offer, the per-search pitch. Load
|
|
50
49
|
it while setup is incomplete; it sheds once a shopper exists.
|
|
51
50
|
|
|
52
|
-
### Intent → tool (load
|
|
51
|
+
### Intent → tool / reference (load on demand)
|
|
53
52
|
|
|
54
|
-
| Intent | Tool | Reference |
|
|
53
|
+
| Intent | Tool / path | Reference |
|
|
55
54
|
|---|---|---|
|
|
56
55
|
| "sign me up" / "log me in" / "register" | `sil_register` | [`catalog_tools_reference.md`](references/catalog_tools_reference.md) |
|
|
57
56
|
| "who am I?" / show my saved name + addresses | `sil_whoami` | [`catalog_tools_reference.md`](references/catalog_tools_reference.md) |
|
|
58
57
|
| "find X" / "search for X" / browse a category or price range | `sil_search` | [`catalog_tools_reference.md`](references/catalog_tools_reference.md) |
|
|
59
58
|
| "look up these items" / re-check ids from a prior result | `sil_product_get` | [`catalog_tools_reference.md`](references/catalog_tools_reference.md) |
|
|
60
59
|
| "set up an agent that shops for me" / "create my shopper" | (onboarding, then the engine) | the two-step below |
|
|
61
|
-
| "what does my shopper know?" / "which domains
|
|
62
|
-
| "show me the <niche> domain" | `sil_profile_get`
|
|
63
|
-
| "forget the <niche> domain" | `sil_profile_remove` | [`
|
|
64
|
-
| (as the shopper) a shopping intent on any niche |
|
|
65
|
-
| "remember this" — a fact or taste the shopper surfaced | `
|
|
66
|
-
| "refine / sharpen my shopper" / fix a niche | (
|
|
60
|
+
| "what does my shopper know?" / "which domains / PRDs?" | `sil_profile_search` | [`method_and_prds.md`](references/method_and_prds.md) |
|
|
61
|
+
| "show me the <niche> domain" (method or one PRD) | `sil_profile_get` | [`method_and_prds.md`](references/method_and_prds.md) |
|
|
62
|
+
| "forget the <niche> domain" (or one PRD) | `sil_profile_remove` | [`method_and_prds.md`](references/method_and_prds.md) |
|
|
63
|
+
| (as the shopper) a shopping intent on any niche | the six-beat loop | [`shop_loop.md`](references/shop_loop.md) |
|
|
64
|
+
| "learn / remember this" — a fact or taste the shopper surfaced | `sil_learn` | [`fill_and_feedback.md`](references/fill_and_feedback.md) |
|
|
65
|
+
| "refine / sharpen my shopper" / fix a niche | `sil_learn` (target + change) | [`fill_and_feedback.md`](references/fill_and_feedback.md) |
|
|
67
66
|
|
|
68
67
|
[`references/catalog_tools_reference.md`](references/catalog_tools_reference.md)
|
|
69
68
|
holds the per-tool behaviour + status taxonomy — basic shopping needs only that.
|
|
@@ -81,38 +80,27 @@ assembled draft, run
|
|
|
81
80
|
engine that persists the one sil-wired shopper. No engine step runs before that
|
|
82
81
|
endorsement.
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
[`references/
|
|
97
|
-
**
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
a fully-resolved
|
|
106
|
-
`sil_search`-driven
|
|
107
|
-
|
|
108
|
-
intents (view / forget a domain) route normally, **ungated**.
|
|
109
|
-
|
|
110
|
-
**Per-query self-check (prose, not a tool).** As you shop, keep track of which
|
|
111
|
-
beat you're on and that you resolved the domain before searching — an in-context
|
|
112
|
-
guardrail, not a new tool, table, or telemetry surface.
|
|
113
|
-
|
|
114
|
-
Management + refinement load on demand:
|
|
115
|
-
[`references/manage_domains.md`](references/manage_domains.md) (view/forget,
|
|
116
|
-
confirm-before-remove) and
|
|
117
|
-
[`references/refine_shopper.md`](references/refine_shopper.md) (sharpen from observed
|
|
118
|
-
sessions, confirm-before-persist).
|
|
83
|
+
## As the shopper — the six-beat Spec-Driven-Shopping loop
|
|
84
|
+
|
|
85
|
+
Once a shopper exists, shop through what you know about the person. The loop is a
|
|
86
|
+
**six-beat** state machine — **classify → method → fill → search-space → reflect →
|
|
87
|
+
feedback** — and its detail lives in the references that own each beat, loaded on
|
|
88
|
+
demand:
|
|
89
|
+
|
|
90
|
+
1. **Classify** the request's `{domain, product, intent}` and reuse a learned
|
|
91
|
+
domain/PRD before minting — [`references/shop_loop.md`](references/shop_loop.md).
|
|
92
|
+
2. **Method** load (hot path) or research-and-mint, then intent-keyed PRDs and the
|
|
93
|
+
frontmatter-as-truth store — [`references/method_and_prds.md`](references/method_and_prds.md).
|
|
94
|
+
3. **Fill** the PRD by precedence, eliciting only the residue —
|
|
95
|
+
[`references/fill_and_feedback.md`](references/fill_and_feedback.md).
|
|
96
|
+
4. **Search-space** — the bounded fan-out —
|
|
97
|
+
[`references/shop_loop.md`](references/shop_loop.md).
|
|
98
|
+
5. **Reflect** on best-available vs the PRD —
|
|
99
|
+
[`references/shop_loop.md`](references/shop_loop.md).
|
|
100
|
+
6. **Feedback** — capture what surfaced via `sil_learn` —
|
|
101
|
+
[`references/fill_and_feedback.md`](references/fill_and_feedback.md).
|
|
102
|
+
|
|
103
|
+
The loop shapes the shopper's **reasoning, not the user's inbox**: a reused domain
|
|
104
|
+
plus a fully-resolved request **passes straight through, asking nothing**. It
|
|
105
|
+
scopes to `sil_search`-driven discovery — identity, a direct `sil_product_get`
|
|
106
|
+
re-check, and shopper-management route normally, ungated.
|
|
@@ -1,118 +1,56 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: multi-domain-shopper-walkthrough
|
|
3
|
-
description:
|
|
3
|
+
description: A worked six-beat, multi-domain run — create one shopper (after an explicit endorsement), then shop two unrelated niches in one session, the second minted on the fly and announced, with a shared user_spec fact reused across both. Illustrative, not a spec.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Worked
|
|
6
|
+
# Worked run — one shopper, two niches, six beats
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
[`../references/agent_creation_engine.md`](../references/agent_creation_engine.md)), then
|
|
11
|
-
shop **two unrelated niches in the same session** — the second **minted on the fly** —
|
|
12
|
-
with a **shared fact reused across both** and **per-domain taste that does not leak**. It
|
|
13
|
-
shows the shape and the gates, not exact wording; the machinery lives in the references.
|
|
8
|
+
A concrete end-to-end walkthrough of the six-beat loop across two unrelated
|
|
9
|
+
niches. It is illustrative — the authoritative rules live in the beat references.
|
|
14
10
|
|
|
15
|
-
##
|
|
11
|
+
## Create the shopper (once, after endorsement)
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
The two-touchpoint interview assembles a draft persona + a shared user-spec seed.
|
|
14
|
+
Only after the user **endorses** the assembled draft does the engine run
|
|
15
|
+
`openclaw agents add` and materialize the shared `user_spec.md`. Nothing is created
|
|
16
|
+
before that endorsement. The result is **one** shopper — a **singleton**.
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
The seeded shared spec already holds one durable fact: `- [hard] ships to Berlin;
|
|
19
|
+
allergic to wool` — a cross-niche fact, kept in `user_spec` because it stays true in
|
|
20
|
+
**every niche**.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
> **User:** "Concise and a bit opinionated — never recommend anything with leather, it's
|
|
23
|
-
> an ethics thing."
|
|
24
|
-
> **Shopper:** "Anything I should always know — sizes, where to ship, hard rules?"
|
|
25
|
-
> **User:** "Ship to 12 Rue Centrale, Lyon, France. The no-leather rule is absolute."
|
|
22
|
+
## Niche A — ski gloves (all six beats)
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
`
|
|
29
|
-
|
|
24
|
+
1. **Classify** — the request "warm gloves for the slope" resolves to
|
|
25
|
+
`{ domain: ski, product: gloves, intent: slope }`. `sil_profile_search` finds no
|
|
26
|
+
ski domain yet → a MISS.
|
|
27
|
+
2. **Method** — research ski gear and **mint** the method via `sil_learn create`,
|
|
28
|
+
**announced** ("I read this as *ski gloves for the slope* — correct me if not").
|
|
29
|
+
3. **Fill** — precedence resolves waterproofing and cuff length from the method;
|
|
30
|
+
the wool allergy is **reused** from the **shared** `user_spec` **without
|
|
31
|
+
re-asking**. Only the budget is elicited — one question, tied to why.
|
|
32
|
+
4. **Search-space** — a bounded fan-out of ≤ 4 `sil_search` calls, core first.
|
|
33
|
+
5. **Reflect** — honesty pass, then a **hero + one alternative**, each with a why.
|
|
34
|
+
6. **Feedback** — the buyer reacts "I always run Hestra" → confirm, then persist a
|
|
35
|
+
durable per-domain taste to the method via **`sil_learn`**.
|
|
30
36
|
|
|
31
|
-
##
|
|
37
|
+
## Niche B — an espresso grinder (same session, minted on the fly)
|
|
32
38
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"persona": "A concise, lightly opinionated generalist shopper.",
|
|
37
|
-
"userSpec": "### Soft facts\n- Ship-to: 12 Rue Centrale, Lyon, France.\n### Hard constraints (INVIOLABLE — every niche)\n- HARD-NO: leather (ethics)."
|
|
38
|
-
}
|
|
39
|
-
```
|
|
39
|
+
In the **same session** the user pivots: "now I need a burr grinder." This is a
|
|
40
|
+
**second niche**, **unrelated** to ski gear. No agent switch — the one shopper
|
|
41
|
+
handles it:
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
1. **Classify** → `{ domain: espresso, product: grinder, intent: general }` (a
|
|
44
|
+
context-free request keys `general`).
|
|
45
|
+
2. **Method** — a MISS again → research + **mint on the fly**, **announced**.
|
|
46
|
+
3. **Fill** — the "ships to Berlin" fact is again **reused across** niches from the
|
|
47
|
+
**shared** `user_spec`, **kept from** the ski session — never re-asked. The
|
|
48
|
+
Hestra taste, being per-domain on the ski method, does **not** leak here.
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
the engine run — `openclaw agents add my-shopper …` → persona into `SOUL.md` →
|
|
45
|
-
`sil_profile_materialize { name, userSpec }` (no `domain`; writes the shared
|
|
46
|
-
`user_spec.md` + an empty `domains: {}`) → wire + admit sil → validate → **`created`**,
|
|
47
|
-
with an **empty `domains` map** (healthy; each niche mints on first shop).
|
|
50
|
+
The two niches coexist: shared facts flow to both; per-domain taste stays isolated.
|
|
48
51
|
|
|
49
|
-
##
|
|
52
|
+
## The singleton edge
|
|
50
53
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
the spot — announced** ("I haven't shopped cycling for you yet — setting that up"). It
|
|
55
|
-
researches a deep `domainSpec` (fit is everything; geometry; gearing; material/wheel
|
|
56
|
-
trade-offs), derives the `intentSpec`, seeds a partial `playbook`, and persists with the
|
|
57
|
-
whole-doc `sil_profile_materialize` carrying `domain.slug: "road-cycling"`. It recommends
|
|
58
|
-
with a **"why" that cites the layers** — "for a first bike **fit/comfort outrank outright
|
|
59
|
-
speed** (a domain mechanic), a 54 cm endurance frame fits, kept within your value budget;
|
|
60
|
-
**no leather anywhere** (your standing hard rule)."
|
|
61
|
-
|
|
62
|
-
A taste surfaces, captured the cheap way — one append, scoped to this domain:
|
|
63
|
-
|
|
64
|
-
> **User:** "I don't chase brands — value over name."
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
sil_remember { kind: "taste", text: "Value over brand; ~€1500 band.", domain: "road-cycling" }
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
→ lands in `domains/road-cycling/playbook.md` only.
|
|
71
|
-
|
|
72
|
-
## Niche B — espresso (a second niche, same session, no switch)
|
|
73
|
-
|
|
74
|
-
> **User:** "Different thing — a home espresso machine, decent but not crazy."
|
|
75
|
-
|
|
76
|
-
Same session, **no agent switch, no re-onboarding**. The loop classifies **espresso**,
|
|
77
|
-
finds no match, and **mints espresso on the fly — announced**, with its own deep
|
|
78
|
-
`domainSpec` (boiler type, PID, pressure profiling, grinder pairing) via a second
|
|
79
|
-
whole-doc `sil_profile_materialize` (`domain.slug: "espresso"`).
|
|
80
|
-
|
|
81
|
-
**The shared fact carries — without being re-asked:** the ship-to from the shared
|
|
82
|
-
`user_spec.md` is reused in espresso with **no re-ask** ("I'll ship to your Lyon address
|
|
83
|
-
as usual"), and the no-leather hard rule still rejects a leather-wrapped tamper handle.
|
|
84
|
-
|
|
85
|
-
**The niche taste does not leak:** the *value-over-brand* taste lives in
|
|
86
|
-
`domains/road-cycling/playbook.md` and does not shape the espresso picks — espresso learns
|
|
87
|
-
its own:
|
|
88
|
-
|
|
89
|
-
> **User:** "For coffee I'll happily pay for a known reliable brand."
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
sil_remember { kind: "taste", text: "Pays up for a reliable known brand.", domain: "espresso" }
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
→ `domains/espresso/playbook.md` only. The two tastes coexist without contradiction —
|
|
96
|
-
per-domain taste isolation. A **fact** would instead go to the shared `user_spec.md`
|
|
97
|
-
(`kind: "fact"`) and carry to *both* niches.
|
|
98
|
-
|
|
99
|
-
## The singleton edge — refuse a second shopper
|
|
100
|
-
|
|
101
|
-
> **User:** "Can you make me a second shopper just for coffee?"
|
|
102
|
-
> **Shopper:** "You already have a shopper — it handles every niche. I've added espresso
|
|
103
|
-
> as a domain; I won't create a second. Want me to refine the espresso domain instead?"
|
|
104
|
-
|
|
105
|
-
The engine's **singleton refusal** (`collision`, "a shopper already exists") — one
|
|
106
|
-
shopper, many domains.
|
|
107
|
-
|
|
108
|
-
## Edge cases this example would have handled
|
|
109
|
-
|
|
110
|
-
- **Reuse before mint** — "another road bike, for winter" reuses the existing
|
|
111
|
-
`road-cycling` domain (semantic dedup), never a near-duplicate pack.
|
|
112
|
-
- **Forget one domain ≠ decommission the shopper** — "forget espresso" runs
|
|
113
|
-
`sil_profile_remove { domainSlug: "espresso" }`; the shopper, shared user spec, and
|
|
114
|
-
road-cycling domain survive.
|
|
115
|
-
- **No web tool** — the shopper says so honestly at mint time and composes from public
|
|
116
|
-
knowledge, never pretending the research happened.
|
|
117
|
-
- **Creation is local + offline** — no sil registration to create; the user registers
|
|
118
|
-
later, on first shop.
|
|
54
|
+
If the user later says "set me up a second shopper," the engine refuses: **a
|
|
55
|
+
shopper already exists**. Steer them to shop a new niche (it mints a domain on the
|
|
56
|
+
spot) or refine the existing one with `sil_learn` — never a second shopper.
|
|
@@ -45,13 +45,13 @@ guarantee holds; the bin legitimately drives `openclaw …` on your behalf.
|
|
|
45
45
|
|---|---|---|---|
|
|
46
46
|
| **agentId** | Lower-kebab id → `agents.list[].id`. Unique, never `main`. | host | Required |
|
|
47
47
|
| **name** | Human-readable name ("My Shopper"). | sil manifest | Required |
|
|
48
|
-
| **persona** | Who the shopper is / how it shops — a generalist, voice, standing rules. | host **`SOUL.md`** (no
|
|
48
|
+
| **persona** | Who the shopper is / how it shops — a generalist, voice, standing rules. | host **`SOUL.md`** (no separate persona file) | Required |
|
|
49
49
|
| **workspace** | The shopper's workspace directory. | host | Required |
|
|
50
50
|
| **userSpec** | The user's **shared, cross-niche** facts + hard constraints. Seeded partial by the interview. | sil `user_spec.md` | **Required** |
|
|
51
51
|
| **channel** | The channel the setup conversation is on — bound to the new shopper. | host `openclaw.json` bindings | **Optional (fail-open)** |
|
|
52
52
|
|
|
53
|
-
There is **no per-niche input at create** — no
|
|
54
|
-
|
|
53
|
+
There is **no per-niche input at create** — no method and no PRD; those are minted lazily
|
|
54
|
+
on first shop via `sil_learn create`. The shopper reaches the web to mint and refresh
|
|
55
55
|
domains, so the agent needs web/fetch tools (inherited from `agents.defaults`); if
|
|
56
56
|
defaults grant none, the bin reports `created` with a `warnings` entry naming the gap
|
|
57
57
|
(bare `sil_search` still works) — surface it.
|
|
@@ -60,11 +60,11 @@ defaults grant none, the bin reports `created` with a `warnings` entry naming th
|
|
|
60
60
|
|
|
61
61
|
1. **Validate the spec FIRST** — `agentId` (present, lower-kebab, ≠ `main`), `name`,
|
|
62
62
|
`persona`, `workspace`, and the shared **`userSpec`** (present, non-blank — the only
|
|
63
|
-
sil artefact at create). No
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
2. **Singleton check.** Run `openclaw agents list --json` and read the sil store (
|
|
67
|
-
|
|
63
|
+
sil artefact at create). No per-domain method or PRD to validate. Any failure stops with
|
|
64
|
+
**`invalid_request`** naming the field and **writes nothing**, ahead of every host
|
|
65
|
+
command.
|
|
66
|
+
2. **Singleton check.** Run `openclaw agents list --json` and read the sil store (whether a
|
|
67
|
+
shopper `user_spec.md` already exists) **before** the add. If a sil shopper already
|
|
68
68
|
exists, stop with **`collision`** — **"a shopper already exists"** — and do **not** run
|
|
69
69
|
`openclaw agents add`; steer to shop-a-new-niche (lazy mint) or refine — **never mint a
|
|
70
70
|
second shopper**. An `agentId` clashing with any existing agent is likewise
|
|
@@ -73,13 +73,14 @@ defaults grant none, the bin reports `created` with a `warnings` entry naming th
|
|
|
73
73
|
--non-interactive --json` — the real `agents.list[]` entry + workspace bootstrap
|
|
74
74
|
(`SOUL.md`, `AGENTS.md`, …), inheriting model and tool profile from `agents.defaults`.
|
|
75
75
|
4. **Write the persona straight into the workspace `SOUL.md`** (host CLI). The persona is
|
|
76
|
-
the shopper's soul — the host's `SOUL.md`, not a sil artefact. There is **no
|
|
77
|
-
|
|
78
|
-
5. **Materialize the shared user spec — NO `domain`.** Call
|
|
79
|
-
name, userSpec }` (the singleton takes no `agentId`).
|
|
80
|
-
shared **`user_spec.md`**
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
the shopper's soul — the host's `SOUL.md`, not a sil artefact. There is **no separate
|
|
77
|
+
persona file** and **no copy** step.
|
|
78
|
+
5. **Materialize the shared user spec — SETUP-ONLY, NO `domain`.** Call
|
|
79
|
+
`sil_profile_materialize { name, userSpec }` (the singleton takes no `agentId`). It is
|
|
80
|
+
**setup-only**: it writes the shared **`user_spec.md`** into `$SIL_DATA_DIR/shopper/`,
|
|
81
|
+
atomically, with the shopper **name in its frontmatter** — there is **no manifest**, and
|
|
82
|
+
it mints **no method or PRD**. Those are minted lazily on first shop via
|
|
83
|
+
`sil_learn create`.
|
|
83
84
|
6. **Wire the sil skill + plugin** (host CLI). Asserted against the pinned host
|
|
84
85
|
**`alpine/openclaw:2026.6.9`**, both value-mode sets with `--strict-json` (the only set
|
|
85
86
|
mode this image accepts):
|
|
@@ -129,11 +130,11 @@ The bin emits **one** `{ status, … }` result and exits 0 **only** on `created`
|
|
|
129
130
|
## Runtime — how the shopper loads its behaviour
|
|
130
131
|
|
|
131
132
|
When you (the sil skill) start a session as the shopper, the host has already injected the
|
|
132
|
-
persona via **`SOUL.md`**.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
shopper calls **`sil_search`** / **`sil_product_get`** (and `sil_register` /
|
|
137
|
-
as needed) with **no further setup**, minting each niche on the fly the first
|
|
138
|
-
user shops it, per [`shop_loop.md`](shop_loop.md). To sharpen the shopper or a
|
|
139
|
-
[`
|
|
133
|
+
persona via **`SOUL.md`**. Load the shared **`user_spec.md`** (cross-niche facts + hard
|
|
134
|
+
constraints, reused across every niche); its frontmatter carries the shopper **name**, and
|
|
135
|
+
`sil_profile_search` scans the domains it has learned — an empty set is healthy, and each
|
|
136
|
+
per-domain method loads **lazily at shop time**. Because the `sil_*` tools were admitted at
|
|
137
|
+
create, the shopper calls **`sil_search`** / **`sil_product_get`** (and `sil_register` /
|
|
138
|
+
`sil_whoami` as needed) with **no further setup**, minting each niche on the fly the first
|
|
139
|
+
time the user shops it, per [`shop_loop.md`](shop_loop.md). To sharpen the shopper or a
|
|
140
|
+
domain, see [`fill_and_feedback.md`](fill_and_feedback.md).
|
|
@@ -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.
|