Skip to content

Export Siren's full typed taxonomy; wire PHPStan (stack-elevator) lint#3

Merged
alexstandiford merged 3 commits into
mainfrom
rocky/sdk-taxonomy
Jul 20, 2026
Merged

Export Siren's full typed taxonomy; wire PHPStan (stack-elevator) lint#3
alexstandiford merged 3 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 constants instead of magic strings (doctrine: global-taxonomy-and-sdk-doctrine).

Typed taxonomy

  • New constant classes in Siren\Sdk (same final-class 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/TaxonomyTest.php pins every vocabulary to the canonical set mined from the service (webhook dispatchers + REST IsAny validations). Stale 28-count assertion in WebhooksTest updated to 32.

Linter wiring (repo-agent-readiness-standard)

  • phpnomad/phpstan-rules ^2.1 + phpstan/phpstan ^2.1 as dev deps; phpstan.neon.dist includes stack-elevator.neon (level 6, src/). The SDK is a flat library so the layer rules have nothing to flag today — wired so any future layered namespace is checked from day one.
  • composer lint script, declared as ci.lint in navigator.yaml, enforced by a new CI lint job (PHP 8.3).
  • Fixed the 5 findings PHPStan surfaced (missing array value types / iterator generics in phpdoc — 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

  • composer test: 86 tests, 281 assertions green (was 75; +11 taxonomy pins)
  • composer lint: PHPStan level 6 + stack-elevator, no errors
  • composer validate --strict clean

🤖 Generated with Claude Code

https://claude.ai/code/session_0138jQKyzwyDfEbbAeMmYNnL

alexstandiford and others added 3 commits July 19, 2026 21:27
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 constant classes:
  ConversionStatus, TransactionStatus, ObligationStatus, PayoutStatus,
  FulfillmentStatus, OpportunityStatus, ApiKeyStatus,
  WebhookSubscriptionStatus.
- 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/TaxonomyTest.php (mirrors the
  service's dispatchers and REST validations).
- Wire phpstan (level 6) + phpnomad/phpstan-rules ^2.1 stack-elevator.neon
  as 'composer lint', declared in navigator.yaml ci.lint and enforced by a
  CI lint job; fix the 5 phpdoc-type 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
phpnomad/phpstan-rules ^2.1 requires PHP ^8.2 but is dev-only static
analysis, never loaded at test runtime. The library still supports and
tests PHP 8.1; lint runs on 8.3 with full platform checks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0138jQKyzwyDfEbbAeMmYNnL
@alexstandiford
alexstandiford merged commit d89cec6 into main Jul 20, 2026
4 checks passed
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