Slide 1

Slide 1 text

"Does architecture still matter when AI writes the code?" V.Dementyev, Evil Martians THE SILICON HEEL #NotADystopia #NoVibedBS San Francisco, 2026

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

In the end, does it even matter?* * spoiler: yes, go buy the book :-)

Slide 4

Slide 4 text

Code complexity Human coordination Why we used to care about architecture

Slide 5

Slide 5 text

Complexity is redefined Teams are shrinking Expectations are rising The paradigm shifts

Slide 6

Slide 6 text

Performance Stability Feedback loop What still matters

Slide 7

Slide 7 text

Vibe-coded feature human intervention

Slide 8

Slide 8 text

Performance Stability Feedback loop What still matters

Slide 9

Slide 9 text

–My gut feeling “Architecture is the key to maintainable and high-quality generated code.”

Slide 10

Slide 10 text

Fizzy Authorization: base vs. action_policy Adding a new role: viewer The experiment Order No 2026 Add a new role: viewer. - Viewers can see accessible boards and cards on them - Viewers cannot be assigned to cards - Viewers can comment on cards but only on cards being triaged - Viewers cannot create cards or boards - Viewers has no access to other parts of the app - The restrictions hold even for user owned cards/comments Ensure there is no UI controls associated with actions not available to viewers.

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Fizzy: authz Base Model predicates Concerns before_action guards Layered Policies authorize! / allowed_to? / authorized_scope

Slide 13

Slide 13 text

module User::Role extend ActiveSupport::Concern included do enum :role, %i[ owner admin member system ].index_by(&:itself), scopes: false end def can_change?(other) (admin? && !other.owner?) || other == self end def can_administer?(other) admin? && !other.owner? && other != self end def can_administer_board?(board) admin? || board.creator == self end def can_administer_card?(card) admin? || card.creator == self end end

Slide 14

Slide 14 text

class CardPolicy < ApplicationPolicy authorize :board, optional: true relation_scope do |scope| scope.joins(board: :accesses).where(accesses: {user_id: user.id}) end def create? allowed_to?(:show?, board) end def manage? allowed_to?(:show?, record.board) end def destroy? allowed_to?(:manage?) && (admin? || record.creator == user) end end

Slide 15

Slide 15 text

class CardsController < ApplicationController # ... private def set_board - @board = Current.user.boards.find params[:board_id] + @board = Current.account.boards.find(params[:board_id]) + authorize! @board, to: :show? end def set_card - @card = Current.user.accessible_cards.find_by!(number: params[:id]) + @card = Current.account.cards.find_by!(number: params[:id]) + authorize! @card end - def ensure_permission_to_administer_card - head :forbidden unless Current.user.can_administer_card?(@card) - end - end

Slide 16

Slide 16 text

How to compare? Bugs/gaps (stability) Tokens usage (cost) Reviewability (human-in-the-loop-ability)

Slide 17

Slide 17 text

Viewer: naïve Prompt (one-shot): "Implement the following feature..." Review with advanced skills/agents

Slide 18

Slide 18 text

Viewer: naïve Base Unprotected actions: 7 UI gaps: 3 Files changed: 52 Layered Unprotected actions: 0 UI gaps: 6 Rule bugs: 1 Files changed: 33

Slide 19

Slide 19 text

Viewer: compound Plan, work, review, repeat (Most) Bugs/gaps are identified during development https://github.com/EveryInc/compound-engineering-plugin

Slide 20

Slide 20 text

3-phased experiment Add a viewer role Add ability to hide columns from viewers Add ability to define a minimal role to see the column

Slide 21

Slide 21 text

3-phased experiment Files Changed 0 12.5 25 37.5 50 Base (C1) Layered (C1) Base (C2) Layered (C2) Base (C3) Layered (C3) Controllers Models Views Policies ! [Base] Scattered guards: 27 controllers with before_action :ensure_contributor — each is a maintenance point for new endpoints

Slide 22

Slide 22 text

3-phased experiment P1 bugs 0 0.25 0.5 0.75 1 Base (C1) Layered (C1) Base (C2) Layered (C2) Base (C3) Layered (C3)

Slide 23

Slide 23 text

Layers win? Both authz architectures work well with AI Stricter separation of concerns reduces review surface significantly Without clear boundaries, bug can escape even when using smarter AI workflows Layers demonstrate stronger compounding effect

