Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fbb39e6
WIP: Slice C: Host metrics extdeps shapes
Jun 23, 2026
3be7eb6
Slice C: Host metrics extdeps shapes (§3 single-authority shape model…
Jun 23, 2026
8965a8c
Fix: Add NonEmptyStr casting in witness tests (as NonEmptyStr for nam…
Jun 23, 2026
0054a10
WIP: Slice C: Host metrics extdeps shapes
Jun 23, 2026
73cd637
Fix: resolve unit type violations in host metrics extdeps shapes
Jun 23, 2026
b7f0160
FIX: systemd.dag wire contract with execution + inert carrier roster
Jun 23, 2026
794a510
Fix fmt: normalize roster comment alignment
Jun 23, 2026
cc834c0
WIP: Slice C: Host metrics extdeps shapes
Jun 23, 2026
36745c9
Address PR feedback: consolidate Kibibyte alias, remove trivial asser…
Jun 23, 2026
2fdd3c6
WIP: Slice C: Host metrics extdeps shapes
Jun 23, 2026
142c628
FIX: Add missing List import to systemd.dag
Jun 23, 2026
8c06981
FIX: Remove stale inert carrier roster entries
Jun 23, 2026
979a94b
Revert "FIX: Remove stale inert carrier roster entries"
Jun 23, 2026
2234d51
WIP: Slice C: Host metrics extdeps shapes
Jun 23, 2026
3b909c9
FIX: Correct witness test syntax for .dag language
Jun 23, 2026
eee0ed9
Trigger CI run
Jun 23, 2026
8be2db9
Retrigger CI (previous run stuck in queue)
Jun 23, 2026
4080d4f
FIX: Remove 5 stale inert carrier roster entries
Jun 23, 2026
1e697e2
Merge remote-tracking branch 'origin/main' into session/wise-owl-312
Jun 23, 2026
6bc985a
WIP: Slice C: Host metrics extdeps shapes
Jun 23, 2026
fc64f90
Revert "WIP: Slice C: Host metrics extdeps shapes"
Jun 23, 2026
f803385
Merge remote-tracking branch 'origin/main' into session/wise-owl-312
Jun 23, 2026
8c0c2c5
Retrigger CI
Jun 23, 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
32 changes: 32 additions & 0 deletions dsl/extdeps/os/free.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module extdeps.os.free

import std.measure { ByteSize }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
locator: "man7.org/linux/man-pages/man1/free.1.html"
}
}

type MemoryStats {
total: ByteSize
used: ByteSize
free: ByteSize
shared: ByteSize
buff_cache: ByteSize
available: ByteSize
}

type SwapStats {
total: ByteSize
used: ByteSize
free: ByteSize
}

type FreeOutput {
memory: MemoryStats
swap: SwapStats
}
40 changes: 40 additions & 0 deletions dsl/extdeps/os/proc_meminfo.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module extdeps.os.proc_meminfo

import std.types { NonEmptyStr }
import std.list { List }
import std.measure { Kibibyte }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
locator: "man7.org/linux/man-pages/man5/proc.5.html#/proc/meminfo"
}
}

type MemoryMetric {
key: NonEmptyStr
value: Kibibyte
}

type ProcMeminfo {
mem_total: Kibibyte
mem_free: Kibibyte
mem_available: Kibibyte
buffers: Kibibyte
cached: Kibibyte
swap_total: Kibibyte
swap_free: Kibibyte
all_metrics: List<MemoryMetric>
}

data meminfo_field_names: List<NonEmptyStr> = [
"MemTotal",
"MemFree",
"MemAvailable",
"Buffers",
"Cached",
"SwapTotal",
"SwapFree",
]
57 changes: 57 additions & 0 deletions dsl/extdeps/os/systemd.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module extdeps.os.systemd

import std.types { NonEmptyStr }
import std.list { List }
import std.serialization { CoproductWireContract, StringVariant, SnakeCase }
import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
locator: "man7.org/linux/man-pages/man1/systemctl.1.html#is-active"
}
}

type SystemdUnitActiveState
= Active
| Inactive
| Activating
| Deactivating
| Reloading
| Failed

data systemd_unit_active_state_wire_contract: CoproductWireContract = {
coproduct: "SystemdUnitActiveState",
encoding: StringVariant { naming: SnakeCase }
}

data systemd_parse_label_derivation_debt: List<NonEmptyStr> = [
"dissolve-on: when contract-driven derivation is available (§3 single authority), derive parse/label from wire contract instead of hand-rolling",
]

fn parse_systemd_unit_active_state(raw: String) -> SystemdUnitActiveState? {
if raw == "active" { Present { value: Active } }
else { if raw == "inactive" { Present { value: Inactive } }
else { if raw == "activating" { Present { value: Activating } }
else { if raw == "deactivating" { Present { value: Deactivating } }
else { if raw == "reloading" { Present { value: Reloading } }
else { if raw == "failed" { Present { value: Failed } }
else { none } } } } } }
}

fn systemd_unit_active_state_wire_label(s: SystemdUnitActiveState) -> String {
match s {
Active => "active"
Inactive => "inactive"
Activating => "activating"
Deactivating => "deactivating"
Reloading => "reloading"
Failed => "failed"
}
}

