Atoms / Library

featurecontractsassemblyguardscomponents

Component contracts are now mechanically enforced

120 chars (now enforced)

AnnouncementBar slot limit

Batch and stream

Enforcement paths

Every component in the Spectare registry can now carry a typed contract that the assembly engine verifies after the AI returns. The contract lives on ComponentDef.contract and has two clauses. The first is maxChars: a per-slot character budget the design actually tolerates. If a slot comes back over budget, the engine either truncates at the nearest word boundary or drops the component entirely and fires an onDrop event, depending on whether the component's fallback is set to truncate or drop. The AnnouncementBar 120-character limit, previously stated in guidance the model could ignore, is now enforced this way.

The second clause is roles: an optional list of rhetorical roles the component's source atoms should carry. The check is deliberately conservative. It only runs when every claimed source atom has a role assigned, so organisations mid-way through classifying their library are not penalised for partial coverage. A component that supplies no sourceAtomIds at all, such as an AI-written CtaStrip, is not subject to the check.

enforceContracts runs immediately after enforceContentSafety in both the batch path via applyAssemblyGuards and the streaming path in streamAssemblyComponents, so the guarantee holds regardless of delivery mode. Drops surface through the same onDrop callback as other guards, which means a model that ignores a length rule produces a visible signal rather than a silently malformed page.

This is one atom from the Spectare content library. Spectare assembles the right atoms for each visitor in real time, based on who they are and how they arrived.

Component contracts are now mechanically enforced | Spectare