SleelaDoc API
HTML documentation for the SLeeLa standard library (/lib)
Home › Packages › hotlink

Package hotlink

This package contains 5 source unit(s) defining 5 class(es) / struct(s). Each unit below lists its fields (the values it stores) and methods (the actions it performs), with a plain explanation of each.

hotlink-demo #sleela 3.0 (lib/hotlink/hotlink-demo.sleela)

HotLinkDemo class

Runnable, self-checking demonstrator for the hot-link backing model. It seeds the standard matrix, then drives the linker: observer modules are hot-attached, the vertical-integration stack is expanded one tier per kind (0 to 16), connections are allowed only where the matrix declares them, value moves only along approved connections, and the refusal paths (cold type, trust floor, caps, duplicate, cycle, native authorizer and pinned digest, detach) all fail closed. Prints PASS or FAIL per check and a tally.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
passedint passedNo description in source.
failedint failedNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
checkvoid check(String label, boolean ok)No description in source.
bannervoid banner(String t)No description in source.
mainvoid main()No description in source.

SLHotLinker #sleela 3.0 (lib/hotlink/SLHotLinker.sleela)

SLHotLinker class

Defines SLHotLinker — the gate every hot-loaded instance and every connection passes through. It checks an instance against its matrix row (known type, hot, trust floor, per-type cap, unique name, and for native code the host authorizer plus the host-pinned digest), records it, and for observer modules admits the port to the SLDocumentObserver. A connection is allowed only if the matrix declares the type pair, fan-out stays under the limit, and no instance-level cycle results. The linker approves; it never loads code itself. Everything is audited.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
matrixSLHotLinkMatrix matrixNo description in source.
observerSLDocumentObserver observerNo description in source.
namesString[] namesNo description in source.
typesString[] typesNo description in source.
statesint[] states0 free, 1 linked, 2 detached
instCountint instCountNo description in source.
linkFromint[] linkFromNo description in source.
linkToint[] linkToNo description in source.
linkLiveint[] linkLiveNo description in source.
linkCountint linkCountNo description in source.
pinTypesString[] pinTypesNo description in source.
pinDigestsString[] pinDigestsNo description in source.
pinCountint pinCountNo description in source.
authorizerGrantedint authorizerGrantedNo description in source.
allowUnverifiedint allowUnverifiedNo description in source.
trailString[] trailNo description in source.
trailCountint trailCountNo description in source.
trailLostint trailLostNo description in source.
refusedint refusedNo description in source.
preflightWhyString preflightWhyNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configureboolean configure(SLHotLinkMatrix m, SLDocumentObserver o)The matrix must be sealed; an unsealed matrix is refused.
modelSLHotLinkMatrix model()No description in source.
instanceTotalint instanceTotal()No description in source.
refusedCountint refusedCount()No description in source.
trailSizeint trailSize()No description in source.
trailOverflowint trailOverflow()No description in source.
trailAtString trailAt(int i)No description in source.
auditvoid audit(String entry)No description in source.
refuseint refuse(String why)No description in source.
grantAuthorizervoid grantAuthorizer()No description in source.
permitUnverifiedvoid permitUnverified(boolean on)No description in source.
revokeAuthorizervoid revokeAuthorizer()Revoking the authorizer detaches every linked native-code instance.
pinIndexint pinIndex(String typeId)No description in source.
pinDigestboolean pinDigest(String typeId, String digest)Pin the expected digest of a host-pinned type. Allowed once; never changed.
indexOfNameint indexOfName(String name)No description in source.
isLinkedboolean isLinked(String name)No description in source.
typeOfNameString typeOfName(String name)No description in source.
countOfTypeint countOfType(String typeId)No description in source.
liveCountint liveCount()No description in source.
preflightint preflight(String typeId, String name, int trust, String digest)Dry run of every attach check, changing and auditing nothing. Returns 0 when attach would succeed, 1 when it is refused for a reason that may pass later (cap reached, authorizer or digest not yet provided, unverified type not yet permitted), 2 when it is refused for good. preflightWhy holds the reason. attach() uses this same method, so the two can never disagree.
attachint attach(String typeId, String name, int trust, String digest)Approve one instance of a class type. Returns its slot, or -1 (audited). `digest` is only consulted for host-pinned types; pass "" otherwise.
attachModuleint attachModule(String typeId, String name, int trust, SLObserverPort port)Approve an observer module and admit its port. The port name must equal the instance name. If the observer refuses, the attach is rolled back.
detachboolean detach(String name)Detach an instance: its links go, and an observer module is retired.
mayControlboolean mayControl(String name, int trust, String verb)No description in source.
pauseModuleboolean pauseModule(String name, int trust)No description in source.
resumeModuleboolean resumeModule(String name, int trust)No description in source.
alterModuleboolean alterModule(String name, int trust, int ins, int rep, int del, int first, int last)No description in source.
replaceModuleboolean replaceModule(String name, int trust, SLObserverPort fresh)Hot-swap: the instance keeps its name, type, links and slot; only the port behind it changes.
reinstateModuleboolean reinstateModule(String name, int trust)No description in source.
linkIndexint linkIndex(int a, int b)No description in source.
isConnectedboolean isConnected(String from, String to)No description in source.
liveLinksint liveLinks()No description in source.
fanoutOfint fanoutOf(int a, String toType)Live links from instance a to any instance of type `toType`.
reachesboolean reaches(int from, int to)Does a live path lead from instance `from` to instance `to`?
linkPairboolean linkPair(String from, String to)Connect two linked instances. Allowed only if the matrix declares the type pair, fan-out is under the limit, the pair is new, and no instance cycle results. A contain self-type link between DIFFERENT instances is the only same-type link the matrix ever permits.
modeBetweenString modeBetween(String from, String to)The matrix mode of a live connection (feed, subscribe, contain), or "".
unlinkPairboolean unlinkPair(String from, String to)No description in source.

