Skip to content

Phase 6.1 — SDK update (TypeScript + Python), prêt à publier#15

Merged
proofoftrust21 merged 4 commits intomainfrom
phase-6.1-sdk
Apr 22, 2026
Merged

Phase 6.1 — SDK update (TypeScript + Python), prêt à publier#15
proofoftrust21 merged 4 commits intomainfrom
phase-6.1-sdk

Conversation

@proofoftrust21
Copy link
Copy Markdown
Owner

Résumé

Promotion des deux SDKs de RC à GA 1.0.0 avec correctifs mineurs de drift.

  • TS @satrank/sdk : 1.0.0-rc.11.0.0
  • Python satrank : 1.0.0rc11.0.0

Tests : 125/125 TS ✅, 116/116 Python ✅. Smoke live contre https://satrank.dev ✅.

Changements

Drift corrigés

  1. MINORAdvisoryBlock.recommendation passe de 3 à 4 valeurs (ajout "consider_alternative", aligne sur le serveur).
  2. BREAKING-docssdk/README.md réécrit pour la surface narrow 1.0 (prior README documentait encore SatRankClient 0.x).
  3. Narrative"AI agents""autonomous agents on Bitcoin Lightning" dans les descriptions.
  4. CleanupApiClient.getAgentVerdict() supprimé (code mort, jamais wiré au public).

Phase 12C (transparent au SDK)

Le sunset des enums AgentSource 'observer_protocol' → 'attestation' et BucketSource sans 'observer' (PR #14) n'impacte pas le SDK — aucune référence trouvée. Mentionné dans les CHANGELOGs.

Livrables

  • Code : 7 fichiers modifiés dans sdk/ et python-sdk/
  • Docs Phase 6.1 : docs/phase-6.1/{SDK-DRIFT-AUDIT,SDK-INTEGRATION-TEST,RELEASE-NOTES-DRAFT,SDK-UPDATE-REPORT}.md
  • CHANGELOGs : sdk/CHANGELOG.md + python-sdk/CHANGELOG.md (nouveaux)
  • Artefacts locaux construits mais non commités :
    • sdk/satrank-sdk-1.0.0.tgz (40.3 kB, 58 files)
    • python-sdk/dist/satrank-1.0.0-py3-none-any.whl + satrank-1.0.0.tar.gz

Anomalie signalée (non-blocking)

Divergence cross-SDK préexistante sur error.code pour les statuts HTTP connus :

  • Python préserve le code serveur (ex. INVALID_CATEGORY)
  • TypeScript substitue par le code de classe (ex. VALIDATION_ERROR)

Non-bloquant pour 1.0 (consommateurs utilisant instanceof ne sont pas affectés). Reporté post-1.0.

⚠️ PUBLISH GATE

Ce PR n'a PAS publié le SDK. La gate est fermée et respectée :

  • ❌ pas de npm publish
  • ❌ pas de twine upload
  • ❌ pas de gh release create
  • ❌ pas de git tag v*

Checklist de publication manuelle (Romain)

Quand tu ouvres la gate :

  • Merger ce PR dans main
  • cd sdk && npm publish (nécessite login npm 2FA)
  • cd python-sdk && twine upload dist/satrank-1.0.0* (nécessite token PyPI)
  • git tag v1.0.0 && git push origin v1.0.0
  • gh release create v1.0.0 --notes-file docs/phase-6.1/RELEASE-NOTES-DRAFT.md
  • Annonce Nostr (npub SatRank)

Notes détaillées dans docs/phase-6.1/RELEASE-NOTES-DRAFT.md.

Test plan

  • npm run build (TS) ✅
  • npm test → 125/125 ✅
  • npm run lint
  • pytest → 116/116 ✅
  • mypy --strict
  • ruff check
  • Smoke live TS contre satrank.dev (listCategories + resolveIntent invalide) ✅
  • Smoke live Python contre satrank.dev (idem) ✅
  • npm pack
  • python -m build
  • À valider par Romain : narrative, wording CHANGELOG/release notes, ouverture de la gate

Promote both SDKs from RC to stable 1.0.0 with minor drift fixes.

TypeScript (@satrank/sdk)
- Add "consider_alternative" to AdvisoryBlock.recommendation union (matches
  the four server values)
- Remove dead ApiClient.getAgentVerdict() (never wired to the public surface)
- Rewrite README for the narrow 1.0 surface (SatRank, fulfill, listCategories,
  resolveIntent, wallet drivers, parseIntent) — the previous README still
  documented the deprecated SDK 0.x SatRankClient
- Narrative: "AI agents" -> "autonomous agents on Bitcoin Lightning"
- Version: 1.0.0-rc.1 -> 1.0.0

Python (satrank)
- Add "consider_alternative" to AdvisoryBlock.recommendation Literal
- Narrative update in pyproject.toml description
- Version: 1.0.0rc1 -> 1.0.0

Validation
- 125/125 TS tests pass, tsc build + lint green
- 116/116 Python tests pass, mypy --strict + ruff green
- Live smoke against https://satrank.dev: /api/health 200 (schema v41,
  8186 agents), /api/intent/categories shape OK, invalid category surfaces
  ValidationSatRankError correctly in both SDKs

