Skip to content

Commit 53ef788

Browse files
stranmaclaude
andcommitted
fix: Correct factual errors in architecture guide per code review
- test-coverage-validator: permissionMode is dontAsk (not acceptEdits), agent has no Edit tool and cannot auto-fix test gaps - review-responder: permissionMode is acceptEdits (not dontAsk), agent can modify files to fix review comments - Secret pattern count: 9 literal + 1 regex (not 13 + 1) - Hook JSON output goes to stdout (not stderr) - CLAUDE.md is ~55 lines (not ~40) - Sudo restricted to init-firewall.sh script (not individual commands) - Firewall uses aggregate tool for CIDR consolidation (not ipset) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 864c4f6 commit 53ef788

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

docs/ARCHITECTURE_GUIDE.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ These run **before** Claude executes a command or file edit. They can block the
9090

9191
1. **Destructive commands** (23 literal patterns): `rm -rf /`, `sudo rm -rf`, `dd if=/dev/zero`, fork bombs, `chmod -R 777 /`, `shutdown`, `reboot`, `halt`, `poweroff`, `git push --force`, `git push -f`, `git push origin +master`, `git push origin +main`, `DROP DATABASE`, `DROP TABLE`, `TRUNCATE TABLE`
9292
2. **Filesystem format** (regex): `mkfs.*`, `DELETE FROM .* WHERE 1`
93-
3. **Secrets in commands** (13 literal + 1 regex): any command containing `ANTHROPIC_API_KEY=`, `OPENAI_API_KEY=`, `AWS_SECRET_ACCESS_KEY=`, `password=`, `token=`, or database URLs with embedded credentials
93+
3. **Secrets in commands** (9 literal + 1 regex): any command containing `ANTHROPIC_API_KEY=`, `OPENAI_API_KEY=`, `AWS_SECRET_ACCESS_KEY=`, `GITHUB_TOKEN=`, `GH_TOKEN=`, `password=`, `passwd=`, `secret=`, `token=`, or database URLs with embedded credentials
9494

95-
Uses `grep -qiF` (case-insensitive, literal) for exact patterns and `grep -qiE` for regex. Returns a JSON decision object to stderr with exit code 2 to block.
95+
Uses `grep -qiF` (case-insensitive, literal) for exact patterns and `grep -qiE` for regex. Returns a JSON decision object to stdout with exit code 2 to block.
9696

9797
**What happens if you remove it.** No pre-execution safety net. A command like `git push --force origin main` would execute if it passes the settings.json permissions. The devcontainer policy blocker (if present) covers some patterns but not all.
9898

@@ -244,7 +244,7 @@ These layers only apply when running inside the devcontainer. They are optional
244244
- GitHub IPs (fetched dynamically from GitHub's API, aggregated into CIDR ranges via `ipset`)
245245
- Specific domains: PyPI (`pypi.org`, `files.pythonhosted.org`), Astral (`astral.sh`), Claude/Anthropic (`claude.ai`, `api.anthropic.com`, `sentry.io`, `statsig.com`), VS Code marketplace
246246

247-
Uses `ipset` with `hash:net` for efficient CIDR-based filtering instead of per-IP iptables rules. IPv6 is completely blocked. Self-tests at the end by verifying `example.com` is unreachable and `api.github.com` is reachable.
247+
GitHub CIDR ranges are aggregated using the `aggregate` tool, then stored in `ipset` with `hash:net` for efficient filtering instead of per-IP iptables rules. IPv6 is completely blocked. Self-tests at the end by verifying `example.com` is unreachable and `api.github.com` is reachable.
248248

249249
**What happens if you remove it.** The container has unrestricted network access. Claude Code could download arbitrary packages from any host, which is a supply-chain attack vector.
250250

@@ -289,7 +289,7 @@ Uses `ipset` with `hash:net` for efficient CIDR-based filtering instead of per-I
289289

290290
**Why it exists.** Principle of least privilege. A root user inside the container could modify system files, install packages at the OS level, and potentially escape the container in some Docker configurations.
291291

292-
**What it does.** The Dockerfile creates a `vscode` user (uid 1000) and runs all commands as that user. Sudo is restricted to firewall-related commands only (`iptables`, `ipset`, `ip6tables`).
292+
**What it does.** The Dockerfile creates a `vscode` user (uid 1000) and runs all commands as that user. Sudo is restricted to a single script: `/usr/local/bin/init-firewall.sh`. The user cannot run `sudo iptables` directly.
293293

294294
**What happens if you remove it.** Claude Code runs as root inside the container. Combined with removed firewall/policy hooks, this means unrestricted system access within the container.
295295

@@ -336,9 +336,9 @@ These run automatically as part of `/done` for Standard and Project scope tasks.
336336

337337
**Why.** Verifies tests pass and checks coverage. Uses Sonnet because it needs to reason about test adequacy, not just run commands.
338338

339-
**What.** Runs `pytest` with coverage flags. Analyzes results and can add missing test cases (`permissionMode: acceptEdits`).
339+
**What.** Runs `pytest` with coverage flags. Analyzes results and reports findings. Read-only (`permissionMode: dontAsk` -- no Edit tool).
340340

341-
**Remove.** Tests are not validated before PR creation. CI still runs them, but you lose the pre-commit coverage check and auto-fix capability.
341+
**Remove.** Tests are not validated before PR creation. CI still runs them, but you lose the pre-commit coverage check.
342342

343343
</details>
344344

@@ -401,7 +401,7 @@ These are invoked manually, not by `/done`. They have no workflow dependencies.
401401
|-------|---------|------|
402402
| security-auditor | OWASP-based vulnerability scan | plan (read-only) |
403403
| refactoring-specialist | SOLID/code smell analysis | plan (read-only) |
404-
| review-responder | Triage automated PR review comments | dontAsk |
404+
| review-responder | Triage and fix automated PR review comments | acceptEdits |
405405
| output-evaluator | LLM-as-Judge quality scoring | dontAsk |
406406
| agent-auditor | Audit agent definitions against best practices | plan (read-only) |
407407

@@ -521,7 +521,7 @@ An example file is provided at `.claude/settings.local.json.example`.
521521

522522
Location: project root
523523

524-
The main agent directives file. Deliberately compact (~40 lines). Contains:
524+
The main agent directives file. Deliberately compact (~55 lines). Contains:
525525
- Development process reference (which skills to use)
526526
- Security rules (what to avoid)
527527
- Development commands (how to run tests, lint, format)

0 commit comments

Comments
 (0)