Repository navigation
Release 1.0.0-alpha.9: client.search across asset types, client.deleted - #63
Merged
Merged
Conversation
…ty find is a usage error The README sent text search to rest-1's list; query.v1 honours find and findin across types. A Searching section states the server's matching rules, each with a live test and a control. An empty find answered no rows (the server's answer to a search for nothing); it now throws a UsageError before any request. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
…0.0-alpha.9 One page of mixed rows in one server-side order with the total. types is required; select and findin take plain attribute names and each row has every selected key under that name, null where its type has no such attribute, so nothing type-qualified is written or read. rest-1 answers it today (it alone takes a subtype's attribute from a base type on instances before the release that lets api/asset); the route is not part of the contract. client.deleted reads deleted assets. The fake has onSearch. Spec 000 states the one place a row carries a key its type lacks. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
Kept as its own commit so that removing it (now or at 1.0) is one change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
client.data goes with it. rest-1's list stays at /wire (rest1.list). The changelog lists it under Breaking with a migration line per use, and the README says why a search's selects are plain while its filters are sent as written. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
A Ref is { _oid } on rest-1-backed reads too: the display columns rest-1
sends beside a relation unasked are dropped instead of put on the Ref,
and a path the caller selected is at row[path]. The same select now gives
the same row whichever endpoint answers (a live test compares all three).
client.search accepts a family by its abstract type (types: ["Workitem"])
from a generated table of each abstract type's concrete subtypes; a live
test checks the table against the instance.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
… fake answers at its transport A select name none of the searched types defines is left out of the request and null on every row, so one list of columns serves any choice of types; only a name that is no attribute of any asset type is refused (from a generated set of the product's attribute names). A findin name none has is dropped; none left is refused. A date is spelled one way on every read (seven decimals, Z on a UTC attribute): query.v1, api/asset and rest-1 each wrote it differently. The schema says what is a date, so text that looks like one is untouched. onSearch answers at the fake's transport, so a client built on fake.transport searches the same way; the fake's instance has any type a scripted search names. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
TypeScript's node10 resolution ignores exports, so /wire, /services and /testing had runtime entries and no types there. Checked by compiling a consumer file against the packed package under node10, bundler and node16. Also a doc line on what fake.searched records. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
The packaging test installs the built package in a temp directory and compiles a consumer of all four import paths under each resolution (it fails under node10 without typesVersions). toDate reads a DateString without relying on a parser's tolerance for seven decimals, which the standard does not promise; the README no longer says new Date does. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
…filters and the fake's metamodel A number lookup on the fake went to real per-root queries as soon as one number root (a Request) had scripted rows, and threw on the first root without a script. It now answers from the scripted rows whichever types have them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
jallers
marked this pull request as ready for review
November 26, 2026 15:06
The standard's date-time format, which any engine's Date parses, where the model spelled seven decimals. This changes the default read path too (client.query and get answered seven). The SDK cuts to the millisecond by design: the server stores about three milliseconds, and in a live sample of 400 timestamps every digit past the third was zero. toDate goes: with three decimals it is new Date. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
A rule the instance has no sentence for is answered as its name in words.
That is a name, not a sentence written for a person, and it can read as
the opposite of what happened ("message must not be sent", of one that
was). audience is "developer" for these; the doc comment says exactly
when it is "user".
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Head
5cab0b9, withmastermerged in.Breaking
client.data.listis removed, andclient.datawith it. Its uses have named calls:client.search(below);client.query/client.queryPage(withfindandfindinfor a search);client.deleted(type, params);@versionone/agility-sdk/wire:rest1.list(client.transport, type, params).{ _oid }on every read. rest-1 sends display columns beside a selected relation unasked (Owners.Name,Owners.Nickname), and the SDK used to put them on the Ref, so the same select gave{ _oid, Name }through rest-1 and{ _oid }through the query endpoints. They are now dropped; a path the caller selected is atrow[path]. Affectsclient.history,client.template,client.deleted,client.searchand the rest-1 reads at/wire. Migration: select the path you read ("Owners.Name") and readrow["Owners.Name"]. Nothing errors if you do not;ref.Nameis simply undefined. A read with no select at all (a template) keeps every column the server sent, each under its own key."2026-09-06T13:52:51.903", three decimals,Zon a UTC attribute. That is the standard's date-time format, sonew Date(value)reads it in any engine. The three endpoints write a date three ways, and rows carried whichever the endpoint behind the call used:queryandgetanswered seven decimals,queryPagedropped trailing zeros,history/templateand the rest-1 reads answered three and a midnight as the date alone. This changes the default read path too (seven decimals → three). The SDK cuts to the millisecond, by design: the server's stored resolution is about three milliseconds (in a live sample of 400 timestamps every digit past the third was zero, and the third was only ever 0, 3 or 7), so nothing observed is lost; if an instance ever carries finer digits, they are dropped. The schema says which attribute is a date, so text that looks like one is untouched. A consumer that normalises fractions itself can stop.findthrows aUsageError. It answered no rows, which is what the server answers to a search for nothing.Changed
client.explain: a rule the instance has no sentence for is for a developer, not a user. Its explanation is the rule's name spelled out ("Refused (asset cannot inactivate closed)."), which is a name, not a sentence written for a person, and can read as the opposite of what happened: "Refused (message must not be sent)." is what it says of a message that was sent.audienceis now"developer"for these; the sentence,ruleandechoed: falseare unchanged. A consumer that shows onlyaudience: "user"sentences gives such a failure its own wording, and needs no change.Added
client.search(text, { types, select?, findin?, filter?, where?, with?, sort?, page })→{ rows, total, more }Text search across asset types: one page of mixed rows, one server-side order, the total.
typesis required and has no default: a default of "work items" silently drops requests, issues, goals and topics (two consumers measured about a fifth of the hits lost that way). It takes concrete types, or a family by its abstract type ("Workitem"), expanded from a small generated table with no extra request.selectandfindintake plain attribute names. Each row has every selected key under that name: its value if the row's type defines the attribute,nullif not, andnullon every row when none of the searched types has it, so one list of columns serves any choice of types. Only a name that is no attribute of any asset type is refused. Spec 000 §2 states this as the one place a row carries a key its type lacks.UsageError: empty text, notypes, an unknown type, a misspelt attribute, afindinwith nothing the searched types have.client.deleted(type, params): deleted assets of a type, as{ rows, total, more }.FakeAgilityClient.onSearch(rows)andfake.searched. It answers at the fake's transport, so a client the code under test builds onfake.transportsearches the same way. The fake also resolves a number of any scripted type now (a Request's number used to need every other number type scripted).typesVersionsfor/wire,/servicesand/testing: their types now resolve under TypeScript'smoduleResolution: "node"(node10), which ignoresexports.Things a reviewer should know
toDatehelper for engines that do not parse seven. With three decimalsnew Dateis the helper, sotoDatewas removed before it shipped.src/types/assets/subtypes.ts, about 8 KB): each abstract type's concrete subtypes, and the set of the product's attribute names, which is what tells "this type has no such attribute" from a misspelling.client.querywithfindis not enough across types. It works within one type or family, and the README's "Searching" section says so. OnBaseAssetthe query endpoints refuseStory.Numberand every other subtype attribute with HTTP 400 (live test).TypeCache). The README says what a short-lived process should do.typesis: unqualified, it is accepted for one type and refused for several. Documented rather than changed.client.deletedaddsIsDeleted='true'so it answers deleted assets only (live test).explainchange follows a second rule with no sentence on the instance being seen live.audience's doc comment now says exactly when it is"user".Verification
npm run verifyon5cab0b9: 249 unit tests in 32 files, all passing. Among them: a packaging test that installs the built package in a temp directory and compiles a consumer of all four import paths under node10, node16 and bundler resolution (it fails under node10 withouttypesVersions).c7c619d(the commit before theexplainchange): 79 passed, 3 skipped by design; every suite's fixtures deleted (the cleanup fails a suite otherwise). On5cab0b9the client suite, which exercisesexplainon real failures, ran again: 12 passed. Pinned live, among the rest: one asset read through query.v1, api/asset and rest-1 with one select gives equal rows, dates included, each date in the three-decimal spelling and round-tripping throughnew Date; the mixed search page (sixteen types, one request, plain keys, an Issue'sNumber, the total, one order); a column none of the searched types has is null and the search is made;types: ["Workitem"]and the subtype table checked against the server; the matching rules; the index lag; the refusals with nothing sent;client.deleted.explainchange): two migrated their find toclient.searchon trial branches. A chat-bot consumer's suite passed (220 tests) with the fake answering its own client; it reads no dates from these calls. A CLI consumer's suite passed and ten live runs of its find and asset commands were byte-identical to the same commands on the released alpha.8; it normalises dates to three decimals itself, which is now what the SDK answers, so that step can go. A browser-app consumer confirmed the Ref rule costs it nothing and takes the day from a template's date by slicing, which holds for either spelling. Both consumers that renderexplain's sentences have been told of that change.After merge
Tag
v1.0.0-alpha.9to stage the publish.🤖 Generated with Claude Code
https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm