feat(mcp)!: expose atomic actor and contribution tools - #268
Conversation
BREAKING CHANGE: corpus.search_code_batch is now corpus.search_code, corpus.list_pull_requests is now corpus.search_pull_requests, github.sync_ci_failures is now github.sync_pull_request_ci, and prescriptive composite workflow tools are no longer advertised.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c68f7abc3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1a082e9a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8bc7ca5598
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
gitcontribute/internal/corpus/actors.go
Line 315 in 835f4ab
When a delayed profile read for node U1 has an older source_updated_at but finishes after its old login has been reassigned to U2, the actor/profile updates above are correctly rejected, yet this unconditional call ranks alias ownership by the later local observed_at and can deactivate U2's current alias. GetActor(login) then resolves U1 even though its retained current_login may differ. Fresh evidence in the final tree is the source-order guard at lines 305-307 followed by this unguarded alias write; apply the same ordering decision to alias activation.
AGENTS.md reference: AGENTS.md:L28-L29
For relationship="contributed", the GraphQL adapter never selects a watcher count, so every returned github.Repository has Watchers == 0. This full projection upsert can therefore replace a previously hydrated nonzero watcher count whenever the GraphQL repository has a newer UpdatedAt, or the same timestamp with a later observation sequence, corrupting repository health, search, and dossier facts. Include the watcher total in that query or merge the sparse result without replacing fields it did not retrieve.
gitcontribute/internal/github/user_rest.go
Lines 88 to 89 in 835f4ab
When callers request relationship="contributed" together with sort or order, this branch accepts those contract fields but the GraphQL helper neither forwards nor applies them. With max_pages or max_items_per_user truncation, the persisted relationship snapshot can therefore contain a different subset from the requested created/updated/pushed/full-name ordering. Either implement equivalent GraphQL ordering or reject these fields for the contributed mode.
gitcontribute/internal/app/mcp_actor_facets.go
Lines 392 to 393 in 835f4ab
When actors is omitted and the contribution query returns no items, this fallback derives zero coverage actors, leaving coverage nil/empty even if every indexed actor lacks synchronization for the requested period. The caller receives total: 0 without the required unknown-coverage signal and may treat missing data as verified absence; this also makes coverage depend on only the current result page when matches exist. Require explicit actors or return bounded/global coverage that represents actors with no matching items as well.
AGENTS.md reference: AGENTS.md:L5-L6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Description
GitContribute now models GitHub accounts as first-class actors and exposes atomic acquisition and corpus primitives instead of prescriptive landscape and contribution workflows.
The actor corpus keeps stable node-ID identities, observed login aliases, nullable profile facts, independently refreshable facets, and period-scoped contribution data. Live user search records identity stubs only. Exact profile, social-account, organization, pinned-item, repository-relationship, and contribution synchronization remain separate bounded operations. Offline reads return snapshot tokens, explicit observation times, authorization scope, and unknown or truncated coverage without implicit network access.
The GitHub adapter uses the pinned go-github types for REST reads and typed product DTOs at the boundary. GraphQL covers organizations, profile showcase items, contributed repositories, and contribution collections, including GitHub Enterprise endpoint derivation. Complete child sets replace atomically; stale or incomplete observations cannot overwrite a newer complete projection. Contribution search separates global and organization-scoped periods, deduplicates overlapping observations, and binds cursors to every active filter.
Breaking catalog changes
corpus.search_code_batchis nowcorpus.search_code; the old scalar code-search alias is no longer advertised.corpus.list_pull_requestsis nowcorpus.search_pull_requests.github.sync_ci_failuresis nowgithub.sync_pull_request_ci.Migration 014 creates the actor, alias, observation, profile, relationship, contribution, and FTS projections. Existing repository and thread authors are backfilled case-insensitively. The down migration removes only the new actor projections.
Suggested review order
internal/corpus/migrations/014_actor_corpus.sql,internal/corpus/migrations/015_actor_corpus_revision.sql,internal/corpus/actors.go, andinternal/corpus/actor_facets.gointernal/github/client.go,internal/github/user_rest.go, andinternal/github/user_graphql.gointernal/app/mcp_actors.go,internal/app/mcp_actor_facets.go, andinternal/mcpcontract/actor_contracts.gointernal/mcpserver/actors.go, catalog removals, contract tests, and documentationThe branch contains 38 changed files with 4,327 additions and 689 deletions. Most additions are the actor schema, typed adapters, contract implementation, and behavioral tests; most deletions remove retired workflow documentation and catalog expectations.
Testing
make verifypassesmake test-racepasses for storage, concurrency, locking, and cancellation pathsmake docspassesCompatibility and scope