Skip to content

Commit 49d0723

Browse files
committed
chore(wheelhouse): cascade template@d44822f7
1 parent 70231ef commit 49d0723

23 files changed

Lines changed: 556 additions & 286 deletions

File tree

.claude/hooks/fleet/minimum-release-age-guard/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ emergency CVE patches.
2929

3030
Type the canonical phrase in a new message:
3131

32-
Allow minimumReleaseAge bypass
32+
Allow soak-time bypass
33+
34+
`Allow minimumReleaseAge bypass` still works as an alias. The matcher folds
35+
hyphens to spaces, so `Allow soak time bypass` matches too.
3336

3437
Use sparingly. The legitimate cases are:
3538

.claude/hooks/fleet/minimum-release-age-guard/index.mts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
// - For Write: compares against current contents (absent file = empty
1616
// exclude array).
1717
//
18-
// Bypass: `Allow minimumReleaseAge bypass` typed verbatim in a recent user
19-
// turn — for emergency CVE patches where a legitimately-published-yesterday
20-
// fix must be installed before the 7-day window closes.
18+
// Bypass: `Allow soak-time bypass` (alias: `Allow minimumReleaseAge bypass`)
19+
// typed verbatim in a recent user turn — for emergency CVE patches where a
20+
// legitimately-published-yesterday fix must be installed before the 7-day
21+
// window closes. The matcher folds hyphens to spaces, so `soak-time` and
22+
// `soak time` both match the same phrase.
2123
//
2224
// Fails open on parse errors (better to under-block than to brick edits
2325
// when the file isn't parseable YAML).
@@ -33,7 +35,13 @@ import { bypassPhrasePresent } from '../_shared/transcript.mts'
3335

3436
const logger = getDefaultLogger()
3537

36-
const BYPASS_PHRASE = 'Allow minimumReleaseAge bypass'
38+
// `soak-time` is the canonical phrase; `minimumReleaseAge` is kept as an alias
39+
// so older transcripts / muscle memory still authorize the bypass. Both fold
40+
// through normalizeBypassText, so spacing/hyphen variants of each also match.
41+
const BYPASS_PHRASES = [
42+
'Allow soak-time bypass',
43+
'Allow minimumReleaseAge bypass',
44+
]
3745

3846
// Permissive YAML extraction tailored to the `minimumReleaseAge.exclude`
3947
// block. We don't pull in a full YAML library — the block shape is narrow:
@@ -148,7 +156,7 @@ await withEditGuard((filePath, content, payload) => {
148156

149157
if (
150158
payload.transcript_path &&
151-
bypassPhrasePresent(payload.transcript_path, BYPASS_PHRASE)
159+
bypassPhrasePresent(payload.transcript_path, BYPASS_PHRASES)
152160
) {
153161
return
154162
}
@@ -175,7 +183,7 @@ await withEditGuard((filePath, content, payload) => {
175183
' node scripts/soak-bypass.mts <pkg>@<version>',
176184
' (the daily updating-daily job removes the entry once its soak clears).',
177185
'',
178-
` Bypass (to hand-edit anyway): type "${BYPASS_PHRASE}" in a new message, then retry.`,
186+
` Bypass (to hand-edit anyway): type "${BYPASS_PHRASES[0]}" in a new message, then retry.`,
179187
'',
180188
].join('\n'),
181189
)

.claude/hooks/fleet/minimum-release-age-guard/test/index.test.mts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,18 @@ test('Write adds a fresh exclude — blocked', async () => {
109109
assert.ok(String(r.stderr).includes('sketchy-pkg'))
110110
})
111111

112-
test('Edit with bypass phrase in transcript — passes', async () => {
112+
async function runBypassCase(bypassText: string): Promise<{ code: number }> {
113113
const filePath = tmpYaml('minimumReleaseAge:\n exclude:\n - pkg-a\n')
114114
const dir = mkdtempSync(path.join(os.tmpdir(), 'mra-guard-tx-'))
115115
const transcriptPath = path.join(dir, 'session.jsonl')
116116
writeFileSync(
117117
transcriptPath,
118118
JSON.stringify({
119119
type: 'user',
120-
message: { content: 'Allow minimumReleaseAge bypass' },
120+
message: { content: bypassText },
121121
}) + '\n',
122122
)
123-
const r = await runHook({
123+
return await runHook({
124124
tool_name: 'Edit',
125125
tool_input: {
126126
file_path: filePath,
@@ -129,5 +129,19 @@ test('Edit with bypass phrase in transcript — passes', async () => {
129129
},
130130
transcript_path: transcriptPath,
131131
})
132+
}
133+
134+
test('Edit with canonical soak-time bypass phrase — passes', async () => {
135+
const r = await runBypassCase('Allow soak-time bypass')
136+
assert.strictEqual(r.code, 0)
137+
})
138+
139+
test('Edit with hyphen-folded "Allow soak time bypass" — passes', async () => {
140+
const r = await runBypassCase('Allow soak time bypass')
141+
assert.strictEqual(r.code, 0)
142+
})
143+
144+
test('Edit with legacy minimumReleaseAge bypass alias — passes', async () => {
145+
const r = await runBypassCase('Allow minimumReleaseAge bypass')
132146
assert.strictEqual(r.code, 0)
133147
})

.claude/hooks/fleet/prefer-pipx-over-pip-guard/index.mts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
// user turn. Fails open on regex / parse errors.
1818

1919
import { readFileSync } from 'node:fs'
20-
import path from 'node:path'
2120
import process from 'node:process'
2221

2322
import { bypassPhrasePresent, readStdin } from '../_shared/transcript.mts'

.claude/skills/fleet/cascading-fleet/SKILL.md

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.claude/skills/fleet/reviewing-code/SKILL.md

Lines changed: 23 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)