SLGovVerdict.sleela
lib/opcodes/governance/SLGovVerdict.sleela · 105 line(s) · sleela
<< lib/opcodes/governance/SLGovVerdict.sleela
SLeeLa Standard Library Definition.
Definition: Defines SLGovVerdict, the discretionary outcome a governance
principal (Registrar, Listener, EventObserver) returns about an opcode or
an opcode sequence.
This is the "discretion in SLeeLa herself" the user asked for: rather than a
raw boolean pass/fail, a verdict carries a graded disposition so the program
can be admitted, warned about, patched, paused as unrest, or rejected.
Dispositions, from most permissive to most restrictive:
ADMIT — the opcode/sequence is in order; proceed.
WARN — proceed, but a concern was recorded (non-blocking).
PATCH — a known, safe correction was applied via a symbol map; proceed
with the patched form.
PAUSE — hold the program as "unrest": not rejected, but it may not run
until a human or a higher authority resolves the concern.
REJECT — the opcode/sequence is out of order unto itself; refuse it.
Family: opcodes.governance. Native VM/OS work crosses an explicit bridge. >>
#sleela 2.5
material;
< Unified SLeeLa standard-library front-end object. >
class SLGovVerdict {
< ---- 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 = 10078;
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-05";
< 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; }
static final int ADMIT = 0;
static final int WARN = 1;
static final int PATCH = 2;
static final int PAUSE = 3;
static final int REJECT = 4;
int disposition;
< human-readable justification >
String reason;
< opcode index the verdict concerns (-1 = whole program) >
int atIndex;
< SLGovPhase value in which it was issued >
int phase;
void configure(int d, String why, int index, int govPhase) {
disposition = d;
reason = why;
atIndex = index;
phase = govPhase;
}
int value() { return disposition; }
String why() { return reason; }
int index() { return atIndex; }
int phaseValue() { return phase; }
boolean proceeds() { return disposition == ADMIT || disposition == WARN || disposition == PATCH; }
boolean blocks() { return disposition == PAUSE || disposition == REJECT; }
boolean isUnrest() { return disposition == PAUSE; }
boolean patched() { return disposition == PATCH; }
< Combine two verdicts: the more restrictive disposition wins, so a single >
< REJECT or PAUSE anywhere governs the sequence. >
SLGovVerdict mostRestrictive(SLGovVerdict other) {
if (other == null) { return this; }
if (other.value() > disposition) { return other; }
return this;
}
}