Skip to content

[P1] Add a bounded quantum job lifecycle with explicit status, queue deadlines and cancellation #59

Closed

Description

@AetherAI3

Problem

Nano's quantum HTTP surface currently exposes submission and same-request recovery. service.py returns 404 for GET; runtime_ibm.py separates pending outcomes internally, but clients still need bespoke runner/resume scripts to operate them. J11's overnight queue stall exposed the missing bounded lifecycle.

A socket timeout, queue-wait deadline, accounting-reconciliation window and QPU execution cap measure different things. None should silently substitute for another.

Work packet

  1. Specify a versioned job-state envelope and authenticated, read-only status operation keyed by existing request identity. Include provider status, outcome, accounting status, held/settled usage and a bounded next-action code.
  2. Add cancellation through the authorized host/provider adapter, with a durable cancellation-request event and terminal confirmation. Fence automatic resume/replacement first. Do not treat timeout as cancellation or cancellation request as terminal success.
  3. Give the host policy explicit queue and accounting deadlines using injected clock/state in tests. Expiry stops waiting and proposes the permitted next action; it never automatically creates an unbounded replacement.
  4. A replacement backend uses a new target-bound plan and request identity linked to the old attempt. At most one outstanding execution per logical attempt; never reuse one digest for different circuits.

Acceptance

  • Fake-clock 11-hour queue scenario produces bounded polling and a clear queue-expired state.
  • Restart, repeated status, repeated cancel and lost acknowledgements do not create duplicate provider submissions.
  • Queue→running/done races reconcile the actual job before any replacement.
  • Unknown usage remains held; confirmed-zero settlement depends on the dedicated accounting issue.
  • Status reads cannot submit or change budget.
  • SDK/client errors carry stable code, field path where relevant, retryability and next action, with no credentials.
  • Distinguish queued, running, execution-failed/cancelled, accounting-pending and fully settled; no single misleading success flag.

Delivery and boundary

First PR: status/state contract and fake-provider tests. Second: authorized cancellation/deadline integration. Coordinate ATLAS and Predator adapters rather than duplicate their ledgers. Build on #52 or its merged successor. No live jobs, cancellation or spend is authorized by this issue; keep existing budgets and default-off hardware gates.

Activity

  1. AetherAI3 commented on Nov 1, 2026

    @AetherAI3
    OwnerAuthor

    Acceptance audit complete: all four work packets and seven acceptance bullets are met in the merged code. Versioned authenticated GET is provider/runtime/budget read-only; execution/outcome, accounting and held/settled usage remain independent. Authorized cancellation is durably requested/fenced before I/O, dispatch is recorded before the RPC, and only provider terminal evidence confirms cancellation. Injected queue/accounting deadlines stop waiting; explicit replacement uses a new target-bound plan, request ID and digest, with atomic lineage and outstanding-execution fencing. Socket timeouts, queue expiry, accounting windows and QPU caps remain distinct.

    The full-run JUnit contains 137 passing lifecycle/zero-lifecycle cases with no skips/failures, including fake-clock11-hour bounded polling/QUEUE_EXPIRED, restart/repeated status/cancel/lost acknowledgements without duplicate submission, running/done races, held unknown usage, strict authenticated #58 zero proof, read-only status, stable sanitized client errors and linked replacement. The captain checked every mapped acceptance test name against the successful JUnit, and verified merged runtime byte identity to that tested tree. No global success flag conflates execution and accounting.

    Reproducible code/evidence: lifecycle contract, fake-clock/restart/cancel/replacement tests, authenticated status tests, SDK/HTTP tests. Status source#71 and controls source#78 are included by exact ancestry in integration#82; ATLAS/Predator adapters coordinate existing ledgers rather than duplicating them.

    Merged integration receipts:

    • Nano #82: main cb6ea884d63dcaa8cc0e7c0b952bb88784e8219f, tree 04a3ea8489259583f5cbb274dc94f3bd7f1a98fb.
    • ATLAS #188: claude/qcomms-hw0-atlas-multipub at db6a30eb50fd096af870843e80e31385629ba7a3, tree eb68e5ef09909395d6bd86c6a763e73b92ad37a7.
    • Predator #460: claude/qcomms-hw0-pilot at 34adff73a31631be5b3c2b49303a42416f258a2e, tree 13eab966351332c2fad58f380c6a37e76cf497e4.

    Actual target branches, parents and trees were verified after each merge. Private integration branches are stated precisely; their default main branches were not these merge targets. The human explicitly answered “Yes, merge using local tests” to waiving the earlier self-hosted gate for these three named integration PRs. That waiver and exact commands/source pins/counts/skips/review limitations are preserved in their bodies. Cloud41322926091 remains FAILED STARTUP: zero jobs/check runs, not a passing test or runner result.

    Local combined Nano: 2446 passed,3 unrelated optional skips, zero failures/errors at 5e4373dbd8e093f50398ed46146ec167911352cc. Merged runtime/compiler/test code is byte-identical; only README/status differ. Final availability/docs/host checks at 7d8fdaeb6d35eebe374b9a1c9f16809b07795578: 26 passed,1 existing README-count skip, local ideal demo100/verified. Exact merged Predator tree: 522 passed,zero skipped/failed at efa7cb6ef0b3481330eb6db1634ecc99f0835ad8. ATLAS combined local evidence201passed/0failed, plus the108-pass nonblocking component suite and cross-repo execution in the full Nano/Predator tests. No live quantum job, cancellation, spend, credential/runner/security setting change, production activation or formal GitHub approval was performed. Default-off hardware gates and existing budgets are preserved.

    Issue #61 remains open for its separate unfinished prepare/sample service-wire acceptance; its partial source inclusion is not treated as completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions