Skip to content

Commit 33d4b08

Browse files
committed
chore(wheelhouse): cascade template@b0c8c0c9
Auto-applied by socket-wheelhouse sync-scaffolding into cascade-socket-bin-10669. 624 file(s) touched: - .claude/commands/fleet/audit-gha-settings.md - .claude/commands/fleet/codifying-disciplines.md - .claude/commands/fleet/green-ci.md - .claude/commands/fleet/scanning-quality.md - .claude/hooks/fleet/_shared/README.md - .claude/hooks/fleet/_shared/error-message-quality.mts - .claude/hooks/fleet/_shared/foreign-paths.mts - .claude/hooks/fleet/_shared/gha-allowlist.mts - .claude/hooks/fleet/_shared/git-state.mts - .claude/hooks/fleet/_shared/hook-env.mts - .claude/hooks/fleet/_shared/markers.mts - .claude/hooks/fleet/_shared/stop-reminder.mts - .claude/hooks/fleet/_shared/test/error-message-quality.test.mts - .claude/hooks/fleet/_shared/test/foreign-paths.test.mts - .claude/hooks/fleet/_shared/test/transcript.test.mts - .claude/hooks/fleet/_shared/transcript.mts - .claude/hooks/fleet/actionlint-on-workflow-edit/README.md - .claude/hooks/fleet/actionlint-on-workflow-edit/index.mts - .claude/hooks/fleet/ai-config-drift-reminder/README.md - .claude/hooks/fleet/ai-config-drift-reminder/index.mts ... and 604 more
1 parent 2282f22 commit 33d4b08

624 files changed

Lines changed: 19685 additions & 5446 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/commands/fleet/audit-gha-settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ If no arguments given, audit the canonical fleet repo list:
2222

2323
## Process
2424

25-
1. Invoke the `auditing-gha-settings` skill runner:
25+
1. Invoke the `auditing-gha` skill runner:
2626

27-
node .claude/skills/auditing-gha-settings/run.mts <owner/repo>...
27+
node .claude/skills/fleet/auditing-gha/run.mts <owner/repo>...
2828

2929
2. The runner exits non-zero if any repo fails the baseline. Read the per-repo findings on stdout.
3030

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description: Scan a repo for disciplines enforced only by prose, convention, or agent memory and codify each into a script, hook, lint rule, or CLAUDE.md rule. Code is law — memory and docs don't enforce. Runs a Workflow of scanner agents, ranks gaps by blast radius, and proposes a concrete codification per gap.
3+
---
4+
5+
Run the `codifying-disciplines` skill.
6+
7+
Finds the disciplines a repo relies on but doesn't enforce (CLAUDE.md rules with
8+
no enforcer, repeated review feedback, build/release steps that depend on
9+
someone remembering, doc conventions with no validator) and turns each into
10+
executable law. Especially load-bearing for build and release steps. Interactive
11+
by default — confirms scope and which proposed codifications to apply now;
12+
non-interactive mode reports without applying.

.claude/commands/fleet/green-ci.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Watch the latest CI run for `$ARGUMENTS` and drive it back to green.
1010

1111
1. Invoke the `greening-ci` skill runner:
1212

13-
node .claude/skills/greening-ci/run.mts --repo <owner/repo> [--workflow <name>] [--mode <fast|release|cool>] [--branch <ref>]
13+
node .claude/skills/fleet/greening-ci/run.mts --repo <owner/repo> [--workflow <name>] [--mode <fast|release|cool>] [--branch <ref>]
1414

1515
Parse the final stdout line as JSON.
1616

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description: Single-pass quality scan — fans out finders in parallel, runs variant analysis, adversarially verifies High/Critical findings, and produces an A-F report. Read-only; makes no commits.
3+
---
4+
5+
Run the `scanning-quality` skill.
6+
7+
**Read-only** — this produces a report and makes no code changes or commits.
8+
To iterate-fix-recheck until the report is clean, use the interactive loop
9+
driver `/fleet:looping-quality` instead.

.claude/hooks/fleet/_shared/README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Helper modules shared across multiple hooks under `.claude/hooks/`. **Not a depl
66

