beads/internal/workapi
CI Bot de9fc833e2 refactor(workapi): move the store reader where a front door cannot reach it
`workapi.NewStoreReader` was exported and lived in internal/workapi, which 22
cmd/bd files already import for the builders. It takes storage.DoltStorage — an
interface a command already holds — so it was a one-line drop-in replacement for
`store.IssueReader()` from any front door, and the wrong one: every storage
decorator adds its layer in its OWN accessor (telemetry's reader-level spans, the
hook store's deliberate pass-through), so a command that constructed a reader
directly would get a bare unspanned one and the code would look entirely
ordinary. The old doc comment said "nothing does; the accessor is the door",
which is a promise, not a guard.

It has real callers, so it cannot simply be unexported: dolt.DoltStore and
embeddeddolt.EmbeddedDoltStore both need one shared body for their accessors,
and they are in different packages. So the body moves down to
internal/workapi/storereader instead, where those two are the only importers,
and the cmd-bd-reader-constructor depguard rule keeps cmd/bd out. Nothing about
internal/httpapi changes: depguard matches pkg by prefix, so
httpapi-transport-boundary already denied the subpackage along with its parent.

The two store packages' own NewIssueReader are unexported at the same time. They
had no caller but their own accessor, they are in internal/ so no out-of-tree
consumer can reach them, and leaving them exported would have left the same door
open one package over.

SEEN TO FAIL, on the golangci-lint version CI installs. `bd show --json` switched
from the accessor to the constructor — the exact bypass — compiles and vets
clean:

  $ golangci-lint run --config=.golangci.yml --build-tags=gms_pure_go ./...
  cmd/bd/show.go:15:2: import
  'github.com/steveyegge/beads/internal/workapi/storereader' is not allowed from
  list 'cmd-bd-reader-constructor': a command reaches the reader role through
  store.IssueReader(), never through the constructor ... (depguard)
  exit 1

ErrUnsupported.Op moves with the function, "NewStoreReader" -> "storereader.New",
so the Op still names the function that refused; its test moves with it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 20:04:09 +00:00
..
storereader refactor(workapi): move the store reader where a front door cannot reach it 2026-07-31 20:04:09 +00:00
testdata feat(issueops): add the Reader role and wire both front doors through it 2026-07-31 18:37:25 +00:00
detail.go feat(issueops): add the Reader role and wire both front doors through it 2026-07-31 18:37:25 +00:00
detail_test.go test(workapi): make the hard-error test pin the short-circuit, unexport isNotFound (bd-hc1) 2026-07-31 08:21:06 +00:00
doc.go refactor(show): share issue-detail assembly and normalize not-found (bd-hc1) 2026-07-31 07:58:46 +00:00
list.go fix(workapi): refuse an invalid metadata key where the builders can name it 2026-07-31 18:37:25 +00:00
list_golden_test.go feat(issueops): add the Reader role and wire both front doors through it 2026-07-31 18:37:25 +00:00
list_status_test.go refactor(list): route both bd list paths through internal/workapi and delete list_filter.go (bd-fv4) 2026-07-31 06:01:48 +00:00
metadata.go fix(workapi): refuse an invalid metadata key where the builders can name it 2026-07-31 18:37:25 +00:00
ready.go fix(workapi): refuse an invalid metadata key where the builders can name it 2026-07-31 18:37:25 +00:00
ready_golden_test.go feat(issueops): add the Reader role and wire both front doors through it 2026-07-31 18:37:25 +00:00
ready_test.go feat(issueops): add the Reader role and wire both front doors through it 2026-07-31 18:37:25 +00:00
sort.go feat(issueops): add the Reader role and wire both front doors through it 2026-07-31 18:37:25 +00:00