Commit graph

17 commits

Author SHA1 Message Date
CI Bot
7f7f27de6c docs(workapi): say where the shared epilogue stops, and what limit 0 does
Two claims were true of the function and not of the sentence around it.

"EXECUTION through workapi.FinishPage for `bd list` on both routes" is
mode-scoped and did not say so. The hierarchical --parent tree under
pretty output reaches no epilogue on either route: the direct route
computes a page at list.go, then discards it for getHierarchicalChildren's
recursive walk, and the proxied route returns into
runListProxiedHierarchicalParent before FinishPage is called at all.
Neither sorts, trims or reports has-more. Every other listing - JSON,
plain text, --watch, --ready - does run the epilogue, so the correction
is "in every mode but one", named, rather than a retreat to "shares
something".

FinishPage's own doc said a limit of 0 means "nothing is cut and there
is by definition nothing more". The first half is what the code does; the
second is not. With limit 0 the cut is skipped and the hasMore SEED is
returned unchanged, so a seam that already reported more rows behind an
unlimited request keeps saying so - which is the honest answer, since a
cut that never ran cannot contradict it. The doc now describes that, and
the test case that carried the old wording in its name is split: one case
for "never cut", one new case for a true seed surviving limit 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 23:35:16 +00:00
CI Bot
a0d38c5d34 docs: state exactly what the reader role now enforces, and what it does not
The doc comments claimed the property at the level it was true and
hand-waved the rest. They now say the whole of it, per surface:

- every read the HTTP surface answers goes through the role, and two lint
  rules make reaching past it a lint failure;
- `bd show --json` is on the role on BOTH routes now, keeping only its own
  id resolution, which has no place on a contract an HTTP client calls;
- `bd ready` and `bd list` are on neither route, and will not be until
  there are more roles to route them through — what they share is the
  builders (pinned by golden files) and, for list on both routes and ready
  on the proxied one, workapi.FinishPage;
- `bd ready`'s DIRECT route shares no epilogue and cannot, because it
  publishes a hidden-row total the role has no member for. Said plainly
  rather than left out.

