Metadata-Version: 2.5
Name: glovebox-hosts
Version: 0.12.0
Summary: The bundled Public Suffix List, file locks, owner-only file rule, owner-only sockets and directories, atomic file publish, process-group stops and text elision every glovebox component shares
Project-URL: Homepage, https://github.com/AlexanderMattTurner/agent-glovebox
Project-URL: Source, https://github.com/AlexanderMattTurner/agent-glovebox
Author: AlexanderMattTurner
License-Expression: Apache-2.0
Keywords: egress,glovebox,hostname,sandbox
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Requires-Python: >=3.9
Requires-Dist: glovebox-core>=0.1.4
Requires-Dist: tldextract==5.4.0
Description-Content-Type: text/markdown

# glovebox-hosts

The helpers every part of glovebox shares that read or write outside the process: the bundled Public Suffix List, file locks, owner-only files, sockets and directories, atomic file publish, process-group stops and text elision. The host rules and the JSON reader live in [`glovebox-core`](../glovebox-core/README.md).

`BUNDLED_SUFFIXES` is the Public Suffix List that `tldextract` bundles, read offline. Pass it to each `glovebox_core.host_rules` rule that judges a name against that list. `tldextract` is imported only when a name is judged, so a python without it raises `SuffixListUnread` there and nowhere else.

`python3 -m glovebox_hosts` runs the host rules for a caller outside Python: `name-check` judges one name.

`glovebox_hosts.flock` holds an exclusive file lock: `held`, for a block. It lives here because the host tools and the monitor package can both import it.

`glovebox_hosts.proc_handle` follows a process through a kernel handle and stops a process group as one unit. `run_group` runs a child under a timeout that stops the grandchildren too. The launcher, the monitor, the driver and the eval harnesses all import it from here.

`glovebox_hosts.reads` reads a host file or folder and raises `ReadFailed` when a read fails. Only a `present_*` reader answers None for a missing path. `glovebox_hosts.proc_identity` judges whether a pid still names the process a record holds, by its start time. `glovebox_hosts.probe_timeouts` holds the ceiling and kill grace one host probe gets. The launcher imports each from here, and the services it holds can import them without the launcher's code.

`glovebox_hosts.held_services` reads the record of the host services a session's launch holds. `down` names each service of that session that should run and does not. The launcher writes the record and stops what it names; the monitor reads it here for its health verdict.
