run-bounded 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- run_bounded-0.1.2/.github/ISSUE_TEMPLATE/bug_report.yml +45 -0
- run_bounded-0.1.2/.github/ISSUE_TEMPLATE/config.yml +5 -0
- run_bounded-0.1.2/.github/ISSUE_TEMPLATE/feature_request.yml +25 -0
- run_bounded-0.1.2/.github/pull_request_template.md +14 -0
- run_bounded-0.1.2/.github/workflows/claude.yml +26 -0
- run_bounded-0.1.2/.github/workflows/opencode-review.yml +66 -0
- run_bounded-0.1.2/.github/workflows/wheels.yml +90 -0
- run_bounded-0.1.2/.gitignore +1 -0
- run_bounded-0.1.2/AGENTS.md +52 -0
- run_bounded-0.1.2/CHANGELOG.md +46 -0
- run_bounded-0.1.2/CODE_OF_CONDUCT.md +43 -0
- run_bounded-0.1.2/CONTRIBUTING.md +52 -0
- run_bounded-0.1.2/Cargo.lock +16 -0
- run_bounded-0.1.2/Cargo.toml +16 -0
- run_bounded-0.1.2/LICENSE +21 -0
- run_bounded-0.1.2/PKG-INFO +153 -0
- run_bounded-0.1.2/README.ko.md +118 -0
- run_bounded-0.1.2/README.md +130 -0
- run_bounded-0.1.2/SECURITY.md +44 -0
- run_bounded-0.1.2/docs/bench/macos-27-arm64-20261117.json +3770 -0
- run_bounded-0.1.2/docs/bench/python-in-process-20261117.json +43 -0
- run_bounded-0.1.2/docs/demo/frame.png +0 -0
- run_bounded-0.1.2/docs/demo/run-bounded-dark.gif +0 -0
- run_bounded-0.1.2/docs/demo/run-bounded-dark.tape +22 -0
- run_bounded-0.1.2/docs/demo/run-bounded.gif +0 -0
- run_bounded-0.1.2/docs/demo/run-bounded.tape +22 -0
- run_bounded-0.1.2/docs/demo/social.html +23 -0
- run_bounded-0.1.2/docs/diagrams/bench.dark.svg +1 -0
- run_bounded-0.1.2/docs/diagrams/bench.ko.dark.svg +1 -0
- run_bounded-0.1.2/docs/diagrams/bench.ko.light.svg +1 -0
- run_bounded-0.1.2/docs/diagrams/bench.ko.mmd +6 -0
- run_bounded-0.1.2/docs/diagrams/bench.light.svg +1 -0
- run_bounded-0.1.2/docs/diagrams/bench.mmd +6 -0
- run_bounded-0.1.2/docs/diagrams/flow.dark.svg +1 -0
- run_bounded-0.1.2/docs/diagrams/flow.ko.dark.svg +1 -0
- run_bounded-0.1.2/docs/diagrams/flow.ko.light.svg +1 -0
- run_bounded-0.1.2/docs/diagrams/flow.ko.mmd +9 -0
- run_bounded-0.1.2/docs/diagrams/flow.light.svg +1 -0
- run_bounded-0.1.2/docs/diagrams/flow.mmd +9 -0
- run_bounded-0.1.2/docs/logo.svg +9 -0
- run_bounded-0.1.2/docs/social.json +34 -0
- run_bounded-0.1.2/docs/social.png +0 -0
- run_bounded-0.1.2/public.json +64 -0
- run_bounded-0.1.2/pyproject.toml +35 -0
- run_bounded-0.1.2/python/bounded_run/__init__.py +266 -0
- run_bounded-0.1.2/python/pyproject.toml +13 -0
- run_bounded-0.1.2/src/main.rs +455 -0
- run_bounded-0.1.2/tests/cli.rs +119 -0
- run_bounded-0.1.2/tests/test_python.py +35 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: Something did not work the way this repository says it should.
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: markdown
|
|
6
|
+
attributes:
|
|
7
|
+
value: |
|
|
8
|
+
Do not report a security problem here. Use the private advisories form instead.
|
|
9
|
+
- type: textarea
|
|
10
|
+
id: happened
|
|
11
|
+
attributes:
|
|
12
|
+
label: What happened
|
|
13
|
+
description: The command you ran and its output, copied as text.
|
|
14
|
+
placeholder: |
|
|
15
|
+
$ run-bounded
|
|
16
|
+
...
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: expected
|
|
21
|
+
attributes:
|
|
22
|
+
label: What you expected
|
|
23
|
+
validations:
|
|
24
|
+
required: true
|
|
25
|
+
- type: input
|
|
26
|
+
id: version
|
|
27
|
+
attributes:
|
|
28
|
+
label: Version
|
|
29
|
+
description: '`run-bounded --version`, or the commit you built.'
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
- type: input
|
|
33
|
+
id: platform
|
|
34
|
+
attributes:
|
|
35
|
+
label: Platform
|
|
36
|
+
description: 'OS and version, and the command you ran, including the flags.'
|
|
37
|
+
validations:
|
|
38
|
+
required: true
|
|
39
|
+
- type: textarea
|
|
40
|
+
id: extra
|
|
41
|
+
attributes:
|
|
42
|
+
label: Anything else
|
|
43
|
+
description: A small reproduction, or what you already tried.
|
|
44
|
+
validations:
|
|
45
|
+
required: false
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Feature request
|
|
2
|
+
description: A task this tool should do and does not.
|
|
3
|
+
labels: ["enhancement"]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: problem
|
|
7
|
+
attributes:
|
|
8
|
+
label: The problem
|
|
9
|
+
description: What you were doing when this got in the way. A command and its output help.
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: proposal
|
|
14
|
+
attributes:
|
|
15
|
+
label: What you suggest
|
|
16
|
+
description: The command, flag or output you expect. Small and concrete is easier to build.
|
|
17
|
+
validations:
|
|
18
|
+
required: true
|
|
19
|
+
- type: textarea
|
|
20
|
+
id: alternatives
|
|
21
|
+
attributes:
|
|
22
|
+
label: What you use instead
|
|
23
|
+
description: Another tool, a shell wrapper, or nothing. Optional.
|
|
24
|
+
validations:
|
|
25
|
+
required: false
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## What and why
|
|
2
|
+
|
|
3
|
+
<!-- What was wrong or missing, and how this change fixes it. Link the issue: Fixes #123 -->
|
|
4
|
+
|
|
5
|
+
## How to check it
|
|
6
|
+
|
|
7
|
+
<!-- The commands that show the change working, with their output. -->
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] `cargo build --locked` passes
|
|
12
|
+
- [ ] `cargo test --locked` passes
|
|
13
|
+
- [ ] `CHANGELOG.md` has a line under Unreleased if users will notice the change
|
|
14
|
+
- [ ] Anything I could not test is written above (another OS, a browser, a router)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: Claude on request
|
|
2
|
+
on:
|
|
3
|
+
issue_comment:
|
|
4
|
+
types: [created]
|
|
5
|
+
pull_request_review_comment:
|
|
6
|
+
types: [created]
|
|
7
|
+
jobs:
|
|
8
|
+
claude:
|
|
9
|
+
# Runs only when a maintainer mentions @claude (for example "@claude review").
|
|
10
|
+
if: contains(github.event.comment.body, '@claude')
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
timeout-minutes: 20
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
pull-requests: write
|
|
16
|
+
issues: write
|
|
17
|
+
id-token: write
|
|
18
|
+
actions: read
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v6
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 1
|
|
23
|
+
- uses: anthropics/claude-code-action@v1
|
|
24
|
+
with:
|
|
25
|
+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
|
26
|
+
claude_args: "--max-turns 30"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
name: opencode-review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened, ready_for_review]
|
|
6
|
+
|
|
7
|
+
concurrency:
|
|
8
|
+
group: opencode-review-${{ github.event.pull_request.number }}
|
|
9
|
+
cancel-in-progress: true
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
pull-requests: write
|
|
14
|
+
issues: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
review:
|
|
18
|
+
if: ${{ github.event.pull_request.draft == false }}
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
timeout-minutes: 20
|
|
21
|
+
steps:
|
|
22
|
+
# Three OpenCode Go keys share one credit pool each; spread pull requests over them.
|
|
23
|
+
- name: Pick an OpenCode Go key
|
|
24
|
+
id: go
|
|
25
|
+
env:
|
|
26
|
+
KEY_1: ${{ secrets.OPENCODE_GO_1 }}
|
|
27
|
+
KEY_2: ${{ secrets.OPENCODE_GO_2 }}
|
|
28
|
+
KEY_3: ${{ secrets.OPENCODE_GO_3 }}
|
|
29
|
+
run: |
|
|
30
|
+
case $((GITHUB_RUN_NUMBER % 3)) in
|
|
31
|
+
0) echo "value=$KEY_1" >> "$GITHUB_OUTPUT" ;;
|
|
32
|
+
1) echo "value=$KEY_2" >> "$GITHUB_OUTPUT" ;;
|
|
33
|
+
*) echo "value=$KEY_3" >> "$GITHUB_OUTPUT" ;;
|
|
34
|
+
esac
|
|
35
|
+
- uses: actions/checkout@v6
|
|
36
|
+
with:
|
|
37
|
+
persist-credentials: false
|
|
38
|
+
- name: Git identity for the review action
|
|
39
|
+
run: |
|
|
40
|
+
git config --global user.name "opencode-review"
|
|
41
|
+
git config --global user.email "opencode-review@users.noreply.github.com"
|
|
42
|
+
- name: Run OpenCode review
|
|
43
|
+
uses: anomalyco/opencode/github@latest
|
|
44
|
+
env:
|
|
45
|
+
OPENCODE_API_KEY: ${{ steps.go.outputs.value }}
|
|
46
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
47
|
+
with:
|
|
48
|
+
model: opencode-go/deepseek-v4.1-flash
|
|
49
|
+
use_github_token: true
|
|
50
|
+
prompt: |
|
|
51
|
+
Review this pull request for real defects only.
|
|
52
|
+
|
|
53
|
+
Report a finding only when the change produces a wrong result, an unhandled
|
|
54
|
+
error, a leaked process, handle or temporary file, a broken edge case (empty,
|
|
55
|
+
huge, unicode, concurrent, interrupted), data loss, a security problem, or a
|
|
56
|
+
behaviour that contradicts the README or AGENTS.md contract.
|
|
57
|
+
Do not report style, naming, formatting, comment wording, missing tests, or
|
|
58
|
+
speculative refactors. The repository AGENTS.md "Code Review Rules" section
|
|
59
|
+
lists what counts as a real defect for this tool.
|
|
60
|
+
|
|
61
|
+
For each finding give one line: severity (P0 blocker, P1 real defect),
|
|
62
|
+
file:line, what breaks, and the smallest correct fix.
|
|
63
|
+
If nothing qualifies, reply with one short line saying no real defects were found.
|
|
64
|
+
Keep the whole comment under 40 lines. Do not edit code, do not push commits,
|
|
65
|
+
do not run the test suite. Read the code only: do not execute the project's
|
|
66
|
+
scripts or binaries, make network calls, or run git commands that change state.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
name: wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
linux:
|
|
10
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
platform:
|
|
14
|
+
- runner: ubuntu-22.04
|
|
15
|
+
target: x86_64
|
|
16
|
+
- runner: ubuntu-24.04-arm
|
|
17
|
+
target: aarch64
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
20
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
21
|
+
with:
|
|
22
|
+
python-version: "3.12"
|
|
23
|
+
- name: Build wheels
|
|
24
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
25
|
+
with:
|
|
26
|
+
target: ${{ matrix.platform.target }}
|
|
27
|
+
manylinux: auto
|
|
28
|
+
args: --release --out dist
|
|
29
|
+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
30
|
+
with:
|
|
31
|
+
name: wheels-linux-${{ matrix.platform.target }}
|
|
32
|
+
path: dist
|
|
33
|
+
|
|
34
|
+
macos:
|
|
35
|
+
runs-on: ${{ matrix.runner }}
|
|
36
|
+
strategy:
|
|
37
|
+
fail-fast: false
|
|
38
|
+
matrix:
|
|
39
|
+
include:
|
|
40
|
+
- { runner: macos-15, target: aarch64-apple-darwin }
|
|
41
|
+
- { runner: macos-15-intel, target: x86_64-apple-darwin }
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
44
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
45
|
+
with:
|
|
46
|
+
python-version: "3.12"
|
|
47
|
+
- name: Build wheels
|
|
48
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
49
|
+
with:
|
|
50
|
+
target: ${{ matrix.target }}
|
|
51
|
+
args: --release --out dist
|
|
52
|
+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
53
|
+
with:
|
|
54
|
+
name: wheels-macos-${{ matrix.target }}
|
|
55
|
+
path: dist
|
|
56
|
+
|
|
57
|
+
windows:
|
|
58
|
+
runs-on: windows-2022
|
|
59
|
+
steps:
|
|
60
|
+
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
61
|
+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
62
|
+
with:
|
|
63
|
+
python-version: "3.12"
|
|
64
|
+
- name: Build wheels
|
|
65
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
66
|
+
with:
|
|
67
|
+
target: x64
|
|
68
|
+
args: --release --out dist
|
|
69
|
+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
70
|
+
with:
|
|
71
|
+
name: wheels-windows-x64
|
|
72
|
+
path: dist
|
|
73
|
+
|
|
74
|
+
release:
|
|
75
|
+
name: Release
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
# Publish whatever built: a hosted runner shortage (macOS arm64) must not block the other wheels;
|
|
78
|
+
# a missing wheel is built locally and uploaded with --skip-existing semantics.
|
|
79
|
+
if: ${{ always() && startsWith(github.ref, 'refs/tags/v') }}
|
|
80
|
+
needs: [linux, macos, windows]
|
|
81
|
+
environment: pypi # PyPI trusted publisher is bound to this environment
|
|
82
|
+
permissions:
|
|
83
|
+
id-token: write
|
|
84
|
+
steps:
|
|
85
|
+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
|
86
|
+
- name: Publish to PyPI
|
|
87
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
88
|
+
with:
|
|
89
|
+
command: upload
|
|
90
|
+
args: --skip-existing wheels-*/*.whl
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/target/
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Agent guide
|
|
2
|
+
|
|
3
|
+
## Layout
|
|
4
|
+
|
|
5
|
+
- `src/main.rs`: Rust CLI and process lifecycle.
|
|
6
|
+
- `python/bounded_run/`: importable Python library.
|
|
7
|
+
- `tests/cli.rs` and `tests/test_python.py`: regressions that need a real process (`cargo test --locked`, `python3 tests/test_python.py`).
|
|
8
|
+
- `docs/demo/`: VHS tapes, recorded demos, and social-preview source image.
|
|
9
|
+
- `pyproject.toml` and `.github/workflows/`: PyPI package workflow and the automatic pull request review.
|
|
10
|
+
- `docs/bench/`: saved benchmark results.
|
|
11
|
+
- `docs/diagrams/`: Mermaid sources and light/dark SVG output.
|
|
12
|
+
- `public.json`: exported public files.
|
|
13
|
+
|
|
14
|
+
## Build and use
|
|
15
|
+
|
|
16
|
+
- Run `cargo build --locked` from this directory.
|
|
17
|
+
- Run `cargo build --release --locked` for timing measurements.
|
|
18
|
+
- Install from a checkout with `cargo install --locked --path .`; the wheel built by `python3 -m pip wheel --no-deps -w dist .` includes the same Rust command and the `bounded_run` Python module. The package is not published on PyPI or crates.io.
|
|
19
|
+
- Install from a source checkout with `cargo install --path .`.
|
|
20
|
+
- Build a local wheel with `python3 -m pip wheel --no-deps --wheel-dir target/wheels .`.
|
|
21
|
+
- Run the demo with `vhs-safe docs/demo/run-bounded.tape` from the project root.
|
|
22
|
+
|
|
23
|
+
## Implementation rules
|
|
24
|
+
|
|
25
|
+
- Keep child stdout and stderr independent and drain both while enforcing caps.
|
|
26
|
+
- Accept absolute executable paths and bare names resolved through PATH; reject relative paths containing `/` or `\`. Pass only the documented minimal environment.
|
|
27
|
+
- Unix cleanup must signal the process group, not only the direct child, and a signal that stops the runner must do the same.
|
|
28
|
+
- Windows cleanup must use a Job Object with `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE` in both editions.
|
|
29
|
+
- Keep the JSON result on stderr so child stdout remains usable as command output.
|
|
30
|
+
- Preserve exit codes for child failures; timeout and idle use 124; a signal death returns 128 + the signal number.
|
|
31
|
+
- A deadline kill must report its timeout even when output forwarding is blocked on a consumer that stopped reading, in both editions.
|
|
32
|
+
- A limit value outside the representable duration range is a CLI error (125), never a panic.
|
|
33
|
+
- Never put real home paths, hostnames, credentials, or account data in demo inputs.
|
|
34
|
+
- Keep README.md and README.ko.md aligned in commands, measurements, and platform claims.
|
|
35
|
+
- Do not publish the CLI to crates.io or Python to PyPI without owner review.
|
|
36
|
+
- Keep dependency versions locked in Cargo.lock and build with `--locked`.
|
|
37
|
+
- Keep the CLI and Python library result classes and cap semantics aligned.
|
|
38
|
+
- Regenerate charts from the saved benchmark JSON; do not type benchmark values into graph sources.
|
|
39
|
+
|
|
40
|
+
## Code Review Rules
|
|
41
|
+
|
|
42
|
+
A change is a real defect when it:
|
|
43
|
+
|
|
44
|
+
- lets a child process or its process group survive a timeout, an idle timeout or a parent exit on any platform.
|
|
45
|
+
- drops or interleaves child stdout and stderr, or loses bytes when a consumer stops reading.
|
|
46
|
+
- breaks an output cap, an idle deadline, or the absolute-path rule for the executable.
|
|
47
|
+
- changes a documented exit code: 124 for timeout and idle, 128 + signal number for a signal death.
|
|
48
|
+
- writes the JSON result to stdout instead of stderr, or emits a result that does not parse.
|
|
49
|
+
- leaves the CLI and the Python library disagreeing on result fields or cap semantics.
|
|
50
|
+
- inherits the full parent environment again, or resolves a relative path or a PATH entry the tool must reject.
|
|
51
|
+
|
|
52
|
+
Not defects: wording, formatting, type annotations, comment style, requested extra tests, or a renamed helper.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses `MAJOR.MINOR.PATCH`.
|
|
5
|
+
|
|
6
|
+
## [Unreleased]
|
|
7
|
+
|
|
8
|
+
## [0.1.2] - 2026-11-18
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- The minimum Rust version is 1.82, declared in `Cargo.toml`, so `cargo build --locked` works on the
|
|
13
|
+
stated minimum. The previous 1.75 claim could not compile the `unsafe extern` block or read the v4
|
|
14
|
+
lockfile.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- A consumer that stops reading output can no longer block a timeout result: the deadline kill
|
|
19
|
+
reports the timeout instead of waiting for a blocked write.
|
|
20
|
+
- A child terminated by a signal returns 128 plus that signal, instead of always 129.
|
|
21
|
+
- The Python edition reports the timeout after a bounded drain, instead of waiting for a descendant
|
|
22
|
+
that left the process group and kept stdout or stderr open.
|
|
23
|
+
- SIGINT, SIGTERM and SIGHUP stop the child's process group before the runner exits, in both
|
|
24
|
+
editions, so a parent exit no longer leaves the child tree behind.
|
|
25
|
+
- The Windows Job Object sets `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE` in both editions, so a runner
|
|
26
|
+
that dies without cleanup still ends the child tree.
|
|
27
|
+
- `--timeout` and `--idle` reject values outside the representable duration range with exit 125
|
|
28
|
+
instead of panicking; the deadline arithmetic uses `checked_add`.
|
|
29
|
+
|
|
30
|
+
## [0.1.1] - 2026-11-17
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- `run-bounded` Rust CLI: `--timeout`, `--idle`, `--max-output` and one JSON result line on stderr.
|
|
35
|
+
- `bounded_run` Python library with the same limits and result fields.
|
|
36
|
+
- Process-group termination on Unix and a Job Object on Windows, so grandchildren end with the
|
|
37
|
+
child.
|
|
38
|
+
- Wheels that install the binary and the importable module together.
|
|
39
|
+
- Recorded demo and saved `hyperfine` measurements on macOS arm64, Ubuntu 24.04 arm64 and Windows
|
|
40
|
+
x64.
|
|
41
|
+
|
|
42
|
+
## [0.1.0] - 2026-11-17
|
|
43
|
+
|
|
44
|
+
### Added
|
|
45
|
+
|
|
46
|
+
- First public source release of the bounded command runner.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Code of conduct
|
|
2
|
+
|
|
3
|
+
## Our pledge
|
|
4
|
+
|
|
5
|
+
We want run-bounded to be a welcoming project for everyone, whatever their age, body, disability,
|
|
6
|
+
ethnicity, gender identity and expression, level of experience, education, nationality, personal
|
|
7
|
+
appearance, race, religion, or sexual identity and orientation.
|
|
8
|
+
|
|
9
|
+
## Our standards
|
|
10
|
+
|
|
11
|
+
Things that make the project better:
|
|
12
|
+
|
|
13
|
+
- Being kind, patient and respectful, including in disagreement.
|
|
14
|
+
- Giving and taking constructive criticism gracefully. Criticize code and ideas, not people.
|
|
15
|
+
- Assuming good intent, and asking when something is unclear.
|
|
16
|
+
- Owning mistakes and learning from them.
|
|
17
|
+
|
|
18
|
+
Things that are not acceptable:
|
|
19
|
+
|
|
20
|
+
- Harassment, insults, or personal or political attacks.
|
|
21
|
+
- Sexualized language or imagery, or unwelcome attention.
|
|
22
|
+
- Publishing someone's private information without their permission.
|
|
23
|
+
- Anything else that would reasonably be considered inappropriate in a professional setting.
|
|
24
|
+
|
|
25
|
+
## Scope
|
|
26
|
+
|
|
27
|
+
This applies in every project space (issues, pull requests, discussions, reviews) and when
|
|
28
|
+
someone represents the project elsewhere.
|
|
29
|
+
|
|
30
|
+
## Enforcement
|
|
31
|
+
|
|
32
|
+
Reports go to the maintainer, [@elfenomenokim](https://github.com/elfenomenokim), through GitHub.
|
|
33
|
+
For something you would rather not post in public, use
|
|
34
|
+
[Report a vulnerability](https://github.com/elfenomenokim/run-bounded/security/advisories/new) and say
|
|
35
|
+
it is a conduct report. Every report is reviewed and the reporter's privacy is respected.
|
|
36
|
+
|
|
37
|
+
The maintainer may remove, edit or reject comments, commits, code, issues and other contributions
|
|
38
|
+
that break this code, and may ban, temporarily or permanently, anyone whose behavior is harmful.
|
|
39
|
+
|
|
40
|
+
## Attribution
|
|
41
|
+
|
|
42
|
+
This code of conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
|
|
43
|
+
version 2.1.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Contributing to run-bounded
|
|
2
|
+
|
|
3
|
+
Fixes and reports are welcome. You do not need to ask before opening a pull request for a bug fix.
|
|
4
|
+
|
|
5
|
+
## Before you start
|
|
6
|
+
|
|
7
|
+
- **A bug:** open an [issue](https://github.com/elfenomenokim/run-bounded/issues/new/choose) with
|
|
8
|
+
the command and its output, the version (`run-bounded --version`) and your platform. A child
|
|
9
|
+
command that reproduces it helps most.
|
|
10
|
+
- **A bigger change** (a new flag, a change to the exit codes or the JSON result): open an issue
|
|
11
|
+
first so the shape can be agreed before you write it.
|
|
12
|
+
- **A security problem:** do not open a public issue. See [SECURITY.md](SECURITY.md).
|
|
13
|
+
|
|
14
|
+
## Set up
|
|
15
|
+
|
|
16
|
+
Rust 1.82 or newer. The test suite needs nothing else.
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
git clone https://github.com/elfenomenokim/run-bounded
|
|
20
|
+
cd run-bounded
|
|
21
|
+
cargo build --locked
|
|
22
|
+
cargo test --locked
|
|
23
|
+
python3 tests/test_python.py
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The Python library lives in `python/bounded_run/` and is built by maturin; build it with
|
|
27
|
+
`python3 -m pip wheel --no-deps --wheel-dir target/wheels .` after the Rust build passes.
|
|
28
|
+
|
|
29
|
+
## What a good patch has
|
|
30
|
+
|
|
31
|
+
- **A test that fails without the change** in `tests/cli.rs` or `tests/test_python.py`, run once against the old code.
|
|
32
|
+
- **The flags, JSON fields and exit codes aligned** between the CLI and the Python library. A change
|
|
33
|
+
to one that is not made in the other is a defect, not a follow-up.
|
|
34
|
+
- **A line under Unreleased** in [CHANGELOG.md](CHANGELOG.md) when a user will notice.
|
|
35
|
+
- **The platforms you did not test** written in the pull request. Say macOS arm64, Linux arm64,
|
|
36
|
+
Windows x64 or nothing.
|
|
37
|
+
|
|
38
|
+
## Review
|
|
39
|
+
|
|
40
|
+
Every pull request runs an automatic DeepSeek review. Ask for another pass with `@codex review` or
|
|
41
|
+
`@claude review` in a comment. If a finding looks wrong, say why in the pull request; the review is
|
|
42
|
+
advice, not a gate.
|
|
43
|
+
|
|
44
|
+
## Style
|
|
45
|
+
|
|
46
|
+
Match the code around you; run `cargo fmt` and `cargo clippy --all-targets -- -D warnings` before
|
|
47
|
+
pushing. Keep one change per pull request. Demo records use fixed text only: never a real home
|
|
48
|
+
path, hostname or account.
|
|
49
|
+
|
|
50
|
+
## Licence
|
|
51
|
+
|
|
52
|
+
Contributions are licensed under the MIT licence in [LICENSE](LICENSE).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 4
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "bounded-run"
|
|
7
|
+
version = "0.1.2"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"libc",
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
[[package]]
|
|
13
|
+
name = "libc"
|
|
14
|
+
version = "0.2.191"
|
|
15
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
16
|
+
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "bounded-run"
|
|
3
|
+
version = "0.1.2"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
rust-version = "1.82"
|
|
6
|
+
description = "A command-line tool for running commands with time, output, and process-tree limits."
|
|
7
|
+
license = "MIT"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
|
|
10
|
+
[[bin]]
|
|
11
|
+
name = "run-bounded"
|
|
12
|
+
path = "src/main.rs"
|
|
13
|
+
|
|
14
|
+
[target.'cfg(unix)'.dependencies]
|
|
15
|
+
libc = "0.2"
|
|
16
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 El Fenomeno
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|