SLHotLinkIntegration #sleela 3.0 (lib/hotlink/SLHotLinkIntegration.sleela)

SLHotLinkIntegration class

Defines SLHotLinkIntegration — the vertical-integration side of the backing model. It owns an SLVerticalIntegration and grows it only through the SLHotLinker: a tier is added by expand(), which first has the linker approve the compartment type for that kind. Value moves only where the linker says two instances are connected: deposit() puts units into a compartment from a connected module, and feed() moves units downstream between connected, adjacent tiers.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
modelSLVerticalIntegration modelNo description in source.
linkerSLHotLinker linkerNo description in source.
tierNamesString[] tierNamesNo description in source.
tierTotalint tierTotalNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String modelName, SLHotLinker l)No description in source.
stackSLVerticalIntegration stack()No description in source.
tiersint tiers()No description in source.
tierOfint tierOf(String name)No description in source.
expandSLCompartment expand(String name, String label, int kind, int trust)Grow the stack by one tier of the given kind, if the linker approves. Returns the compartment, or null (the refusal is in the linker audit).
depositint deposit(String fromName, String toName, int amount)A connected module puts units into a compartment. Returns units stored.
feedint feed(String fromTier, String toTier, int amount)Move units downstream between two connected tiers that are adjacent.

SLHotLinkMatrix #sleela 3.0 (lib/hotlink/SLHotLinkMatrix.sleela)

SLHotLinkMatrix class

