beads/internal/workapi/storereader
Stephanie Jarmak 8ac3e6ea04
feat(workapi): opt-in BriefDeps projection for the issue detail view (#5547)
be-4d36f2 gave the dependents side a shallow shape after hub beads made
`bd show --json <hub>` allocate 5-13 GB marshaling full Issue records. The
dependencies side of the same builder never got it, and still returns the
complete body of every dependency.

Measured on a 16,051-issue store, one `bd show <id> --json` returned 214,456
bytes, of which 193,039 was the dependencies array; a single dependency carried
a 180,975-byte notes field. Reading one issue costs the full text of everything
it depends on.

BriefDeps reuses the shape collectDependents already settled on (id, status,
type, priority, title, dependency_type) and drops the free-form text. It is
opt-in and the default payload is unchanged, so no existing caller loses a
field it reads. That matters here: #4122 objects to default payload changes
and #5078 records what the last one cost.

The reduction runs after the Parent scan, which reads DependencyType and ID off
the full rows, and builds a new slice rather than overwriting the one the source
returned, which a caching source would keep shallow for later callers.

collectDependents now routes through the same shallowDep helper so the two
shapes are identical by construction rather than by coincidence.

Storage layer only, per CONTRIBUTING_PR_GUIDELINES.md; the cmd/bd flag that
reaches this is the follow-up PR.

Refs #5546

Co-authored-by: sjarmak <t@t.co>
2026-08-10 06:51:41 -07:00
..
reader.go feat(workapi): opt-in BriefDeps projection for the issue detail view (#5547) 2026-08-10 06:51:41 -07:00
reader_test.go Converge Offset and MaxRows on all three legs, and fix the panic and the breaker hole under them (#5435) 2026-08-08 11:37:09 -07:00