Skip to content

Export Siren's full typed taxonomy; wire mypy strict lint#3

Open
alexstandiford wants to merge 2 commits into
mainfrom
rocky/sdk-taxonomy
Open

Export Siren's full typed taxonomy; wire mypy strict lint#3
alexstandiford wants to merge 2 commits into
mainfrom
rocky/sdk-taxonomy

Conversation

@alexstandiford

Copy link
Copy Markdown
Contributor

What

Charter 761 (SDKs speak the taxonomy) — the SDK becomes the typed carrier of Siren's domain vocabulary so integrations reach for SDK enums instead of magic strings (doctrine: global-taxonomy-and-sdk-doctrine).

Typed taxonomy

  • New str-valued enums in siren.types, exported from the package root (same pattern as WebhookEventType): EventSlug (built-in ingestion slugs sale/refund/site-visited), ConversionStatus, TransactionStatus, ObligationStatus, PayoutStatus, FulfillmentStatus, OpportunityStatus, ApiKeyStatus, WebhookSubscriptionStatus.
  • WebhookEventType: 4 missing events addedCREDIT_ISSUED, CREDIT_REDEEMED, CURRENCY_CREATED, CURRENCY_DELETED. The Siren service registers dispatchers for all four but the SDK and openapi.yaml never listed them. Both updated.
  • tests/test_taxonomy.py pins every vocabulary to the canonical set mined from the service (webhook dispatchers + REST validations). Stale 28-count assertion in test_webhooks.py updated to 32.

Linter wiring (repo-agent-readiness-standard)

  • The repo had no ci.lint. Wired mypy --strict over src/siren ([tool.mypy] in pyproject, mypy>=1.8 in dev extras), declared as ci.lint in navigator.yaml, enforced by a new CI lint job. Mirrors siren-node's typecheck-as-lint contract.
  • Fixed the two findings strict mypy surfaced (an Any return in backoff-delay, an unparameterized dict annotation — no behavior change).

Source of truth

Vocabularies mined from Novatorius/siren (the taxonomy owner). Noted upstream inconsistency (encoded as-is, flagged for founder): obligation machine paths write complete while the management REST surface accepts fulfilled — both included in ObligationStatus.

Verification

  • pytest: 90 tests green (was 78; +12 taxonomy pins)
  • mypy (strict): no issues in 10 source files

🤖 Generated with Claude Code

https://claude.ai/code/session_0138jQKyzwyDfEbbAeMmYNnL

alexstandiford and others added 2 commits July 19, 2026 21:29
…lint

Siren owns its domain vocabulary (global-taxonomy-and-sdk-doctrine); this SDK
is the typed carrier of it so integrations never hand-roll magic strings.

- Add EventSlug (built-in ingestion slugs) and status enums:
  ConversionStatus, TransactionStatus, ObligationStatus, PayoutStatus,
  FulfillmentStatus, OpportunityStatus, ApiKeyStatus,
  WebhookSubscriptionStatus (all str-valued, exported from the package root).
- WebhookEventType: add CREDIT_ISSUED, CREDIT_REDEEMED, CURRENCY_CREATED,
  CURRENCY_DELETED — dispatched by the service but missing from the SDK and
  openapi.yaml.
- Pin the canonical vocabularies in tests/test_taxonomy.py (mirrors the
  service's dispatchers and REST validations).
- Wire mypy --strict as the repo lint (pyproject [tool.mypy], navigator.yaml
  ci.lint, CI lint job); fix the two findings it surfaced.

Charter 761 (SDKs speak the taxonomy).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0138jQKyzwyDfEbbAeMmYNnL
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