Defines SLHotLinkMatrix — the backing model of the hot-link matrix: which types of class may be hot-loaded, and which types may be connected to which. Everything is validated as it is added and a bad row or link is refused (fail closed). seal() freezes the matrix; SLHotLinker only accepts a sealed one. standard() seeds the matrix declared in hotlink-matrix.xml, and tools/validate_hotlink_matrix.py checks the two agree.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
rowsSLHotLinkRow[] rowsNo description in source.
rowCountint rowCountNo description in source.
edgeFromString[] edgeFromNo description in source.
edgeToString[] edgeToNo description in source.
edgeModeString[] edgeModeNo description in source.
edgeFanoutint[] edgeFanoutNo description in source.
edgeCountint edgeCountNo description in source.
frozenint frozenNo description in source.
refusedint refusedNo description in source.

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure()No description in source.
rowTotalint rowTotal()No description in source.
linkTotalint linkTotal()No description in source.
refusedCountint refusedCount()No description in source.
isSealedboolean isSealed()No description in source.
sealvoid seal()No description in source.
indexOfint indexOf(String typeId)No description in source.
findSLHotLinkRow find(String typeId)No description in source.
rowAtSLHotLinkRow rowAt(int i)No description in source.
typeForKindString typeForKind(int kind)The type that realises an SLIntegrationKind ordinal, or "" if none.
oneOf2boolean oneOf2(String v, String a, String b)No description in source.
oneOf3boolean oneOf3(String v, String a, String b, String c)No description in source.
addRowboolean addRow(String typeId, String code, String instance, String link,Add a row. Refused (returns false, nothing changes) when sealed, when a field is out of vocabulary or range, or when the combination is unsafe: native code must require the authorizer and a host-pinned digest, and a compartment row must name a kind range that no other row already covers.
edgeIndexint edgeIndex(String from, String to)No description in source.
typeReachesboolean typeReaches(String from, String to)Does the type graph already reach `to` from `from`? (self-links ignored)
addEdgeboolean addEdge(String from, String to, String mode, int fanout)Add a permitted connection. Both ends must be hot types. Refused when sealed, unknown, duplicate, out of range, cycle-making, or a self-link in any mode other than contain.
edgeAllowedboolean edgeAllowed(String from, String to)No description in source.
fanoutLimitint fanoutLimit(String from, String to)No description in source.
edgeModeOfString edgeModeOf(String from, String to)No description in source.
standardint standard()Seed the matrix declared in hotlink-matrix.xml and seal it. Returns the number of seeds that were refused (0 when everything is consistent).

SLHotLinkRow #sleela 3.0 (lib/hotlink/SLHotLinkRow.sleela)

SLHotLinkRow class

Defines SLHotLinkRow — one row of the hot-link matrix: a TYPE of class that may join a running system, how its code and instances arrive, its contract with the host, the trust needed to bring it, and its cap. Mirrors a classType element of hotlink-matrix.xsd.

Carries the standard Metadata Class record — eleven catalogued provenance attributes (version, id, author, date, copyright, trademark, corporation, origin, birth date, science rating, national schedule) with matching get/set accessors. These are omitted from the tables below for brevity.

Fields — the named values this unit stores.

FieldDeclarationWhat it holds
idString idNo description in source.
codeArrivalString codeArrivallinked | native
instanceArrivalString instanceArrivalhot | cold
contractString contractport | compartment | native-abi
minTrustint minTrustNo description in source.
maxInstancesint maxInstancesNo description in source.
kindFirstint kindFirstSLIntegrationKind range this type covers; -1 and -1 when not a compartment
kindLastint kindLastNo description in source.
requiresAuthorizerint requiresAuthorizerNo description in source.
digestPolicyString digestPolicynone | host-pinned
statusString statusverified | declared | unverified

Methods — the actions this unit can perform.

MethodSignatureWhat it does
configurevoid configure(String typeId, String code, String instance, String link,No description in source.
getIdString getId()No description in source.
getCodeArrivalString getCodeArrival()No description in source.
getInstanceArrivalString getInstanceArrival()No description in source.
getContractString getContract()No description in source.
getMinTrustint getMinTrust()No description in source.
getMaxInstancesint getMaxInstances()No description in source.
getKindFirstint getKindFirst()No description in source.
getKindLastint getKindLast()No description in source.
needsAuthorizerboolean needsAuthorizer()No description in source.
getDigestPolicyString getDigestPolicy()No description in source.
getStatusString getStatus()No description in source.
isHotboolean isHot()No description in source.
isNativeCodeboolean isNativeCode()No description in source.
coversKindboolean coversKind(int kind)No description in source.