Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PY := $(VENV)/bin/python
PATTERNS ?= .patterns
LINT_PATHS := scripts/validate-kits.py scripts/run-kit-tests.py scripts/tests claude-code/files claude-code/tests claude-code/scripts/test claude-code/scripts/verify
LINT_PATHS += codex/files codex/tests codex/scripts antigravity/files antigravity/tests antigravity/scripts scripts/verify-native-cli.py personal/scripts/vendor-pocock-skills
LINT_PATHS += personal/scripts/vendor-diagram-design personal/scripts/test-diagram-design.py personal/scripts/test-first-mate-detector.py personal/vendor/diagram-design-local/scripts
LINT_PATHS += personal/scripts/vendor-diagram-design personal/scripts/test-diagram-design.py personal/scripts/test-first-mate-detector.py personal/scripts/test-gh-stack-install.py personal/vendor/diagram-design-local/scripts
GITLEAKS ?= gitleaks

.PHONY: setup check lint test validate security
Expand Down
9 changes: 6 additions & 3 deletions personal/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ An acq `hybrid/v1` skill kit. Start with [`README.md`](README.md).
- **Check your work:** `scripts/verify` (offline) and, from the repository root,
`python scripts/run-kit-tests.py personal`. Both need `python3`; `shellcheck` and `acq`
are used when installed.
- The kit has one `commands` entry on purpose: a background startup step that runs
`files/home/paseo-plugins-install.sh` (ADR 0003). Skills are dropped at their final path;
- The kit has two `commands` entries on purpose, both background startup steps: one runs
`files/home/paseo-plugins-install.sh` (ADR 0003) and one runs
`files/home/gh-stack-install.sh` (ADR 0006; moving its pins means changing the tag,
the commit, and both digests together). Skills are dropped at their final path;
do not add a step to link or fetch them. It has no `agent:` block, and `caps.network`
lists `github.com` and `registry.npmjs.org`. A new Paseo plugin is one `install_plugin ID git:owner/repo <40-hex>`
lists `github.com`, `api.github.com`, `release-assets.githubusercontent.com` and
`registry.npmjs.org`. A new Paseo plugin is one `install_plugin ID git:owner/repo <40-hex>`
(or `npm:pkg <x.y.z>`) line in that script; the script refuses unpinned sources and
`scripts/verify` section 3d checks it. Read the plugin's source at the pin first.
30 changes: 22 additions & 8 deletions personal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,19 @@ that holds the author's personal layer: the skills a coding agent should have in
every sandbox, applied last on top of the global kits.

