Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
55d6d11
Contain Every Agent Command in a Task- and Memory-Capped Scope
ptr727 Sep 26, 2026
cbf664e
Keep Hook Commands Out of the Containment Scope
ptr727 Sep 26, 2026
450d93a
Register the Prefix Only Where python3 Can Run It
ptr727 Sep 26, 2026
fa57dec
Execute the Deployed Prefix Before Treating a Host as Contained
ptr727 Sep 26, 2026
903c4ce
Scope Only Bash Tool Calls, and Report a Foreign-Path Prefix
ptr727 Sep 26, 2026
c3d7ab8
Refuse Unenforceable Ceilings, and Report an Uncontained Host
ptr727 Sep 26, 2026
f266de1
Refuse an Octal Task Count, and Check Delegation Per Command
ptr727 Sep 26, 2026
d04a748
Accept One Canonical Override Form, and Test the Delegation Check
ptr727 Sep 26, 2026
30644fb
Cap Swap, Keep Nested Sessions Inside Their Parent's Scope
ptr727 Sep 26, 2026
f3a8ca0
Give a Nested Session Its Own Scopes Again
ptr727 Sep 26, 2026
f2cc3df
Stop Recommending a Cleanup That Ends Every Session's Tool Calls
ptr727 Sep 26, 2026
21e1957
Sweep Under the Prefix Even With No Manager, and Own the Prefix by Name
ptr727 Sep 26, 2026
94c86d4
Test the Sweep's Reap Gate, and Name a Lost Manager
ptr727 Sep 26, 2026
55d13c1
Report an Unknown Rather Than a Lost Manager at Session End
ptr727 Sep 26, 2026
a7db99c
Drop the Sweep's Promise of a Report That May Not Follow
ptr727 Sep 26, 2026
5bcfb18
State Which Servers Requirement 9 Leaves Unbounded
ptr727 Sep 26, 2026
f9b3605
Limit Requirement 9's Server Rule to Tool Calls
ptr727 Sep 26, 2026
af797da
Drop Requirement 9's Claims About Which Servers End With the Session
ptr727 Sep 26, 2026
138c498
Resolve a Shim's Real Command With type -P
ptr727 Sep 26, 2026
57bedfb
Require the Shim's Captured Path Be Absolute and Outside the Shim
ptr727 Sep 26, 2026
4e40cd4
Test the Shim's Captured Path by File Identity
ptr727 Sep 26, 2026
7eca7ac
Name a Missing systemd-run Apart From an Unreachable Manager
ptr727 Sep 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .agents/skills/shell-codestyle/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ name: shell-codestyle
description: >-
Governs Bash/shell script style for ptr727/ProjectTemplate fleet repos: when a bootstrap or
host-tool script may be shell instead of Python, the mandatory set -Eeuo pipefail header, the
pipefail-versus-early-reader pitfall, self-locating scripts, the shellcheck-plus-shfmt
clean-compile, and the why-not-what comment rule. Use this whenever writing, reviewing, or
editing a shell script (a `.sh` file, or an extensionless bash/sh shebang script), whenever
deciding whether a new script should be Bash or Python, or whenever a pipeline built from
`curl`/`grep`/`jq`-style commands looks like it silently swallowed a failure. Triggers even when
the task looks like a one-line tweak to an existing script, because a missing `-e`/`pipefail`,
or a reader piped straight from a producer that closes the pipe early, are each invisible until
the exact failure mode they guard against actually happens. Fleet-wide: a shell script can
appear in any repo (a bootstrap that installs the interpreter, a host tool that must run before
a toolchain exists), not only a repo whose primary language is shell.
pipefail-versus-early-reader pitfall, self-recursive command shims, self-locating scripts, the
shellcheck-plus-shfmt clean-compile, and the why-not-what comment rule. Use this whenever
writing, reviewing, or editing a shell script (a `.sh` file, or an extensionless bash/sh shebang
script), whenever deciding whether a new script should be Bash or Python, or whenever a pipeline
built from `curl`/`grep`/`jq`-style commands looks like it silently swallowed a failure, or
whenever a script or probe writes a wrapper or shim named after a command it also calls.
Triggers even when the task looks like a one-line tweak to an existing script, because a missing
`-e`/`pipefail`, or a reader piped straight from a producer that closes the pipe early, are each
invisible until the exact failure mode they guard against actually happens. Fleet-wide: a shell
script can appear in any repo (a bootstrap that installs the interpreter, a host tool that must
run before a toolchain exists), not only a repo whose primary language is shell.
---

