MINK
Standard library

MINK Standard Library Reference

Applies to: MINK 1.0.5 (current repository build) and MINK 1.0.4 (published npm package). The module contracts below were audited on 2026-11-05 (M6 Session 178) against the then-current 1.0.4 repository build and a 1.0.2 install; audit-time versions are kept where they are part of the evidence. Status: Developer reference, audited 2026-11-05 (M6 Session 178); current version line re-checked 2026-11-08 (Session 217). Companion documents: LANGUAGE_BASICS.md for runtime semantics, DEBUGGING_AND_TESTING.md for diagnostics and test workflow.

This reference is built from the sources in stdlib/*.mink and from programs that were compiled and executed during the audit. Every entry carries an evidence marker:

MarkerMeaning
EXECThe call was compiled and run, and its output/exit code was observed.
SOURCESignature and contract come from the module source and its comments; it was not executed in this session.
PARTIALPartly executed, or executed only in a composite probe.
UNKNOWNThe source states no reliable contract; do not rely on it.

Compilation proves syntax, not behavior. Source comments are evidence of intent, not proof of behavior; where a comment and an execution disagree, the execution wins and the disagreement is called out.

Contents

  1. Environment and version reality
  2. Module index
  3. Output and formatting
  4. Strings
  5. Collections
  6. Filesystem
  7. JSON
  8. CSV
  9. Encoding
  10. Hashing and crypto
  11. Math
  12. Time
  13. Logging
  14. Process and environment
  15. Random
  16. Regular expressions
  17. Networking, HTTP and TLS
  18. SQLite
  19. Compression and archives
  20. Threads and tasks
  21. Assertions and mink test
  22. Option and Result
  23. Ownership cheat sheet
  24. What is not verified
  25. Where to look next

1. Environment and version reality

Two binaries were used during this audit and they were not the same version:

BinaryVersion at audit (2026-11-05)Standard-library lookup
mink on PATH (npm global package)mink 1.0.2<package>/stdlib, resolved from the executable
target/release/mink.exe (repository build)mink 1.0.4<exe>/../stdlib, then <cwd>/stdlib

The installed package reported 1.0.2 on the audit machine. Earlier M6 records assume an installed 1.0.4; that assumption did not hold here. Both binaries compiled and ran the programs in this reference, but the repository

  1. binary is the one used for every recorded output unless stated

otherwise. Current state (Session 217, 2026-11-08): the registry serves

  1. and the repository build reports mink 1.0.5; the module contracts and

recorded outputs below still come from the 1.0.4/1.0.2 audit and were not re-executed for 1.0.5. Record the exact version in any bug report.

The repository binary must be run with the repository root as the working directory, or the source copied beside the needed stdlib files. The installed binary carries its own stdlib, so it works from any directory.

# repository build
./target/release/mink.exe --version        # mink 1.0.5 (1.0.4 at audit time)
./target/release/mink.exe build app.mink

# installed package
mink --version                             # 1.0.2 on the audit machine; registry now 1.0.4
mink build app.mink

2. Module index

Load a module with mod name;. Its top-level functions are then called unqualified. use does not load a file. Standard-library module files are plain MINK; they can be read, and a local name.mink beside your source shadows the bundled module.

ModulePurposeEvidence
assertTest assertions used by mink testEXEC
collectionsVec<T> helper functions (vec_*)EXEC
cryptoHMAC-SHA256, HKDF-SHA256, secure randomSOURCE
csvRFC 4180 subset row parse/writeEXEC
encodingHex, Base64/URL-safe Base64, UTF-8, URL encoding, byte classesPARTIAL
environmentWraps the predeclared rt_env_* intrinsics as env_*; load with mod environment;EXEC
filesystemPaths, file read/write, directories, CWDEXEC
hashingFNV-1a, djb2, SHA-256, digest equalitySOURCE
httpHTTP/1.1 client over TCPSOURCE
httpserverHTTP/1.1 server helpersSOURCE
jsonArena-based JSON parser and serializerEXEC
loggingLeveled logging to stderrEXEC
mathInteger/float math, trigonometry, logsPARTIAL
networkTCP/UDP sockets, polling, timeoutsSOURCE
optionOption<T> enum declaration onlySOURCE
processChild process run and output captureEXEC
randomDeterministic xorshift64* PRNGSOURCE
reBacktracking regular expressionsEXEC
resultResult<T, E> enum declaration onlySOURCE
sqliteIn-memory SQL engineEXEC
stringsString search, transform, split/join, parseEXEC
tasksDeferred-task queueSOURCE
threadsThreads and locksSOURCE
timeClock, calendar, strftime/strptimeEXEC
tlsTLS client with certificate validationSOURCE
zipZIP archive builder and readerPARTIAL
zlibDeflate/inflate, zlib, gzip, CRC-32, Adler-32PARTIAL

Built-in types and intrinsics need no mod: Vec<T>, Map<K, V>, Set<T>, and every rt_* intrinsic listed below.

3. Output and formatting

Every print intrinsic writes its value and then CRLF (\r\n). There is no same-line print. To build one line, build one Str and print it once.

IntrinsicBehaviorEvidence
rt_print_str(s: Str)Writes s then CRLF; borrows sEXEC
rt_print_int(n: Int)Decimal then CRLFEXEC
rt_print_float(f: Float)Up to 17 significant digits, trailing zeros removed, then CRLFEXEC
rt_print_char(c: Char)Character then CRLFEXEC
rt_stderr_write(s: Str)Writes exactly s; no newline is appendedEXEC
rt_str_concat(a: Str, b: Str) -> StrNew owned string; borrows both inputsEXEC
rt_str_format(fmt, a, b, c) -> StrNew owned string; substitutes up to three {}EXEC
rt_str_from_int(n) -> StrNew owned stringEXEC
rt_str_from_float(f) -> StrNew owned stringEXEC (source signature)
rt_str_from_bool(b) -> StrNew owned stringSOURCE
rt_str_len(s) -> Int, rt_str_byte(s, i) -> IntBorrow; byte-orientedEXEC
rt_str_eq(a, b) -> BoolBorrows bothEXEC

Verified float output:

InputOutput
2.52.5
1.01
1.0 / 3.00.33333333333333331
0.1 + 0.20.30000000000000004
-0.0-0

A string containing \n produces an extra break because the intrinsic adds its own terminator (rt_print_str(rt_str_concat("x", "\n")) writes x\n\r\n). rt_str_format("a={} b={}", one, two, "") with fewer substituted values than placeholders leaves the remaining slots empty; it does not fail.

Known discrepancy: src/backend/ir.rs still describes PrintFloat as "up to six fractional digits". The observed behavior is 17 significant digits. The source comment was left unchanged; runtime semantics were not modified.

4. Strings (mod strings)

The module follows the V1 ownership contract: user functions consume their Str parameters. Search/validation functions therefore return the consumed input in a tuple so the caller can free it exactly once; transformations consume the input and return a new string.

4.1 Search and compare

SignatureResult and ownershipEvidence
str_cmp(a: Str, b: Str) -> Int-1, 0, 1; consumes and frees bothSOURCE
str_index_of(s: Str, sub: Str) -> (Int, Str)-1 when absent; frees sub, returns sEXEC
str_last_index_of(s, sub) -> (Int, Str)Last byte index; frees sub, returns sSOURCE
str_contains(s, sub) -> (Bool, Str)Returns sEXEC
str_starts_with(s, prefix) -> (Bool, Str)Returns sSOURCE
str_ends_with(s, suffix) -> (Bool, Str)Returns sSOURCE
str_count(s, sub) -> (Int, Str)Non-overlapping count; returns sSOURCE
str_is_numeric(s) -> (Bool, Str)Returns sSOURCE
str_is_alpha(s) -> (Bool, Str)Returns sSOURCE
str_is_alphanumeric(s) -> (Bool, Str)Returns sSOURCE
str_char_at(s: Str, i: Int) -> (Int, Str)Byte value; returns sSOURCE
mod strings;

fn main() -> Int {
    let (at, s) = str_index_of("hello world", "world");
    rt_print_int(at);          // 6
    rt_str_free(s);            // the input string, returned by the call
    let (yes, t) = str_contains("hello", "ell");
    if yes { rt_print_str("contains"); }
    rt_str_free(t);
    return 0;
}

Output (each line CRLF):

6
contains

4.2 Transformation (input consumed, new string returned)

SignatureNotesEvidence
str_trim(s) -> StrASCII whitespace at both endsEXEC
str_trim_start(s) -> Str, str_trim_end(s) -> StrOne sideSOURCE
str_to_upper(s) -> Str, str_to_lower(s) -> StrASCIIEXEC (upper)
str_sub(s, start, end) -> Strend exclusive; indices are bytesEXEC
str_repeat(s, count) -> StrEmpty when count <= 0SOURCE
str_pad_left(s, len, pad_byte) -> Strpad_byte is a byte value (48 = '0')EXEC
str_pad_right(s, len, pad_byte) -> StrSame conventionSOURCE
str_reverse(s) -> StrByte order, not grapheme orderSOURCE
str_replace(s, old, new) -> StrReplaces the first occurrence; an empty old inserts new at the startEXEC
str_replace_all(s, old, new) -> StrReplaces every non-overlapping occurrence; an empty old returns the input unchangedSOURCE
str_join_2(a, b) -> Str, str_join_3(a, b, c) -> StrPlain concatenation helpersSOURCE

All of these consume their Str arguments. Passing a literal is safe because freeing a literal is a no-op; passing a heap string passes ownership.

4.3 Split and join

SignatureContractEvidence
str_split(s: Str, delim: Str) -> Vec<Str>Consumes both; each part is a fresh owned string; empty delimiter yields one partEXEC
str_join(parts: Vec<Str>, delim: Str) -> StrConsumes the vector (and its element strings) and the delimiter; returns an owned stringEXEC
mod strings;

fn main() -> Int {
    let parts = str_split("a,b,c", ",");
    rt_print_int(rt_vec_len(parts));    // 3
    let joined = str_join(parts, "-");  // parts is consumed here
    rt_print_str(joined);               // a-b-c
    rt_str_free(joined);
    return 0;
}

Output: 3, a-b-c.

4.4 Parsing

SignatureContractEvidence
str_parse_int(s: Str) -> (Int, Bool)(value, ok); (0, false) on junk or overflow; consumes sEXEC
str_parse_float(s: Str) -> (Float, Bool)Same conventionSOURCE

The flag is a Bool. Do not pass it to an if when a module returns an Int flag: base64_decode_alloc returns (Str, Int), and if ok on that value is E-T01 expected Bool, found Int.

5. Collections: Vec, Map, Set

Collections are built-in handle values. Operations take a handle and return a handle; assign the result of a consuming operation back to the variable. Read-only operations borrow. There is no automatic cleanup, and freeing a collection handle more than once is an invalid free at runtime.

5.1 Intrinsics

IntrinsicOwnershipEvidence
rt_vec_new(cap) -> Vec<T>New handleEXEC
rt_vec_push(v, value) -> Vec<T>Consumes v, returns the handle to keepEXEC
rt_vec_pop(v) -> TBorrows v; returns the last value (observed 11)EXEC
rt_vec_get(v, i) -> T, rt_vec_len(v) -> IntBorrowEXEC
rt_vec_set(v, i, value) -> Vec<T>Consumes, returnsEXEC
rt_vec_remove(v, i) -> Vec<T>Consumes, returnsSOURCE
rt_vec_free(v)Releases the handle and its element stringsEXEC
rt_map_new(cap) -> Map<K,V>New handleEXEC
rt_map_insert(m, key, value) -> Map<K,V>Consumes the handle, key and value; returns the handle to keepEXEC
rt_map_get(m, key) -> V, rt_map_has(m, key) -> Bool, rt_map_len(m) -> IntBorrowEXEC
rt_map_remove(m, key) -> Map<K,V>Consumes, returnsEXEC
rt_map_keys(m) -> Vec<K>, rt_map_values(m) -> Vec<V>Fresh vector of copiesEXEC
rt_map_free(m)Releases the handle and its keys/valuesEXEC
rt_set_new(cap), rt_set_insert(s, v), rt_set_has, rt_set_len, rt_set_remove, rt_set_elements, rt_set_freeSame handle pattern; elements returns Vec<T>EXEC

Map keys may be Int, Bool, Char, Str, or an enum whose variants carry no payload. Map<K, V> annotations are accepted on bindings, parameters and return types.

fn total(m: Map<Int, Int>) -> Int {
    return rt_map_get(m, 1) + rt_map_get(m, 2);
}

fn build() -> Map<Int, Int> {
    let mut m = rt_map_new(2);
    m = rt_map_insert(m, 1, 10);
    m = rt_map_insert(m, 2, 20);
    return m;
}

fn main() -> Int {
    let mut m = rt_map_new(2);
    m = rt_map_insert(m, 1, 10);
    m = rt_map_insert(m, 2, 20);
    rt_print_int(total(m));       // 30
    let built = build();
    rt_print_int(total(built));   // 30
    rt_print_int(total(built));   // 30: a map may be passed repeatedly
    rt_map_free(m);
    rt_map_free(built);
    return 0;
}

5.2 Contracts that matter

  • A map handle can cross a function boundary and be used again by the caller. An unannotated parameter used with rt_map_get is inferred as a map; a partial inference failure can print Map<unresolved, ...>.
  • rt_map_insert with an existing key replaces the value. The key is moved in, so a heap key must be a copy if the caller still needs the original string.
  • Inserting an owned Str into a map moves it. rt_map_free releases keys and values, so do not free a string that was inserted.
  • rt_map_keys / rt_map_values / rt_set_elements return owned vectors; free them with rt_vec_free. Their order is not insertion order; treat it as unspecified.
  • rt_map_get on a key that is not present is a runtime failure E-R11 (exit 111), not a sentinel value. Use rt_map_has when a key may be absent.
  • Use-after-free and stale handles are diagnosed (Sessions 195 and 197). Every Vec/Map/Set accessor validates the handle against the runtime liveness table before reading its header, so `rt_map_free(m); rt_map_get(m, 1); exits 105 (E-R05`) instead of returning stale bytes. Handles also carry the allocation generation, so a freed handle whose block is reused by a new allocation is still rejected (E-R05, 105) rather than aliasing the replacement; freeing such a handle is E-R05 too, while a plain double free remains E-R04 (104). The generation is 16 bits, but a freed block whose generation reaches 0xFFFF is retired instead of reused (Session 204), so generation 0 is never issued and a handle kept across any number of reallocations stays dead (E-R05, 105). The cost is one abandoned block per 65,536 reuses.
  • A Vec<Str> built with rt_vec_push inside deeply nested if/else blocks produced a corrupted length (16 for one element) and an invalid free in the Session 180 application. The same pattern worked at shallower nesting. The application was restructured to avoid it; see the consolidated session record. Treat collection mutation inside deep nesting as suspect and verify it.

5.3 collections module (mod collections)

Thin wrappers over the intrinsics: vec_new, vec_free, vec_len, vec_is_empty, vec_get, vec_set, vec_first, vec_last, vec_push, vec_pop, vec_remove, vec_insert, vec_contains, vec_index_of, vec_count, vec_sum, vec_min, vec_max, vec_reverse.

vec_insert(v, index, value) consumes and returns the vector. vec_reverse(v) mutates in place and returns the same handle. vec_min/vec_max on an empty vector read index 0 and are not safe; check vec_len first. All vec_sum, vec_min, vec_max assume numeric elements.

mod collections;

fn main() -> Int {
    let mut v = vec_new(4);
    v = vec_push(v, 10);
    v = vec_push(v, 20);
    v = vec_push(v, 30);
    rt_print_int(vec_sum(v));        // 60
    rt_print_int(vec_index_of(v, 99)); // -1
    v = vec_insert(v, 1, 99);
    rt_print_int(vec_get(v, 1));     // 99
    rt_print_int(vec_pop(v));        // 30
    vec_free(v);
    return 0;
}

6. Filesystem (mod filesystem)

fs_* wrappers consume their Str parameters. Literal arguments are safe; heap paths are moved. Return values are the only error information: there is no filesystem last-error call.

CallSuccessFailureEvidence
fs_write(path, data) -> Intbytes written (0 for empty data)-1EXEC
fs_read(path) -> Strowned contents; length is the bytes actually read; empty file and failed read give """"EXEC (Session 203)
fs_file_size(path) -> Intbytes (0 for empty)-1EXEC
fs_exists(path) -> Booltrue / false-EXEC
fs_create_dir, fs_remove_dir, fs_remove_file, fs_copy_file, fs_move, fs_set_cwd01EXEC (create/remove/copy/move per Session 177)
fs_dir_open(path) -> Inthandle0SOURCE + Session 177
fs_dir_next(handle) -> Strowned entry name"" when exhausted or 0SOURCE + Session 177
fs_dir_close(handle) -> Int0-1 for 0SOURCE + Session 177
fs_get_cwd() -> Strowned path-SOURCE
fs_file_size_or(path, default) -> Intsize or default-SOURCE

fs_read cannot distinguish a missing file from an empty file: both return a zero-length string. Use fs_exists or fs_file_size (-1 vs 0).

fs_read obtains the exact 64-bit size with GetFileSizeEx (Session 206), then uses the byte count ReadFile actually transferred as the returned string's length. A failed read and a short read therefore return an owned string of exactly the transferred bytes (empty on failure); the uninitialised tail of the allocation is never exposed. A file larger than the 1 GiB arena (minus the 16-byte string header) is refused with an owned empty string instead of being truncated or aborting, and a failed size query takes the same safe path. fs_file_size also uses GetFileSizeEx, so it reports the exact 64-bit length at and above 4 GiB rather than the low 32 bits. The read API remains whole-file; there is no seek or read-at-offset operation.

fs_is_file returns true when the path exists and its size is non-negative; fs_is_dir returns true when the path exists and its size is negative. These are size-based heuristics, not a real file-type query.

Path helpers (all consume their Str arguments): path_join, path_parent, path_filename, path_extension, path_stem, path_has_extension, path_is_absolute, path_is_relative, path_with_extension, path_normalize. path_join uses / as its separator even on Windows and returns b when b starts with /.

mod filesystem;

fn main() -> Int {
    let written = fs_write("note.txt", "hello");
    let size = fs_file_size("note.txt");
    let text = fs_read("note.txt");
    let missing = fs_read("absent.txt");
    rt_print_int(written);                       // 5
    rt_print_int(size);                          // 5
    rt_print_int(rt_str_len(text));              // 5
    rt_print_int(rt_str_len(missing));           // 0
    rt_print_int(fs_file_size("absent.txt"));    // -1
    rt_str_free(text);
    rt_str_free(missing);
    rt_print_int(fs_remove_file("note.txt"));    // 0
    return 0;
}

Directory enumeration: the handle is an owned resource and forgetting fs_dir_close leaks. Entry order is unspecified.

7. JSON (mod json)

The parser is arena based. Allocate an arena with rt_alloc(bytes), parse into it, read values by word offset, and release the arena with rt_free. The parser consumes its input string, so copy a string you still need.

CallContractEvidence
json_parse(input: Str, arena: Ptr<Int>) -> Int64 KiB geometry (8192 slots); returns value offset, 0 on error; consumes inputEXEC
json_parse_in(input, arena, slots) -> IntCaller-sized arena; slots includes the write-pointer slotSOURCE
json_tag(arena, offset) -> Int0 null, 1 bool, 2 number, 3 string, 4 array, 5 objectSOURCE
json_as_bool, json_as_int, json_as_str, json_num_strTyped reads; json_as_str returns an owned StrEXEC (as_str/as_int)
json_arr_len, json_arr_get(arena, arr, i) -> IntArray access by offsetEXEC
json_obj_len, json_obj_get_key(arena, obj, i) -> Str, json_obj_get_val(arena, obj, i) -> IntObject access; the key is an owned StrEXEC
json_to_str(arena, offset) -> StrOwned serializationEXEC
json_null, json_bool_val, json_int_val, json_num_text, json_str_val, json_arr_start, json_obj_startConstructors that write at a word pointerSOURCE
mod json;

fn main() -> Int {
    let arena = rt_alloc(65536);
    let v = json_parse("{\"name\":\"mink\",\"count\":3}", arena);
    let key = json_obj_get_key(arena, v, 0);
    rt_print_str(key);                                  // name
    rt_str_free(key);
    let name = json_as_str(arena, json_obj_get_val(arena, v, 0));
    rt_print_str(name);                                 // mink
    rt_str_free(name);
    rt_print_int(json_as_int(arena, json_obj_get_val(arena, v, 1))); // 3
    let round = json_to_str(arena, v);
    rt_print_str(round);
    rt_str_free(round);
    rt_free(arena);
    return 0;
}

Output: name, mink, 3, {"name":"mink","count":3}.

json_parse returns 0 for malformed input and for a document that does not fit. A successful parse returns a non-zero offset; offset 0 can never be a valid value because the arena begins with the input bytes.

Nesting limit (session 278). The parser recurses once per array/object level. It accepts at most 128 levels of nesting (_JSON_MAX_DEPTH); deeper input returns 0 without parsing. Before session 278 the recursion was unbounded, and roughly 500 levels of [[[…]]] overflowed the generated program's 1 MiB stack and terminated the process with 0xC00000FD — an uncontrolled crash on untrusted input rather than a parse error. 100 levels still parse; 200 and above return 0. Regression coverage: tests/ownership_runtime_conformance.rs (B-LIB-01–B-LIB-03).

Arena vs. returned strings. The arena is one rt_alloc block owned by the caller and released with rt_free(arena). The accessors do not return views into it: json_as_str, json_obj_get_key, json_num_str and json_to_str each allocate a new heap Str with rt_str_alloc and copy the bytes out. Those results are ordinary owned strings — free each with rt_str_free — and they stay valid after the arena is released. The exit-time leak scan counts the arena and every copied string as separate live blocks, so both must be released; otherwise the program exits 106 (E-R06).

8. CSV (mod csv)

RFC 4180 subset: comma separated, CR/LF/CRLF records, double-quoted fields, "" escapes a quote inside a quoted field. The module works one record at a time; split a document on line endings first, but pass whole records whose quoted fields contain newlines.

CallContractEvidence
csv_parse_row(line: Str) -> Vec<Str>Consumes line; returns owned field strings; empty input yields an empty vectorEXEC
csv_escape(field: Str) -> StrConsumes; quotes/escapes only when requiredEXEC
csv_write_row(fields: Vec<Str>) -> StrDoes not consume the vector; returns an owned lineEXEC
csv_field_count(row: Vec<Str>) -> IntBorrowsEXEC
csv_round_trip(fields: Vec<Str>) -> Vec<Str>Write then parseSOURCE
mod csv;

fn main() -> Int {
    let row = csv_parse_row("a,\"b,c\",\"d\"\"e\"");
    rt_print_int(csv_field_count(row));   // 3
    let out = csv_write_row(row);
    rt_print_str(out);                    // a,"b,c","d""e"
    rt_str_free(out);
    rt_vec_free(row);                     // releases the field strings
    return 0;
}

Forgetting rt_vec_free(row) leaves the field strings live and exits 106.

9. Encoding (mod encoding)

All functions consume Str parameters. The decoders return a tuple whose second element is an Int status (1 success, 0 failure), not a Bool; using it directly as a condition is E-T01.

FunctionResultEvidence
hex_encode(s) -> Str, hex_encode_upper(s) -> StrHex textEXEC
hex_decode_alloc(s) -> (Str, Int)Decoded bytes and statusSOURCE
base64_encode(s) -> Str, base64_url_encode(s) -> StrBase64 textEXEC (standard)
base64_decode_alloc(s) -> (Str, Int), base64_url_decode_alloc(s) -> (Str, Int)Decoded and statusEXEC
url_encode(s) -> Str, url_decode_alloc(s) -> (Str, Int)Percent encodingEXEC (encode)
utf8_validate(s) -> Bool, utf8_char_count(s) -> IntBorrow-only validation/countPARTIAL
utf8_decode(s) -> Vec<Int>, utf8_encode(codes: Vec<Int>) -> StrCode pointsSOURCE
utf8_char_at(s, i) -> Int, utf8_byte_index(s, i) -> Int, utf8_slice(s, start, end) -> StrCode-point indexingSOURCE
byte_is_digit/upper/lower/alpha/alphanumeric/hex/printable/whitespace(b: Int) -> BoolByte classesSOURCE
str_is_ascii, int_to_hex, hex_to_intHelpersSOURCE
mod encoding;

fn main() -> Int {
    let h = hex_encode("AB");
    rt_print_str(h);                       // 4142
    rt_str_free(h);
    let b = base64_encode("hello");
    rt_print_str(b);                       // aGVsbG8=
    rt_str_free(b);
    let (plain, status) = base64_decode_alloc("aGVsbG8=");
    rt_print_str(plain);                   // hello
    rt_str_free(plain);
    if status == 1 { rt_print_str("b64-ok"); }
    return 0;
}

10. Hashing and crypto

10.1 mod hashing

FunctionContractEvidence
hash_fnv1a(s: Str) -> Int64-bit FNV-1a; consumes sSOURCE
hash_djb2(s) -> Intdjb2; consumes sSOURCE
hash_combine(a: Int, b: Int) -> IntMix two hash valuesSOURCE
hash_sha256(s: Str) -> StrLowercase hex digest, owned; consumes sSOURCE
hash_digest_equal(a, b) -> BoolConstant-time-ish compare; consumes bothSOURCE
hex_encode_byte(b: Int) -> StrTwo hex charactersSOURCE

10.2 mod crypto

FunctionContractEvidence
crypto_init() -> IntInitialize the CSPRNG; 0 on successSOURCE
crypto_random_bytes(count) -> Str, crypto_random_hex(count) -> StrOwned random dataSOURCE
crypto_random_int() -> IntRandom 64-bit valueSOURCE
hmac_sha256(key, message) -> StrOwned hex HMAC; consumes bothSOURCE
hkdf_extract(salt, ikm) -> Str, hkdf_expand(prk, info, length) -> Str, hkdf_sha256(ikm, salt, info, length) -> StrHKDF-SHA256SOURCE
crypto_verify(a, b) -> BoolCompare digestsSOURCE
crypto_secure_zero_str(s) -> StrOverwrite then return the stringSOURCE

crypto.mink declares its hashing dependency, so mod crypto; alone pulls in hash_sha256. crypto_init should be called before random-byte use.

11. Math (mod math)

Functions are pure numeric and return values directly. Representative API:

GroupFunctionsEvidence
Constantsmath_pi, math_e, math_tau, math_sqrt2, math_ln2, math_ln10, math_infEXEC (pi)
Integermath_abs, math_min, math_max, math_clamp, math_sign, math_pow, math_factorial, math_isqrt, math_gcd, math_lcm, math_popcount, math_is_power_of_two, math_next_power_of_twoEXEC (pow, gcd, isqrt, popcount, clamp)
Conversionmath_int_to_float, math_float_to_intSOURCE
Float basicsmath_float_abs/min/max/sign/floor/ceil/round/trunc/pow/sqrt/ln/log2/log10/log/expEXEC (sqrt, floor)
Trigonometrymath_float_sin/cos/tan/asin/acos/atan/atan2, math_float_sinh/cosh/tanhSOURCE
Interpolationmath_lerp, math_inverse_lerp, math_remap, math_degrees, math_radians, math_approximately_equalSOURCE

Verified values: math_pow(2, 10) = 1024, math_gcd(48, 18) = 6, math_isqrt(144) = 12, math_popcount(255) = 8, math_float_sqrt(2.0) prints 1.4142135623730949, math_pi() prints 3.1415926535897931, math_float_floor(2.9) prints 2, math_clamp(15, 0, 10) = 10.

The float implementations are Taylor series / iterative approximations, not hardware library calls. Accuracy was not measured beyond the values above.

12. Time (mod time)

FunctionContractEvidence
time_now() -> IntUnix secondsSOURCE
time_millis() -> IntMilliseconds since boot (runtime tick base)SOURCE
time_ticks() -> Int, time_freq() -> IntHigh-resolution counter and frequencySOURCE
duration_ms(start, end) -> Int, duration_us(start, end) -> IntDifferences of tick valuesSOURCE
time_year/month/day/hour/minute/second(ts) -> IntUTC calendar fieldsEXEC
time_weekday(ts) -> IntDay of weekSOURCE
time_is_leap_year(y) -> Int, time_days_in_month(y, m) -> IntCalendar helpersSOURCE
time_format(ts) -> StrYYYY-MM-DD HH:MM:SS, ownedEXEC
time_strftime(ts, fmt) -> Strstrftime directives, ownedEXEC
time_strptime(s, fmt) -> (Int, Bool)Parsed timestamp and success flag; consumes both stringsEXEC
time_epoch(y, mo, d, h, mi, s) -> IntBuild a UTC timestampEXEC
time_add(ts, seconds) -> Int, time_diff(a, b) -> IntArithmeticSOURCE
Name helperstime_month_name/abbr, time_weekday_name/abbrSOURCE

Verified: time_epoch(2026, 11, 5, 12, 30, 45) = 1793881845, and time_format / time_strftime("%Y-%m-%d %H:%M:%S") both print 2026-11-05 12:30:45. time_strptime("2026-11-05", "%Y-%m-%d") returns 1793836800, true.

time_now is wall-clock Unix seconds; time_millis is not a Unix timestamp, so do not mix the two.

13. Logging (mod logging)

Levels use Python's numeric values: DEBUG 10, INFO 20, WARNING 30, ERROR 40, CRITICAL 50. The threshold is stored in the process environment as MINK_LOG_LEVEL; there are no mutable globals. Records go to stderr as LEVEL: message\n.

CallContractEvidence
log_set_level(level) -> Int0 success, -1 failureEXEC
log_set_level_name(name: Str) -> IntConsumes the name; 0 successEXEC
log_get_level() -> IntCurrent threshold (default 20)EXEC
log_enabled(level) -> BoolLevel passes thresholdEXEC
log_log(level, msg: Str) -> IntConsumes the messageSOURCE
log_debug/info/warning/error/critical(msg: Str) -> IntConvenience wrappersEXEC
log_level_name(level) -> StrOwned or literal nameSOURCE
log_level_from_name(name) -> Int0 for unknownSOURCE
mod logging;

fn main() -> Int {
    rt_print_int(log_set_level_name("DEBUG"));  // 0
    log_debug("dbg-line");                      // stderr
    rt_print_int(log_set_level(40));            // 0
    log_info("suppressed");
    log_error("err-line");                      // stderr
    if log_enabled(30) { rt_print_str("warn-enabled"); }
    return 0;
}

stdout: 0, 0, warn-disabled (at level 40). stderr: DEBUG: dbg-line, ERROR: err-line.

14. Process and environment

14.1 mod process

CallContractEvidence
process_run(cmd: Str) -> IntChild exit code; consumes cmdEXEC
process_run_input(cmd, input) -> IntWrites up to one pipe buffer of stdinSOURCE
process_stdout() -> Str, process_stderr() -> StrBSS-backed capture buffers: print, do not freeEXEC
process_stdout_len() -> Int, process_stderr_len() -> IntCaptured byte countsEXEC
process_id() -> IntCurrent PIDEXEC
process_is_valid_cmd(cmd) -> Bool, process_run_ok(cmd) -> Bool, process_has_output(cmd) -> BoolHelpers; consume their stringsSOURCE

Freeing a captured buffer is E-R04 invalid free (exit 104). This was reproduced:

mod process;

fn main() -> Int {
    let code = process_run("cmd /c echo hello-proc");  // 0
    let out = process_stdout();
    rt_print_int(rt_str_len(out));                     // 12
    rt_print_str(out);                                 // hello-proc
    // Do NOT call rt_str_free(out).
    return 0;
}

rt_stderr_write does not append a newline, so a diagnostic written with it runs into the next stderr output.

14.2 Environment (mod environment)

Sessions 178-181 recorded this module as unloadable: it declared raw extern fn rt_env_*; items, and the parser accepts only fn, let and const at top level (E-P01). Session 182 repaired it by wrapping the predeclared intrinsics in ordinary functions. mod environment; now loads and the tests in tests/environment_lib.rs pin the module contract.

CallContractEvidence
env_get(name: Str) -> StrOwned value; empty string when unset; consumes nameEXEC
env_set(name: Str, value: Str) -> Int0 success, -1 failure; consumes both stringsEXEC
env_has(name: Str) -> BoolExistence; consumes nameEXEC
env_remove(name: Str) -> Int0 success, -1 failure; consumes nameEXEC
env_cwd() -> StrOwned current directoryEXEC

The underlying rt_env_* and rt_fs_get_cwd intrinsics remain predeclared, so they also work without mod environment;. Prefer the module wrappers for the unprefixed API used by the rest of the standard library.

mod environment;

fn main() -> Int {
    env_set("MINK_EXAMPLE", "on");
    let value = env_get("MINK_EXAMPLE");
    rt_print_str(value);
    rt_str_free(value);
    env_remove("MINK_EXAMPLE");
    return 0;
}

Windows variable names are case-insensitive; empty values are supported.

15. Random (mod random)

Deterministic xorshift64* PRNG. It is not cryptographically secure.

CallContractEvidence
random_seed(seed: Int)Seed 0 is treated as 1SOURCE
random_next() -> IntFull 64-bit range, may be negativeSOURCE
random_int(min, max) -> IntInclusive rangeSOURCE
random_bool() -> Int, random_byte() -> Int, random_float_bits() -> IntScalar helpersSOURCE
random_choice(count) -> Int, random_shuffle_3(a, b, c) -> IntSelection helpersSOURCE
random_uniform_check(n) -> Int, random_bit_count(n) -> IntDiagnosticsSOURCE

Use crypto_random_* when unpredictability matters.

16. Regular expressions (mod re)

Backtracking engine, arena based. Search functions return the consumed subject back in a tuple, like strings.

CallContractEvidence
re_is_match(pat, text) -> (Bool, Str)Returns the subjectEXEC
re_search(pat, text) -> (Int, Str)First match start, -1 when absentEXEC
re_match_end(pat, text) -> (Int, Str)End offsetSOURCE
re_full_match(pat, text) -> (Bool, Str)Whole-subject matchSOURCE
re_find(pat, text) -> (Int, Int, Str)Start, end, subjectSOURCE
re_count(pat, text) -> (Int, Str)Match countSOURCE
re_find_all(pat, text) -> (Vec<Int>, Str)Vec of match startsEXEC
re_split(pat, text) -> (Vec<Str>, Str)Owned parts vectorEXEC
re_replace(pat, text, repl) -> StrOwned result, replaces allEXEC
re_replace_first(pat, text, repl) -> StrOwned resultSOURCE

Verified: re_is_match("^a+$", "aaa") true; re_search("b+", "abbbc") = 1; re_find_all("[0-9]+", "a1b22c333") has 3 entries; `re_replace("[0-9]+", "a1b22", "N") = aNbN; re_split(",", "a,b,c")` has 3 parts.

The engine takes a match-step budget; catastrophic patterns return no match instead of running forever. The exact budget is internal.

17. Networking, HTTP and TLS

These modules were inspected but not executed in this session; network behavior is covered by the M3/M4 records and tests/network_lib.rs, tests/http_lib.rs, tests/httpserver_lib.rs.

17.1 mod network

net_init, net_cleanup, net_last_error, net_socket(af, ty, proto), net_tcp_socket, net_udp_socket, net_connect, net_connect_timeout, net_bind, net_listen, net_accept, net_send, net_recv, net_recvfrom, net_sendto, net_sender_ip, net_sender_port, net_close, net_shutdown, net_resolve, net_free_resolve, net_hostname, net_htons, net_ntohs, net_is_valid_socket, net_is_ok, net_dial, net_listen_on, net_poll, net_poll_alloc, net_poll_set, net_poll_events, net_poll_revents, net_wait_readable, net_wait_writable, net_can_read, net_can_write, net_would_block, net_would_block_code, net_set_nonblocking, net_socket_error, net_timeout_code, net_timeout_ms, net_recv_timeout.

Constants are functions: AF_INET(), SOCK_STREAM(), SOCK_DGRAM(), IPPROTO_TCP(), IPPROTO_UDP(), SD_RECEIVE/SEND/BOTH, net_pollin(), net_pollout().

Sockets are Int handles; net_close returns 0/-1. net_recv returns an owned Str. net_init should run once before socket use and net_cleanup at shutdown.

17.2 mod http

Client only. http_last_error, http_request(method, path), http_get(path), http_add_header, http_finalize_request, http_header(response, name), http_content_length, http_status_code, http_status_text, http_body, http_recv_all, `http_send(request, host, port), http_client_get_with(host, port, path)`, http_client_post_with(host, port, path, body), http_client_get(url), http_client_post(url, body). Error sentinels: HTTP_ERR_SOCKET() -1, HTTP_ERR_CONNECT() -2, HTTP_ERR_SEND() -3, HTTP_ERR_TOO_LARGE() -4, HTTP_ERR_RECV() -5; MAX_BODY() is 4 MiB.

http_client_get returns an owned Str containing the whole response (headers and body), or an empty string on failure. Use http_last_error to distinguish. The module declares mod network; itself, so mod http; is enough.

17.3 mod httpserver

Server helpers: http_server_listen, http_server_listen_backlog, http_server_accept, http_server_accept_default, http_server_close, http_server_read_request, http_server_serve, http_server_request_line, http_server_method, http_server_path, http_server_version, http_server_header, http_server_content_length, http_server_body, http_server_parse, http_server_response, http_server_response_text, http_server_ok, http_server_not_found, http_server_send, http_server_respond, http_server_respond_ok, http_server_respond_not_found, http_server_reason. Limits: http_server_backlog() 16, http_server_timeout_ms() 5000, http_server_recv_chunk() 4088, http_server_max_request() 65536, http_server_max_headers() 64.

17.4 mod tls and HTTPS

tls_connect(host, port, ca_path, out_err: Ptr<Int>) -> Ptr<Int>, tls_status(h), tls_err(h), tls_cipher(h), tls_send(h, data), tls_recv(h, maxlen), tls_close(h), `https_client_get_with(host, port, path, ca_path), https_client_get(url, ca_path). Pass an empty ca_path` ("") to validate against the Windows trust store; a non-empty path pins trust to exactly one PEM certificate (a multi-certificate bundle is not read). Certificate validation includes hostname and chain checks. Handles are Ptr<Int> values released by tls_close. Executed against github.com with an empty ca_path on 2026-11-22: status 200, 468,710 bytes.

18. SQLite (mod sqlite)

An in-memory SQL engine. The "database" is an opaque Str blob threaded through every call; each mutating call returns the new blob. Results and errors are tuples.

CallContractEvidence
sql_new() -> StrEmpty database blobEXEC
sql_exec(db: Str, sql: Str) -> (Str, Str)(result text, new db); consumes both inputsEXEC
sql_rows(db, table) -> (Int, Str)(row count, new db)EXEC
sql_has_table(db, name) -> (Bool, Str)(exists, new db)EXEC
sql_tables(db) -> (Str, Str)(table list, new db)SOURCE
sql_in_transaction(db) -> (Bool, Str)Transaction state and dbSOURCE
sql_free(db)Releases the blobEXEC
sql_quote(s) -> Str, sql_field(line, index) -> StrHelpersSOURCE
mod sqlite;

fn main() -> Int {
    let mut db = sql_new();
    let created = sql_exec(db, "CREATE TABLE t (id INT, name STR)");
    rt_print_str(created.0);       // OK
    rt_str_free(created.0);
    db = created.1;
    let inserted = sql_exec(db, "INSERT INTO t VALUES (1, 'a')");
    rt_str_free(inserted.0);
    db = inserted.1;
    let q = sql_exec(db, "SELECT * FROM t");
    rt_print_str(q.0);             // 1\ta
    rt_str_free(q.0);
    db = q.1;
    let has = sql_has_table(db, "t");
    db = has.1;
    if has.0 { rt_print_str("has-table"); }
    sql_free(db);
    return 0;
}

Every tuple's second string is the new database handle and must be assigned back. Discarding it and freeing the old db is an invalid free (reproduced: E-R04 at stdlib/sqlite.mink:1476). The engine is a teaching/embedded implementation, not a SQLite binding; its SQL surface is limited to the statements exercised in examples/inventory_db.

19. Compression and archives

19.1 mod zlib

CallContractEvidence
zlib_compress(data: Str, level: Int) -> StrRaw zlib stream, owned; consumes dataEXEC
zlib_decompress(data: Str) -> (Str, Int)(output, status); status 0 successEXEC
deflate_raw(data, level) -> Str, inflate_raw(data) -> (Str, Int)Raw deflateSOURCE
gzip_compress(data, level) -> Str, gzip_decompress(data) -> (Str, Int)gzip containerSOURCE
zlib_crc32(data) -> (Int, Str), zlib_adler32(data) -> (Int, Str)Checksum and the returned input string; free the second elementEXEC (crc32)

Level is a compression effort from 0 to 9-ish; 6 was used successfully. zlib_decompress returns a tuple; passing a heap argument consumes it, so pass a copy when the original is still needed.

19.2 mod zip

Builder: zip_new(), zip_new_level(level), zip_add(arc, name, data), zip_add_stored, zip_add_dir, zip_finish(arc) -> Str, zip_free(arc), zip_count(arc).

zip_finish frees the archive arena itself. Calling zip_free(arc) after zip_finish is an invalid free (E-R04, exit 104), reproduced. Free only the returned archive string.

Reader: zip_read_count(data) -> (Int, Str), zip_list(data) -> Vec<Str>, zip_entry_name(data, i) -> (Str, Int), `zip_entry_size(data, i) -> (Int, Str), zip_entry_data(data, i) -> (Str, Int)`, zip_entry_data_by_name(data, name) -> (Str, Int), zip_entry_is_dir, zip_is_safe_path(name) -> Bool, zip_extract_all(data, dest) -> Int, zip_extract_entry(data, i, dest) -> Int.

Every reader call consumes the archive Str, so pass a copy when reusing it. A composite reader probe (count + list + entry data) exited 106 with a leak; individual list-only and entry-only probes exited 0. The leak source was not isolated. Treat the reader as needing explicit cleanup review before production use.

20. Threads and tasks

20.1 mod threads

thread_spawn(f, arg: Ptr<Int>) -> Int, thread_join(handle) -> Int, thread_self() -> Int, lock_new() -> Int, lock_acquire(lock), lock_release(lock), lock_free(lock). Thread arguments are raw Ptr<Int> blocks allocated with rt_alloc; ownership of that memory is the caller's. Not executed here.

20.2 mod tasks

task_pending() -> Int, task_run() -> Int, task_stop(), task_await(handle) -> Int. Deferred work queue; not executed here.

21. Assertions and mink test

mod assert provides assert_true, assert_false, assert_eq_int, assert_ne_int, assert_eq_str, assert_ne_str, assert_eq_float.

  • On success they are silent.
  • On failure they print a diagnostic to stderr and call rt_exit(1).
  • assert_eq_str / assert_ne_str consume both strings and free them on the success path.

mink test file.mink discovers top-level functions named test_*, runs each, and prints PASS: / FAIL: lines plus a summary. Exit code 1 if any test fails.

$ ./target/release/mink.exe test tmp/demo.mink
mink: test: found 2 test(s) in 'tmp/demo.mink'
  PASS: test_add
  PASS: test_str

mink: test result: 2 passed, 0 failed, 2 total

Observed limitation: assert_eq_int's failure message printed only assertion failed: expected (the two values were missing from the captured stderr). Do not rely on assertion messages for machine-readable failure details; assert on the process exit code and your own diagnostics.

22. Option and Result

stdlib/option.mink and stdlib/result.mink contain only generic enum declarations:

enum Option<T> { Some(T), None }
enum Result<T, E> { Ok(T), Err(E) }

There are no helper functions (unwrap, map, ?). Matching is written with match; a payload can be extracted through a variant pattern. Generic enum instantiation was not exercised in this session; treat these declarations as type vocabulary rather than a ready-made error-handling API.

23. Ownership cheat sheet

SituationRule
String literalImmortal; rt_str_free on it is a no-op
rt_str_concat, rt_str_format, rt_str_from_*, fs_read, rt_argvReturn owned strings; free exactly once
json_as_str, json_obj_get_key, json_num_str, json_to_strReturn heap copies, not arena views; free each, and they outlive rt_free(arena)
JSON arena from rt_allocOne owned block; release with rt_free(arena)
rt_print_str, rt_str_len, rt_str_byte, rt_str_eqBorrow; no free
User function with a Str parameterConsumes (moves) the argument
Read-only user callPass &s and use *s in the callee
Returned stringCaller owns it
rt_map_insert / rt_vec_push on a StrMoves the value into the collection
rt_map_free / rt_vec_free / rt_set_freeReleases the handle and its element strings
Leak at exitE-R06, exit code 106; earlier output is kept
Invalid freeE-R04, exit code 104
Collection use-after-free or stale handleE-R05, exit 105 (Sessions 195, 197)

There is no path-sensitive ownership: a value freed inside a conditional is treated as moved for the rest of the function. Structure helpers with one return and unconditional releases rather than freeing in branches.

24. What is not verified

  • crypto, hashing, random, tls, network, http, httpserver, threads, tasks, option, result: source inspection only in this session. Their signatures are listed; behavior is covered (or not) by existing tests, not by this audit.
  • zip reader leak source (composite probe exited 106).
  • fs_dir_* execution: source and Session 177 evidence, not re-executed here.
  • math accuracy beyond the listed values; trigonometry and logarithms were not executed.
  • encoding decode status semantics were executed for Base64 only; hex/URL decode paths are source-only.
  • json constructors and json_parse_in sizing were not executed.
  • Generic enums (Option<T>, Result<T, E>) were not instantiated.
  • Linux behavior: this reference is Windows x86_64 only.
  • No module was audited for exhaustive edge-case coverage. Absence of a function here does not mean it is unsupported; check the module source.

25. Where to look next

  • LANGUAGE_BASICS.md: runtime semantics, modules, ownership, filesystem conventions.
  • DEBUGGING_AND_TESTING.md: compiler diagnostics, test harnesses, bug-report template.
  • CORE_GRAMMAR.md: syntax authority.
  • stdlib/*.mink: implementation and comments.
  • examples/: complete programs.
  • benchmarks/m6/session180/: the audit's cold-start application and verifier.

26. Complete exported surface (Session 201 appendix)

Sections 4–22 describe the common functions of each module. This appendix lists every public top-level fn exported by stdlib/*.mink that those sections do not mention, with its source signature. Names beginning with _ are private implementation helpers and are intentionally excluded. Signatures are copied from the source; behavior is covered (or not) by the module's tests and by the notes in §24.

26.1 Byte and character predicates (mod byte, mod strings)

byte_is_alpha(b: Int) -> Bool
byte_is_alphanumeric(b: Int) -> Bool
byte_is_hex(b: Int) -> Bool
byte_is_lower(b: Int) -> Bool
byte_is_printable(b: Int) -> Bool
byte_is_upper(b: Int) -> Bool
byte_is_whitespace(b: Int) -> Bool
str_is_space(b: Int) -> Bool

26.2 Math (mod math)

math_float_acos(x: Float) -> Float
math_float_asin(x: Float) -> Float
math_float_atan(x: Float) -> Float
math_float_atan2(y: Float, x: Float) -> Float
math_float_ceil(f: Float) -> Float
math_float_cos(x: Float) -> Float
math_float_cosh(x: Float) -> Float
math_float_exp(x: Float) -> Float
math_float_ln(x: Float) -> Float
math_float_log(base: Float, x: Float) -> Float
math_float_log10(x: Float) -> Float
math_float_log2(x: Float) -> Float
math_float_max(a: Float, b: Float) -> Float
math_float_min(a: Float, b: Float) -> Float
math_float_pow(base: Float, exp: Float) -> Float
math_float_round(f: Float) -> Float
math_float_sign(f: Float) -> Float
math_float_tan(x: Float) -> Float
math_float_tanh(x: Float) -> Float
math_float_trunc(f: Float) -> Float

26.3 Time (mod time)

time_byte_str(b: Int) -> Str
time_day(ts: Int) -> Int
time_days_from_civil(y0: Int, m: Int, d: Int) -> Int
time_digits(hi: Int, lo: Int) -> Int
time_hour(ts: Int) -> Int
time_minute(ts: Int) -> Int
time_month(ts: Int) -> Int
time_month_abbr(m: Int) -> Str
time_pad4(n: Int) -> Str
time_second(ts: Int) -> Int
time_strftime_directive(ts: Int, c: Int) -> Str
time_weekday_abbr(w: Int) -> Str

26.4 Logging (mod logging)

log_critical(msg: Str) -> Int
log_warning(msg: Str) -> Int
log_level_debug() -> Int
log_level_info() -> Int
log_level_warning() -> Int
log_level_error() -> Int
log_level_critical() -> Int

26.5 HTTP and networking helpers

http_byte_eq_ci(a: Int, b: Int) -> Bool
http_is_upper(b: Int) -> Bool
http_parse_int_from_bytes(s: Str, start: Int, end: Int) -> Int
http_response_ok(response: Str) -> Bool
http_server_read_request_default(sock: Int) -> Str
http_server_request_copy(request: Str) -> Str
http_server_serve_default(sock: Int) -> (Int, Str)
http_server_text_type() -> Str
http_sub_bytes(s: Str, start: Int, end: Int) -> Str
http_to_lower(b: Int) -> Int
http_url_host(url: Str) -> Str
http_url_path(url: Str) -> Str
http_url_port(url: Str) -> Int
net_set_last_error(code: Int) -> Int

26.6 Runtime string intrinsics re-exported by mod strings

rt_str_from_char(b: Int) -> Str
rt_str_parse_int(s: Str) -> Int

26.7 Networking shutdown constants (mod network)

SD_RECEIVE() -> Int   // 0: stop receiving
SD_SEND() -> Int      // 1: stop sending
SD_BOTH() -> Int      // 2: stop both directions

tests/stdlib_docs.rs scans stdlib/*.mink and fails when a public function is missing from this reference, so the appendix stays complete as the surface grows. tests/stdlib_signatures.rs extracts every signature above and compares it with the corresponding top-level source fn, so a stale name, parameter type or return type fails the suite instead of merely being mentioned (Session 208).

This page is generated from the file in the repository, which is the source of truth. Found a mistake? Open an issue.