Skip to content

Release 1.0.0-alpha.12: client.lists; unknown config keys refused; a handed-in built-in transport no longer resends twice over - #68

Merged
jallers merged 15 commits into
masterfrom
claude/list-values
Nov 26, 2026
Merged

jallers merged 15 commits into
masterfrom
claude/list-values

Conversation

@jallers

@jallers jallers commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Up to date with master, which has the integration-tier hardening and alpha.11; the diff is this release alone.

Breaking

A config object with a key its factory does not know is refused. new AgilityApiClient(config, options) (both objects), createFetchTransport(config) and new FakeAgilityClient(config) throw a UsageError at construction for a key that is not theirs. Until now such a key was ignored without a word; a compiler tells a TypeScript caller, and nothing told a JavaScript or JSDoc-checked one (a consumer's fetchImpl on the client's config did nothing for several releases).

  • The message names the key or keys, suggests the nearest known key for a typo ("retrys" (did you mean "retries"?)), lists the keys the factory takes, and never repeats a value: a config holds credentials. A test puts a secret in the config and asserts it is in neither the message nor details.
  • A key is refused whatever its value, undefined included: the name is the mistake. A known key may be undefined.
  • One list of keys per factory, typed so that it does not compile when it and the config type drift apart in either direction; a test proves both.
  • Not covered: the per-call option objects of client methods.
  • Migration: read each of those three calls and remove or correct any key the README does not list. The two likeliest causes are an option in the wrong object (transport and types go in the client's second argument; onError is the client's, not the transport's) and a config object shared with other code that added keys of its own.

Fixed

A built-in transport handed to a client was given the resend and timeout rules a second time. With new AgilityApiClient(config, { transport: createFetchTransport({ …, fetchImpl }) }), until now the only way to supply a fetch of one's own, a read that failed with a 5xx, a 429 or a lost connection was sent four times instead of two. Present since alpha.5; found by a CLI consumer in published alpha.11. No write was ever resent by it, and nothing is resent after a timeout.

  • The transport createFetchTransport returns now declares that it applies both rules itself, and the client adds neither, whether it made the transport or was handed it. Its own retries and timeoutMs are then the ones that count. Spec 000 §6 states the invariant: each rule once, in one place.
  • The rule stays inside the built-in transport because only there is the response at hand, with its Retry-After.
  • A caller's own wrapper around the built-in transport is still a custom transport and gets the client's rules; the README says to make the inner one with retries: 0, timeoutMs: 0.

Changed

More is known about "retry-write" (no behaviour change). A browser-app consumer checked the case that matters most to a browser, a credential that had been valid and expired: on one product release an api/asset batch of creates and a rest-1 attribute write were each answered 401 and not applied, and a query.v1 read got the same 401; no 403 and no redirect was seen. The doc comment, spec 000 and example 09 say so. Still not checked: a 403, other releases, other ways of signing in. A 401 can carry a body or none; all are kind: "auth", and transportConformance has each as a case.

Added

  • fetchImpl in the client's config: the fetch the built-in transport calls.

client.lists: which values a list-typed attribute (Status, Priority, Source, Category, a custom dropdown) may take, and the one a name means. It asks the server's api/ValidValues, as the product's own pickers do.

const { Status } = await client.lists.values({ asset: "Story:1077", attributes: ["Status"], select: ["Order"] });
await client.lists.values({ type: "Defect", scope: "Scope:1005", team: "Team:1030", attributes: ["Priority"] });

const done = await client.lists.value({ asset: "Story:1077", attribute: "Status", name: "done" });
await client.send([{ from: "Story:1077", update: { Status: done._oid } }]);
  • lists.values: a map from attribute to rows { _oid, Name, …selected } in the list's own order. One request per attribute, one after another. Nothing is cached.
  • lists.value: the whole name, ignoring case and surrounding space; an OID is accepted and checked to be among the valid values; match: "prefix" also takes the start of the name or of a word in it. It never picks among several: NO_SUCH_VALUE or AMBIGUOUS_VALUE (both kind: "invalid"), each with the candidates as rows in details.values.
  • client.fields.describe(type, scope) gains lists: which of a form's attributes are list-typed, and the list type of each.
  • /wire: validValues.forAsset / forNew. /services: lists. /testing: fake.onValues({ Status: rows }) and fake.valuesAsked.
  • examples/12-list-values.ts, a README section "List values", a paragraph in spec 000 §6.

What the server does (proved live)

The integration test brings a world of its own: a Scope under the system project with its own Scheme, global statuses and priorities in and out of that Scheme, a Team that owns three statuses (one inactivated), a Team that owns none, and a Story on each team and on none.

Question Answer
What decides the list The scope's scheme: only the values selected in it. Control: another scope has none of them.
A team with its own process Its statuses replace the scheme's, for Status only; Priority still comes from the scheme. { asset } alone applies it.
A team that owns no status Changes nothing.
An inactive value Left out. There is no "none" entry.
A base type (PrimaryWorkitem) Accepted.
An asset not created yet, on a team The team must travel inside the context, joined to the scope by a comma. teamoid is silently ignored in that form and the scheme's values come back; a semicolon is a 400.
Does a write agree with the list Only partly. A status outside a team's process is refused (Violation'PrimaryWorkitemCannotHaveInvalidStatus). A status the scope's scheme does not select is accepted. So the list is what to offer, and lists.value is what keeps a name from becoming a value the project does not use.
Values Every one a string, numbers included. Dates come in the server's culture format, so select refuses a date.

