Home /Modules/operating-system/SLOSSensitivitySource.sleela

SLOSSensitivitySource.sleela

lib/operating-system/SLOSSensitivitySource.sleela · 242 line(s) · sleela

<< lib/operating-system/SLOSSensitivitySource.sleela
   SLeeLa Standard Library Definition.
   Definition: Defines SLOSSensitivitySource -- the zero-payload REFERENCE to
     the OS-grade C/C++ source warehouse (mearvk/OS.Sensitivity.III) that
     isolates the C and C++ for each target operating-system shape into its own
     top-level folder: linux/, windows/, macos/. It records the warehouse's
     identity, clone URL, the pinned commit for reproducibility, its default
     branch, and the map from an OS shape + component to the warehouse directory
     that provides it (uefi, bootloader, kernel-loader, driver-loader,
     base-drivers, os-loader, desktop-loader, os-core).
   
     It carries NO warehouse bytes. SLeeLa references the warehouse here and an
     OS Creator(TM) runnable fetches only the chosen shape's C/C++ on a per-user
     basis through SLOSSensitivityFetch, then manipulates it to produce the
     exact preliminary ISO source build for that user, at home or office.
   
   Relationship: SLDistroSource points at the upstream Ubuntu-lineage parts;
     this points at the dedicated, per-shape C/C++ warehouse the OS Creator
     consumes. SLOSModel / OS Creator generate the SLeeLa-shaped scaffolding;
     this names exactly which warehouse, which revision, which per-shape parts.
   
   Family: operating-system. Pure reference/manifest; no payload. >>