# Shell Codestyle
Expand Down Expand Up @@ -50,6 +51,15 @@ depend on Python either. Everything else is Python, with a test under its own sc
- **A reader that stops early needs its producer read first.** Under `pipefail`, a producer
writing to a closed pipe exits non-zero, so `curl ... | grep -q` reports a successful fetch as a
failure whenever the match is found early enough. Capture the output, then search it.
- **A shim named for a command resolves that command by absolute path.** A wrapper named `jq`,
placed ahead of the real one on `PATH`, that calls `command jq` or a bare `jq` calls itself,
since `command` skips functions and aliases but not the `PATH` search. Every call starts another
copy of the wrapper, so the chain grows until something stops it. Capture the real path with
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
`type -P` before changing `PATH`, stop unless it is an absolute path that is not the shim itself,
tested as files with `[ "$real" -ef "$shim" ]` rather than as spellings, and call that path from
inside the shim. An inherited `PATH` can already hold the shim, under a symlinked spelling too,
and a `.` entry yields a relative path. `command -v` is not a substitute, since it prints
the bare name for a shell function of that name.
- **Self-locating, never dependent on the caller's directory.** A script resolves its own
directory from `BASH_SOURCE` and references its payloads through it, since the working
directory at invocation is not a property of the script.
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
40c3f8736d2d6180
d46e3118a4acca8c
30 changes: 20 additions & 10 deletions .claude-plugin/fleet-skills/skills/shell-codestyle/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ name: shell-codestyle
description: >-
Governs Bash/shell script style for ptr727/ProjectTemplate fleet repos: when a bootstrap or
host-tool script may be shell instead of Python, the mandatory set -Eeuo pipefail header, the
pipefail-versus-early-reader pitfall, self-locating scripts, the shellcheck-plus-shfmt
clean-compile, and the why-not-what comment rule. Use this whenever writing, reviewing, or
editing a shell script (a `.sh` file, or an extensionless bash/sh shebang script), whenever
deciding whether a new script should be Bash or Python, or whenever a pipeline built from
`curl`/`grep`/`jq`-style commands looks like it silently swallowed a failure. Triggers even when
the task looks like a one-line tweak to an existing script, because a missing `-e`/`pipefail`,
or a reader piped straight from a producer that closes the pipe early, are each invisible until
the exact failure mode they guard against actually happens. Fleet-wide: a shell script can
appear in any repo (a bootstrap that installs the interpreter, a host tool that must run before
a toolchain exists), not only a repo whose primary language is shell.
pipefail-versus-early-reader pitfall, self-recursive command shims, self-locating scripts, the
shellcheck-plus-shfmt clean-compile, and the why-not-what comment rule. Use this whenever
writing, reviewing, or editing a shell script (a `.sh` file, or an extensionless bash/sh shebang
script), whenever deciding whether a new script should be Bash or Python, or whenever a pipeline
built from `curl`/`grep`/`jq`-style commands looks like it silently swallowed a failure, or
whenever a script or probe writes a wrapper or shim named after a command it also calls.
Triggers even when the task looks like a one-line tweak to an existing script, because a missing
`-e`/`pipefail`, or a reader piped straight from a producer that closes the pipe early, are each
invisible until the exact failure mode they guard against actually happens. Fleet-wide: a shell
script can appear in any repo (a bootstrap that installs the interpreter, a host tool that must
run before a toolchain exists), not only a repo whose primary language is shell.
---

