Skip to content

Commit 7e7dfee

Browse files
committed
fix: address v11 Copilot review comments
- testing.md: Add import requirements to code examples - testing.md: Fix safe_read_file docstring for accuracy - security.md: Soften Pydantic requirement to typed validators - security.md: Clarify exception swallowing allows documented helpers - rigor.md: Fix task-<task-id> to <task-id> to avoid duplication Signed-off-by: jason poley <jason.poley@gmail.com>
1 parent 119ce31 commit 7e7dfee

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

.claude/rules/rigor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Configure in `.flowspec/rigor-config.yml` (optional, created per-project) or acc
5454
backlog task edit <task-id> --plan $'1. Research\n2. Implement\n3. Test'
5555

5656
# EXEC-001: Git worktree required
57-
BRANCH="$(hostname -s | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]/-/g')/task-<task-id>/slug"
57+
BRANCH="$(hostname -s | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]/-/g')/<task-id>/slug"
5858
git worktree add "../$(basename "$BRANCH")" "$BRANCH"
5959

6060
# EXEC-003: Decision logging required

.claude/rules/security.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Use environment variables or secret managers instead.
1515
## Input Validation
1616

1717
- Validate all external inputs at boundaries
18-
- Use Pydantic models for request validation
18+
- Use typed validators (Pydantic, dataclasses, or similar)
1919
- Never trust user input
2020

2121
```python
22-
# Good: Use typed validators
22+
# Good: Use typed validators (Pydantic example)
2323
from pydantic import BaseModel, EmailStr, Field
2424

2525
class UserCreate(BaseModel):
@@ -56,7 +56,7 @@ When writing heuristic classifiers or security scanners:
5656

5757
- Log exceptions with context using `logger.warning()` or `logger.error()`
5858
- Include relevant data (truncated to reasonable size)
59-
- Never silently swallow exceptions
59+
- Avoid silent swallowing (exception: documented helpers like `safe_read_file`)
6060

6161
```python
6262
# Good: Log exceptions (requires: import httpx, logging; logger = logging.getLogger(__name__))

.claude/rules/testing.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Every API function needs tests for:
4444
Every test that reads files MUST include:
4545

4646
```python
47+
# Requires: from pathlib import Path
4748
def get_project_root() -> Path:
4849
"""Get the project root directory reliably."""
4950
return Path(__file__).resolve().parent.parent
@@ -54,8 +55,9 @@ Never use relative paths like `Path(".claude/agents/...")`.
5455
## Safe File Reading
5556

5657
```python
58+
# Requires: from pathlib import Path; from typing import Optional
5759
def safe_read_file(file_path: Path) -> Optional[str]:
58-
"""Safely read a file, returning None if it doesn't exist."""
60+
"""Safely read file, returning None on missing/error."""
5961
try:
6062
if file_path.exists() and file_path.is_file():
6163
return file_path.read_text(encoding="utf-8")

0 commit comments

Comments
 (0)