Repository navigation
🐛 fix: dashboard and hub init panics from lookahead in feedback login regexp - #10617
Conversation
regexp.MustCompile at package init used (?=...), which Go's RE2 engine does not support, so pkg/dashboard panicked on load (spoke startup and every dashboard test). Express the no-double-hyphen rule without lookahead and enforce the 39-char cap explicitly; add a table test. Signed-off-by: Andrew 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 |
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
Second commit: |
pkg/hub/feedback.go carried the identical (?=...) pattern, so the hub binary and every hub test panicked at init too. Same rewrite + length cap + table test. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
There was a problem hiding this comment.
Conclusion: this conflicts with #10612 on the same two lines, and it ships ~830 lines of an unrelated feature that the PR body does not mention. Recommend a maintainer merge #10612 first and ask this PR to shrink to its real delta (or close it). I have not closed anything.
1. Undisclosed scope — src/pkg/dashboard/mcp_knowledge.go (+505) and mcp_knowledge_test.go (+327).
Both were added in commit 8aefe84 alongside the regexp fix. Neither exists on v5, neither is mentioned in the body, and the title says "fix: dashboard init panic". mcp_knowledge.go:15-27 describes an anonymous, unauthenticated POST /mcp/knowledge endpoint gated by HIVE_PUBLIC_KNOWLEDGE (#10615). server.go is not in this diff, so handlePublicKnowledgeMCP is not routed yet — dead code today — but landing a public trust-boundary surface under a one-line bug-fix title means it gets no review. It belongs in its own PR for #10615.
2. Conflict with #10612 (not a duplicate). Both replace feedbackGitHubLoginPattern (src/pkg/dashboard/feedback.go:80) and hubFeedbackGitHubLoginPattern (src/pkg/hub/feedback.go:378) with different regexps, so whichever lands second needs a rebase. The regexp work here is the better of the two: the unbounded (?:-?[A-Za-z0-9])* plus the explicit 39-char cap in githubLoginForMention / hubGitHubLoginForMention correctly rejects a 40-char login, whereas #10612's (?:-?[A-Za-z0-9]){0,38} counts 2-char iterations and accepts a 77-char a-a-a-… login (I ran both against Go's regexp). The new feedback_login_test.go files pin that behaviour.
But #10612 is earlier, also restores the OpenAPI entry and the hermetic promotion test, and is what gets v5 green. So the pragmatic path:
- merge #10612;
- rebase this PR onto it, drop
mcp_knowledge.go/mcp_knowledge_test.go(move them to a #10615 PR), and keep only the length cap + the two tests — or close it if that remainder isn't worth a PR.
Question for a maintainer (one sentence): should #10615's public-knowledge endpoint ever land via a bug-fix PR, or does it need its own review pass?
relative links and anchors resolve fails identically on v5 and both PRs; #10608 addresses it.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Shared CI incident: the red checks on this PR ( 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
… to #10621) Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
…coverage floor Hermetic unit tests (nil client, stub admitters, httptest server, no sleeps) for src/pkg/github/reporter_trust_wait.go so the v5 coverage gate for pkg/github clears its 89% floor again after #10586. Rebuilt cleanly on v5 by the reviewer: the prior branch state had merged unrelated feedback/dashboard work (already landed via #10617) that conflicted with v5 and tripped the webstatic style ratchet. Refs #10586 Closes #10592 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: adjudicator <adjudicator@hive.kubestellar.io>
…al agents (#10621) * 🐛 fix: dashboard init panic from lookahead in feedback login regexp regexp.MustCompile at package init used (?=...), which Go's RE2 engine does not support, so pkg/dashboard panicked on load (spoke startup and every dashboard test). Express the no-double-hyphen rule without lookahead and enforce the 39-char cap explicitly; add a table test. Signed-off-by: Andrew Anderson <andy@clubanderson.com> * changelog: fragment for #10617 Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com> * 🐛 fix: same lookahead regexp panic in pkg/hub feedback login validator pkg/hub/feedback.go carried the identical (?=...) pattern, so the hub binary and every hub test panicked at init too. Same rewrite + length cap + table test. Signed-off-by: Andrew Anderson <andy@clubanderson.com> * changelog: drop duplicate fragment (bot added fixed-10617.md) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * ✨ knowledge: owner-switched read-only public MCP endpoint (#10615) Add POST /mcp/knowledge, a Model Context Protocol endpoint any external agent can use anonymously to read this hive's operational knowledge — but only after the owner sets HIVE_PUBLIC_KNOWLEDGE. Default off (404). Strictly read-only: the surface serves initialize/ping/tools/list and three tools (knowledge_search, knowledge_get, knowledge_export). No code path reaches CreateFact/UpdateFact/DeleteFact or vault mutation. Only operational fact types are projected; ideation/governance types, sources, usage counters and confidence reasoning never leave the hive. Optional HIVE_PUBLIC_KNOWLEDGE_TAGS narrows the projection further. isPublicPath (spoke) and publicExactPaths (hub nginx auth_request) wave the path through only so the handler can run its own fail-closed check. Signed-off-by: Andrew Anderson <andy@clubanderson.com> * 📖 knowledge: document the public knowledge MCP endpoint env-vars, api-reference (+citation refresh), documentation map, a new public-knowledge-mcp.md with Goose/Claude/Copilot client snippets, and the changelog fragment for #10615. Signed-off-by: Andrew Anderson <andy@clubanderson.com> * knowledge: register /mcp/knowledge with a literal so api-reference citations verify Signed-off-by: Andrew Anderson <andy@clubanderson.com> * hub: test that /mcp/knowledge bypasses the SaaS auth_request gate exactly Signed-off-by: Andrew Anderson <andy@clubanderson.com> * changelog: fragment for #10621 Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com> * changelog: drop duplicate fragment (bot added added-10621.md) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * Harden public knowledge MCP: full bodies, type filter, related filtering, MCP 2025-06-18 - knowledge_get/export/search re-read facts by slug so bodies are not the 200-rune store snippets - enforce the type filter after search (vault/git stores ignore it) - over-fetch 10x before the public filter so private facts cannot starve the result window - filter Related down to public slugs - advertise MCP 2025-06-18 and reject JSON-RPC batches with -32600 Signed-off-by: Andrew Anderson <andy@clubanderson.com> * fix: drop public-knowledge MCP files that leaked into this PR (belong to #10621) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * docs: refresh api-reference citations (drifted on v5) Signed-off-by: Andrew Anderson <andy@clubanderson.com> * docs: resolve api-reference merge leftovers Signed-off-by: Andrew Anderson <andy@clubanderson.com> --------- Signed-off-by: Andrew Anderson <andy@clubanderson.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com> Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…coverage floor (#10594) Hermetic unit tests (nil client, stub admitters, httptest server, no sleeps) for src/pkg/github/reporter_trust_wait.go so the v5 coverage gate for pkg/github clears its 89% floor again after #10586. Rebuilt cleanly on v5 by the reviewer: the prior branch state had merged unrelated feedback/dashboard work (already landed via #10617) that conflicted with v5 and tripped the webstatic style ratchet. Refs #10586 Closes #10592 Signed-off-by: adjudicator <adjudicator@hive.kubestellar.io> Co-authored-by: adjudicator <adjudicator@hive.kubestellar.io> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Andy Anderson <andy@clubanderson.com>
Problem
pkg/dashboard/feedback.go(from #10593) declaresGo's RE2 engine has no lookahead, so this panics at package init:
Every
pkg/dashboardtest (and the spoke binary) dies on load.Fix
^[A-Za-z0-9](?:-?[A-Za-z0-9])*(?:\[bot\])?$— same rule (single, non-leading, non-trailing hyphens) without lookahead.githubLoginForMention.TestGithubLoginForMentioncovering accept/reject cases including[bot]suffix and length boundary.Unblocks CI for #10615.