diff --git a/doc/agile/versions/v0/sprint_01/sprint.org b/doc/agile/versions/v0/sprint_01/sprint.org index 1d87a687..905c43bb 100644 --- a/doc/agile/versions/v0/sprint_01/sprint.org +++ b/doc/agile/versions/v0/sprint_01/sprint.org @@ -73,7 +73,7 @@ Know what we build and what we must beat: the repository shape, and measured bas | [[id:41FD3A9B-6D52-44A2-9676-6EC5FD28F8A9][Trace a break to its cause]] | DONE | 2026-11-21 | 2026-11-21 | Every commit and pull request states its story, task and environment, and compass traces a finding on main to the commit, pull request and environment that likely caused it. | | [[id:67224021-6300-4FEE-BA62-518F2FEB22AB][Move the skill levels to the project]] | BACKLOG | | | The level of each skill becomes the project's data in a check document, compass stamps it and reports the slices, and ORE Studio's apply_skill_levels.py goes. | | [[id:F9ED1184-6A62-4B08-A2F7-D109E2C28605][Gate the knowledge titles]] | DONE | 2026-11-22 | 2026-11-22 | A check codec holds every knowledge page's title to a noun phrase and its file name to the title in snake case, from words a project's check document lists. | -| [[id:1874A6CC-3640-4A89-B07F-C9A5F6AAD5F2][Surface the open blame reports]] | STARTED | 2026-11-29 | | Show every environment the blame reports still open on main, its own first, when it lists them, after it merges or rebases main and when it runs a gate, from the report types a project names in its configuration. | +| [[id:1874A6CC-3640-4A89-B07F-C9A5F6AAD5F2][Surface the open blame reports]] | DONE | 2026-11-29 | 2026-12-05 | Show every environment the blame reports still open on main, its own first, when it lists them, after it merges or rebases main and when it runs a gate, from the report types a project names in its configuration. | | [[id:D8019709-7EF9-43E0-AC64-85DB34A078BE][Build the compass web front end]] | STARTED | 2026-11-29 | | Give developers and testers one web front end over compass's document service, compass.web in TypeScript on ores.web's stack over compass's C++ HTTP endpoints: search, documents, the sprint board with its stories and tasks, test runs with screenshots, a WebGL link graph and a local compass agent on llama.cpp, built in increments the product owner validates in a browser and ready to sit inside ores.web. | | [[id:0D43BBF9-C7E9-4A41-BFF2-CC15D6F0AEDA][Give codegen the model contract]] | DONE | 2026-12-03 | 2026-12-04 | Refuse, with a message naming the fix, a model that omits a section or property its templates need, so a new model cannot generate C++ that does not compile. | | [[id:4BD0292F-FA8C-4EB8-B31D-DAEDFE3BDA34][Share documents across projects and environments]] | BACKLOG | | | Decide where the truth of each kind of document lives once compass serves more than one project and each project more than one environment: what every environment shares, what stays in one environment until it merges (codegen models), how projects reference each other's documents, and what each view shows by default. | diff --git a/doc/agile/versions/v0/sprint_01/surface_the_open_blame_reports/story.org b/doc/agile/versions/v0/sprint_01/surface_the_open_blame_reports/story.org index 91ce66ac..7bf6d8a4 100644 --- a/doc/agile/versions/v0/sprint_01/surface_the_open_blame_reports/story.org +++ b/doc/agile/versions/v0/sprint_01/surface_the_open_blame_reports/story.org @@ -39,11 +39,11 @@ would have caught the breaks before they reached main. | Field | Value | |---------------+----------------------------------------| -| State | STARTED | +| State | DONE | | Parent sprint | [[id:850C1BC8-FE02-4EE0-A5D6-6085DC34CE27][Sprint 1]] | -| Now | =compass blames=, =check= and the git hooks show the open reports, the current environment's first and marked; the folder is analysed and three checks are proposed. The service query and the environment naming remain. | +| Now | Nothing. | | Waiting on | Nothing. | -| Next | Serve the open reports over HTTP and MCP. | +| Next | Nothing. | | Last touched | 2026-12-05 | * Acceptance @@ -68,7 +68,7 @@ would have caught the breaks before they reached main. |------+-------+-------+-----+-------------| | [[id:686B61EC-0AD8-4AEB-ADA7-1F9EAB504AC6][List the open blame reports]] | DONE | 2026-11-29 | 2026-12-04 | A compass blames command that lists the open reports of the types a project names, the current environment's first and marked, and the same short summary from check and the git hooks. | | [[id:62A4D200-9C15-4D37-A47C-CB593BD51D64][Analyse the blame reports during the sprint]] | DONE | | 2026-12-04 | Read the blame folder at points during the sprint, class the breaks it records, and find the proactive checks that would have caught them before they reached main. | -| [[id:BFCA17AF-5BDD-4B4B-8B07-5325F191C472][Serve the open blame reports]] | BACKLOG | | | Answer the open reports over the document service, as an HTTP read route and an MCP tool generated from the route models, so agents that read compass through it see them too. | +| [[id:BFCA17AF-5BDD-4B4B-8B07-5325F191C472][Serve the open blame reports]] | DONE | 2026-12-05 | 2026-12-05 | Answer the open reports over the document service, as an HTTP read route and an MCP tool generated from the route models, so agents that read compass through it see them too. | | [[id:8DFD6766-E279-4496-AAE6-A9CD7AC6457A][Unify environment names]] | DONE | 2026-12-05 | 2026-12-05 | Give an environment one name everywhere compass and its projects state one, by a migration that renames corpus.environment.name and the environment columns of activity in one transaction, not by naming it differently on the next sync. | * Decisions diff --git a/doc/agile/versions/v0/sprint_01/surface_the_open_blame_reports/task_serve_the_open_blame_reports.org b/doc/agile/versions/v0/sprint_01/surface_the_open_blame_reports/task_serve_the_open_blame_reports.org index 9a3b2f02..bab5bed8 100644 --- a/doc/agile/versions/v0/sprint_01/surface_the_open_blame_reports/task_serve_the_open_blame_reports.org +++ b/doc/agile/versions/v0/sprint_01/surface_the_open_blame_reports/task_serve_the_open_blame_reports.org @@ -7,8 +7,8 @@ #+level: s1 #+filetags: :blame:serve:surface_the_open_blame_reports:sprint_01:v0: #+owner: marco -#+branch: -#+pr: +#+branch: feature/serve-the-open-blame-reports +#+pr: 280 #+blocked_on: #+blocked_since: #+created: 2026-11-29 @@ -36,22 +36,43 @@ kinds first. | Field | Value | |--------------+----------------------------------------| -| State | BACKLOG | +| State | DONE | | Parent story | [[id:1874A6CC-3640-4A89-B07F-C9A5F6AAD5F2][Surface the open blame reports]] | -| Now | Not yet started. | +| Now | Done: the reports are a query, and a Blames screen groups them by sprint and opens each one. | | Waiting on | Nothing. | -| Next | Begin implementation. | -| Last touched | 2026-11-29 | +| Next | Nothing. | +| Last touched | 2026-12-05 | * Acceptance -- +- A page of an environment's documents carries its =State= and the sprint its + path sits in, so a report list can show both without a second read. +- A list request may name up to two =* Status= fields and a heading; each + summary carries the fields' values as =owner= and =found_by= and whether + the heading's section holds text as =answered=. Names a regular + expression would read specially are refused and answer empty. +- compass.web has a Blames screen shaped like the prototype the product owner + signed off: count tiles first; three views; *By sprint* groups the reports + with a filter by state; *Outstanding* groups the open ones by owner, oldest + first; *Analysis* counts each owner's load, the open and addressed split, + and the days reports were filed on. Every row opens in the document view + by its =:ID:=. +- On a real folder, a report opens with its whole page rendered, its + =* Response= included. * 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.) +1. The database already keeps each page's =State=, and a sprint is the + nearest =sprint_= in its path. Add both, and an optional =owner_field=, + to =document_summary=; the owner is read from the document's source by a + regular expression whose field name is validated to letters, digits, + spaces, =_= and =-=, so no other input reaches the expression. +2. A Blames screen lists the documents of a type, groups them by sprint and + filters by the lifecycle state: a page is closed when its state is =DONE= + or =ABANDONED=, open otherwise. Each row links to the document view by + =:ID:=. +3. Verify on a real folder: three ORE Studio blame reports synced into a + throwaway database, the screen driven in Chromium, a report opened. * Measurements @@ -65,10 +86,29 @@ task and name that file in the Command column. | What | Value | Command | Commit | |------+-------+---------+--------| -| | | | | +| =compass.http.tests= | 9836 assertions in 390 cases | =compass.http.tests= | this branch | +| =@compass/pages= vitest | 255 tests in 12 files | =npx vitest run= | this branch | +| Real folder, open filter | 1 of 3 reports | Chromium against the throwaway database | this branch | +| A report opened | whole page rendered, =* Response= included | Chromium, click through from the list | this branch | * Notes +- *The owner is read from the source at query time.* The database keeps a + page's state but not the field a project's reports use for an owner, and + the field's name is project data. The request names it, the server + validates the name, and the expression reads it from the stored source. + This costs a scan of each listed document's source; filling a column at + sync through the project's =* Open reports= table would replace it, and is + the follow-up when the list grows. +- *Closed means done or abandoned.* The database's state is the page's TODO + state, so the screen treats =DONE= and =ABANDONED= as closed and every + other state as open. A project whose open states differ needs the open + states from its =* Open reports= table instead; the =blames= command + already reads them. +- *The list is capped at 100*, the route's maximum; a page shows the first + hundred and says so through its count. Paging the screen is the follow-up + if a project keeps more than that. + * Test Scenarios Manual QA scenarios (scaffolded via =compass add test_scenario=) @@ -93,3 +133,15 @@ via its "Verifies task" field. | | | | | | * Result + +A page of documents now carries its state, its sprint, its created date, +the requested Status fields' values as =owner= and =found_by=, and whether +the requested heading's section holds text as =answered=. compass.web gained the +Blames screen from the prototype: count tiles, the By sprint, Outstanding and +Analysis views, and every row opening in the document view by its =:ID:=. +It is the seventh screen in the menu, beside Documents. + +Verified on a throwaway database seeded with three of ORE Studio's blame +reports: the open filter showed the one started report with its owner, All +showed the three, and clicking one opened its page with the owner's +=* Response= rendered. diff --git a/doc/knowledge/compass/compass_web_features.org b/doc/knowledge/compass/compass_web_features.org index a489807f..09471813 100644 --- a/doc/knowledge/compass/compass_web_features.org +++ b/doc/knowledge/compass/compass_web_features.org @@ -41,6 +41,17 @@ marked unresolved rather than followed. The view also lists the document's images, the documents it links to, and the documents that link to it, each backlink with the heading path the link sits under. Documents are read-only. +** Blames + +The Blames screen lists the reports a project keeps open, the breaks main +reported and the environment that owns each. It groups them by sprint, the +newest first, the open ones before the addressed within a group, and filters +by open or addressed. Each row names the report, its environment, the sprint +and whether a response was written; opening one shows the whole page, the +owner's response included. The screen reads the document service, so a +project states the type and the owner field in its configuration and compass +names none of them. + ** The sprint The Sprint screen draws the environment's present or an earlier sprint as a @@ -101,7 +112,7 @@ first, so what the model no longer sees is counted rather than hidden. Every address names an environment, and the picker lists every environment the service holds, with the time of its last sync and its document count. All -six screens read only that environment. The server filters every read by the +every screen reads only that environment. The server filters every read by the caller's environment, subject and view: run alone, compass has no sign-in and local callers use the team view; behind ORE Studio's gateway, the caller's session supplies the subject and view, and a knowledge view sees only what diff --git a/projects/compass.http/include/compass.http/messages/document_queries_protocol.hpp b/projects/compass.http/include/compass.http/messages/document_queries_protocol.hpp index 4cf9f34b..67c42d3e 100644 --- a/projects/compass.http/include/compass.http/messages/document_queries_protocol.hpp +++ b/projects/compass.http/include/compass.http/messages/document_queries_protocol.hpp @@ -331,6 +331,12 @@ struct document_summary { std::vector tags; std::string updated; std::string excerpt; + std::string state; + std::string sprint; + std::string owner; + std::string created; + std::string found_by; + bool answered{}; friend bool operator==(const document_summary&, const document_summary&) = default; }; @@ -349,6 +355,12 @@ struct document_summary { ::compass::db::codec::field{"tags", &document_summary::tags, true}, ::compass::db::codec::field{"updated", &document_summary::updated}, ::compass::db::codec::field{"excerpt", &document_summary::excerpt}, + ::compass::db::codec::field{"state", &document_summary::state}, + ::compass::db::codec::field{"sprint", &document_summary::sprint}, + ::compass::db::codec::field{"owner", &document_summary::owner}, + ::compass::db::codec::field{"created", &document_summary::created}, + ::compass::db::codec::field{"found_by", &document_summary::found_by}, + ::compass::db::codec::field{"answered", &document_summary::answered}, }; } @@ -357,6 +369,9 @@ struct list_documents_request { document_filter filter; std::uint32_t limit = 50; std::uint32_t offset = 0; + std::optional owner_field; + std::optional found_by_field; + std::optional answered_heading; friend bool operator==(const list_documents_request&, const list_documents_request&) = default; }; @@ -371,6 +386,9 @@ struct list_documents_request { ::compass::db::codec::field{"filter", &list_documents_request::filter, true}, ::compass::db::codec::field{"limit", &list_documents_request::limit, true}, ::compass::db::codec::field{"offset", &list_documents_request::offset, true}, + ::compass::db::codec::field{"owner_field", &list_documents_request::owner_field}, + ::compass::db::codec::field{"found_by_field", &list_documents_request::found_by_field}, + ::compass::db::codec::field{"answered_heading", &list_documents_request::answered_heading}, }; } diff --git a/projects/compass.http/modeling/compass.http.document_queries.org b/projects/compass.http/modeling/compass.http.document_queries.org index 7240b7ed..d3263c73 100644 --- a/projects/compass.http/modeling/compass.http.document_queries.org +++ b/projects/compass.http/modeling/compass.http.document_queries.org @@ -492,6 +492,57 @@ The document's =#+updated:=. The first lines of the document's body, clipped for a list. Empty when the document has no body text. +*** state +:PROPERTIES: +:cpp_type: std::string +:END: + +The document's =State= row, as the database derives it: =open= or +=addressed=. Empty when the page states none. + +*** sprint +:PROPERTIES: +:cpp_type: std::string +:END: + +The sprint the document's path sits in, the nearest =sprint_= segment. +Empty when the path has none. + +*** owner +:PROPERTIES: +:cpp_type: std::string +:END: + +The value the requested =owner_field= holds in the document's =* Status= +table, bare of its code marks. Empty when the request names no field or the +document states none. + +*** created +:PROPERTIES: +:cpp_type: std::string +:END: + +The document's =#+created:=, which a list shows as the page's age. Empty +when the page states none. + +*** found_by +:PROPERTIES: +:cpp_type: std::string +:END: + +The value the requested =found_by_field= holds in the document's =* Status= +table, bare of its code marks. Empty when the request names no field or the +document states none. + +*** answered +:PROPERTIES: +:cpp_type: bool +:END: + +Whether the document has a section under the requested =answered_heading= +with text in it, as a report's =* Response= is. False when the request names +no heading or the section is absent or empty. + ** list_documents_request :PROPERTIES: :tool: list_documents @@ -543,6 +594,37 @@ The most documents to answer, at most 100; a larger limit is refused as How many documents to skip, for the next page. +*** owner_field +:PROPERTIES: +:cpp_type: std::optional +:http_in: query +:END: + +A =* Status= field whose value each summary carries as =owner=, such as the +field that names the environment a report belongs to. A name of letters, +digits, spaces, =_= and =-=; any other is refused. Reading it scans each +document's source at query time; a column filled at sync would replace it. + +*** found_by_field +:PROPERTIES: +:cpp_type: std::optional +:http_in: query +:END: + +A =* Status= field whose value each summary carries as =found_by=, such as +the field that names the environment that found the break. Validated and +read as =owner_field= is. + +*** answered_heading +:PROPERTIES: +:cpp_type: std::optional +:http_in: query +:END: + +A heading whose section, when it holds text, makes =answered= true, such as +a report's =Response=. Validated and read as =owner_field= is. + + ** list_documents_response *** documents diff --git a/projects/compass.http/src/query/reads.cpp b/projects/compass.http/src/query/reads.cpp index c8e3b8ef..4bc5b919 100644 --- a/projects/compass.http/src/query/reads.cpp +++ b/projects/compass.http/src/query/reads.cpp @@ -45,13 +45,57 @@ using db::io::result; using db::query::statement; /// The columns of a document_summary of a document d at a placement p. -constexpr std::string_view summary_columns = - "coalesce(d.org_id, ''), coalesce(d.title, ''), coalesce(d.type, ''), " - "coalesce(d.description, ''), p.path, array_to_string(d.tags, E'\\x1f'), " - "coalesce(d.updated, ''), " - "coalesce(left(btrim(regexp_replace((SELECT s.text FROM corpus.section s " - "WHERE s.hash = d.hash AND s.text <> '' ORDER BY s.ord LIMIT 1), " - "'\\[\\[[^]]*\\]\\[([^]]*)\\]\\]', '\\1', 'g')), 320), '')"; +/** + * @brief Whether @p field can be read as a Status field: letters, digits, + * spaces, underscores and dashes. Nothing that a regular expression reads + * specially, because the field names the expression. + */ +bool safe_field(std::string_view field) { + if (field.empty() || !(std::isalpha(static_cast(field[0])))) + return false; + return std::ranges::all_of(field, [](char c) { + const auto u = static_cast(c); + return std::isalnum(u) || c == ' ' || c == '_' || c == '-'; + }); +} + +/// The columns of a document_summary of a document d at a placement p, with +/// the values the requested Status fields hold and whether the requested +/// heading answers, at the end. +std::string summary_columns(std::string_view owner_field, + std::string_view found_by_field, std::string_view answered_heading) { + std::string out = + "coalesce(d.org_id, ''), coalesce(d.title, ''), coalesce(d.type, ''), " + "coalesce(d.description, ''), p.path, array_to_string(d.tags, E'\\x1f'), " + "coalesce(d.updated, ''), " + "coalesce(left(btrim(regexp_replace((SELECT s.text FROM corpus.section s " + "WHERE s.hash = d.hash AND s.text <> '' ORDER BY s.ord LIMIT 1), " + "'\\[\\[[^]]*\\]\\[([^]]*)\\]\\]', '\\1', 'g')), 320), ''), " + "coalesce(d.state, ''), " + "coalesce(substring(p.path from '(sprint_[0-9]+)'), ''), "; + if (safe_field(owner_field)) + out += "coalesce(trim(both ' `' from substring(d.source from " + "'\\| *" + std::string(owner_field) + + " *\\| *([^|\\n]*)')), '')"; + else + out += "''"; + out += ", coalesce(d.created, ''), "; + if (safe_field(found_by_field)) + out += "coalesce(trim(both ' `' from substring(d.source from " + "'\\| *" + std::string(found_by_field) + + " *\\| *([^|\\n]*)')), '')"; + else + out += "''"; + out += ", "; + if (safe_field(answered_heading)) + out += "EXISTS (SELECT 1 FROM corpus.heading h JOIN corpus.section s " + "ON s.hash = h.hash AND s.heading_ord = h.ord AND s.text <> '' " + "WHERE h.hash = d.hash AND lower(h.title) = lower('" + + std::string(answered_heading) + "'))"; + else + out += "false"; + return out; +} std::vector split_units(std::string_view joined) { std::vector out; @@ -77,6 +121,12 @@ messages::document_summary summary_at(const result& r, std::size_t row, std::siz s.tags = split_units(r.value(row, first + 5)); s.updated = r.value(row, first + 6); s.excerpt = r.value(row, first + 7); + s.state = r.value(row, first + 8); + s.sprint = r.value(row, first + 9); + s.owner = r.value(row, first + 10); + s.created = r.value(row, first + 11); + s.found_by = r.value(row, first + 12); + s.answered = r.value(row, first + 13) == "t"; return s; } @@ -434,7 +484,8 @@ messages::list_documents_response list_documents(db::io::connection& c, const messages::list_documents_request& r) { const auto e = db::query::find_environment(c, r.environment); statement s; - s.sql = "WITH listed AS (\nSELECT " + std::string(summary_columns) + + s.sql = "WITH listed AS (\nSELECT " + summary_columns(r.owner_field.value_or(""), + r.found_by_field.value_or(""), r.answered_heading.value_or("")) + "\nFROM corpus.placement p JOIN corpus.document d ON d.hash = p.hash\n"; db::query::where_documents(s, e.id, v, to_db(r.filter)); s.sql += ")\nSELECT (SELECT count(*) FROM listed), listed.* FROM listed\n" @@ -462,7 +513,7 @@ std::optional read_document(db::io::connection& c, const messages::get_document_request& r) { const auto e = db::query::find_environment(c, r.environment); statement s; - s.sql = "SELECT " + std::string(summary_columns) + ", d.source, encode(d.hash, 'hex')\n" + s.sql = "SELECT " + summary_columns({}, {}, {}) + ", d.source, encode(d.hash, 'hex')\n" "FROM corpus.placement p JOIN corpus.document d ON d.hash = p.hash\n"; db::query::where_documents(s, e.id, v, {}); s.sql += " AND d.org_id = " + s.bind(r.id) + "\nORDER BY p.path LIMIT 1"; @@ -471,8 +522,8 @@ std::optional read_document(db::io::connection& c, return std::nullopt; document_source out; out.summary = summary_at(found, 0, 0); - out.source = found.value(0, 8); - out.hash = found.value(0, 9); + out.source = found.value(0, 14); + out.hash = found.value(0, 15); out.synced_at = e.synced_at; out.environment_id = e.id; @@ -601,7 +652,7 @@ std::optional backlinks(db::io::connection& c, return std::nullopt; statement s; - s.sql = "SELECT " + std::string(summary_columns) + ", coalesce(h.anchor, ''),\n" + s.sql = "SELECT " + summary_columns({}, {}, {}) + ", coalesce(h.anchor, ''),\n" " CASE WHEN l.text <> '' THEN l.text ELSE l.path END,\n" " encode(l.hash, 'hex'), l.ord, coalesce(l.heading_ord, -1), l.path\n" "FROM corpus.link l\n" @@ -615,7 +666,7 @@ std::optional backlinks(db::io::connection& c, statement holders; std::unordered_set hashes; for (std::size_t row = 0; row < rows.rows(); ++row) - hashes.emplace(rows.value(row, 10)); + hashes.emplace(rows.value(row, 16)); std::string in; for (const auto& hash : hashes) in += (in.empty() ? "decode(" : ", decode(") + holders.bind(hash) + ", 'hex')"; @@ -643,22 +694,22 @@ std::optional backlinks(db::io::connection& c, for (std::size_t row = 0; row < rows.rows(); ++row) { messages::backlink b; b.document = summary_at(rows, row, 0); - b.anchor = rows.value(row, 8); - b.text = rows.value(row, 9); - const std::string hash(rows.value(row, 10)); + b.anchor = rows.value(row, 14); + b.text = rows.value(row, 15); + const std::string hash(rows.value(row, 16)); if (hash != parsed) { parsed = hash; source = sources[hash]; tables = {}; compass::ingest::org::parse(source, tables); } - const auto heading = to_number(rows.value(row, 12)); + const auto heading = to_number(rows.value(row, 18)); if (heading >= 0) b.headings = heading_path(outlines[hash], static_cast(heading)); const auto t = ot::view(tables); - const auto ord = to_number(rows.value(row, 11)); + const auto ord = to_number(rows.value(row, 17)); if (ord < t.links.size() && - t.links.paths[ot::link_id{ord}].of(source) == rows.value(row, 13)) + t.links.paths[ot::link_id{ord}].of(source) == rows.value(row, 19)) b.excerpt = excerpt_of(source, t, link_range(t, ot::link_id{ord})); out.backlinks.push_back(std::move(b)); } diff --git a/projects/compass.http/src/routes/document_queries_routes.cpp b/projects/compass.http/src/routes/document_queries_routes.cpp index c562bacd..865edb96 100644 --- a/projects/compass.http/src/routes/document_queries_routes.cpp +++ b/projects/compass.http/src/routes/document_queries_routes.cpp @@ -150,6 +150,9 @@ compass::http::messages::list_documents_request bind_list_documents(const domain b.query("property", r.filter.properties, false); b.query("limit", r.limit, false); b.query("offset", r.offset, false); + b.query("owner_field", r.owner_field, false); + b.query("found_by_field", r.found_by_field, false); + b.query("answered_heading", r.answered_heading, false); b.finish(); return r; } @@ -172,6 +175,9 @@ void add_list_documents(net::router& r, list_documents_handler h) { .query_array("property", "string", false, "Only documents whose top-level property holds the value, each written NAME:value and split at the first colon.") .query_param("limit", "integer", "", false, "The most documents to answer, at most 100; a larger limit is refused as invalid.") .query_param("offset", "integer", "", false, "How many documents to skip, for the next page.") + .query_param("owner_field", "string", "", false, "A * Status field whose value each summary carries as owner, such as the field that names the environment a report belongs to. A name of letters, digits, spaces, _ and -; any other is refused. Reading it scans each document's source at query time; a column filled at sync would replace it.") + .query_param("found_by_field", "string", "", false, "A * Status field whose value each summary carries as found_by, such as the field that names the environment that found the break. Validated and read as owner_field is.") + .query_param("answered_heading", "string", "", false, "A heading whose section, when it holds text, makes answered true, such as a report's Response. Validated and read as owner_field is.") .input() .response() .tool_call([h](const domain::caller& c, std::string_view arguments) { diff --git a/projects/compass.http/tests/query_reads_tests.cpp b/projects/compass.http/tests/query_reads_tests.cpp index 602ed48b..4661e691 100644 --- a/projects/compass.http/tests/query_reads_tests.cpp +++ b/projects/compass.http/tests/query_reads_tests.cpp @@ -125,7 +125,7 @@ const corpus& seeded() { "#+filetags: :howto:\n")); add(page("SPRINT-1", "sprint", "Sprint 1", "user", "This page documents a sprint.\n\n* Status\n\n| Field | Value |\n" - "|-------+-------|\n| State | STARTED |", + "|-------+-------|\n| State | STARTED |\n| Owner | brave_hopper |\n| Found by | solid_dirac |", "#+created: 2026-11-01\n")); std::vector placed; for (std::size_t i = 0; i < documents.size(); ++i) @@ -494,6 +494,33 @@ TEST_CASE("documents lists the pages the view sees, filtered and paged", "[serve CHECK_THAT(past.body, ContainsSubstring("\"documents\":[]")); } +TEST_CASE("documents carries a Status field's value only when the request names " + "it, and only for a name it can read", "[serve][query]") { + const auto& data = seeded(); + reads r(data); + const auto owner = r.get("/v1/main/documents?type=sprint&owner_field=Owner"); + CHECK_THAT(owner.body, ContainsSubstring("\"owner\":\"brave_hopper\"")); + CHECK_THAT(owner.body, ContainsSubstring("\"state\":\"STARTED\"")); + + const auto none = r.get("/v1/main/documents?type=sprint"); + CHECK_THAT(none.body, ContainsSubstring("\"owner\":\"\"")); + + const auto unsafe = r.get("/v1/main/documents?type=sprint&owner_field=Owner%29"); + CHECK_THAT(unsafe.body, ContainsSubstring("\"owner\":\"\"")); + + const auto found = r.get( + "/v1/main/documents?type=sprint&found_by_field=Found%20by"); + CHECK_THAT(found.body, ContainsSubstring("\"found_by\":\"solid_dirac\"")); + + const auto answered = r.get( + "/v1/main/documents?type=sprint&answered_heading=Status"); + CHECK_THAT(answered.body, ContainsSubstring("\"answered\":true")); + + const auto silent = r.get( + "/v1/main/documents?type=sprint&answered_heading=Nowhere"); + CHECK_THAT(silent.body, ContainsSubstring("\"answered\":false")); +} + TEST_CASE("document answers a page's org source, never HTML, and only in a view that " "sees it", "[serve][query]") { const auto& data = seeded(); diff --git a/projects/compass.web/packages/pages/src/BlamesScreen.tsx b/projects/compass.web/packages/pages/src/BlamesScreen.tsx new file mode 100644 index 00000000..c232aa76 --- /dev/null +++ b/projects/compass.web/packages/pages/src/BlamesScreen.tsx @@ -0,0 +1,336 @@ +/** -*- mode: typescript-ts-mode; tab-width: 4; indent-tabs-mode: nil -*- + * + * Copyright (C) 2026 Marco Craveiro + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +import { keepPreviousData, useQuery } from '@tanstack/react-query'; +import type { ReactNode } from 'react'; +import { Link, useSearchParams } from 'react-router'; +import type { DocumentSummary } from './client.js'; +import { retryable } from './client.js'; +import { useCompass } from './context.js'; +import { useTranslation } from './i18n/Provider.js'; + +/** The reports a project keeps open, by the type its pages carry. */ +export const BLAME_TYPE = 'blame_report'; +const OWNER_FIELD = 'Owner'; +const FOUND_BY_FIELD = 'Found by'; +const ANSWERED_HEADING = 'Response'; +const LIMIT = 100; +/** A page is closed when its State is one a lifecycle ends in. */ +const CLOSED = new Set(['DONE', 'ABANDONED']); +const closed = (state: string): boolean => CLOSED.has(state.toUpperCase()); +const VIEWS = ['sprint', 'outstanding', 'analysis'] as const; +type View = (typeof VIEWS)[number]; + +function ageOf(d: DocumentSummary): number | null { + const at = Date.parse(d.created); + if (Number.isNaN(at)) return null; + return Math.max(0, Math.floor((Date.now() - at) / 86_400_000)); +} + +function Tiles({ reports }: { readonly reports: readonly DocumentSummary[] }): ReactNode { + const { t } = useTranslation(); + const open = reports.filter((d) => !closed(d.state)).length; + const tiles = [ + { key: 'total', value: reports.length }, + { key: 'open', value: open }, + { key: 'addressed', value: reports.length - open }, + { key: 'unowned', value: reports.filter((d) => d.owner === '').length }, + ]; + return ( +
+ {tiles.map((tile) => ( +
+
+ {tile.value} +
+
{t(`blames.tiles.${tile.key}`)}
+
+ ))} +
+ ); +} + +function Bars({ entries }: { readonly entries: readonly (readonly [string, number])[] }): ReactNode { + const top = Math.max(...entries.map(([, n]) => n), 1); + return ( +
    + {entries.map(([label, n]) => ( +
  • + {label} + + + + {n} +
  • + ))} +
+ ); +} + +/** + * The reports a project keeps open: their state, owner and sprint, the open + * ones first, each opening in the document view by its :ID:. The address + * names the view, the type and the state filter. + */ +export function BlamesScreen({ environment }: { readonly environment: string }): ReactNode { + const { t, plural } = useTranslation(); + const { inputs, client } = useCompass(); + const [params] = useSearchParams(); + const type = params.get('type') ?? BLAME_TYPE; + const state = params.get('state') ?? 'open'; + const wanted = params.get('view') ?? 'sprint'; + const view: View = (VIEWS as readonly string[]).includes(wanted) ? (wanted as View) : 'sprint'; + const reports = useQuery({ + queryKey: ['compass', inputs.httpBase, 'documents', environment, { type, state, limit: LIMIT }], + queryFn: ({ signal }) => + client.documents( + { + environment, + type, + owner_field: OWNER_FIELD, + found_by_field: FOUND_BY_FIELD, + answered_heading: ANSWERED_HEADING, + limit: LIMIT, + offset: 0, + }, + signal, + ), + placeholderData: keepPreviousData, + retry: retryable, + }); + const all = reports.data?.documents ?? []; + const open = all.filter((d) => !closed(d.state)); + const visible = state === 'all' ? all : state === 'addressed' ? all.filter((d) => closed(d.state)) : open; + const href = (next: { readonly state?: string; readonly view?: string }) => { + const out = new URLSearchParams(); + out.set('type', type); + out.set('state', next.state ?? state); + out.set('view', next.view ?? view); + return { search: `?${out.toString()}` }; + }; + + if (reports.isPending) { + return

{t('blames.loading')}

; + } + if (reports.isError) { + return

{t('blames.failed', { reason: reports.error.message })}

; + } + + const sprints = new Map(); + for (const d of visible) { + const list = sprints.get(d.sprint) ?? []; + list.push(d); + sprints.set(d.sprint, list); + } + const ordered = [...sprints.entries()].sort((a, b) => b[0].localeCompare(a[0], 'en', { numeric: true })); + const owners = new Map(); + for (const d of [...open].sort((a, b) => (ageOf(b) ?? 0) - (ageOf(a) ?? 0))) { + const owner = d.owner === '' ? t('blames.noOwner') : d.owner; + const list = owners.get(owner) ?? []; + list.push(d); + owners.set(owner, list); + } + const ownerLoad = [...all.reduce((m, d) => { + const key = d.owner === '' ? t('blames.noOwner') : d.owner; + m.set(key, (m.get(key) ?? 0) + 1); + return m; + }, new Map())].sort((a, b) => b[1] - a[1]); + const filed = [...all.reduce((m, d) => { + const day = d.created === '' ? '?' : d.created; + m.set(day, (m.get(day) ?? 0) + 1); + return m; + }, new Map())].sort((a, b) => a[0].localeCompare(b[0])); + + return ( +
+ + + + {view === 'sprint' ? ( +
+
+ {(['open', 'addressed', 'all'] as const).map((key) => ( + + {t(`blames.filter.${key}`)} + + ))} + + {plural('blames.count', visible.length)} + +
+ {visible.length === 0 ? ( +

+ {t('blames.empty')} +

+ ) : ( +
+ {ordered.map(([sprint, rows]) => ( +
+

+ {sprint === '' ? t('blames.noSprint') : sprint.replace(/_/g, ' ')} + {rows.length} +

+
    + {rows.map((d) => ( + + ))} +
+
+ ))} +
+ )} +
+ ) : view === 'outstanding' ? ( + open.length === 0 ? ( +

+ {t('blames.outstanding.empty')} +

+ ) : ( +
+ {[...owners.entries()].map(([owner, rows]) => ( +
+

+ {owner} + {rows.length} +

+
    + {rows.map((d) => ( + + ))} +
+
+ ))} +
+ ) + ) : ( +
+
+

+ {t('blames.analysis.owners')} +

+ +
+
+

+ {t('blames.analysis.states')} +

+ +
+
+

+ {t('blames.analysis.filed')} +

+ +
+
+ )} +
+ ); +} + +function ReportRow({ + environment, + report: d, +}: { + readonly environment: string; + readonly report: DocumentSummary; +}): ReactNode { + const { t } = useTranslation(); + const { inputs } = useCompass(); + const age = ageOf(d); + return ( +
  • +
    + + {d.state === '' ? '—' : d.state} + + {d.org_id === '' ? ( + {d.title} + ) : ( + + {d.title} + + )} + {d.owner === '' ? null : ( + + {t('blames.owner', { owner: d.owner })} + + )} + {d.found_by === '' ? null : ( + + {t('blames.foundBy', { name: d.found_by })} + + )} + {age === null ? null : {t('blames.age', { days: age })}} + + {d.answered ? t('blames.answered') : t('blames.awaiting')} + +
    +
    {d.path}
    + {d.excerpt === '' ? null : ( +

    {d.excerpt}

    + )} +
  • + ); +} diff --git a/projects/compass.web/packages/pages/src/DocumentScreen.tsx b/projects/compass.web/packages/pages/src/DocumentScreen.tsx index 578be282..ca2c5992 100644 --- a/projects/compass.web/packages/pages/src/DocumentScreen.tsx +++ b/projects/compass.web/packages/pages/src/DocumentScreen.tsx @@ -716,6 +716,12 @@ export function OrgFragment({ tags: [], updated: '', excerpt: '', + state: '', + sprint: '', + owner: '', + created: '', + found_by: '', + answered: false, }, body: org, anchors: [], diff --git a/projects/compass.web/packages/pages/src/blames.test.tsx b/projects/compass.web/packages/pages/src/blames.test.tsx new file mode 100644 index 00000000..5cb1514f --- /dev/null +++ b/projects/compass.web/packages/pages/src/blames.test.tsx @@ -0,0 +1,129 @@ +/** -*- mode: typescript-ts-mode; tab-width: 4; indent-tabs-mode: nil -*- + * + * Copyright (C) 2026 Marco Craveiro + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation; either version 3 of the License, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; +import { renderToStaticMarkup } from 'react-dom/server'; +import { createMemoryRouter, RouterProvider } from 'react-router'; +import { describe, expect, it } from 'vitest'; +import type { CompassInputs } from './context.js'; +import { CompassPagesProvider } from './context.js'; +import type { Environment } from './environments.js'; +import { environmentsKey } from './environments.js'; +import { compassRoutes } from './pages.js'; + +const inputs: CompassInputs = { + httpBase: '/', + linkTo: (place) => + 'document' in place ? `/${place.environment}/docs/${place.document}` : `/${place.environment}/${place.screen ?? ''}`, + onDenied: () => undefined, +}; + +const environments: Environment[] = [ + { name: 'compass', kind: 'worktree', synced_at: '2026-12-05T09:00:00Z', documents: 3 }, +]; + +const report = (id: string, title: string, state: string, sprint: string, path: string) => ({ + org_id: id, + title, + type: 'blame_report', + description: '', + path, + tags: [], + updated: '2026-12-05', + excerpt: 'The suite asserts the old route.', + state, + sprint, + owner: id === 'B1' ? 'eager_maxwell' : 'solid_dirac', + created: '2026-11-29', + found_by: id === 'B2' ? 'bright_faraday' : 'brave_hopper', + answered: id !== 'B0', +}); + +const documents = { + documents: [report('B1', 'Blame: the first', 'STARTED', 'sprint_31', 'doc/sprint_31/blame/a.org'), + report('B2', 'Blame: the second', 'DONE', 'sprint_31', 'doc/sprint_31/blame/b.org'), + report('B0', 'Blame: the earlier', 'STARTED', 'sprint_30', 'doc/sprint_30/blame/c.org')], + total: 3, + synced_at: '2026-12-05T09:00:00Z', +}; + +function draw(address: string, state: string): string { + const queries = new QueryClient(); + queries.setQueryData(environmentsKey(inputs.httpBase), environments); + queries.setQueryData( + ['compass', '/', 'documents', 'compass', { type: 'blame_report', state, limit: 100 }], + documents, + ); + const router = createMemoryRouter(compassRoutes(), { initialEntries: [address] }); + return renderToStaticMarkup( + + + + + , + ); +} + +describe('the blames screen', () => { + it('puts the counts first, then the three views', () => { + const html = draw('/compass/blames?state=all', 'all'); + expect(html).toContain('data-testid="blames-tile-total"'); + expect(html).toMatch(/data-testid="blames-tile-total"[^>]*>\s*3\s*]*>\s*2\s*]*>\s*1\s* { + const html = draw('/compass/blames?state=all', 'all'); + expect(html).toContain('sprint 31'); + expect(html).toContain('sprint 30'); + expect(html.indexOf('sprint 31')).toBeLessThan(html.indexOf('sprint 30')); + expect(html).toMatch(/href="\/compass\/docs\/B1"[^>]*>Blame: the first<\/a>/); + expect(html).toContain('3 reports'); + expect(html).toContain('owner eager_maxwell'); + expect(html).toContain('found by brave_hopper'); + expect(html).toContain('no response'); + }); + + it('shows only the open reports until the filter says otherwise', () => { + const html = draw('/compass/blames', 'open'); + expect(html).toContain('Blame: the first'); + expect(html).toContain('Blame: the earlier'); + expect(html).not.toContain('Blame: the second'); + expect(html).toContain('2 reports'); + expect(html).toContain('state=all&view=sprint'); + }); + + it('groups the outstanding by the owner that owes the answer', () => { + const html = draw('/compass/blames?state=open&view=outstanding', 'open'); + expect(html).toContain('eager_maxwell'); + expect(html).toContain('Blame: the first'); + expect(html).not.toContain('Blame: the second'); + }); + + it('counts the loads and the states in the analysis view', () => { + const html = draw('/compass/blames?state=all&view=analysis', 'all'); + expect(html).toContain('data-testid="blames-analysis"'); + expect(html).toContain('Who owes what'); + expect(html).toContain('Filed by day'); + }); +}); diff --git a/projects/compass.web/packages/pages/src/client.ts b/projects/compass.web/packages/pages/src/client.ts index ec8b75c2..df1eaf98 100644 --- a/projects/compass.web/packages/pages/src/client.ts +++ b/projects/compass.web/packages/pages/src/client.ts @@ -94,6 +94,12 @@ export const documentSummarySchema = z.object({ tags: z.array(z.string()), updated: z.string(), excerpt: z.string(), + state: z.string(), + sprint: z.string(), + owner: z.string(), + created: z.string(), + found_by: z.string(), + answered: z.boolean(), }); /** The document a link opens, as compass.http resolved it under the caller's view. */ @@ -828,6 +834,9 @@ export interface CompassClient { query: { readonly environment: string; readonly type?: string; + readonly owner_field?: string; + readonly found_by_field?: string; + readonly answered_heading?: string; readonly limit: number; readonly offset: number; }, @@ -1151,6 +1160,15 @@ export function createClient( if (query.type !== undefined) { params.set('type', query.type); } + if (query.owner_field !== undefined) { + params.set('owner_field', query.owner_field); + } + if (query.found_by_field !== undefined) { + params.set('found_by_field', query.found_by_field); + } + if (query.answered_heading !== undefined) { + params.set('answered_heading', query.answered_heading); + } params.set('limit', String(query.limit)); params.set('offset', String(query.offset)); return read( diff --git a/projects/compass.web/packages/pages/src/i18n/en.ts b/projects/compass.web/packages/pages/src/i18n/en.ts index 8010b899..25def01b 100644 --- a/projects/compass.web/packages/pages/src/i18n/en.ts +++ b/projects/compass.web/packages/pages/src/i18n/en.ts @@ -113,6 +113,23 @@ export const en: Catalogue = { count: { one: '{count} document, by path', other: '{count} documents, by path' }, pages: 'Pages of documents', }, + blames: { + loading: 'Reading the reports…', + failed: 'compass.http did not answer the reports: {reason}', + count: { one: '{count} report', other: '{count} reports' }, + filter: { all: 'All', open: 'Open', addressed: 'Addressed' }, + empty: 'No report matches this filter.', + noSprint: 'No sprint', + views: { label: 'Views', sprint: 'By sprint', outstanding: 'Outstanding', analysis: 'Analysis' }, + tiles: { total: 'reports', open: 'still open', addressed: 'addressed', unowned: 'with no owner named' }, + outstanding: { empty: 'Nothing outstanding.' }, + analysis: { owners: 'Who owes what', states: 'Open and addressed', filed: 'Filed by day' }, + owner: 'owner {owner}', + age: '{days}d old', + noOwner: 'no owner', foundBy: 'found by {name}', + answered: 'answered', + awaiting: 'no response', + }, document: { loading: 'Reading the document…', failed: 'compass.http did not answer the document: {reason}', @@ -543,6 +560,10 @@ export const en: Catalogue = { title: 'Documents', task: 'Read a document in the browser', what: 'the document view: its metadata, its org rendered in the browser, its links, anchors, images and backlinks', + }, blames: { + title: 'Blames', + task: 'Serve the open blame reports', + what: 'the reports a project keeps open, by sprint, the open ones first, each opening in the document view', }, sprint: { title: 'Sprint', diff --git a/projects/compass.web/packages/pages/src/i18n/fr.ts b/projects/compass.web/packages/pages/src/i18n/fr.ts index 04ccb575..bf39d3c0 100644 --- a/projects/compass.web/packages/pages/src/i18n/fr.ts +++ b/projects/compass.web/packages/pages/src/i18n/fr.ts @@ -111,6 +111,23 @@ const fr: Catalogue = { count: { one: '{count} document, par chemin', other: '{count} documents, par chemin' }, pages: 'Pages de documents', }, + blames: { + loading: 'Lecture des rapports…', + failed: 'compass.http n\'a pas répondu aux rapports : {reason}', + count: { one: '{count} rapport', other: '{count} rapports' }, + filter: { all: 'Tous', open: 'Ouverts', addressed: 'Traités' }, + empty: 'Aucun rapport ne correspond à ce filtre.', + noSprint: 'Sans sprint', + views: { label: 'Vues', sprint: 'Par sprint', outstanding: 'En cours', analysis: 'Analyse' }, + tiles: { total: 'rapports', open: 'encore ouverts', addressed: 'traités', unowned: 'sans propriétaire' }, + outstanding: { empty: 'Rien en cours.' }, + analysis: { owners: 'Qui doit quoi', states: 'Ouverts et traités', filed: 'Déposés par jour' }, + owner: 'propriétaire {owner}', + age: '{days} j', + noOwner: 'sans propriétaire', foundBy: 'trouvé par {name}', + answered: 'répondu', + awaiting: 'sans réponse', + }, document: { loading: 'Lecture du document…', failed: "compass.http n'a pas répondu avec le document : {reason}", @@ -557,6 +574,10 @@ const fr: Catalogue = { title: 'Documents', task: 'Read a document in the browser', what: 'la vue du document : ses métadonnées, son org rendu dans le navigateur, ses liens, ancres, images et rétroliens', + }, blames: { + title: 'Blâmes', + task: 'Serve the open blame reports', + what: 'les rapports qu\'un projet garde ouverts, par sprint, les ouverts d\'abord, chacun s\'ouvrant dans la vue document', }, sprint: { title: 'Sprint', diff --git a/projects/compass.web/packages/pages/src/i18n/pt.ts b/projects/compass.web/packages/pages/src/i18n/pt.ts index e35a5f55..29eeda13 100644 --- a/projects/compass.web/packages/pages/src/i18n/pt.ts +++ b/projects/compass.web/packages/pages/src/i18n/pt.ts @@ -111,6 +111,23 @@ const pt: Catalogue = { count: { one: '{count} documento, por caminho', other: '{count} documentos, por caminho' }, pages: 'Páginas de documentos', }, + blames: { + loading: 'A ler os relatórios…', + failed: 'compass.http não respondeu aos relatórios: {reason}', + count: { one: '{count} relatório', other: '{count} relatórios' }, + filter: { all: 'Todos', open: 'Abertos', addressed: 'Tratados' }, + empty: 'Nenhum relatório corresponde a este filtro.', + noSprint: 'Sem sprint', + views: { label: 'Vistas', sprint: 'Por sprint', outstanding: 'Em curso', analysis: 'Análise' }, + tiles: { total: 'relatórios', open: 'ainda abertos', addressed: 'tratados', unowned: 'sem dono' }, + outstanding: { empty: 'Nada em curso.' }, + analysis: { owners: 'Quem deve o quê', states: 'Abertos e tratados', filed: 'Registados por dia' }, + owner: 'dono {owner}', + age: '{days} d', + noOwner: 'sem dono', foundBy: 'encontrado por {name}', + answered: 'respondido', + awaiting: 'sem resposta', + }, document: { loading: 'A ler o documento…', failed: 'O compass.http não respondeu com o documento: {reason}', @@ -552,6 +569,10 @@ const pt: Catalogue = { title: 'Documentos', task: 'Read a document in the browser', what: 'a vista do documento: os seus metadados, o seu org desenhado no browser, as suas ligações, âncoras, imagens e ligações de entrada', + }, blames: { + title: 'Acusações', + task: 'Serve the open blame reports', + what: 'os relatórios que um projeto mantém abertos, por sprint, os abertos primeiro, cada um a abrir na vista do documento', }, sprint: { title: 'Sprint', diff --git a/projects/compass.web/packages/pages/src/screens.tsx b/projects/compass.web/packages/pages/src/screens.tsx index 4fd1af9c..c25703bf 100644 --- a/projects/compass.web/packages/pages/src/screens.tsx +++ b/projects/compass.web/packages/pages/src/screens.tsx @@ -20,6 +20,7 @@ import type { ComponentType, ReactNode } from 'react'; import { AgentScreen } from './AgentPanel.js'; +import { BlamesScreen } from './BlamesScreen.js'; import { DocumentsScreen } from './DocumentsScreen.js'; import { GraphScreen } from './GraphScreen.js'; import { SearchScreen } from './SearchScreen.js'; @@ -27,12 +28,12 @@ import { SprintScreen } from './SprintScreen.js'; import { TestingScreen } from './TestingScreen.js'; /** - * The six screens of compass.web, in the menu's order, as the shell prototype + * The screens of compass.web, in the menu's order, as the shell prototype * signed off. The menu, the routes and the screens' titles all read this * table; a screen's catalogue entries are `screens..title`, `.task` (the * task that builds it) and `.what` (what that task builds). */ -export const SCREEN_KEYS = ['search', 'documents', 'sprint', 'testing', 'graph', 'agent'] as const; +export const SCREEN_KEYS = ['search', 'documents', 'blames', 'sprint', 'testing', 'graph', 'agent'] as const; export type ScreenKey = (typeof SCREEN_KEYS)[number]; @@ -53,6 +54,7 @@ export const SCREEN_PAGES: Readonly< > = { search: SearchScreen, documents: DocumentsScreen, + blames: BlamesScreen, sprint: SprintScreen, testing: TestingScreen, graph: GraphScreen, @@ -76,6 +78,12 @@ const ICON_PATHS: Readonly> = { ), + blames: ( + <> + + + + ), sprint: ( <>