mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-27 23:44:57 +08:00
docs: intake hikaMaeng web search fork ideas
Add ROADMAP pinpoint #255 summarizing the safe subset of hikaMaeng/Sigrid Jin's web-search provider work to adopt later.\n\nReviewed fork commits 262405e, bd11289, fa93cd3, 5f2540a, 7f34d91, and 535be97 from https://github.com/hikaMaeng/claw-code. This deliberately preserves attribution and avoids a blind cherry-pick because the cross-crate provider/spec/config/banner changes need a dedicated implementation lane with tests.
This commit is contained in:
12
ROADMAP.md
12
ROADMAP.md
@@ -16809,3 +16809,15 @@ Introduces the **FOURTH distinct discovery-pattern** in the audit catalog: **PUR
|
|||||||
Required fix shape: (a) add `resources/subscribe` + `resources/unsubscribe` request methods on `McpStdioProcess` parallel to `list_resources` / `read_resource`; (b) add a notification dispatch path on the stdio reader that routes `notifications/resources/updated` and `notifications/resources/list_changed` to a per-server channel rather than dropping them; (c) add `pub enum ResourceLifecycleEvent { Created(McpResource) | Updated { uri } | Destroyed { uri } | ListChanged }` typed event surfaced through `LaneEvents`; (d) add a session-bound `ResourceRegistry` in the runtime that tracks active subscriptions, applies updates, and fires staleness warnings; (e) add `version` / `etag` optional fields on `McpResource`; (f) advertise `resources.subscribe = true` in the initialize handshake when the runtime supports it; (g) expose `/resources`, `/resources refresh`, `/resources subscribe <uri>` slash commands and `claw mcp resources [list|read|subscribe]` CLI subcommands. Acceptance: an MCP server that emits `notifications/resources/updated { uri: "db://orders/42" }` mid-session causes claw to update its `ResourceRegistry`, fire a `ResourceUpdated` lane event, and either re-read the resource on next reference or surface a staleness marker — instead of the agent silently reasoning over a stale snapshot.
|
Required fix shape: (a) add `resources/subscribe` + `resources/unsubscribe` request methods on `McpStdioProcess` parallel to `list_resources` / `read_resource`; (b) add a notification dispatch path on the stdio reader that routes `notifications/resources/updated` and `notifications/resources/list_changed` to a per-server channel rather than dropping them; (c) add `pub enum ResourceLifecycleEvent { Created(McpResource) | Updated { uri } | Destroyed { uri } | ListChanged }` typed event surfaced through `LaneEvents`; (d) add a session-bound `ResourceRegistry` in the runtime that tracks active subscriptions, applies updates, and fires staleness warnings; (e) add `version` / `etag` optional fields on `McpResource`; (f) advertise `resources.subscribe = true` in the initialize handshake when the runtime supports it; (g) expose `/resources`, `/resources refresh`, `/resources subscribe <uri>` slash commands and `claw mcp resources [list|read|subscribe]` CLI subcommands. Acceptance: an MCP server that emits `notifications/resources/updated { uri: "db://orders/42" }` mid-session causes claw to update its `ResourceRegistry`, fire a `ResourceUpdated` lane event, and either re-read the resource on next reference or surface a staleness marker — instead of the agent silently reasoning over a stale snapshot.
|
||||||
|
|
||||||
**Status:** Open. No source code changed. Filed 2026-04-26 11:04 KST. HEAD: `17efd95` (post-#253 fast-forward verification onto gaebal-gajae's 11:00 KST DogfoodCycleSummary/StateVectorCompact pinpoint at `17efd95` — TENTH consecutive concurrent-dogfood rebase cycle, three-way parity local==origin==fork at `17efd95` confirmed before filing). Branch: feat/jobdori-168c-emission-routing. Cluster delta: session-bound-resource-tracking-registry 0→1 (founder), Resource-lifecycle-event-opacity 0→1 (founder), Pure-clawability-friction-from-dogfooding discovery-pattern 0→1 (founder, FOURTH distinct discovery-pattern after META-cluster-growth + complementary-pinpoint-pair-bundle + NEW-SOLO-CLUSTER-FOUNDING-WITH-DAILY-DRIVER-IMPACT). Smaller-scope by design (matches #253's context-budget-discipline). Distinct from #252's API-shape gap (this is runtime-protocol gap), distinct from #229/#238/#244 persistent-WebSocket cluster (this is stdio JSON-RPC notification dispatch), distinct from #239/#243/#253 dogfood-coordination layer (this is protocol-runtime layer). Linked to #253 as the discipline-pivot enabler that allowed this smaller-scope pinpoint to be foregrounded over the larger META-cluster-growth options.
|
**Status:** Open. No source code changed. Filed 2026-04-26 11:04 KST. HEAD: `17efd95` (post-#253 fast-forward verification onto gaebal-gajae's 11:00 KST DogfoodCycleSummary/StateVectorCompact pinpoint at `17efd95` — TENTH consecutive concurrent-dogfood rebase cycle, three-way parity local==origin==fork at `17efd95` confirmed before filing). Branch: feat/jobdori-168c-emission-routing. Cluster delta: session-bound-resource-tracking-registry 0→1 (founder), Resource-lifecycle-event-opacity 0→1 (founder), Pure-clawability-friction-from-dogfooding discovery-pattern 0→1 (founder, FOURTH distinct discovery-pattern after META-cluster-growth + complementary-pinpoint-pair-bundle + NEW-SOLO-CLUSTER-FOUNDING-WITH-DAILY-DRIVER-IMPACT). Smaller-scope by design (matches #253's context-budget-discipline). Distinct from #252's API-shape gap (this is runtime-protocol gap), distinct from #229/#238/#244 persistent-WebSocket cluster (this is stdio JSON-RPC notification dispatch), distinct from #239/#243/#253 dogfood-coordination layer (this is protocol-runtime layer). Linked to #253 as the discipline-pivot enabler that allowed this smaller-scope pinpoint to be foregrounded over the larger META-cluster-growth options.
|
||||||
|
|
||||||
|
## Pinpoint #255 — hikaMaeng fork proves local WebSearch needs a provider/spec registry intake lane, but the safe landing shape is design-first rather than blind cherry-pick
|
||||||
|
|
||||||
|
Dogfooded 2026-04-26 02:12 UTC on `feat/jobdori-168c-emission-routing` by fetching and statically reviewing the public fork `https://github.com/hikaMaeng/claw-code` at `/tmp/hikaMaeng-claw-code-read`. Interesting fork commits inspected: `262405e` (pluggable Tavily/Brave/Bing/custom/DDG fallback), `bd11289` (settings.json-only websearch config), `fa93cd3` (startup banner provider line), `5f2540a` (Firecrawl plus Brave gzip handling), `7f34d91` (external `searchProvider.json` specs), and `535be97` (web-search integration guide). Attribution: implementation ideas are from hikaMaeng / Sigrid Jin's fork work and should remain credited in any follow-up implementation commit.
|
||||||
|
|
||||||
|
Safe intake finding: do **not** cherry-pick the fork wholesale. The useful distilled ideas are smaller and align with #245/#250/#251: (1) separate provider selection from provider mechanics (`settings.json` chooses `websearch.provider` + secret; `searchProvider.json` describes endpoint/method/auth/result paths); (2) keep DDG/HTML parsing as the fallback path while JSON API providers use a generic executor; (3) make provider status visible in startup/UI so operators know which search backend is active; (4) preserve domain allow/block filtering, dedupe, and result truncation after provider-specific parsing; (5) handle provider transport quirks centrally (for example Brave gzip / response decoding) rather than in ad hoc call sites; (6) document custom-provider extension without requiring rebuilds.
|
||||||
|
|
||||||
|
Why ROADMAP-only in this branch: current `rust/crates/tools/src/lib.rs` already has a local DDG-backed `WebSearch` tool with tests and `CLAWD_WEB_SEARCH_BASE_URL` mock support, but the fork's later commits add config-schema surface, runtime config validation, root-level provider spec files, and CLI banner wiring as one cross-crate feature. Landing that feature safely needs an implementation lane with tests for config precedence, provider-spec parsing, no-secret logging, mock provider HTTP, and backward-compatible DDG behavior. A minimal cherry-pick would either break the existing test contract or introduce an unreviewed external spec file/runtime path.
|
||||||
|
|
||||||
|
Required fix shape for follow-up: (a) add a `WebSearchConfig { provider, api_key_ref/api_key }` runtime config view using existing settings precedence; (b) add a provider-spec schema with explicit allowlisted auth modes and result-path parsing, searched from project/user/system locations; (c) build a generic JSON provider executor plus a preserved DDG HTML executor; (d) keep post-parse domain filters/dedupe/truncate common; (e) add provider-status display only after config parse is non-fatal and redacts secrets; (f) add docs derived from `535be97` but rewritten in this repo's style and language; (g) add an external-patch-intake packet under #251 recording fork URL, commit range, diffstat, reviewed files, accepted/rejected ideas, and attribution.
|
||||||
|
|
||||||
|
Acceptance: `WebSearch` continues to pass existing DDG/mock tests with no settings file; setting `.claw/settings.json` to a supported provider plus a local mock `searchProvider.json` routes through the generic executor; missing API keys fail with typed/actionable errors before dispatch; provider name is visible without leaking secrets; and the commit body/ROADMAP preserves attribution to hikaMaeng's fork commits above. **Status:** Open. No source code changed in this intake commit. Cluster delta: #245 client-side configurable provider/parser registry gains concrete external implementation evidence; #251 external-fork intake gains its first reviewed fork packet; #250 server-managed search remains the complementary server-side half and is intentionally not mixed into this local-provider implementation lane.
|
||||||
|
|||||||
Reference in New Issue
Block a user