# Shell Codestyle
Expand Down Expand Up @@ -50,6 +51,15 @@ depend on Python either. Everything else is Python, with a test under its own sc
- **A reader that stops early needs its producer read first.** Under `pipefail`, a producer
writing to a closed pipe exits non-zero, so `curl ... | grep -q` reports a successful fetch as a
failure whenever the match is found early enough. Capture the output, then search it.
- **A shim named for a command resolves that command by absolute path.** A wrapper named `jq`,
placed ahead of the real one on `PATH`, that calls `command jq` or a bare `jq` calls itself,
since `command` skips functions and aliases but not the `PATH` search. Every call starts another
copy of the wrapper, so the chain grows until something stops it. Capture the real path with
`type -P` before changing `PATH`, stop unless it is an absolute path that is not the shim itself,
tested as files with `[ "$real" -ef "$shim" ]` rather than as spellings, and call that path from
inside the shim. An inherited `PATH` can already hold the shim, under a symlinked spelling too,
and a `.` entry yields a relative path. `command -v` is not a substitute, since it prints
the bare name for a shell function of that name.
- **Self-locating, never dependent on the caller's directory.** A script resolves its own
directory from `BASH_SOURCE` and references its payloads through it, since the working
directory at invocation is not a property of the script.
Expand Down
30 changes: 20 additions & 10 deletions .github/skills/shell-codestyle/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ name: shell-codestyle
description: >-
Governs Bash/shell script style for ptr727/ProjectTemplate fleet repos: when a bootstrap or
host-tool script may be shell instead of Python, the mandatory set -Eeuo pipefail header, the
pipefail-versus-early-reader pitfall, self-locating scripts, the shellcheck-plus-shfmt
clean-compile, and the why-not-what comment rule. Use this whenever writing, reviewing, or
editing a shell script (a `.sh` file, or an extensionless bash/sh shebang script), whenever
deciding whether a new script should be Bash or Python, or whenever a pipeline built from
`curl`/`grep`/`jq`-style commands looks like it silently swallowed a failure. Triggers even when
the task looks like a one-line tweak to an existing script, because a missing `-e`/`pipefail`,
or a reader piped straight from a producer that closes the pipe early, are each invisible until
the exact failure mode they guard against actually happens. Fleet-wide: a shell script can
appear in any repo (a bootstrap that installs the interpreter, a host tool that must run before
a toolchain exists), not only a repo whose primary language is shell.
pipefail-versus-early-reader pitfall, self-recursive command shims, self-locating scripts, the
shellcheck-plus-shfmt clean-compile, and the why-not-what comment rule. Use this whenever
writing, reviewing, or editing a shell script (a `.sh` file, or an extensionless bash/sh shebang
script), whenever deciding whether a new script should be Bash or Python, or whenever a pipeline
built from `curl`/`grep`/`jq`-style commands looks like it silently swallowed a failure, or
whenever a script or probe writes a wrapper or shim named after a command it also calls.
Triggers even when the task looks like a one-line tweak to an existing script, because a missing
`-e`/`pipefail`, or a reader piped straight from a producer that closes the pipe early, are each
invisible until the exact failure mode they guard against actually happens. Fleet-wide: a shell
script can appear in any repo (a bootstrap that installs the interpreter, a host tool that must
run before a toolchain exists), not only a repo whose primary language is shell.
---

