ADR 0153: Remove Class Variables (classState:)

Status

Implemented (2026-11-26) — Epic BT-5144. Accepted 2026-11-24. See Implementation Tracking.

The owner has decided the following; this ADR records and details it.

The seven questions the draft left open were settled by the owner on acceptance. They are recorded under Decisions on the open questions.

This supersedes ADR 0130 and ADR 0019, supersedes §1 of ADR 0013 (class variables; its class-method and instantiation sections stay), and amends ADR 0142 (rules 1 and 2 of §1 have nothing left to test), ADR 0084 (classVars:, and where runtime funs run), ADR 0123 (the no-class-variable rule for migrations) and ADR 0124 (late classState:).

How to read the evidence. A claim marked (read) was checked by reading the cited code or document on main at f1fcd5e. (survey) means it comes from the owner's usage and cost survey, relayed by the session that commissioned this ADR, and was not re-checked here; the downstream repositories are outside this session's access. (inferred) follows from what was read but was not checked directly. Nothing in this ADR was verified by running the system.

Context

Problem statement

classState: declares a mutable class variable, the Beamtalk form of a Smalltalk class-side instance variable.

sealed Object subclass: MyRegistry
  classState: current = nil

  class current => self.current
  class current: instance => self.current := instance

A Smalltalk class variable is shared memory. The BEAM has no shared mutable memory, so ADR 0130 emulates it: the variables live in the class's gen_server (the class process), and a class method of a class that declares any runs inside that process. That makes a class with classState: an actor already, but one with its own rules, its own machinery and its own bugs. Three facts say it is not worth keeping.

1. Nothing uses it.

WhereclassState: declarations
stdlib/src0. Four files mention it, all in doc comments (behaviour.bt:238, 263, class_builder.bt:126, 300, system_navigation.bt:1116, process_dictionary.bt:26) (read)
examples/0 (read)
src/ of beamtalk-agents, announcements, buccaneer, catalina, hpack, http, linear, mint, oauth, yaml, symphony, exdura, liquid0; every hit is a doc comment (survey)
stdlib/test, tests/repl-protocol, test-package-compiler/cases118 files declare one (90 in stdlib/test/fixtures, 18 in tests/repl-protocol, 10 in test-package-compiler/cases); 140 mention it (read; the survey counted 106, by a different method)
benchmarks/, runtime/perf5 .bt files declare one; 38 files mention class variables, most of them recorded result tables (read; the survey counted 18)

Every declaration is a test or a benchmark of the feature. Downstream code that needs shared state uses named actors instead: named: / spawnAs: in 21 src files (survey).

2. It is expensive to keep.

PieceSize (read: wc -l)
runtime/apps/beamtalk_runtime/src/beamtalk_class_vars.erl758
beamtalk_class_var_abi.erl, beamtalk_class_var_errors.erl206, 189
crates/beamtalk-codegen/src/core_erlang/class_var_access.rs, class_var_keys.rs513, 172
crates/beamtalk-core/src/semantic_analysis/validators/class_state_abroad.rs563 (and 969 lines of tests)
validators/class_process_ffi_validators.rs1,040, about half for the class-process case (survey)
Harness: crates/beamtalk-core/src/test_helpers/class_var_program.rs, crates/beamtalk-cli/tests/cli/cli_class_var_agreement.rs, crates/beamtalk-codegen/tests/class_var_agreement.rs2,503, 1,370, 307
EUnit: beamtalk_class_vars_tests.erl, beamtalk_class_var_abi_tests.erl852, 538
CI: the nightly class-var-corpus job (.github/workflows/fuzz.yml:304) and its triage path (fuzz-triage.yml), just test-class-var-corpus, just lint-class-var-catchers

Beyond the dedicated files, 145 Rust files and 60 Erlang files (31 source, 29 test) mention class variables (read: grep -l).

A Linear search for "class variable" over the last 90 days returns 86 issues (read); the survey puts about 65 of them on class variables and the class process. Many are lost writes: BT-3691 (read), BT-3683, BT-3667, BT-3611, BT-3584 (survey). Two epics were spent on it: BT-3701 (ADR 0130) and BT-4297 (ADR 0142) (read).

3. Code that never declares a class variable pays for it.

The conceptual argument

Because the class process is where class variables live, the language carries rules that exist only to explain it:

A newcomer who writes one classState: line meets all of this. An Actor has one rule: it owns its state, and you send it messages.

What class variables are for, and where each use already lives