77
- **`shell-command.mts`** — Tokenizes a Bash command string with `shell-quote` into discrete `Command`s (`binary`, `args`, leading env `assignments`, plus `viaVariable` / `viaEval` indirection flags). Exposes `parseCommands`, `findInvocation`, `commandsFor`, `invocationHasFlag`, and `hasOpaqueInvocation`. Used by every structure-sensitive Bash guard (`codex-no-write-guard`, `release-workflow-guard`, `no-empty-commit-guard`, the git-detection guards, …) so a forbidden invocation is matched on the actual parsed command — `$(…)` / `$VAR` / `eval` indirection is seen rather than evaded, and a quoted mention inside an `echo` or `-m` body can't false-trigger.
88

9-
- **`hook-env.mts`**`isHookDisabled(slug)` and `hookLog(slug, ...lines)`. Standardizes the `SOCKET_<UPPER_SLUG>_DISABLED` env-var convention every hook supports plus the `[<slug>] <line>` stderr prefix shape. Use these in new hooks so every hook gets a uniform kill switch + output format for free.
10-
119
- **`markers.mts`** — Shared sentinel constants for bypass phrases the user can type to override a hook (`Allow <name> bypass`, etc.).
1210

1311
- **`payload.mts`**`ToolCallPayload` and `ToolInput` types for the PreToolUse JSON payload, plus `readCommand` / `readFilePath` / `readWriteContent` narrowing helpers. **Use this instead of re-declaring `tool_input` types per-hook** — the fleet had 7 hand-rolled variants before this module landed.
@@ -22,14 +20,12 @@ Helper modules shared across multiple hooks under `.claude/hooks/`. **Not a depl
2220

2321
## When to reach for what (new hook quick-reference)
2422

25-
- Writing a **Stop hook** that just emits a reminder when patterns match? → `import { runStopReminder } from '../_shared/stop-reminder.mts'`. See `excuse-detector` for the single-group shape, or `voice-and-tone-reminder` (uses `runStopReminders`) for merging several pattern tables into one process while keeping per-group disable env vars.
23+
- Writing a **Stop hook** that just emits a reminder when patterns match? → `import { runStopReminder } from '../_shared/stop-reminder.mts'`. See `excuse-detector` for the single-group shape, or `yakback-reminder` (uses `runStopReminders`) for merging several pattern tables into one process while keeping per-group disable env vars.
2624

2725
- Writing a **PreToolUse hook** that inspects a tool call's input? → `import { ToolCallPayload, readCommand, readFilePath } from '../_shared/payload.mts'`. Saves you the `typeof === 'string'` guard.
2826

2927
- Detecting whether a Bash command really invokes some binary/subcommand (and want `$(…)` / `$VAR` / quoted-mention false positives handled)? → `import { commandsFor, findInvocation } from '../_shared/shell-command.mts'`.
3028

31-
- Want a kill switch for your hook? → `import { isHookDisabled, hookLog } from '../_shared/hook-env.mts'`. The hook is enabled by default and `SOCKET_<UPPER_SLUG>_DISABLED=1` opts out — same shape across the fleet.
32-
3329
- Need to scan secret-bearing env-var names? → `import { ALL_TOKEN_KEY_PATTERNS } from '../_shared/token-patterns.mts'`.
3430

