Conversation
Add a pluggable research source interface (internal/research) and a `knowledge research <query>` command that searches, in one pass, the project's knowledge stores, ADR folders in registered repos' code roots, the Hive knowledge export the Hive launcher writes to ~/agent.md, and Context7 library documentation. Each source reports used, skipped or unavailable with a reason, so a standalone run degrades to local knowledge with no error. Spektacular only reads the Hive export and never handles launcher credentials; the optional Context7 key is sent only to context7.com and redirects are refused. The spec interview step now seeds itself from this research, and the findings it draws on are cited in a new `## Research Sources` spec section assembled from research_sources.md, so citations outlive the workflow's working directory. Knowledge ranking exports ScoreHit/CutoffFloor and the store exports DescribeBytes, so ADRs and Hive export entries rank on the same formula and evidence rules as knowledge store hits. Fixes hivecommons#59 Hive-Run: hivecommons#59 Hive-Plan: issue-59 seed spec research with Hive knowledge and Context7 domain docs Hive-Spec: 000061_seed-spec-research#acceptance-criteria Signed-off-by: castrojo <castrojo@users.noreply.github.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 |
A failed docs fetch did not count toward the per-source limit, so a long Context7 result list whose docs all failed triggered one request per result, each up to the 15s timeout. Count attempts instead of findings. Hive-Run: hivecommons#59 Hive-Plan: issue-59 seed spec research with Hive knowledge and Context7 domain docs Hive-Spec: 000061_seed-spec-research#acceptance-criteria Signed-off-by: castrojo <castrojo@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #59
What
internal/researchdefines aSourceinterface and aSeedfunction. Four adapters ship with it:knowledge: the configured knowledge stores, same ranking asknowledge search.adr: Markdown ADRs in each registered repo's code root, underadr/,adrs/,doc/adr/,docs/adr/,docs/adrs/,docs/decisions/,docs/architecture/decisions/orarchitecture/decisions/. The root is resolved throughrepo.Set.LocalSource.hive: the Hive knowledge export thatbin/contributor-agent.shwrites to~/agent.md(# Agent Knowledge,## <type>,### <title>,Tags:). Active under Hive (HIVE_HUBset).context7:GET /api/v2/libs/search, then a bounded/<id>/llms.txt?topic=<query>&tokens=2000per library; the excerpts come from the fetched docs. Active under Hive or whenCONTEXT7_API_KEYis set. The key is optional, as in Hive's owncontext7Get.knowledge research <query> [--limit N].used,skippedorunavailablewith a reason.cite(knowledge:<tier>/<name>/<path>,adr:<repo>/<path>,hive:<section>/<title>,context7:<id>) and areadfield saying how to fetch the full body.research_sources.md.## Research Sourcessection, and step 08 assembles it from that file. Citations therefore survive therm -rf .spektacular/work/<spec>cleanup.knowledge.ScoreHit/CutoffFloorandstore.DescribeBytesare exported so ADR and Hive-export findings use the same formula and evidence rules as store hits.Set.Searchnow callsScoreHit, with no behaviour change.docs/knowledge-base.mdgains a "Seeding spec research" section and a command-table row; changelog record000061_seed-spec-researchis added and CHANGELOG.md updated; the spek-new skill (template plus installed.claude/.bobcopies) mentions the research step.Security choices
/api/knowledge/exportitself and never touchesHIVE_REGISTRATION_TOKEN./api/knowledge/searchneeds dashboard auth, so contributors cannot use it anyway.https://context7.combase, and redirects are refused./-prefixed[A-Za-z0-9/._-]path with no.., or it is dropped.Acceptance criteria
TestHiveSource_CitesRelevantExportEntriesandTestHiveSource_TitleCountsAsEvidence, plus a smoke run withHIVE_HUBset and a fixture~/agent.md:hive used [('hive:Decisions/CLI flags follow cobra conventions', …)]context7 used [('context7:/spf13/cobra', ['By default, Cobra ignores local flags on parent commands…'])]from the live Context7 API.TestSeed_DegradesPerSourceAndKeepsGoing,TestHiveSource_DegradesandTestContext7Source_Degrades. A smoke run withoutHIVE_HUB/CONTEXT7_API_KEYreturnederror: false, exit 0, withknowledgeused andhive/context7skipped with reasons.Verification
go vet ./...passes.go test -shuffle=on ./...passes exceptinternal/autocommitTestIntegration_CommitPushesNothing. That test fails on my host becausegit-upload-packis not installed; it is unrelated to this change.spektacular init claudeproject:spec goto interviewrenders the research instruction and theresearch_sources.mdpath.docs/adr/0001-cobra.mdin the repo code root comes back asadr:<repo>/docs/adr/0001-cobra.md.knowledge:repo/<repo>/decisions/cobra-flags.md.knowledge_query_required.Not in this PR
The registered
docsrepo (spektacular-website) documents configuration and workflows. It may want a page forknowledge researchand the new spec section; that belongs in a separate PR against that repo.— hive: backend=omp
🐝 Hive Agent:
contributor| SHA:84be2b5