Repository navigation
✨ ask: hive panel and rollout verification for optional Ask AI help - #19206
clubanderson wants to merge 14 commits into
Conversation
Adds the ask config block and HIVE_ASK_* env (off by default, inert when unconfigured, key only from a file under the allowed secret dirs), the pkg/askai service (Kapa Chat API client pinned to the published QueryResponse schema, per-person consent store, credential-shape refusal, source allowlist, plain-text answers, per-person/per-hive/hub-wide limits, circuit breaker, content-free audit lines) and the hub routes GET /api/ask/status, PUT/DELETE /api/ask/consent, POST /api/ask and GET /api/ask/stats. Routes are registered only when the feature is on. Fixes #19180 Signed-off-by: Andy Anderson <andy@clubanderson.com>
…sleep The Kapa Chat request is a model request (machine, reasonModelPrompt) in the new outbound-sites inventory from v5. The in-flight test now waits on a channel instead of polling with time.Sleep, keeping the sleep ratchet. Signed-off-by: Andy Anderson <andy@clubanderson.com>
Lifts pkg/askai over the 90% package floor: bad vendor JSON, an invalid thread id dropped, cancellation, the half-open breaker's single trial, handle eviction, idle-counter pruning, corrupt consent records and the service defaults. Signed-off-by: Andy Anderson <andy@clubanderson.com>
Adds the shared panel component (pkg/askai/web: same-origin script and stylesheet, text-only rendering, consent notice, sources and AI label, docs-link fallback in every state, keyboard and screen-reader support, docked layout) and wires it into the hub dashboard only when Ask is on. With Ask off the dashboard document, its ETag and its headers are unchanged and the assets are not served. Scale controls show the effective switch with a help mark. Fixes #19181 Signed-off-by: Andy Anderson <andy@clubanderson.com> (cherry picked from commit 2fe253f)
Adds the ask block to hive.yaml (vendor ids never serialised to JSON and redacted in the config export), the hive dashboard routes GET /api/ask/status, PUT/DELETE /api/ask/consent and POST /api/ask (404 while off), per-person consent on the hive keyed by dashboard identity, direct mode with the hive's own key, and hub mode through a new POST /api/hub/ask/relay on the hub. The relay authenticates the hive with its per-hive heartbeat bearer, serves hosted hives only in this round, honours a per-hive disable list and an hourly per-hive quota, and binds conversation handles to the hive. Settings, Features gains the Ask switch, mode and section-label toggle. Fixes #19183 Signed-off-by: Andy Anderson <andy@clubanderson.com>
The hive dashboard loads the shared Ask panel component from 'self' only when /api/config reports ask_enabled; the section in view or the open Settings tab labels the question from the closed vocabulary, and the docs link follows it. /ask-panel.js and /ask-panel.css on the hive answer 404 while Ask is off. Adds a vocabulary parity test against the dashboard's section registry, a node test of the panel view model, the self-hosted direct-mode guide and a rollout verification checklist. Fixes #19184 Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
…luded Signed-off-by: Andy Anderson <andy@clubanderson.com>
Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch:
Conflicts are checked with every PR merged onto the current tip of
|
Signed-off-by: Andy Anderson <andy@clubanderson.com>
UI render evidenceRender evidence captured. Built from
These are fixture renders, not live data: the page was built from the PR head and filled with synthetic data from |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. ℹ️ Sentinel: informational, author is trusted (owner), merge is not blocked. Head
No @clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. Review findings from Scope of this review: I read the phase 5 dashboard front end (
|
… does not count them Signed-off-by: Andy Anderson <andy@clubanderson.com>
… in the dashboard ratchet Signed-off-by: Andy Anderson <andy@clubanderson.com>
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Delta re-review (b0828af..8cd49e4). Allowlist entry, config golden ask block and the 68→69 import ratchet are consistent with the new pkg/askai import. The parity-test change is not.
Finding (in-scope, blocks): the delta deletes the GET /ask-panel.js and GET /ask-panel.css entries from routeParityExceptions (src/pkg/dashboard/openapi_route_parity_test.go), but both routes are still registered at src/pkg/dashboard/api.go:87-88. Neither route is in dashboard/openapi.json at this head: grep ask-panel finds nothing, and only /api/ask/status, /api/ask/consent and /api/ask are documented. TestOpenAPISpecCoversEveryRegisteredRoute will therefore report "registered but undocumented: GET /ask-panel.js" and the same for .css. The panel assets are a required part of #19184 item 1, so this red test blocks it.
Fix: either restore the two exceptions removed in the delta, or add /ask-panel.js and /ask-panel.css to dashboard/openapi.json. I recommend restoring the exceptions, because they are static assets and not JSON operations:
var routeParityExceptions = []routeParityException{
+ {
+ method: "GET", path: "/ask-panel.js",
+ reason: "Ask AI help panel script (#19184): a static same-origin asset " +
+ "served only while ask is on, not a JSON data operation.",
+ },
+ {
+ method: "GET", path: "/ask-panel.css",
+ reason: "Ask AI help panel stylesheet (#19184): a static same-origin " +
+ "asset served only while ask is on, not a JSON data operation.",
+ },
{
method: "GET", path: "/api/health",I read the test logic and registrations but did not run the test.
Findings not on a changed line
src/pkg/dashboard/openapi_route_parity_test.go:47: Removing the /ask-panel.js and /ask-panel.css exceptions breaks the parity test: api.go:87-88 still registers both routes and openapi.json does not document them. Restore the exceptions (see summary for the diff) or add spec entries.
-- hive: agent=adjudicator-3 backend=claude model=claude-sonnet-5-5 claude=2.1.327
|
Merge state is dirty (conflicts with v5). This is a human-authored branch, so the scanner will not push to it; please rebase onto v5 (stacked phases may need rebasing in order). 🐝 Hive Agent: |
|
scanner: this PR is CONFLICTING with v5 (stacked Ask AI phases). Human-authored, so deferring: rebase onto v5 once the earlier phase merges. Not pushing to this branch. 🐝 Hive Agent: |
|
hive/scanner: this PR has merge conflicts with v5 (mergeable_state=dirty). It is human-authored, so the hive will not push to it. Please rebase or merge v5 (stacked Ask AI phases usually need rebasing in order). Deferred until the conflict is resolved. 🐝 Hive Agent: |
|
Scanner: this PR is in a conflicting (dirty) state against its base. Not rebasing from here since it is a human-authored branch; please rebase/merge the base and push. Note that #19202, #19204 and #19206 look like a stack, so rebase in order. 🐝 Hive Agent: |
Phase 5 of the Ask AI help design (
src/docs/design/dashboard-ask-ai-help.md): the hive panel, self-hosted direct-mode docs and the live verification checklist. It builds on #19200 (hub backend), #19202 (hub panel and the shared component) and #19204 (hive backend and relay), so until those merge this diff also shows them; merge them first, in that order. The phase 5 changes are the commit "ask: hive panel and rollout verification for optional Ask AI help".Fixes #19184
What it does
pkg/askai/web/ask-panel.jsand.css), served from'self'at/ask-panel.jsand/ask-panel.cssonly while Ask is on (404otherwise)./api/configreportsask_enabled: true(the effective state, including the hosted-only rule for hub mode). With Ask off the page adds nothing and requests nothing for it; there is one empty opener slot in the top bar.DASHBOARD_SECTION_HELP), orsettings/settings-featureswhile the Settings dialog is open. The docs-link fallback follows the same section throughdashboardDocsHref, like every "?" mark.script-src-elem 'self'andstyle-src-elem 'self'.src/docs/ask-ai-help.md): turning it on for a self-hosted hive in direct mode (Secret or read-only mount under/secrets,hive.yamlkeys), using the panel, and a Verifying a rollout checklist.Tests
404with Ask off and served with the right types when on;/api/configreportsask_enabledfrom the effective settings.cfg.ask_enabled === true, loads only same-origin assets, names no third-party host and writes no markup; the dashboard holds exactly one slot and calls the loader from the config bootstrap.sections.js).httpssources survive and name their host, an answer without one becomes "No cited answer", every other outcome is a notice with the backend's message.Live verification (prepared, not run)
Nothing was enabled on the hub or any hive. Once the Kapa API key exists, the operator runs the checklist in
src/docs/ask-ai-help.md#verifying-a-rollout: hub off then on, a cited answer, a refused fake token, withdrawal, one hosted hive in hub mode (audit lines on hub and hive, no question text), one self-hosted hive in direct mode, the empty-key fallback, switching off again, and checking in Kapa analytics that only the question and the section label arrived.