feat(graph): add repository-scoped graph publication - #123
Merged
Merged
Conversation
balcsida
added a commit
that referenced
this pull request
Sep 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
balcsida
force-pushed
the
feat/codegraph/s1-08-publish-policy
branch
from
September 27, 2026 14:02
0d34355 to
f61c105
Compare
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.
Summary
Implements S1.08 of the CodeGraph parity roadmap: repository-scoped graph publication. Stage 2 (the CLI publishing a local CodeGraph index) depends on it. Until now, v2 artifacts could only be stored by tests; the public upload accepted v1 from administrators only.
POST /v1/graph/uploadswithapplication/vnd.graphnest.graph.v2+protobufpublishes a v2 generation for the indexed commit and answers200with the new generation, the one it replaced, and the verified content hash.graph_publication_grants(migration 037) and managed by administrators throughPUT /v1/graph/publication-grants. The route reuses the supply-chain upload-grant handler, which this PR extracts so both routes share it.expected_generation, and replacing another producer (for example the managed scanner) also needsreplace_producer=true. PostgreSQL compares the generation and indexed commit under the repository row lock, so concurrent, stale or advancing-SHA uploads get409and never overwrite the wrong generation.deduplicated: trueinstead of a conflict. It matches on the verified semantic hash, which covers repository, commit and producer. Retired content cannot be reactivated this way.publicationblock: accepted versions, upload limit, whether the caller may publish, and the active generation. Capabilities now list upload versions[1, 2].graph_uploadsrow records the publisher (api_token:<user id>), producer, commit, content hash, and activation and retirement.v1 uploads are unchanged and remain administrator-only. Only the text of their
403message changed.Evidence
test/integration/graph_publication_test.goruns every S1.08 acceptance case against real PostgreSQL and real API tokens:replace_producer=true.Temporarily removing the post-parse recheck made both this test and the service unit tests fail.
Compatibility, schema and security
repositories. It is additive and needs no configuration./mcpand cannot publish.ponytail:ingraphingest.Service.Publish.Verification
Local notes:
make openapi-checkneeds Ruby 2.7 or later; macOS system Ruby 2.6 cannot run it, so I ran it in a container.internal/postgressupply-chain job-claim tests, andmainfails them the same way. The Docker VM clock was about 16 ms behind the host. Those tests enqueue at hosttime.Now()and then immediately claim against the database'snow(), so the job is not yet due. Every graph and publication test passed in both runs.Not in this PR
The CLI (Stage 2), MCP exposure of publication, and the rest of S1.06, S1.07, S1.09 and S1.10. The full Stage 1 gate has not been run, and this PR does not claim it passes.
🤖 Generated with Claude Code