Slide 24

Slide 24 text

Tokens Measured /usage, not tokens (Max plan) Layered version spent ~10% more than base Planning and reviewing are the most consuming Skills have a room for improvement

Slide 25

Slide 25 text

Idioms, patterns, system design, and now... Skills and skills again Order No 2026

Slide 26

Slide 26 text

Idioms, patterns, system design, and now... AI orchestration patterns! Skills and skills again Order No 2026

Slide 27

Slide 27 text

Some skills Layered Rails: https://github.com/palkan/skills Inertia Rails: https://github.com/inertia-rails/skills ...more to come (from you?)

Slide 28

Slide 28 text

▐▛███▜▌ Claude Code v2.1.47 ▝▜█████▛▘ Opus 4.6 · Claude Max ▘▘ ▝▝ /Users/vladimirdementyev/dev/fizzy

Slide 29

Slide 29 text

▐▛███▜▌ Claude Code v2.1.47 ▝▜█████▛▘ Opus 4.6 · Claude Max ▘▘ ▝▝ /Users/vladimirdementyev/dev/fizzy > /layered-rails:analyze ● I'll run a comprehensive layered architecture analysis of the Fizzy codebase. Let me start by gathering structural information and running violation detection in parallel. ● 3 Explore agents finished (ctrl+o to expand) ├─ Analyze model concerns/modules · 69 tool uses · 44.7k tokens │ 㽾 Done ├─ Analyze controllers for violations · 65 tool uses · 43.7k tokens │ 㽾 Done └─ Analyze jobs and helpers · 47 tool uses · 38.1k tokens 㽾 Done ● Now I have all the data needed. Here's the full analysis:

Slide 30

Slide 30 text

│ 㽾 Done └─ Analyze jobs and helpers · 47 tool uses · 38.1k tokens 㽾 Done ● Now I have all the data needed. Here's the full analysis: --- Layered Architecture Analysis Summary - Overall health: Good - Layer compliance: ~90% - God object candidates: 1 (Card, via concern proliferation) - Callback concerns: 3 (minor) - Anti-patterns detected: 3 (minor) The Fizzy codebase demonstrates strong layered architecture discipline, consistent with Basecamp's "vanilla Rails" philosophy. Controllers are thin, models are rich, and side effects are well-organized. The most notable pattern is namespace-scoped concerns (e.g., Card::Closeable) rather than a flat app/models/concerns/ bag ....

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

/layered-rails:* /layered-rails:review /layered-rails:analyze:callbacks /layered-rails:analyze:gods /layered-rails:spec-test

Slide 33

Slide 33 text

Layered Design for Ruby on Rails Applications, Chapter 5, "When Rails Abstractions Are Not Enough", p.107

Slide 34

Slide 34 text

> Specification test (inferred from the implementation) describe TrelloImport do describe "#process" do context "when import succeeds" do it "sets status to processing then completed" # ✅ Domain: state transition it "records started_at and completed_at" # ✅ Domain: state tracking it "delegates to Processor" # ✅ Domain: orchestration end context "when import fails" do it "sets status to failed with error message" # ✅ Domain: state transition it "re-raises the error" # ✅ Domain: error propagation end context "when system user does not exist" do it "creates a system user on the account" # ⚠ Belongs on Account — duplicates account.system_user end end # ... end

Slide 35

Slide 35 text

> Existing Test Analysis class TrelloImportTest < ActiveSupport::TestCase test "process_later enqueues TrelloImportJob" # ✅ Domain test "process imports board from Trello JSON" # ⚠ Integration: runs full Processor, tests Processor behavior test "process imports columns from lists" # ⚠ Integration: same test "process imports cards" # ⚠ Integration: same # ... test "process sets status to failed on error" # ✅ Domain: state transition test "store_id_mapping and get_fizzy_id work correctly" # ✅ Domain: unit behavior test "accessible_to? returns true for owner"# ✅ Domain: unit behavior test "import with API credentials attempts attachment download" # ❌ Infrastructure: uses stub_request(:get, /trello\.com/) # ... end

Slide 36

Slide 36 text

Pattern-oriented architecture 2026+ Order No 2026 Idioms ! ! ! Design patterns ! ! % Architectural patterns ! % % AI orchestration patterns % % %

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

Thank you Vladimir Dementyev Evil Martians