Skip to content

Release 1.0.0-alpha.7: what a browser app consumer asked for - #59

Merged
jallers merged 4 commits into
masterfrom
claude/alpha-7
Nov 26, 2026
Merged

jallers merged 4 commits into
masterfrom
claude/alpha-7

Conversation

@jallers

@jallers jallers commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

One breaking change, to attachments; everything else is additive. CHANGELOG.md has an entry and a migration line for each change.

Breaking

  • An attachment is answered as a row of the Attachment type, under meta.v1's attribute names like every other row (_oid, Name, Filename, ContentType, Description, CreateDate, "CreatedBy.Name"), plus id. It was the one place the SDK had a vocabulary of its own (oid, name, filename, …), against spec 000 §3. Applies to client.attachments.list, page, info, get, add and AttachmentUploadError.attachment. get answers the served type as servedContentType beside the recorded ContentType. The changelog has the migration field by field.

Added

  • client.attachments.list / page take a select. The extra keys land on the row itself, as selected, translated and typed by what was selected.
  • client.attachments.get(id, { inline: true }): metadata and bytes in one query.v1 request (the Attachment's Content as Base64 beside its row) where the default is two. For small files.
  • normalizeQuery(query): a query written with rest-1's spellings (sel, a textual where, comma-joined lists, a "size,start" page) becomes a QueryBody. QueryBody itself gains no alias. Saying one thing twice, or asking for deleted, is a UsageError.
  • @versionone/agility-sdk/testing with FakeAgilityClient: the real client over a transport that sends nothing and answers what a test scripted, in the model's shape (onQuery, onSend, onLocalize, onRequest; asked, sent, requests). A read nothing was scripted for throws instead of reading as empty. resolve.numbers answers from the scripted rows, a query from a create's alias reads the created asset back, and fake.transport can serve a client the code under test builds itself.
  • apiErrorFromResponse(status, data): the error the fetch transport throws for a refused response, exported for a custom Transport.
  • @versionone/agility-sdk/wire: the wire modules under their own import path. The root keeps exporting them for this alpha.

Fixed

  • Outcome.requestId after assets.sendGuarded and batch.run was always null; a batch sent in one request now keeps the server's id.

Documented

  • Page.more is the pager's signal when total is null.
  • kind: "usage" means nothing was sent.
  • What baseUrl is for with a custom Transport.
  • Stale notes fixed: client.query on retries and details; README's "extend" and "no registry package" sections; the pull request target in CONTRIBUTING.md; CI's push branches.

Things a reviewer should know

  • Three build entries, shared chunks. tsup now builds index, wire and testing with splitting: true in both formats, so dist/ holds chunk files (all in one directory) and a class is one class whichever path imported it. test/unit/cjs.test.ts proves it for CommonJS.
  • The fake is scripted in the model's shape, not the server's. Spec 000 gains §5a saying why and what it therefore does not prove (no translation, no filter evaluated, no write applied). It does not script guarded sends or batch.run: their request sequence is internal and changes in the next alpha.
  • Design choices open to change before 1.0: the inline read is an option on get rather than a second method; normalizeQuery keeps keys it does not know; add's options keep their camelCase names.

Verification

  • npm run verify: typecheck, build, 197 unit tests in 27 files, all passing.
  • Integration tier against the API-testing instance: 42 passed, 3 skipped (the custom-fields suite runs on local instances only; the embedded-image upload is opt-in because an image cannot be deleted). Live tests cover the inline read in exactly one request, select on list and page, and a normalised rest-1 query reading the same rows as its QueryBody, with an expect-zero control.
  • The packed tarball, installed in an empty project: all three import paths resolve and type-check under nodenext for both an ESM and a CommonJS consumer (checked on the first commit of this branch).

After merge

Tag v1.0.0-alpha.7 to stage the publish.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm

Nothing breaks. Added:

- attachments.list / page take a `select`; the extra values come back
  under `selected`, translated and typed by what was selected.
- attachments.get(id, { inline: true }) reads metadata and bytes in one
  query.v1 request (Content as Base64 beside the row) for a small file.
- normalizeQuery: a query in rest-1's spellings (sel, a textual where,
  comma-joined lists, a "size,start" page) as a QueryBody.
- @versionone/agility-sdk/testing with FakeAgilityClient: the real client
  over a transport that answers what a test scripted, in the model's
  shape; an unscripted read throws rather than reading as empty.
- apiErrorFromResponse(status, data): the fetch transport's error for a
  refused response, for a custom Transport to throw the same.
- @versionone/agility-sdk/wire: the wire modules under their own import
  path; the root keeps exporting them for this alpha.

The three entries are built with shared chunks in both formats, so a
class is one class whichever path imported it (the CommonJS test proves
it). Spec 000 gains section 5a for the entries and the fake.

Docs: Page.more as the pager's signal when total is null; kind "usage"
means nothing was sent; what baseUrl is for with a custom Transport;
client.query's stale notes on retries and details. README's stale
"extend" and "no registry package" sections and CONTRIBUTING's pull
request target now describe the repository as it is.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
… guarded send keeps its request id

FakeAgilityClient, from a chat-bot consumer's trial of the branch:
- resolve.numbers / resolve.ref find a number among every scripted row,
  so a test names no number root (which roots exist is the SDK's
  business and changes between releases);
- a query from the alias of a create in the same batch answers the
  scripted row of that type under the created OID;
- localize answers onLocalize labels and echoes any other tag, as loc-2
  does for a tag it does not know;
- an unscripted meta.v1 type read answers 404, so a client the code under
  test builds on fake.transport reads rows as scripted.

Outcome.requestId after sendGuarded and batch.run was always null: the
outcome is merged from the guard's passes, and a merge dropped the id
even when there was one pass. One send now keeps its id (a CLI consumer).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
The attachments service was the one place the SDK renamed meta.v1's
attributes (oid, name, filename, contentType, createdBy), against spec
000 section 3. list, page, info, get and add now answer a row under the
attribute names (_oid, Name, Filename, ContentType, Description,
CreateDate, "CreatedBy.Name") plus `id`, the number attachment.img
addresses. A `select` on list / page therefore adds its keys to the row
itself, typed by what was selected, and the `selected` bag introduced
earlier on this branch never ships. get answers the served type as
`servedContentType` beside the recorded `ContentType`.

Breaking for attachments only; the changelog has the migration field by
field.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
…sports

- AttachmentInfo no longer extends Asset: it has `_oid`, `id`, the six
  metadata keys and whatever a `select` named, and nothing else, so a
  read the migration missed (row.filename, row.FileName, an unselected
  custom attribute) is a compile error. Type tests pin it, here and
  against the packed tarball for ESM and CommonJS.
- FakeAgilityClient: a read-back through a create's alias answers the
  scalar values the create sent over the scripted row (which stands in
  for what the server adds, a Number); a doc example for telling two
  queries of one type apart.
- Docs, from a browser app consumer with its own Transport: a 304 on an
  `acceptNotModified` request resolves undefined after onResponse (a duty
  alpha.5 added without listing it as breaking); `retries` and
  `timeoutMs` configure the built-in transport only; `client.meta`
  answers the model's Metamodel, not meta.v1's document.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
@jallers
jallers merged commit 4be80d6 into master Nov 26, 2026
4 checks passed
@jallers
jallers deleted the claude/alpha-7 branch November 26, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants