Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
f747547
Linear code-point/octet slice: skip/take/get/count share the RRB carr…
Oct 4, 2026
08a22a6
code_point_slice witness: offset decode over non-ASCII text through t…
Oct 4, 2026
6df2f1b
Regenerate stage0 mirrors (pass 1); witness imports
Oct 5, 2026
fe80952
Regenerate stage0 mirrors (pass 2): emitted skip/take/skip-first now …
Oct 5, 2026
abcf580
Value drop: release a persistent carrier by refcount below a nesting …
Oct 5, 2026
aa8bf65
Cite the deep-drop control by its module
Oct 5, 2026
e8bfb93
Merge origin/main (conflicted generated mirrors taken from main; rege…
Oct 5, 2026
80b9ffc
Regenerate stage0 mirrors on the merged tree (required-regen converge…
Oct 5, 2026
04cd308
Restate the slice cost as O(n log n); exact negative-count contracts;…
Oct 5, 2026
6ece848
Regenerate witnesses.yml: slice cost controls step on the generated job
Oct 5, 2026
be51a9f
Enrol only the drop tests of value_depth_walker_tests beside the slic…
Oct 5, 2026
ddb5b64
code_point_slice witness: size the many-fields walk under the new-wit…
Oct 5, 2026
f70eb02
Merge origin/main (conflicted generated artifacts taken from main; re…
Oct 5, 2026
e68e82d
skip/take contracts: ephemeral_work from the same clamped k as output…
Oct 5, 2026
91f195d
Regenerate stage0 mirrors and witnesses.yml on the merged tree (requi…
Oct 5, 2026
26db7bc
Merge origin/main (conflicted generated artifacts taken from main; re…
Oct 5, 2026
09bf927
Regenerate stage0 mirrors and witnesses.yml on the merged tree (requi…
Oct 5, 2026
e0355cb
workspace_source: exact-name credential exclusions; pinned srv1 host …
Oct 5, 2026
a79b8e9
workspace_source: exclude FIDO-backed SSH keys by name (id_ecdsa_sk, …
Oct 5, 2026
d4c03d1
workspace_source: exclude transcript content (operator decision); per…
Oct 5, 2026
b3ba8c1
workspace_source: excluded size is a ByteSize parsed once; class-matc…
Oct 5, 2026
e6b296f
workspace_source: segment rules and path rules are two types; no fail…
Oct 5, 2026
7095623
Workspace pack: same-size, same-path synthetic transcript placeholder…
Oct 5, 2026
0488771
Workspace pack: prove placeholder bytes by digest, not name and size
Oct 5, 2026
6616291
Workspace transcript append rate: a size-and-mtime instrument on srv1…
Oct 5, 2026
2308bcf
transcript rate: the declared interval row no longer shares its name …
Oct 5, 2026
ce5f706
Regenerate fleet-converge.yml for workspace_transcript_rate_observe
Oct 5, 2026
210e398
Workspace pack: declared agent_state_slot input; zero-placeholder pac…
Oct 5, 2026
afa4e1b
Merge #13429 (agent_state_slot admission); the rate instrument takes …
Oct 5, 2026
457c439
Merge origin/main: keep main's PortableValue drop beside the carrier …
Oct 5, 2026
3cc369f
v1_rt.rs: restore list_skip/list_take (main's mirror lacked the runti…
Oct 5, 2026
8169255
Regenerate fleet-converge.yml after the slot merge
Oct 5, 2026
d2e6b30
transcript rate: a grown file's delta is a ByteSize like every other …
Oct 5, 2026
c10f939
Regenerate stage0 mirrors on the merged tree (pass 1; v1_rt.rs kept a…
Oct 5, 2026
7a1af03
workspace_source: move two in-body annotations to module-item grain (…
Oct 5, 2026
7030a40
Merge branch 'workspace-transcript-placeholders' of https://github.co…
Oct 5, 2026
34306c6
Regenerate stage0 mirrors on the merged tree (pass 2; required-regen …
Oct 5, 2026
34e2693
transcript rate: a backwards clock reading refuses the window instead…
Oct 5, 2026
d942a8d
workspace_source: restore 'let archive' lost in the annotation move
Oct 5, 2026
3ca0d91
Merge branch 'workspace-transcript-placeholders' of https://github.co…
Oct 5, 2026
cc1b069
transcript rate: enrol the two real-execution witnesses on the local-…
Oct 5, 2026
249b0fc
Enroll the pack's six wet witnesses: local_repo_wet_schedule rows and…
Oct 5, 2026
449c370
Merge #13429 (wet-lane enrolment of its real-execution witnesses)
Oct 5, 2026
3084e8c
Merge main; #13429's route-gap chunk renamed chunk_41 (main landed it…
Oct 5, 2026
2c2c8d0
floor_route_gap: the pack's Dir expectations are chunk_41 (main lande…
Oct 5, 2026
3074790
Merge remote-tracking branch 'origin/main' into session/swift-ibex-835
Oct 6, 2026
229c31d
Merge remote-tracking branch 'origin/main' into session/sunny-heron-294
Oct 6, 2026
5d3205b
repo_self_build: the targeted-test comment no longer calls the unit l…
Oct 6, 2026
0481d0b
Regenerate compiler_tests.rs on the merged tree (required-regen conve…
Oct 6, 2026
c799787
Merge remote-tracking branch 'origin/main' into session/sunny-heron-294
Oct 6, 2026
e03a6ef
Merge main into workspace-transcript-placeholders (chunk_40 before ch…
Oct 6, 2026
6e57eca
Merge #13429 (main integrated); route-gap registration taken from #13…
Oct 6, 2026
9462a8f
transcript rate: sample instants are ObservationInstants on one clock…
Oct 6, 2026
44e67ef
transcript rate: the span annotation moves to module-item grain (emit…
Oct 6, 2026
199d7b7
transcript rate: receipt rates are std.measure Bandwidth derived from…
Oct 6, 2026
eb1371a
Merge main into workspace-transcript-placeholders (std.optional re-ho…
Oct 6, 2026
36608d4
Repoint the three claude_code modules in the fleet-converge closure t…
Oct 6, 2026
5735c8a
Regenerate fleet-converge.yml over the merged tree (generator output)
Oct 6, 2026
cbabe57
Merge main into workspace-transcript-placeholders (v2.std.optional im…
Oct 6, 2026
e2e71fe
Merge main into workspace-transcript-placeholders (docs/design-rung-d…
Oct 6, 2026
3b4e68b
Merge #13429 (e2e71fe; std.optional repoint); fleet-converge.yml rege…
Oct 6, 2026
f476361
Merge remote-tracking branch 'origin/main' into session/sunny-heron-294
Oct 6, 2026
75bedc9
transcript rate: import std.optional (re-homed by #13388)
Oct 6, 2026
12303d0
Regenerate fleet-converge.yml (generator output) after merging #13429…
Oct 6, 2026
654117b
Merge origin/main (generated conflicts taken from main; v1_rt.rs keep…
Oct 7, 2026
aded760
Regenerate stage0 mirrors and witnesses.yml on the merged tree (requi…
Oct 7, 2026
df455ec
Merge main into workspace-transcript-placeholders (floor_route_gap ch…
Oct 7, 2026
9802e2b
Merge #13429 (df455ec; main merged) into #13442; wet schedule keeps b…
Oct 7, 2026
c6ed99c
floor_route_gap: drop the extra closing brace in the chunk roster join
Oct 7, 2026
3a70ea4
Merge commit 'c6ed99c73af351cc560ef358729c85ce3ff9aaa6' into session/…
Oct 7, 2026
92421dd
Merge origin/main into #13442 (mode list keeps R2ConditionalPutRacePr…
Oct 7, 2026
9eead4f
Regenerate fleet-converge.yml (generator output) after merging main
Oct 7, 2026
e241cc6
retrigger CI
Oct 7, 2026
a651914
workspace_source: pack refusal kind is a closed WorkspacePackRefusal …
Oct 7, 2026
121acc4
Merge origin/main into #13442 (mode list: main's plus WorkspaceTransc…
Oct 7, 2026
2c0b248
Merge commit 'a6519149b64ef6bbaac2d22348b1aace813f7c9c' into session/…
Oct 7, 2026
a3bcc63
Regenerate fleet-converge.yml (generator output) after merging main a…
Oct 7, 2026
76052f4
Merge origin/main incl. #13280 (generated conflicts taken from main; …
Oct 8, 2026
931fc9a
Regenerate stage0 mirrors and witnesses.yml on main incl. #13280 (ext…
Oct 8, 2026
a1b6477
Merge main into workspace-transcript-placeholders (fleet-converge.yml…
Oct 8, 2026
97d505b
Merge #13429 (a1b6477); fleet-converge.yml taken from #13429, regener…
Oct 8, 2026
69bd90a
Regenerate fleet-converge.yml (generator output) after merging #13429…
Oct 8, 2026
2cfffd6
Merge origin/main (generated conflicts taken from main; regen follows)
Oct 9, 2026
e551ac2
Regenerate stage0 mirrors and witnesses.yml on current main (incl. v1…
Oct 9, 2026
ea37bdf
Merge origin/main into #13442 (mode list: main's plus WorkspaceTransc…
Oct 9, 2026
6a23a5a
Regenerate fleet-converge.yml (generator output) after merging main
Oct 9, 2026
31f19da
Merge branch 'pr13346' into integration/warm-badger-442
Oct 9, 2026
d9dc8b6
Merge branch 'pr13442c' into integration/warm-badger-442
Oct 9, 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
40 changes: 33 additions & 7 deletions .github/workflows/fleet-converge.yml

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions .github/workflows/witnesses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,31 @@ jobs:
if (! '[' '-f' "$GUNBC_FLOOR_RECEIPT" ']') || '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' || ('[' "$GUNBC_FLOOR_CLASS" '=' 'infra' ']' && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=structural' "$GUNBC_FLOOR_RECEIPT"))) || ('[' "$GUNBC_FLOOR_CLASS" '=' 'none' ']' && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=structural' "$GUNBC_FLOOR_RECEIPT")) && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=infra' "$GUNBC_FLOOR_RECEIPT"))); then 'printf' 'class=%s\nsignature=%s\nexit=%s\n' "$GUNBC_FLOOR_CLASS" "$GUNBC_FLOOR_SIGNATURE" "$GUNBC_FLOOR_EXIT" > "$GUNBC_FLOOR_RECEIPT"; if '[' "$GUNBC_FLOOR_CLASS" '=' 'infra' ']'; then 'echo' '::error title=environment::floor_class='"$GUNBC_FLOOR_CLASS"' signature='"$GUNBC_FLOOR_SIGNATURE"' exit='"$GUNBC_FLOOR_EXIT"'; this is not a verdict about the diff. Attempt receipt: '"$GUNBC_FLOOR_RECEIPT"; fi; if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']'; then 'echo' '::error title=subject::floor_class='"$GUNBC_FLOOR_CLASS"' exit='"$GUNBC_FLOOR_EXIT"'; read the step log for the subject defect'; fi; fi
'exit' "$GUNBC_FLOOR_EXIT"

if: "!cancelled()"
- name: Run the slice cost controls
id: slice_cost_controls
run: |+
GUNBC_FLOOR_LOG='gunbc-floor-cmd.log'
'set' '+e'
'set' '-o' 'pipefail'
('sh' '-e' '-c' 'cargo test --release -p v1-stage0-runtime --lib -- list_slice_tests') 2>&1 | 'tee' "$GUNBC_FLOOR_LOG"
GUNBC_FLOOR_EXIT="$?"
GUNBC_FLOOR_RECEIPT='gunbc-floor-outcome.txt'
GUNBC_FLOOR_CLASS='structural'
GUNBC_FLOOR_SIGNATURE=''
if '[' "$GUNBC_FLOOR_EXIT" '-eq' '126' ']'; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='CommandInvokedCannotExecute'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' "$GUNBC_FLOOR_EXIT" '-eq' '127' ']'; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='CommandNotFound'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' "$GUNBC_FLOOR_EXIT" '-eq' '0' ']'; then GUNBC_FLOOR_CLASS='none'; GUNBC_FLOOR_SIGNATURE=''; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'MemoryStallRefusedPageThrash' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='MemoryStallRefusedPageThrash'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'The runner has received a shutdown signal' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='RunnerLost'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'sccache: error: failed to execute compile' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='SccacheFailedToExecuteCompile'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' '(exit status: 254)' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='SccacheRustcWrapperExit254'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'sccache: encountered fatal error' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='SccacheFatalError'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'failed to spawn' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='ProcessSpawnFailure'; fi
if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' && '[' '-f' "$GUNBC_FLOOR_LOG" ']' && 'grep' '-q' 'Resource temporarily unavailable' "$GUNBC_FLOOR_LOG"; then GUNBC_FLOOR_CLASS='infra'; GUNBC_FLOOR_SIGNATURE='ResourceTemporarilyUnavailable'; fi
if (! '[' '-f' "$GUNBC_FLOOR_RECEIPT" ']') || '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']' || ('[' "$GUNBC_FLOOR_CLASS" '=' 'infra' ']' && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=structural' "$GUNBC_FLOOR_RECEIPT"))) || ('[' "$GUNBC_FLOOR_CLASS" '=' 'none' ']' && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=structural' "$GUNBC_FLOOR_RECEIPT")) && (! ('[' '-f' "$GUNBC_FLOOR_RECEIPT" ']' && 'grep' '-q' 'class=infra' "$GUNBC_FLOOR_RECEIPT"))); then 'printf' 'class=%s\nsignature=%s\nexit=%s\n' "$GUNBC_FLOOR_CLASS" "$GUNBC_FLOOR_SIGNATURE" "$GUNBC_FLOOR_EXIT" > "$GUNBC_FLOOR_RECEIPT"; if '[' "$GUNBC_FLOOR_CLASS" '=' 'infra' ']'; then 'echo' '::error title=environment::floor_class='"$GUNBC_FLOOR_CLASS"' signature='"$GUNBC_FLOOR_SIGNATURE"' exit='"$GUNBC_FLOOR_EXIT"'; this is not a verdict about the diff. Attempt receipt: '"$GUNBC_FLOOR_RECEIPT"; fi; if '[' "$GUNBC_FLOOR_CLASS" '=' 'structural' ']'; then 'echo' '::error title=subject::floor_class='"$GUNBC_FLOOR_CLASS"' exit='"$GUNBC_FLOOR_EXIT"'; read the step log for the subject defect'; fi; fi
'exit' "$GUNBC_FLOOR_EXIT"

if: "!cancelled()"
- name: "Stage0 mirrors match one emission by this seed: required CI build lane"
id: stage0_regen
Expand Down
94 changes: 94 additions & 0 deletions dag/extdeps/crypto/seeded_filler.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
module extdeps.crypto.seeded_filler

import std.types { String, NonEmptyStr, Int, FilePath }
import std.measure { ByteSize, byte_size, measure_count }
import std.optional { Present, Absent }
import std.decl_ref { DeclarationRef, WholeDeclaration }
import extdeps.external_authority { ExternalAuthority, ExternalModelScope, ExternalSubjectRef }
import extdeps.uri { Uri, Https }
import extdeps.shell
import extdeps.tools.coreutils_truncate
import extdeps.tools.coreutils_stat
import extdeps.tools.openssl

// A DETERMINISTIC, NON-SECRET, INCOMPRESSIBLE FILE OF EXACTLY N BYTES, KEYED BY A SEED.
//
// The construction is the GNU coreutils manual's own seeded random source ("Sources of random data"):
// the AES-256-CTR keystream that `openssl enc -aes-256-ctr -pass pass:<seed> -nosalt` produces over
// zeros. Here the zeros are a file `truncate -s N` sized exactly, so the keystream is exactly N bytes
// long without a pipe: CTR is a stream mode, so output length equals input length. It is
// reproducible (one seed, one key, one stream), two seeds give unrelated streams, and an AES
// keystream is indistinguishable from random, so neither gzip nor a chunk store's dedup finds
// structure in it -- which is why it, and not zeros or a repeated pattern, stands in for content
// whose SIZE must be carried while its bytes must not be: a compressible filler would understate
// what storing the real content costs. The seed is in argv and is NOT a secret; the filler carries
// no information beyond its seed and its length.
data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri { scheme: Https, locator: "www.gnu.org/software/coreutils/manual/html_node/Random-sources.html" }
}

data seeded_filler_openssl_enc_authority: ExternalAuthority = ExternalAuthority {
uri: Uri { scheme: Https, locator: "docs.openssl.org/3.0/man1/openssl-enc/" }
}

data extdeps_model_scope: ExternalModelScope = ExternalModelScope {
subject: ExternalSubjectRef {
declaration: DeclarationRef { module_path: "extdeps.crypto.seeded_filler", decl_name: "seeded_filler_write", field: WholeDeclaration }
},
first_citation: extdeps.crypto.seeded_filler.extdeps_external_authority_anchor,
further_citations: [extdeps.crypto.seeded_filler.seeded_filler_openssl_enc_authority]
}

// WHICH STEP REFUSED. The size readback is a step: a filler whose stat size is not the requested
// size is refused, never returned.
type SeededFillerStep
= FillerZeroSized
| FillerKeystreamWritten
| FillerZeroRemoved
| FillerSizeReadBack

type SeededFiller
= SeededFillerWritten { path: NonEmptyStr, size: ByteSize }
| SeededFillerRefused { path: NonEmptyStr, step: SeededFillerStep, detail: String }

fn seeded_filler_step_words(step: SeededFillerStep) -> String {
match step {
FillerZeroSized => "truncate"
FillerKeystreamWritten => "openssl-enc"
FillerZeroRemoved => "zero-input-removal"
FillerSizeReadBack => "size-readback"
}
}

// WRITE THE FILLER AT `path`, whose parent directory must exist. The zero input is a sibling
// `<path>.zero`, sparse on every filesystem truncate extends, and removed before returning.
fn seeded_filler_write(seed: NonEmptyStr, size: ByteSize, path: NonEmptyStr) -> SeededFiller {
let zero = concat(path as String, ".zero") as NonEmptyStr
let sized = coreutils.Truncate.ToSize(size_bytes: to_string(measure_count(m: size)) as NonEmptyStr, path: zero)
if sized.success == false {
SeededFillerRefused { path: path, step: FillerZeroSized, detail: "truncate could not size the zero input" }
} else {
let enc = openssl.Enc.Aes256CtrPassphrase(passphrase: seed, input_path: zero, output_path: path)
let removed = shell.Remove.FileForce(path: zero as FilePath)
if enc.success == false {
SeededFillerRefused { path: path, step: FillerKeystreamWritten, detail: enc.stderr }
} else if removed.success == false {
SeededFillerRefused { path: path, step: FillerZeroRemoved, detail: concat("the zero input could not be removed: ", zero as String) }
} else {
seeded_filler_readback(path: path, size: size)
}
}
}

fn seeded_filler_readback(path: NonEmptyStr, size: ByteSize) -> SeededFiller {
let st = coreutils.Stat.PathSize(path: path)
match parse_int(s: replace(st.size_text, "\n", "")) {
Absent => SeededFillerRefused { path: path, step: FillerSizeReadBack, detail: concat("stat printed no size: ", st.size_text) }
Present { value: n } =>
if st.success && n == measure_count(m: size) {
SeededFillerWritten { path: path, size: size }
} else {
SeededFillerRefused { path: path, step: FillerSizeReadBack, detail: join(["the filler is ", to_string(n), " bytes, not ", to_string(measure_count(m: size))], "") }
}
}
}
4 changes: 4 additions & 0 deletions dag/extdeps/exec/command.dag
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ fn argv_command(program: ProgramIdentity, arguments: List<String>) -> ArgvComman
decl_ref(module_path: "extdeps.tools.tar", decl_name: "tar_extract_command"),
decl_ref(module_path: "extdeps.tools.tar", decl_name: "tar_create_from_list_command"),
decl_ref(module_path: "extdeps.tools.tar", decl_name: "tar_list_command"),
decl_ref(module_path: "extdeps.tools.tar", decl_name: "tar_create_from_two_lists_command"),
decl_ref(module_path: "extdeps.tools.tar", decl_name: "tar_list_sizes_command"),
decl_ref(module_path: "extdeps.tools.tar", decl_name: "tar_extract_listed_command"),
decl_ref(module_path: "extdeps.tools.btrfs_progs", decl_name: "btrfs_subvolume_create_command"),
decl_ref(module_path: "extdeps.tools.btrfs_progs", decl_name: "btrfs_subvolume_snapshot_read_only_command"),
decl_ref(module_path: "extdeps.tools.btrfs_progs", decl_name: "btrfs_subvolume_delete_command"),
Expand All @@ -115,6 +118,7 @@ fn argv_command(program: ProgramIdentity, arguments: List<String>) -> ArgvComman
decl_ref(module_path: "extdeps.tools.findutils", decl_name: "find_regular_files_sha256_command"),
decl_ref(module_path: "extdeps.tools.findutils", decl_name: "find_owner_executable_files_command"),
decl_ref(module_path: "extdeps.tools.findutils", decl_name: "find_symlink_targets_command"),
decl_ref(module_path: "extdeps.tools.findutils", decl_name: "find_regular_file_size_mtime_command"),
decl_ref(module_path: "extdeps.tools.gnu_coreutils", decl_name: "mv_exact_destination_command"),
decl_ref(module_path: "extdeps.tools.gnu_coreutils", decl_name: "sort_in_place_command"),
decl_ref(module_path: "extdeps.tools.unzip", decl_name: "unzip_extract_command"),
Expand Down
4 changes: 2 additions & 2 deletions dag/extdeps/languages/rust/emit.dag
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ data rust_simple_method_specs: List<SimpleMethodSpec> = [
{ method_name: "first", template: "\{recv\}.first().cloned()", wraps_result: false },
{ method_name: "enumerate", template: "\{recv\}.iter().cloned().enumerate().map(|(i, v)| (i as i64, v)).collect::<Vec<_>>()", wraps_result: true },
{ method_name: "chars", template: "\{recv\}.chars().map(|c| c as i64).collect::<Vec<_>>()", wraps_result: true },
{ method_name: "skip", template: "\{recv\}.iter().cloned().skip(\{arg\} as usize).collect::<Vec<_>>()", wraps_result: true },
{ method_name: "take", template: "\{recv\}.iter().cloned().take(\{arg\} as usize).collect::<Vec<_>>()", wraps_result: true },
{ method_name: "skip", template: "v1_rt::list_skip(&\{recv\}, \{arg\})", wraps_result: true },
{ method_name: "take", template: "v1_rt::list_take(&\{recv\}, \{arg\})", wraps_result: true },
{ method_name: "is_empty", template: "\{recv\}.is_empty()", wraps_result: false }
]

Expand Down
29 changes: 29 additions & 0 deletions dag/extdeps/tools/coreutils_truncate.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module extdeps.tools.coreutils_truncate

import extdeps.external_authority { ExternalAuthority }
import extdeps.uri { Uri, Https }
import std.types { Bool, NonEmptyStr, Unit }

data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority {
uri: Uri {
scheme: Https
locator: "www.gnu.org/software/coreutils/manual/html_node/truncate-invocation.html"
}
}

// `truncate -s N FILE` creates FILE if it is absent and sets its size to EXACTLY N bytes; bytes it
// adds read as zero (coreutils "truncate invocation"). -s takes a bare decimal byte count here, never
// a suffixed one, so the size is the caller's integer and nothing the tool reinterprets. -- ends the
// options, so a path beginning with '-' is a path.
service coreutils.Truncate {
operation ToSize {
requires none
input { size_bytes: NonEmptyStr, path: NonEmptyStr }
output { success: Bool from "exit_success" }
transport shell { argv: ["truncate", "-s", "{size_bytes}", "--", "{path}"] }
exit {
0 => Unit
nonzero => String "truncate could not size the path"
}
}
}
24 changes: 24 additions & 0 deletions dag/extdeps/tools/findutils.dag
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,27 @@ fn find_owner_executable_files_command(root: String) -> ArgvCommand {
fn find_symlink_targets_command(root: String) -> ArgvCommand {
argv_command(program: find_program(), arguments: [root, "-type", "l", "-printf", "l %P -> %l\\n"])
}

// THE REGULAR FILES UNDER A ROOT WITH THEIR SIZE AND MODIFICATION TIME, ONE
// `<size>\t<mtime>\t<relative path>` LINE EACH, AND NOTHING READ BUT METADATA. Every -printf
// directive here is answered from the inode find already holds from its own stat(2) of the entry
// (find manual, "Format Directives"): %s is st_size in bytes, %T@ is st_mtime as seconds since the
// epoch with a fractional part, %P is the path with the starting point removed. No directive opens
// the file, and the expression carries no action that runs another program, so the command reads
// no file content -- find_command_runs_another_program below is how a consumer checks the second
// half on the value rather than on this note. The path is LAST so a name holding a tab survives as
// the rest of the line; the escapes are find's own, so the argv word carries a backslash and a
// letter, never a control character.
fn find_regular_file_size_mtime_command(root: String) -> ArgvCommand {
argv_command(program: find_program(), arguments: [root, "-type", "f", "-printf", "%s\\t%T@\\t%P\\n"])
}

// THE ACTIONS THAT MAKE find RUN ANOTHER PROGRAM ON WHAT IT MATCHED (find manual, "Run Commands"):
// -exec and -execdir, and their prompting forms -ok and -okdir. find itself reads directory entries
// and inodes; every content reader it can reach -- cat, sha256sum, grep -- arrives through one of
// these four. find_regular_files_sha256_command above is a real builder that uses one.
data find_program_running_actions: List<String> = ["-exec", "-execdir", "-ok", "-okdir"]

fn find_command_runs_another_program(command: ArgvCommand) -> Bool {
any(command.arguments, a => any(find_program_running_actions, x => a == x))
}
16 changes: 16 additions & 0 deletions dag/extdeps/tools/gzip.dag
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,19 @@ service gzip.Gzip {
}
}
}

// COMPRESS ONE FILE BESIDE ITSELF: `--keep --best --force`, which writes <path>.gz at level 9, keeps
// the input, and replaces a stale <path>.gz (gzip manual, "Invoking gzip"). The compressed size is a
// stat of <path>.gz; it is how a caller asks whether bytes are compressible without carrying them.
service gzip.Compress {
operation BesideKeepBest {
requires none
input { path: NonEmptyStr }
output { success: Bool from "exit_success" }
transport shell { argv: ["gzip", "--keep", "--best", "--force", "--", "{path}"] }
exit {
0 => Unit
nonzero => String "gzip could not compress the path"
}
}
}
25 changes: 25 additions & 0 deletions dag/extdeps/tools/openssl.dag
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,28 @@ data extdeps_model_scope: ExternalModelScope = ExternalModelScope {
first_citation: extdeps.tools.openssl.extdeps_external_authority_anchor,
further_citations: []
}

// `openssl enc -aes-256-ctr` ENCRYPTS ONE FILE INTO ANOTHER UNDER AES-256 IN COUNTER MODE (openssl-enc,
// docs.openssl.org/3.0/man1/openssl-enc/). CTR is a stream mode, so the output is exactly as long as
// the input -- no padding, and -nosalt drops the "Salted__" header -- and is the input XOR the AES
// keystream. -pass pass:<p> derives the key and IV from the passphrase; -md sha256 pins that
// derivation's digest, which is the default from OpenSSL 1.1.0 on, so 1.1 and 3.x hosts agree. The
// passphrase is in argv and is therefore NOT a secret: this operation is for keyed, reproducible
// streams whose key anyone may know (extdeps.crypto.seeded_filler), never for confidentiality.
service openssl.Enc {
operation Aes256CtrPassphrase {
requires none
input { passphrase: NonEmptyStr, input_path: NonEmptyStr, output_path: NonEmptyStr }
output {
success: Bool from "exit_success"
stderr: String from "stderr"
}
transport shell {
argv: [openssl_program().invocation, "enc", "-aes-256-ctr", "-nosalt", "-md", "sha256", "-pass", "pass:{passphrase}", "-in", "{input_path}", "-out", "{output_path}"]
}
exit {
0 => Unit
nonzero => String "openssl enc refused"
}
}
}
Loading
Loading