SLMoralOperation.sleela
lib/moral-capacitor/SLMoralOperation.sleela · 93 line(s) · sleela
<< lib/moral-capacitor/SLMoralOperation.sleela
SLeeLa Standard Library Definition.
Definition: Defines SLMoralOperation — the thing the Moral Capacitor(TM)
judges. An operation is described by who performs it (actor, e.g. "vm" /
"os" / "machine"), the action verb (e.g. "allocate", "erase", "spawn",
"boot"), the target it affects (e.g. "guest-memory", "/dev/sda"), the scope
(e.g. "process", "disk", "host"), whether it is reversible, and whether the
affected party has consented. These fields are what the frameworks appraise
and what the veto set tests.
Keeping the operation an explicit object (rather than loose arguments) means a
verdict and a ledger entry can name exactly what was judged.
Family: moral-capacitor. Evaluated by SLMoralCapacitor. >>
#sleela 2.5
material;
class SLMoralOperation {
< ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
<< Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
or catalog can read and (where appropriate) override this record.
Values are faithful to the subject's real origin where publicly known. >>
String metaVersion = "1.0.0";
int metaId = 10916;
String metaAuthor = "Kiro Agent";
String metaDate = "2026-10-16";
String metaCopyright = "SLeeLa project";
String metaTrademark = "none";
String metaCorporation = "none";
< metaOrigin: National | <nation> | International | Galactic >
String metaOrigin = "International";
String metaBirthDate = "2026-10-10";
< metaScienceRating: maturity/robustness on a 1..10 scale >
int metaScienceRating = 9;
< metaNationalSchedule: a real, citable instrument or "none" >
String metaNationalSchedule = "none";
String getMetaVersion() { return metaVersion; }
void setMetaVersion(String v) { metaVersion = v; }
int getMetaId() { return metaId; }
void setMetaId(int v) { metaId = v; }
String getAuthor() { return metaAuthor; }
void setAuthor(String v) { metaAuthor = v; }
String getDate() { return metaDate; }
void setDate(String v) { metaDate = v; }
String getCopyright() { return metaCopyright; }
void setCopyright(String v) { metaCopyright = v; }
String getTrademark() { return metaTrademark; }
void setTrademark(String v) { metaTrademark = v; }
String getCorporation() { return metaCorporation; }
void setCorporation(String v) { metaCorporation = v; }
String getOrigin() { return metaOrigin; }
void setOrigin(String v) { metaOrigin = v; }
String getBirthDate() { return metaBirthDate; }
void setBirthDate(String v) { metaBirthDate = v; }
int getScienceRating() { return metaScienceRating; }
void setScienceRating(int v) { metaScienceRating = v; }
String getNationalSchedule() { return metaNationalSchedule; }
void setNationalSchedule(String v) { metaNationalSchedule = v; }
< "vm" / "os" / "machine" / library name >
String actor;
< verb: "allocate" / "erase" / "spawn" / "boot" / ... >
String action;
< what it affects >
String target;
< "process" / "disk" / "host" / "network" / ... >
String scope;
< 1 if the effect can be undone >
int reversible;
< 1 if the affected party has consented >
int consented;
int configured;
void configure(String who, String what, String onWhat, String howWide) {
actor = who; action = what; target = onWhat; scope = howWide;
reversible = 1; consented = 1; configured = 1;
}
void setReversible(boolean yes) { if (yes) { reversible = 1; } else { reversible = 0; } }
void setConsented(boolean yes) { if (yes) { consented = 1; } else { consented = 0; } }
String actorName() { return actor; }
String actionVerb() { return action; }
String targetName() { return target; }
String scopeName() { return scope; }
boolean isReversible() { return reversible == 1; }
boolean hasConsent() { return consented == 1; }
< A short identity line for verdicts and the ledger. >
String identity() {
return actor + ":" + action + " " + target + " (" + scope + ")";
}
}