claimOnUOW records the claim-path decision instead of leaving it
unexplained: the CAS is already ONE implementation a level below both
surfaces (domain issueUseCaseImpl.claim, which ClaimIssue and
ApplyUpdate's spec.Claim arm are two names for), so there is no claim
logic above it to extract. What is above it is a batch-with-per-id-exit-
codes on one side and a typed 409 on the other, and a function spanning
those would be two halves with one caller each.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 22:56:06 +00:00
CI Bot
1108af95ee refactor(workapi): one execution epilogue for every list and ready read
Both surfaces already shared CONSTRUCTION — one BuildListFilter, one
BuildReadyFilter, both over the same issueops request types, both pinned
by the builders' golden files. They executed separately: the two Reader
implementations applied the over-fetch/sort/trim/HasMore tail, and each
CLI route applied its own copy. That tail had already drifted twice, and
both times it was the same bug in the same three lines written in two
places — a --ready page under a sort the database cannot express came
back untrimmed from one implementation, and the proxied route answered
`--sort id --limit 5` with every row while the direct route answered
with five.

workapi.FinishPage is now that tail, once. It is called by both
issueops.Reader implementations, by both of `bd list`'s routes, and by
the proxied `bd ready` listing. Nothing about the contract widened: the
epilogue takes rows, an order, a page limit and the seam's own has-more,
and answers with the page and the verdict. A seam that reports has-more
natively seeds it; a seam that does not passes false and lets the
over-fetched row speak.

`bd ready`'s DIRECT route keeps its own epilogue, and the comment in
ready_input.go now says so instead of claiming otherwise: it answers the
strictly larger question "how many rows were hidden" with a second
counting query and publishes the total in its pagination meta, which the
role has no way to express and the CLI cannot stop printing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 22:27:01 +00:00
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
CI Bot
161a0eedd8 docs: scope the Reader role's claim to where it is actually true
"Both front doors can only say rd.List(ctx, req)" was false for two of three
operations on the CLI side. `bd ready` and `bd list` still load config, build a
filter and stamp the --max-rows cap on it, on BOTH their routes — the exact
ritual the role exists to make unwritable — and five doc comments asserted
otherwise, including the leaf contract's own.

The gap is real and is not closed by moving MaxRows onto the leaf requests:
those commands consume the FILTER for --claim, --gated, --explain, --mol,
--watch, the hierarchical --parent tree and the text renderings that want
[]*types.Issue rather than a counted page. Routing only their JSON paths
through the role would fork each command in two, which is more drift, not
less. Closing it needs more roles, not more methods on this one.

So every claim now states its scope: the HTTP surface is on the role for all
three operations and machine-checked; `bd show --json` is on the role; the two
paging commands are not, and their protection is one level down — the same
builders over the same request types, pinned by the builders' golden files. The
two sites that still call the builders say why, in place.

Third structural divergence recorded on the parity oracle, which listed only
two: the endpoint always defaults to workapi.DefaultListLimit, while `bd list`
resolves a five-way CLI policy first (explicit --limit, --all, configured
list.limit, piped stdout -> unlimited per GH#4094, agent mode -> 20), so the
shared request-level default is unreachable from the CLI and `bd list --json |
...` swapped for the HTTP call loses rows past 50. The oracle passes an
explicit limit on both sides, so it never saw this.
TestListLimitPolicyIsResolvedBeforeTheRequest pins the policy branch by branch
against a real initialized config — removing the piped branch makes it report
50 where the CLI promises 0.

Two comments still naming the deleted ReadyParams type now name
issueops.ReadyRequest.
2026-07-31 18:37:26 +00:00
CI Bot
03276c78bb test(workapi,httpapi): cover the store reader's page epilogue and the cursor round trip
storeReader.Ready and storeReader.List had zero coverage: no front door reaches
them (the CLI's paging commands still call the builders directly, and the HTTP
surface goes through the uow reader), so the over-fetch and trim that moved out
of cmd/bd/list.go lived unexercised. They are pinned now — the +1 probe row, the
trim back to the page limit, an exact page reported as complete, an unlimited
query left unlimited, and SQLLimit's two cases — against a fake DoltStorage
that honors the row limit the way a query would.

TestCursorRoundTrips never round-tripped. The fixture's CreatedAt was the zero
time, decodeCursor rejects a zero instant as an empty position, so `ok` was
always false and BOTH assertion branches were dead: the test passed with
encodeCursor broken outright. It now mints from a real instant and asserts the
id and the instant come back exactly; dropping CreatedAt from cursorFor fails it.

Also aligns the nil-store refusal's Op with the constructor it names
(NewStoreReader, matching the store packages' NewIssueReader), which the new
test asserts.
2026-07-31 18:37:26 +00:00
CI Bot
f1d4b4b1ca fix(workapi): refuse an invalid metadata key where the builders can name it
The frozen document says an invalid `metadata_field` key is a 400. It was a
500: the only check lived in the SQL builder, so the failure arrived wrapped in
the storage method's name ("GetReadyWorkWithCounts: invalid metadata key ...")
— a shape nothing above storage can classify — and client typos landed in the
request_error alarm stream. Three doc comments already claimed otherwise,
including the leaf contract's "Keys are validated inside", which no Reader
implementation did.

Both builders now call one validator, so the claim is true of every
implementation of the role rather than of the CLI's flag parsing only. The CLI
keeps its own usage errors: it validates the same input at flag-parse time and
reaches the builder with the keys already checked, so its messages and exit
codes are untouched.

invalidFilterParam gains the two prefixes, and every row of that switch — the
three that were already there included — is now driven end to end by
TestABuilderRefusalIsTheDocumentedBadRequest. `invalid issue type ` was pinned
nowhere before: rewording it in list.go turns ?type=bogus into a 500 and now
fails that test.
2026-07-31 18:37:25 +00:00
CI Bot
1c35a769d3 feat(issueops): add the Reader role and wire both front doors through it
Reader is Lifecycle's read counterpart, built as its mirror image: a role in
the leaf `issueops` package, reached through a capability accessor on the
storage seam, implemented at the same six sites. `Storage` gains
`IssueReader() (issueops.Reader, error)` beside `IssueLifecycle()`, and the
governing rule holds — a new capability got a new role and a new accessor,
not four more methods on an existing one.

SUBSUME, NOT COMPOSE. Reader takes the whole high-level request and performs
filter and default construction INTERNALLY, supplying its own ConfigSource
from the store or unit of work it already holds. Under compose both front
doors would each build a ConfigSource, load config, call a builder and execute
— two callers again, which is the topology that shipped a bare IssueFilter to
a viewer and silently served in_progress rows as "ready". Under subsume the
ritual is not callable from a front door: handlers and RunE bodies can only
say rd.List(ctx, req), so the failure mode is unwritable rather than merely
discouraged.

The three read endpoints are implemented against the frozen OpenAPI v0
document and consume the accessor; the 501 stubs and their self-deleting
exemption list are gone. `bd show --json` reaches the same role through the
same accessor, resolving the canonical id first so fuzzy and cross-repo
lookup stay CLI-local.

The workapi builders are re-typed onto the leaf request types, so there is no
second params struct to drift; both recorded goldens replay byte-identical,
which is the proof the re-typing changed nothing.

Load-bearing details:

- `sort` is forwarded EXPLICITLY as priority when absent. The storage layer
  reads an empty policy as hybrid, which demotes older high-priority work and
  therefore changes the item SET once a limit truncates — while the document
  still reads correctly. Pinned by a handler test on the recorded filter and
  by the parity oracle's order assertion.
- The parity oracle compares FULL ITEM JSON, not id sets. An id-set oracle
  passes while ready ships a bare Issue against the CLI's IssueWithCounts.
- internal/workapi no longer imports internal/storage/uow; it names the slice
  of a unit of work it reads through, so the uow provider can implement the
  role without closing an import cycle.
- internal/utils' cgo store test moves to an external test package for the
  same reason, with its two unexported-symbol cases split out.

Verified: issueops is still a leaf (internal/types + stdlib only); the
protocol corpus is unchanged structurally and behaviourally under
BEADS_PROTOCOL_REQUIRE_DOLT=1; a real `bd serve` answers all six operations
against a real workspace with CLI and HTTP JSON identical field for field.
2026-07-31 18:37:25 +00:00
CI Bot
a124acc6cb merge(bd-hc1): shared issue-detail assembly 2026-07-31 18:33:37 +00:00
CI Bot
60d8f69231 test(ready): pin the JSON usage-error contract the golden cannot see (bd-ehi)
Correction to bd-ehi's report: it claimed all six divergences between the two
pre-collapse builders are machine-pinned by TestReadyFilterGoldenDivergences.
Five of them are. The sixth - the shared gatherer reporting five usage errors
through HandleErrorRespectJSON where the proxied builder used HandleError - is
not, and cannot be: the golden was recorded with jsonOutput false, where the
two helpers print the same stderr line, so those cases show up as agreements.

The change is observable and worth keeping: the direct route has always used
the RespectJSON variant, so unifying on it leaves that route byte-identical
and gives the proxied one what --json means everywhere else in bd. Reverting
would instead break the direct route. So it is pinned rather than reverted:

  - TestGatherReadyInputUsageErrorsRespectJSON asserts, for each of the five,
    that a JSON error object lands on stdout and stderr stays empty.
  - The proxied integration suite asserts the same end to end for three of
    them, which is the route whose behaviour actually changed.

The divergence test's doc comment now says what the golden structurally cannot
see and where that is covered instead, so the next reader does not repeat the
claim.

Agent-Signature: claude-code-opus-5-unknown-reasoning on behalf of CI Bot
2026-07-31 08:48:21 +00:00
CI Bot
e6b2504e5a fix(ready): keep the negative --offset rejection on the proxied route (bd-ehi)
`bd ready --offset -1` started exiting 1 with "--offset must be >= 0" outside
proxied mode, where it used to print ready work. The direct RunE only ever
rejected --offset > 0 ("only supported under --proxied-server") and never
looked at the flag again, so a negative value was a no-op there; moving the
proxied gatherer's validation into the shared gatherer handed it to a route
that had never had it.

--offset is a proxied-only flag, so its validation belongs to the proxied
route's RunE, which is where it now runs - before gathering, so it still
precedes the mol-type, metadata and sort checks exactly as it did when it sat
at the top of the gatherer. It keeps HandleError rather than the RespectJSON
variant: this message is the proxied route's alone, and plain stderr text is
what it has always been.

The shared gatherer now takes an offset only when it is positive, which is
what both old builders did with the values that reached them: the direct one
never set Offset at all, and the proxied one had already rejected negatives.

Pinned three ways: a unit test on the gatherer, a live-CLI embedded test that
`bd ready --offset -1` still lists ready work, and a proxied integration test
that the same command line is still rejected there.

Agent-Signature: claude-code-opus-5-unknown-reasoning on behalf of CI Bot
2026-07-31 08:31:00 +00:00
CI Bot
bcda8d4d45 fix(ready): keep the directory label off the normalizer (bd-ehi)
The GH#541 directory label is a configured value, not user input, and both
pre-collapse builders put it on the filter verbatim: they assigned
config.GetDirectoryLabels() to labelsAny *after* NormalizeLabels had run over
the user's sets. Routing it through ReadyParams changed that, because
BuildReadyFilter normalizes the label sets it is given - so a directory.labels
value with stray whitespace silently started matching a different label.

The golden could not catch it: the generator ran with no directory.labels
configured, so the branch was never recorded. It is a real config path, hence
a test that would have - the configured label is one NormalizeLabels visibly
rewrites, and the assertion is against the raw value.

The default's emptiness gate now reads the built filter's label sets rather
than a locally normalized copy. That is the same decision (BuildReadyFilter
normalizes with the same function) and it removes cmd/bd's second normalize
pass along with the "NormalizeLabels is idempotent" hand-wave that justified
it.

Agent-Signature: claude-code-opus-5-unknown-reasoning on behalf of CI Bot
2026-07-31 08:28:32 +00:00
CI Bot
0e7f15be96 test(workapi): make the hard-error test pin the short-circuit, unexport isNotFound (bd-hc1)
TestGetIssueOrWispKeepsHardErrors did not test what it claimed. Both fakes
hard-errored on GetIssue AND GetWisp, so the pre-fix fall-through resolver
reached the same hard error by the longer route and the test stayed green
under mutation - it pinned the "no not-found decay" half of the fix and
nothing about ordering.

The scenario that discriminates is the asymmetric one: the issue lookup
fails while the id happens to exist in the wisp table. Fall-through answers
that with (wisp, true, nil) - a dead backend reported as a successful read
of a different table. fakeIssueUC grows an issueErr knob for exactly that,
and the new subtest fails against the old semantics.

The store subtest stays and is now documented as what it is: the store
adapter's GetWisp is a hardwired dead end, so that seam has no fall-through
to suppress and cannot discriminate. It pins that the store's hard error
still reaches the caller.

Also unexports IsNotFound. It had no caller outside the package - all six
cmd/bd sites test errors.Is(err, storage.ErrNotFound) against the already
normalized error - and exporting it cut against the design, handing
frontends a second way to read raw seam errors when the point of
GetIssueOrWisp is that they never see one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 08:21:06 +00:00
CI Bot
1ce5e13cb1 refactor(show): share issue-detail assembly and normalize not-found (bd-hc1)
Lift the detail view - labels, dependencies with metadata, the three
cardinality counts, the comments-omitted flag, the shallow dependent
rows, and epic progress - into internal/workapi/detail.go behind
BuildIssueDetails + DetailSource, with store and UOW adapters. Both
copies in cmd/bd are deleted: bd show's direct assembly block and
proxiedBuildDetails, along with proxiedGetIssueOrWisp, proxiedCountDeps,
and proxiedCountComments. Fuzzy id resolution, --current, watch mode,
and the array-of-one output envelope stay CLI-local; so do
proxiedListDeps and proxiedGetComments, which feed terminal rendering
rather than the shared shape.

The point of the slice is the correctness fix, not the code motion. The
two storage seams disagree about "no such issue": the store wraps
storage.ErrNotFound, while db.issueSQLRepositoryImpl.Get returns a bare
sql.ErrNoRows that issueUseCaseImpl.get wraps with the id - never
storage.ErrNotFound, and never a (nil, nil) pair. workapi.GetIssueOrWisp
normalizes both shapes, plus nil-issue-with-nil-error, to the
storage.ErrNotFound sentinel, and short-circuits hard errors instead of
retrying them against the wisp table. Putting that in the shared
function - not in a caller - is what stops the next frontend
reintroducing either failure mode: `if err != nil || issue == nil` -> 404
reports a dropped connection as a missing issue, and its mirror image
ships a 500 for one.

Six proxied callers inherit the fix. Most visibly, `bd show <missing-id>`
in proxied mode printed "Error fetching x: get x: sql: no rows in result
set" and gate list answered "issue not found" for any backend failure at
all; both now say what actually happened.

Two behaviour deltas, both in error paths the corpus does not cover:
the proxied JSON path no longer swallows a failed --include-dependents /
--include-comments read (it errors like the direct path always has), and
a proxied lookup that fails for a non-not-found reason reports that
reason. Row streams are collected through storage.Iter on both seams,
so the direct path keeps its be-4d36f2 streaming and the proxied path
gains it; the comment collector now copies each value, per Iter's
documented pointer-reuse contract.

Also deletes shallowDependentsForJSON, which had no production caller
left; its be-4d36f2 guard moves to workapi as
TestBuildIssueDetailsShallowDependents.

Verification: protocol corpus unchanged structurally (no diff under
cmd/bd/protocol vs the base) and behaviourally (TestCorpusGolden green
with BEADS_PROTOCOL_REQUIRE_DOLT=1, before and after);
TestProxiedServerShow{,2,3} 50/50 subtests green with
BEADS_TEST_PROXIED_SERVER=1; TestEmbeddedShow 21/21 green with
BEADS_TEST_EMBEDDED_DOLT=1; TestShow_* green individually;
TestCoverage_ShowUpdateClose green; TestProxiedServer{State,SetState,
Label,Comment,GateList,GateCheck} green. TestShow_IDFlag and
TestCoverage_TemplateAndPinnedProtections fail identically on the base
commit (in-process harness state leakage), and TestCoverage_ShowThread
skips on the base commit for want of a reachable Dolt server.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-31 07:58:46 +00:00
CI Bot
6b04f94ef0 refactor(workapi): add BuildReadyFilter with a golden recorded from both old builders (bd-ehi)
First half of the bd-ehi collapse, kept separate so the golden table is
provably generated from the OLD code: this commit adds
internal/workapi/ready.go (BuildReadyFilter, ReadyParams,
DefaultReadyLimit) without touching either of cmd/bd's copies, and records
what BOTH of them produce for 39 command lines into
internal/workapi/testdata/ready_filter_golden.json.

Recording both columns is the point. `bd ready`'s defaults are built twice
today - inline in ready.go's RunE for the direct path, and in
gatherReadyInput for the proxied path - and the golden is what turns "they
look the same" into a fact. They agree on 33 of the 39 cases, including
Status: "open" (the tracked description says only one copy hard-codes it;
that has not been true since ready_input.go was added in 911ff8025). The
six disagreements are pinned by TestReadyFilterGoldenDivergences with the
branch that was kept and why:

  - Offset: only gather sets it. The direct RunE rejects --offset before
    any filter exists, so this is not observable.
  - MaxRows/MaxRowsSource: only the direct path sets them, and only the
    direct path can enforce them. Kept in cmd/bd rather than ReadyParams.
  - --max-rows -1 / --claim --gated / --offset -1: each rejected by one
    builder because the other path's RunE rejects it upstream.

DefaultReadyLimit = 100 is today's CLI default, not a new choice: it is
readyCmd's --limit default at HEAD. 0 still means unlimited, so the builder
does not substitute it.

The generator (cmd/bd/zz_ready_filter_golden_gen_test.go) is scaffolding
and is deleted in the follow-up commit that removes ready.go's inline copy.
It clones readyCmd's real flag definitions rather than re-declaring them,
and its args -> ReadyParams mapping cannot launder a mistake into a false
pass: the golden records the ReadyParams, so a field set in params but not
on the command line makes the replay fail rather than succeed.

Agent-Signature: claude-code-opus-5-unknown-reasoning on behalf of CI Bot
2026-07-31 07:19:59 +00:00
CI Bot
e2d82a54d7 refactor(list): route both bd list paths through internal/workapi and delete list_filter.go (bd-fv4)
Second half of the extraction. cmd/bd/list_filter.go is gone; the direct
path (list.go), the proxied path (list_proxied_server.go), and the four
other consumers the file had grown (search, search_proxied_server, count,
count_proxied_server, graph_apply) call workapi.BuildListFilter /
LoadStoreListConfig / LoadUOWListConfig / ApplyStatusFilter /
ValidStatusList instead.

listInput now embeds workapi.ListParams rather than copying into it. A
50-field flags -> params mapping would be a silent-swap hazard the compiler
cannot see; embedding makes cmd/bd fill the shared struct directly, so
there is one definition of a list query and nothing to keep in sync. The
CLI-only fields (output format, pager, tree/deps rendering, effectiveLimit,
--repo) stay in listInput, which is why ListParams is a subset and not the
whole thing.

applyStatusFilter and validStatusList are exported rather than kept
unexported as the design sketch had them: search.go, search_proxied_server.go
and graph_apply.go already called them, and leaving them behind in cmd/bd
would have forked the status-parsing rules.

The --limit flag now registers workapi.DefaultListLimit. internal/config's
list.limit viper default keeps its own literal 50 - internal/config cannot
import workapi, because workapi imports internal/config for
GetCustomTypesFromYAML.

Boundary enforcement lands with the package, per the design: a
workapi-frontend-boundary depguard rule denying cobra and net/http under
internal/workapi, and a pr-policy.sh grep for the symbol-level half depguard
cannot express (config.GetDirectoryLabels, os.Getenv). Both were verified to
fail on a deliberate violation and then reverted.

Gates: protocol corpus unchanged (whole cmd/bd/protocol package green with
BEADS_PROTOCOL_REQUIRE_DOLT=1, no testdata diff); TestBuildListFilterGolden
35/35 against the filters recorded from the old builder; TestEmbeddedList
52 subtests and TestProxiedServerList 65 subtests green; count, search and
graph-apply suites green; golangci-lint clean on cmd/bd and internal/workapi
apart from the two pre-existing main.go gosec baselines.

Agent-Signature: claude-code-opus-5-unknown-reasoning on behalf of CI Bot
2026-07-31 06:01:48 +00:00
CI Bot
af56541bb3 refactor(workapi): add internal/workapi with the list-filter builder and a pre-extraction golden (bd-fv4)
First half of the bd-fv4 extraction, kept separate so the golden table is
provably generated from the OLD code: this commit adds
internal/workapi/list.go (BuildListFilter, ListParams, ListConfig,
ConfigSource, DefaultListLimit) without touching cmd/bd's copy, records
what cmd/bd's buildListFilter produces for 35 inputs into
internal/workapi/testdata/list_filter_golden.json, and asserts the moved
builder reproduces it byte for byte.

DefaultListLimit = 50 is today's CLI default, not a new choice: both
cmd/bd/list.go's --limit flag and internal/config's list.limit default are
50 at HEAD.

The generator (cmd/bd/zz_list_filter_golden_gen_test.go) is scaffolding and
is deleted in the follow-up commit that removes cmd/bd/list_filter.go. Its
params -> listInput conversion cannot launder a mistake into a false pass:
the golden records the ListParams, so a mis-mapped field there makes the
replay fail rather than succeed.

Agent-Signature: claude-code-opus-5-unknown-reasoning on behalf of CI Bot
2026-07-31 05:42:40 +00:00