3531
## Adding to `_shared/`
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/**
2+
* @file Shared error-message-quality classifier. The single source for "is this
3+
* a vague-only error message" — consumed by both
4+
* `error-message-quality-reminder` (Stop hook, grades code blocks the
5+
* assistant wrote) and the `error-messages-are-thorough` check (commit-time,
6+
* grades `throw new …Error("…")` across the committed tree). Extracted so the
7+
* pattern list + grading bar live in ONE place; a tweak to either lands for
8+
* both surfaces at once.
9+
*
10+
* The bar (per CLAUDE.md "Error messages"): a message is vague when it is a
11+
* short static string carrying ONLY a vague verb/noun — no "what" rule, no
12+
* field/location, no saw-vs-wanted value. A message with a colon (field-path
13+
* prefix), an embedded quote (a shown value), or length > 40 is presumed to
14+
* carry specifics and is NOT graded.
15+
*/
16+
17+
// Match any Error-suffixed class plus the legacy TemporalError name.
18+
export const ERROR_CLASS_RE = /(?:Error|TemporalError)$/
19+
20+
export interface VaguePattern {
21+
readonly label: string
22+
readonly regex: RegExp
23+
readonly hint: string
24+
}
25+
26+
export const VAGUE_MESSAGE_PATTERNS: readonly VaguePattern[] = [
27+
{
28+
label: 'bare "invalid"',
29+
regex:
30+
/^(?:invalid|invalid value|invalid input|invalid argument|invalid format)\.?$/i,
31+
hint: '"Invalid" describes the fallout, not the rule. Say what shape was expected: "must be lowercase", "must match /^[a-z]+$/", "must be one of X / Y / Z".',
32+
},
33+
{
34+
label: 'bare "failed"',
35+
regex:
36+
/^(?:failed|failure|operation failed|request failed|action failed)\.?$/i,
37+
hint: '"Failed" describes the symptom. Name what was attempted and what blocked it: "could not write <path>: ENOENT", "fetch <url> returned 503".',
38+
},
39+
{
40+
label: 'bare "error occurred"',
41+
regex: /^(?:an? )?error(?:\s+occurred)?\.?$/i,
42+
hint: 'The message says nothing the reader can act on. State the rule, the location, the bad value.',
43+
},
44+
{
45+
label: 'bare "something went wrong"',
46+
regex: /^something went wrong\.?$/i,
47+
hint: 'Pure filler. CLAUDE.md "Error messages": the reader should fix the problem from the message alone.',
48+
},
49+
{
50+
label: 'bare "unable to X" / "could not X" (verb-only)',
51+
regex: /^(?:unable to|could not|cannot|can'?t)\s+\w+\.?$/i,
52+
hint: 'No object / no reason. "Unable to read" → "could not read <path>: <errno>".',
53+
},
54+
{
55+
label: 'bare "not found"',
56+
regex: /^(?:not found|not\s+exist|does not exist|missing)\.?$/i,
57+
hint: 'Missing what? Where? Say "config file not found: <path>" with the specific path.',
58+
},
59+
{
60+
label: 'bare "bad" / "wrong" / "incorrect"',
61+
regex:
62+
/^(?:bad|wrong|incorrect|invalid format)(?:\s+(?:argument|data|format|input|value))?\.?$/i,
63+
hint: 'Same as "invalid" — describe the rule the value violated, not how you feel about it.',
64+
},
65+
]
66+
67+
export interface MessageGrade {
68+
readonly label: string
69+
readonly hint: string
70+
}
71+
72+
/**
73+
* Grade a single thrown-error message string. Returns the matched vague pattern,
74+
* or undefined when the message clears the bar (carries a colon / quoted value,
75+
* is longer than 40 chars, or matches no vague-only pattern). A non-string
76+
* message (template literal with interpolation, an identifier) is out of scope —
77+
* pass an empty string and it returns undefined.
78+
*/
79+
export function gradeMessage(message: string): MessageGrade | undefined {
80+
const trimmed = message.trim()
81+
if (trimmed.length === 0) {
82+
return undefined
83+
}
84+
// A colon suggests a field-path prefix; an embedded quote/backtick suggests a
85+
// shown "saw vs. wanted" value. Either way, presumed specific.
86+
if (
87+
trimmed.includes(':') ||
88+
trimmed.includes('"') ||
89+
trimmed.includes('`')
90+
) {
91+
return undefined
92+
}
93+
if (trimmed.length > 40) {
94+
return undefined
95+
}
96+
for (let i = 0, { length } = VAGUE_MESSAGE_PATTERNS; i < length; i += 1) {
97+
const pattern = VAGUE_MESSAGE_PATTERNS[i]!
98+
if (pattern.regex.test(trimmed)) {
99+
return { label: pattern.label, hint: pattern.hint }
100+
}
101+
}
102+
return undefined
103+
}

0 commit comments

Comments
 (0)