Skip to content

v0.2.0 — Ruby 3.3+, latest dependencies, working admin engine, stripe 19

Choose a tag to compare

@Davidslv Davidslv released this 27 Sep 19:34
· 8 commits to main since this release
f9a873d

Warning

Breaking changes for hosts (pre-1.0, so this is a minor bump):

  • Generated billing code targets stripe ~> 19.0 (was ~> 13.0) and
    raises Billing::GatewayError where Stripe errors used to escape.
    Hosts that rescued Stripe::* from the generated services must rescue
    Billing::GatewayError. Match your Stripe webhook endpoint's API
    version to 2026-08-26.dahlia.
  • Generated code is not rewritten by a gem upgrade. See "Fixed" for the
    manual steps (engine spec/dummy/config/cable.yml, admin engine).

Added

  • Integration suite: a default seams:install host must resolve its
    bundle on a multi-platform lockfile (x86_64-linux, aarch64-linux,
    arm64-darwin, x86_64-darwin). Guards the #42 class, where a gem shipping
    only some native platforms broke bundle on Rails 8 lockfiles. Completes
    #48.

  • Community and AI-era repository standards: SUPPORT.md, GOVERNANCE.md,
    MAINTAINERS.md, CITATION.cff, .editorconfig, .github/FUNDING.yml,
    an llms.txt machine-readable index, and AGENTS.md instructions for AI
    coding agents. doc/explanation/ARCHITECTURE.md gains a "Where this design would
    strain" section. Blank issues are now routed through the issue chooser.

  • Install generator: ships an opinionated quality toolchain — a host is hardened
    from the first CLI run. seams:install installs strong_migrations
    (+ initializer, audits all migrations via start_after = 0) and lefthook
    (lefthook.yml: pre-commit rubocop, pre-push specs) by default, and wires a
    from-scratch db:migrate safety check into the generated CI. The rubocop/
    brakeman/bundle-audit gems the generated CI shells out to are now injected
    into the host Gemfile too. herb (HTML+ERB lint + .herb.yml) is available
    but off by default — opt in with --herb — because its platform-specific
    native gem breaks cold installs on multi-platform lockfiles (see commit
    6c16c52). strong_migrations and lefthook are opt-out via
    --no-strong-migrations / --no-lefthook. Also closes two gaps where Seams
    generated migrations that nothing validated — the host CI now vets them.

  • Permissions engine (bin/seams permissions): generates a host-editable
    role → ability grant map at config/initializers/seams_permissions.rb, backed
    by Seams::PermissionRegistry / Seams::Permissions and the
    authorize_permission! controller helper. See [doc/reference/PERMISSIONS.md].

  • Admin engine (bin/seams admin): opt-in Administrate dashboards with a Pundit
    Platform/Tenant policy split and an admin audit trail writing
    Core::AuditLog rows. See [doc/explanation/ARCHITECTURE_WAVE_11.md].

  • Design engine (bin/seams design, --shell): a themeable design system —
    33 ui_* components, Tailwind v4 @theme tokens + component CSS,
    Design::FormBuilder, a /design/guide gallery, and a design:component
    generator; --shell also generates an application layout and a starter
    signed-in dashboard. See [doc/design-system/DESIGN_SYSTEM.md].

