Package hotlink
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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed | No description in source. |
failed | int failed | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | void check(String label, boolean ok) | No description in source. |
banner | void banner(String t) | No description in source. |
main | void 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
matrix | SLHotLinkMatrix matrix | No description in source. |
observer | SLDocumentObserver observer | No description in source. |
names | String[] names | No description in source. |
types | String[] types | No description in source. |
states | int[] states | 0 free, 1 linked, 2 detached |
instCount | int instCount | No description in source. |
linkFrom | int[] linkFrom | No description in source. |
linkTo | int[] linkTo | No description in source. |
linkLive | int[] linkLive | No description in source. |
linkCount | int linkCount | No description in source. |
pinTypes | String[] pinTypes | No description in source. |
pinDigests | String[] pinDigests | No description in source. |
pinCount | int pinCount | No description in source. |
authorizerGranted | int authorizerGranted | No description in source. |
allowUnverified | int allowUnverified | No description in source. |
trail | String[] trail | No description in source. |
trailCount | int trailCount | No description in source. |
trailLost | int trailLost | No description in source. |
refused | int refused | No description in source. |
preflightWhy | String preflightWhy | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | boolean configure(SLHotLinkMatrix m, SLDocumentObserver o) | The matrix must be sealed; an unsealed matrix is refused. |
model | SLHotLinkMatrix model() | No description in source. |
instanceTotal | int instanceTotal() | No description in source. |
refusedCount | int refusedCount() | No description in source. |
trailSize | int trailSize() | No description in source. |
trailOverflow | int trailOverflow() | No description in source. |
trailAt | String trailAt(int i) | No description in source. |
audit | void audit(String entry) | No description in source. |
refuse | int refuse(String why) | No description in source. |
grantAuthorizer | void grantAuthorizer() | No description in source. |
permitUnverified | void permitUnverified(boolean on) | No description in source. |
revokeAuthorizer | void revokeAuthorizer() | Revoking the authorizer detaches every linked native-code instance. |
pinIndex | int pinIndex(String typeId) | No description in source. |
pinDigest | boolean pinDigest(String typeId, String digest) | Pin the expected digest of a host-pinned type. Allowed once; never changed. |
indexOfName | int indexOfName(String name) | No description in source. |
isLinked | boolean isLinked(String name) | No description in source. |
typeOfName | String typeOfName(String name) | No description in source. |
countOfType | int countOfType(String typeId) | No description in source. |
liveCount | int liveCount() | No description in source. |
preflight | int 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. |
attach | int 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. |
attachModule | int 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. |
detach | boolean detach(String name) | Detach an instance: its links go, and an observer module is retired. |
mayControl | boolean mayControl(String name, int trust, String verb) | No description in source. |
pauseModule | boolean pauseModule(String name, int trust) | No description in source. |
resumeModule | boolean resumeModule(String name, int trust) | No description in source. |
alterModule | boolean alterModule(String name, int trust, int ins, int rep, int del, int first, int last) | No description in source. |
replaceModule | boolean replaceModule(String name, int trust, SLObserverPort fresh) | Hot-swap: the instance keeps its name, type, links and slot; only the port behind it changes. |
reinstateModule | boolean reinstateModule(String name, int trust) | No description in source. |
linkIndex | int linkIndex(int a, int b) | No description in source. |
isConnected | boolean isConnected(String from, String to) | No description in source. |
liveLinks | int liveLinks() | No description in source. |
fanoutOf | int fanoutOf(int a, String toType) | Live links from instance a to any instance of type `toType`. |
reaches | boolean reaches(int from, int to) | Does a live path lead from instance `from` to instance `to`? |
linkPair | boolean 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. |
modeBetween | String modeBetween(String from, String to) | The matrix mode of a live connection (feed, subscribe, contain), or "". |
unlinkPair | boolean 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
model | SLVerticalIntegration model | No description in source. |
linker | SLHotLinker linker | No description in source. |
tierNames | String[] tierNames | No description in source. |
tierTotal | int tierTotal | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String modelName, SLHotLinker l) | No description in source. |
stack | SLVerticalIntegration stack() | No description in source. |
tiers | int tiers() | No description in source. |
tierOf | int tierOf(String name) | No description in source. |
expand | SLCompartment 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). |
deposit | int deposit(String fromName, String toName, int amount) | A connected module puts units into a compartment. Returns units stored. |
feed | int 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
rows | SLHotLinkRow[] rows | No description in source. |
rowCount | int rowCount | No description in source. |
edgeFrom | String[] edgeFrom | No description in source. |
edgeTo | String[] edgeTo | No description in source. |
edgeMode | String[] edgeMode | No description in source. |
edgeFanout | int[] edgeFanout | No description in source. |
edgeCount | int edgeCount | No description in source. |
frozen | int frozen | No description in source. |
refused | int refused | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure() | No description in source. |
rowTotal | int rowTotal() | No description in source. |
linkTotal | int linkTotal() | No description in source. |
refusedCount | int refusedCount() | No description in source. |
isSealed | boolean isSealed() | No description in source. |
seal | void seal() | No description in source. |
indexOf | int indexOf(String typeId) | No description in source. |
find | SLHotLinkRow find(String typeId) | No description in source. |
rowAt | SLHotLinkRow rowAt(int i) | No description in source. |
typeForKind | String typeForKind(int kind) | The type that realises an SLIntegrationKind ordinal, or "" if none. |
oneOf2 | boolean oneOf2(String v, String a, String b) | No description in source. |
oneOf3 | boolean oneOf3(String v, String a, String b, String c) | No description in source. |
addRow | boolean 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. |
edgeIndex | int edgeIndex(String from, String to) | No description in source. |
typeReaches | boolean typeReaches(String from, String to) | Does the type graph already reach `to` from `from`? (self-links ignored) |
addEdge | boolean 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. |
edgeAllowed | boolean edgeAllowed(String from, String to) | No description in source. |
fanoutLimit | int fanoutLimit(String from, String to) | No description in source. |
edgeModeOf | String edgeModeOf(String from, String to) | No description in source. |
standard | int 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.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
id | String id | No description in source. |
codeArrival | String codeArrival | linked | native |
instanceArrival | String instanceArrival | hot | cold |
contract | String contract | port | compartment | native-abi |
minTrust | int minTrust | No description in source. |
maxInstances | int maxInstances | No description in source. |
kindFirst | int kindFirst | SLIntegrationKind range this type covers; -1 and -1 when not a compartment |
kindLast | int kindLast | No description in source. |
requiresAuthorizer | int requiresAuthorizer | No description in source. |
digestPolicy | String digestPolicy | none | host-pinned |
status | String status | verified | declared | unverified |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String typeId, String code, String instance, String link, | No description in source. |
getId | String getId() | No description in source. |
getCodeArrival | String getCodeArrival() | No description in source. |
getInstanceArrival | String getInstanceArrival() | No description in source. |
getContract | String getContract() | No description in source. |
getMinTrust | int getMinTrust() | No description in source. |
getMaxInstances | int getMaxInstances() | No description in source. |
getKindFirst | int getKindFirst() | No description in source. |
getKindLast | int getKindLast() | No description in source. |
needsAuthorizer | boolean needsAuthorizer() | No description in source. |
getDigestPolicy | String getDigestPolicy() | No description in source. |
getStatus | String getStatus() | No description in source. |
isHot | boolean isHot() | No description in source. |
isNativeCode | boolean isNativeCode() | No description in source. |
coversKind | boolean coversKind(int kind) | No description in source. |