Skip to content

Commit de7eaea

Browse files
GeneAIclaude
authored andcommitted
chore: Apply pre-commit hook auto-fixes
Applied automatic formatting fixes from pre-commit hooks: - isort: Import sorting for wizard files - end-of-file-fixer: Fixed EOF for security audit files Files updated: - 8 wizard files (healthcare plugins) - 4 test files (coach_wizards, software_cli) - 3 example files (level_5_transformative) - 2 security audit JSON files These are formatting-only changes from the previous commit's pre-commit hook auto-corrections. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d89b3bc commit de7eaea

15 files changed

+228
-140
lines changed

examples/level_5_transformative/data/deployment_pipeline.py

Lines changed: 26 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,17 @@ def deploy_to_staging(self, build_artifacts: dict):
3636
print(f"Build artifacts: {list(build_artifacts.keys())}")
3737

3838
# Deploy to staging
39-
self.deployment_log.append({
40-
'environment': 'staging',
41-
'version': self.version,
42-
'status': 'deployed'
43-
})
39+
self.deployment_log.append(
40+
{"environment": "staging", "version": self.version, "status": "deployed"}
41+
)
4442

4543
# PROBLEM: No verification that:
4644
# - All environment variables are set correctly
4745
# - Database migrations completed successfully
4846
# - Feature flags are configured
4947
# - Monitoring is in place
5048

51-
print(f"✓ Deployed to staging (but was everything verified?)")
49+
print("✓ Deployed to staging (but was everything verified?)")
5250
return True
5351

5452
def promote_to_production(self, staging_checks: dict = None):
@@ -78,13 +76,11 @@ def promote_to_production(self, staging_checks: dict = None):
7876
# Missing: Confirmation of monitoring/alerting setup
7977
# Missing: Explicit acknowledgment from on-call team
8078

81-
self.deployment_log.append({
82-
'environment': 'production',
83-
'version': self.version,
84-
'status': 'deployed'
85-
})
79+
self.deployment_log.append(
80+
{"environment": "production", "version": self.version, "status": "deployed"}
81+
)
8682

87-
print(f"✓ Deployed to production")
83+
print("✓ Deployed to production")
8884
return True # But is it SAFE?
8985

9086

@@ -94,16 +90,13 @@ def deploy_feature_release(app_config: dict):
9490
9591
PATTERN: Same information loss during handoffs as healthcare!
9692
"""
97-
pipeline = DeploymentPipeline(
98-
app_name=app_config['name'],
99-
version=app_config['version']
100-
)
93+
pipeline = DeploymentPipeline(app_name=app_config["name"], version=app_config["version"])
10194

10295
# Dev → Staging handoff
10396
build_artifacts = {
104-
'docker_image': f"{app_config['name']}:{app_config['version']}",
105-
'config_files': ['app.yml', 'secrets.yml'],
106-
'migrations': ['20250101_add_user_table.sql']
97+
"docker_image": f"{app_config['name']}:{app_config['version']}",
98+
"config_files": ["app.yml", "secrets.yml"],
99+
"migrations": ["20250101_add_user_table.sql"],
107100
}
108101

109102
# HANDOFF #1: Dev team → Staging team
@@ -119,8 +112,8 @@ def deploy_feature_release(app_config: dict):
119112

120113
# Quick "checks" (not comprehensive!)
121114
staging_checks = {
122-
'passed': True, # But what was actually checked?
123-
'smoke_tests': 'passed',
115+
"passed": True, # But what was actually checked?
116+
"smoke_tests": "passed",
124117
# Missing: Environment variable verification
125118
# Missing: Database migration verification
126119
# Missing: Rollback plan review
@@ -149,17 +142,14 @@ def emergency_hotfix_deployment(issue_description: str):
149142
EXACTLY like emergency patient handoffs!
150143
Time pressure = shortcuts = information loss
151144
"""
152-
print(f"\n=== EMERGENCY HOTFIX ===")
145+
print("\n=== EMERGENCY HOTFIX ===")
153146
print(f"Issue: {issue_description}")
154147
print()
155148

