SLRegistryProvenance.sleela
lib/registry/SLRegistryProvenance.sleela · 101 line(s) · sleela
<< lib/registry/SLRegistryProvenance.sleela
SLeeLa Standard Library Definition.
Definition: Defines SLRegistryProvenance — the OOD equivalent of a native
registry provenance record (registry/sleela_registry.* struct
sl_reg_provenance). It makes a registry entry self-describing and
verifiable: the tracked file's name, date, author, version, a stable hex
id, the SHA-256 of its content, and an ORIGINALITY SEAL. The seal is a
SHA-256 over (hexId | version | hash | author); if any of those is altered,
verify() reports the seal broken. The actual hashing crosses the native
bridge (the host computes SHA-256); this class is the record + seal check.
Mirrors: sl_reg_provenance + sl_reg_seal/sl_reg_seal_verify.
Family: registry. Attached to an SLRegistryKey. >>
#sleela 3.0
material;
class SLRegistryProvenance {
< ---- 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 = 11097;
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-14";
< 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; }
< tracked file name >
String name;
< ISO-8601 recorded date/time >
String date;
< authoring party >
String author;
< artifact version >
String version;
< 16 hex chars, stable identity >
String hexId;
< SHA-256 of the file content (64 hex) >
String hash;
< originality seal (64 hex) >
String seal;
void configure(String fileName, String recordedDate, String by,
String ver, String id, String contentHash) {
name = fileName; date = recordedDate; author = by;
version = ver; hexId = id; hash = contentHash; seal = "";
}
< The seal input: the four identity-and-content fields, order fixed. >
String sealInput() { return hexId + "|" + version + "|" + hash + "|" + author; }
< The host computes SHA-256 of sealInput() and sets it here (native bridge). >
void setSeal(String computed) { seal = computed; }
boolean isSealed() {
if (seal == null) { return false; }
return seal != "";
}
< Verify requires the host to recompute SHA-256(sealInput()) and compare. >
< expected = that recomputation; returns true if it matches the stored seal. >
boolean verify(String expected) { return isSealed() && seal == expected; }
String render() {
return "<provenance> file=" + name + " author=" + author
+ " version=" + version + " hexid=" + hexId
+ " hash=" + hash + " seal=" + seal
+ " [" + (isSealed() ? "SEALED" : "UNSEALED") + "]";
}
}