-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy path.smallhours.yml
More file actions
132 lines (121 loc) · 6.06 KB
/
Copy path.smallhours.yml
File metadata and controls
132 lines (121 loc) · 6.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# smallhours consumer config. Every key is OPTIONAL — delete any line to take
# the default shown. setup-repo.sh drops this into a new consumer repo alongside
# the stub workflow. Defaults live in scripts/lib/config.sh.
#
# Comments stay on their own lines so this passes strict YAML linters as-is.
version: 1
# Per-stage Claude model. Default: claude-sonnet-5 for every stage.
# resolve_conflict is Phase 2 (M7).
models:
implement: claude-opus-5
address_review: claude-sonnet-5
auto_fix: claude-sonnet-5
resolve_conflict: claude-sonnet-5
# Per-stage --max-turns ceiling.
# resolve_conflict is Phase 2 (M7).
max_turns:
implement: 200
address_review: 30
auto_fix: 40
resolve_conflict: 20
# Consecutive CI auto-fix attempts before giving up (0 disables auto-fix:
# the first red hands straight off to a human). Default: 3.
attempt_cap: 3
# Max issues worked at once. ready-for-agent is an unbounded queue; the
# dispatcher keeps at most this many in agent-working, promoting the rest as
# slots free. Default: 3.
max_concurrent: 3
# Name of the consumer CI workflow the state machine gates on. Must match the
# workflows entry in the stub's workflow_run trigger. Default: ci.
ci_workflow: CI
# Map canonical label names (CONTEXT.md vocabulary) to this repo's own label
# strings, for repos with a pre-existing label scheme. Keys are canonical
# names; values are what actually appears on issues/PRs. Unmapped names use
# the canonical string. The workflow-trigger labels — ready-for-agent,
# agent-working, and the PR marker agent — are FIXED in v1 and cannot be
# remapped (the reusable workflow gates on them before config is readable).
# Example:
# labels:
# in-review: "status: in review"
# ready-for-human: "status: needs human"
labels: {}
# Extra domains appended to the sandbox egress allowlist (GitHub + Anthropic are
# always allowed). Default: none.
egress_extra_domains: []
# When true, the sandbox reaches registry.npmjs.org AND install lifecycle
# scripts are disabled (NPM_CONFIG_IGNORE_SCRIPTS=true). When false (default),
# npm has no network egress.
#
# On for this repo because the agent installs its own dependencies — nothing is
# installed for it — and because an issue that adds a library has to be able to
# resolve one. IGNORE_SCRIPTS costs us nothing here: pnpm 11 denies build scripts
# by default anyway (there is no `allowBuilds` map in pnpm-workspace.yaml).
npm_allowed: true
# Widen the sandbox so `pnpm install` can actually write. Egress alone is not
# enough: the sandbox permits writes to the working directory and $TMPDIR only,
# and the store is outside both — without this, resolution succeeds and the store
# write is denied, which surfaces as a baffling install failure.
#
# More paths than any one machine uses, deliberately. pnpm picks the store by
# platform and by which volume the project sits on (XDG on a Linux runner, a
# project-local .pnpm-store when home is on another volume), and corepack has to
# fetch the pinned pnpm 11.17.0 into a cache of its own. An allowWrite entry that
# goes unused costs nothing; a missing one costs a whole run.
#
# Lists only — smallhours owns the profile's booleans (its ADR 0008).
sandbox:
filesystem:
allowWrite:
- ~/.local/share/pnpm
- ~/.local/state/pnpm
- ~/.cache
- ~/.npm
# Run after the agent stops and before the PR opens; a failure re-enters the agent
# with the output (verify_reentries), so a lint or type error costs ~10s instead of
# a 3m18s CI round trip plus one of attempt_cap's auto-fix attempts.
#
# `pnpm verify` is lint + typecheck + i18n:check + unit/component tests + build —
# the same set CI's Build job runs, and all of it executable in the agent phase.
# E2E is deliberately NOT here: it needs a MediaMTX container, Playwright browsers
# and ffmpeg, none of which exist there, and its web server binds a local port the
# sandbox forbids. CI owns that. See docs/TESTING.md.
# A bare `pnpm`, which needs smallhours >= v0.6.0. Everything on the runner's
# PATH is read-only to the agent inside its sandbox, so it could never install
# pnpm anywhere a later shell would find it — issue #306's run caught it reaching
# pnpm through `npx pnpm`, out of a hash-keyed cache at
# ~/.npm/_npx/<hash>/node_modules/.bin, which nothing puts on PATH.
#
# smallhours ADR 0014 gives the agent one writable directory that IS on the
# gate's PATH, and its prompts point at it, so an installed pnpm is visible to
# the gate by bare name. That also fixes the trap this line fell into twice: the
# `verify` script below re-invokes `pnpm`, and a launcher that runs pnpm without
# exporting PATH (`corepack pnpm`) leaves that child with nothing — which is why
# `corepack pnpm run verify` failed where `npx --yes pnpm@x` had worked.
#
# No version pinned here on purpose: the agent installs whatever `packageManager`
# names, so there is no second copy for Renovate to drift out from under us.
verify: pnpm verify
verify_reentries: 2
# Prefix agent PR titles with a conventional-commit type derived from the
# issue's labels. `main` is squash-merged, so the PR title IS the subject
# semantic-release parses — an unprefixed one fails the repo's own
# `Conventional commit format` check and, before smallhours#30, cost a whole
# auto-fix attempt to correct on a PR whose code was already green.
#
# Presence is the opt-in; absent, titles pass through verbatim.
#
# `tech-debt: fix` deliberately, not `refactor`. Debt issues here are routinely
# real user-visible fixes — #206 (record toggle showed a stale state through the
# whole write) is one, and its body says "Ships as `fix:`". `refactor` cuts no
# release, and CLAUDE.md is explicit that silently dropping a change out of the
# next release is the failure worth avoiding. An extra patch on a nightly
# release train is cheap by comparison.
#
# This buys a title that PASSES, not a title that is good: the map cannot know
# that #206 is better described as "show pending state on record toggle" than by
# its own problem-statement title. Retitling a PR by hand stays worthwhile.
conventional_title_types:
bug: fix
tech-debt: fix
enhancement: feat
documentation: docs