156149
# Under pressure, skip verification steps
157150
# Sound familiar from healthcare handoffs?
158151

159-
pipeline = DeploymentPipeline(
160-
app_name="critical-service",
161-
version="1.2.1-hotfix"
162-
)
152+
pipeline = DeploymentPipeline(app_name="critical-service", version="1.2.1-hotfix")
163153

164154
# PROBLEM: Time pressure leads to skipping checklist
165155
# PROBLEM: Verbal-only communication with on-call team
@@ -187,16 +177,16 @@ def emergency_hotfix_deployment(issue_description: str):
187177

188178
# Normal deployment with handoff gaps
189179
app_config = {
190-
'name': 'user-service',
191-
'version': '2.5.0',
192-
'features': ['new-authentication', 'password-reset'],
193-
'dependencies': ['postgres-14', 'redis-7'],
194-
'environment_vars': {
195-
'DATABASE_URL': 'postgres://prod-db:5432/users',
196-
'REDIS_URL': 'redis://prod-cache:6379',
197-
'JWT_SECRET': '[REDACTED]', # Critical! Was this communicated?
198-
'FEATURE_FLAG_NEW_AUTH': 'true' # Critical! Verified?
199-
}
180+
"name": "user-service",
181+
"version": "2.5.0",
182+
"features": ["new-authentication", "password-reset"],
183+
"dependencies": ["postgres-14", "redis-7"],
184+
"environment_vars": {
185+
"DATABASE_URL": "postgres://prod-db:5432/users",
186+
"REDIS_URL": "redis://prod-cache:6379",
187+
"JWT_SECRET": "[REDACTED]", # Critical! Was this communicated?
188+
"FEATURE_FLAG_NEW_AUTH": "true", # Critical! Verified?
189+
},
200190
}
201191

202192
deploy_feature_release(app_config)

examples/level_5_transformative/data/healthcare_handoff_code.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def perform_handoff(self, patient_data: dict):
3333
CRITICAL GAP #3: No checklist to ensure all critical info transferred
3434
"""
3535
import time
36+
3637
self.handoff_time = time.time()
3738

3839
# Verbal handoff (information loss likely!)
@@ -43,12 +44,12 @@ def perform_handoff(self, patient_data: dict):
4344
# PROBLEM: No verification of medication changes!
4445
# PROBLEM: No explicit sign-off that handoff is complete!
4546

46-
if patient_data.get('allergies'):
47+
if patient_data.get("allergies"):
4748
print(f"Allergies: {patient_data['allergies']}")
4849
# But what if the receiving nurse wasn't listening?
4950
# What if they assumed no allergies because it wasn't mentioned clearly?
5051

51-
if patient_data.get('medications'):
52+
if patient_data.get("medications"):
5253
print(f"Medications: {patient_data['medications']}")
5354
# Again, no verification!
5455

@@ -67,9 +68,7 @@ def shift_change_handoff(outgoing_patients: list, incoming_nurse: str):
6768
for patient in outgoing_patients:
6869
# Quick verbal handoff under time pressure
6970
handoff = PatientHandoff(
70-
patient_id=patient['id'],
71-
from_nurse=patient['current_nurse'],
72-
to_nurse=incoming_nurse
71+
patient_id=patient["id"], from_nurse=patient["current_nurse"], to_nurse=incoming_nurse
7372
)
7473

7574
# CRITICAL VULNERABILITY: No verification loop
@@ -113,21 +112,21 @@ def patient_transfer_to_icu(patient_data: dict):
113112
# Shift change scenario
114113
patients_to_handoff = [
115114
{
116-
'id': 'P12345',
117-
'diagnosis': 'Pneumonia',
118-
'current_nurse': 'Alice',
119-
'allergies': ['Penicillin', 'Latex'], # CRITICAL!
120-
'medications': ['Azithromycin 500mg'],
121-
'vitals': {'bp': '120/80', 'hr': 72}
115+
"id": "P12345",
116+
"diagnosis": "Pneumonia",
117+
"current_nurse": "Alice",
118+
"allergies": ["Penicillin", "Latex"], # CRITICAL!
119+
"medications": ["Azithromycin 500mg"],
120+
"vitals": {"bp": "120/80", "hr": 72},
122121
},
123122
{
124-
'id': 'P67890',
125-
'diagnosis': 'Post-surgical recovery',
126-
'current_nurse': 'Alice',
127-
'allergies': None, # But was this communicated clearly?
128-
'medications': ['Morphine 2mg PRN', 'Heparin'],
129-
'vitals': {'bp': '110/70', 'hr': 68}
130-
}
123+
"id": "P67890",
124+
"diagnosis": "Post-surgical recovery",
125+
"current_nurse": "Alice",
126+
"allergies": None, # But was this communicated clearly?
127+
"medications": ["Morphine 2mg PRN", "Heparin"],
128+
"vitals": {"bp": "110/70", "hr": 68},
129+
},
131130
]
132131

133132
print("=== SHIFT CHANGE HANDOFF ===")

examples/level_5_transformative/run_full_demo.py

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
Licensed under Fair Source 0.9 (converts to Apache 2.0 on January 1, 2029)
1616
"""
1717

