Skip to content

Commit c38e3a4

Browse files
committed
fix: restore full-auto PR pipeline end to end
Three breaks found by live-run diagnosis after #1047 merged: 1. The agent invoked ./scripts/create-docs-pr.sh as a multi-line command (backslash continuations), which prefix permission rules never match -> denied 4x, gave up. Prompt now mandates single-line invocation and explains why. 2. The main ruleset requires PRs (no bypass actors), so the prompt's 'commit directly to main' path could never work. Minor changes now go through a PR + immediate self-merge (0 approvals required). Tripwire uses --state all so a self-merged PR is not a false alarm. 3. claude-review.yml (day shift) still ran @main with --allowedTools in claude_args - the same June parsing change silently denied 'gh pr merge', so auto-merge was dead too. Pinned to v1.0.168, permissions moved to shared .claude/settings.json (union of both workflows' allowlists + basic read-only utils). Also: re-ignore content/github/**/.claude/ mirror dirs (unignored by #1047's root-only rule, they dirtied the CI workspace every run and tripped the verify step), and drop the temporary show_full_output flag. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent dd8a629 commit c38e3a4

4 files changed

Lines changed: 46 additions & 29 deletions

File tree

.claude/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22
"permissions": {
33
"allow": [
44
"Bash(gh pr:*)",
5+
"Bash(gh issue:*)",
6+
"Bash(gh release:*)",
57
"Bash(git:*)",
68
"Bash(npm:*)",
79
"Bash(jq:*)",
810
"Bash(date:*)",
11+
"Bash(ls:*)",
12+
"Bash(cat:*)",
13+
"Bash(grep:*)",
14+
"Bash(head:*)",
15+
"Bash(tail:*)",
16+
"Bash(wc:*)",
17+
"Bash(echo:*)",
18+
"Bash(uv run scripts/fetcher.py:*)",
919
"Bash(./scripts/create-docs-pr.sh:*)",
1020
"mcp__barkme__notify"
1121
]

.github/workflows/claude-review.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ jobs:
6767
if: |
6868
!contains(github.event.pull_request.title, '[skip-review]') &&
6969
!contains(github.event.pull_request.title, '[WIP]')
70-
uses: anthropics/claude-code-action@main
70+
# Pinned like fetch-claude-docs.yml: @main's claude_args parsing split
71+
# '--allowedTools Bash(gh pr:*)' on whitespace, silently denying
72+
# 'gh pr merge' - auto-merge was dead. Tool permissions live in
73+
# .claude/settings.json (settingSources=project), not in claude_args.
74+
uses: anthropics/claude-code-action@v1.0.168
7175
env:
7276
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
7377
with:
@@ -76,7 +80,6 @@ jobs:
7680
allowed_bots: "claude-yolo[bot],github-actions[bot]"
7781
claude_args: |
7882
--model claude-sonnet-4-6
79-
--allowedTools Bash(gh pr:*),Bash(git:*),Bash(gh issue:*),Bash(gh release:*),Bash(npm:*),Bash(ls:*),Bash(cat:*),Bash(grep:*),Bash(uv run scripts/fetcher.py:*),Bash(jq:*),mcp__barkme__notify
8083
--mcp-config '{
8184
"mcpServers": {
8285
"barkme": {

.github/workflows/fetch-claude-docs.yml

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ jobs:
6666
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
6767
github_token: ${{ steps.app-token.outputs.token }}
6868
allowed_bots: "claude-yolo[bot]"
69-
# TEMPORARY: expose agent transcript to diagnose permission denials
70-
show_full_output: true
7169
claude_args: |
7270
--model claude-sonnet-4-6
7371
--mcp-config '{
@@ -122,45 +120,47 @@ jobs:
122120
123121
## DECISION CRITERIA (based on WHY it matters)
124122
125-
IGNORE (noise; do not commit/PR):
126-
- Only blog/research content changed with no other files
127-
- Only github/ repo content changed with no other files
128-
- Only .metadata.json changed
123+
This repo is an archive: EVERY fetched change gets committed.
124+
main is push-protected (branch ruleset, no bypass), so all
125+
changes travel through a PR - even minor ones. What varies is
126+
whether humans hear about it:
129127
130-
If the diff contains only low-signal changes: do nothing, exit 0.
131-
132-
**CREATE PR** (WHY: humans need to know):
128+
**PR + leave open for day shift** (WHY: humans need to know):
133129
- Version updates in content/claude-code-manifest.json
134130
- New features documented in claude-code or agent-sdk docs
135131
- CHANGELOG additions
136132
- API changes or new API endpoints
137133
- Breaking changes
138134
- Security-related updates
139135
- New MCP spec versions
140-
- New engineering blog posts (high signal)
141136
142-
**COMMIT DIRECTLY** (WHY: not worth human attention):
143-
- Typo fixes < 5 lines
144-
- Timestamp updates
145-
- Metadata changes
146-
- Formatting tweaks
147-
- Dead link fixes
148-
- Minor doc wording changes
137+
**PR + self-merge immediately** (WHY: archive freshness, zero human value):
138+
- Only github/ mirror or support/ content changed
139+
- Only .metadata.json / timestamps changed
140+
- Typo fixes, formatting tweaks, dead links, minor wording
141+
142+
If `git status` is completely clean: nothing to do, exit 0.
149143
150144
## HOW TO HANDLE
151145
152-
**For meaningful changes (PR needed)**:
146+
IMPORTANT - invoke the PR script as ONE single line: no
147+
backslash line-continuations, no $( ) command-substitution
148+
wrapper. The permission allowlist matches command prefixes,
149+
and a multi-line command is silently DENIED (this exact
150+
failure stalled the pipeline in July 2026).
151+
152+
**For meaningful changes (PR for day shift)**:
153153
```bash
154-
PR_URL=$(./scripts/create-docs-pr.sh "{key feature}" "{why it matters}" "{version}")
155-
# Barkme notification with PR URL
154+
./scripts/create-docs-pr.sh "{key feature}" "{why it matters}" "{version}"
156155
```
156+
The script prints the PR URL on its last line. Then barkme.
157157
158-
**For minor changes (direct commit)**:
158+
**For minor changes (PR + immediate self-merge)**:
159159
```bash
160-
git add .
161-
git commit -m "docs: {what} (minor)"
162-
git push
160+
./scripts/create-docs-pr.sh "{what} (minor)" "{one-line why}" "{version}"
161+
gh pr merge {pr-url} --rebase
163162
```
163+
No barkme for minor self-merges.
164164
165165
## OUTPUT STYLE
166166
- Focus on WHY changes matter, not WHAT changed
@@ -211,7 +211,9 @@ jobs:
211211
exit 1
212212
fi
213213
if [ "$BRANCH" != "main" ] && [ -n "$BRANCH" ]; then
214-
PRS=$(gh pr list --head "$BRANCH" --json number --jq 'length')
214+
# --state all: minor PRs are self-merged (and their branch
215+
# auto-deleted) before this step runs - that is success, not failure
216+
PRS=$(gh pr list --head "$BRANCH" --state all --json number --jq 'length')
215217
if [ "$PRS" = "0" ]; then
216218
echo "::error::Branch $BRANCH pushed but no PR exists - PR creation silently failed"
217219
exit 1

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ dist/
1616
.claude-trace/
1717

1818
# Local development (root only; keep settings.json tracked: CI reads tool
19-
# permissions from it via settingSources=project. Note: content/github/**
20-
# mirrors still ship .claude/ dirs we currently do not archive.)
19+
# permissions from it via settingSources=project.)
2120
/.claude/*
2221
!/.claude/settings.json
22+
# github mirrors ship .claude/ dirs we do not archive; left untracked they
23+
# dirty the CI workspace every run and trip the Verify outcome step
24+
content/github/**/.claude/
2325
worktree/
2426
WIP/
2527
references/

0 commit comments

Comments
 (0)