# Shell Codestyle
Expand Down Expand Up @@ -50,6 +51,15 @@ depend on Python either. Everything else is Python, with a test under its own sc
- **A reader that stops early needs its producer read first.** Under `pipefail`, a producer
writing to a closed pipe exits non-zero, so `curl ... | grep -q` reports a successful fetch as a
failure whenever the match is found early enough. Capture the output, then search it.
- **A shim named for a command resolves that command by absolute path.** A wrapper named `jq`,
placed ahead of the real one on `PATH`, that calls `command jq` or a bare `jq` calls itself,
since `command` skips functions and aliases but not the `PATH` search. Every call starts another
copy of the wrapper, so the chain grows until something stops it. Capture the real path with
`type -P` before changing `PATH`, stop unless it is an absolute path that is not the shim itself,
tested as files with `[ "$real" -ef "$shim" ]` rather than as spellings, and call that path from
inside the shim. An inherited `PATH` can already hold the shim, under a symlinked spelling too,
and a `.` entry yields a relative path. `command -v` is not a substitute, since it prints
the bare name for a shell function of that name.
- **Self-locating, never dependent on the caller's directory.** A script resolves its own
directory from `BASH_SOURCE` and references its payloads through it, since the working
directory at invocation is not a property of the script.
Expand Down
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ An agent session is billed on the context it carries, not the work it does. Ever
- **Keep a long query in a file, not in the command.** A heredoc re-typed on every call costs its own length in context each time, often more than the answer it retrieves.
- **Keep generated caches outside the checkout when the executor restricts writes.** Give each task a cache directory under a writable temporary root. Point tools such as uv and ruff there through their own cache variables. Never repurpose `HOME` or an agent's configuration directory to make a tool run.
- **Report an execution boundary separately from a check finding.** A denied path, network request, or Docker socket says the check did not run. Preserve that failure, then use the executor's approval mechanism for the required rerun. Request the narrowest reusable command prefix the executor supports. Report the rerun's result as the verification evidence.
- **Bound every probe, and prove it ended.** A throwaway probe or test harness runs under `timeout`, and one that can recurse or fan out also runs under a task and memory cap. Start it in a process group of its own, as `setsid --wait timeout <n> <probe>` on Linux, and end it by that group with `kill -- -<pgid>`. Without `--wait`, `setsid` returns at once when its caller leads a process group, and the probe runs on detached. A `pkill -f` pattern that matches nothing exits 1 and kills nothing. Then confirm with `pgrep` that nothing from any earlier run survives, since a later clean run proves nothing about an earlier one. Never suppress a cleanup command's output or exit status. A command the harness moved to the background, where no background job was intended, is stopped and confirmed gone before work continues.

### Delegation

Expand Down
2 changes: 1 addition & 1 deletion CODESTYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This is packaged as the `python-codestyle` Skill at `.agents/skills/python-codes

## Shell

Bash, and only where a program cannot be Python: a bootstrap that installs the interpreter cannot be written in it, and a host tool that must run before a development toolchain exists cannot depend on Python either. Everything else is Python, with a test under its own scripts tree's `tests/` directory. The mandatory `set -Eeuo pipefail` header, the pipefail-versus-early-reader pitfall, self-locating scripts, the `shellcheck`-plus-`shfmt` clean-compile, and the why-not-what comment rule are packaged as the `shell-codestyle` Skill at `.agents/skills/shell-codestyle/SKILL.md` in the hub, not a repo-relative link since that path is hub-local and not carried into every fleet repo. Read the skill for the full rules. Run the clean-compile check itself per `GOVERNANCE.md` "Running the Linters Locally (Known-Working Invocations)", a hub-only section read in a hub checkout rather than carried into every fleet repo, not by probing `command -v shellcheck`.
Bash, and only where a program cannot be Python: a bootstrap that installs the interpreter cannot be written in it, and a host tool that must run before a development toolchain exists cannot depend on Python either. Everything else is Python, with a test under its own scripts tree's `tests/` directory. The mandatory `set -Eeuo pipefail` header, the pipefail-versus-early-reader pitfall, self-recursive command shims, self-locating scripts, the `shellcheck`-plus-`shfmt` clean-compile, and the why-not-what comment rule are packaged as the `shell-codestyle` Skill at `.agents/skills/shell-codestyle/SKILL.md` in the hub, not a repo-relative link since that path is hub-local and not carried into every fleet repo. Read the skill for the full rules. Run the clean-compile check itself per `GOVERNANCE.md` "Running the Linters Locally (Known-Working Invocations)", a hub-only section read in a hub checkout rather than carried into every fleet repo, not by probing `command -v shellcheck`.

<!-- Repo -->

Expand Down
Loading
Loading