18-
import os
1918
import sys
2019
from datetime import datetime, timedelta
2120
from pathlib import Path
@@ -26,7 +25,7 @@
2625

2726
# Import Coach Wizards
2827
try:
29-
from coach_wizards import ComplianceWizard, CICDWizard
28+
from coach_wizards import CICDWizard, ComplianceWizard
3029
from coach_wizards.base_wizard import WizardIssue, WizardPrediction
3130
except ImportError:
3231
print("ERROR: Could not import coach_wizards")
@@ -54,7 +53,7 @@ def store_pattern(self, domain: str, pattern_type: str, details: dict):
5453
"pattern_type": pattern_type,
5554
"details": details,
5655
"stored_at": datetime.now(),
57-
"confidence": details.get("confidence", 0.9)
56+
"confidence": details.get("confidence", 0.9),
5857
}
5958
self.patterns.append(pattern)
6059
return pattern
@@ -106,7 +105,7 @@ def analyze_healthcare_handoff(memory: PatternMemory):
106105
with open(healthcare_file) as f:
107106
healthcare_code = f.read()
108107

109-
print_info(f"Analyzing healthcare handoff protocol...")
108+
print_info("Analyzing healthcare handoff protocol...")
110109
print_info(f"File: {healthcare_file.name}")
111110
print()
112111

@@ -123,7 +122,7 @@ def analyze_healthcare_handoff(memory: PatternMemory):
123122
code_snippet="handoff.perform_handoff(patient)",
124123
fix_suggestion="Implement standardized checklist with read-back verification",
125124
category="Compliance",
126-
confidence=0.95
125+
confidence=0.95,
127126
),
128127
WizardIssue(
129128
severity="warning",
@@ -133,7 +132,7 @@ def analyze_healthcare_handoff(memory: PatternMemory):
133132
code_snippet="print(f'Patient {self.patient_id}')",
134133
fix_suggestion="Add written verification step",
135134
category="Compliance",
136-
confidence=0.88
135+
confidence=0.88,
137136
),
138137
]
139138

@@ -154,23 +153,23 @@ def analyze_healthcare_handoff(memory: PatternMemory):
154153
"no_verification_checklist",
155154
"verbal_only_communication",
156155
"time_pressure",
157-
"assumptions_about_receiving_party"
156+
"assumptions_about_receiving_party",
158157
],
159158
"failure_rate": 0.23, # 23% without verification steps
160159
"solution": "Explicit verification steps with read-back confirmation",
161160
"confidence": 0.95,
162-
"evidence": "Healthcare studies show 23% of handoffs fail without checklists"
161+
"evidence": "Healthcare studies show 23% of handoffs fail without checklists",
163162
}
164163

