Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d194c1c
WIP: Model systemd-oomd as a dependency (pure .dag, no live execution…
Jun 23, 2026
a3fbd54
WIP: Model systemd-oomd as a dependency (pure .dag, no live execution…
Jun 23, 2026
95c61f8
Merge remote-tracking branch 'origin/main' into session/valiant-pike-233
Jun 23, 2026
92e7d11
Model systemd-oomd as a dependency (pure .dag): reconcile carrier + s…
Jun 23, 2026
181f773
WIP: Model systemd-oomd as a dependency (pure .dag, no live execution…
Jun 23, 2026
05b75fe
Fix main-red: name jobserver's external-authority anchor to the gate-…
Jun 23, 2026
db0e67a
Merge remote-tracking branch 'origin/main' into session/valiant-pike-233
Jun 24, 2026
8a60900
Fix tree-wide main-red: regenerate ROADMAP.md from authority (dedup m…
Jun 24, 2026
9f3dfae
WIP: Model systemd-oomd as a dependency (pure .dag, no live execution…
Jun 24, 2026
8670b97
Strengthen OomdEnforced grounding to a full conjunction; retarget to …
Jun 24, 2026
1794ee7
WIP: Model systemd-oomd as a dependency (pure .dag, no live execution…
Jun 24, 2026
9e97611
Address review: ground oomd durations on std.measure Second; enumerat…
Jun 24, 2026
a263c92
Address review nits: String? grounding sentinel; promote Percent to s…
Jun 24, 2026
aea9ecb
Add gunbc_oomd_fleet_evidence seam for the fleet capacity gate (CI-hu…
Jun 24, 2026
4d186fa
WIP: Model systemd-oomd as a dependency (pure .dag, no live execution…
Jun 24, 2026
71ae949
Address RC: ground Percent as a Measure in std.measure (not a std.typ…
Jun 24, 2026
3955512
Merge remote-tracking branch 'origin/main' into session/valiant-pike-233
Jun 24, 2026
f0a43d0
WIP: Model systemd-oomd as a dependency (pure .dag, no live execution…
Jun 24, 2026
84d9288
Merge remote-tracking branch 'origin/main' into session/valiant-pike-233
Jun 24, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions dsl/extdeps/os/oomd.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
module extdeps.os.oomd

import std.types { NonEmptyStr, String, FilePath, Bool }
import std.measure { Second, second, Percent, percent }

import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
locator: "www.freedesktop.org/software/systemd/man/latest/oomd.conf.html"
}
}

data oomd_surface_doc: String = "systemd-oomd is the userspace OOM manager: it watches cgroup memory pressure (PSI) and swap usage and kills the worst-offending cgroup BEFORE the kernel OOM killer / OOM livelock fires. That livelock is the srv2-reboot vector. This module models what oomd PROVIDES (the config knobs it reads and the eviction backstop it gives), with the real key names from oomd.conf(5) and systemd.resource-control(5). It sits beside extdeps.os.systemd / extdeps.os.systemctl under the one systemd home. WHICH cgroups to protect at WHICH thresholds is workflow policy (gunbc), not a fact about systemd-oomd."

data systemd_oomd_unit: NonEmptyStr = "systemd-oomd.service"
data oomd_conf_path: FilePath = "/etc/systemd/oomd.conf"
data oomd_conf_dropin_dir: FilePath = "/etc/systemd/oomd.conf.d"

type ManagedOomAction
= ManagedOomAuto
| ManagedOomKill

type OomdGlobalConfig {
swap_used_limit: Percent
default_memory_pressure_limit: Percent
default_memory_pressure_duration: Second
}

data oomd_default_global_config: OomdGlobalConfig = OomdGlobalConfig {
swap_used_limit: percent(90),
default_memory_pressure_limit: percent(60),
default_memory_pressure_duration: second(30),
}

type UnitManagedOomPolicy {
scope_unit: NonEmptyStr
managed_oom_swap: ManagedOomAction
managed_oom_memory_pressure: ManagedOomAction
managed_oom_memory_pressure_limit: Percent?
managed_oom_memory_pressure_duration: Second?
}

data oomd_managed_oom_memory_pressure_property: NonEmptyStr = "ManagedOOMMemoryPressure"
data oomd_managed_oom_memory_pressure_limit_property: NonEmptyStr = "ManagedOOMMemoryPressureLimit"
data oomd_managed_oom_swap_property: NonEmptyStr = "ManagedOOMSwap"

data oomd_managed_value_kill: NonEmptyStr = "kill"
data oomd_managed_value_auto: NonEmptyStr = "auto"

fn managed_oom_action_value(a: ManagedOomAction) -> NonEmptyStr {
match a {
ManagedOomKill => oomd_managed_value_kill
ManagedOomAuto => oomd_managed_value_auto
}
}

type OomdDropIn {
target_unit: NonEmptyStr
policy: UnitManagedOomPolicy
}

service systemd.Oomctl {
operation Dump {
input {}
output {
stdout: String from "stdout"
success: Bool from "exit_success"
}
readonly
transport shell { argv: ["oomctl", "dump"] }
exit {
0 => Unit
nonzero => String "oomctl dump failed (systemd-oomd not running?)"
}
}
}
109 changes: 109 additions & 0 deletions dsl/extdeps/os/systemctl.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
module extdeps.os.systemctl

import std.types { NonEmptyStr, String, List, Bool, Int }

import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
locator: "www.freedesktop.org/software/systemd/man/latest/systemctl.html"
}
}

data systemctl_interface_doc: String = "systemd's service-manager control surface (systemctl). The active-state enum authority lives in extdeps.os.systemd (SystemdUnitActiveState); this module adds the operation shapes and the enablement-state enum, reusing that single authority rather than re-minting it. The operation shapes (inputs -> outputs, exit/error semantics) are what extdeps owns; the unit a caller acts on is always a parameter, never a literal baked into argv (a baked unit name would be business policy leaking down from the workflow layer, DESIGN section 3 fact c). The show-effective read (ShowProperty) reads back the LIVE resolved value, the only sound basis for grounding an enforcement predicate (DESIGN section 5: verify the realization, not the declaration). Names and exit semantics from systemctl(1)."

type UnitFileState
= UnitEnabled
| UnitEnabledRuntime
| UnitLinked
| UnitMasked
| UnitStatic
| UnitDisabled
| UnitIndirect
| UnitGenerated
| UnitTransient
| UnitBad

service systemd.Systemctl {
operation Enable {
input { unit: NonEmptyStr }
output {
success: Bool from "exit_success"
stdout: String from "stdout"
stderr: String from "stderr"
}
transport shell { argv: ["systemctl", "enable", "{unit}"] }
exit {
0 => Unit
nonzero => String "systemctl enable failed"
}
}

operation Start {
input { unit: NonEmptyStr }
output {
success: Bool from "exit_success"
stdout: String from "stdout"
stderr: String from "stderr"
}
transport shell { argv: ["systemctl", "start", "{unit}"] }
exit {
0 => Unit
nonzero => String "systemctl start failed"
}
}

operation SetProperty {
input { unit: NonEmptyStr, property: NonEmptyStr, value: NonEmptyStr }
output {
success: Bool from "exit_success"
stderr: String from "stderr"
}
transport shell { argv: ["systemctl", "set-property", "{unit}", "{property}={value}"] }
exit {
0 => Unit
nonzero => String "systemctl set-property failed"
}
}

operation DaemonReload {
input {}
output {
success: Bool from "exit_success"
stderr: String from "stderr"
}
transport shell { argv: ["systemctl", "daemon-reload"] }
exit {
0 => Unit
nonzero => String "systemctl daemon-reload failed"
}
}

operation IsActive {
input { unit: NonEmptyStr }
output {
state: String from "stdout"
active: Bool from "exit_success"
}
readonly
transport shell { argv: ["systemctl", "is-active", "{unit}"] }
exit {
0 => Unit
3 => Unit "unit is not active"
nonzero => String "systemctl is-active failed"
}
}

operation ShowProperty {
input { unit: NonEmptyStr, property: NonEmptyStr }
output { value: String from "stdout" }
readonly
transport shell { argv: ["systemctl", "show", "{unit}", "--property={property}", "--value"] }
exit {
0 => Unit
nonzero => String "systemctl show failed"
}
}
}
27 changes: 24 additions & 3 deletions dsl/extdeps/package_managers/apt.dag
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module extdeps.apt

import std.types { NonEmptyStr, FilePath }
import std.types { NonEmptyStr, FilePath, String, Bool }

import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
Expand All @@ -18,7 +18,28 @@ data apt_local_bin_dir: FilePath = "/usr/local/bin"
data package_coreutils: NonEmptyStr = "coreutils"
data package_grep: NonEmptyStr = "grep"
data package_diffutils: NonEmptyStr = "diffutils"
data package_cargo: NonEmptyStr = "cargo"
data package_rustc: NonEmptyStr = "rustc"
data package_cargo: NonEmptyStr = "cargo"
data package_rustc: NonEmptyStr = "rustc"

data package_systemd_oomd_defaults: NonEmptyStr = "systemd-oomd-defaults"

data apt_man_url: NonEmptyStr = "https://manpages.debian.org/testing/apt/apt.8.en.html"

data apt_install_effect_doc: String = "Install as an effect (non-readonly operation). The package is a PARAMETER reusing the existing package-name concept (package_* data below); apt owns the install interface shape, WHICH package is workflow policy supplied by the caller, so the argv carries no business literal (DESIGN section 3). Exit codes from apt-get(8): 100 covers a held dpkg/apt lock, fetch error, or unmet dependency."

service apt.PackageManager {
operation Install {
input { package: NonEmptyStr }
output {
success: Bool from "exit_success"
stdout: String from "stdout"
stderr: String from "stderr"
}
transport shell { argv: ["apt-get", "install", "--yes", "{package}"] }
exit {
0 => Unit
100 => String "apt-get install failed (lock held, fetch error, or unmet dependency)"
nonzero => String "apt-get install failed"
}
}
}
Loading