Use in SmalltalkHome on the BEAMEvidence
A singleton or default instanceA named Actor (spawnAs:, named:)21 downstream src files (survey)
Counters and cachesAtomicCounter, Ets, or an Actorstdlib/src/atomic_counter.bt, ets.bt (read)
A literal constantA class method that answers the literal93 one-line unary class methods in stdlib/src, 10 of them a bare literal such as class supervisionPolicy -> RestartStrategy => #permanent (read: grep); about 260 one-line class foo => methods across stdlib and the packages (survey)
An expensive computed constantpersistent_term, written by handbeamtalk-hpack does it twice in src/hpackhuffman.bt: class tables and class fastTables call persistent_term get:, build on a miss, then put: (survey)

Nothing used classState: for a constant. The first three rows need nothing new. The fourth is a pattern that has been written by hand twice and deserves to be written once.

Constraints

Decision

1. The rule

Shared mutable state lives in an Actor (or in AtomicCounter / Ets, which a process owns). A class has no state of its own. classState: is removed, and nothing replaces it as syntax.

error: `classState:` was removed (ADR 0153). A class has no state of its own.
  hint: for state that changes, use an Actor (`spawnAs:` / `named:`), an
        AtomicCounter or an Ets table.
        For a constant, write a class method: `class limit => 100`.
        For a value that is expensive to build, see `PersistentTerm`.

error: `self.count` in a class method: a class has no slots.
  hint: `self.x` reads an instance's state. Class methods have none.

The second error also covers self.x := v in a class method. Both are compile errors on every surface.

2. What replaces each use

UseReplacement
Mutable shared state, singletonsA named Actor
CountersAtomicCounter
CachesEts, or an Actor's state:
Literal constantsA class method
Computed constantsPersistentTerm at:ifAbsentPut: (new, §3)

A singleton is a named Actor, and current asks the runtime each time it is called (principles §4). This replaces the class current example in docs/beamtalk-language-features.md § Class-Side Methods:

