Skip to content

Commit 92760b6

Browse files
committed
refactor: rename verify_authors.py to verify_registry.py and expand validation
Add path existence verification to the registry validation script. Add command-line interface to run specific validations. Update registry.yaml paths to match actual directory structure.
1 parent 3adcaef commit 92760b6

File tree

3 files changed

+100
-38
lines changed

3 files changed

+100
-38
lines changed

.github/scripts/verify_authors.py renamed to .github/scripts/verify_registry.py

Lines changed: 95 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
1. GitHub handles exist
55
2. Website and avatar URLs are valid
66
3. All registry.yaml authors are defined in authors.yaml
7+
4. All registry.yaml paths exist
8+
9+
Usage:
10+
python verify_registry.py [command]
11+
12+
Commands:
13+
all Run all verifications (default)
14+
authors Verify GitHub handles and author URLs only
15+
paths Verify registry paths only
16+
registry Verify registry authors exist in authors.yaml
717
"""
818

919
import yaml
@@ -40,22 +50,12 @@ def check_url(url):
4050
return False, str(e)
4151

4252

43-
def main():
44-
# Load YAML files
45-
authors_path = Path(__file__).parent.parent.parent / "authors.yaml"
46-
registry_path = Path(__file__).parent.parent.parent / "registry.yaml"
47-
48-
with open(authors_path, 'r') as f:
49-
authors = yaml.safe_load(f)
50-
51-
with open(registry_path, 'r') as f:
52-
registry = yaml.safe_load(f)
53-
53+
def verify_authors(authors):
54+
"""Verify GitHub handles and author URLs."""
5455
failed_handles = []
5556
failed_urls = []
56-
missing_authors = []
5757

58-
# Step 1: Verify GitHub handles
58+
# Verify GitHub handles
5959
print("=== Verifying GitHub Handles ===\n")
6060
for username in authors.keys():
6161
print(f"Checking GitHub handle: {username}...")
@@ -66,7 +66,7 @@ def main():
6666
else:
6767
print(f" ✓ OK")
6868

69-
# Step 2: Verify URLs
69+
# Verify URLs
7070
print("\n=== Verifying Author URLs ===\n")
7171
for username, details in authors.items():
7272
print(f"Checking URLs for {username}...")
@@ -95,7 +95,13 @@ def main():
9595
else:
9696
print(f" ✓ Avatar URL OK: {url}")
9797

98-
# Step 3: Verify registry authors exist in authors.yaml
98+
return failed_handles, failed_urls
99+
100+
101+
def verify_registry_authors(registry, authors):
102+
"""Verify registry authors exist in authors.yaml."""
103+
missing_authors = []
104+
99105
print("\n=== Verifying Registry Authors ===\n")
100106
registry_authors = set()
101107
for entry in registry:
@@ -112,6 +118,74 @@ def main():
112118
else:
113119
print(f" ✓ {author}")
114120

121+
return missing_authors
122+
123+
124+
def verify_paths(registry, repo_root):
125+
"""Verify registry paths exist."""
126+
missing_paths = []
127+
128+
print("\n=== Verifying Registry Paths ===\n")
129+
print(f"Found {len(registry)} cookbooks in registry.yaml")
130+
131+
for entry in registry:
132+
if 'path' in entry:
133+
path = entry['path']
134+
full_path = repo_root / path
135+
title = entry.get('title', 'Unknown')
136+
137+
if not full_path.exists():
138+
missing_paths.append(f"{path} (title: {title})")
139+
print(f" ❌ Path not found: {path}")
140+
else:
141+
print(f" ✓ {path}")
142+
else:
143+
missing_paths.append(f"Entry missing 'path' field (title: {entry.get('title', 'Unknown')})")
144+
print(f" ❌ Entry missing 'path' field: {entry.get('title', 'Unknown')}")
145+
146+
return missing_paths
147+
148+
149+
def main():
150+
# Parse command line argument
151+
command = sys.argv[1] if len(sys.argv) > 1 else "all"
152+
153+
if command not in ["all", "authors", "paths", "registry"]:
154+
print(f"Unknown command: {command}")
155+
print(__doc__)
156+
sys.exit(1)
157+
158+
# Load YAML files
159+
repo_root = Path(__file__).parent.parent.parent
160+
authors_path = repo_root / "authors.yaml"
161+
registry_path = repo_root / "registry.yaml"
162+
163+
authors = None
164+
registry = None
165+
166+
if command in ["all", "authors", "registry"]:
167+
with open(authors_path, 'r') as f:
168+
authors = yaml.safe_load(f)
169+
170+
if command in ["all", "paths", "registry"]:
171+
with open(registry_path, 'r') as f:
172+
registry = yaml.safe_load(f)
173+
174+
# Run verifications based on command
175+
failed_handles = []
176+
failed_urls = []
177+
missing_authors = []
178+
missing_paths = []
179+
180+
if command in ["all", "authors"]:
181+
failed_handles, failed_urls = verify_authors(authors)
182+
183+
if command in ["all", "registry"]:
184+
missing_authors = verify_registry_authors(registry, authors)
185+
186+
if command in ["all", "paths"]:
187+
missing_paths = verify_paths(registry, repo_root)
188+
115189
# Report results
116190
has_failures = False
117191

@@ -133,6 +207,12 @@ def main():
133207
print(f" - {author}")
134208
has_failures = True
135209

210+
if missing_paths:
211+
print("\n❌ The following paths in registry.yaml do not exist:")
212+
for path in missing_paths:
213+
print(f" - {path}")
214+
has_failures = True
215+
136216
if has_failures:
137217
sys.exit(1)
138218
else:

.github/workflows/verify-authors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
3131
- name: Verify authors and registry
3232
run: |
33-
python .github/scripts/verify_authors.py
33+
python .github/scripts/verify_registry.py

registry.yaml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
- title: 00 - The One-Liner Research Agent
5757
description: Build a research agent using Claude Code SDK with WebSearch for autonomous
5858
research.
59-
path: claude_code_sdk/00_The_one_liner_research_agent.ipynb
59+
path: claude_agent_sdk/00_The_one_liner_research_agent.ipynb
6060
authors:
6161
- JiriDeJonghe
6262
date: '2025-09-12'
@@ -65,7 +65,7 @@
6565
- title: 01 - The Chief of Staff Agent
6666
description: Build multi-agent systems with subagents, hooks, output styles, and
6767
plan mode features.
68-
path: claude_code_sdk/01_The_chief_of_staff_agent.ipynb
68+
path: claude_agent_sdk/01_The_chief_of_staff_agent.ipynb
6969
authors:
7070
- JiriDeJonghe
7171
date: '2025-09-12'
@@ -74,7 +74,7 @@
7474
- title: 02 - The Observability Agent
7575
description: Connect agents to external systems via MCP servers for GitHub monitoring
7676
and CI workflows.
77-
path: claude_code_sdk/02_The_observability_agent.ipynb
77+
path: claude_agent_sdk/02_The_observability_agent.ipynb
7878
authors:
7979
- JiriDeJonghe
8080
date: '2025-09-12'
@@ -161,24 +161,6 @@
161161
date: '2024-03-03'
162162
categories:
163163
- RAG & Retrieval
164-
- title: Illustrated Responses with Claude
165-
description: Create Claude responses illustrated with images using Stable Diffusion
166-
API tool integration.
167-
path: misc/illustrated_responses.ipynb
168-
authors:
169-
- alexalbertt
170-
date: '2024-03-03'
171-
categories:
172-
- Responses
173-
- title: Experimentally Testing Claude's Long-Context QA Abilities
174-
description: Legacy notebook testing Claude 2's long-context question answering
175-
performance and evaluation methods.
176-
path: misc/mc_qa.ipynb
177-
authors:
178-
- Anthropic
179-
date: '2023-08-15'
180-
categories:
181-
- RAG & Retrieval
182164
- title: Metaprompt
183165
description: Prompt engineering tool that generates starting prompts for your tasks
184166
to solve blank-page problem.
@@ -506,7 +488,7 @@
506488
- title: Parallel tool calls on Claude 3.7 Sonnet
507489
description: Enable parallel tool calls on Claude 3.7 Sonnet using batch tool meta-pattern
508490
workaround.
509-
path: tool_use/parallel_tools_claude_3_7_sonnet.ipynb
491+
path: tool_use/parallel_tools.ipynb
510492
authors:
511493
- Anthropic
512494
date: '2025-03-05'

0 commit comments

Comments
 (0)