Skip to content

Add wf.installations namespace (sync and async) - #3

Merged
gbelote merged 1 commit into
mainfrom
greg/xenon/installations-namespace
Oct 6, 2026
Merged

gbelote merged 1 commit into
mainfrom
greg/xenon/installations-namespace

Conversation

@gbelote

@gbelote gbelote commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary

Mirrors wefunder-node #21.

  • wf.installations on both Wefunder and AsyncWefunder: eligible_targets(), list(), get(), create(), mint_token(), revoke(), and install_or_mint_token(). All six operations are GA in the public spec and were already generated, but only reachable via wf.call(op, ...).
  • install_or_mint_token(body) handles the API's 409 already_installed answer: it mints a token for details["installation"], re-requesting the same scopes so a retry never widens the grant. Any other error still raises, including an already_installed with no details["installation"].
  • mint_token(id, scopes=None) sends no body when scopes is omitted (the install's ceiling) and a real {"scopes": []} for an explicit empty list, which grants nothing.
  • Six new per-operation examples (removed from the curl-only allowlist); the guides/install-target snippet now uses the namespace. examples_manifest.json rebuilt. README updated.

Verification

  • ruff check, ruff format, pytest (all passing, incl. new tests/test_installations.py with sync + async coverage, and the existing install-target guide test against the rewritten example), python scripts/build_examples_manifest.py.
  • pyright locally reports only pre-existing import-resolution noise (same on main); CI runs it against the installed package.

🤖 Generated with Claude Code

All six installation operations are GA and were already generated, but only
reachable through wf.call(...) on the generated module. This adds a typed
namespace (eligible_targets, list, get, create, mint_token, revoke) plus
install_or_mint_token, which folds in the API's 409 already_installed answer
by minting a token for details.installation with the same scopes.

The six per-operation examples are new (off the curl-only allowlist) and the
install-target guide now uses the namespace.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@gbelote
gbelote requested a review from rivetbot October 6, 2026 05:16

@rivetbot rivetbot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 9b985a9. No actionable correctness findings. Sync/async namespaces consistently use generated operations, preserve create/mint envelopes, distinguish omitted scopes from [], and reuse supplied scopes on the already-installed fallback.

CI generated parity and Python 3.11–3.13 lint, format, pyright, pytest and build passed: https://github.com/Wefunder/wefunder-python/actions/runs/37417736487

Source review only; I did not run local tests or make live calls. Live sandbox e2e was skipped.

@gbelote
gbelote merged commit 85c2872 into main Oct 6, 2026
5 checks passed
@gbelote
gbelote deleted the greg/xenon/installations-namespace branch October 6, 2026 15:46
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.

2 participants