API stability
Which classes the semantic-versioning promise covers, and what it promises. The authority is the marker in each class-level docblock, not this page and not the DI container visibility (ADR-127).
The three markers
@api — call it
Classes and interfaces you call: the feature services
(Completion and friends), Llm,
the option classes, the response and value objects they accept and return,
and the typed exceptions they throw. Within a major version:
- no class or method is removed,
- no method signature changes incompatibly,
- documented behaviour does not break.
Everything a marked method's signature mentions is itself @api — you
never receive an object you are not allowed to rely on.
@api Extension point — implement it
Interfaces and attributes third parties implement:
Tool, Guardrail,
Contextual, Provider
and the capability interfaces, Translator,
Search, the preset/evaluation providers, the
middleware contracts, and the # / #
attributes. These carry a stricter promise, forced by the direction of
implementation:
no new abstract member within a major version — adding one would break
every existing implementation, not just callers.
@internal — hands off
Everything else: backend controllers, dashboard widgets, hooks, upgrade wizards, console commands, DI compiler passes, TCA form elements, Extbase repositories and the setup wizard. These may change or disappear in any release, including patch releases. PHPStan and modern IDEs warn when code outside this package touches them.
What is out of contract
- Subclassing internals: protected members of
@apiclasses are not part of the promise. Extend via the extension points, not inheritance. - Constructor signatures of
@apiservices: obtain them from the DI container, never vianew. Constructing option/value objects directly is fine — their constructors are part of the signature promise. - Anything reached by reflection or by reading private state.
- Members of an
@apiclass marked@internalin their docblock, such as the process pin ofRun(ADR-228): the runtime sets them, and the snapshot still lists them.Augmentation
The snapshot below records the constructor a caller reaches with new,
including the service ones that are out of contract here. That is
deliberate: no mechanical rule separates a value object a consumer builds
with new from a service it only ever injects, and a new required
argument on the former breaks callers exactly as a deleted method would.
Recording them costs a service-wiring change one snapshot regeneration;
recording none of them let a widened constructor through the gate in
silence.
The constructor is also the one member that is not recorded
declared-only. Every other member has to be, because inherited TYPO3 core
members differ between 13.4 and 14.x — but new Foo binds to
whatever constructor Foo inherits, so a declared-only rule left four
Specialized services and two Provider subclasses
with no constructor line at all, and a required argument added to their
shared base moved nothing. A constructor is therefore taken from the
nearest declaring class whenever that class is inside Netresearch\.
Two cases still carry no constructor line, and both are intended:
- The constructor is inherited from outside this repository — TYPO3
core's
Abstract,Entity \Runtime. That signature is not ours and does differ across the version matrix, so recording it would make the snapshot depend on which matrix cell rendered it.Exception - There is no public constructor. A value object with a
private __and static factories is reached through the factories, which the snapshot records as methods.construct
The snapshot records constructor lines for the classes that meet these rules; its current contents are the inventory of the public surface.
Enforcement
The rendered @api surface is frozen in
Tests/: an unintended signature change fails CI
before review, and the same test asserts the closure rule: every
Netresearch\ type an @api method or property signature
mentions is itself @api. An intended change updates the snapshot in the
same PR — the diff is the review artifact.
Constructor parameter types are outside the closure rule. A DI-built service is handed its collaborators by the container, so its constructor names internals by design; the line is still frozen — a new required parameter on it is a breaking diff — but the types on it are not a promise that you may call them.
The failure is classified, because "different" makes a new value object read
like a deleted method. An additive diff (a new class, interface or enum,
a new concrete method or a property of a class, a new constant, an abstract
class made concrete, a final class made non-final, an abstract method given
a body, an interface a class now implements without leaving methods open,
trailing parameters with a default value or a parameter that gains a
default on a constructor, on a method of a
final class or an enum, or on a final method) is regenerated and noted in an
added changelog fragment. The rule for optional parameters follows
roave/backward-compatibility-check: no caller breaks, and nothing can
override such a member with the old signature. On any other method an added
optional parameter breaks every override, on an interface method every
implementation, and an added required parameter breaks every call.
A breaking one is a decision, and the failure message says so and points
at Deprecation and removal policy:
- anything removed or changed, a new required parameter, a new optional one
on an overridable, interface or abstract method, and a class or method made
finalincluded, - a new method on an existing
@apiinterface — it breaks every implementation outside this extension, whether or not the interface is marked as an extension point, - a new abstract method on an existing
@apiabstract class or trait, public, protected or (on a trait) private, declared there or left open from a parent or an interface — it breaks every subclass outside this extension (the snapshot marks the classabstract classand the methodmethod abstract), - a new case of an existing
@apienum — it breaks every exhaustivematchwithout a default arm, - a changed header line: a class made abstract, a changed parent class, a
changed list of parent interfaces of an interface (an interface that starts
to extend another makes every implementation implement that one too), or an
interface removed from a class's
implements. A parent class changed to a subclass of the old one breaks nobody, but the snapshot alone cannot tell, so the message asks the author to check.
Two diffs are reported as check by hand, because the snapshot cannot
classify them: a method abstract protected or method abstract private
line that vanished (the snapshot does not render concrete protected or
private methods, so a hook given a body and a deleted one look the same), and a third-party interface added to an
abstract class (methods declared outside this extension and PHP are not
rendered, so the ones a subclass now has to implement are invisible). Read
the class; a deleted hook or a newly open method is breaking.
How something leaves the surface again is Deprecation and removal policy. Which TYPO3 and PHP versions the promise is made on is Support matrix.
Versioning during 0.x
While the extension is pre-1.0, the promise applies one level down: in 0.x.y, the middle number x plays the role of the major and the last number y the role of minor and patch together.
- x rises only for a breaking change, by one, to 0.x+1.0. A breaking
change is either a breaking diff of the frozen
@apisurface (the classifier ofTests/reports breaking, see Enforcement — a new method on anUnit/ Api/ api- surface. txt @apiinterface, a new abstract method on an@apiabstract class and a new case of an@apienum included, as 0.41.0 and 0.36.0 recorded the first and the last), or a behaviour change that consumers have to handle — for example 0.44.0 added the run statuswaiting_, which a consumer has to know about.for_ dependency - y rises for everything else: new features, fixes, an additive
@apidiff (a new class, interface or enum, a new concrete method of a class), and additive database changes (new columns or tables with defaults that need only the schema update). - A release that raises x carries at least one top-level CHANGELOG bullet
that opens with
- **BREAKING(upper case, followed by no letter, digit or underscore) and says what a consumer has to change. A release that keeps x carries none. The word may stand only there, once: every other occurrence, in any case and form (**Breaking:**, a nested bullet, the word quoted as inline code or inside fenced code, prose such as "not a breaking change"), is refused.
The reason is Composer's caret on a 0.x version: ^0. admits 0.54.*
and refuses 0.55.0. Every rise of x therefore forces each extension that
depends on nr_llm to widen its constraint and publish a release before an
installation can update. 0.45.0 to 0.55.0 raised x eleven times without a
BREAKING entry; six of their release pull requests named new features or
additions as the reason.
Build/ (part of
composer ci: and make changelog, run in CI)
compares each release after 0.55.1 with the highest earlier version. It
refuses a release that raises x without a - **BREAKING bullet, one that
raises it by more than one or to a last number other than 0, one that keeps
x with such a bullet, and any ## heading (older ones included) other
than ## and ## , such as ## ,
## or ## 0.. In those sections, in
[Unreleased] and in changelog. fragments it refuses every occurrence of the word "breaking", inline code and fenced
code included, that is not the one marker of a marker line. Whether a change is
breaking stays the release author's decision: the check reads the
CHANGELOG, not the API diff.
From 1.0.0 on the promise applies as written above.