Add reachable issue graph API#147
Draft
mariusvniekerk wants to merge 5 commits into
Draft
Conversation
Middleman needs canonical task graph semantics from kata instead of rebuilding relationship traversal and layout pruning entirely in frontend code. This adds a daemon-owned graph read surface that resolves from stable issue identity, normalizes relationship direction, preserves unresolved endpoints, and exposes layout-only block pruning without returning browser-specific rendering state. Generated with Codex Co-authored-by: Codex <codex@openai.com>
The reachable graph response has a stable ordering contract, and keeping that ordering embedded in anonymous sort closures made it harder to see which fields define that contract. Put the comparison logic on the graph DTOs and the local traversal neighbor type so callers sort through named semantics instead of duplicating field-by-field ordering at each site. Generated with Codex Co-authored-by: Codex <codex@openai.com>
Current mainline routes daemon handlers through the backend-neutral db.Storage contract, so the reachable graph implementation needs to avoid concrete SQLite queries. Reading links through LinksByIssue keeps the graph endpoint portable across storage backends and lets the generated OpenAPI/client artifacts reflect the new route on the branch reviewers will inspect. Generated with Codex Co-authored-by: Codex <codex@openai.com>
Replaying the graph endpoint onto current main removed the project_id link column and made the projectID helper arguments fixture-only. Naming them as intentionally unused keeps lint green without changing the graph behavior under test. Generated with Codex Co-authored-by: Codex <codex@openai.com>
roborev: Combined Review (
|
Reachable graph traversal can encounter links whose other endpoint belongs to another active project. Treating those endpoints as unresolved made valid graph nodes disappear and would have forced callers back into frontend-side graph reconstruction. Hydrating linked issues by ID keeps traversal aligned with the existing cross-project link model, while deriving qualified IDs from each node's owning project avoids labeling foreign issues with the source project name. Validation: env -u KATA_SERVER go test -shuffle=on ./internal/daemon -run 'TestReachableGraph_TraversesCrossProjectLinksWithQualifiedIDs'; env -u KATA_SERVER go test -shuffle=on ./internal/api ./internal/daemon; git diff --check; make lint; make api-check Generated with Codex Co-authored-by: Codex <codex@openai.com>
roborev: Combined Review (
|
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.
Middleman currently has to reconstruct canonical kata relationship semantics in frontend TypeScript before it can render the reachable graph. That puts backend concerns like relationship direction, reciprocal dedupe, missing endpoint preservation, stable ordering, and layout-only transitive block pruning in the browser layer.
This PR moves the canonical reachable graph read model into the daemon. Clients can fetch a source issue graph with bounded or full depth and optional done filtering, then focus on rendering, local emphasis, viewport state, and browser layout concerns without owning kata graph semantics.
The branch is based on current mainline storage abstractions, so graph traversal reads links through db.Storage rather than a SQLite-only project-link query. The OpenAPI and generated client artifacts are included so downstream consumers can call the new route directly.
Related: kenn-io/middleman#621.
Validation:
env -u KATA_SERVER go test -shuffle=on ./internal/api ./internal/daemon;make lint; push hooks also ranmake api-check,make lint, andnilaway.