Implement stage for the delivery team: delivery-implement-lead runs
test-author -> implementer -> qa in sequence on a draft WIP: PR and
removes WIP: when qa passes, starting review. delivery-test-first turns
acceptance criteria into acceptance checks committed under the
Delivery-Stage: test-author trailer; delivery-ci-checks reads a PR's or
commit's CI by the names in docs/agents/delivery.md.
Agents follow ADR-0016 (no tools: lists, disallowedTools fences on the
lead and qa) and pin Claude model aliases without model-policy; Copilot
limitations are documented in docs/runtimes.md. delivery 0.4.0.
Refs: #192
ADR: ADR-0016, ADR-0031, ADR-0032
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
Two fresh-context adversarial reviews and a spec/standards review of the
guard found bypasses, false denies and fail-open paths. Fixes:
- Substitution bodies are parsed by the tokenizer itself, so an
apostrophe in a here-doc commit/PR body no longer hides later commands.
- Redirect operands never become words; every redirect target is checked
for secret paths and .git/hooks.
- Unquoted here-doc substitutions are analysed; stdin shells (bash -,
ssh host, pwsh) analyse their here-doc as a script.
- Option clusters ending in a value letter (bash -euo pipefail -c,
sudo -iu root) consume their value.
- PowerShell mode: backtick escapes, iex, cmd /c, -EncodedCommand denied.
- Malformed payloads and unknown runtimes fail closed; runtime comes from
the deploy path only.
- Linear-time parsing with size, word, command, depth and unwrap caps, so
Copilot cannot time out (and fail open) on long input.
- Wider secret coverage (.ssh/.kube globs and dirs, id_* suffixes, sops
age key, k3s/admin kubeconfigs, git-credentials, deploy keys, REV:path)
and hook-bypass routes (git config alias, .git/hooks writes, find
-delete, HUSKY=0, LEFTHOOK=0).
- Fewer false denies: commit/PR message values, find -name, search globs,
jq/yq filters, pytest -k, git -S/--grep, ssh -i naming, non-admin
kubeconfigs, quoted braces, option names, doc and test files.
- New allowlists: helmfile, terragrunt hcl/render, helm diff.
- delivery 0.2.0: a new hook changes compiled output (configure.md).
- ADR-0032: allowlists described as "no cluster or state change and no
secret printed"; Write added to the file tools.
Refs #190
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
Ship one pre-tool-use hook in the delivery package. It denies the Never
tier on every runtime and asks before Odd jobs on Claude Code and Copilot
CLI (denying them on Codex and unknown runtimes):
- guard.py: stdlib-only Python; tokenises the shell line, unwraps
bash -c / env / sudo / eval / xargs / find -exec / rtk / uv run and
friends, checks file-tool paths for secret material, and uses read-verb
allowlists for kubectl, helm, flux and tofu
- hooks.json: no matcher, onFailure: block, 10s timeout
- tests/test-delivery-guard-hook.sh: 281 cases incl. bypass attempts and
per-runtime output shape
- root apm.yml: executables.allow delivery#0.1.0
- check-executables-allow-sync now covers every plugin shipping hooks/bin
- ADR-0032 amended: Copilot ask kept as an accepted risk, file tools and
allowlists recorded
Refs #190
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN