Skip to content

Agent API_p21

grisun0 edited this page Oct 30, 2026 · 10 revisions

API (page 21 of 21)

Previous: API_p20.md

tools/check_cohesion.py

tools/check_complexity.py

tools/check_kb_sync.py

tools/check_mutant_anchors.py

tools/check_spin_discipline.py

tools/check_surprising.py

tools/check_syscall_sanitize.py

tools/clip_bridge.py

  • valid_dst (function) tools/clip_bridge.py:41 def valid_dst(name, cfg) -- True when name is a safe guest path.
  • printable_line (function) tools/clip_bridge.py:52 def printable_line(line, cfg) -- True when every char survives the kernel readline.
  • build_plan (function) tools/clip_bridge.py:59 def build_plan(text, dst, cfg) -- Return (ok, lines, diagnostic) for carrying text to dst.
  • main (function) tools/clip_bridge.py:84 def main(argv) -- Entry point: clip_bridge.py .

tools/doom_pwad.py

Imported by: tests/test_doom_pwad.py

  • pad_tex (function) tools/doom_pwad.py:165 def pad_tex(raw) -- Return a texture or flat name padded to its 8-byte field.
  • parse_grid (function) tools/doom_pwad.py:172 def parse_grid(text) -- Parse grid text into rows, refusing empty or ragged input.
  • grid_extents (function) tools/doom_pwad.py:195 def grid_extents(rows) -- Return coordinate bounds of the lattice in map units.
  • is_wall (function) tools/doom_pwad.py:203 def is_wall(rows, row, col) -- Treat out-of-bounds cells as solid wall so maps stay closed.
  • flood_reachable (function) tools/doom_pwad.py:210 def flood_reachable(rows) -- Return the walkable set reachable from the player start tile.
  • validate_grid (function) tools/doom_pwad.py:240 def validate_grid(rows) -- Enforce single player, single exit, and full reachability.
  • cell_corners (function) tools/doom_pwad.py:269 def cell_corners(row, col) -- Return cell corners as (x0, x1, y_top, y_bottom) in map units.
  • cell_class (function) tools/doom_pwad.py:279 def cell_class(cell) -- Classify a walkable cell: doors stand alone, styles never merge.
  • label_regions (function) tools/doom_pwad.py:291 def label_regions(rows) -- Flood same-class walkable cells into region ids; walls stay -1.
  • region_sector (function) tools/doom_pwad.py:326 def region_sector(region, door_tag) -- Map a labelled region to its sector record fields and wall skin.
  • compile_geometry (function) tools/doom_pwad.py:371 def compile_geometry(rows, exit_pos, wall_side) -- Compile edges into vertexes, two-sided rooms and tagged doors.
  • vertex (function) tools/doom_pwad.py:386 def vertex(x, y) -- Deduplicate lattice points shared by adjacent edges.
  • compile_things (function) tools/doom_pwad.py:485 def compile_things(rows) -- Compile thing stamps into mapthing records in scan order.
  • seg_angle (function) tools/doom_pwad.py:506 def seg_angle(dx, dy) -- Return the stored short angle for a seg direction vector.
  • build_lumps (function) tools/doom_pwad.py:516 def build_lumps(rows) -- Compile a validated grid into the eleven E1M1 lump payloads.
  • build_pwad (function) tools/doom_pwad.py:597 def build_pwad(rows) -- Assemble lump payloads into a complete PWAD byte string.
  • read_pwad (function) tools/doom_pwad.py:616 def read_pwad(data) -- Split PWAD bytes into header fields and an ordered lump table.
  • check_pwad (function) tools/doom_pwad.py:639 def check_pwad(data) -- Validate lump order, record sizes and cross-lump references.
  • payload (function) tools/doom_pwad.py:650 def payload(name) -- Slice one lump payload out of the file image.
  • check_multiple (function) tools/doom_pwad.py:655 def check_multiple(name, fmt) -- Require the lump length to hold whole records only.
  • cmd_build (function) tools/doom_pwad.py:816 def cmd_build(grid_path, out_path) -- Build a PWAD from a grid file, refusing to write on any error.
  • cmd_check (function) tools/doom_pwad.py:826 def cmd_check(path) -- Validate a PWAD file and report its lump census on success.
  • main (function) tools/doom_pwad.py:834 def main(argv) -- Dispatch the build, check and info verbs with host-safe errors.

tools/gdb_repro.py

Depends on: kernel/time.c

tools/gen_avatar.py

tools/gen_desktop_pngs.py

tools/gen_icons.py

tools/gen_zip_fixtures.py

tools/kernel_feature_survey.py

tools/lisp_scoped.sh

tools/make_usb.sh

tools/minifs_dump.py

tools/minifs_fsck.py

tools/minifs_saves.py

tools/minios_cli.py

Depends on: kernel/time.c

tools/minios_gui.py

Depends on: kernel/time.c

tools/minios_hyper.py

Depends on: kernel/time.c

tools/mkcpyzip.py

  • build_zip (function) tools/mkcpyzip.py:22 def build_zip(lib_dir, out_zip, skip) -- Write out_zip with the Lib tree minus skip dirs; return file count.
  • main (function) tools/mkcpyzip.py:41 def main()

tools/mkfs.minifs.py

tools/mkpak1.py

tools/mkramdisk.py

tools/mkvocab.py

  • bytes_to_unicode (function) tools/mkvocab.py:18 def bytes_to_unicode() -- Reversible byte to unicode map used by the GPT-2 encoder.
  • main (function) tools/mkvocab.py:35 def main(encoder_path, vocab_path) -- Convert encoder.json to the VOCB binary vocabulary.

tools/mutate.sh

tools/probe_compute_vga.py

Depends on: kernel/time.c

tools/probe_minicraft.py

Depends on: kernel/time.c

tools/qga_client.py

Depends on: kernel/time.c

tools/repro_gui.py

Depends on: kernel/time.c

tools/sign_elf.py

  • sha512 (function) tools/sign_elf.py:61 def sha512(data) -- One-shot SHA-512.
  • encodepoint_raw (function) tools/sign_elf.py:66 def encodepoint_raw(x, y) -- Encode affine (x, y) to 32 bytes.
  • edwards_add (function) tools/sign_elf.py:71 def edwards_add(p, q) -- Add two extended points, all math mod field_p.
  • scalarmult (function) tools/sign_elf.py:88 def scalarmult(p, e) -- Multiply extended point p by scalar e.
  • base_point (function) tools/sign_elf.py:99 def base_point() -- Recompute the base point from y = 4/5.
  • publickey (function) tools/sign_elf.py:112 def publickey(seed) -- Derive the 32-byte public key from a 32-byte seed.
  • sign_digest (function) tools/sign_elf.py:121 def sign_digest(digest, seed) -- Sign a 64-byte canonical digest, returning 64 signature bytes.
  • pad_to (function) tools/sign_elf.py:135 def pad_to(blob, alignment) -- Pad blob with zero bytes up to alignment.
  • parse_ehdr (function) tools/sign_elf.py:143 def parse_ehdr(data) -- Unpack the ELF header, raising ValueError when truncated.
  • parse_phdrs (function) tools/sign_elf.py:158 def parse_phdrs(data, ehdr) -- Unpack the program headers, raising ValueError when out of range.
  • canonical_digest (function) tools/sign_elf.py:172 def canonical_digest(data, ehdr, phdrs) -- Build the kernel-agreed digest: entry plus PT_LOAD segments.
  • find_note_slots (function) tools/sign_elf.py:199 def find_note_slots(data, ehdr, phdrs) -- Locate patchable signature slots, returning file offsets of descs.
  • find_section_slot (function) tools/sign_elf.py:222 def find_section_slot(data, ehdr) -- Locate the .note.minios.sign section descriptor, else -1.
  • append_section (function) tools/sign_elf.py:257 def append_section(data, ehdr, desc) -- Append a .note.minios.sign section, returning the new image.
  • pub_for_key (function) tools/sign_elf.py:305 def pub_for_key(key_id) -- Resolve the trusted public key for checking without secrets.
  • key_material (function) tools/sign_elf.py:321 def key_material(key_id) -- Resolve the signing seed and public key for a key id.
  • process (function) tools/sign_elf.py:341 def process(path, key_id, check_only) -- Sign or verify one file, returning (action, detail).
  • verify_external (function) tools/sign_elf.py:395 def verify_external(sig, digest, pub) -- Verify with PyNaCl when present, else the local fallback.
  • fallback_verify (function) tools/sign_elf.py:408 def fallback_verify(sig, digest, pub) -- Pure-python Ed25519 verify for hosts without PyNaCl.
  • decode_point (function) tools/sign_elf.py:429 def decode_point(raw) -- Decode a point encoding to extended coordinates.
  • points_equal (function) tools/sign_elf.py:447 def points_equal(p, q) -- Compare extended points by cross-multiplied coordinates.
  • main (function) tools/sign_elf.py:454 def main(argv) -- Drive signing or checking over files and directory walks.

