Commit f61a5b3
feat(workspace, search-results, org-workbench, shell): searches become async jobs — the queue rail lands
Agent searches (didi's links/streams/team crawls) ran as synchronous
invokes: the button disabled, one column was hijacked, and the operator
babysat a 60-210s wait per search. Now a search is a job — search.submit
returns a search_id in milliseconds, the workspace service owns a durable
registry, completion broadcasts over the existing WS event machinery, and
a new search-results remote renders the registry as a queue of cards in a
persistent right rail. Fire many, walk away, triage on arrival.
Registry + async execution (services/workspace):
- searches.ts — in-memory map + write-through JSON at SEARCH_STORE_PATH
(the sessions/active-workspace volume precedent), 24h TTL sweep, and an
executor that dispatches the existing organization.crawl.requested NATS
request (same 600s budget) without awaiting it. prompt-runner untouched.
- Four local capabilities: search.submit / list / results / dismiss;
search.updated joins the WS broadcast subjects. Stranded queued/running
entries are marked failed-with-retry on restart, never left spinning.
- Local capabilities now receive the actor envelope, so didi attribution
survives the async boundary into the crawl request.
The rail (apps/search-results, :3018 — spec said 3017 but strategy-curator
had claimed it):
- Cards show target chip, org, status, and elapsed vs typical duration
(hardcoded v1: links/streams ~90s, team ~200s); done cards pulse and
count into a header badge; the registry refetches on events, no polling.
- Expand fetches results on demand: links/streams rows with a ➕ that
carries the crawl's kind (and stream name) through the write; a team
surface with the full staged-people candidate gates, consume-on-accept.
- Dismissing a done card with unreviewed candidates asks once inline;
failed cards offer Retry (resubmit same entity+target).
Door switchover (org-workbench, search-and-add, shell):
- The links/streams 🤖 and the People 🤖 now enqueue via search.submit and
flip the rail visible (augment-it:search-submitted); StagedPeople and
crawlTeam are deleted from org-workbench (the rail owns staging now).
- search-and-add's crawl mode and the envelope crawl flag are retired;
term-search and stream-scan modes unchanged.
- Shell: 🔎 queue toggle + done-count badge beside 💬 chat, right-rail
slot mirroring the chat rail; searchResults federation entry; dev.sh
lists :3018.
Proven live against the Aspen safe target: prove-search-queue.mjs all
green over the real WS (submit 4ms → running + settle events → 7 results
→ dismiss), then a browser drive of the spec's click-path — two concurrent
crawls ticking in the rail, survival across a page reload, expand, one
accept with kind carry-through, and the unreviewed-candidates confirm.
Files changed: see the changelog entry
changelog/2026-07-24_07_Searches-Become-Async-Jobs-The-Queue-Rail-Lands-
Fire-Many-Walk-Away-Triage-On-Arrival.md for the full inventory.
Also included:
- .gitignore: .playwright-mcp/ browser-drive session artifacts
- spec annotated: port correction + status (Phases 1-3 implemented)
Closes #42.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013u3i9BoKeZRndqToQ3M5Q51 parent b3d1247 commit f61a5b3
36 files changed
Lines changed: 1803 additions & 395 deletions
File tree
- apps
- org-workbench/src
- lib
- search-and-add/src
- lib
- search-results
- src
- lib
- changelog
- context-v/specs
- scripts
- services/workspace/src
- shell
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
64 | 67 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 39 | | |
43 | 40 | | |
44 | | - | |
45 | 41 | | |
46 | 42 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
51 | 46 | | |
52 | 47 | | |
53 | | - | |
54 | | - | |
55 | 48 | | |
56 | 49 | | |
57 | 50 | | |
| |||
74 | 67 | | |
75 | 68 | | |
76 | 69 | | |
77 | | - | |
78 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
79 | 73 | | |
| 74 | + | |
80 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
| |||
86 | 84 | | |
87 | 85 | | |
88 | 86 | | |
89 | | - | |
90 | 87 | | |
91 | 88 | | |
92 | 89 | | |
| |||
108 | 105 | | |
109 | 106 | | |
110 | 107 | | |
111 | | - | |
112 | | - | |
| 108 | + | |
113 | 109 | | |
114 | 110 | | |
115 | | - | |
| 111 | + | |
116 | 112 | | |
117 | 113 | | |
118 | 114 | | |
119 | | - | |
| 115 | + | |
120 | 116 | | |
121 | 117 | | |
122 | 118 | | |
| |||
151 | 147 | | |
152 | 148 | | |
153 | 149 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | 150 | | |
169 | 151 | | |
170 | 152 | | |
| |||
This file was deleted.
0 commit comments