Phase 12C note
- AgentSource/BucketSource enum sunset (PR #14) is transparent: neither SDK
  references the enums. No code change required here.

Docs
- docs/phase-6.1/SDK-DRIFT-AUDIT.md (S1 deliverable)
- docs/phase-6.1/SDK-INTEGRATION-TEST.md (S4 deliverable)
- docs/phase-6.1/RELEASE-NOTES-DRAFT.md (S5 deliverable, for manual publish)
- docs/phase-6.1/SDK-UPDATE-REPORT.md (S6 deliverable)
- sdk/CHANGELOG.md and python-sdk/CHANGELOG.md (new)

PUBLISH GATE remains closed: artifacts built locally only
(sdk/satrank-sdk-1.0.0.tgz untracked; python-sdk/dist/ gitignored).
No npm publish / twine upload / gh release / git tag has been run.
See RELEASE-NOTES-DRAFT.md for the manual publication checklist.
…Stable, fix keyword drift

Pre-publish adjustments for SatRank SDK 1.0.0 GA.

License — both SDKs to MIT (client-side permissive, max adoption)
- sdk/package.json: "license": "AGPL-3.0" -> "MIT"
- sdk/README.md: license section -> MIT
- sdk/LICENSE: new MIT file (copyright 2026 Romain Orsoni / SatRank)
- sdk/package.json "files": add "LICENSE" to the npm publish list
- python-sdk/LICENSE: new MIT file (matches existing
  pyproject.toml license = { text = "MIT" })

Python metadata
- classifiers: "Development Status :: 4 - Beta" -> "5 - Production/Stable"
  (coherent with 1.0.0 GA)
- keywords: "ai-agents" -> "autonomous-agents" (narrative consistency
  with the TS SDK and the rest of the Phase 6.1 wording)

Rationale
- MongoDB / Elastic pattern: server core stays AGPL-3.0 (protects the
  SatRank oracle backend); client SDKs are MIT (removes friction for
  agent developers). The economic protection via L402 on paid endpoints
  is orthogonal and unchanged.

Artifacts rebuilt (not committed — matches prior policy)
- sdk/satrank-sdk-1.0.0.tgz: 41.0 kB, 59 files, bundles LICENSE + README
- python-sdk/dist/satrank-1.0.0-py3-none-any.whl + .tar.gz: LICENSE
  auto-included by setuptools in dist-info/licenses/
- Stale python-sdk/dist/satrank-1.0.0rc1.* removed during clean rebuild.

PUBLISH GATE remains closed. No npm publish, no twine upload, no
gh release, no git tag. Ready for manual publish per
docs/phase-6.1/RELEASE-NOTES-DRAFT.md once validated.
Adds a postgres:16-alpine service container to the test job with
healthcheck so the Node test harness's globalSetup can connect and
bootstrap the template DB. DATABASE_URL env var matches the default
that src/tests/helpers/testDatabase.ts falls back to.

Fixes the CI failure pattern observed on PR #13:
  Error: connect ECONNREFUSED 127.0.0.1:5432
  at Object.setup (src/tests/helpers/globalSetup.ts:25:22)

Credentials mirror the satrank/satrank/satrank default used locally so
we do not diverge test expectations between dev and CI. GitHub Actions
waits for the service healthcheck to pass before starting the job
steps, so no external wait-for-it script is needed.
@proofoftrust21 proofoftrust21 marked this pull request as ready for review April 22, 2026 07:20
@proofoftrust21 proofoftrust21 merged commit 32fdee2 into main Apr 22, 2026
2 checks passed
@proofoftrust21 proofoftrust21 deleted the phase-6.1-sdk branch April 22, 2026 07:21
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