Adds PATCH /v0/beads/issues/{id}, the last operation in the write-lifecycle
tranche and the one with the widest body vocabulary.
A PLAIN METHOD, not a custom one, by the memories precedent: partial update of
one named resource is what PATCH already means, exactly as one named resource
with no body is what DELETE means for forgetMemory. It registers directly, keeps
pattern == specPath, and leaves the custom-method namespace for operations that
are not CRUD. The claim-route commentary calling the issue-detail path
"GET-only" is updated in the same change.
MEMBER PRESENCE IS THE SIGNAL, and that is why the body is decoded as raw
members: a member present sets the role's Field, a member absent leaves the
field untouched, and the generated struct cannot tell those apart because it
models both as a nil pointer. Explicit null is a third state read off the raw
bytes — a clear on the four nullable members, which are exactly the ones the
role models as Field[*T], and a 400 naming the member everywhere else. Without
that pre-check a `"title": null` would unmarshal to nil and slide through as
"untouched": a write the client asked for and the server silently dropped.
status, assignee and metadata are excluded and refused BY NAME. Keeping them
out is half the reason this operation documents no 409 at all — they are
exactly where close policy, the claim fence and the metadata algebra would have
entered its code set. parent_id, persistence, owner, closed_by_session, spec_id
and await_id are absent for the reasons the spec enumerates; each is additive
to publish later.
The role's ErrValidation maps to 400 in a failUpdate sibling of
failBatchCreate, with the same no-role-prose rule. Its ErrNotFound branch runs
first and is the divergence: this operation DOES address a resource by path, so
an id naming nothing is a genuine 404 rather than a statement about the body.
Two new spec gates. TestUpdateRequestMembersMatchTheHandler covers both levels
of the body, where a hand-rolled accepted set could otherwise drift from the
document with every other gate green. TestNullablePatchMembersAreExactlyThe
DocumentsNullableOnes pins the clear-vs-refuse set from both sides, because
drift there is silent in the worst direction: an unannounced clear on a field
nobody agreed could be cleared.
The PATCH wildcard also matches segments that look like custom methods, since
`{id}` matches any whole segment. That is the detail path's long-standing
behavior — GET has always answered the same way — and it resolves as an update
of an issue whose id is literally "bd-1:close", which no row holds.
TestPatchOnACustomMethodSegmentIsNeverTheCustomMethod pins the property that
matters: a PATCH never executes as a lifecycle verb.
Retained real-dependency proof: TestProxiedServerServeUpdate, against real
Dolt — one issue carrying a set member, a null-cleared member and an untouched
member, all read back after the PATCH; changed:false on a same-value resend;
label replacement removing an omitted label; and the workspace-vocabulary
refusal arriving as the documented 400 rather than a 500.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>