tools/update_sources.py

  • GitResult.ok (method) tools/update_sources.py:211 def ok(self)
  • Outcome.changed (method) tools/update_sources.py:228 def changed(self)
  • run_git (function) tools/update_sources.py:236 def run_git(git, cwd) -- Run git in a directory and capture its output.
  • git_out (function) tools/update_sources.py:253 def git_out(git, cwd) -- Run git and return stdout, or the empty string on failure.
  • head_sha (function) tools/update_sources.py:261 def head_sha(git, path) -- Return the checked-out revision, or the empty string.
  • short_sha (function) tools/update_sources.py:266 def short_sha(sha) -- Shorten a revision for display.
  • current_branch (function) tools/update_sources.py:271 def current_branch(git, path) -- Return the checked-out branch name, empty when detached.
  • is_dirty (function) tools/update_sources.py:276 def is_dirty(git, path) -- Report whether the worktree carries uncommitted changes.
  • is_shallow (function) tools/update_sources.py:281 def is_shallow(git, path) -- Report whether the checkout is a shallow clone.
  • resolve_path (function) tools/update_sources.py:286 def resolve_path(directory) -- Resolve a checkout directory against the repository root.
  • fetch_upstream (function) tools/update_sources.py:294 def fetch_upstream(git, path, branch, shallow_depth) -- Fetch the upstream branch, optionally with a bounded depth.
  • deepen_upstream (function) tools/update_sources.py:306 def deepen_upstream(git, path, branch, commits) -- Deepen a shallow checkout so a fast-forward becomes provable.
  • upstream_target (function) tools/update_sources.py:316 def upstream_target(git, path, branch) -- Return the revision the upstream branch points at.
  • ahead_behind (function) tools/update_sources.py:325 def ahead_behind(git, path, branch) -- Return the (ahead, behind) commit counts against the upstream branch.
  • fast_forward (function) tools/update_sources.py:339 def fast_forward(git, path, target) -- Merge an upstream revision, refusing anything but a fast-forward.
  • reconcile (function) tools/update_sources.py:344 def reconcile(git, path, target, strategy) -- Integrate an upstream revision into a branch that carries local commits.
  • abort_reconcile (function) tools/update_sources.py:351 def abort_reconcile(git, path, strategy) -- Undo a failed reconciliation so the checkout stays clean.
  • conflicted_files (function) tools/update_sources.py:359 def conflicted_files(git, path) -- List the files a failed reconciliation left unmerged.
  • update_submodules (function) tools/update_sources.py:365 def update_submodules(git, path, submodules) -- Initialize and refresh the submodules of a checkout.
  • handle_tracked (function) tools/update_sources.py:375 def handle_tracked(git, repo, path, dry_run, fetch_enabled, strategy) -- Bring a tracked checkout to the upstream tip, keeping local commits.
  • handle_pinned (function) tools/update_sources.py:446 def handle_pinned(git, repo, path, dry_run, fetch_enabled) -- Hold a checkout at the release tag it is pinned to.
  • handle_repo (function) tools/update_sources.py:493 def handle_repo(git, repo, directory, dry_run, fetch_enabled, strategy) -- Dispatch one checkout to the handler its mode asks for.
  • write_snapshot (function) tools/update_sources.py:513 def write_snapshot(path, outcomes) -- Record the pre-update revision of every checkout that moved.
  • rollback (function) tools/update_sources.py:535 def rollback(git, snapshot_path, directories) -- Restore the revisions recorded by the last update.
  • print_status (function) tools/update_sources.py:572 def print_status(git, selected, directories) -- Print the revision of every managed checkout.
  • print_outcome (function) tools/update_sources.py:594 def print_outcome(outcome) -- Print one checkout result.
  • select_repos (function) tools/update_sources.py:599 def select_repos(names) -- Resolve the requested repository names, failing on unknown ones.
  • parse_overrides (function) tools/update_sources.py:614 def parse_overrides(pairs) -- Split the --repo overrides into directory and URL maps.
  • main (function) tools/update_sources.py:634 def main(argv) -- Run the updater and report what happened.