Changed

  • Generated host pins: rspec-rails is injected as ">= 7.1", "< 9" (was
    "~> 7.1") in the host Gemfile and each engine Gemfile, so Rails 7.2+
    hosts get rspec-rails 8.x. The generated CI uses actions/checkout@v7
    and a postgres:18 service; the Kamal Postgres accessory comment moves
    to postgres:18 and its volume to /var/lib/postgresql (18's layout).
  • Billing generator: the generated engine now targets stripe-ruby 19
    (gem "stripe", "~> 19.0", was ~> 13.0), which pins Stripe API version
    2026-08-26.dahlia. Existing hosts run bundle update stripe and should
    move their webhook endpoint to the same API version (the handlers accept
    both shapes meanwhile). Changes in the generated code:
    • New Billing::Stripe::Payload reads Stripe objects and webhook hashes
      alike. Handlers and Invoices::SyncService read the invoice's
      subscription from invoice.parent.subscription_details.subscription and
      the period end from items.data[0].current_period_end (both moved in
      2025-03-31.basil). The old top-level invoice.subscription and
      subscription.current_period_end are still read as fallbacks.
    • invoice.paid now stores Stripe's status_transitions.paid_at as
      paid_at instead of the time the webhook arrived.
    • Fixed #dig calls on SDK responses (Gateways::Stripe#normalise_subscription,
      Invoices::SyncService#paid_at_for). Stripe::StripeObject has no #dig,
      so these raised NoMethodError on real API responses.
    • Billing::Stripe::Client re-raises every Stripe::StripeError as
      Billing::GatewayError (original on #cause). Every generated caller
      already rescued Billing::GatewayError, but the gem-backed client never
      raised it, so Stripe errors escaped StripeService, the checkout and
      portal services, and CreateLifetimeSessionService. Hosts that rescued
      Stripe::* errors from these services should rescue
      Billing::GatewayError instead.
    • The webhook endpoint answers 400 (not 500) to a signed v2 thin event;
      stripe-ruby 19's Stripe::Webhook.construct_event raises ArgumentError
      for those.
    • Stripe event fixtures under spec/fixtures/stripe/ use the dahlia shapes
      and carry api_version.
  • Dependencies: Ruby 4.0.7 (repo, CI, and the generated host's
    .ruby-version / Dockerfile default), Rails 8.1.4, RuboCop 1.91 (+
    rubocop-rails 2.38, rubocop-performance 1.27), SimpleCov 1.3, brakeman
    8.0.6, sqlite3 2.9.6, yard 0.9.45, and the docs-site on Astro 7.3 / Starlight 0.42. Patches the
    websocket-driver 0.8.0 advisories (CVE-2026-54463/54464/54465/61666)
    and the docs-site devalue, nanoid, and postcss advisories. CI moves to
    actions/setup-node@v7.
  • Documentation: doc/ is now organised into Diátaxis folders —
    tutorials/, how-to/, reference/, design-system/,
    explanation/, plus internal/ for maintainer-facing working
    documents. Published URLs on the docs site are unchanged (the site
    flattens the folders), and the site's in-page cross-links — which
    previously shipped as raw .md hrefs and 404'd — now resolve to the
    real page URLs.
  • Engine generator: ApplicationController now requires authentication by default. Opt out via skip_before_action :authenticate_identity! in controllers serving public flows. [BREAKING for hosts that explicitly relied on engines being unauthenticated by default.]
  • Notifications generator: preferences controller now uses an explicit
    permit list from the channel/type registry rather than permit!.
    Eliminates the brakeman mass-assignment warning shipped with generated
    engines. Hosts that have already ejected
    app/controllers/notifications/preferences_controller.rb will not
    re-generate it (per the template_unless_ejected contract); to pick
    up the new behaviour, replace
    params.require(:preferences).permit! in the ejected copy with
    params.require(:preferences).permit(*Notifications::Preferences.allowed_keys)
    and require notifications/preferences from
    lib/notifications.rb.
  • Teams generator: TeamsController now includes Teams::Authorization and applies require_team_member! as a before_action on show, and require_team_admin! on edit, update, and destroy. Previously those actions had no resource-level membership guard, letting any authenticated identity act on any team by ID. The require_team_member! and require_team_admin! predicates in the concern now redirect to teams_path with an alert rather than returning a bare 403, matching the convention used by the other team controllers.

Fixed

  • Admin engine UI: the sidebar and every New / show / edit / destroy link
    were missing, because Administrate reads the host's routes and a mounted
    engine's routes are not in them. existing_action? and a navigation
    partial now read the engine's routes; authorized_action? uses the
    policy of the resource being linked. An _index_header override builds
    the New link from the controller. Creates now write an admin audit row
    (Administrate's create never set requested_resource). The admin
    README documents the authenticator and membership resolver that tenant
    mode needs.

  • bin/audit (the pre-push gate) failed from a linked git worktree:
    the hook's exported GIT_DIR made bundle-audit --update pull its
    advisory database against this repo. It now clears git's hook
    variables for that command.

  • gemspec: required_ruby_version is now >= 3.3.0 (was >= 4.0.0), so
    bundle add seams resolves on Ruby 3.3 and 3.4 hosts. CI runs the spec
    suite on 3.3, 3.4, and 4.0. RuboCop targets 3.3 so 4.0-only syntax is
    caught. Ruby 3.2 is end-of-life and SimpleCov 1.x requires 3.3.
    Fixes #79.

  • host_inject_gem dropped every version requirement after the first, so
    a range like (">= 7.1", "< 9") was written as ">= 7.1" only.

  • Admin generator: the host no longer gets mount Admin::Engine and an
    Admin.configure initializer stub from the base engine step. The engine
    lives at Seams::Admin::Engine, so every host that ran seams:admin
    raised NameError on boot. seams:engine gains --skip-host-wiring
    for canonical generators that wire the host themselves. The admin engine
    now runs in the rails-new integration suite.

  • Admin engine: every dashboard request failed. Fixed the chain found by
    driving a generated host over HTTP:

    • routes point at /admin/... controllers (isolate_namespace resolved
      admin/identities to Seams::Admin::Admin::IdentitiesController) and
      sit in scope as: :admin so Administrate's admin_* helpers exist;
    • the base controller includes Auth::Authentication, so
      current_identity resolves; signed-out visitors are redirected to
      sign-in, non-staff get 403;
    • policies resolve as Admin::<Platform|Tenant>::<Resource>Policy via
      Pundit's policy_class: (the array lookup produced
      Module::Auth::IdentityPolicy);
    • dashboards declare self.model; association fields take a
      dashboard: option (Admin::Fields::BelongsTo / HasMany);
    • the Admin::* controllers get the engine's route helpers, the
      accounts/teams membership route-key clash is dispatched by record
      class, flash messages use the real model name, and verify_authorized
      no longer names a non-action (ActionNotFound on Rails 7.1+);
    • the admin dummy app registers the abilities its tenant policies
      check, and the tenant role specs use a concrete policy.
      The integration suite signs in as anonymous, non-staff, and staff and
      asserts every dashboard's index and new page plus a create.
  • Generated bin/docker-entrypoint now runs db:prepare for the
    Dockerfile's own bundle exec rails server -b 0.0.0.0 command. It only
    checked the first three arguments, where server never appears, so a
    seams-built container started against an empty database. Verified by
    building and running a generated host (all engines) against Postgres 18.

  • Engine dummy apps now ship spec/dummy/config/cable.yml (test adapter).
    solid_cable 4.1 reads config_for("cable") at boot, so every generated
    engine spec suite failed to load in a host that bundles solid_cable.
    Engines generated before this release need the file added by hand:
    engines/*/spec/dummy/config/cable.yml containing test: /
    adapter: test.

  • Nightly link check: lychee retries each link 5 times (10s apart) before
    reporting it, and a failing run updates the open broken-link issue
    instead of filing a new one. Closes #93 and #109, both transient
    connection resets on contributor-covenant.org.

  • Teams generator: InvitationsController#accept now redirects unauthenticated requests to the sign-in path (stashing the token in the session under pending_invitation_token) instead of raising ActiveRecord::RecordInvalid. The host's sign-in flow is responsible for reading return_to and redirecting back after authentication.

  • Teams generator: InvitationsController#accept now verifies that the signed-in identity's email matches the invitation email (case-insensitively) before creating the membership. Previously any authenticated identity holding a valid token could accept the invitation under a different account.

  • Billing generator: scoped_invoices / scoped_subscriptions now return
    .none when the current customer ref is nil. The previous behaviour was
    an information disclosure: Rails translates
    .where(customer_ref: nil) to WHERE customer_ref IS NULL, which
    matches every invoice and subscription row whose customer_ref has not
    yet been linked to a Stripe customer — typically including manual,
    draft, or test records seeded by other staff. The fix returns an empty
    relation when there is no customer to scope by.

    Hosts that have already ejected
    app/controllers/billing/invoices_controller.rb or
    subscriptions_controller.rb will not re-generate them (per the
    template_unless_ejected contract). To pick up the fix, prepend each
    scope helper with:

    return Billing::Invoice.none if current_billing_customer_ref.nil?
    

    (likewise Billing::Subscription.none in the subscriptions helper)
    before the existing .where(customer_ref: …) line.