It is an opt-in `--kit` mixin. It installs no agent, writes no provider
configuration, and publishes no ports. It runs one background startup command that
installs Paseo plugins (see [Paseo plugins](#paseo-plugins)), and allow-lists one
network hosts, `github.com` and `registry.npmjs.org`, for that command.
configuration, and publishes no ports. It runs two background startup commands: one
installs Paseo plugins (see [Paseo plugins](#paseo-plugins)), the other installs the
`gh stack` extension and its skill (see [gh stack](#gh-stack)). It allow-lists four
network hosts, `github.com`, `api.github.com`, `release-assets.githubusercontent.com`
and `registry.npmjs.org`, for those commands.

## What it ships

```text
~/.agents/skills/
paseo-first-mate/ the author's own skill (version 1.6.0), its references, and two helper scripts
paseo-first-mate/ the author's own skill (version 1.7.0), its references, and two helper scripts
SKILL.md
references/*.md longer procedures the skill links to (delegation, status doc,
references/*.md longer procedures the skill links to (delegation, status map,
handoff, host commands, stacking, cross-PR checks)
assets/first-mate-check.py change detector (prints nothing when nothing changed)
assets/first-mate-wait.sh background wait loop around the detector; one loop per
Expand All @@ -33,8 +35,19 @@ network hosts, `github.com` and `registry.npmjs.org`, for that command.
so no per-agent linking is needed.

The skills are written at their final path by the kit's `files[]` records, so they
need no command. The one startup command is the plugin installer below; it is
detached and always exits 0, so nothing it does can fail a sandbox create.
need no command. The two startup commands are the installers below; each is
detached and always exits 0, so nothing they do can fail a sandbox create.

## gh stack

At startup a background script, `~/gh-stack-install.sh`, installs the `gh stack`
extension and the `gh-stack` agent skill that the first-mate skill uses to stack and
merge dependent PRs. Both are pinned: the extension to tag `v0.3.0`, with its binary's
sha256 checked against a recorded digest (the binary is removed on a mismatch), and the
skill to the commit that tag points at. It needs `gh` 2.90.0 or later and does not
upgrade it; the first-mate skill's Prerequisites section says how. It is idempotent,
retries, always exits 0, and logs to `~/.local/state/paseo/gh-stack.log`. Reasoning and
limits: [`docs/decisions/0006`](docs/decisions/0006-install-gh-stack-at-startup.md).

## Paseo plugins

Expand Down Expand Up @@ -289,7 +302,8 @@ drops files and starts one plugin installer that needs the separate paseo kit, s
run commands and push code. Everything is plain text you can read in this
directory; review the diff before pinning a new SHA, especially after
re-vendoring.
- **`github.com` and `registry.npmjs.org` are open to every agent in the sandbox.**
- **`github.com`, `api.github.com`, `release-assets.githubusercontent.com` and
`registry.npmjs.org` are open to every agent in the sandbox.**
`caps.network` is sandbox-wide, not scoped to the installer, so any agent or plugin
there can also reach them (clones, gists, pushes, package fetches). The paseo kit
already allows the npm registry.
Expand Down
69 changes: 69 additions & 0 deletions personal/docs/decisions/0006-install-gh-stack-at-startup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: "Install gh stack and its skill at sandbox startup"
description: "Pin and digest-check the gh stack extension and its agent skill in the personal kit, so the first-mate skill has its stacking tools"
status: draft
tier: 2
date: "2026-12-04"
last_updated: "2026-12-04"
decision_makers: ["Bret Mogilefsky"]
nist_controls: ["CM-3", "CM-7", "SA-11", "SR-3"]
impact_level: "Moderate"
ato_relevance: "no"
risk_treatment: "mitigate"
---

# Install gh stack and its skill at sandbox startup

## Context and problem statement

The `paseo-first-mate` skill stacks and merges dependent pull requests with `gh stack`
and the `gh-stack` agent skill. Neither was present in a new sandbox, so the coordinator
stopped to install them in every sandbox, and the skill did not list them as
prerequisites. Both are a binary and a skill from `github/gh-stack`, fetched over the
network.

## Decision outcome

1. **A startup step installs both.** `~/gh-stack-install.sh` runs in the background at
sandbox start, beside the Paseo plugin installer. It runs
`gh extension install github/gh-stack --pin v0.3.0` and
`gh skill install github/gh-stack gh-stack --pin <commit> --agent universal --scope user`.
Both are skipped when already present. It always exits 0, retries each install three
times, takes a run lock, and logs to `~/.local/state/paseo/gh-stack.log`.
2. **Everything is pinned, and the binary is verified.** The skill is pinned to the full
commit that tag `v0.3.0` points at. `gh` does not verify a downloaded extension
binary, so the script compares its sha256 with a digest recorded in the script, taken
from the release's published asset digests, and runs `gh extension remove` on a
mismatch. Digests are recorded for Linux amd64 and arm64; other platforms install
nothing and log why. `scripts/verify` section 3d2 fails on an unpinned install, a
missing digest, or a missing removal path.
3. **It does not install or upgrade `gh`.** `gh skill` first shipped in 2.90.0. When `gh`
is missing or older, the script logs it and stops. Upgrading `gh` needs root or an
unpinned download, so the first-mate skill's Prerequisites section carries the
procedure (package manager, or a release tarball checked against its checksums file).
4. **Egress.** `gh extension install` and `gh skill install` reach `api.github.com`,
`github.com`, and `release-assets.githubusercontent.com` (observed with `GH_DEBUG=api`
on gh 2.102.1). The last two are added to `caps.network.allow` with `api.github.com`.
`caps.network` is sandbox-wide.
5. **Moving a pin** means changing the tag, the commit, and both digests together, then
reading the new skill. The skill's text steers the agent, so review its diff.

## Consequences and limitations

- The kit adds two egress hosts and a second short background process at startup.
- Digests are not verified against anything the kit controls beyond the release's own
published values, which share a trust root with the binary. They catch corruption and
a changed asset, not a compromised release.
- The skill's metadata records the pin, but `gh skill` does not verify content hashes.
- Not tested: a real `acq run` on msb or sbx, macOS (no pinned digest), a proxy that
inspects HTTPS, and the extension at `gh` versions other than 2.102.1.

## Verification and rollback

`scripts/test-gh-stack-install.py` runs the shipped script against a fake `gh` (13 tests,
including the digest-mismatch removal, idempotence, the version gate, failed installs,
and the run lock). The real `gh extension install` and `gh skill install` were run once
with an isolated `HOME` to confirm the commands, flags, digest, and hosts. Run
`personal/scripts/verify` and `python3 scripts/run-kit-tests.py personal`. Roll back by
reverting this decision, the script, its test, the spec records, and the `verify` section.
The record is AI-authored and remains draft pending human review.
Loading
Loading