Actor subclass: Registry
  state: entries = #{}

  class current -> Registry => (self named: #registry) unwrap

  register: key as: value => self.entries := self.entries at: key put: value
  lookup: key => self.entries at: key ifAbsent: [nil]

The application's supervisor starts the actor under that name (a SupervisionSpec with a name), so it is restarted if it dies. In a script or at the REPL, start it once: Registry spawnAs: #registry.

No "look up, or spawn if absent" helper is added. The downstream packages already use named: and spawnAs: directly in 21 files (survey), and a lazily spawned actor is unsupervised, which is the wrong default to make easy. If a second hand-written copy of that pattern appears, the helper is a few lines on Actor (Decided question 2).

A counter is an AtomicCounter. Create it once with new:, at application start, and look it up by name from any process (stdlib/src/atomic_counter.bt:45, 56) (read). new: is process-bound, so the table behind the counter is created in, and owned by, AtomicCounter's class process (language features, line 1352) (reviewer, read). It lives until delete or until the node stops, whichever process asked for it.

AtomicCounter new: #ordersCreated                 // once, at application start
(AtomicCounter named: #ordersCreated) increment   // anywhere

A literal constant is a class method. It compiles to a literal in the module's constant pool, and a send that names the defining class answers a scalar one in place, at 1 reduction (BT-4363, BT-4504; ast/method.rs:literal_constant_body, which covers scalars only) (read). Any other send (an inherited method, self class notFound from an instance, a collection literal) is an ordinary in-caller class send. A subclass inherits the method and may override it.

Object subclass: HttpStatus
  class notFound -> Integer => 404
  class reasons -> Dictionary(Integer, String) =>
    #{200 => "OK", 404 => "Not Found", 500 => "Internal Server Error"}
>> HttpStatus notFound
=> 404
>> HttpStatus reasons at: 404
=> "Not Found"

A dictionary literal #{...} or list literal #(...) whose elements are literals is emitted as a Core Erlang map or list literal (crates/beamtalk-codegen/src/core_erlang/expressions.rs:507-570), which erlc folds into one constant-pool term. An array literal #[...] is a call to beamtalk_array:from_list (expressions.rs:577-596) and is rebuilt on every call, so a constant table should be a list or a dictionary (reviewer, read).

3. PersistentTerm: the helper for computed constants

A new sealed stdlib class, a class-side facade over persistent_term, in the same family as ProcessDictionary (stdlib/src/process_dictionary.bt).

Object subclass: HpackHuffman
  class tables -> Tuple =>
    PersistentTerm at: #hpack_huffman_tables ifAbsentPut: [self buildTables]
>> PersistentTerm at: #demo_squares ifAbsentPut: [(1 to: 5) collect: [:n | n * n]]
=> #(1, 4, 9, 16, 25)
>> PersistentTerm at: #demo_squares ifAbsentPut: [Error signal: "not run"]
=> #(1, 4, 9, 16, 25)
>> PersistentTerm erase: #demo_squares
=> true
MethodAnswers
class at: key ifAbsentPut: blockThe stored value. On a miss it runs block, stores the result and answers it
class at: key ifAbsent: blockThe stored value, or the block's value. Stores nothing
class includesKey: keyWhether a value is stored
class erase: keytrue if a value was removed (a Boolean, as persistent_term:erase/1 answers; ProcessDictionary erase: answers the previous value). Forces a global GC

Why this name and this API.

Rules, stated in the class's doc comment.

Reload: nothing is cleared. A value stays until erase: or until the node stops. The helper is not tied to a class, so reloading the class whose method built the value does not rebuild it.

Implementation. stdlib/src/persistent_term.bt plus a native module beamtalk_persistent_term.erl of a few dozen lines. The class is sealed typed, like ProcessDictionary. It declares no state and its selectors are not process-bound, so its methods, and the block passed to them, run in the caller. Type signatures follow ProcessDictionary's (key :: Object), except that the answer follows the block: at:ifAbsentPut: is Block(T) -> T and at:ifAbsent: is Block(T) -> Object | T (BT-5168). Every call site for one key must build the same type.

Follow-up: move beamtalk-hpack's class tables and class fastTables to the helper (a change in that repository).

4. What is deleted

The file list is in Implementation. In summary:

5. Where a class method runs afterwards

A class method runs in the caller unless its selector is process-bound. That is the whole rule.

ClassBuilder and ADR 0084 runtime funs keep working, and run in the caller. Today a class whose own class methods are runtime funs (every class built with ClassBuilder classMethods:) runs them in the class process, because a runtime fun shadows the class's compiled methods (language features, line 4120) (read). ADR 0142 already applies an ancestor's runtime fun in the caller (beamtalk_class_dispatch:apply_class_method_body/7) (read: the amendment note at the top of ADR 0084). Phase 3 extends that to the receiving class's own funs.

The process-bound selectors keep their routing, for reasons that have nothing to do with class variables (read: the doc comment on PROCESS_BOUND_CLASS_SELECTORS, class_info.rs:507-539):

SelectorsWhy they are process-bound
new, new:, startLink, startLink:basicNew / basicNewWith read the class name and module from the class process's dictionary. The in-caller constructor shapes of BT-4099, BT-4464 and BT-4475 are unchanged, and their "no class variables in the chain" condition becomes always true
spawn, spawnWith:Dedicated clauses in beamtalk_class_dispatch:class_send_plain/3
supervise, spawnAs:, spawnWith:as:Supervisor routing, already started in the caller (ADR 0135 §1)
runAll, runAll:, run:, run:method:The TestCase run selectors answer test_spawn and need the gen_server's noreply

The class process itself stays, as the owner of the class object: registration, metadata, reload, the method tables. Whether the process-bound selectors can leave it is a separate question, not decided here.

6. Other ADRs

ADREffect
0013§1 (class variables) superseded. Class methods and instantiation unchanged
0019Superseded. Singleton access is a named Actor. The stdlib stopped using class-variable singletons with ADR 0129 (inferred: stdlib/src declares none)
0048None. The class modifier stays
0084classVars: removed. Runtime class-method funs stay and run in the caller (§5)
0123Frozen; the class-variable parts trimmed. Also withdrawn, because they only existed for the class process: §2's Base performLocally: #migrateFromV1: withArguments: idiom and its caveat that an ancestor step is serialised through Base's process where class variables are visible (0123-versioned-state-migration.html:304-318), the recorded refinement of lowering migrateFromVN: sends to local_call/3, and the rationale about local_call/3 passing empty class variables (:405-417) (reviewer, read). An ancestor step becomes an ordinary in-caller class send. The compile error "a migrateFromVN: method may not access class variables" and its validator are removed, because class-side self.x is now an error everywhere and the special case has nothing to add. The with_snapshot/2 wrapper inside beamtalk_object_class:local_call/3 is removed; local_call/3 itself stays, because the migration runner calls it (beamtalk_shape_migration.erl:306) (read). shapeVersion:, migrateFromVN: and instance-state migration are unchanged
0124late classState: removed. late state: unchanged. The five compile-time errors in the language docs lose their classState: halves
0130Superseded in full
0142§1 rules 1 and 2, the chain-wide amendment and the descendant-flag erasure for class-variable changes have nothing to act on. Rule 3 (process-bound selectors), the guarded static call and the static call keys stay
0152Sequenced first (Implementation). After both, the shadow flag has one kind, runtime_fun

Single source of truth

Prior Art

Summarised from the languages' documentation; not re-checked for this ADR.

LanguageWhat it doesWhat we take
Pharo / SqueakClass variables (shared with subclasses) and class-side instance variables (per class), both mutable shared memory. Constants are usually class-side methods that answer a literalThe class-side method as the constant. We drop the variables
NewspeakNo global namespace and no static state. A class has no mutable class-side state; shared state belongs to a module instanceThe closest precedent for removing class variables from a Smalltalk-family language
ErlangNo module-level mutable state. Constants are macros or functions that answer a literal. persistent_term (OTP 21.2) holds values read often and written rarely, with a global GC on updateBoth replacements for constants, unchanged
ElixirModule attributes are compile-time constants. State is a process (Agent, GenServer), ETS or :persistent_term"Constants in the module, state in a process" is what BEAM developers expect
Gleamconst holds compile-time literals onlyLiteral constants need no run-time support
Scala, Kotlin, Swiftlazy val, by lazy, static let: computed once on first use; Scala and Kotlin evaluate again after an exceptionat:ifAbsentPut: has the same first-use and retry behaviour
Pony, DartPony has no global mutable state; constants are functions on primitive types. Dart statics are per isolate, never sharedActor languages do not share mutable statics

User Impact

Steelman Analysis

Keep classState: as it is

CohortStrongest argument
Newcomer"It is one line. An Actor is a class, a spawn and a name."
Smalltalk purist"Class-side variables are part of the language I know. Every Smalltalk has them."
BEAM veteran"ADR 0130 and 0142 already paid for it, and it now has a single home and a clear rule."
Operator"It works and the bugs are fixed. Removing it is churn."
Language designer"A class is an object; objects have state. A class without state is a module."

Keep the syntax, back it with a hidden Actor

CohortStrongest argument
Newcomer"I keep the one-line declaration and get the Actor semantics for free."
Smalltalk purist"The syntax survives."
BEAM veteran"It is honest about being a process."
Language designer"One state model underneath, two spellings on top."

Immutable class-constant syntax (constant: name = expr)

CohortStrongest argument
Newcomer"constant: limit = 100 says what it is. A method that happens to answer a literal does not."
Smalltalk purist"A declaration the browser can list is better than a naming convention."
BEAM veteran"The compiler could pick the storage for me and clear it on reload, which the helper does not."
Operator"Constants tied to a class are rebuilt when the class is reloaded. Hand-managed keys go stale."
Language designer"Intent in the declaration lets the compiler reject an Actor in a constant."

ETS-backed classState:

CohortStrongest argument
Newcomer"Read and write from anywhere, no process rules, no new error."
BEAM veteran"Concurrent reads, no gen_server bottleneck. ADR 0013 listed it as the scaling path."
Operator"Visible in observer."

Tension points

Alternatives Considered

Keep classState: as it is

Rejected. Nothing uses it (Context §1), and code that does not use it pays for it on on:do:, on Result tryDo: and on every class send (Context §3). "Classes are objects with state" is sound in an image; on the BEAM the state is in a process either way, and an Actor says so.

Keep mutable classState:, backed by an Actor transparently

The compiler would generate a hidden actor per class and turn self.x := v into a message to it.

Object subclass: Tally
  classState: n = 0
  class bump => self.n := self.n + 1   // would compile to: read from the hidden actor, add, write back

Rejected.

Immutable class-constant syntax

The first draft of this ADR designed it: constant: name [:: Type] = expr lowering to a class-side method of the same name, a literal initialiser compiled in, a computed one evaluated on first read and kept in persistent_term under a key that carries a hash of the class source, erased when the class reloads, inherited and overridable like any class method.

Object subclass: HttpStatus
  constant: notFound = 404
  constant: tokenPattern :: Regex = (Regex from: "[A-Za-z0-9_]+") unwrap

Rejected by the owner as not needed yet (YAGNI).

If stale PersistentTerm keys on reload become a real problem, this is the design to return to.

ETS-backed classState:

A per-class table readable and writable from any process: self.n := self.n + 1 becomes ets:lookup then ets:insert. Rejected, for ADR 0130's reasons and one more.

Constant named: #key ifAbsent: [...]

The same helper under an intent name. Rejected by the owner in favour of PersistentTerm.

A helper tied to the class (self once: #tables do: [...])

The helper could key on the calling class and have the runtime erase a class's keys when it reloads. Rejected: see Decision §3, "Reload". It rebuilds the per-class bookkeeping this ADR deletes.

No helper; call persistent_term through FFI

(Erlang persistent_term) get: key with: default works today, and hpack uses it. Rejected as the documented answer: the miss-build-store sequence has a race and a caveat that each author would have to rediscover, and raw keys can collide with the runtime's own.

Deprecate for a release, then remove

Rejected by the owner, as for ADR 0152: with no user of the feature there is nobody for a warning to reach.

Consequences

Positive

Negative

Neutral

Implementation

Sizes are rough (S, M, L). Phases 0 and 1 do not depend on BT-5141. Phases 2 and 3 land after BT-5141 (ADR 0152) merges: both edit beamtalk_class_dispatch.erl and beamtalk_class_shadow_flags.erl, and after ADR 0152 the shadow flags have two kinds, runtime_fun and class_vars, of which this ADR removes the second.

Phase 0: inventory (S)

Produce the list Phases 2 and 3 work from.

Phase 1: add PersistentTerm (S)

Phase 2: remove classState: (L)

One change, with no warning period.

Phase 3: delete the class-process machinery (L)

After Phase 2 nothing the compiler emits calls beamtalk_class_vars.

Compiled code from before this change. Every module built by an older compiler calls beamtalk_class_vars:snapshot/0 before each on:do:. Loaded into a runtime without that module, it fails with undef. As for ADR 0152, the build stamp is what prevents this (a build is invalidated when BEAMTALK_VERSION changes), and Phase 0 confirms it covers dependency and persisted BEAMs. beamtalk_class_var_abi already refuses modules built for an older calling convention; its check moves to whatever module-load check remains, so that a module built before this change is refused with a clear message and not an undef (inferred: the mechanism exists; this use of it is proposed).

PieceWhere
Access, ABI, errorsbeamtalk_class_vars.erl, beamtalk_class_var_abi.erl, beamtalk_class_var_errors.erl, include/beamtalk_class_vars_keys.hrl, beamtalk_class_vars_test_support.erl, and their EUnit suites
The class-variable homeThe install / read-back / uninstall in invoke_class_method/7 (beamtalk_class_dispatch.erl:1635) and the class_state field of #class_state{}; get_class_var / set_class_var (beamtalk_object_class.erl:316, 1213-1215) and beamtalk_runtime_api:set_class_var/3; the class-side reflection selectors and class_var_reflection_selectors_conformance.json; register/1's read of the builder's classState key (beamtalk_class_builder.erl:429-430; the rest of register/1 is untouched)
The execution-mode inputset_class_vars/2 and the class_vars value of the derived flag in beamtalk_class_shadow_flags.erl; chain_has_class_variables/1 and put_class_variables/2 in beamtalk_class_metadata.erl; the descendant-flag erasure that a class-variable change triggers
Runtime funs in the callerSplit the guard and route run_in_caller/7 through apply_class_method_body/7 (Decision §5). Tests: a ClassBuilder class whose fun shadows nothing, one whose fun shadows a compiled method reached by a static send, and one installed while a caller loops
Catch boundariesprotect/1 in beamtalk_result.erl:228, 285, beamtalk_supervisor.erl:391, beamtalk_telemetry.erl:317, beamtalk_test_case.erl:76, beamtalk_test_assert.erl:48 and beamtalk_repl_eval.erl:842, and the snapshot / restore pair in beamtalk_erlang_proxy.erl:436, 511-520 (reviewer; Phase 0 confirms the list with the catcher lint before it is deleted); scripts/ci/lint-class-var-catchers.escript, its fixtures, the Justfile recipe and docs/development/class-var-catcher-audit.md
Snapshotswith_snapshot/2 in beamtalk_supervisor_class_call.erl:63, beamtalk_supervisor_init_config.erl:135 and local_call/3 (beamtalk_object_class.erl:474) (read); the class-state snapshot rows in beamtalk_class_registry.erl
performLocally:The intrinsic and its tests (stdlib/test/perform_locally_test.bt, tests/repl-protocol/cases/perform_locally.btscript). local_call/3 stays as an internal function for the migration runner

Must pass after each phase: just ci, just test-corpus, just verify-threaded-ir, just test-repl-protocol, just dialyzer. A benchmark run before Phase 2 and after Phase 3 (docs/development/benchmarks.md) records what the snapshot and the guard input cost: the on:do: rows, Result tryDo:, and vs-elixir rows 3a-3j.

Migration Path

There is no deprecation period.

Code todayAfter
classState: limit = 100, read onlyclass limit => 100; read with self limit
classState: table = ..., built onceclass table => PersistentTerm at: #pkg_table ifAbsentPut: [...]
classState: current = nil holding an instanceA named Actor: class current => (self named: #name) unwrap
classState: count = 0, incrementedAtomicCounter, or a field of an Actor
classState: cache = #{}An Ets table owned by an Actor, or an Actor's state:
late classState: x :: TAn Actor with late state: x :: T
Cls fieldAt: #xCls x. Cls fieldAt: #x raises does-not-understand
Cls performLocally: #sel withArguments: argsCls perform: #sel withArguments: args
builder classVars: #{#x => 1}`builder addClassMethod: #x body: [:self

Packages must be rebuilt with the new compiler. No downstream package needs a source change (survey).

Decisions on the open questions

The draft listed seven open questions. The owner settled all seven when accepting the ADR (2026-11-24).

  1. The helper is PersistentTerm, with at:ifAbsentPut:, at:ifAbsent:, includesKey: and erase:, and no at:put:. The alternative Constant named: #key ifAbsent: [...] is rejected (see Alternatives Considered).
  2. No "named, or spawn" helper on Actor until a second copy of that pattern appears.
  3. performLocally:withArguments: is deleted. perform:withArguments: runs in the caller for every selector that is not process-bound. Phase 0 still searches downstream for a caller before Phase 2 lands.
  4. The per-send guard read (BT-4987) is a follow-up issue, measured after ADR 0152 and this ADR have both landed. By then the guard's remaining reasons are a runtime fun shadowing a compiled method, a method removed by a reload or removeSelector:, and the class process being alive.
  5. PersistentTerm refuses a top-level pid, actor or class as a value, with a clear error. The package-prefix key convention is enough; keys are not checked.
  6. No lint for hand-rolled persistent_term use. A doc note points at the helper.
  7. Class-side fieldAt: after removal raises the ordinary does-not-understand error, as do fieldAt:put:, hasField: and clearField: sent to a class. Phase 2 pins this with a test.

Implementation Tracking

Epic: BT-5144. Status: Implemented.

PhaseIssueWhat
0BT-5145Inventory of classState: uses, downstream search, baseline benchmark
1BT-5146, BT-5147, BT-5168PersistentTerm stdlib helper; beamtalk-hpack moved onto it; its return type
2a-2cBT-5148, BT-5149, BT-5150Tests, REPL-protocol cases and benchmarks migrated off classState:
2dBT-5151Class-variable fuzz harness, agreement corpus and nightly job deleted
2eBT-5152classState:, late classState: and class-side self.x are compile errors on every surface
2fBT-5153Codegen stops emitting class-variable code (no snapshot before on:do:)
2gBT-5154Class-variable analysis deleted (class-state-abroad, class-process-ffi)
2hBT-5155, BT-5242Stdlib class-variable surface removed; beamtalk-exdura stops using performLocally:
2iBT-5157Docs sweep, ADR annotations, AGENTS.md rules
3aBT-5158Class-variable input removed from the shadow flags and class metadata
3bBT-5160Class-variable home removed from invoke_class_method/7
3cBT-5159protect/1 and the snapshot/restore pair removed from every catch boundary
3dBT-5161Class methods that are ADR 0084 runtime funs run in the caller
3eBT-5162with_snapshot/2, class-state snapshot rows and performLocally: removed
3fBT-5163, BT-5255beamtalk_class_vars* deleted; module_abi gate refuses older modules; codegen drops the empty 'classState' entry

Compiled code from before this change is refused by the module_abi load gate (beamtalk_module_abi, which replaced beamtalk_class_var_abi). The build stamp (BEAMTALK_VERSION) already rebuilds project, dependency and workspace-persisted BEAMs, so a normal build never reaches the gate. A module that does (a hand-copied BEAM, a release assembled from stale parts) declares no module_abi, and is refused with an abi_mismatch that names the module and says to recompile, not an undef from beamtalk_class_vars:snapshot/0. The value is 4: 1-3 were the class-variable conventions of ADR 0130, 0137 and 0142.

Follow-ups, outside this epic's removal work: BT-5164 (measure the per-send guard read) and BT-5241 (type-checker warning for fieldAt: family sent to a class).

References