Decisions a reviewer should know

  • Only relations to a list type. The endpoint takes no page and no filter and answers any attribute whole (every member or iteration in a scope). "No read is unbounded" is an invariant of this SDK, so for Owners, Team, Timebox and the like the service throws a UsageError before sending, naming the bounded read to use. The /wire module is the endpoint as it is, and its header says so.
  • No fallback. On an instance without the endpoint the call fails as the server's 404. Offering every value of the list type instead would be a different answer presented as the same one. From which product release the endpoint exists is not established here.
  • Requests go one after another, not in parallel: a form asks for a handful of attributes, and the instance is shared.
  • fields.describe grew a key. A consumer that compares its whole answer with toEqual adds lists.
  • Two faults found by consumers trying the branch, both fixed here. A schema missing an ancestor of the list type (a test serving only some meta.v1 types) made the service say "not a list type" and advise another read; it now names the type it could not load (NOT_FOUND). And the fake, given no metamodel, refused an unscripted attribute in words a server's metamodel would not produce; it now says in its own words that nothing was scripted.

Reference data on the testing instance

The API-testing instance now holds nine permanent assets, put there by its owner so consumers can prove valid values against real data: a team with its own process and its three statuses (named sdk-reference …), and five global story statuses with the product's own names, selected in the default scheme (three roll up as Active, Done and Accepted as Closed). This pull request:

  • lists them by OID in AGENTS.md, with the rule that nothing creates, edits, closes, reorders or deletes them;
  • makes deleteFixtures refuse, before any request, a list that contains any of those OIDs, the default scheme or the system project, and refuse anything named sdk-reference (it reads the names first);
  • adds two read-only live tests against them, which skip on an instance that has none;
  • removes spec 000's statement that the instance has no story status.

Verification

