feat(mapper): add entity-proto mappers#211
Merged
Merged
Conversation
3 tasks
yushan8
marked this pull request as draft
July 17, 2026 04:11
3 tasks
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
from
July 17, 2026 05:13
9bd4bdf to
d05117c
Compare
yushan8
force-pushed
the
yushan/entity-target-graph
branch
from
July 17, 2026 05:13
4cb3028 to
fba8c52
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
3 times, most recently
from
July 17, 2026 22:57
ecb2996 to
36f3f33
Compare
yushan8
force-pushed
the
yushan/entity-target-graph
branch
from
July 17, 2026 22:57
fba8c52 to
34e6a59
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
4 times, most recently
from
July 20, 2026 02:03
b621c93 to
03833f5
Compare
yushan8
force-pushed
the
yushan/entity-target-graph
branch
2 times, most recently
from
July 20, 2026 03:20
ac6aea4 to
facc62d
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
2 times, most recently
from
July 20, 2026 03:28
8ba38ac to
6fc3266
Compare
yushan8
force-pushed
the
yushan/entity-target-graph
branch
from
July 20, 2026 03:28
facc62d to
ef4db65
Compare
1 task
3 tasks
yushan8
force-pushed
the
yushan/entity-target-graph
branch
from
July 20, 2026 03:42
ef4db65 to
1b416d5
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
2 times, most recently
from
July 20, 2026 03:46
0f5a89c to
5fb83ae
Compare
yushan8
force-pushed
the
yushan/entity-target-graph
branch
from
July 20, 2026 03:46
1b416d5 to
ac18fbe
Compare
yushan8
marked this pull request as ready for review
July 20, 2026 04:43
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
from
July 20, 2026 04:52
5fb83ae to
7f55e85
Compare
yushan8
force-pushed
the
yushan/entity-target-graph
branch
from
July 20, 2026 04:52
ac18fbe to
9789ce1
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
from
July 20, 2026 05:27
7f55e85 to
e762db8
Compare
yushan8
force-pushed
the
yushan/entity-target-graph
branch
from
July 20, 2026 05:27
9789ce1 to
061115e
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
from
July 20, 2026 16:52
e762db8 to
dff47a4
Compare
yushan8
force-pushed
the
yushan/entity-target-graph
branch
from
July 20, 2026 17:16
6b968d3 to
2da7020
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
from
July 20, 2026 17:17
dff47a4 to
9c060bc
Compare
yushan8
added a commit
that referenced
this pull request
Jul 20, 2026
…210) ## Summary - Add `entity.OptimizedTarget`, `entity.Metadata`, and `entity.GetTargetGraphResponse` as compact, proto-free representations of the target graph wire types - Add `entity.ChangedTarget` and `entity.GetChangedTargetsResponse` for the changed-targets path - These entity types mirror the proto definitions but live in a dependency-free package, preventing proto from leaking into storage, orchestrator, and other non-transport layers ## Test plan - [x] `make build && make test && make gazelle` ## Stack 1. **#210 — this PR** (entity types) 2. #211 (mappers + streaming) 3. #222 (storage JSON rewrite) 4. #212 (callsite migration + cleanup) --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 task
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
from
July 20, 2026 18:21
9c060bc to
63d2138
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
from
July 20, 2026 18:41
63d2138 to
7b87081
Compare
yushan8
force-pushed
the
yushan/streaming-split
branch
from
July 20, 2026 19:31
2f87a76 to
eacdca8
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
from
July 20, 2026 19:32
7b87081 to
23bf3ac
Compare
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
2 times, most recently
from
July 20, 2026 22:20
8f360d1 to
15fe2f7
Compare
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…eaming Move SplitTargetGraph from internal/mapper to internal/streaming where the other split functions live. Rename chunk→split for consistency. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Remove protoToOptimizedTarget, protoToMetadata, and round-trip tests that converted back from proto. Replace with direct proto field assertions. Use t.Context() instead of context.Background(). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…kage Move ResultToTargetGraph and idmapper out of internal/ so external consumers (e.g. the internal monorepo compute package) can import them. Proto↔entity conversion helpers remain in internal/mapper. Also fixes trailing newline lint issue in target_graph.go. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
yushan8
force-pushed
the
yushan/streaming-and-mappers
branch
from
July 20, 2026 22:32
15fe2f7 to
814e971
Compare
xytan0056
approved these changes
Jul 20, 2026
yushan8
added a commit
that referenced
this pull request
Jul 21, 2026
## Summary - Adds entity-proto mappers for target graph and changed targets responses - `ResultToTargetGraph` — converts `targethasher.Result` into ID-mapped entity types - `GetTargetGraphResponseToProto` / `ChangedTargetsResponseToProto` — entity→proto conversions for gRPC streaming - `ProtoToGetTargetGraphRequest` — proto→entity request conversion This PR is addresses this comment to split up the Result -> Optimized target entity conversion, and OptimizedTarget -> `GetTargetGraphResponseToProto` #206. These mappers are used to avoid leaking proto definitions into internals such as storage and orchestrator. ## Stack 1. #224 (streaming split utilities) 2. **This PR** (entity-proto mappers) 3. #222 (storage JSON rewrite) 4. #212 (callsite migration) ## Test plan - [x] `make build && make test && make gazelle` --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
yushan8
added a commit
that referenced
this pull request
Jul 21, 2026
## Summary - Adds entity-proto mappers for target graph and changed targets responses - `ResultToTargetGraph` — converts `targethasher.Result` into ID-mapped entity types - `GetTargetGraphResponseToProto` / `ChangedTargetsResponseToProto` — entity→proto conversions for gRPC streaming - `ProtoToGetTargetGraphRequest` — proto→entity request conversion This PR is addresses this comment to split up the Result -> Optimized target entity conversion, and OptimizedTarget -> `GetTargetGraphResponseToProto` #206. These mappers are used to avoid leaking proto definitions into internals such as storage and orchestrator. ## Stack 1. #224 (streaming split utilities) 2. **This PR** (entity-proto mappers) 3. #222 (storage JSON rewrite) 4. #212 (callsite migration) ## Test plan - [x] `make build && make test && make gazelle` --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
yushan8
added a commit
that referenced
this pull request
Jul 22, 2026
…#222) ## Summary Intent: Proto definitions are currently leaking into the storage. We should `Put` the actual entities to be encoded/decoded from the storage, not the proto definitions. - Remove all proto imports from `core/storage/` — serialize entity structs directly via `encoding/json` - Move write functions from reader files into `graphwriter.go` - Controller reads `entity.GetTargetGraphResponse` and `entity.GetChangedTargetsResponse` internally, converting to proto via mapper only at `stream.Send` - Changed-targets pipeline fully migrated to entity types - Orchestrator uses `mapper.ResultToTargetGraph` + `SplitBySize` - Consolidate `service.chunking.*` into a single `max_message_bytes` config field - Remove old chunking code from `core/common` - Update `query-bench` example ## Test plan - [x] `grep -r "tangopb\|gogo/protobuf" core/storage/` returns zero results - [x] `make build && make test` — all 19 test targets pass - [x] `make gazelle` — BUILD files in sync ## Stack 1. #210 (entity types) 2. #211 (mappers + streaming) 3. **#222 — this PR** (storage JSON + callsite migration + cleanup) Ran `integration tests` and `make bench` to make sure storage is compatible with current changes. --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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
ResultToTargetGraph— convertstargethasher.Resultinto ID-mapped entity typesGetTargetGraphResponseToProto/ChangedTargetsResponseToProto— entity→proto conversions for gRPC streamingProtoToGetTargetGraphRequest— proto→entity request conversionThis PR is addresses this comment to split up the Result -> Optimized target entity conversion, and OptimizedTarget ->
GetTargetGraphResponseToProto#206. These mappers are used to avoid leaking proto definitions into internals such as storage and orchestrator.Stack
Test plan
make build && make test && make gazelle