Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Atproto Lexicon Contracts Laravel Package

revolution/atproto-lexicon-contracts

PHP contracts for AT Protocol lexicons: typed interfaces and value objects that keep atproto records, XRPC payloads, and schema handling consistent across Laravel apps. Code against stable abstractions instead of raw arrays.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This package is a type-contract artifact, not a runtime library: auto-generated PHP interfaces and enums derived from AT Protocol Lexicon schemas. It carries value only if you also own the layers around it — concrete DTO implementations, hydration/serialization (ATProto uses DAG-CBOR for repository records and JSON for XRPC), and an XRPC transport client. PHP interfaces cannot be instantiated, so the package supplies the shape of the domain but none of the behavior. In a Laravel codebase this maps cleanly to a hexagonal/anti-corruption boundary — contracts at the edge, Eloquent and domain services untouched — but it is additive scaffolding, not a solution.

Integration feasibility. Mechanically trivial: composer require + PSR-4 autoload, zero transitive dependencies, zero framework coupling, MIT-licensed. The friction is entirely in trust and provenance, and there are two concrete red flags worth surfacing before any engineering time is spent:

  1. Vendor/repository mismatch. The package is published as revolution/atproto-lexicon-contracts while the source repository is invokable/atproto-lexicon-contracts. Unexplained namespace divergence in a Composer package is either a fork with unmerged changes, a rename in flight, or an unverified listing — all of which require a manual diff against the upstream before the first composer require.
  2. Zero adoption signal. 0 stars, 0 dependents, near-zero composite score. There is no evidence of production use, no issue history to mine for known gaps, and no community to inherit maintenance from.

Technical risk. The dominant risk is lexicon drift, and it is structural rather than incidental:

  • Closed enums are a backward-compatibility trap. PHP enums are closed sets. When an upstream Lexicon adds a value (routine in ATProto's evolving schema), the generated enum becomes incomplete and any exhaustive match in your code fatals at runtime. Enum regeneration is therefore a semver-major event for consumers, not a patch.
  • Regeneration churn. Auto-generated output changes shape with generator version, not just schema version. Without a pinned commit and a reproducible generator, upgrades are opaque diffs.
  • Single-version FQCN constraint. You cannot load two Lexicon versions side by side under one namespace, which blocks graceful schema-migration windows.
  • Encoding gap. The package does not appear to address CBOR/DAG-CBOR encoding, which is where most real-world ATProto interop bugs live and where PHP ecosystem support is thin.

Key questions for the maintainer/owner.

  • Which generator produced this output, at which commit, against which Lexicon versions and NSIDs?
  • Is regeneration automated in CI, and is drift from upstream lexicon detected?
  • What is the intended serialization path (CBOR libraries, JSON encoding strategy) and is it tested?
  • Why does the Composer vendor differ from the repository owner?
  • Is there a commitment to tag releases against Lexicon schema versions, and what is the enum-addition policy?

Integration Approach

Stack fit. Compatible with Laravel 8–12 given a PHP 8.1+ floor (enums). Verify the generated code's use of readonly properties, never returns, and typed class constants — if present, the floor rises to PHP 8.2/8.3 and must be pinned in composer.json platform config and CI matrix. No service provider, config, or migration surface, which is a genuine plus: nothing to register, nothing to boot, nothing to break during framework upgrades.

Migration path. This is greenfield — no incumbent to displace. The correct posture is treat it as vendored source, not a dependency. Recommended shape:

  1. Fork or copy into an internal namespace (e.g., App\Contracts\AtProto\...) so the public API is yours to evolve.
  2. Pin to a commit SHA, never a floating constraint; record the upstream Lexicon version set alongside it.
  3. Wrap access behind an application-owned adapter — AtProtoRecordSerializer, PostMapper — so no controller, job, or model ever references a generated interface directly.
  4. Add a contract test suite that round-trips representative records through your encoder and asserts against real ATProto payloads.

Compatibility. Watch for namespace collisions with any existing ATProto or Bluesky SDK already in the dependency graph; if you adopt a competing client later, the generated FQCNs will fight for the same names. Also confirm the package declares no replace/provide claims that would mask a conflict.

Sequencing.

  • Phase 0 — due diligence (1–2 days): diff generated output against an independently generated set from current upstream Lexicons; confirm the vendor/repo discrepancy; verify license headers survive in generated files.
  • Phase 1 — internalization: vendor into internal namespace, pin commit, wire CI to re-run the generator and fail on diff.
  • Phase 2 — serialization layer: build and test the CBOR/JSON encode-decode path before any feature depends on the contracts.
  • Phase 3 — one bounded context: integrate a single read-only or publish-only flow (e.g., posting to Bluesky) behind a feature flag. Measure hydration cost.
  • Phase 4 — widen: only after a full lexicon-update cycle has been exercised end to end.

Operational Impact

Maintenance. Effectively you are adopting a generator workflow, not a library. Budget for a recurring ritual: watch upstream Lexicon changes, regenerate, diff, review, release. Call it 2–4 hours per schema cycle, plus unbounded time when the diff is large. With 0 stars and 0 dependents, the bus factor is 1 and abandonment should be assumed as the base case — MIT licensing makes the fork-and-own path legitimate and probably correct.

Support. No community triage, no SLA, no known-good production corpus. Internal ownership of the generated code and its tests is a prerequisite, not a mitigation. Escalation path is "read the Lexicon spec," which is well documented — this is the saving grace.

Scaling. Runtime cost is near zero: interfaces and enums are compile-time constructs, opcache-friendly, no reflection required for autoloading. The scaling risk is application-side: reflection-based or generic hydration mappers over dozens of generated types will dominate request time in hot paths. Prefer hand-written or code-generated hydrators, cache compiled serializers, and benchmark record mapping under realistic payload sizes before rollout.

Failure modes. Ranked by likelihood × impact:

  • Enum exhaustion — upstream adds a case, your exhaustive match throws UnhandledMatchError in production. Mitigate with a default arm mapping to a domain-level Unknown value, plus alerting on that path.
  • Silent field drift — new Lexicon fields unmarshalled into a void; records write back incomplete. Mitigate with round-trip tests against live payloads.
  • Regeneration breakage — a generator bump renames or restructures types, failing static analysis or CI; caught early if generation is deterministic and diffed.
  • Namespace collision on later SDK adoption; painful to unwind once references spread.
  • Supply-chain exposure — an unverified vendor publishing generated code is a soft target; vendor-in and hash-pin to close it.

Ramp-up. Consuming the interfaces: under a day for a mid-level PHP developer. Building the serialization and hydration layer: 1–2 weeks including test fixtures, and this is the real cost center. Owning the generation pipeline and lexicon-update process: 2–3 weeks before it is trustworthy. Total credible time-to-production for a single integration: 4–6 engineer-weeks, of which the package itself contributes almost nothing.

Recommendation. Do not adopt as a direct Composer dependency at its current maturity signal. Use it as a reference implementation — fork, pin, namespace internally, and treat the generated contracts as a starting artifact you own. The interfaces are cheap to reproduce and expensive to depend on.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel