Skip to content

feat(mcp): hydrate GitHub source content - #1

Merged
Novirmor merged 19 commits into
mainfrom
feature/20260709/hydrate-github-source-content
Jul 9, 2026
Merged

feat(mcp): hydrate GitHub source content#1
Novirmor merged 19 commits into
mainfrom
feature/20260709/hydrate-github-source-content

Conversation

@Novirmor

@Novirmor Novirmor commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

Adds on-demand GitHub source-content hydration for Graphify-backed MCP tools, plus a new read_source_content tool for direct source reads.

What Changed

  • Node provenance: store.NodeRow now exposes source_url, captured_at, author, contributor (columns already in schema)
  • Source hydration core (internal/mcp/source_content.go): GitHub URL normalization (blob→raw), bounded HTTP fetch (64 KiB cap, 5s timeout), text detection, snippet window extraction, truncation reporting, structured per-source status envelopes
  • MCP tool enrichment: get_context, query_repo, explain_symbol, and get_file_context accept optional source_content option (modes: off/auto/snippet/full); default responses remain metadata-only
  • New tool: read_source_content (17th MCP tool) for direct source reads by node ID or file path
  • Documentation: docs/tools.md updated for the new tool and hydration option

Design Decisions

  • Opt-in only: existing tool behavior unchanged unless source_content is present
  • No candle-managed auth: uses externally authorized/fetchable GitHub URLs; non-GitHub hosts return unsupported
  • Structured failure: fetch errors, non-text content, and unsupported URLs return SourceContent status envelopes, not tool errors
  • Wrapper results: hydrated responses use wrapper types ({node, source_content}) rather than mutating base rows

Verification

  • 157 tests pass (12 packages, 0 failures)
  • go vet clean
  • golangci-lint clean
  • Full verification report: docs/superpowers/reports/2026-07-09-hydrate-github-source-content-verify.md

Comet Workflow

OpenSpec change: hydrate-github-source-content
Design Doc: docs/superpowers/specs/2026-07-09-hydrate-github-source-content-design.md
Plan: docs/superpowers/plans/2026-07-09-hydrate-github-source-content.md

Known Follow-ups

  • Tool-count references in README.md, AGENTS.md, docs/architecture.md still say 16 (should be 17)
  • Auto-trigger paths have limited dedicated test coverage

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Novirmor and others added 19 commits July 9, 2026 15:47
OpenSpec proposal/design/spec/tasks, Superpowers Design Doc, and
implementation plan for on-demand GitHub source-content hydration.
QueryRepoWithSource truncated the result set to max_candidates when
source_content was enabled, silently dropping structural matches beyond
the limit. Return every matched node instead, hydrating only the first
max_candidates and marking the rest "skipped", matching get_context's
enrichment behavior so opting into source content never hides results.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Novirmor
Novirmor merged commit 135be7e into main Jul 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant