Enriched list --json and batch-show for warm-graph integrations (depends on #18) - #19
Open
dan-huminology wants to merge 2 commits into
Open
Enriched list --json and batch-show for warm-graph integrations (depends on #18)#19dan-huminology wants to merge 2 commits into
list --json and batch-show for warm-graph integrations (depends on #18)#19dan-huminology wants to merge 2 commits into
Conversation
Introduce Session with in-memory graph, Unix-socket proxy in the CLI, ergo serve, reload-on-mismatch, and --no-server one-shot fallback. No JSONL schema changes; existing tests pass.
Opt-in list --with-meta/--with-body (version 2 items) and batch-show for warm-graph hydration without N× show round trips. Extends serve wire with batch_show and stderr passthrough. Depends on resident serve (sandover#18).
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
This PR adds opt-in read projections so integrations can hydrate task metadata and bodies without N×
show/show --bodyround trips throughergo serve.It builds on the warm in-memory
Graphfrom #18. Default behavior is unchanged:list --jsonwithout new flags still emits version 1 JSON identical to today.Both features ship in this PR:
list --json --with-meta [--with-body]— version 2 items with timestamps, claim fields,depends_on, and optional losslessbodybatch-show --json <id>…— one JSON document keyed by task id (max 256 ids); missing ids omitted with stderr warningslistpayload carries new flags; newbatch_showmethod; warnings travel on wirestderrand print to the clientDepends on #18 (resident
serve).Problem
Even with
ergo serve, watch and console integrations still need fields thatlist --jsonomits (created_at,depends_on, storedbody, …). Workarounds replaybacklog.jsonlin TypeScript or fall back to pairedshow+show --bodycalls — duplicating ergo’s reducer and multiplying socket traffic on hot paths.The missing piece is not a new store; it is supported CLI projections that reuse the warm graph #18 already holds.
Approach
Feature 1 — enriched list JSON
New flags on
list(both require--json):items[]row--with-metacreated_at,updated_at,claimed_at(null when unset),claimed_by(null when unset),depends_on(string[], may be empty)--with-bodybody(lossless stored bytes, same asshow --body)When either flag is set, document
versionis 2. When neither is set, output remains version 1.depends_onlists prerequisites (this task depends on these ids), fromGraph.Dependencies(id)— same edges asshow’s “depends on” section.Example row (all flags on):
{ "id": "W2KEE7", "title": "agent:write-test-plan", "kind": "task", "state": "todo", "ready": true, "epic_id": "MDINNW", "created_at": "2026-08-22T21:58:01.276626138Z", "updated_at": "2026-08-22T21:58:01.276626138Z", "claimed_at": null, "claimed_by": null, "depends_on": ["YDX3YB"], "body": "…" }Keys for flags that are off are omitted (not
"body": nullunless--with-bodyis on and the stored body is empty).Feature 2 — batch-show
Always JSON. Returns:
{ "version": 1, "tasks": { "ABC12": { "id": "ABC12", "title": "run:ci", "kind": "task", "state": "todo", "epic_id": "LAND1", "created_at": "2026-08-30T00:00:54.717284613Z", "updated_at": "2026-08-30T01:05:36.336Z", "claimed_at": null, "claimed_by": null, "depends_on": ["PREV1"], "body": "…" } } }batch_showwith payload{"ids":[…],"with_body":true}Serve / proxy
listwire method carries extendedListRequest(JSONWithMeta,JSONWithBody)writeWireOKnow includes optionalstderr; proxied clients echo server stderr before stdout (batch-show missing-id warnings)ergo serveafter installing this binary so it understandsbatch_show. Old serve continues to handlelist/show; unknown methods return a structured wire error.Operator UX
Tests
go test ./...depends_on, timestamps, null claim); v2 body matchesShowBodyinternal/ergo/list_json_test.gointernal/ergo/batch_show_test.go--no-serverstdoutcmd/ergo/serve_roundtrip_test.gointernal/ergo/help.txt,quickstart.txt,cmd/ergo/manual_test.goReviewer notes
internal/ergo/list_projection.go(projectTaskJSON,taskDependsOnJSON, …)batch_show_json.goownsBatchShowRequest,Application.BatchShow, and JSON render[]map[string]anyitems so unset claim fields serialize as JSONnullprotocolVersion = 1); only new method + extended list payload— Dan's AI Helper