Repository navigation
Closed
Description
Outcome
#86 proved read-only interoperability: protocol/qsearch-lifecycle/v1 (status only) plus a TypeScript status client, both checked against goldens generated by the Python implementation. The issue said explicitly that cancellation and replacement "write semantics need a separate follow-up after interoperability is proved". This is that follow-up. The goal is to let a non-Python host request refresh, cancel and replace through the existing service endpoints, without creating a second lifecycle authority or any retry or automation that changes the server's guarantees.
Starting point
- The Python
LifecycleClientalready has explicitrefresh,cancelandreplacecalls (docs/qsearch-lifecycle.md, "Explicit host controls"). Each makes one signed POST and binds the method, path and body in the MAC. - Contract v1 deliberately excludes them. A v1 client refuses them with
UNSUPPORTED_CAPABILITY.
First milestone and strict scope
- Contract v2. Publish
nano.qsearch.lifecycle-wire.v2as an additive version and leave v1 frozen. It must pin:- POST body bytes: empty for refresh and cancel; canonical JSON of a
predator.qsearch.request.v2for replace. - Body SHA-256 framing.
- Response binding:
- a control response must bind the requested digest;
- a replace response must bind the new descriptor digest, plus
lineage.replaces_request_digest == original.
- The control-specific error codes:
CANCELLATION_*,REPLACEMENT_*,ORIGINAL_ATTEMPT_UNRECONCILED,NEW_IDENTITY_REQUIRED,NEW_TARGET_REQUIRED,REQUEST_BUSY.
- POST body bytes: empty for refresh and cancel; canonical JSON of a
- Goldens. Derive them from the real service with fake providers only, following the [P1][hillclimb] Publish a portable lifecycle wire contract and TypeScript read-only client #86
regen.pypattern. Record any Python discrepancy as a strict-xfail compatibility test. - TypeScript. Add
refresh/cancel/replaceto the TS client behind an explicit capability set chosen by the caller. A client created for status-only must keep refusing them.
Wire and governance rules
- Each call makes exactly one POST and is never retried. A lost acknowledgement maps to
TRANSPORT_UNAVAILABLEwithnext_action: MANUAL_RECONCILIATION(Python parity), never to an assumed success. - A cancellation request is not cancellation. Only a later status showing
execution.status: CANCELLEDconfirms it. The client never infers cancellation from a timeout, a deadline or an acknowledgement. - Replace is refused locally before I/O unless the caller supplies a new request ID, a new digest and a different target. Server-side refusal stays authoritative.
- Calling a client method grants no host or provider authority. ATLAS authority, reservation and budget checks stay server-side and unchanged. No budget logic goes in clients.
- No endpoint, schema identity, receipt, provider or ledger changes. [P1][language] Define typed prepare, sample and optimize operations for quantum comm-ops #61 native operations stay out of scope.
Acceptance matrix
- Bytes and MAC: the bytes and MAC for each control match Python byte for byte, with synthetic keys.
- Exactly one POST:
- every control is exactly one transport call (zero when refused locally);
- nothing follows a response automatically: no status read, retry, cancel or replace.
- Binding: a replace response with the wrong descriptor digest or parent digest is
INVALID_RESPONSE. - Cancellation histories stay distinct, and none is reported as confirmed cancellation unless execution is
CANCELLED:- lost acknowledgement
- cancel already dispatched
- provider reports
RUNNING/DONE/ERRORafter the cancel request
- Compatibility: v1 fixtures and v1 clients stay byte-stable and keep passing.
- Runs offline: fake providers or local simulator only; no live connection or spend.
Dependencies and lane boundary
- Builds on [P1][hillclimb] Publish a portable lifecycle wire contract and TypeScript read-only client #86 (test(protocol): lifecycle wire contract v1 and Python-derived goldens (#86, 1/3) #91–feat(sdk): read-only TypeScript lifecycle status client (#86, 3/3) #93, ci(sdk): build and test the TypeScript lifecycle status client #100).
- Does not edit
protocol/qsearch-lifecycle/v1/. - Coordinate any shared schema with [P1][language] Define typed prepare, sample and optimize operations for quantum comm-ops #61 and [P1][hillclimb] Build reproducible offline release conformance from exact source and wheels #88: [P1][hillclimb] Build reproducible offline release conformance from exact source and wheels #88's conformance harness verifies
SHA256SUMS. - Issue creation is planning authorization only.
Metadata
Metadata
Assignees
Labels
No labels
Activity
Merge pull request #107 from AetherAI3/claude/nano101-lifecycle-wire-v2
feat(sdk): add refresh/cancel/replace to the TypeScript lifecycle cli…
fix(sdk): start both replace hashes inside the deadline
Merge pull request #108 from AetherAI3/claude/nano101-ts-controls
AetherAI3 commentedon Nov 8, 2026
Landed on green self-hosted CI with normal merges (no
--admin). Each merge was pinned to its verified head, and main's file contents equal the tested heads.31b30df:nano.qsearch.lifecycle-wire.v2, the additive contract (v1 untouched).["status"]); POST framing; Python-exact canonical replacement bytes (code-point key order, number kind taken from the lexeme,reprfloats); replace bound to the descriptor digest plus lineage; and a lost acknowledgement means observe, never an assumed effect.NOT_RUN), 18 real service errors and 18 negatives.replacetakes a parsed Mapping, so duplicate keys and depth limits are the caller's parser's concern, and Python has no capability set.9e14862: the TSLifecycleClientgains refresh/cancel/replace behind capabilities, plus a lexeme-preserving canonicaliser and an injected SHA-256.StatusClientand v1 behaviour are unchanged.npm test121/121 against the Python v2 and v1 goldens. CI: Node 20/24 green, plus all 6 required checks.fieldis now unspecified forINVALID_RESPONSEnegatives, matching v1.Follow-up owned by the #88 lane: a
lifecycle_wire_v2conformance capability that pins the v2SHA256SUMS,regen --checkand 8 stable v2 test IDs.