From 03cec962d981d6fa1417551e660b5facabcd49cb Mon Sep 17 00:00:00 2001 From: Marco Craveiro Date: Tue, 1 Dec 2026 23:17:09 +0000 Subject: [PATCH 1/4] [http] Test that the agent searches for compass itself The keyword list drops compass, so a question such as what is compass searches for nothing and the model is told no document matched. The test pins the keyword and the retrieval; the fix follows. Co-Authored-By: Claude Code --- .../compass.http/tests/ops_agent_tests.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/projects/compass.http/tests/ops_agent_tests.cpp b/projects/compass.http/tests/ops_agent_tests.cpp index fe7338d1..71128998 100644 --- a/projects/compass.http/tests/ops_agent_tests.cpp +++ b/projects/compass.http/tests/ops_agent_tests.cpp @@ -74,7 +74,7 @@ ops::agent_passage_text passage(std::uint32_t n, std::string kind_title, TEST_CASE("the agent searches the question's words, less its function words", "[agent][ops]") { CHECK(ops::agent_keywords("How do I register compass's MCP server with Claude Code?") == - strings{"register", "mcp", "server", "claude", "code"}); + strings{"register", "compass", "mcp", "server", "claude", "code"}); CHECK(ops::agent_keywords("Why are C++ builds capped at -j2?") == strings{"c++", "builds", "capped", "j2"}); CHECK(ops::agent_keywords("Does compass.http serve HTML, html?") == @@ -82,6 +82,22 @@ TEST_CASE("the agent searches the question's words, less its function words", CHECK(ops::agent_keywords("how do i").empty()); } +TEST_CASE("a question about compass itself searches for compass", "[agent][ops]") { + std::vector asked; + const auto search = [&](const std::string& q) { + asked.push_back(q); + if (q != "compass") + return std::vector{}; + return std::vector{hit("C", {"Answer"}, 1.0)}; + }; + const auto sections = [](const search_hit& h) { + return std::vector{section(h.heading_path, long_text)}; + }; + const auto found = ops::agent_retrieve("what is compass", search, sections); + CHECK(asked == strings{"compass"}); + REQUIRE(found.passages.size() == 1); +} + TEST_CASE("a compound question is searched a clause at a time", "[agent][ops]") { CHECK(ops::agent_clauses("What is the viable system model and how does compass use it?") == strings{"What is the viable system model", "how does compass use it?"}); From 737884b85ec575c4d16ce8fee5e71f3a0183f400 Mon Sep 17 00:00:00 2001 From: Marco Craveiro Date: Tue, 1 Dec 2026 23:17:28 +0000 Subject: [PATCH 2/4] [http] Keep compass in the agent's search terms The stop-word list held the product name, so the agent stripped compass from every question. A question such as what is compass then searched for nothing, and the model was told no document matched. Keep compass and compass's as search terms; the plain search route already answers them. Co-Authored-By: Claude Code --- projects/compass.http/src/ops/agent.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/projects/compass.http/src/ops/agent.cpp b/projects/compass.http/src/ops/agent.cpp index 37ec2660..3b53f199 100644 --- a/projects/compass.http/src/ops/agent.cpp +++ b/projects/compass.http/src/ops/agent.cpp @@ -44,13 +44,12 @@ constexpr std::size_t max_clauses = 3; constexpr std::array weak_headings{ "see also", "prs", "review", "test scenarios", "measurements", "result", "status"}; -constexpr std::array stop_words{ +constexpr std::array stop_words{ "a", "about", "an", "and", "are", "as", "at", "be", "by", "can", "could", "do", "does", "for", "from", "has", "have", "how", "i", "in", "is", "it", "its", "me", "my", "of", "on", "or", "our", "should", "so", "that", "the", "their", "them", "then", "there", "these", "they", "this", "to", "use", "used", "uses", "using", "was", "we", "what", - "when", "where", "which", "who", "why", "will", "with", "would", "you", "your", - "compass", "compass's"}; + "when", "where", "which", "who", "why", "will", "with", "would", "you", "your"}; constexpr std::string_view knowledge_rules = "You answer questions about the compass repository's documents. Answer only from the " From d1736fe01818e4866f228c3174b455c811fab33b Mon Sep 17 00:00:00 2001 From: Marco Craveiro Date: Tue, 1 Dec 2026 23:19:57 +0000 Subject: [PATCH 3/4] [agile] Record the agent question task Co-Authored-By: Claude Code --- .../build_the_compass_web_front_end/story.org | 3 +- ..._answer_questions_about_compass_itself.org | 110 ++++++++++++++++++ 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/task_answer_questions_about_compass_itself.org diff --git a/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/story.org b/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/story.org index 0d9b80dd..68ad2528 100644 --- a/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/story.org +++ b/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/story.org @@ -39,7 +39,7 @@ its own documentation screens in its favour. |---------------+----------------------------------------| | State | STARTED | | Parent sprint | [[id:850C1BC8-FE02-4EE0-A5D6-6085DC34CE27][Sprint 1]] | -| Now | Captured with its tasks. Rename, the OpenAPI document and the inventory are done. Prototype the shell and the document view (#234), Prototype the link graph in WebGL (#236), Prototype the agent panel on llama.cpp (#237) and Prototype the sprint and testing views (#239) are signed off. Stand up compass.web on the ores.web stack (#241) is signed off: compass serve serves compass.web. Search the documents in the browser (#242) is signed off with decision 10's ranking. Read a document in the browser (#243) is signed off and merged. Retire the HTML document route (#244) is signed off and merged. Show the sprint board, its stories and its tasks (#246) is signed off and merged. Draw the sprint charts (#247) is signed off and merged. Run test scenarios with screenshots in the browser (#248) is signed off and merged. Draw the link graph in WebGL (#249) is signed off and merged. Talk to the compass agent in the browser (#252) is signed off and merged. Serve compass behind ORE Studio's gateway (#254) is signed off and merged. Open compass.web from ores.web (#256) is signed off and merged. Publish the developer link (#257) merged the packaging and install work; the team address remains the product owner's. Suggest searches and offer an AI mode (#259) is STARTED: the landing page keeps its box centered while typing, lists the closest documents in a combo box, and hands the typed query to the agent from AI mode. | +| Now | Captured with its tasks. Rename, the OpenAPI document and the inventory are done. Prototype the shell and the document view (#234), Prototype the link graph in WebGL (#236), Prototype the agent panel on llama.cpp (#237) and Prototype the sprint and testing views (#239) are signed off. Stand up compass.web on the ores.web stack (#241) is signed off: compass serve serves compass.web. Search the documents in the browser (#242) is signed off with decision 10's ranking. Read a document in the browser (#243) is signed off and merged. Retire the HTML document route (#244) is signed off and merged. Show the sprint board, its stories and its tasks (#246) is signed off and merged. Draw the sprint charts (#247) is signed off and merged. Run test scenarios with screenshots in the browser (#248) is signed off and merged. Draw the link graph in WebGL (#249) is signed off and merged. Talk to the compass agent in the browser (#252) is signed off and merged. Serve compass behind ORE Studio's gateway (#254) is signed off and merged. Open compass.web from ores.web (#256) is signed off and merged. Publish the developer link (#257) merged the packaging and install work; the team address remains the product owner's. Suggest searches and offer an AI mode (#259) is STARTED: the landing page keeps its box centered while typing, lists the closest documents in a combo box, and hands the typed query to the agent from AI mode. The agent's retrieval dropped compass itself; the fix is in review. | | Waiting on | The product owner's team address for compass.web. | | Next | Publish the developer link once the address is decided. | | Last touched | 2026-12-01 | @@ -107,6 +107,7 @@ its own documentation screens in its favour. | [[id:55AACEE0-4551-43E8-8985-A79CE53666C2][Run test scenarios with screenshots in the browser]] | DONE | 2026-11-30 | 2026-12-01 | Add the testing pages: what needs testing in the sprint, a step-by-step scenario runner that records results, notes and pasted screenshots through the service's run routes, and the screenshots shown back. | | [[id:D730E00C-E6DF-4ED8-8B38-ECD40C335EF4][Draw the link graph in WebGL]] | DONE | 2026-11-30 | 2026-12-01 | Serve the environment's ID-link graph from a new compass route and draw it in compass.web with sigma.js and graphology, with search, local graph, colouring by type and the Zettelkasten overlays. | | [[id:A4FFB55D-43E3-4E2E-AA22-2503F0A49090][Talk to the compass agent in the browser]] | DONE | 2026-11-30 | 2026-12-01 | Add the compass agent: a chat panel in compass.web over a compass route that runs the signed-off loop against a local llama-server, retrieves through the query layer, streams over SSE and cites documents that open in compass.web. | +| [[id:AF19ABDD-FCB6-4241-ACA3-9A50388BB245][Answer questions about compass itself]] | STARTED | 2026-12-01 | | Search the agent's question for compass itself: the stop-word list dropped the product name, so what is compass searched for nothing. Keep compass and compass's as terms, with a test. | | [[id:D6F014EB-CB9F-44D6-B14A-9544B2691943][Serve compass behind ORE Studio's gateway]] | DONE | 2026-12-01 | 2026-12-01 | Run compass.http behind ores.http as its gateway and compass.web inside ores.web on ores.web's session, while compass on its own keeps running with no sign-in, and hand ORE Studio the forwarder and view mapping its side needs. | | [[id:44146C3F-FE10-4832-9311-7C2A87D17CDC][Open compass.web from ores.web]] | DONE | 2026-12-01 | 2026-12-01 | Make compass.web reachable from ores.web: first an external menu entry, then compass.web's pages as a package ores.web adds as a dependency and mounts, reading compass through ores.http, so ORE Studio can decommission its own documentation screens. | | [[id:131CF0B6-CF93-40A0-A6AC-4635F4A3CE8A][Publish the developer link]] | STARTED | 2026-12-01 | | Run compass.web for the team at a stable address, link it from compass's developer pages, and ship its built files with compass's releases. | diff --git a/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/task_answer_questions_about_compass_itself.org b/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/task_answer_questions_about_compass_itself.org new file mode 100644 index 00000000..802193df --- /dev/null +++ b/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/task_answer_questions_about_compass_itself.org @@ -0,0 +1,110 @@ +:PROPERTIES: +:ID: AF19ABDD-FCB6-4241-ACA3-9A50388BB245 +:END: +#+title: Task: Answer questions about compass itself +#+description: Search the agent's question for compass itself: the stop-word list dropped the product name, so what is compass searched for nothing and the model was told no document matched. Keep compass and compass's as terms, with a test. +#+type: task +#+level: s1 +#+filetags: :build_the_compass_web_front_end:sprint_01:v0: +#+owner: marco +#+branch: feature/agent-search-compass +#+pr: +#+blocked_on: +#+blocked_since: +#+created: 2026-12-01 +#+updated: 2026-12-01 +#+environment: +#+todo: DISCOVERED BACKLOG STARTED BLOCKED | DONE ABANDONED + +This page documents a [[id:31C868B9-306E-4282-BA8C-07E647021B34][task]] in the [[id:D8019709-7EF9-43E0-AC64-85DB34A078BE][Build the compass web front end]] story. It captures the goal, current status, acceptance, and any notes or results. + +* Goal + +A person asks the agent what compass is, or another question whose only +content word is the product name. The agent searches its documents for +compass and answers from them. + +* Status + +| Field | Value | +|--------------+----------------------------------------| +| State | STARTED | +| Parent story | [[id:D8019709-7EF9-43E0-AC64-85DB34A078BE][Build the compass web front end]] | +| Now | The stop-word list dropped compass; the fix keeps it, the agent tests pass, and the live agent now searches compass and answers from the documents. | +| Waiting on | The product owner's sign-off. | +| Next | The product owner's sign-off. | +| Last touched | 2026-12-01 | + +* Acceptance + +- A question such as =what is compass= searches for =compass= and returns + passages. +- The keyword list keeps =compass= and =compass's= as search terms. +- The agent tests pass natively. + +* Plan + +(Implementation strategy. Written when work starts; key decisions +are distilled into the parent story's =* Decisions= at close, but the +plan itself stays — it is the historical record of what we did.) + +* Measurements + +Every number this task claims about a tree, with the command that produced it +and the commit it was measured at. A number without both is not a measurement, +because a clean-up record describes a tree and trunk moves under a branch: a +consumer count, a gate's component count and a suite's size all change with no +code changing, and the reader of a bare number cannot tell which tree it came +from. Where the raw output matters, put it in an =evidence/= file beside the +task and name that file in the Command column. + +| What | Value | Command | Commit | +|------+-------+---------+--------| +| Agent search terms for =what is compass=, before | none | =curl -sN 'http://127.0.0.1:8080/v1/compass/agent?q=what%20is%20compass'= | d234b035 | +| Agent search terms for =what is compass=, after | =compass= | =curl -sN 'http://127.0.0.1:8080/v1/compass/agent?q=what%20is%20compass'= | 4c1cd93f | +| Agent retrieval tests, before the fix | 2 failed | =compass.http.tests "[agent][ops]"= | 93c7e7e0 | +| Agent retrieval tests, after the fix | 53 assertions in 10 cases passed | =compass.http.tests "[agent][ops]"= | 4c1cd93f | + +* Notes + +The product owner reported that the agent answered =what is compass= with +"No compass document matched your query", and the panel said the agent +searched for nothing. =agent_keywords= removes the stop words, and the list +held =compass= and =compass's=, the product's own name. The question then had +no terms, =search_relaxed= ran no query, and the model was told no document +matched. The plain search route already answers =what is compass= with +compass's documents. + +The live check after the fix returned =queries:["compass"]=, five passages and +an answer citing passage 1: 753 prompt tokens, 90 generated in 89 seconds on +the CPU model. + +* Test Scenarios + +Manual QA scenarios (scaffolded via =compass add test_scenario=) +that verify this task. Link +new ones here as they're created; the scenario doc itself links back +via its "Verifies task" field. + +| Scenario | State | Notes | +|----------+-------+-------| +| | | | + +* PRs + +| PR | Title | +|----+-------| +| (this branch) | [http] Keep compass in the agent's search terms | + +* Review + +| # | Comment summary | File | Decision | Notes | +|---+-----------------+------+----------+-------| +| | | | | | + +* Result + +=compass= and =compass's= leave the stop-word list. The keyword list keeps +the product name, and a question about compass searches for it and answers +from the documents. The regression test fails on main and passes with the +fix. From 2fad0cd2d6263edab91436d4b74b0b40169dbd10 Mon Sep 17 00:00:00 2001 From: Marco Craveiro Date: Tue, 1 Dec 2026 23:20:17 +0000 Subject: [PATCH 4/4] [agile] Link the agent question task to its pull request Co-Authored-By: Claude Code --- .../task_answer_questions_about_compass_itself.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/task_answer_questions_about_compass_itself.org b/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/task_answer_questions_about_compass_itself.org index 802193df..ed22ae4b 100644 --- a/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/task_answer_questions_about_compass_itself.org +++ b/doc/agile/versions/v0/sprint_01/build_the_compass_web_front_end/task_answer_questions_about_compass_itself.org @@ -8,7 +8,7 @@ #+filetags: :build_the_compass_web_front_end:sprint_01:v0: #+owner: marco #+branch: feature/agent-search-compass -#+pr: +#+pr: 260 #+blocked_on: #+blocked_since: #+created: 2026-12-01 @@ -94,7 +94,7 @@ via its "Verifies task" field. | PR | Title | |----+-------| -| (this branch) | [http] Keep compass in the agent's search terms | +| [[https://github.com/MASD-Project/compass/pull/260][#260]] | [http] Keep compass in the agent's search terms | * Review