tools/wl_scoped.sh

tools/wm_layout_sync.py

  • WmLayoutSyncConfig.__init__ (method) tools/wm_layout_sync.py:20 def __init__(self, root) -- Docstring: Bind all paths to one repository root.
  • WmLayoutSyncResult.__init__ (method) tools/wm_layout_sync.py:39 def __init__(self, modes, symbols, checks) -- Docstring: Store discovered modes, symbols and check count.
  • WmLayoutSync.__init__ (method) tools/wm_layout_sync.py:49 def __init__(self, config) -- Docstring: Hold config as the sole tunable source.
  • WmLayoutSync.discover (method) tools/wm_layout_sync.py:53 def discover(self) -- Docstring: Extract modes, symbols and test checks from sources.
  • WmLayoutSync.render (method) tools/wm_layout_sync.py:66 def render(self, result) -- Docstring: Build manifest markdown from discovery result.
  • WmLayoutSync.synchronize (method) tools/wm_layout_sync.py:101 def synchronize(self, write) -- Docstring: Discover, render and optionally write the manifest.
  • parse_args (function) tools/wm_layout_sync.py:151 def parse_args(argv) -- Docstring: Parse CLI flags for check or write modes.
  • main (function) tools/wm_layout_sync.py:159 def main(argv) -- Docstring: Run discovery and write or verify the manifest.

tools/wm_scoped.sh

vma.c

Depends on: headers/vma.h

  • vma_ctx_init (function) vma.c:37 void vma_ctx_init(vma_ctx_t *c, vma_node_t *pool)
  • vma_ctx_bind (function) vma.c:52 void vma_ctx_bind(vma_ctx_t *c)
  • vma_ctx_save (function) vma.c:64 void vma_ctx_save(vma_ctx_t *c)
  • vma_view_save (function) vma.c:74 void vma_view_save(vma_view_t *v)
  • vma_view_load (function) vma.c:86 void vma_view_load(const vma_view_t *v)
  • vma_tree_init (function) vma.c:98 void vma_tree_init(void)
  • vma_alloc_node (function) vma.c:113 static vma_node_t *vma_alloc_node(void)
  • vma_rotate_left (function) vma.c:124 static void vma_rotate_left(vma_node_t **root, vma_node_t *x)
  • vma_rotate_right (function) vma.c:136 static void vma_rotate_right(vma_node_t **root, vma_node_t *x)
  • vma_insert_fixup (function) vma.c:148 static void vma_insert_fixup(vma_node_t **root, vma_node_t *z)
  • vma_tree_insert (function) vma.c:187 vma_node_t *vma_tree_insert(vma_node_t **root, unsigned long base, unsigned long len)
  • vma_node_in_tree (function) vma.c:215 static int vma_node_in_tree(vma_node_t *root, vma_node_t *n) -- 1 when node n hangs in the tree rooted at root (live and free trees * share one pool and one cache, so a cached node...
  • vma_tree_find (function) vma.c:220 vma_node_t *vma_tree_find(vma_node_t *root, unsigned long base)
  • vma_tree_find_containing (function) vma.c:238 vma_node_t *vma_tree_find_containing(vma_node_t *root, unsigned long va) -- Docstring: Find the live node containing va (base <= va < base+len), or VMA_NIL.
  • vma_transplant (function) vma.c:252 static void vma_transplant(vma_node_t **root, vma_node_t *u, vma_node_t *v)
  • vma_tree_minimum (function) vma.c:259 static vma_node_t *vma_tree_minimum(vma_node_t *x)
  • vma_delete_fixup (function) vma.c:264 static void vma_delete_fixup(vma_node_t **root, vma_node_t *x)
  • vma_tree_delete (function) vma.c:319 int vma_tree_delete(vma_node_t **root, unsigned long base)

Start

Wiki

Agent Docs

Recipes

Clone this wiki locally