Repository navigation
feat(sdk): TypeScript refresh/cancel/replace controls (wire v2) (#101, 2/2) - #108
Merged
Merged
Conversation
AetherAI3
changed the base branch from
claude/nano101-lifecycle-wire-v2
to
main
November 8, 2026 13:06
…ent (wire v2) Additive v2 client per protocol/qsearch-lifecycle/v2 (Nano #101, PR2): - LifecycleClient with a caller-chosen capability set (default status); ungranted operations are UNSUPPORTED_CAPABILITY with zero transport calls. - refresh/cancel: one POST, empty body; replace: canonical body, MAC over its SHA-256 via an injected sha256 capability (createSha256 in ./webcrypto). - Binding: refresh/cancel to the requested digest; replace to the descriptor digest and lineage.replaces_request_digest; full v1 validation. - Transport failure or timeout on a POST is TRANSPORT_UNAVAILABLE with MANUAL_RECONCILIATION; responses are returned as is, never interpreted. - src/canonical.ts reproduces Python canonical_json(json.loads(text)) byte for byte from JSON text or UTF-8 bytes (lexeme-preserving parser, code-point key order, Python float repr). - StatusClient is a thin wrapper over the shared engine, behaviour unchanged. - Tests: client suite, canonical dev set derived from the Python reference, property tests, v2 drift guard, fetch POST body, and a v2 golden runner that fails until the Python fixtures land. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Independent review (no CRITICAL/HIGH) found the injected sha256 capability could be invoked after the deadline had settled a replace call. Reproduced by a failing test; both hashes now start together. Refs #101 Co-Authored-By: Claude Opus 5.5 <[email protected]>
AetherAI3
force-pushed
the
claude/nano101-ts-controls
branch
from
November 8, 2026 13:07
e9ae6bb to
d219288
Compare
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.
Summary
Adds
LifecycleClientto@nano/qsearch-lifecycle. It provides status plus refresh / cancel / replace, each available only when the caller grants it, per wire contract v2. Every control makes exactly one signed POST and returns the server's state unchanged. The client never retries, never follows up and never interprets cancellation.StatusClientand all v1 behaviour are unchanged. PR 2 of 2 for #101; based on PR 1. Closes #101.Key Changes
["status"]. An operation that was not granted fails withUNSUPPORTED_CAPABILITYbefore any I/O.canonical_json. The response must bind the descriptor digest and lineage.TRANSPORT_UNAVAILABLEwithMANUAL_RECONCILIATION, never a state.createSha256()lives in./webcrypto. The fetch adapter sends bodies only on POST.Verification
npm test: 121/121 against the Python v2 goldens and the v1 goldens.pack:checkinstalls outside the checkout.Risk / Follow-ups
UNEXPECTED_REDIRECT/NONE(v1 rule, Python parity). There is no client-side cap on replacement size; the service returns 413.🤖 Generated with Claude Code