REQ-DDB-WIKI-033: The hub is live — refresh-driven rebuilds, agent focus, and an API over the query engine

← Requirements

What it requires

  1. While the hub runs it is attached to the server: after the refresh loop refreshes targets, every one whose wiki is already built is rebuilt (an unopened wiki is not), and each finished build is announced as a rebuilt event on /events (server-sent events, a keepalive comment every 15 s, every stream ended when the hub stops).
  2. A found function's dossier reply gains wiki_url — its symbol section on the hub, carrying no token — and a focus event; with the hub off no key is added and a failing link never costs the answer.
  3. Pages the hub serves carry an injected /live.js that offers a reload on rebuilt and a link on focus; the static site carries no live code.
  4. /api/<slug>/dossier and /api/<slug>/search answer through clew.query.export; a missing argument or a refused call is a 400 with its reason, an unbuilt index a 404.
tier
PASS
declared
implemented
priority
P1

Where it lives

  • Answer: query engine + MCP server4

See it on the map

How it is met

implemented bytestsresultattachlinkpublishrefreshedtest_a_comment_posted_on_a_served_page_is_stored_for_the_agentpassedtest_a_dossier_reply_carries_a_wiki_url_only_while_the_hub_runspassedtest_a_refreshed_target_with_a_built_wiki_is_rebuilt_and_announcedpassedtest_a_wiki_is_built_on_demand_and_then_servedpassedtest_mcp_refresh_of_a_vendored_sub_index_excludes_its_own_childrenpassedtest_nothing_outside_the_site_is_servedpassedtest_pages_served_by_the_hub_carry_the_live_scriptpassedtest_serve_attaches_the_hub_to_the_tools_and_the_refresh_looppassedtest_serve_runs_the_background_loop_beside_the_transportpassedtest_serve_runs_the_hub_only_when_asked_and_records_its_urlpassedtest_served_pages_carry_the_comment_controlpassedtest_the_api_answers_with_the_query_enginepassedtest_the_comment_endpoint_refuses_what_it_mustpassedtest_the_hub_binds_loopback_and_refuses_a_request_without_its_tokenpassedtest_the_hub_lists_every_target_and_says_which_are_unreachablepassedtest_the_hub_writes_nothing_to_stdoutpassedtest_the_refresh_loop_tells_the_hub_what_it_refreshedpassed

Show on the map

Implemented by

Tests (17)

Linked directly

17 tests: 17 passed

17 passed
testresultlinked byimplementers exercisedcalls away
test_mcp_refresh_of_a_vendored_sub_index_excludes_its_own_childrenpassedmeasured4 of 4: attach, link, publish, refreshed—
test_a_refreshed_target_with_a_built_wiki_is_rebuilt_and_announcedpassedmeasured2 of 4: publish, refreshed—
test_a_dossier_reply_carries_a_wiki_url_only_while_the_hub_runspassedmeasured1 of 4: link—
test_a_wiki_is_built_on_demand_and_then_servedpassedmeasured1 of 4: publish—
test_nothing_outside_the_site_is_servedpassedmeasured1 of 4: publish—
test_serve_attaches_the_hub_to_the_tools_and_the_refresh_looppassedmeasured1 of 4: attach—
test_serve_runs_the_hub_only_when_asked_and_records_its_urlpassedmeasured1 of 4: attach—
test_the_hub_writes_nothing_to_stdoutpassedmeasured1 of 4: publish—
test_a_comment_posted_on_a_served_page_is_stored_for_the_agentpassedcatalogunknown—
test_pages_served_by_the_hub_carry_the_live_scriptpassedcatalogunknown—
test_served_pages_carry_the_comment_controlpassedcatalogunknown—
test_the_api_answers_with_the_query_enginepassedcatalogunknown—
test_the_comment_endpoint_refuses_what_it_mustpassedcatalogunknown—
test_the_hub_binds_loopback_and_refuses_a_request_without_its_tokenpassedcatalogunknown—
test_the_hub_lists_every_target_and_says_which_are_unreachablepassedcatalogunknown—
test_the_refresh_loop_tells_the_hub_what_it_refreshedpassedcatalogunknown—
test_serve_runs_the_background_loop_beside_the_transportpassedmeasured1 of 4: attach2

Flows through it