Skip to content

feat(sdk): read-only TypeScript lifecycle status client (#86, 3/3) - #93

Merged
AetherAI3 merged 2 commits into
mainfrom
claude/nano86-ts-status-client
Nov 8, 2026
Merged

AetherAI3 merged 2 commits into
mainfrom
claude/nano86-ts-status-client

Conversation

@AetherAI3

Copy link
Copy Markdown
Owner

Summary

Adds @nano/qsearch-lifecycle, a zero-dependency TypeScript client that reads Nano job state through the v1 wire contract. One status() call makes exactly one authenticated GET and returns a validated state. It never makes a second request, polls, cancels or touches budgets. PR 3 of 3 for #86; based on PR 2. Closes #86.

Key Changes

  • Caller-injected capabilities only — The caller must supply transport, signer, clock and nonce; nothing is read from env, storage or discovery, and keys never enter the client.
  • Strict parsing and validation — Duplicate keys, unsafe numbers, booleans used as numbers, extra members and any invariant break are refused before a result is returned.
  • Bounded, leak-free errors — Error codes are fixed, messages contain no URL, key, header or body, and timeouts never invent a terminal state.
  • Status only — Cancel, refresh, replace and [P1][language] Define typed prepare, sample and optimize operations for quantum comm-ops #61 native operations fail explicitly with UNSUPPORTED_CAPABILITY.

Verification

  • 81/81 node --test against the Python goldens from PR 1/2 (Node 24.18, TypeScript 5.8.3).
  • Held-out set (24 cases, frozen before any code, never shown to the implementer): 24/24.
  • Packed tarball installs and runs its example outside the repo with no Python; types resolve under node10, node16 and bundler.
  • Two independent reviews found no CRITICAL or HIGH issues; the MEDIUM fixes are in candidate 3 of 3 (see HILLCLIMB.md).

Risk / Follow-ups

  • No CI job builds the SDK yet, and GitHub CI is billing-locked; evidence is local only.
  • The package is private and nothing is published.

🤖 Generated with Claude Code

AetherAI3 and others added 2 commits November 7, 2026 18:45
Add sdk/typescript/qsearch-lifecycle (@nano/qsearch-lifecycle, private,
ESM, zero runtime deps, typescript 5.8.3 dev-only) implementing the frozen
nano.qsearch.lifecycle-wire.v1 status surface (Nano #86, PR2):

- StatusClient: status() is exactly one signed GET (zero when refused before
  I/O); all capabilities injected (transport, signer, clock, nonce, timer);
  one deadline bounds signing + exchange; no retry/poll/cancel/refresh/replace;
  supports()/requireCapability() refuse every operation but status.
- Strict RFC 8259 parser (duplicate keys, unsafe numbers, depth 64,
  null-prototype objects) and a hand-written closed-envelope validator equal
  to job-state.v1.schema.json incl. I1-I8; Python _call check order kept so
  Python-detected failures report field null.
- LifecycleClientError with constant message and no URL/key/header/nonce/
  body/cause.
- Optional adapters: ./webcrypto (HMAC-SHA256 signer, random nonce) and
  ./fetch (explicit fetch, manual redirects, streaming cap at max+1, abort).
- Tests (node:test on dist/): client, parser, validator with a differential
  schema oracle, fetch, webcrypto, wire/schema drift, example, and a golden
  runner that fails (never skips) until Python fixtures are merged.
- README, offline example, pack:check out-of-checkout install proof,
  HILLCLIMB.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Second independent review, candidate 3 of 3:
- A signer result with a spoofed Uint8Array tag threw inside a promise
  callback: unhandled rejection plus a misleading retryable
  TRANSPORT_UNAVAILABLE. The MAC (and the webcrypto key) are now copied via
  internal typed-array slots and every signer-result fault maps to
  CLIENT_CONFIGURATION(signer). Reproduced by a failing test first.
- TypeScript node10 consumers could not resolve the package (TS2307); add
  main/types/typesVersions and ship the MIT LICENSE inside the package.
- README: cleartext warning for http base URLs; number edge cases.

Refs #86

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

[P1][hillclimb] Publish a portable lifecycle wire contract and TypeScript read-only client

1 participant