At the head commit (7fbe4f4):

  • npm run verify: 289 unit tests in 36 files, all passing.
    • Unknown keys: refused by all three factories and by the client's options; typo suggestions; a key in the wrong object; every documented key accepted (an object typed Required<Config>, compared with the list); the undefined rules; no value in the message or details; a client made by withSignal not refused.
    • Resends: attempts counted for the three ways of building a client (from its config with a fetch; a built-in transport handed in; a custom transport) against a 502, a lost connection, a 429 with Retry-After and a timeout: 2, 2, 2 and 1 in all three; a timeout ends at one deadline.
    • List values: the unit fixtures are a response captured from the endpoint with identities replaced.
  • No example, test or document of the SDK's own passes a key that is now refused.
  • The integration tier against the API-testing instance, which runs every example as a consumer would: 91 passed, 3 skipped by design, including lists.test.ts (10 tests) and all twelve examples. The nine permanent assets read back as described.
  • Fixtures: before the lists test was written, each type it creates (Team, StoryStatus, WorkitemPriority, Scheme, Scope, Story) was created and deleted once by exact OID and confirmed unreadable afterwards. The test deletes dependents first and then queries every created OID by type; anything still readable fails the run. No existing Scheme, Scope or Team is touched.
  • Two consumers installed an earlier commit of the branch and tried client.lists: a CLI consumer (fake, refusals, and a read-only live call returning the reference team's statuses in order) and a chat-bot consumer (its suite passing; live, the same statuses as its previous two-query path in both the team and the scheme context, and a name resolved and written on a fixture story of its own).

After merge

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

🤖 Generated with Claude Code

https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm

… a name means

Over api/ValidValues, which applies the scope's scheme and the team's
process. lists.values answers rows per attribute for an asset or for a
type in a scope (and on a team); lists.value resolves a name or an OID
to the one valid value, or throws NO_SUCH_VALUE / AMBIGUOUS_VALUE with
the candidates as rows. Only relations to a list type are asked for:
the endpoint cannot be paged or filtered. fields.describe says which
attributes are list-typed; the fake scripts values with onValues.

Proved live on fixtures of the suite's own (a scope with its scheme, a
team with a process, a team without), each deleted by exact OID.

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

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
…ake says when an attribute was not scripted

Two consumer findings. A schema missing Status or List made the service
conclude 'not a list type' and advise another read. And the fake, with
no metamodel, refused Owners in words a server's metamodel would not
produce.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
…d-only, and guarded from cleanup

Four assets named sdk-reference are there to stay (AGENTS.md lists
them). deleteFixtures reads the names first and refuses a list that
holds any of them; the live lists test reads the reference team's
statuses; spec 000 no longer says the instance has no story status.

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

They carry the product's own names, so the cleanup guard knows them (and
the reference team's four, the default scheme and the system project) by
OID as well as by the sdk-reference prefix. AGENTS.md lists all nine; a
read-only live test asserts what the system project offers.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
@jallers
jallers marked this pull request as ready for review November 26, 2026 18:18
AGENTS.md said all five scheme statuses read Active; two now read
Closed. The live test asserts each status's RollupState.

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

The client could not tell that a transport it was handed was the
built-in one and wrapped it again, so a failed read was sent four times
instead of two. The transport createFetchTransport returns now declares
that it applies both rules itself. The client's config also takes
fetchImpl, so a fetch of the caller's own no longer needs a transport.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
@jallers jallers changed the title Release 1.0.0-alpha.12: client.lists, the values a list-typed attribute may take Release 1.0.0-alpha.12: client.lists; a handed-in built-in transport no longer resends twice over Nov 26, 2026
…e place; count attempts for every way of building a client

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
…hing is applied; conformance cases for a 401 with a body

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
new AgilityApiClient, createFetchTransport and new FakeAgilityClient
throw a UsageError at construction for an unknown key: it names the key,
suggests the nearest known one, and never repeats a value. A misspelt
or misplaced option was ignored without a word, which a compiler tells a
TypeScript caller and nothing told a JavaScript one. Each factory's key
list is tied to its config type and does not compile if they drift.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
@jallers jallers changed the title Release 1.0.0-alpha.12: client.lists; a handed-in built-in transport no longer resends twice over Release 1.0.0-alpha.12: client.lists; unknown config keys refused; a handed-in built-in transport no longer resends twice over Nov 26, 2026
@jallers
jallers merged commit 0559313 into master Nov 26, 2026
4 checks passed
@jallers
jallers deleted the claude/list-values branch November 26, 2026 19:33
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