Home /Modules/operating-system/SLOSArtifact.sleela

SLOSArtifact.sleela

lib/operating-system/SLOSArtifact.sleela · 93 line(s) · sleela

<< lib/operating-system/SLOSArtifact.sleela
   SLeeLa Standard Library Definition.
   Definition: Defines SLOSArtifact — a single named build artifact produced by
     the OS-construction pipeline: a generated source file (os_config.h,
     os_boot.c, os_image.cpp), an installer script, a manifest, or the final
     bootable ISO descriptor. It carries a logical output path, a kind tag, and
     the artifact's text contents (for source/scripts/manifests) or a descriptor
     (for the ISO). SLOSCompiler, SLISOBuilder, and SLInstallerGenerator each
     produce these; SLOSBuildReport collects them.
   
   This is a flat value object (no self-reference): callers hold artifacts in
   their own fields or feed them to SLOSBuildReport, which accumulates a
   printable index without needing a dynamic array.
   
   Family: operating-system. Produced by SLOSCompiler, SLISOBuilder, SLInstallerGenerator. >>
#sleela 2.5
material;
class SLOSArtifact {
  < ---- 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 = 10924;
  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; }
  < Kind tags. >
  static final int KIND_C_HEADER = 0;
  static final int KIND_C_SOURCE = 1;
  static final int KIND_CPP_SOURCE = 2;
  static final int KIND_SCRIPT = 3;
  static final int KIND_ISO = 4;
  static final int KIND_MANIFEST = 5;

  < logical output path >
  String path;
  < one of KIND_* >
  int kind;
  < text (source/script/manifest) or ISO descriptor >
  String contents;

  void configure(String outPath, int artifactKind, String text) {
    path = outPath; kind = artifactKind; contents = text;
  }

  String outputPath() { return path; }
  int artifactKind()  { return kind; }
  String text()       { return contents; }
  int byteCount()     { return native sleela_str_length(contents); }

  String kindName() {
    if (kind == KIND_C_HEADER)   { return "c-header"; }
    if (kind == KIND_C_SOURCE)   { return "c-source"; }
    if (kind == KIND_CPP_SOURCE) { return "cpp-source"; }
    if (kind == KIND_SCRIPT)     { return "script"; }
    if (kind == KIND_ISO)        { return "iso"; }
    return "manifest";
  }
}