#sleela 2.5
material;
class SLOSSensitivitySource {
  < ---- 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 = 10931;
  String metaAuthor = "Kiro Agent";
  String metaDate = "2026-10-23";
  String metaCopyright = "SLeeLa project";
  String metaTrademark = "none";
  String metaCorporation = "none";
  < metaOrigin: National | <nation> | International | Galactic >
  String metaOrigin = "International";
  String metaBirthDate = "2026-10-23";
  < metaScienceRating: maturity/robustness on a 1..10 scale >
  int metaScienceRating = 7;
  < 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; }

  < Warehouse identity. >
  String name;
  String owner;
  String repo;
  < https clone URL >
  String url;
  < default branch >
  String branch;
  < exact revision for reproducible fetches >
  String pinnedCommit;

  < Configure with the known OS.Sensitivity.III warehouse reference. The pinned >
  < commit is the current main tip; callers may repin with pin(commit). >
  void configure() {
    name = "OS Sensitivity III (OS-grade C/C++ warehouse)";
    owner = "mearvk";
    repo = "OS.Sensitivity.III";
    url = "https://github.com/mearvk/OS.Sensitivity.III.git";
    branch = "main";
    < repinned to the main tip that carries all three populated shapes >
    < (complete linux-5.10.254 kernel; windows wine+reactos; macos xnu+ >
    < puredarwin+gnustep+darling) plus the root shapes.json descriptor. >
    pinnedCommit = "36eb3010ec17ed167b25cf52d3569718cbdbc666";
  }

  < The machine-readable shape descriptor at the warehouse root. The OSCreator >
  < runnable reads this (after fetch) to resolve shapes, component paths, >
  < pinned upstream refs, licenses, and build entry points without hard-coding. >
  String descriptorFile() { return "shapes.json"; }

  < On-disk path to the descriptor after a fetch into destRoot. >
  String descriptorPath(String destRoot) {
    return destRoot + "/" + repo + "/" + descriptorFile();
  }

  < Repin to a specific revision (keeps fetches reproducible). >
  void pin(String commit) { pinnedCommit = commit; }

  String identity() { return name + " [" + owner + "/" + repo + "@" + pinnedCommit + "]"; }
  String cloneUrl() { return url; }
  String defaultBranch() { return branch; }
  String commit() { return pinnedCommit; }

  < ---- OS shapes ------------------------------------------------------- >
  < The three top-level folders, one per operating-system shape. shapeDir >
  < returns the warehouse folder for a shape, or "" for an unknown shape. The >
  < accepted shape names mirror SLOSShape ("Linux"/"Windows"/"macOS") and their >
  < lower-case folder forms. >
  String shapeDir(String shape) {
    if (shape == "Linux"   || shape == "linux")   { return "linux"; }
    if (shape == "Windows" || shape == "windows") { return "windows"; }
    if (shape == "macOS"   || shape == "macos" || shape == "mac") { return "macos"; }
    return "";
  }

  boolean providesShape(String shape) { return shapeDir(shape) != ""; }

  < ---- Per-component directory map ------------------------------------- >
  < The per-shape subdirectory that carries each OS component's C/C++, in the >
  < firmware -> boot -> kernel -> userspace -> desktop order the OS boots. A >
  < caller resolves (shape, component) to a full warehouse path. componentDir >
  < returns "" for an unknown component; dirFor composes shape + component. >
  String componentDir(String component) {
    if (component == "uefi")           { return "uefi"; }
    if (component == "bios")           { return "bios"; }
    if (component == "bootloader")     { return "bootloader"; }
    if (component == "kernel-loader")  { return "kernel-loader"; }
    if (component == "driver-loader")  { return "driver-loader"; }
    if (component == "base-drivers")   { return "base-drivers"; }
    if (component == "os-loader")      { return "os-loader"; }
    if (component == "desktop-loader") { return "desktop-loader"; }
    if (component == "os-core")        { return "os-core"; }
    < compatibility/standalone parts carried by the windows + macos shapes >
    if (component == "compat-loader")  { return "compat-loader"; }
    if (component == "reactos")        { return "reactos"; }
    if (component == "puredarwin")     { return "puredarwin"; }
    if (component == "frameworks")     { return "frameworks"; }
    if (component == "installer")      { return "installer"; }
    if (component == "file-systems")   { return "file-systems"; }
    return "";
  }

  boolean providesComponent(String component) { return componentDir(component) != ""; }

  < ---- Shape-aware component resolution ------------------------------- >
  << The windows and macos shapes carry a different component layout than the
     native linux shape. shapeComponentDir resolves the EXACT warehouse path
     for a (shape, component) pair, honoring the per-shape structure recorded
     in the root shapes.json descriptor:
       linux/os-core, linux/os-loader, linux/desktop-loader, ...
       windows/compat-loader (Wine), windows/reactos (ReactOS standalone)
       macos/os-core (XNU), macos/puredarwin, macos/frameworks,
       macos/compat-loader (Darling)
     Returns "" when the pair is not provided by this warehouse. >>
  String shapeComponentDir(String shape, String component) {
    String sd = shapeDir(shape);
    if (sd == "") { return ""; }
    String cd = componentDir(component);
    if (cd == "") { return ""; }
    < windows: only compat-loader (wine) and reactos are present >
    if (sd == "windows") {
      if (cd == "compat-loader" || cd == "reactos") { return sd + "/" + cd; }
      return "";
    }
    < macos: os-core (xnu), puredarwin, frameworks, compat-loader (darling) >
    if (sd == "macos") {
      if (cd == "os-core" || cd == "puredarwin" || cd == "frameworks" || cd == "compat-loader") {
        return sd + "/" + cd;
      }
      return "";
    }
    < linux: the native component set >
    return sd + "/" + cd;
  }

  boolean providesShapeComponent(String shape, String component) {
    return shapeComponentDir(shape, component) != "";
  }

  < dirFor(shape, component): the warehouse path "<shape>/<component>", or "" if >
  < either the shape or the component is unknown. >
  String dirFor(String shape, String component) {
    return shapeComponentDir(shape, component);
  }

  < ---- Downloadability notes ------------------------------------------ >
  < What a fetch retrieves. The warehouse uses NO Git LFS, so a normal clone >
  < needs no `git lfs` step; its C/C++ is plain git objects. >
  String downloadabilityNote(String part) {
    if (part == "lfs") {
      return "NO LFS: the warehouse uses no LFS filters; a normal clone retrieves everything";
    }
    if (shapeDir(part) != "" || componentDir(part) != "" || part == "source") {
      return "YES: git-tracked C/C++ source clones fully (shallow is enough)";
    }
    return "UNKNOWN part";
  }

  < A newline-separated reference sheet a tool or README can print. >
  String referenceSheet() {
    String s = "# OS-grade C/C++ warehouse reference\n";
    s = s + "name:   " + name + "\n";
    s = s + "repo:   " + owner + "/" + repo + "\n";
    s = s + "url:    " + url + "\n";
    s = s + "branch: " + branch + "\n";
    s = s + "commit: " + pinnedCommit + "\n";
    s = s + "shapes:\n";
    s = s + "  Linux   -> " + shapeDir("Linux") + "\n";
    s = s + "  Windows -> " + shapeDir("Windows") + "\n";
    s = s + "  macOS   -> " + shapeDir("macOS") + "\n";
    s = s + "components (per shape):\n";
    s = s + "  uefi          -> " + componentDir("uefi") + "\n";
    s = s + "  bootloader    -> " + componentDir("bootloader") + "\n";
    s = s + "  kernel-loader -> " + componentDir("kernel-loader") + "\n";
    s = s + "  driver-loader -> " + componentDir("driver-loader") + "\n";
    s = s + "  base-drivers  -> " + componentDir("base-drivers") + "\n";
    s = s + "  os-loader     -> " + componentDir("os-loader") + "\n";
    s = s + "  desktop-loader-> " + componentDir("desktop-loader") + "\n";
    s = s + "  os-core       -> " + componentDir("os-core") + "\n";
    s = s + "descriptor: " + descriptorFile() + " (machine-readable shape map)\n";
    s = s + "example paths:\n";
    s = s + "  Linux   os-core       -> " + dirFor("Linux", "os-core") + "\n";
    s = s + "  Windows compat-loader -> " + dirFor("Windows", "compat-loader") + "\n";
    s = s + "  Windows reactos       -> " + dirFor("Windows", "reactos") + "\n";
    s = s + "  macOS   os-core        -> " + dirFor("macOS", "os-core") + "\n";
    s = s + "  macOS   puredarwin    -> " + dirFor("macOS", "puredarwin") + "\n";
    s = s + "  macOS   frameworks    -> " + dirFor("macOS", "frameworks") + "\n";
    s = s + "  macOS   compat-loader -> " + dirFor("macOS", "compat-loader") + "\n";
    s = s + "downloadable:\n";
    s = s + "  source parts -> " + downloadabilityNote("source") + "\n";
    s = s + "  git lfs      -> " + downloadabilityNote("lfs") + "\n";
    return s;
  }
}