Skip to content

Phase 3 SP4 — CLI dlw + Python SDK#18

Merged
l17728 merged 14 commits into
mainfrom
feat/phase-3-sp4-cli-sdk
May 19, 2026
Merged

Phase 3 SP4 — CLI dlw + Python SDK#18
l17728 merged 14 commits into
mainfrom
feat/phase-3-sp4-cli-sdk

Conversation

@l17728
Copy link
Copy Markdown
Owner

@l17728 l17728 commented May 19, 2026

Summary

  • Python SDK dlw.sdk: sync Client + async AsyncClient, each with tasks.{submit,get,list,cancel,delete} + DownloadTask.{wait,refresh}; typed error hierarchy mapped to POSIX exit codes; config precedence (flag>env>config>default), token-only auth.
  • dlw CLI (argparse, stdlib — matches dlw-executor): submit/list/show/cancel/delete/watch, -o table|json, exit codes per spec §4.1; CLI-is-SDK. New [project.scripts] dlw= entry.
  • Purely additive — only new src/dlw/sdk/*, src/dlw/cli/*, tests, docs + one scripts line. No controller endpoint/model/schema/migration/lint change; alembic head + uv.lock + deps unchanged. Phase 3 sub-project 4 of 4 (SP1 Phase 3 SP1 — Multi-tenancy (OIDC + RBAC + tenant scoping + quota) #15, SP2 Phase 3 SP2 — Multi-source (SourceDriver + NameResolver + LPT/chunk routing) #16, SP3 Phase 3 SP3 — Incremental download + global dedup (refcount/GC) #17 merged) — completes Phase 3.
  • Pre-execution 2-opus review fixed 2 BLOCKERs before code (httpx 0.27.2 ASGITransport is async-only → sync/CLI tested via httpx.MockTransport, async via the proven test_tasks.py ASGITransport pattern; _fixtures.py __all__). Final whole-impl opus review: MERGE-READY, 0 CRITICAL/HIGH.

Test plan

  • uv run pytest green: 427 passed (381 prior + 46 new SDK/CLI), 0 fail/0 error
  • invariant_lint / lint_no_direct_status_write green; openapi unchanged (no api yaml change); alembic head 7636b35e4881 unchanged; no dep/lock diff
  • SDK sync (MockTransport) + async (real ASGI app + DB) + CLI exit-code coverage

Spec: docs/superpowers/specs/2026-05-19-phase-3-sp4-cli-sdk-design.md
Plan: docs/superpowers/plans/2026-05-19-phase-3-sp4-cli-sdk.md

Known MVP limitations (deferred on purpose, documented in docs/operator/cli-sdk.md §6): client-side list filter; polling watch/wait (no events endpoint); token-only auth (no OIDC); cancel --reason accepted-but-not-persisted.

🤖 Generated with Claude Code

l17728 and others added 14 commits May 19, 2026 11:00
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
R1 (BLOCKER): httpx 0.27.2 ASGITransport is async-only -> sync Client/CLI
tests use httpx.MockTransport (tests/sdk/_mock.py); async AsyncClient e2e
mirrors tests/api/test_tasks.py (async aclient fixture + ASGITransport).
No uvicorn live-server (cross-loop engine hazard).
R2 (BLOCKER): tests/sdk/_fixtures.py declares explicit __all__ incl. the
underscore autouse fixtures (from..import * would drop them).
R3: cancel asserts == "cancelling" (cancel_task never sets cancelled sync).
R4: --reason accepted-but-not-persisted documented as MVP limitation.
R5: Task 11 no longer hardcodes suite count / alembic head.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… transport

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ript

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@l17728 l17728 merged commit dd8fe15 into main May 19, 2026
12 checks passed
@l17728 l17728 deleted the feat/phase-3-sp4-cli-sdk branch May 19, 2026 06:11
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.

1 participant