Repository navigation
fix(client): publishItem JSDoc names NO_DRAFT, not the retired [no_draft] opener - #20187
Conversation
… axis, not the retired [no_draft] opener `publishItem`'s docstring (packages/client/src/index.ts, ships into dist/index.d.ts) still documented the refusal as `404 [no_draft]`, the bracketed lowercase message opener PR #19683 (#16245) retired from every metadata-protocol producer on the 2026-08-29 maintainer ruling that `error` is human language and `code` is the machine token. The runtime has emitted `status: 404, code: 'NO_DRAFT'` with no bracketed opener since that PR landed; this corrects the docstring to match, following the same `404 `NO_DRAFT`` convention already used in packages/spec/src/api/plugin-rest-api.zod.ts. No behaviour change. Card relation carried in the pull request body only. Claude-Session: https://claude.ai/code/session_01UYBdGBzWSrAMzpW8ah3GbP Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 15 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
… JSDoc check-issue-citations judges every citation on a line a diff touches as ADDED. The previous commit's edit landed on a line that already carried a bare `[#12195]` citation, which does not resolve on this repository's board (allocated, ≤ current frontier, absent — deleted vs transferred not probed). Per the gate's own prescription, and since this docstring ships into the published dist/index.d.ts (a tracker number there is provenance a consumer cannot use), the citation is dropped rather than guessed at; the sentence's substance (the name is percent-encoded, like `getItem`) is unchanged. Claude-Session: https://claude.ai/code/session_01UYBdGBzWSrAMzpW8ah3GbP Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: Independence: INDEPENDENT AGENT (fed the card, the rulings and the PR only; not the dispatch order or the seat's conclusions) VERDICT: FAIL
|
CommonMark does not honour a backslash escape inside a code span, so `404 \`NO_DRAFT\`` closed at the escaped backtick and rendered the rest of the sentence inside-out once @changesets/cli copied this body verbatim into packages/client/CHANGELOG.md. Rewritten as plain 404 `NO_DRAFT` — one span around the code only, 404 as plain text — matching the sibling changeset's working spelling. Verified by rendering both the old and new text through marked (CommonMark) and a mechanical backtick-pairing check: the five spans (publishItem, dist/index.d.ts, NO_DRAFT, code, [no_draft]) all open and close correctly now. Claude-Session: https://claude.ai/code/session_01UYBdGBzWSrAMzpW8ah3GbP Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: Delta of: ① Derived judgments
|
Fixes #19704
Clause-②: no
publishItem's JSDoc inpackages/client/src/index.ts(ships intodist/index.d.ts) documented the publish-refusal spelling as404 [no_draft]— the bracketed lowercase message opener the 2026-08-29 maintainer ruling retired from every@objectstack/metadata-protocolproducer via #16245 / PR #19683 (7a25a3ee9c). The runtime has answeredstatus: 404, code: 'NO_DRAFT'with no bracketed opener since that PR landed. This corrects the docstring to nameNO_DRAFTon thecodeaxis, following the same 404NO_DRAFTconvention already used inpackages/spec/src/api/plugin-rest-api.zod.ts. No behaviour change.The card's own
Blocked-by: #16245is satisfied — that PR merged on 2026-09-22 (7a25a3ee9c). Triage originally planned to fold this card into #19705's round; per the claim's serial-constraints note, that round closed via a PR touching only QA files and never picked this line up, so this card proceeded on its own.Measured
packages/client/src/index.ts:2152read404 [no_draft] when there is nothing to publish.onorigin/main455dcc06.git grep -n --fixed-strings "[no_draft]"over the tracked tree (excludingcontent/docs/releases/andCHANGELOG.mds) found no other present-tense claim of this spelling insidepackages/client/src/. Control words in the same file —NO_DRAFTand[item_locked]are zero there whilepublishhits 55 times — show the grep discriminates rather than being silently broken.@objectstack/clientand grepped the emitteddist/index.d.ts— the docstring does ship (with positive controls, two neighbouring JSDoc lines, confirmed present too). This is a published-surface correction, so it carries.changeset/19704-client-no-draft-jsdoc.md(patch), not theskip-changesetroute.SysMetadataRepository.promoteDraft(packages/metadata-protocol/src/sys-metadata-repository.ts:946) throwsstatus: 404,code: 'NO_DRAFT', message"No pending draft exists for {type}/{name} — nothing to publish."— no bracketed opener. The new docstring names exactly that.[no_draft]text (zerogit grephits acrosspackages/client/'s test files).Acceptance notes
Two more present-tense claims of the same retired bracketed-opener shape turned up while measuring the above, both outside this card's file surface (packages/client/src/ + the [no_draft] spelling specifically) — reported rather than fixed here:
packages/rest/src/rest-server.ts:8427— a source comment (404 [no_draft] when nothing to publish.) on the samePOST /meta/:type/:name/publishroute this card's producer serves. Same defect family as [finding]packages/client/src/index.ts:2151JSDoc still documents404 [no_draft], a spelling the runtime no longer emits after #16245 #19704 and finding(metadata-protocol): 30 refusal messages open with a bracketed tag that restates the code the same throw declares — the shape #12975 rules out, and it reaches the wire #16245, different file.packages/client/src/index.ts:6297— a sibling docstring (Get a sharing rule by id or name. 404 [RULE_NOT_FOUND] when absent.) for a different code. Its producer (packages/plugins/plugin-sharing/src/sharing-rule-service.ts:818, barethrow new Error('RULE_NOT_FOUND')) and REST mapping (packages/rest/src/rest-server.ts:12807-12808,:12920) never emit a bracketed message either — the finding(metadata-protocol): 30 refusal messages open with a bracketed tag that restates the code the same throw declares — the shape #12975 rules out, and it reaches the wire #16245 shape recurring on a code that ruling never touched.Neither is the
[no_draft]spelling this card claims, and the second isn't in scope by spelling; both are named in the round report for the dispatching seat to route.Generated by Claude Code