165164
# Store in memory (simulating MemDocs)
166165
memory.store_pattern(
167-
domain="healthcare",
168-
pattern_type="handoff_failure",
169-
details=handoff_pattern
166+
domain="healthcare", pattern_type="handoff_failure", details=handoff_pattern
170167
)
171168

172169
print_success("Pattern 'critical_handoff_failure' stored in memory")
173-
print_info(f"Key finding: Handoffs without verification fail {handoff_pattern['failure_rate']:.0%} of the time")
170+
print_info(
171+
f"Key finding: Handoffs without verification fail {handoff_pattern['failure_rate']:.0%} of the time"
172+
)
174173
print()
175174

176175
print("Pattern Details:")
@@ -208,16 +207,13 @@ def analyze_deployment_pipeline(memory: PatternMemory, healthcare_pattern: dict)
208207
print_header("CROSS-DOMAIN PATTERN DETECTION", "-")
209208

210209
# Retrieve healthcare pattern
211-
patterns = memory.retrieve_cross_domain(
212-
current_domain="software",
213-
looking_for="handoff"
214-
)
210+
patterns = memory.retrieve_cross_domain(current_domain="software", looking_for="handoff")
215211

216212
if patterns:
217213
healthcare_match = patterns[0]
218-
print_success(f"Pattern match found from healthcare domain!")
214+
print_success("Pattern match found from healthcare domain!")
219215
print()
220-
print(f" Source Domain: healthcare")
216+
print(" Source Domain: healthcare")
221217
print(f" Pattern: {healthcare_match['details']['pattern_name']}")
222218
print(f" Description: {healthcare_match['details']['description']}")
223219
print(f" Healthcare failure rate: {healthcare_match['details']['failure_rate']:.0%}")
@@ -232,7 +228,7 @@ def analyze_deployment_pipeline(memory: PatternMemory, healthcare_pattern: dict)
232228
"✗ Staging→Production handoff lacks explicit sign-off",
233229
"✗ Assumptions about production team's knowledge",
234230
"✗ Verbal/Slack-only communication",
235-
"✗ Time pressure during deployments"
231+
"✗ Time pressure during deployments",
236232
]
237233

238234
print("Deployment Handoff Gaps:")
@@ -256,7 +252,7 @@ def analyze_deployment_pipeline(memory: PatternMemory, healthcare_pattern: dict)
256252
"2. Require explicit sign-off between staging and production",
257253
"3. Implement automated handoff verification",
258254
"4. Add read-back confirmation for critical environment variables",
259-
"5. Document rollback procedure as part of handoff"
255+
"5. Document rollback procedure as part of handoff",
260256
],
261257
reasoning=(
262258
"Cross-domain pattern match: Healthcare analysis found that handoffs "
@@ -267,7 +263,7 @@ def analyze_deployment_pipeline(memory: PatternMemory, healthcare_pattern: dict)
267263
" • Time pressure leading to shortcuts\n"
268264
" • Verbal-only communication\n\n"
269265
"Based on healthcare pattern, predicted failure in 30-45 days."
270-
)
266+
),
271267
)
272268

273269
print_alert("DEPLOYMENT HANDOFF FAILURE PREDICTED")
@@ -358,5 +354,6 @@ def main():
358354
except Exception as e:
359355
print(f"\n\nERROR: {e}")
360356
import traceback
357+
361358
traceback.print_exc()
362359
sys.exit(1)

security_audit.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,4 +1005,4 @@
10051005
}
10061006
},
10071007
"results": []
1008-
}
1008+
}

security_scan_results.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,4 +1122,4 @@
11221122
}
11231123
},
11241124
"results": []
1125-
}
1125+
}

0 commit comments

Comments
 (0)