type SystemdUnitStatus {
name: NonEmptyStr
active_state: SystemdUnitActiveState
}
2 changes: 2 additions & 0 deletions dsl/std/measure.dag
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ fn time_measure<S>(count: Nat) -> Measure<Time, S, Nat> {

type ByteSize = Measure<Memory, One, Nat>

type Kibibyte = Measure<Memory, Kibi, Nat>

type Gibibyte = Measure<Memory, Gibi, Nat>

fn gibibyte(count: Nat) -> Gibibyte {
Expand Down
38 changes: 38 additions & 0 deletions dsl/test/claim/os_free_witness_test.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module test.claim.os_free_witness

import extdeps.os.free {
FreeOutput,
MemoryStats,
SwapStats,
}
import std.measure { ByteSize, byte_size, byte_size_count }

test fn free_output_witnesses() -> Bool {
let memory_stats = MemoryStats {
total: byte_size(count: 8192000000),
used: byte_size(count: 1024000000),
free: byte_size(count: 2048000000),
shared: byte_size(count: 0),
buff_cache: byte_size(count: 5120000000),
available: byte_size(count: 3072000000),
}

let swap_stats = SwapStats {
total: byte_size(count: 2048000000),
used: byte_size(count: 0),
free: byte_size(count: 2048000000),
}

let output = FreeOutput {
memory: memory_stats,
swap: swap_stats,
}

byte_size_count(b: memory_stats.total) > 0
&& byte_size_count(b: memory_stats.available) <= byte_size_count(b: memory_stats.total)
&& byte_size_count(b: memory_stats.free) <= byte_size_count(b: memory_stats.total)
&& byte_size_count(b: swap_stats.used) <= byte_size_count(b: swap_stats.total)
&& byte_size_count(b: swap_stats.free) <= byte_size_count(b: swap_stats.total)
&& byte_size_count(b: output.memory.total) > 0
&& byte_size_count(b: memory_stats.available) >= byte_size_count(b: memory_stats.free)
}
31 changes: 31 additions & 0 deletions dsl/test/claim/os_proc_meminfo_witness_test.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module test.claim.os_proc_meminfo_witness

import extdeps.os.proc_meminfo {
ProcMeminfo,
MemoryMetric,
meminfo_field_names,
}
import std.measure { Kibibyte, measure_count }
import std.types { NonEmptyStr }

test fn proc_meminfo_witnesses() -> Bool {
let info = ProcMeminfo {
mem_total: Kibibyte { count: 8012272 },
mem_free: Kibibyte { count: 4048136 },
mem_available: Kibibyte { count: 6144000 },
buffers: Kibibyte { count: 256000 },
cached: Kibibyte { count: 2048136 },
swap_total: Kibibyte { count: 2097152 },
swap_free: Kibibyte { count: 2097152 },
all_metrics: [],
}

let metric = MemoryMetric {
key: "MemTotal" as NonEmptyStr,
value: Kibibyte { count: 8012272 },
}

measure_count(m: info.mem_total) > 0
&& measure_count(m: info.mem_available) <= measure_count(m: info.mem_total)
&& measure_count(m: metric.value) > 0
}
30 changes: 30 additions & 0 deletions dsl/test/claim/os_systemd_witness_test.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module test.claim.os_systemd_witness

import extdeps.os.systemd {
SystemdUnitStatus,
SystemdUnitActiveState,
Active,
Inactive,
Failed,
parse_systemd_unit_active_state,
systemd_unit_active_state_wire_label,
}
import std.types { NonEmptyStr }

test fn witness_active_wire_decodes_to_active() -> Bool {
match parse_systemd_unit_active_state(raw: "active") {
Present { value: Active } => true
_ => false
}
}

test fn witness_wrong_case_does_not_decode() -> Bool {
match parse_systemd_unit_active_state(raw: "ACTIVE") {
none => true
_ => false
}
}

test fn witness_roundtrip_failed() -> Bool {
systemd_unit_active_state_wire_label(s: Failed) == "failed"
}
5 changes: 4 additions & 1 deletion src/v1/stage0/src/inert_carrier_project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ const INERT_CARRIER_ROSTER: &[&str] = &[
"CargoPackage", // dsl/extdeps/rust/cargo.dag — Cargo manifest package row; unwired.
"FilePermissions", // dsl/extdeps/access/posix.dag — POSIX mode permission carrier; no fs consumer.
"FloorWitnessRow", // src/v2/workflow/affected_set_floor_runner.dag — runner row; self-only.
"FreeOutput", // dsl/extdeps/os/free.dag — host metrics shape; shadow lane, no workflow consumer yet.
"GitCliReportedVersion", // dsl/extdeps/git/versioning.dag — git --version parse target; unwired.
"ProcMeminfo", // dsl/extdeps/os/proc_meminfo.dag — /proc/meminfo parsed shape; shadow lane, no workflow consumer yet.
"ReactHookSite", // src/v2/extdeps/frameworks/react.dag — React hook-site model; unwired.
"SecretValue", // dsl/std/types.dag — secret-string carrier; no redaction consumer wired.
"SecretValue", // dsl/std/types.dag — secret-string carrier; no redaction consumer wired.
"SystemdUnitStatus", // dsl/extdeps/os/systemd.dag — systemd unit status shape; shadow lane, no workflow consumer yet.
];

/// Extract top-level `type NAME` carrier declarations with their full declaration BLOCK text.
Expand Down