* feat(http): serve IsBlockedBatch through the BlockingAnnotator role behind dependencies.blocking.isBlocked
gc's native ready cache needs bd's stored, transitive is_blocked column for
the active set (beads.BlockedQuerier.IsBlockedBatch). Over http the client
answered it with the generated stub, so every reconcile logged
`operation "IsBlockedBatch" not supported by the http backend`, the
projection stayed disabled and native Ready took ~5 s on the MC shadow.
No read a deployed (1.3.0) server serves can answer the column exactly:
the /v0 reads hydrate issues without is_blocked, the blocking decoration is
direct and two edge types only, and the flag also propagates down
parent-child edges and reads waits-for / conditional-blocks gates. So this
is an additive server behaviour plus a token, not a client-side
composition.
- issueops: BlockingRequest.IncludeIsBlocked asks for, and
IssueBlocking.IsBlocked carries, each answered id's stored flag (nil =
no row, never "free"). issueops.BlockedFlags is the one library entry
for the batched read over the role, chunked at BlockedFlagsChunk (100,
held equal to the served issue_id bound by an httpapi test).
- Bodies: storage/issueops.ExecuteBlockingAnnotation reads the flag with
IsBlockedBatchInTx in the same read transaction (dolt, embeddeddolt and
every sqlkit-style store that calls it); the unit-of-work body asks the
new DependencyUseCase/Repository IsBlockedBatch (same shared SQL body).
externaldeps keeps IsBlockedBatch's external-blocker invariant on the
local and remote annotators, and its Store.IsBlockedBatch no longer makes
the raw edge read over a role-served store.
- Wire: GET /v0/beads/dependencies/blocking accepts `is_blocked` behind the
new behaviour token dependencies.blocking.isBlocked (spec, apigen,
wire-shape golden). wire_revision stays 2.
- Client: httpBlockingAnnotator forwards IncludeIsBlocked and refuses it
BEFORE dialing with *ErrUnsupported{Capability:
dependencies.blocking.isBlocked} against a server that does not
advertise it; Store.IsBlockedBatch is issueops.BlockedFlags over that
annotator, so gc's errors.As latch still sees the typed refusal on an
old server, now naming the token that lifts it.
Tests: conformance case RunBlockingAnnotatorReportsTheTransitiveBlockedFlag
(child of a blocked parent is blocked, free is false, a ghost has no flag,
unasked carries none, BlockedFlags agrees) on the dolt, embedded, uow and
served legs; httpapi handler and chunk-bound tests; client tests for
chunking, the wire shape and the zero-dial refusal; vocabulary/capability
gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(externaldeps): keep the external blocker on the unit-of-work IsBlockedBatch
bd serve on a server or proxied-server workspace serves through the
unit-of-work arm (WrapUOWProvider) and advertises
policy.external_dependencies, so a client trusts the server's answers and
adds no external term of its own. That arm's dependency use case did not
override IsBlockedBatch, so the new dependencies.blocking.isBlocked flag
answered the stored is_blocked column, which has no external term. An issue
blocked only by an unsatisfied external: ref came back is_blocked=false,
with that ref listed in its own blocked_by, while GET /v0/beads/ready
excluded it.
dependencyUseCase.IsBlockedBatch now raises every id that has an
unsatisfied external blocker, deciding by the edges and resolver
GetReadyWork excludes by, read through the same unit of work. Unlike Ready
it resolves only the refs of the ids the column answered: a client asks in
chunks, and no chunk should reopen every foreign project the workspace
names. An id naming no row stays absent.
Also correct the store decorator's IsBlockedBatch doc (the served flag now
comes from the annotator role), add the CHANGELOG entry for the new
capability, and pin the flag against Ready on every arm: WrapUOWProvider,
directly and through its BlockingAnnotator (an absent id stays absent), the
local annotator, and the served test, which now asserts the flag and the
batched read. A counting opener pins that the unit-of-work read opens only
the foreign projects its asked rows name.
Checked against a real bd serve on a proxied-server workspace. At
97bcb57738 an issue blocked by external:remote:payments answered
is_blocked=false while /ready excluded it. With this change it answers
true, and once the capability ships /ready includes the issue and
is_blocked is false. Asked about a free issue alone, the server resolves
no external project; asked about the remote-blocked issue, it resolves
remote and leaves alone the unconfigured project another issue names.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(externaldeps): pin that a satisfied external blocker leaves the unit-of-work is_blocked false
Review of 192b73676 (bee-ghosttrack): the two new IsBlockedBatch tests only
had unsatisfied external refs, so a body that raised every answered id with
any external record (ignoring the resolver) stayed green.
TestWrapUOWProviderBlockedFlagResolvesOnlyTheAskedRefs's opener now
returns a foreign store whose labelled index carries a CLOSED provider of
provides:payments (the decorator_test.go shape). be-shipped blocks on
external:remote:payments (satisfied) and must read false; be-blocked moves
to external:remote:invoices (still unsatisfied) and reads true; both still
open /projects/remote once. With the reviewer's mutant applied
(`if _, ok := answered[id]; ok && len(state.refsByIssue) >= 0 {`) the test
fails on be-shipped in both new cases; restored, it passes
(bazel test //internal/storage/externaldeps:externaldeps_test).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(externaldeps): pin the store arm's satisfied external ref and the unasked is_blocked flag
The store arm decides an external blocker in two places: IsBlockedBatch's
local loop skips a ref the resolver reports satisfied, and the
BlockingAnnotator role folds IsBlocked's verdict, which applies the same
filter, into the served flag. Both annotators, store and remote, add that
flag only when the request asks for it. No test checked either store answer
for a ref whose project had shipped the capability, or that an unasked
annotation carries no flag, so dropping any of those checks left the
package green.
Pin them: IsBlockedBatch and the store annotator answer false for a row
whose only blocker is external:remote:payments once remote has closed its
provides:payments issue, and neither annotator flags a row unasked, even
one an external ref blocks. This is the store half of bd-yewju3; the
previous commit pinned the unit-of-work half.
Each mutant below survives the package at the previous commit and fails
exactly one test here (go test -tags=gms_pure_go
./internal/storage/externaldeps/; unmutated, bazel test
//internal/storage/externaldeps:externaldeps_test passes):
- decorator.go IsBlockedBatch: `&& !satisfied[dep.DependsOnID]` made
`&& len(satisfied) >= 0` fails TestIsBlockedBatchHonorsShippedExternalRef.
- decorator.go IsBlocked: `if !satisfied[ref.raw] {` made always true fails
TestBlockingAnnotatorLeavesShippedExternalRefUnblocked.
- role_accessors.go: `if req.IncludeIsBlocked {` made `if true {` fails
TestBlockingAnnotatorAddsNoFlagUnasked.
- remote_roles.go: dropping `req.IncludeIsBlocked &&` fails
TestRemoteBlockingAnnotatorMergesExternalBlockers.
Agent-Signature: claude-code-claude-opus-5-5-max on behalf of Julian Knutsen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Ten agents over 216 files, one directory-balanced group each, working to a
rubric that named what to cut (duplication narration, restatement of the next
line, the governing rule echoed in every command file, throat-clearing) and
what to keep (traps, invariants, security, tracker ids, behaviour changes, and
the "why a naive simplification destroys this assertion" rationale).
Net 1,523 lines. Density against this repo's own per-directory norm on main:
cmd/bd 33.6% -> 27.3% (main 10.7%)
internal/storage 26.1% -> 23.1% (main 14.1%)
backend/conformance 34.0% -> 29.6% (main 22.8%)
internal/httpapi 30.9% -> 27.8% (main 30.6%, now below)
overall 34.7% -> 31.6%
Every agent landed at 18-25% rather than the 30% asked for, and every one gave
the same reason independently: what remained was on the keep list. Ten separate
judgements agreeing is the most useful result here — the prose is dense, but it
is mostly load-bearing, and the shortfall is the honest answer rather than a
failure to try.
TWO REVERTS, both to protect something worth more than the lines.
issueops/ is back to its pre-trim state, giving up 610 lines. The conformance
contracts cite the leaf docs BY LINE — "pins treewalker.go:52-66" — 155 times.
Trimming the cited files silently repointed those at whatever text moved into
those numbers, across agent boundaries so no agent could see it. A semantic
remapper recovered 141 of them, but 23 needed judgement and several landed on
struct fields. The leaf docs are the spec the contracts are written against;
they are the one place in this change where dense prose IS the deliverable, and
keeping them stable is worth more than the 610 lines. tree_walker_contract.go
and version_reconciler_contract.go went back for the same reason: an agent had
deleted a paragraph containing a citation, so positional restoration could not
align them.
After the reverts, exactly 5 citations point into a still-trimmed file and 2 of
those are weak — both in cmd/bd/config_guard_test.go, which this series never
touched and whose citations were already wrong on main (init.go:361 pointed at
a closing brace; the guard it names is at init.go:1499).
VERIFICATION. A guard strips every comment and all whitespace from each of the
193 modified files at HEAD and in the worktree and requires the two to be
byte-identical, so a code change cannot hide in a comment diff. It handles `//`
inside string and raw-string literals, and was tested against a deliberate code
change before being trusted. gofmt clean, go build, go vet, golangci-lint 0
issues, and the two AST-based tests that PARSE trimmed files — the timed
provider binding pin over claim.go and the serve database-source gate over
serve.go — both pass.
One real defect found while trimming: checkDatabaseSource's doc block ran into
`// sourceRoles is ...` with no blank line, so godoc attached thirty-one lines
of the wrong prose to func sourceRoles and left checkDatabaseSource
undocumented. Fixed by separating them.
STAGE TWO OF TWO. Stage 1 (aa10a725e) added MaxRows and SkipCounts to
ListRequest and flipped no routes; this is the flip, plus the one role the
decoration needed.
TWO PARTS, and the role first because the flip needs it.
THE ROLE. `issueops.BlockingAnnotator` answers the decoration a listing prints
beside each row — `(parent: X, blocked by: Y, blocks: Z)` — for the ids of a
page that has already been chosen. It is its own role rather than EdgeReader
growth (Q12 asked and answered two), and the distance between them is larger
than it looks: EdgeReader returns STORED ROWS of every type with targets
spelled as stored, no status consulted, and a per-anchor Missing flag from an
existence probe; this one returns a DERIVED summary of two types with closed
blockers dropped, the inbound direction included, and NO existence probe at
all. It is not Reader growth either — it has no order of its own, nothing it
returns depends on how the page was chosen, and a ListRequest field would have
implied the annotation was part of the query.
THERE IS NO MISSING FLAG, and that is a decision the leaf states rather than an
omission: an id that names nothing and an id with no live blocking edges
decorate identically, so a probe would be a read whose answer no caller can
use. One conformance case asserts that ABSENCE of a distinction.
A BLOCKER THIS DATABASE HOLDS NO ROW FOR COUNTS AS OPEN — an `external:`
reference, a foreign-repository id, a row whose issue was deleted. An
unreadable status is not `closed`, and a listing that hid a blocker it could
not resolve would report work as unblocked on the strength of a row it never
found. Both implementations already did this; it now has a sentence and a case.
THE ORDER WITHIN EACH LIST IS NOW PINNED, ascending with repeats collapsed, and
this is the commit's ONE user-visible change. Both lists are joined into one
line of output, so the query's natural order was user-visible bytes that could
move between runs. It affects only rows with two or more live blockers, and it
is recorded as A-blk-2.
TWO BODIES, NOT THREE. dolt and embeddeddolt share
storage/issueops.ExecuteBlockingAnnotation inside their own read transaction;
the unit-of-work provider is the genuinely separate one — it reads BOTH
dependency tiers for every id and merges, where the store side partitions the
ids by plane, and it resolves statuses only for the ids a row mentioned.
FinishBlockingAnnotation is what makes the SHAPE of the answer one decision
rather than two. Seventeen cases, three wirings, ZERO PARKS.
THE HTTP HALF. GET /v0/beads/dependencies/blocking, spec first, `make api-gen`
after. `IssueBlocking` is x-go-type-pinned to the role package the way `Cycle`
and `CycleMember` are, and BOTH the schema and the envelope's Items are pinned
in internal/httpapi/pinning.go — the v2.6.0 allOf trap was checked (the
generated type is a bare alias) and bd-5o3gt did not become two. The size bound
is maxDependencyAnchors, SHARED with the stored-edge read rather than given a
constant of its own: the two operations are asked about the same page of ids,
and two numbers would let a client ask one about a page the other refuses.
`dependencies.blocking` joins the capability vocabulary; `checkDatabaseSource`
grows a required role, which is the edit that reaches code this commit did not
write.
THE FLIP, one mode at a time and named as such in the code. FIRST `--json`:
the role's List runs the same LoadStoreListConfig, the same BuildListFilter and
the same workapi.FinishPage the branch ran longhand, so the page is unchanged
bytes and ErrTooManyRows still reaches handleMaxRowsError for exit 2. SECOND
every text rendering, with SkipCounts set — stage 1 added that field for this
arrival, and without it the flip would trade a plain scan for three aggregate
joins on the most-run command in the tree. THIRD the decoration.
WHAT STAYS OFF THE ROLE is --watch and the hierarchical --parent tree, the two
modes that consume the FILTER as a value. The bead also named --deps and
--format, and its stated reason — "reach no epilogue on either route" — is
false for both: they run FinishPage and printTruncationHint today. What is
genuinely off-role in those two is the WHOLE-GRAPH dependency-record load they
perform, which is neither a page nor the blocking decoration; their page comes
from the role like every other mode's. Recorded as A-blk-3 with the reading
this commit proceeded under, which is also the reading stage 1's own message
states ("stage 2 moves bd list's TEXT path onto the role").
The proxied route loses `runListProxiedReady`: --ready is ListRequest.ReadyFlag
and picking the ready query from it is the role's job on both routes. Two
functions differing only in which use-case method they called is the drift this
replaces.
PROVABLY INERT AT THE CLI, measured rather than argued: 31 `bd list` / `bd
children` invocations — every output mode, both cap knobs, --ready, --parent,
--format, --deps — run against a binary built from integration/facade-wave-3
and one built from this commit, over ONE shared workspace, differ on exactly
the two multi-blocker lines A-blk-2 predicts and nothing else in 687 lines. A
base-against-base run isolates the one other moving line as the
once-per-period install tip.
The forbidigo exception list did NOT shrink, and the count in
issueops/reader.go's claim is unchanged. cmd/bd/list.go and
list_proxied_server.go were never on it; cmd/bd/list_show_filter_modes.go still
is, because the tree walk, the watch loop, the proxied builder call and `bd
show --current` all still name the type. Said in the config rather than implied
by silence.
Verified: build, vet, gofmt clean; golangci-lint 0 issues; the seventeen new
cases at dolt, embeddeddolt (BEADS_TEST_EMBEDDED_DOLT=1) and uow, all green
with no skips; internal/httpapi and make api-check; internal/storage,
internal/telemetry, internal/jira, internal/workapi/..., issueops and the root
layering pins; the embedded `bd list`/`bd children`/max-rows CLI suites,
TestProxiedServerList under BEADS_TEST_PROXIED_SERVER=1 (58 subtests including
tree_parent, the three format modes, ready pagination and the three max-rows
refusals), TestProxiedLookup*, and the protocol corpus package.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>